dlls/shell32/shlexec.c

Ge van Geldorp gvg at reactos.com
Thu Oct 21 13:57:16 CDT 2004


Changelog:
  Ge van Geldorp <gvg at reactos.com>
  - Don't double-quote an already double-quoted argument
  - Properly increment the fmt pointer

Index: dlls/shell32/shlexec.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlexec.c,v
retrieving revision 1.55
diff -u -r1.55 shlexec.c
--- dlls/shell32/shlexec.c	7 Oct 2004 03:06:48 -0000	1.55
+++ dlls/shell32/shlexec.c	21 Oct 2004 18:52:46 -0000
@@ -142,8 +142,10 @@
                     else
                         cmd = lpFile;
 
-                    /* Add double quotation marks unless we already have them (e.g.: "file://%1" %* for exefile) */
-                    if (res == out || *(fmt + 1) != '"')
+                    /* Add double quotation marks unless we already have them
+                       (e.g.: "file://%1" %* for exefile) or unless the arg is already
+                       enclosed in double quotation marks */
+                    if ((res == out || *(fmt + 1) != '"') && *cmd != '"')
                     {
                         *res++ = '"';
                         strcpyW(res, cmd);
@@ -207,9 +209,13 @@
                         strcpyW( res, tmpEnvBuff );
                     res += strlenW(res);
                 }
-                fmt++;
                 done = TRUE;
                 break;
+            }
+            /* Don't skip past terminator (catch a single '%' at the end) */
+            if (*fmt != '\0')
+            {
+                fmt++;
             }
         }
         else



More information about the wine-patches mailing list