fix a bug in goto

a stubs for setlocal and endlocal (our default is delayed expansion)

svn path=/trunk/; revision=32073
This commit is contained in:
Christoph von Wittich 2008-02-01 09:49:58 +00:00
parent 8c1cafd4fb
commit cf39f6646d
5 changed files with 38 additions and 2 deletions

View file

@ -361,6 +361,9 @@ INT CommandScreen (LPTSTR, LPTSTR);
/* Prototypes for SET.C */
INT cmd_set (LPTSTR, LPTSTR);
/* Prototypes for SETLOCAL.C */
INT cmd_setlocal (LPTSTR, LPTSTR);
INT cmd_endlocal (LPTSTR, LPTSTR);
/* Prototypes for START.C */
INT cmd_start (LPTSTR, LPTSTR);

View file

@ -54,6 +54,7 @@
<file>replace.c</file>
<file>screen.c</file>
<file>set.c</file>
<file>setlocal.c</file>
<file>shift.c</file>
<file>start.c</file>
<file>strtoclr.c</file>

View file

@ -100,6 +100,8 @@ COMMAND cmds[] =
{_T("echoerr."), CMD_HIDE, CommandEchoerr},
{_T("echoserr"), 0, CommandEchoserr},
{_T("endlocal"), 0, cmd_endlocal},
#ifdef INCLUDE_CMD_DEL
{_T("erase"), 0, CommandDelete},
#endif
@ -192,6 +194,8 @@ COMMAND cmds[] =
{_T("set"), 0, cmd_set},
#endif
{_T("setlocal"), 0, cmd_setlocal},
{_T("shift"), CMD_BATCHONLY, cmd_shift},
#ifdef INCLUDE_CMD_START

View file

@ -39,7 +39,7 @@
INT cmd_goto (LPTSTR cmd, LPTSTR param)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR tmp;
LPTSTR tmp, tmp2;
LONG lNewPosHigh = 0;
#ifdef _DEBUG
@ -119,8 +119,9 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
pos++;
}
tmp2 = param;
/* use whole label name */
if ((*tmp == _T(':')) && ((_tcsicmp (++tmp, param) == 0) || (_tcsicmp (tmp, ++param) == 0)))
if ((*tmp == _T(':')) && ((_tcsicmp (++tmp, param) == 0) || (_tcsicmp (tmp, ++tmp2) == 0)))
return 0;
}

View file

@ -0,0 +1,27 @@
/*
* GOTO.C - goto internal batch command.
*
* History:
*
* 1 Feb 2008 (Christoph von Wittich)
* started.
*/
#include <precomp.h>
/* unimplemented */
/* our current default is delayedexpansion */
INT cmd_setlocal (LPTSTR cmd, LPTSTR param)
{
return 0;
}
/* endlocal doesn't take any params */
INT cmd_endlocal (LPTSTR cmd, LPTSTR param)
{
return 0;
}