From f48b00f5f5f423bbf014837469006462e6d96b98 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Wed, 23 Jan 2002 00:00:02 +0000 Subject: [PATCH] It was ignoring the command line parameters because there was an extraneous argv[1] that was a repeat of the module name, but in quotation marks. The processing in pcmain stops on the first argument that doesn't start with '-' so my other arguments got ignored. argv[0] 0x00b40800 "C:\test\binary\nethackw.exe" argv[1] 0x00b40878 ""C:\test\binary\nethackw.exe"" argv[2] 0x00b408f0 "-uwizard" argv[3] 0x00b40938 "-D" --- win/win32/winhack.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/win/win32/winhack.c b/win/win32/winhack.c index fa1563fec..655f03c8b 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -75,12 +75,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, wizard = TRUE; #endif - /* get command line parameters */ - GetModuleFileName(NULL, wbuf, BUFSZ); - argv[0] = _strdup(NH_W2A(wbuf, buf, BUFSZ)); - + /* get command line parameters */ p = _tcstok(GetCommandLine(), TEXT(" ")); - for( argc=1; p && argc0 ) { argv[argc] = _strdup( NH_W2A(p, buf, BUFSZ) ); @@ -89,7 +86,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, } p = _tcstok(NULL, TEXT(" ")); } - + GetModuleFileName(NULL, wbuf, BUFSZ); + argv[0] = _strdup(NH_W2A(wbuf, buf, BUFSZ)); + pcmain(argc,argv); moveloop();