14 |
|
|
15 |
|
#ifdef MSDOS |
16 |
|
#include <fcntl.h> |
17 |
+ |
extern int _fmode; |
18 |
|
#endif |
19 |
|
|
20 |
|
extern int fputs(); |
34 |
|
|
35 |
|
main(argc, argv) |
36 |
|
int argc; |
37 |
< |
char *argv[]; |
37 |
> |
char **argv; |
38 |
|
{ |
39 |
|
int dim = 0; |
40 |
|
FILE *fp; |
43 |
|
if (argc > 1 && !strcmp(argv[1], "-d")) { |
44 |
|
argc--; argv++; |
45 |
|
dim = 1; |
46 |
+ |
#ifdef MSDOS |
47 |
+ |
setmode(fileno(stdin), _fmode = O_BINARY); |
48 |
+ |
#endif |
49 |
|
} else if (argc == 2 && !strcmp(argv[1], "-")) { |
50 |
|
#ifdef MSDOS |
51 |
|
setmode(fileno(stdin), O_BINARY); |
52 |
|
setmode(fileno(stdout), O_BINARY); |
53 |
|
#endif |
54 |
< |
getheader(stdin, NULL); |
54 |
> |
getheader(stdin, NULL, NULL); |
55 |
|
copycat(); |
56 |
|
exit(0); |
57 |
|
} |
88 |
|
int j; |
89 |
|
register int c; |
90 |
|
|
91 |
< |
getheader(fp, NULL); /* skip header */ |
91 |
> |
getheader(fp, NULL, NULL); /* skip header */ |
92 |
|
|
93 |
|
switch (c = getc(fp)) { |
94 |
|
case '+': /* picture */ |
120 |
|
copycat() /* copy input to output */ |
121 |
|
{ |
122 |
|
register int c; |
123 |
< |
|
123 |
> |
|
124 |
|
while ((c = getchar()) != EOF) |
125 |
|
putchar(c); |
126 |
|
} |