From bc34d964685c4cad719353abba82be95dd0eb284136320516d19f7580543e50d Mon Sep 17 00:00:00 2001 From: Philipp Thomas Date: Mon, 23 Aug 2010 09:57:26 +0000 Subject: [PATCH] - Only do freopen if O_BINARY is true. OBS-URL: https://build.opensuse.org/package/show/Base:System/diffutils?expand=0&rev=10 --- diffutils-no_binary_mode.patch | 13 +++++++++++++ diffutils.changes | 5 +++++ diffutils.spec | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 diffutils-no_binary_mode.patch diff --git a/diffutils-no_binary_mode.patch b/diffutils-no_binary_mode.patch new file mode 100644 index 0000000..8d9d195 --- /dev/null +++ b/diffutils-no_binary_mode.patch @@ -0,0 +1,13 @@ +Index: src/diff.c +=================================================================== +--- src/diff.c.orig 2010-08-20 12:12:57.564209017 +0200 ++++ src/diff.c 2010-08-20 12:14:04.231266936 +0200 +@@ -1087,7 +1087,7 @@ compare_files (struct comparison const * + else if (strcmp (cmp.file[f].name, "-") == 0) + { + cmp.file[f].desc = STDIN_FILENO; +- if (binary && ! isatty (STDIN_FILENO)) ++ if (O_BINARY && binary && ! isatty (STDIN_FILENO)) + freopen (NULL, "rb", stdin); + if (fstat (STDIN_FILENO, &cmp.file[f].stat) != 0) + cmp.file[f].desc = ERRNO_ENCODE (errno); diff --git a/diffutils.changes b/diffutils.changes index c0cfbc0..a9986ac 100644 --- a/diffutils.changes +++ b/diffutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Aug 20 10:15:36 UTC 2010 - pth@novell.com + +- Only do freopen if O_BINARY is true. + ------------------------------------------------------------------- Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de diff --git a/diffutils.spec b/diffutils.spec index b98536b..4aae737 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -32,6 +32,7 @@ Summary: GNU diff Utilities Source: diffutils-%{version}-cvs.tar.bz2 Patch1: diffutils-2.8.1-i18n-0.2.patch Patch2: diffutils-2.8.7-autoconf.patch +Patch3: diffutils-no_binary_mode.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -42,6 +43,7 @@ make source code patches, for instance. %setup -q -n %{name}-%{version}-cvs %patch1 -p1 %patch2 +%patch3 %build AUTOPOINT=true autoreconf -fi