diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 7e0b43a125a..87767e57457 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2318,37 +2318,6 @@ void __wine_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ) } -/*********************************************************************** - * check_command_line - * - * Check if command line is one that needs to be handled specially. - */ -static void check_command_line( int argc, char *argv[] ) -{ - static const char version[] = PACKAGE_STRING "\n"; - static const char usage[] = - "Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n" - " wine --help Display this help and exit\n" - " wine --version Output version information and exit\n"; - - if (argc <= 1) - { - write( 2, usage, sizeof(usage) - 1 ); - exit(1); - } - if (!strcmp( argv[1], "--help" )) - { - write( 1, usage, sizeof(usage) - 1 ); - exit(0); - } - if (!strcmp( argv[1], "--version" )) - { - write( 1, version, sizeof(version) - 1 ); - exit(0); - } -} - - /*********************************************************************** * __wine_process_init */ @@ -2362,7 +2331,6 @@ void __wine_process_init(void) void (* DECLSPEC_NORETURN init_func)(void); extern mode_t FILE_umask; - check_command_line( __wine_main_argc, __wine_main_argv ); main_exe_file = thread_init(); /* retrieve current umask */ diff --git a/loader/main.c b/loader/main.c index 5000add2bbc..dd5d7694dc5 100644 --- a/loader/main.c +++ b/loader/main.c @@ -61,6 +61,37 @@ static inline void reserve_area( void *addr, size_t size ) #endif /* __APPLE__ */ +/*********************************************************************** + * check_command_line + * + * Check if command line is one that needs to be handled specially. + */ +static void check_command_line( int argc, char *argv[] ) +{ + static const char version[] = PACKAGE_STRING; + static const char usage[] = + "Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n" + " wine --help Display this help and exit\n" + " wine --version Output version information and exit"; + + if (argc <= 1) + { + fprintf( stderr, "%s\n", usage ); + exit(1); + } + if (!strcmp( argv[1], "--help" )) + { + printf( "%s\n", usage ); + exit(0); + } + if (!strcmp( argv[1], "--version" )) + { + printf( "%s\n", version ); + exit(0); + } +} + + /********************************************************************** * main */ @@ -69,6 +100,7 @@ int main( int argc, char *argv[] ) char error[1024]; int i; + check_command_line( argc, argv ); if (wine_main_preload_info) { for (i = 0; wine_main_preload_info[i].size; i++)