From 3f5b4e35ccb5666749201bf8b3ffc667c0709baf Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 14 Apr 1996 17:11:47 +0000 Subject: [PATCH] (main) [DJGPP v2]: Don't change to binary for a tty. --- lib-src/hexl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib-src/hexl.c b/lib-src/hexl.c index 417d9f285d1..beb170613dd 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -138,7 +138,8 @@ main (argc, argv) #ifdef MSDOS #if __DJGPP__ >= 2 - setmode (fileno (stdout), O_BINARY); + if (!isatty (fileno (stdout))) + setmode (fileno (stdout), O_BINARY); #else (stdout)->_flag &= ~_IOTEXT; /* print binary */ _setmode (fileno (stdout), O_BINARY); @@ -186,7 +187,8 @@ main (argc, argv) { #ifdef MSDOS #if __DJGPP__ >= 2 - setmode (fileno (stdout), O_BINARY); + if (!isatty (fileno (fp))) + setmode (fileno (fp), O_BINARY); #else (fp)->_flag &= ~_IOTEXT; /* read binary */ _setmode (fileno (fp), O_BINARY); -- 2.39.2