delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/03/24/21:35:39

To: djgpp-workers AT delorie DOT com
Subject: Re: Support for program specific environment files
References: <20emmho6of DOT fsf_-_ AT Sky DOT inp DOT nsk DOT su>
From: Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su>
Date: 25 Mar 1999 08:28:07 +0600
In-Reply-To: Michael Bukin's message of "22 Mar 1999 22:00:48 +0600"
Message-ID: <203e2us3pk.fsf@Sky.inp.nsk.su>
Lines: 28
X-Mailer: Gnus v5.5/Emacs 19.34
Reply-To: djgpp-workers AT delorie DOT com

Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su> writes:

If anyone is using it, there is a problem with loading environment
file from the same directory as executable.  It loads environment file
from current directory instead.

> +void
> +__crt0_load_environment_file(char *app_name)
> +{
> ...
> +    /* Try app_name.env  */
> +    sec_env[0] = 0;
> +    safe_string_append (sec_env, app_name, sizeof (sec_env));

Remove the above line and add two lines

safe_string_append (sec_env, __dos_argv0, sizeof (sec_env));
__replace_filename (sec_env, app_basename, sizeof (sec_env));

And uncomment definition of __replace_filename.

> +    __replace_extension (sec_env, ENV_EXTENSION, sizeof (sec_env));
> +    __load_environment_file (sec_env, app_basename);
> +  }
> +}

-- 
Michael Bukin

- Raw text -


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