mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
[CMD] GOTO: Fix handling of the ':EOF' label handling.
- The ':EOF' label feature is available only when extensions are enabled. - Anything that follows the ':EOF' label, separated by at least one whitespace character, is ignored, and the batch file terminates.
This commit is contained in:
parent
aee1dd2972
commit
c5e6e5a19c
|
@ -65,8 +65,10 @@ INT cmd_goto(LPTSTR param)
|
||||||
++tmp;
|
++tmp;
|
||||||
*tmp = _T('\0');
|
*tmp = _T('\0');
|
||||||
|
|
||||||
/* jump to end of the file */
|
/* Support jumping to the end of the file, only if extensions are enabled */
|
||||||
if ( _tcsicmp( param, _T(":eof"))==0)
|
if (bEnableExtensions &&
|
||||||
|
(_tcsnicmp(param, _T(":EOF"), 4) == 0) &&
|
||||||
|
(!param[4] || _istspace(param[4])))
|
||||||
{
|
{
|
||||||
/* Position at the end of the batch file */
|
/* Position at the end of the batch file */
|
||||||
bc->mempos = bc->memsize;
|
bc->mempos = bc->memsize;
|
||||||
|
|
Loading…
Reference in a new issue