Support extproc on OS/2

extproc is similar to like #! on OS/2.
This commit is contained in:
KO Myung-Hun
2015-05-09 15:41:56 +09:00
parent 5127457319
commit 9b30ce1a6d
3 changed files with 18 additions and 1 deletions

5
exec.c
View File

@ -930,9 +930,12 @@ scriptexec(struct op *tp, const char **ap)
cp = buf + n;
/* bail out if no shebang magic found */
if ((cp[0] != '#') || (cp[1] != '!'))
#ifdef __OS2__
if (strncmp(cp, "extproc", 7) || (cp[7] != ' ' && cp[7] != '\t'))
#endif
goto noshebang;
cp += 2;
cp += *cp == '#' ? 2 : 7;
/* skip whitespace before shell name */
while (*cp == ' ' || *cp == '\t')
++cp;