if ( strcmp(ty_name,PROG)==0 ) {
if ( new->t_prog ) twice=YES ;
bline= scanb(bol); /* Scan for \ */
- vline= scanvars(gr_start(bline)); /* Scan for {} */
- gr_throw(&bline);
- new->t_prog= gr_final(&vline);
- clr_noscan(new->t_prog);
+ new->t_prog= gr_final(&bline);
} else
if ( strcmp(ty_name,MAPF)==0 ) {
/* First read the mapflags line
#include "ack.h"
#include "list.h"
#include "trans.h"
+#include "grows.h"
#include "data.h"
#include <signal.h>
#define ARG_MORE 40 /* The size of args chunks to allocate */
+extern growstring scanvars();
+
static char **arglist ; /* The first argument */
static unsigned argcount ; /* The current number of arguments */
static unsigned argmax; /* The maximum number of arguments so far */
int runphase(phase) register trf *phase ; {
register list_elem *elem ;
+ char *prog ; int result ;
+ growstring bline ;
+ bline=scanvars(phase->t_prog) ;
+ prog=gr_final(&bline) ;
if ( v_flag || debug ) {
if ( v_flag==1 && !debug ) {
vprint("%s",phase->t_name) ;
}
} else {
/* list all args */
- vprint("%s",phase->t_prog) ;
+ vprint("%s",prog) ;
scanlist(l_first(phase->t_flags), elem) {
vprint(" %s",l_content(*elem)) ;
}
x_arg(l_content(*elem)) ;
}
x_arg( (char *)0 ) ;
- return run_exec(phase) ;
+ result=run_exec(phase,prog) ;
+ throws(&prog) ;
+ return result ;
}
-int run_exec(phase) trf *phase ; {
+int run_exec(phase,prog) trf *phase ; char *prog ; {
int status, child, waitchild ;
do_flush();
quit(-5) ;
default:
error("%s died with signal %d",
- phase->t_prog,status&0177) ;
+ prog,status&0177) ;
}
/* The assumption is that processes voluntarely
dying with a non-zero status already produced
exit(1) ;
}
}
- execv(phase->t_prog,arglist) ;
+ execv(prog,arglist) ;
if ( phase->t_stdout ) { close(1) ; dup(2) ; }
- error("Cannot execute %s",phase->t_prog) ;
+ error("Cannot execute %s",prog) ;
exit(1) ;
/*NOTREACHED*/
}