8 |
|
*/ |
9 |
|
|
10 |
|
#include <stdlib.h> |
11 |
– |
#include <fcntl.h> |
12 |
– |
#include <stdio.h> |
13 |
– |
#include <string.h> |
11 |
|
#include <math.h> |
12 |
|
#include <ctype.h> |
13 |
|
|
104 |
|
char *argv[] |
105 |
|
) |
106 |
|
{ |
107 |
+ |
char *fpath; |
108 |
|
int i; |
109 |
|
|
110 |
|
esupport |= E_VARIABLE|E_FUNCTION|E_INCHAN|E_OUTCHAN|E_RCONST; |
134 |
|
svpreset(argv[++i]); |
135 |
|
break; |
136 |
|
case 'f': |
137 |
< |
fcompile(argv[++i]); |
137 |
> |
fpath = getpath(argv[++i], getrlibpath(), 0); |
138 |
> |
if (fpath == NULL) { |
139 |
> |
eputs(argv[0]); |
140 |
> |
eputs(": cannot find file '"); |
141 |
> |
eputs(argv[i]); |
142 |
> |
eputs("'\n"); |
143 |
> |
quit(1); |
144 |
> |
} |
145 |
> |
fcompile(fpath); |
146 |
|
break; |
147 |
|
case 'e': |
148 |
|
scompile(argv[++i], NULL, 0); |
311 |
|
|
312 |
|
while (getinputrec(fp)) { |
313 |
|
varset("recno", '=', (double)++nrecs); |
314 |
+ |
varset("outno", '=', (double)(nout+1)); |
315 |
|
colflg = 0; |
316 |
|
eclock++; |
317 |
|
if (!conditional || varvalue("cond") > 0.0) { |
311 |
– |
varset("outno", '=', (double)++nout); |
318 |
|
putout(); |
319 |
+ |
++nout; |
320 |
|
} |
321 |
|
} |
322 |
|
fclose(fp); |