[sed] Fixed option handling rhbz#948598

FridolĂ­n PokornĂ˝ fpokorny at fedoraproject.org
Fri May 3 11:31:59 UTC 2013


commit a01d808e574a3f9a462f5b72c01a6e4af3a37e13
Author: Fridolin Pokorny <fpokorny at redhat.com>
Date:   Fri May 3 13:29:35 2013 +0200

    Fixed option handling rhbz#948598

 sed-4.2.2-fixed-opts.patch |   41 +++++++++++++++++++++++++++++++++++++++++
 sed.spec                   |    7 ++++++-
 2 files changed, 47 insertions(+), 1 deletions(-)
---
diff --git a/sed-4.2.2-fixed-opts.patch b/sed-4.2.2-fixed-opts.patch
new file mode 100644
index 0000000..d991271
--- /dev/null
+++ b/sed-4.2.2-fixed-opts.patch
@@ -0,0 +1,41 @@
+diff -upr sed-4.2.2/sed/sed.c sed-4.2.2_new/sed/sed.c
+--- sed-4.2.2/sed/sed.c	2013-05-03 13:15:23.841235793 +0200
++++ sed-4.2.2_new/sed/sed.c	2013-05-03 13:15:23.842235796 +0200
+@@ -163,14 +163,21 @@ main(argc, argv)
+   int argc;
+   char **argv;
+ {
+-#ifdef REG_PERL
+-#define SHORTOPTS "bcsnrzRuEe:f:l:i::V:"
++#if defined(REG_PERL) && \
++    (defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__))
++#define SHORTOPTS "bsnrzRuEe:f:l:i::V:"
++#elif defined(REG_PERL)
++#define SHORTOPTS "snrzRuEe:f:l:i::V:"
++#elif defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
++#define SHORTOPTS "bsnrzuEe:f:l:i::V:"
+ #else
+-#define SHORTOPTS "bcsnrzuEe:f:l:i::V:"
++#define SHORTOPTS "snrzuEe:f:l:i::V:"
+ #endif
+ 
+   static struct option longopts[] = {
++#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
+     {"binary", 0, NULL, 'b'},
++#endif
+     {"regexp-extended", 0, NULL, 'r'},
+ #ifdef REG_PERL
+     {"regexp-perl", 0, NULL, 'R'},
+@@ -283,10 +290,12 @@ main(argc, argv)
+ 	  posixicity = POSIXLY_BASIC;
+ 	  break;
+ 
++#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
+         case 'b':
+ 	  read_mode = "rb";
+ 	  write_mode = "wb";
+ 	  break;
++#endif
+ 
+ 	/* Undocumented, for compatibility with BSD sed.  */
+ 	case 'E':
diff --git a/sed.spec b/sed.spec
index 8f07027..b194665 100644
--- a/sed.spec
+++ b/sed.spec
@@ -6,13 +6,14 @@
 Summary: A GNU stream text editor
 Name: sed
 Version: 4.2.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv3+
 Group: Applications/Text
 URL: http://sed.sourceforge.net/
 Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.bz2
 Source1: http://sed.sourceforge.net/sedfaq.txt
 Patch0: sed-4.2.2-copy.patch
+Patch1: sed-4.2.2-fixed-opts.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: glibc-devel, libselinux-devel
 Requires(post): /sbin/install-info
@@ -31,6 +32,7 @@ specified in a script file or from the command line.
 %prep
 %setup -q
 %patch0 -p1 -b .copy
+%patch1 -p1 -b .fixed-opts
 
 %build
 %configure --without-included-regex
@@ -71,6 +73,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_mandir}/man*/*
 
 %changelog
+* Fri May 03 2013 Fridolin Pokorny <fpokorny at redhat.com> - 4.2.2-3
+- Fixed option handling rhbz#948598
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.2.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list