From: Gurusamy Sarathy Date: Mon, 11 Aug 1997 18:44:42 +0000 (+1200) Subject: /x is not a valid shell switch on Win95 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a9a032c3f8c74999a5c6e086d3b36a6efa88d7b;p=p5sagit%2Fp5-mst-13.2.git /x is not a valid shell switch on Win95 This one fixes `Invalid switch' messages on Windows95 when running system() et al. p5p-msgid: 199708121720.NAA14760@aatma.engin.umich.edu --- diff --git a/win32/win32.c b/win32/win32.c index f615bdc..3d6048a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -379,7 +379,8 @@ do_aspawn(void* really, void** mark, void** arglast) } else { argv[index++] = cmd = GetShell(); - argv[index++] = "/x"; /* always enable command extensions */ + if (IsWinNT()) + argv[index++] = "/x"; /* always enable command extensions */ argv[index++] = "/c"; } @@ -455,8 +456,11 @@ do_spawn2(char *cmd, int exectype) } if(needToTry) { char *argv[5]; - argv[0] = shell; argv[1] = "/x"; argv[2] = "/c"; - argv[3] = cmd; argv[4] = Nullch; + int i = 0; + argv[i++] = shell; + if (IsWinNT()) + argv[i++] = "/x"; + argv[i++] = "/c"; argv[i++] = cmd; argv[i] = Nullch; switch (exectype) { case EXECF_SPAWN: status = win32_spawnvp(P_WAIT, argv[0],