32 |
|
|
33 |
|
extern char *atos(); |
34 |
|
|
35 |
< |
extern char rifname[]; /* rad input file name */ |
35 |
> |
extern char rifname[128]; /* rad input file name */ |
36 |
|
|
37 |
|
extern char VersionID[]; |
38 |
|
extern char *progname; |
163 |
|
|
164 |
|
if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ |
165 |
|
copystruct(&nv, &stdview); |
166 |
< |
if ((fname = getpath(buf, NULL, 0)) == NULL || |
166 |
> |
if ((fname = getpath(buf, "", R_OK)) == NULL || |
167 |
|
(success = viewfile(fname, &nv, NULL)) == -1) { |
168 |
|
sprintf(errmsg, "cannot open \"%s\"", buf); |
169 |
|
error(COMMAND, errmsg); |
193 |
|
char *fname; |
194 |
|
FILE *fp; |
195 |
|
|
196 |
< |
if (*atos(view, sizeof(view), s)) |
196 |
> |
if (*atos(view, sizeof(view), s)) { |
197 |
> |
if (isint(view)) { |
198 |
> |
error(COMMAND, "cannot write view by number"); |
199 |
> |
return; |
200 |
> |
} |
201 |
|
s = sskip(s); |
202 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
202 |
> |
} |
203 |
> |
while (isspace(*s)) |
204 |
> |
s++; |
205 |
> |
if (*s) |
206 |
> |
atos(rifname, sizeof(rifname), s); |
207 |
> |
else if (rifname[0] == '\0') { |
208 |
|
error(COMMAND, "no previous rad file"); |
209 |
|
return; |
210 |
|
} |
235 |
|
s = sskip(s); |
236 |
|
else |
237 |
|
strcat(buf, "1"); |
238 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
238 |
> |
if (*s) |
239 |
> |
atos(rifname, sizeof(rifname), s); |
240 |
> |
else if (rifname[0] == '\0') { |
241 |
|
error(COMMAND, "no previous rad file"); |
242 |
|
return; |
243 |
|
} |
244 |
< |
fname = getpath(rifname, NULL, 0); |
234 |
< |
if (fname == NULL || access(fname, R_OK) == -1) { |
244 |
> |
if ((fname = getpath(rifname, "", R_OK)) == NULL) { |
245 |
|
sprintf(errmsg, "cannot access \"%s\"", rifname); |
246 |
|
error(COMMAND, errmsg); |
247 |
|
return; |
668 |
|
COLR *scanline; |
669 |
|
int y; |
670 |
|
|
671 |
< |
if (sscanf(s, "%s", buf) != 1 && buf[0] == '\0') { |
671 |
> |
while (isspace(*s)) |
672 |
> |
s++; |
673 |
> |
if (*s) |
674 |
> |
atos(buf, sizeof(buf), s); |
675 |
> |
else if (buf[0] == '\0') { |
676 |
|
error(COMMAND, "no file"); |
677 |
|
return; |
678 |
|
} |