From d617ac19fda3f2a0cb0a6afb8f4fd287d0801998 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 20 Sep 2012 13:04:32 +0200 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFFixing=20Cygwin=20read=20mode.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removing the \r\n → \n conversion. The goal is to have the same behavior in Cygwin as in Linux. --- gnulib | 2 +- sed/compile.c | 2 +- sed/sed.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gnulib b/gnulib index 13a006f..6418d7c 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 13a006f97fca894168e4c1aedfa780f83717c78c +Subproject commit 6418d7c9619803324fe72e226aa96db3763ca23b diff --git a/sed/compile.c b/sed/compile.c index f48f8ec..2b8c899 100644 --- a/sed/compile.c +++ b/sed/compile.c @@ -1605,7 +1605,7 @@ compile_file(cur_program, cmdfile) prog.file = stdin; if (cmdfile[0] != '-' || cmdfile[1] != '\0') - prog.file = ck_fopen(cmdfile, "rt", true); + prog.file = ck_fopen(cmdfile, read_mode, true); cur_input.line = 1; cur_input.name = cmdfile; diff --git a/sed/sed.c b/sed/sed.c index bab2296..cfab9da 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -78,7 +78,11 @@ bool follow_symlinks = false; char *in_place_extension = NULL; /* The mode to use to read files, either "rt" or "rb". */ +#ifndef __CYGWIN__ char *read_mode = "rt"; +#else +char *read_mode = "r"; +#endif /* Do we need to be pedantically POSIX compliant? */ enum posixicity_types posixicity;