Date: Thu, 15 Jan 1998 13:05:46 +0200 (IST) From: Eli Zaretskii To: Robert Hoehne cc: djgpp-workers AT delorie DOT com Subject: Re: spawn() problem In-Reply-To: <34BD2B38.8F094DF5@gmx.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 14 Jan 1998, Robert Hoehne wrote: > Is it a bug or a feature of the spawn... functions, that > the called DJGPP program ignores the argv0 value of the > stub? (when spawn.. is called directly and not through > system() )? I think `system' should have the same behavior, since it really calls `spawn' internally. Anyway, this was discussed during v2.01 development, but it was decided to leave it alone as it was (since v1.x). Part of the reason is that the startup code is tricky and needed a lot of iterations to get right, and God knows what would break if we change this. IMHO, the argv0 feature of the stub should not be used. If you want to have `foo' instead of `foo.exe' to have `main' decide what to do, you need to find the extension and strip it off. There's no easy way out of this mess. _CRT0_FLAG_DROP_EXE_SUFFIX also doesn't work from `spawn', btw. > I ask this also, so that I will include in the bnu281b.zip > which I have to upload to DJ (because of the missing > nm.exe :-( ) again the full executables ranlib.exe and > strip.exe and not only links to ar.exe and objcopy.exe. I think adding code which strips the .exe extension is the correct way to go. Putting a 200KB-large executable into an archive just to save a few source lines is IMHO not the best solution.