aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/process.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c
index b95e173e1..0db1a455a 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -57,6 +57,10 @@ parse_interpreter(const char *cmd, char ***opts, int *nopts)
57 if (n < 4) /* at least '#!/x' and not error */ 57 if (n < 4) /* at least '#!/x' and not error */
58 return NULL; 58 return NULL;
59 59
60 /*
61 * See http://www.in-ulm.de/~mascheck/various/shebang/ for trivia
62 * relating to '#!'.
63 */
60 if (buf[0] != '#' || buf[1] != '!') 64 if (buf[0] != '#' || buf[1] != '!')
61 return NULL; 65 return NULL;
62 buf[n] = '\0'; 66 buf[n] = '\0';
@@ -70,8 +74,12 @@ parse_interpreter(const char *cmd, char ***opts, int *nopts)
70 *p = '\0'; 74 *p = '\0';
71 } 75 }
72 76
77 /* skip whitespace after '#!' */
78 for ( s=buf+2; *s && isspace(*s); ++s ) {
79 }
80
73 /* move to end of interpreter path (which may not contain spaces) */ 81 /* move to end of interpreter path (which may not contain spaces) */
74 for ( s=buf+2; *s && !isspace(*s); ++s ) { 82 for ( ; *s && !isspace(*s); ++s ) {
75 } 83 }
76 84
77 n = 0; 85 n = 0;