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

Comparing ray/src/util/getinfo.c (file contents):
Revision 2.21 by greg, Wed Jul 24 17:27:54 2019 UTC vs.
Revision 2.22 by greg, Thu Mar 3 22:54:49 2022 UTC

# Line 49 | Line 49 | main(
49   )
50   {
51          int  dim = 0;
52 +        char    fmt[MAXFMTLEN];
53          FILE  *fp;
54          int  i;
55  
# Line 61 | Line 62 | main(
62          flockfile(stdin);
63   #endif
64          SET_FILE_BINARY(stdin);
65 +        fmt[0] = '*'; fmt[1] = '\0';
66          if (argc > 2 && !strcmp(argv[1], "-c")) {
67                  SET_FILE_BINARY(stdout);
68                  setvbuf(stdin, NULL, _IONBF, 2);
69 <                if (getheader(stdin, (gethfunc *)fputs, stdout) < 0) {
69 >                if (checkheader(stdin, fmt, stdout) < 0) {
70                          fputs("Bad header!\n", stderr);
71                          return 1;
72                  }
73                  printargs(argc-2, argv+2, stdout);
74 +                if (fmt[0] != '*')              /* better be the same! */
75 +                        fputformat(fmt, stdout);
76                  fputc('\n', stdout);
77                  if (dim) {                      /* copy resolution string? */
78                          RESOLU  rs;
# Line 85 | Line 89 | main(
89                  return 1;
90          } else if (argc > 2 && !strcmp(argv[1], "-a")) {
91                  SET_FILE_BINARY(stdout);
92 <                if (getheader(stdin, (gethfunc *)fputs, stdout) < 0) {
92 >                if (checkheader(stdin, fmt, stdout) < 0) {
93                          fputs("Bad header!\n", stderr);
94                          return 1;
95                  }
# Line 96 | Line 100 | main(
100                          if (argv[i][len-1] != '\n')
101                                  fputc('\n', stdout);
102                  }
103 +                if (fmt[0] != '*')
104 +                        fputformat(fmt, stdout);
105                  fputc('\n', stdout);
106                  copycat();
107                  return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines