mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
cmd.exe: Fix parameter parsing returns.
Only return valid values for the location of the parameter if it is the one requested. Currently returns address when ANY quoted or bracketed parameter found.
This commit is contained in:
parent
b822e73263
commit
a7c5906b62
@ -147,6 +147,7 @@ int i = 0;
|
||||
static char param[MAX_PATH];
|
||||
char *p;
|
||||
|
||||
if (where != NULL) *where = NULL;
|
||||
p = param;
|
||||
while (TRUE) {
|
||||
switch (*s) {
|
||||
@ -154,7 +155,7 @@ char *p;
|
||||
s++;
|
||||
break;
|
||||
case '"':
|
||||
if (where != NULL) *where = s;
|
||||
if (where != NULL && i==n) *where = s;
|
||||
s++;
|
||||
while ((*s != '\0') && (*s != '"')) {
|
||||
*p++ = *s++;
|
||||
@ -169,7 +170,7 @@ char *p;
|
||||
p = param;
|
||||
break;
|
||||
case '(':
|
||||
if (where != NULL) *where = s;
|
||||
if (where != NULL && i==n) *where = s;
|
||||
s++;
|
||||
while ((*s != '\0') && (*s != ')')) {
|
||||
*p++ = *s++;
|
||||
|
Loading…
Reference in New Issue
Block a user