207 |
|
|
208 |
|
fgetline(buf, sizeof(buf), fin); |
209 |
|
if (expand) { |
210 |
< |
if (xac > 2) { |
211 |
< |
if ((pin = popen(buf+1, "r")) == NULL) { |
212 |
< |
fprintf(stderr, |
213 |
< |
"%s: (%s): cannot execute \"%s\"\n", |
214 |
< |
progname, fname, buf); |
215 |
< |
exit(1); |
216 |
< |
} |
217 |
< |
xform(buf, pin); |
218 |
< |
pclose(pin); |
219 |
< |
} else { |
220 |
< |
fflush(stdout); |
221 |
< |
system(buf+1); |
210 |
> |
if ((pin = popen(buf+1, "r")) == NULL) { |
211 |
> |
fprintf(stderr, "%s: (%s): cannot execute \"%s\"\n", |
212 |
> |
progname, fname, buf); |
213 |
> |
exit(1); |
214 |
|
} |
215 |
+ |
xform(buf, pin); |
216 |
+ |
pclose(pin); |
217 |
|
} else { |
218 |
|
printf("\n%s", buf); |
219 |
|
if (xac > 1) { |
242 |
|
progname, fname, typ); |
243 |
|
exit(1); |
244 |
|
} |
245 |
< |
if (issurface(fn)) |
245 |
> |
if (ismodifier(fn)) |
246 |
> |
printf("\n%s %s ", nam, typ); |
247 |
> |
else |
248 |
|
printf("\n%s %s ", newmod != NULL ? newmod : nam, |
249 |
|
invert ? ofun[tinvers[fn]].funame : typ); |
254 |
– |
else |
255 |
– |
printf("\n%s %s ", nam, typ); |
250 |
|
/* object name */ |
251 |
|
fgetword(nam, sizeof(nam), fin); |
252 |
< |
if (idprefix != NULL && issurface(fn)) |
259 |
< |
printf("%s.%s\n", idprefix, nam); |
260 |
< |
else |
252 |
> |
if (idprefix == NULL || ismodifier(fn)) |
253 |
|
printf("%s\n", nam); |
254 |
+ |
else |
255 |
+ |
printf("%s.%s\n", idprefix, nam); |
256 |
|
/* transform arguments */ |
257 |
|
if ((*ofun[fn].funp)(fin) < 0) { |
258 |
|
fprintf(stderr, "%s: (%s): bad %s \"%s\"\n", |
298 |
|
FILE *fin; |
299 |
|
{ |
300 |
|
register int i; |
301 |
+ |
int resetarr = 0; |
302 |
|
FUNARGS fa; |
303 |
|
|
304 |
|
if (readfargs(&fa, fin) != 1) |
305 |
|
return(-1); |
306 |
|
/* string arguments */ |
307 |
< |
printf("%d", fa.nsargs + xac-xfa); |
307 |
> |
if (xac > xfa && strcmp(xav[xfa], "-i")) |
308 |
> |
resetarr = 2; |
309 |
> |
printf("%d", fa.nsargs + resetarr + xac-xfa); |
310 |
|
for (i = 0; i < fa.nsargs; i++) |
311 |
|
printf(" %s", fa.sarg[i]); |
312 |
+ |
if (resetarr) |
313 |
+ |
printf(" -i 1"); |
314 |
|
for (i = xfa; i < xac; i++) /* add xf arguments */ |
315 |
|
printf(" %s", xav[i]); |
316 |
|
printf("\n"); |