(main): Avoid setmode; use POSIX-specified routines instead.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Jul 2005 18:24:42 +0000 (18:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Jul 2005 18:24:42 +0000 (18:24 +0000)
src/split.c

index a93fdff..7c357c8 100644 (file)
@@ -541,7 +541,8 @@ main (int argc, char **argv)
           quote (infile));
 
   /* Binary I/O is safer when bytecounts are used.  */
-  SET_BINARY (STDIN_FILENO);
+  if (O_BINARY && ! isatty (STDIN_FILENO))
+    freopen (NULL, "rb", stdin);
 
   /* No output file is open now.  */
   output_desc = -1;