--- ray/src/util/getinfo.c 2003/02/22 02:07:30 2.5 +++ ray/src/util/getinfo.c 2003/07/21 22:30:19 2.7 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: getinfo.c,v 2.5 2003/02/22 02:07:30 greg Exp $"; +static const char RCSid[] = "$Id: getinfo.c,v 2.7 2003/07/21 22:30:19 schorsch Exp $"; #endif /* * getinfo.c - program to read info. header from file. @@ -9,12 +9,8 @@ static const char RCSid[] = "$Id: getinfo.c,v 2.5 2003 #include -#ifdef MSDOS -#include -extern int _fmode; -#endif +#include "platform.h" -extern int fputs(); int @@ -42,14 +38,11 @@ char **argv; if (argc > 1 && !strcmp(argv[1], "-d")) { argc--; argv++; dim = 1; -#ifdef MSDOS - setmode(fileno(stdin), _fmode = O_BINARY); -#endif + SET_DEFAULT_BINARY(); /* for output file */ + SET_FILE_BINARY(stdin); } else if (argc == 2 && !strcmp(argv[1], "-")) { -#ifdef MSDOS - setmode(fileno(stdin), O_BINARY); - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); getheader(stdin, NULL, NULL); copycat(); exit(0); @@ -70,13 +63,14 @@ char **argv; fclose(fp); } } - if (argc == 1) + if (argc == 1) { if (dim) { getdim(stdin); } else { getheader(stdin, fputs, stdout); putchar('\n'); } + } exit(0); }