[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:
Hermès Bélusca-Maïto 2020-07-22 01:16:53 +02:00
parent 71cd64d66a
commit 2e4c8c019e
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 74 additions and 34 deletions

View file

@ -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++;