summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/split.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/split.c b/src/split.c
index a93fdffed..7c357c8ef 100644
--- a/src/split.c
+++ b/src/split.c
@@ -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;