Change 13062 by jhi@alpha on 2001/11/17 15:35:22

        Integrate change #13058 from maintperl;
        change#12559 breaks things on Win9x because command.com doesn't
        grok dquotes at all; disable all the system() smarts for
        command.com

Affected files ...

.... //depot/perl/win32/win32.c#177 integrate

Differences ...

==== //depot/perl/win32/win32.c#177 (text) ====
Index: perl/win32/win32.c
--- perl/win32/win32.c.~1~      Sat Nov 17 08:45:06 2001
+++ perl/win32/win32.c  Sat Nov 17 08:45:06 2001
@@ -3109,6 +3109,7 @@
     STRLEN len = 0;
     bool bat_file = FALSE;
     bool cmd_shell = FALSE;
+    bool dumb_shell = FALSE;
     bool extra_quotes = FALSE;
     bool quote_next = FALSE;
 
@@ -3154,6 +3155,11 @@
                cmd_shell = TRUE;
                len += 3;
            }
+           else if (stricmp(exe, "command.com") == 0
+                    || stricmp(exe, "command") == 0)
+           {
+               dumb_shell = TRUE;
+           }
        }
     }
 
@@ -3182,26 +3188,28 @@
 
        /* we want to protect empty arguments and ones with spaces with
         * dquotes, but only if they aren't already there */
-       if (!curlen) {
-           do_quote = 1;
-       }
-       else if (!(arg[0] == '"' && curlen > 1 && arg[curlen-1] == '"')) {
-           STRLEN i = 0;
-           while (i < curlen) {
-               if (isSPACE(arg[i])) {
+       if (!dumb_shell) {
+           if (!curlen) {
+               do_quote = 1;
+           }
+           else if (!(arg[0] == '"' && curlen > 1 && arg[curlen-1] == '"')) {
+               STRLEN i = 0;
+               while (i < curlen) {
+                   if (isSPACE(arg[i])) {
+                       do_quote = 1;
+                       break;
+                   }
+                   i++;
+               }
+           }
+           else if (quote_next) {
+               /* ok, we know the argument already has quotes; see if it
+                * really is multiple arguments pretending to be one and
+                * force a set of quotes around it */
+               if (*find_next_space(arg))
                    do_quote = 1;
-                   break;
-               }
-               i++;
            }
        }
-       else if (quote_next) {
-           /* ok, we know the argument already has quotes; see if it
-            * really is multiple arguments pretending to be one and
-            * force a set of quotes around it */
-           if (*find_next_space(arg))
-               do_quote = 1;
-       }
 
        if (do_quote)
            *ptr++ = '"';
End of Patch.

Reply via email to