perl 5.0 alpha 3
[p5sagit/p5-mst-13.2.git] / do / aexec
CommitLineData
79072805 1bool
2do_aexec(really,arglast)
3STR *really;
4int *arglast;
5{
6 register STR **st = stack->ary_array;
7 register int sp = arglast[1];
8 register int items = arglast[2] - sp;
9 register char **a;
10 char *tmps;
11
12 if (items) {
13 New(401,Argv, items+1, char*);
14 a = Argv;
15 for (st += ++sp; items > 0; items--,st++) {
16 if (*st)
17 *a++ = str_get(*st);
18 else
19 *a++ = "";
20 }
21 *a = Nullch;
22#ifdef TAINT
23 if (*Argv[0] != '/') /* will execvp use PATH? */
24 taintenv(); /* testing IFS here is overkill, probably */
25#endif
26 if (really && *(tmps = str_get(really)))
27 execvp(tmps,Argv);
28 else
29 execvp(Argv[0],Argv);
30 }
31 do_execfree();
32 return FALSE;
33}
34