Fix: 'Debugger RUN <script-file> still not 100%' (Bug #16688)

. Honour absolute path (ie. don't prefix with CWD)
This commit is contained in:
tomch 2010-01-30 15:51:33 +00:00
parent 09d8ae4a88
commit 4bfb54b85d
2 changed files with 14 additions and 19 deletions

View File

@ -708,8 +708,6 @@ LPSTR GetCurrArg(LPSTR lpCmdLine)
LPSTR GetNextArg(LPSTR lpCmdLine) LPSTR GetNextArg(LPSTR lpCmdLine)
{ {
LPSTR pSrc = lpCmdLine;
int bInQuotes = 0; int bInQuotes = 0;
while(*lpCmdLine) while(*lpCmdLine)
@ -717,12 +715,8 @@ LPSTR GetNextArg(LPSTR lpCmdLine)
if(*lpCmdLine == '\"') if(*lpCmdLine == '\"')
{ {
bInQuotes ^= 1; bInQuotes ^= 1;
if( bInQuotes )
{
}
if(!bInQuotes) if(!bInQuotes)
{ {
//MessageBox( NULL, lpCmdLine, pSrc, MB_OK );
*lpCmdLine++ = 0x00; // Assume end-quote is end of this arg *lpCmdLine++ = 0x00; // Assume end-quote is end of this arg
continue; continue;
} }
@ -780,10 +774,6 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
{ {
LPSTR lpNextArg = GetNextArg(lpCmdLine); 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) if(strcmp(lpCmdLine, "-noreg") == 0)
{ {
g_bRegisterFileTypes = false; g_bRegisterFileTypes = false;
@ -937,10 +927,6 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
DiskInitialize(); DiskInitialize();
CreateColorMixMap(); // For tv emulation g_nAppMode 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 int nError = 0; // TODO: Show error MsgBox if we get a DiskInsert error
if(szImageName_drive1) if(szImageName_drive1)
{ {

View File

@ -5668,11 +5668,20 @@ Update_t CmdOutputRun (int nArgs)
// if (g_aArgs[1].bType & TYPE_QUOTED_2) // if (g_aArgs[1].bType & TYPE_QUOTED_2)
strcpy( sMiniFileName, pFileName ); _tcscpy( sMiniFileName, pFileName );
// strcat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING // _tcscat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING
_tcscpy(sFileName, g_sCurrentDir); // if (pFileName[0] == '\\' || pFileName[1] == ':') // NB. Any prefix quote has already been stripped
_tcscat(sFileName, sMiniFileName); {
// Abs pathname
_tcscpy(sFileName, sMiniFileName);
}
else
{
// Rel pathname
_tcscpy(sFileName, g_sCurrentDir);
_tcscat(sFileName, sMiniFileName);
}
if (script.Read( sFileName )) if (script.Read( sFileName ))
{ {
@ -5684,7 +5693,7 @@ Update_t CmdOutputRun (int nArgs)
for( int iLine = 0; iLine < nLine; iLine++ ) for( int iLine = 0; iLine < nLine; iLine++ )
{ {
script.GetLine( iLine, g_pConsoleInput, CONSOLE_WIDTH-2 ); script.GetLine( iLine, g_pConsoleInput, CONSOLE_WIDTH-2 );
g_nConsoleInputChars = strlen( g_pConsoleInput ); g_nConsoleInputChars = _tcslen( g_pConsoleInput );
bUpdateDisplay |= DebuggerProcessCommand( false ); bUpdateDisplay |= DebuggerProcessCommand( false );
} }
} }