From a0914d8e6ce0e8ec3db295c01deb09b180fdd56b Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Fri, 5 Sep 1997 00:00:00 +0000 Subject: [PATCH] Minor OS/2 patch for 4_03 This makes "$^X -w script" skip the shell though $^X contains backslashes: Only os2/os2.c is touched. Enjoy, p5p-msgid: 199710032224.SAA15345@monk.mps.ohio-state.edu --- os2/os2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os2/os2.c b/os2/os2.c index 8074242..8a292e3 100644 --- a/os2/os2.c +++ b/os2/os2.c @@ -294,7 +294,7 @@ int execf; register char *s; char flags[10]; char *shell, *copt, *news = NULL; - int rc, added_shell = 0, err; + int rc, added_shell = 0, err, seenspace = 0; char fullcmd[MAXNAMLEN + 1]; #ifdef TRYSHELL @@ -346,6 +346,8 @@ int execf; if (*s == '\n' && s[1] == '\0') { *s = '\0'; break; + } else if (*s == '\\' && !seenspace) { + continue; /* Allow backslashes in names */ } doshell: if (execf == EXECF_TRUEEXEC) @@ -364,6 +366,8 @@ int execf; if (rc < 0) rc = 255 << 8; /* Emulate the fork(). */ if (news) Safefree(news); return rc; + } else if (*s == ' ' || *s == '\t') { + seenspace = 1; } } -- 2.7.4