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

Comparing ray/src/px/pflip.c (file contents):
Revision 2.9 by greg, Tue Aug 8 18:04:41 2006 UTC vs.
Revision 2.10 by greg, Thu May 17 17:36:14 2012 UTC

# Line 70 | Line 70 | main(
70                          correctorder++;
71                  else
72                          break;
73 +        if (i < argc-2)
74 +                goto userr;
75 +        if (!fhoriz && !fvert)
76 +                fprintf(stderr, "%s: warning - no operation\n", argv[0]);
77          if (i >= argc || argv[i][0] == '-') {
78 <                fprintf(stderr, "Usage: %s [-h][-v][-c] infile [outfile]\n",
79 <                                progname);
80 <                exit(1);
81 <        }
82 <        if ((fin = fopen(argv[i], "r")) == NULL) {
78 >                if (fvert)
79 >                        goto userr;
80 >                SET_FILE_BINARY(stdin);
81 >                fin = stdin;
82 >        } else if ((fin = fopen(argv[i], "r")) == NULL) {
83                  fprintf(stderr, "%s: cannot open\n", argv[i]);
84                  exit(1);
85          }
# Line 106 | Line 110 | main(
110                  scanfile();
111          flip();                         /* flip the image */
112          exit(0);
113 + userr:
114 +        fprintf(stderr, "Usage: %s [-h][-v][-c] infile [outfile]\n",
115 +                        progname);
116 +        exit(1);
117   }
118  
119  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines