| 92 |
|
long n; |
| 93 |
|
int ndx; |
| 94 |
|
/* open file if not stdin */ |
| 95 |
< |
if (fname && !(fp = fopen(fname, "r"))) { |
| 95 |
> |
if (!fname) |
| 96 |
> |
fname = "<stdin>"; |
| 97 |
> |
else if (!(fp = fopen(fname, "r"))) { |
| 98 |
|
fputs(fname, stderr); |
| 99 |
|
fputs(": cannot open for input\n", stderr); |
| 100 |
|
return 0; |
| 190 |
|
stderr); |
| 191 |
|
break; |
| 192 |
|
} |
| 193 |
< |
fclose(fp); /* done with input */ |
| 193 |
> |
if (fp != stdin) /* done with input */ |
| 194 |
> |
fclose(fp); |
| 195 |
|
for (ndx = 0; ndx < nextID; ndx++) { /* append string table */ |
| 196 |
|
fputs(idmap[ndx], stdout); |
| 197 |
|
putchar('\0'); /* nul-terminated IDs */ |
| 342 |
|
default: |
| 343 |
|
usage_exit(1); |
| 344 |
|
} |
| 345 |
+ |
if ((xres > 0) & (yres > 0)) /* user specified resolution? */ |
| 346 |
+ |
hdrflags &= ~HF_RESOUT; |
| 347 |
|
if (reverse && a >= argc) { |
| 348 |
|
fputs(progname, stderr); |
| 349 |
|
fputs(": -r option requires named input file\n", stderr); |