32 |
|
|
33 |
|
extern char *atos(); |
34 |
|
|
35 |
< |
extern char rifname[]; /* rad input file name */ |
35 |
> |
extern FILE *popen(); |
36 |
|
|
37 |
+ |
extern char rifname[128]; /* rad input file name */ |
38 |
+ |
|
39 |
|
extern char VersionID[]; |
40 |
|
extern char *progname; |
41 |
|
extern char *octname; |
165 |
|
|
166 |
|
if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ |
167 |
|
copystruct(&nv, &stdview); |
168 |
< |
if ((fname = getpath(buf, NULL, 0)) == NULL || |
168 |
> |
if ((fname = getpath(buf, "", R_OK)) == NULL || |
169 |
|
(success = viewfile(fname, &nv, NULL)) == -1) { |
170 |
|
sprintf(errmsg, "cannot open \"%s\"", buf); |
171 |
|
error(COMMAND, errmsg); |
195 |
|
char *fname; |
196 |
|
FILE *fp; |
197 |
|
|
198 |
< |
if (*atos(view, sizeof(view), s)) |
198 |
> |
if (*atos(view, sizeof(view), s)) { |
199 |
> |
if (isint(view)) { |
200 |
> |
error(COMMAND, "cannot write view by number"); |
201 |
> |
return; |
202 |
> |
} |
203 |
|
s = sskip(s); |
204 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
204 |
> |
} |
205 |
> |
while (isspace(*s)) |
206 |
> |
s++; |
207 |
> |
if (*s) |
208 |
> |
atos(rifname, sizeof(rifname), s); |
209 |
> |
else if (rifname[0] == '\0') { |
210 |
|
error(COMMAND, "no previous rad file"); |
211 |
|
return; |
212 |
|
} |
237 |
|
s = sskip(s); |
238 |
|
else |
239 |
|
strcat(buf, "1"); |
240 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
240 |
> |
if (*s) |
241 |
> |
atos(rifname, sizeof(rifname), s); |
242 |
> |
else if (rifname[0] == '\0') { |
243 |
|
error(COMMAND, "no previous rad file"); |
244 |
|
return; |
245 |
|
} |
246 |
< |
fname = getpath(rifname, NULL, 0); |
234 |
< |
if (fname == NULL || access(fname, R_OK) == -1) { |
246 |
> |
if ((fname = getpath(rifname, "", R_OK)) == NULL) { |
247 |
|
sprintf(errmsg, "cannot access \"%s\"", rifname); |
248 |
|
error(COMMAND, errmsg); |
249 |
|
return; |
637 |
|
(*dev->comout)("ray hit nothing"); |
638 |
|
else { |
639 |
|
sprintf(buf, "ray hit %s %s \"%s\"", |
640 |
< |
objptr(thisray.ro->omod)->oname, |
640 |
> |
thisray.ro->omod == OVOID ? VOIDID : |
641 |
> |
objptr(thisray.ro->omod)->oname, |
642 |
|
ofun[thisray.ro->otype].funame, |
643 |
|
thisray.ro->oname); |
644 |
|
(*dev->comout)(buf); |
671 |
|
COLR *scanline; |
672 |
|
int y; |
673 |
|
|
674 |
< |
if (sscanf(s, "%s", buf) != 1 && buf[0] == '\0') { |
674 |
> |
while (isspace(*s)) |
675 |
> |
s++; |
676 |
> |
if (*s) |
677 |
> |
atos(buf, sizeof(buf), s); |
678 |
> |
else if (buf[0] == '\0') { |
679 |
|
error(COMMAND, "no file"); |
680 |
|
return; |
681 |
|
} |