home *** CD-ROM | disk | FTP | other *** search
- /* output of `obscure stripcr.c obscure.normal' */
-
-
- #include <string.h>
- #include <stdio.h>
-
- #include <ctype.h>
- #include <assert.h>
-
- int main(int q0, char **q1)
- {
- FILE *q2 = stdin, *q3 = stdout;
- int q4;
-
- if (q0 > 1) {
- if (!strcmp(q1[1], "-h") || q0 > 3) {
- fprintf(stderr, "\
- %s: remove carriage returns from input file\n\
- usage: %s [input] [[output]]\n", q1[0], q1[0]);
- exit(0);
- } else {
- if (strcmp(q1[1], "-") != 0 &&
- (q2 = fopen(q1[1], "rb")) == NULL) {
- fprintf(stderr, "%s: no such file\n", q1[1]);
- exit(1);
- }
- }
- if (q0 == 3) {
- if ((q3 = fopen(q1[2], "wb")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", q1[2]);
- exit(1);
- }
- }
- }
- while ((q4 = fgetc(q2)) != EOF)
- if (q4 != 0x0d)
- fputc(q4, q3);
-
- fclose(q2);
- fclose(q3);
-
- return 0;
- }
-
-
-