Jason Edmeades : cmd.exe: Fix parameter parsing returns.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 28 08:19:14 CST 2007


Module: wine
Branch: master
Commit: a7c5906b626fd17de661dc8e12fab71e79c6e1ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a7c5906b626fd17de661dc8e12fab71e79c6e1ad

Author: Jason Edmeades <us at edmeades.me.uk>
Date:   Tue Feb 27 23:21:59 2007 +0000

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.

---

 programs/cmd/batch.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 5a854f7..bbc3f83 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -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++;




More information about the wine-cvs mailing list