Fixed grep to be consistent in 'grep -Pc' and 'grep -P | wc -l'
Resolves: rhbz#1269014
This commit is contained in:
parent
ba174f15d5
commit
a403fe66ef
24
grep-2.22-Pc-consistent-results.patch
Normal file
24
grep-2.22-Pc-consistent-results.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/src/grep.c b/src/grep.c
|
||||||
|
--- a/src/grep.c
|
||||||
|
+++ b/src/grep.c
|
||||||
|
@@ -1415,13 +1415,13 @@ grep (int fd, struct stat const *st)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Detect whether leading context is adjacent to previous output. */
|
||||||
|
- if (lastout)
|
||||||
|
- {
|
||||||
|
- if (textbin == TEXTBIN_UNKNOWN)
|
||||||
|
- textbin = TEXTBIN_TEXT;
|
||||||
|
- if (beg != lastout)
|
||||||
|
- lastout = 0;
|
||||||
|
- }
|
||||||
|
+ if (beg != lastout)
|
||||||
|
+ lastout = 0;
|
||||||
|
+
|
||||||
|
+ /* If the file's textbin has not been determined yet, assume
|
||||||
|
+ it's text if has found any matched line already. */
|
||||||
|
+ if (textbin == TEXTBIN_UNKNOWN && nlines)
|
||||||
|
+ textbin = TEXTBIN_TEXT;
|
||||||
|
|
||||||
|
/* Handle some details and read more data to scan. */
|
||||||
|
save = residue + lim - beg;
|
@ -3,7 +3,7 @@
|
|||||||
Summary: Pattern matching utilities
|
Summary: Pattern matching utilities
|
||||||
Name: grep
|
Name: grep
|
||||||
Version: 2.22
|
Version: 2.22
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: http://www.gnu.org/software/grep/
|
URL: http://www.gnu.org/software/grep/
|
||||||
Group: Applications/Text
|
Group: Applications/Text
|
||||||
@ -18,6 +18,8 @@ Patch0: grep-2.22-man-fix-gs.patch
|
|||||||
# upstream ticket 39445
|
# upstream ticket 39445
|
||||||
Patch1: grep-2.22-help-align.patch
|
Patch1: grep-2.22-help-align.patch
|
||||||
Patch2: grep-2.22-disable-performance-related-tests.patch
|
Patch2: grep-2.22-disable-performance-related-tests.patch
|
||||||
|
# backported from upstream, upstream bug#22028
|
||||||
|
Patch3: grep-2.22-Pc-consistent-results.patch
|
||||||
Requires(post): /sbin/install-info
|
Requires(post): /sbin/install-info
|
||||||
Requires(preun): /sbin/install-info
|
Requires(preun): /sbin/install-info
|
||||||
|
|
||||||
@ -42,6 +44,7 @@ GNU grep is needed by many scripts, so it shall be installed on every system.
|
|||||||
# to measured runtime, which doesn't work reliable on the builders with
|
# to measured runtime, which doesn't work reliable on the builders with
|
||||||
# variable load.
|
# variable load.
|
||||||
%patch2 -p1 -b .disable-performance-related-tests
|
%patch2 -p1 -b .disable-performance-related-tests
|
||||||
|
%patch3 -p1 -b .Pc-consistent-results
|
||||||
|
|
||||||
chmod 755 tests/kwset-abuse
|
chmod 755 tests/kwset-abuse
|
||||||
|
|
||||||
@ -94,6 +97,10 @@ fi
|
|||||||
%{_libexecdir}/grepconf.sh
|
%{_libexecdir}/grepconf.sh
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 1 2015 Jaroslav Škarvada <jskarvad@redhat.com> - 2.22-3
|
||||||
|
- Fixed grep to be consistent in 'grep -Pc' and 'grep -P | wc -l'
|
||||||
|
Resolves: rhbz#1269014
|
||||||
|
|
||||||
* Thu Nov 5 2015 Jaroslav Škarvada <jskarvad@redhat.com> - 2.22-2
|
* Thu Nov 5 2015 Jaroslav Škarvada <jskarvad@redhat.com> - 2.22-2
|
||||||
- Disabled performance related tests
|
- Disabled performance related tests
|
||||||
(by disable-performance-related-tests patch), patch backported from upstream
|
(by disable-performance-related-tests patch), patch backported from upstream
|
||||||
|
Loading…
Reference in New Issue
Block a user