Commit 910234ea authored by Alexandre Julliard's avatar Alexandre Julliard

Pass the environ variable from main to try to avoid Darwin's

_NSGetEnviron() ugliness.
parent 3270bb1e
......@@ -53,7 +53,7 @@ extern int __wine_main_argc;
extern char **__wine_main_argv;
extern WCHAR **__wine_main_wargv;
extern char **__wine_main_environ;
extern void wine_init( int argc, char *argv[], char *error, int error_size );
extern void wine_init( int argc, char *argv[], char *envp[], char *error, int error_size );
/* debugging */
......
......@@ -172,13 +172,6 @@ struct statvfs
# define S_IXOTH S_IEXEC
#endif
#ifdef __APPLE__
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif
/****************************************************************
* Constants
......
......@@ -504,7 +504,7 @@ static void debug_usage(void)
*
* Main Wine initialisation.
*/
void wine_init( int argc, char *argv[], char *error, int error_size )
void wine_init( int argc, char *argv[], char *envp[], char *error, int error_size )
{
char *wine_debug;
int file_exists;
......@@ -515,7 +515,7 @@ void wine_init( int argc, char *argv[], char *error, int error_size )
wine_init_argv0_path( argv[0] );
__wine_main_argc = argc;
__wine_main_argv = argv;
__wine_main_environ = environ;
__wine_main_environ = envp;
mmap_init();
if ((wine_debug = getenv("WINEDEBUG")))
......
......@@ -33,6 +33,7 @@ int main( int argc, char *argv[] )
{
char error[1024];
int i;
extern char **environ;
if (wine_main_preload_info)
{
......@@ -41,7 +42,7 @@ int main( int argc, char *argv[] )
wine_main_preload_info[i].size );
}
wine_init( argc, argv, error, sizeof(error) );
wine_init( argc, argv, environ, error, sizeof(error) );
fprintf( stderr, "wine: failed to initialize: %s\n", error );
exit(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment