diff --git a/grep-2.5.1-oi.patch b/grep-2.5.1-oi.patch index 9ac03e6..f06a142 100644 --- a/grep-2.5.1-oi.patch +++ b/grep-2.5.1-oi.patch @@ -1,42 +1,46 @@ -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=72641 (sent upstream) - ---- grep-2.5.1/src/grep.c.oi 2002-10-13 20:58:55.000000000 +0100 -+++ grep-2.5.1/src/grep.c 2002-10-13 21:02:43.000000000 +0100 -@@ -533,6 +533,37 @@ - { - size_t match_size; - size_t match_offset; -+ if(match_icase) -+ { -+ char *buf = (char*) xmalloc (lim - beg); -+ char *ibeg = buf; -+ char *ilim = ibeg + (lim - beg); +--- grep-2.5.1/src/search.c.oi 2003-12-08 10:56:43.000000000 +0000 ++++ grep-2.5.1/src/search.c 2003-12-08 11:01:11.000000000 +0000 +@@ -219,6 +219,21 @@ + + patterns[pcount] = patterns0; + ++ // patch ed@javabase.fsnet.co.uk ++ if (match_icase ++#ifdef MBS_SUPPORT ++ && MB_CUR_MAX == 1 ++#endif /* MBS_SUPPORT */ ++ ) ++ { ++ static char trans[NCHAR]; + int i; -+ for (i = 0; i < lim - beg; i++) -+ ibeg[i] = tolower (beg[i]); -+ -+ while ((match_offset = (*execute) (ibeg, lim - beg, &match_size, 1)) -+ != (size_t) -1) -+ { -+ char const *b = ibeg + match_offset; -+ if (b == lim) -+ break; -+ if (match_size == 0) -+ break; -+ if(color_option) -+ printf("\33[%sm", grep_color); -+ fwrite(b, sizeof (char), match_size, stdout); -+ if(color_option) -+ fputs("\33[00m", stdout); -+ fputs("\n", stdout); -+ ibeg = b + match_size; -+ } -+ free (buf); -+ lastout = lim; -+ if(line_buffered) -+ fflush(stdout); -+ return; -+ } - while ((match_offset = (*execute) (beg, lim - beg, &match_size, 1)) - != (size_t) -1) - { ++ for (i = 0; i < NCHAR; ++i) ++ trans[i] = TOLOWER (i); ++ patterns[pcount].regexbuf.translate = trans; ++ } ++ // end patch ++ + if ((err = re_compile_pattern (motif, len, + &(patterns[pcount].regexbuf))) != 0) + error (2, 0, err); +@@ -302,6 +317,21 @@ + error (2, errno, _("memory exhausted")); + patterns[pcount] = patterns0; + ++ // patch ed@javabase.fsnet.co.uk ++ if (match_icase ++#ifdef MBS_SUPPORT ++ && MB_CUR_MAX == 1 ++#endif /* MBS_SUPPORT */ ++ ) ++ { ++ static char trans[NCHAR]; ++ int i; ++ for (i = 0; i < NCHAR; ++i) ++ trans[i] = TOLOWER (i); ++ patterns[pcount].regexbuf.translate = trans; ++ } ++ // end patch ++ + if ((err = re_compile_pattern (motif, len, + &(patterns[pcount].regexbuf))) != 0) + error (2, 0, err); diff --git a/grep.spec b/grep.spec index 7caae51..a77b633 100644 --- a/grep.spec +++ b/grep.spec @@ -1,5 +1,5 @@ %define beta %nil -%define rel 17.2 +%define rel 17.3 Summary: The GNU versions of grep pattern matching utilities. Name: grep Version: 2.5.1 @@ -11,8 +11,8 @@ Release: %{rel} License: GPL Group: Applications/Text Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}%{beta}.tar.bz2 -Patch0: grep-2.5.1-oi.patch -Patch1: grep-2.5-i18n.patch +Patch0: grep-2.5-i18n.patch +Patch1: grep-2.5.1-oi.patch Patch2: grep-2.5.1-manpage.patch Patch3: grep-2.5.1-gofast.patch Patch4: grep-2.5.1-efgrep.patch @@ -33,8 +33,8 @@ utility for searching through text. %prep %setup -q -n %{name}-%{version}%{beta} -%patch0 -p1 -b .oi -%patch1 -p1 -b .i18n +%patch0 -p1 -b .i18n +%patch1 -p1 -b .oi %patch2 -p1 -b .manpage %patch3 -p1 -b .gofast %patch4 -p1 -b .efgrep @@ -81,6 +81,12 @@ fi %{_mandir}/*/* %changelog +* Mon Dec 08 2003 Tim Waugh 2.5.1-17.3 +- Fixed -o -i properly (bug #111489). + +* Sat Dec 6 2003 Tim Waugh +- Another bug-fix for UTF-8 speed-up patch (bug #111614). + * Fri Nov 21 2003 Tim Waugh 2.5.1-17.2 - Another two multibyte efficiency bug-fixes (bug #110524).