Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3E1B35F9.DC4EA825@phekda.freeserve.co.uk> Date: Tue, 07 Jan 2003 20:18:01 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: m4 port: return program name as 'm4' not '/some/path/m4.exe' [PATCH] References: <003801c2b559$f33a0d60$0100a8c0 AT acp42g> <3E19BEAE DOT 7CC5B46C AT phekda DOT freeserve DOT co DOT uk> <200301061840 DOT h06IebI26175 AT envy DOT delorie DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. DJ Delorie wrote: > Note that for maximum unix compatibility, we should probably do this: > > In the crt0 code, compare the path to our executable to the $PATH. If > we were found in some directory already on the $PATH, omit the > directory and leave the basename. If we were not found on the $PATH, > leave the full path alone. With or without the '.exe'? > Another thing we might consider is to remove the drive specifier if it > happens to be the current drive. For many cases, this will make it > look unix-like enough to work with dos-unaware programs. Why not just munge it from say c:/ to /dev/c/? That makes it Unixy enough and doesn't involve information loss. I suppose there could be two styles of munging: * just return the stem without extension - Unix-style; * return a path converted to /dev-style - Unix-friendly. Should either of these argv[0] mungings be on by default? Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]