Mail Archives: djgpp-workers/1999/03/24/21:35:39
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 -