Commit a7c5906b authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

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.
parent b822e732
......@@ -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++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment