rpms/grep/FC-6 grep-empty-pattern.patch, NONE, 1.1 grep.spec, 1.63, 1.64

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 22 19:38:37 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/grep/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv23610

Modified Files:
	grep.spec 
Added Files:
	grep-empty-pattern.patch 
Log Message:
* Wed Nov 22 2006 Tim Waugh <twaugh at redhat.com> 2.5.1-54.1.2
- Fixed count of patterns when the last is an empty string (bug #204255).
- Resolves: rhbz#204255


grep-empty-pattern.patch:
 grep.c   |    3 ---
 search.c |    8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

--- NEW FILE grep-empty-pattern.patch ---
--- grep-2.5.1a/src/grep.c.empty-pattern	2006-11-22 19:05:43.000000000 +0000
+++ grep-2.5.1a/src/grep.c	2006-11-22 19:22:04.000000000 +0000
@@ -1667,9 +1667,6 @@
 	  out_invert ^= 1;
 	  match_lines = match_words = 0;
 	}
-      else
-	/* Strip trailing newline. */
-        --keycc;
     }
   else
     if (optind < argc)
--- grep-2.5.1a/src/search.c.empty-pattern	2006-11-22 19:21:11.000000000 +0000
+++ grep-2.5.1a/src/search.c	2006-11-22 19:35:06.000000000 +0000
@@ -204,6 +204,10 @@
       motif = sep;
     } while (sep && total != 0);
 
+  /* Strip trailing newline. */
+  if (size && pattern[size - 1] == '\n')
+    size--;
+
   /* In the match_words and match_lines cases, we use a different pattern
      for the DFA matcher that will quickly throw out cases that won't work.
      Then if DFA succeeds we do some hairy stuff using the regex matcher
@@ -288,6 +292,10 @@
       motif = sep;
     } while (sep && total != 0);
 
+  /* Strip trailing newline. */
+  if (size && pattern[size - 1] == '\n')
+    size--;
+
   /* In the match_words and match_lines cases, we use a different pattern
      for the DFA matcher that will quickly throw out cases that won't work.
      Then if DFA succeeds we do some hairy stuff using the regex matcher


Index: grep.spec
===================================================================
RCS file: /cvs/dist/rpms/grep/FC-6/grep.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- grep.spec	22 Nov 2006 14:56:56 -0000	1.63
+++ grep.spec	22 Nov 2006 19:38:30 -0000	1.64
@@ -1,7 +1,7 @@
 Summary: The GNU versions of grep pattern matching utilities.
 Name: grep
 Version: 2.5.1
-Release: 54.1.1%{?dist}
+Release: 54.1.2%{?dist}
 License: GPL
 Group: Applications/Text
 Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}a.tar.bz2
@@ -19,6 +19,7 @@
 Patch13: grep-2.5.1-w.patch
 Patch14: grep-P.patch
 Patch15: grep-mem-exhausted.patch
+Patch16: grep-empty-pattern.patch
 URL: http://www.gnu.org/software/grep/
 Prereq: /sbin/install-info
 Buildroot: %{_tmppath}/%{name}-%{version}-root
@@ -49,6 +50,7 @@
 %patch13 -p1 -b .w
 %patch14 -p1 -b .P
 %patch15 -p1 -b .mem-exhausted
+%patch16 -p1 -b .empty-pattern
 chmod a+x tests/fmbtest.sh
 
 %build
@@ -98,6 +100,9 @@
 %{_mandir}/*/*
 
 %changelog
+* Wed Nov 22 2006 Tim Waugh <twaugh at redhat.com> 2.5.1-54.1.2
+- Fixed count of patterns when the last is an empty string (bug #204255).
+
 * Wed Nov 22 2006 Tim Waugh <twaugh at redhat.com> 2.5.1-54.1.1
 - Fix 'memory exhausted' errors by limiting in-memory buffer (bug #198165).
 




More information about the fedora-cvs-commits mailing list