From owner-freebsd-current@FreeBSD.ORG Thu Sep 30 12:10:39 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 E819416A4CE for ; Thu, 30 Sep 2004 12:10:39 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7187443D1F for ; Thu, 30 Sep 2004 12:10:39 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CCzlb-0000Lv-Hk; Thu, 30 Sep 2004 13:10:35 +0100 Date: Thu, 30 Sep 2004 13:10:35 +0100 From: Ceri Davies To: S?awek ?ak Message-ID: <20040930121035.GR2493@submonkey.net> Mail-Followup-To: Ceri Davies , S?awek ?ak , Ryan Sommers , freebsd-current@freebsd.org References: <861xgm5ltz.fsf@thirst.unx.era.pl> <20040928194853.GT2493@submonkey.net> <86k6ud2t6t.fsf@thirst.unx.era.pl> <20040929131136.GA2493@submonkey.net> <415AB9BF.1070003@gamersimpact.com> <86is9wx8qp.fsf@thirst.unx.era.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9B5XEHKwA0ZzBbnj" Content-Disposition: inline In-Reply-To: <86is9wx8qp.fsf@thirst.unx.era.pl> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: Ryan Sommers cc: freebsd-current@freebsd.org Subject: Re: Bug in #! processing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list 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 12:10:40 -0000 --9B5XEHKwA0ZzBbnj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2004 at 02:05:18PM +0200, S?awek ?ak wrote: > Ryan Sommers writes: >=20 > > Ceri Davies wrote: > > > >> That seems wrong too. #! shouldn't be magic anywhere other than at the > >> > >>beginning of a file. > >> > >> > > I haven't looked at the code yet, on my list, but I'm guessing this was= done to > > avoid a possible circular reference. >=20 > What circular reference? Could you elaborate? The algorithm goes like= this: >=20 > 1. skip all space till #! > 2. skip #! and read path for the interpreter > 3. find and split arguments > 4. invoke intepreter with it's path at argv[0], arguments at subseque= nt > positions and append path to the script at the end. >=20 > That's it, modulo : and no interpreter path at all in the script as l= egacy > which is a special case anyway. #1 in your list doesn't happen. Ceri --=20 It is not tinfoil, it is my new skin. I am a robot. --9B5XEHKwA0ZzBbnj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBW/e7ocfcwTS3JF8RAgxGAJ9NAMAO78avvsckpnXsd2f5o4akhACgq3qm fJPyP+0Dl+ziOwCCPhY50Ow= =4yof -----END PGP SIGNATURE----- --9B5XEHKwA0ZzBbnj--