Change 13058 by gsar@rake on 2001/11/17 03:50:49
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/maint-5.6/perl/win32/win32.c#29 edit
Differences ...
==== //depot/maint-5.6/perl/win32/win32.c#29 (text) ====
Index: perl/win32/win32.c
--- perl/win32/win32.c.~1~ Fri Nov 16 21:00:05 2001
+++ perl/win32/win32.c Fri Nov 16 21:00:05 2001
@@ -3068,6 +3068,7 @@
STRLEN len = 0;
bool bat_file = FALSE;
bool cmd_shell = FALSE;
+ bool dumb_shell = FALSE;
bool extra_quotes = FALSE;
bool quote_next = FALSE;
@@ -3113,6 +3114,11 @@
cmd_shell = TRUE;
len += 3;
}
+ else if (stricmp(exe, "command.com") == 0
+ || stricmp(exe, "command") == 0)
+ {
+ dumb_shell = TRUE;
+ }
}
}
@@ -3141,26 +3147,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.