mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:31:40 +00:00
[CMD] GOTO: Fix label parsing.
We note two things, when CMD searches for the corresponding label in the batch file: - the first character of the line is always ignored, unless it's a colon; - the escape caret ^ is supported and interpreted. Fixes some cmd_winetests.
This commit is contained in:
parent
71cd64d66a
commit
2e4c8c019e
4 changed files with 74 additions and 34 deletions
|
@ -131,7 +131,7 @@ static LPTSTR BatchParams(LPTSTR s1, LPTSTR s2)
|
|||
BOOL inquotes = FALSE;
|
||||
|
||||
/* Find next parameter */
|
||||
while (_istspace(*s2) || (*s2 && _tcschr(_T(",;="), *s2)))
|
||||
while (_istspace(*s2) || (*s2 && _tcschr(STANDARD_SEPS, *s2)))
|
||||
s2++;
|
||||
if (!*s2)
|
||||
break;
|
||||
|
@ -139,7 +139,7 @@ static LPTSTR BatchParams(LPTSTR s1, LPTSTR s2)
|
|||
/* Copy it */
|
||||
do
|
||||
{
|
||||
if (!inquotes && (_istspace(*s2) || _tcschr(_T(",;="), *s2)))
|
||||
if (!inquotes && (_istspace(*s2) || _tcschr(STANDARD_SEPS, *s2)))
|
||||
break;
|
||||
inquotes ^= (*s2 == _T('"'));
|
||||
*s1++ = *s2++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue