ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcode_ident.c
(Generate patch)

Comparing ray/src/util/rcode_ident.c (file contents):
Revision 2.1 by greg, Fri Jul 19 22:25:03 2019 UTC vs.
Revision 2.2 by greg, Fri Jul 19 22:57:12 2019 UTC

# Line 92 | Line 92 | create_index(const char *fname, int hdrflags, int ndxb
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;
# Line 188 | Line 190 | create_index(const char *fname, int hdrflags, int ndxb
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 */
# Line 339 | Line 342 | main(int argc, char *argv[])
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines