emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#25707: closed ([PATCH] grep: don't forcefully stri


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#25707: closed ([PATCH] grep: don't forcefully strip carriage returns)
Date: Tue, 15 Oct 2019 22:39:02 +0000

Your message dated Tue, 15 Oct 2019 15:37:54 -0700
with message-id <address@hidden>
and subject line Re: bug#25707: [PATCH] grep: don't forcefully strip carriage 
returns
has caused the debbugs.gnu.org bug report #25707,
regarding [PATCH] grep: don't forcefully strip carriage returns
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
25707: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25707
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] grep: don't forcefully strip carriage returns Date: Mon, 13 Feb 2017 13:23:58 -0600
Commit 5c92a54 made the mistaken assumption that using fopen("rt")
on platforms where O_TEXT is non-zero makes sense.  However, POSIX
already requires fopen("r") to open a file in text mode, vs.
fopen("rb") when binary mode is wanted, and at least on Cygwin,
where it is possible to control whether a mount point is binary
or text by default (using just "r"), the use of fopen("rt") actively
breaks assumptions on a binary mount by silently corrupting any
carriage returns that are supposed to be preserved.

* src/grep.c (main): Never use fopen("rt").
Signed-off-by: Eric Blake <address@hidden>
---
 src/grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/grep.c b/src/grep.c
index 74acb0b..ce8859b 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2586,7 +2586,7 @@ main (int argc, char **argv)
         break;

       case 'f':
-        fp = STREQ (optarg, "-") ? stdin : fopen (optarg, O_TEXT ? "rt" : "r");
+        fp = STREQ (optarg, "-") ? stdin : fopen (optarg, "r");
         if (!fp)
           die (EXIT_TROUBLE, errno, "%s", optarg);
         oldcc = keycc;
-- 
2.9.3




--- End Message ---
--- Begin Message --- Subject: Re: bug#25707: [PATCH] grep: don't forcefully strip carriage returns Date: Tue, 15 Oct 2019 15:37:54 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 No further comment for a couple of years, so I'm closing this bug report. Any remaining issues can be re-raised in a new report as needed.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]