www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/20/07:11:08

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 <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
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: <Pine.SUN.3.91.1020120140406.9986F-100000@is>
MIME-Version: 1.0
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

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'.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019