From 4bfb54b85d7a37728102c996e81b8f39cbf737ab Mon Sep 17 00:00:00 2001 From: tomch Date: Sat, 30 Jan 2010 15:51:33 +0000 Subject: [PATCH] Fix: 'Debugger RUN still not 100%' (Bug #16688) . Honour absolute path (ie. don't prefix with CWD) --- source/Applewin.cpp | 14 -------------- source/Debug.cpp | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index bb433ba2..5b8cc0f0 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -708,8 +708,6 @@ LPSTR GetCurrArg(LPSTR lpCmdLine) LPSTR GetNextArg(LPSTR lpCmdLine) { - LPSTR pSrc = lpCmdLine; - int bInQuotes = 0; while(*lpCmdLine) @@ -717,12 +715,8 @@ LPSTR GetNextArg(LPSTR lpCmdLine) if(*lpCmdLine == '\"') { bInQuotes ^= 1; - if( bInQuotes ) - { - } if(!bInQuotes) { -//MessageBox( NULL, lpCmdLine, pSrc, MB_OK ); *lpCmdLine++ = 0x00; // Assume end-quote is end of this arg continue; } @@ -780,10 +774,6 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) { LPSTR lpNextArg = GetNextArg(lpCmdLine); -// BUG: Double-click .DSK -// Think the 1st double quote is active, while the last double quote is getting stripped -//MessageBox(NULL, lpCmdLine, "Command Line", MB_OK ); - if(strcmp(lpCmdLine, "-noreg") == 0) { g_bRegisterFileTypes = false; @@ -937,10 +927,6 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) DiskInitialize(); CreateColorMixMap(); // For tv emulation g_nAppMode -// BUG: Double-click .DSK -//MessageBox( NULL, szImageName_drive1, "Disk 1", MB_OK ); -//MessageBox( NULL, szImageName_drive2, "Disk 2", MB_OK ); - int nError = 0; // TODO: Show error MsgBox if we get a DiskInsert error if(szImageName_drive1) { diff --git a/source/Debug.cpp b/source/Debug.cpp index aea9d97b..15eaf541 100644 --- a/source/Debug.cpp +++ b/source/Debug.cpp @@ -5668,11 +5668,20 @@ Update_t CmdOutputRun (int nArgs) // if (g_aArgs[1].bType & TYPE_QUOTED_2) - strcpy( sMiniFileName, pFileName ); -// strcat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING + _tcscpy( sMiniFileName, pFileName ); +// _tcscat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING - _tcscpy(sFileName, g_sCurrentDir); // - _tcscat(sFileName, sMiniFileName); + if (pFileName[0] == '\\' || pFileName[1] == ':') // NB. Any prefix quote has already been stripped + { + // Abs pathname + _tcscpy(sFileName, sMiniFileName); + } + else + { + // Rel pathname + _tcscpy(sFileName, g_sCurrentDir); + _tcscat(sFileName, sMiniFileName); + } if (script.Read( sFileName )) { @@ -5684,7 +5693,7 @@ Update_t CmdOutputRun (int nArgs) for( int iLine = 0; iLine < nLine; iLine++ ) { script.GetLine( iLine, g_pConsoleInput, CONSOLE_WIDTH-2 ); - g_nConsoleInputChars = strlen( g_pConsoleInput ); + g_nConsoleInputChars = _tcslen( g_pConsoleInput ); bUpdateDisplay |= DebuggerProcessCommand( false ); } }