Module: wine Branch: master Commit: bda2832d8d95ac7271b241c5749cdcd54aa5265e URL: http://source.winehq.org/git/wine.git/?a=commit;h=bda2832d8d95ac7271b241c574...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Nov 6 13:04:56 2006 +0100
ntdll: Moved command-line help to the loader binary.
---
dlls/ntdll/loader.c | 32 -------------------------------- loader/main.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 7e0b43a..87767e5 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2319,37 +2319,6 @@ void __wine_init_windows_dir( const WCHA
/*********************************************************************** - * 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 */ void __wine_process_init(void) @@ -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 5000add..dd5d769 100644 --- a/loader/main.c +++ b/loader/main.c @@ -61,6 +61,37 @@ static inline void reserve_area( void *a
#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++)