| version 1.6, 1993/04/17 01:38:51 |
version 1.7, 1993/04/17 08:07:03 |
| Line 111 execve(p, uap, retval) |
|
| Line 111 execve(p, uap, retval) |
|
| struct vmspace *vs; |
struct vmspace *vs; |
| caddr_t newframe; |
caddr_t newframe; |
| char shellname[MAXINTERP]; /* 05 Aug 92*/ |
char shellname[MAXINTERP]; /* 05 Aug 92*/ |
| |
char arguments[MAXINTERP]; |
| long magic; |
long magic; |
| union { |
union { |
| char ex_shell[MAXINTERP]; /* #! and interpreter name */ |
char ex_shell[MAXINTERP]; /* #! and interpreter name */ |
| Line 210 again: /* 05 Aug 92*/ |
|
| Line 211 again: /* 05 Aug 92*/ |
|
| *sp++ = *cp++; |
*sp++ = *cp++; |
| *sp = '\0'; |
*sp = '\0'; |
| |
|
| indir = 1; /* indicate this is a script file */ |
while (*cp == ' ') |
| |
cp++; |
| |
if (*cp) { /* extra argument */ |
| |
sp = arguments; |
| |
while (*cp) |
| |
*sp++ = *cp++; |
| |
*sp = '\0'; |
| |
indir = 2; |
| |
} |
| |
else |
| |
indir = 1; /* indicate this is a script file */ |
| vput(ndp->ni_vp); |
vput(ndp->ni_vp); |
| FREE(ndp->ni_pnbuf, M_NAMEI); |
FREE(ndp->ni_pnbuf, M_NAMEI); |
| |
|
| Line 283 again: /* 05 Aug 92*/ |
|
| Line 294 again: /* 05 Aug 92*/ |
|
| /* first, do (shell name if any then) args */ |
/* first, do (shell name if any then) args */ |
| if (indir) { |
if (indir) { |
| ep = shellname; |
ep = shellname; |
| twice: |
thrice: |
| if (ep) { |
if (ep) { |
| /* did we outgrow initial argbuf, if so, die */ |
/* did we outgrow initial argbuf, if so, die */ |
| if (argbufp >= (char **)stringbuf) { |
if (argbufp >= (char **)stringbuf) { |
|
|
| limitonargs -= stringlen; |
limitonargs -= stringlen; |
| } |
} |
| |
|
| if (indir) { |
if (indir == 2) { |
| |
indir = 1; |
| |
ep = arguments; |
| |
goto thrice; |
| |
} |
| |
if (indir == 1) { |
| indir = 0; |
indir = 0; |
| /* orginal executable is 1st argument with scripts */ |
/* orginal executable is 1st argument with scripts */ |
| ep = uap->fname; |
ep = uap->fname; |
| goto twice; |
goto thrice; |
| } |
} |
| /* terminate in case no more args to script */ |
/* terminate in case no more args to script */ |
| suword(argbufp, 0); |
suword(argbufp, 0); |