--- ray/src/px/ttyimage.c 1991/11/12 16:05:29 2.1 +++ ray/src/px/ttyimage.c 2003/02/22 02:07:28 2.3 @@ -1,9 +1,6 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ttyimage.c,v 2.3 2003/02/22 02:07:28 greg Exp $"; #endif - /* * ttyimage.c - program to dump pixel file to dumb terminal. * @@ -11,12 +8,16 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#ifdef MSDOS +#include +#endif +#include #include "color.h" #include "resolu.h" -#define NCOLS 133 +#define NCOLS 133 main(argc, argv) @@ -34,7 +35,9 @@ char **argv; fprintf(stderr, "%s: can't open file \"%s\"\n", argv[0], argv[1]); exit(1); } - +#ifdef MSDOS + setmode(fileno(input), O_BINARY); +#endif /* get picture dimensions */ if (checkheader(input, COLRFMT, NULL) < 0 || fgetresolu(&xres, &yres, input) < 0) { @@ -65,7 +68,7 @@ int shade(clr) /* return character for color */ COLR clr; { -#define NSHADES 13 +#define NSHADES 13 static char shadech[NSHADES+1] = " .,:;+?%&*$@#";