From: Gurusamy Sarathy Date: Mon, 2 Jun 2003 20:40:19 +0000 (+0000) Subject: resurrect change#19628 and make it work by generalizing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11998fdb9e856e363920dd01b47ba3f3fe2d0bb2;p=p5sagit%2Fp5-mst-13.2.git resurrect change#19628 and make it work by generalizing a spot that had a hardcoded dependency on the cmd.exe arguments being "/x/c" or "/c" p4raw-link: @19628 on //depot/perl: 7b24c8f3b02202da900623391393234a869d1b34 p4raw-id: //depot/perl@19668 --- diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 2b63c6b..76f0e2d 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -1061,7 +1061,7 @@ The command used to load the debugger code. The default is: =item PERL5SHELL (specific to the Win32 port) May be set to an alternative shell that perl must use internally for -executing "backtick" commands or system(). Default is C +executing "backtick" commands or system(). Default is C on WindowsNT and C on Windows95. The value is considered to be space-separated. Precede any character that needs to be protected (like a space or backslash) with a backslash. diff --git a/win32/win32.c b/win32/win32.c index d059fe2..083e98e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -506,7 +506,7 @@ get_shell(void) * for). */ const char* defaultshell = (IsWinNT() - ? "cmd.exe /x/c" : "command.com /c"); + ? "cmd.exe /x/d/c" : "command.com /c"); const char *usershell = PerlEnv_getenv("PERL5SHELL"); w32_perlshell_items = tokenize(usershell ? usershell : defaultshell, &w32_perlshell_tokens, @@ -3608,7 +3608,9 @@ create_command_line(char *cname, STRLEN clen, const char * const *args) if (!extra_quotes && cmd_shell - && (stricmp(arg, "/x/c") == 0 || stricmp(arg, "/c") == 0)) + && curlen >= 2 + && *arg == '/' /* see if arg is "/c", "/x/c", "/x/d/c" etc. */ + && stricmp(arg+curlen-2, "/c") == 0) { /* is there a next argument? */ if (args[index+1]) {