Date: Thu, 30 Sep 2004 13:10:35 +0100 From: Ceri Davies <ceri@submonkey.net> To: S?awek ?ak <zaks@prioris.mini.pw.edu.pl> Cc: freebsd-current@freebsd.org Subject: Re: Bug in #! processing Message-ID: <20040930121035.GR2493@submonkey.net> In-Reply-To: <86is9wx8qp.fsf@thirst.unx.era.pl> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Thu, Sep 30, 2004 at 02:05:18PM +0200, S?awek ?ak wrote: > Ryan Sommers <ryans@gamersimpact.com> writes: > > > 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. > > What circular reference? Could you elaborate? The algorithm goes like this: > > 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 subsequent > positions and append path to the script at the end. > > That's it, modulo : and no interpreter path at all in the script as legacy > which is a special case anyway. #1 in your list doesn't happen. Ceri -- It is not tinfoil, it is my new skin. I am a robot. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBW/e7ocfcwTS3JF8RAgxGAJ9NAMAO78avvsckpnXsd2f5o4akhACgq3qm fJPyP+0Dl+ziOwCCPhY50Ow= =4yof -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040930121035.GR2493>
