Exit with non-zero exit code when error occurs.
Chris Pressey
3 years ago
58 | 58 | - use %% instead of %c with '%' being passed in |
59 | 59 | - avoid freeing fo/fi on failure to open |
60 | 60 | removed -p flag as it is equivalent to |
61 | `-w 80 -h 25`, just use that instread | |
61 | `-w 80 -h 25`, just use that instead | |
62 | show usage and exit if unrecognized command-line | |
63 | options are given | |
64 | exit with a non-zero exit code if an error occurs | |
62 | 65 | |
63 | 66 | v0.94: Sep 2004, Chris Pressey |
64 | 67 | display correct version number |
197 | 200 | } else |
198 | 201 | { |
199 | 202 | printf ("Error : couldn't open '%s' for input.\n", argv[argc - 1]); |
200 | exit (0); | |
203 | exit (1); | |
201 | 204 | } |
202 | 205 | |
203 | 206 | if (!(fo = fopen (argv[argc - 1], "w"))) /*** Output */ |
204 | 207 | { |
205 | 208 | printf ("Error : couldn't open '%s' for output.\n", argv[argc - 1]); |
206 | exit (0); | |
209 | exit (1); | |
207 | 210 | } |
208 | 211 | |
209 | 212 | printf ("Compiling"); |