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 d17c3d0490
commit 82f0bbf8a6
2 changed files with 14 additions and 19 deletions

View File

@ -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)
{

View File

@ -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 );
}
}