X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Sun, 20 Jan 2002 14:10:18 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: djgpp-workers AT delorie DOT com Subject: Re: env.exe crash - reproducible test program In-Reply-To: <3C4AB07C.AF998177@phekda.freeserve.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 20 Jan 2002, Richard Dawe wrote: > > This suggests a solution: add a dummy putenv call to the startup > > code, which will be called unconditionally. > > Yes, this works. There's a patch below. Thanks. > Do you think this code should be in > crt1.c instead of this function or is it OK where it is? OK to commit? See my comments below. > Eli, would you still like YAMD versions of Charles's test programs? No, I think you explained the cause; thanks. > void > __crt0_load_environment_file(char *app_name) > { I think this should go into crt1.c, not c1loadef.c. That's because the latter could be excluded from a program if the user defines an empty __crt0_load_environment_file in her program (e.g., to minimize the footprint). > + * Use putenv to delete an environment variable with a name that is > + * unlikely to be used. > + */ > + putenv(unconst("DJGPP_sillynametohaveforanenvironmentvariable", char *)); Doesn't it work to say just putenv(""); ? That would do the trick without putting extraneous variables into the environment. Remember: all we need is for putenv to record the value of `environ'.