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;