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:
Jason Edmeades 2007-02-27 23:21:59 +00:00 committed by Alexandre Julliard
parent b822e73263
commit a7c5906b62

View File

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