From 1d8d16782e43a7697e72f6d8c5b298ca5de06c8c Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 19 Aug 2010 00:51:59 +0000 Subject: win32: handle filename in commandline properly. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56208 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- ChangeLog | 4 ++++ win32/gui/WndMain.c | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc9f754d..96f48162 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +August 19, 2010 Wei Mingzhi + + * win32/gui/WndMain.c: Handle filename in commandline properly. + August 18, 2010 Wei Mingzhi * plugins/peopsxgl/cfg.h: Readded Windows support. diff --git a/win32/gui/WndMain.c b/win32/gui/WndMain.c index 9a3a1896..00fd2409 100644 --- a/win32/gui/WndMain.c +++ b/win32/gui/WndMain.c @@ -193,9 +193,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } else if (strcmp(arg, "-runcd") == 0) { cdfile[0] = '\0'; } else if (strcmp(arg, "-cdfile") == 0) { - arg = strtok(NULL, " "); + arg = strtok(NULL, "\""); if (arg != NULL) { strcpy(cdfile, arg); + } else { + arg = strtok(NULL, " "); + if (arg != NULL) strcpy(cdfile, arg); } } else if (strcmp(arg, "-psxout") == 0) { Config.PsxOut = TRUE; @@ -203,11 +206,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine MessageBox(gApp.hWnd, _( "Usage: pcsx [options]\n" "\toptions:\n" - "\t-runcd\t\tRuns CD-ROM\n" - "\t-cdfile FILE\tRuns a CD image file\n" + "\t-runcd\t\tRuns CD-ROM (requires -nogui)\n" + "\t-cdfile FILE\tRuns a CD image file (requires -nogui)\n" "\t-nogui\t\tDon't open the GUI\n" "\t-psxout\t\tEnable PSX output\n" - "\t-help\tDisplay this message"), + "\t-help\t\tDisplay this message"), "PCSX", 0); return 0; -- cgit v1.2.3