From owner-freebsd-current@FreeBSD.ORG Thu Sep 30 14:45:48 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5B4716A4CE for ; Thu, 30 Sep 2004 14:45:48 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C68043D2D for ; Thu, 30 Sep 2004 14:45:48 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: by mproxy.gmail.com with SMTP id 79so3548843rnk for ; Thu, 30 Sep 2004 07:45:30 -0700 (PDT) Received: by 10.38.77.56 with SMTP id z56mr3257455rna; Thu, 30 Sep 2004 07:45:27 -0700 (PDT) Received: by 10.38.75.49 with HTTP; Thu, 30 Sep 2004 07:45:27 -0700 (PDT) Message-ID: <790a9fff04093007451fdb0f7f@mail.gmail.com> Date: Thu, 30 Sep 2004 09:45:27 -0500 From: Scot Hetzel To: Ceri Davies , S?awek ?ak , freebsd-current@freebsd.org In-Reply-To: <20040930122154.GS2493@submonkey.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <861xgm5ltz.fsf@thirst.unx.era.pl> <20040928194853.GT2493@submonkey.net> <86k6ud2t6t.fsf@thirst.unx.era.pl> <20040929131136.GA2493@submonkey.net> <86mzz8x8zv.fsf@thirst.unx.era.pl> <20040930122154.GS2493@submonkey.net> Subject: Re: Bug in #! processing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Scot Hetzel List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2004 14:45:48 -0000 On Thu, 30 Sep 2004 13:21:54 +0100, Ceri Davies wrote: > I agree(ish); I don't think that the kernel should do anything special > here either and I think that the "correct" thing to do would be to back > out that revision. Unfortunately the FreeBSD userbase can write a lot > of scripts in 4 and a half years and we probably can't get away with it. > Perhaps it could be done in -CURRENT, but I'd really like to see some > other opinions. For clarity, what I'm proposing is the application of > the attached diff. Opinions from anyone? > Instead of backing out that revision, change the test for # to include a check for white space before it, this way those who have used the # character as a comment on the first line won't have to change any thing. - for (ihp = &image_header[2]; *ihp != '\n' && *ihp != '#'; ++ihp) { + for (ihp = &image_header[2]; *ihp != '\n' && ! (*ihp-1 == '[white space]' && *ihp == '#'); ++ihp) { where [white space] could be either a tab or a space character. or just check if a dash is before #. + for (ihp = &image_header[2]; *ihp != '\n' && ! (*ihp-1 == '-' && *ihp == '#'); ++ihp) { Scot Discaimer: the code may not work as written adjust to your liking.