diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-17 15:35:22 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-17 15:35:22 +0000 |
commit | 7b11e424f236ec2e8ad476d91917c44ed3b5fba9 (patch) | |
tree | e0814a83d7ab1f6cccf004860217f451328cffc2 | |
parent | 2ef86165396eee3140dba826dcdb0e5daab3b0b7 (diff) | |
download | perl-7b11e424f236ec2e8ad476d91917c44ed3b5fba9.tar.gz |
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
p4raw-link: @13058 on //depot/maint-5.6/perl: 50ebe189cec19a941749051b01f36b6a9a290d1e
p4raw-link: @12559 on //depot/maint-5.6/perl: c196af81e4de7395bbcca7607214cb47be8a55c0
p4raw-id: //depot/perl@13062
p4raw-integrated: from //depot/maint-5.6/perl@13061 'merge in'
win32/win32.c (@12747..)
-rw-r--r-- | win32/win32.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/win32/win32.c b/win32/win32.c index b23ce65c36..4c36cc7806 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3109,6 +3109,7 @@ create_command_line(char *cname, STRLEN clen, const char * const *args) 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 @@ create_command_line(char *cname, STRLEN clen, const char * const *args) cmd_shell = TRUE; len += 3; } + else if (stricmp(exe, "command.com") == 0 + || stricmp(exe, "command") == 0) + { + dumb_shell = TRUE; + } } } @@ -3182,25 +3188,27 @@ create_command_line(char *cname, STRLEN clen, const char * const *args) /* 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])) { - do_quote = 1; - break; + 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++; } - 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; + 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) |