summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-03-05 21:41:24 +0000
committerMike Frysinger <vapier@gentoo.org>2010-03-05 21:41:24 +0000
commitc2012e2998704666836aed81d0fc594b2a579089 (patch)
tree22312c54a302d563a5b2b79a313060533fab82d8 /sys-apps/grep
parentupstream patch for wheel handling (bug #307901) (diff)
downloadgentoo-2-c2012e2998704666836aed81d0fc594b2a579089.tar.gz
gentoo-2-c2012e2998704666836aed81d0fc594b2a579089.tar.bz2
gentoo-2-c2012e2998704666836aed81d0fc594b2a579089.zip
punt old files
(Portage version: 2.2_rc65/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/grep')
-rw-r--r--sys-apps/grep/files/2.5.1-utf8-case.patch29
-rw-r--r--sys-apps/grep/files/grep-2.5.1-bracket.patch11
-rw-r--r--sys-apps/grep/files/grep-2.5.1-color.patch10
-rw-r--r--sys-apps/grep/files/grep-2.5.1-fgrep.patch196
-rw-r--r--sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch55
-rw-r--r--sys-apps/grep/files/grep-2.5.1-i18n.patch305
-rw-r--r--sys-apps/grep/files/grep-2.5.1-libintl.patch99
-rw-r--r--sys-apps/grep/files/grep-2.5.1-manpage.patch21
-rw-r--r--sys-apps/grep/files/grep-2.5.1-oi.patch50
-rw-r--r--sys-apps/grep/files/grep-2.5.1-perl-segv.patch19
-rw-r--r--sys-apps/grep/files/grep-2.5.1-restrict_arr.patch11
-rw-r--r--sys-apps/grep/files/grep-2.5.1a-nls.patch39
-rw-r--r--sys-apps/grep/files/grep-2.5.3-yesno-test-fix.patch32
13 files changed, 0 insertions, 877 deletions
diff --git a/sys-apps/grep/files/2.5.1-utf8-case.patch b/sys-apps/grep/files/2.5.1-utf8-case.patch
deleted file mode 100644
index c8842709daf9..000000000000
--- a/sys-apps/grep/files/2.5.1-utf8-case.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Grabbed from Debian:
-http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=249245
-
-To fix Gentoo bug:
-http://bugs.gentoo.org/show_bug.cgi?id=76192
-
---- grep-2.5.1.orig/src/dfa.c 2004-10-19 02:07:23.000000000 +0900
-+++ grep-2.5.1/src/dfa.c 2004-10-19 02:24:28.000000000 +0900
-@@ -652,6 +652,20 @@
- REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
- work_mbc->nchars + 1);
- work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
-+ if (case_fold && (iswlower((wint_t) wc) || iswupper((wint_t) wc)))
-+ {
-+ wint_t altcase;
-+
-+ altcase = wc; /* keeps compiler happy */
-+ if (iswlower((wint_t) wc))
-+ altcase = towupper((wint_t) wc);
-+ else if (iswupper((wint_t) wc))
-+ altcase = towlower((wint_t) wc);
-+
-+ REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
-+ work_mbc->nchars + 1);
-+ work_mbc->chars[work_mbc->nchars++] = (wchar_t) altcase;
-+ }
- }
- }
- while ((wc = wc1) != L']');
diff --git a/sys-apps/grep/files/grep-2.5.1-bracket.patch b/sys-apps/grep/files/grep-2.5.1-bracket.patch
deleted file mode 100644
index f99571c02034..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-bracket.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- grep-2.5.1/src/dfa.c.bracket 2003-10-30 16:21:14.000000000 +0000
-+++ grep-2.5.1/src/dfa.c 2003-10-30 16:22:38.000000000 +0000
-@@ -586,7 +586,7 @@
- work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
- }
- }
-- wc = -1;
-+ wc1 = wc = -1;
- }
- else
- /* We treat '[' as a normal character here. */
diff --git a/sys-apps/grep/files/grep-2.5.1-color.patch b/sys-apps/grep/files/grep-2.5.1-color.patch
deleted file mode 100644
index f54c258e114a..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-color.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- grep-2.5.1/src/grep.c.color 2004-11-16 16:46:22.845505847 +0000
-+++ grep-2.5.1/src/grep.c 2004-11-16 16:46:27.961530537 +0000
-@@ -607,6 +607,7 @@
- fputs ("\33[00m", stdout);
- beg = b + match_size;
- }
-+ fputs ("\33[K", stdout);
- }
- fwrite (beg, 1, lim - beg, stdout);
- if (ferror (stdout))
diff --git a/sys-apps/grep/files/grep-2.5.1-fgrep.patch b/sys-apps/grep/files/grep-2.5.1-fgrep.patch
deleted file mode 100644
index 49edf4a76e42..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-fgrep.patch
+++ /dev/null
@@ -1,196 +0,0 @@
---- grep-2.5.1/src/search.c
-+++ grep-2.5.1/src/search.c
-@@ -360,13 +360,7 @@
- /* Find a possible match using the KWset matcher. */
- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
- if (offset == (size_t) -1)
-- {
--#ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1)
-- free(mb_properties);
--#endif
-- return (size_t)-1;
-- }
-+ goto failure;
- beg += offset;
- /* Narrow down to the line containing the candidate, and
- run it through DFA. */
-@@ -379,7 +373,7 @@
- while (beg > buf && beg[-1] != eol)
- --beg;
- if (kwsm.index < kwset_exact_matches)
-- goto success;
-+ goto success_in_beg_and_end;
- if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
- continue;
- }
-@@ -398,7 +392,7 @@
- }
- /* Successful, no backreferences encountered! */
- if (!backref)
-- goto success;
-+ goto success_in_beg_and_end;
- }
- else
- end = beg + size;
-@@ -413,14 +407,11 @@
- end - beg - 1, &(patterns[i].regs))))
- {
- len = patterns[i].regs.end[0] - start;
-- if (exact)
-- {
-- *match_size = len;
-- return start;
-- }
-+ if (exact && !match_words)
-+ goto success_in_start_and_len;
- if ((!match_lines && !match_words)
- || (match_lines && len == end - beg - 1))
-- goto success;
-+ goto success_in_beg_and_end;
- /* If -w, check if the match aligns with word boundaries.
- We do this iteratively because:
- (a) the line may contain more than one occurence of the
-@@ -434,7 +425,7 @@
- if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1]))
- && (len == end - beg - 1
- || !WCHAR ((unsigned char) beg[start + len])))
-- goto success;
-+ goto success_in_start_and_len;
- if (len > 0)
- {
- /* Try a shorter length anchored at the same place. */
-@@ -461,19 +452,26 @@
- }
- } /* for Regex patterns. */
- } /* for (beg = end ..) */
-+
-+ failure:
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && mb_properties)
- free (mb_properties);
- #endif /* MBS_SUPPORT */
- return (size_t) -1;
-
-- success:
-+ success_in_beg_and_end:
-+ len = end - beg;
-+ start = beg - buf;
-+ /* FALLTHROUGH */
-+
-+ success_in_start_and_len:
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && mb_properties)
- free (mb_properties);
- #endif /* MBS_SUPPORT */
-- *match_size = end - beg;
-- return beg - buf;
-+ *match_size = len;
-+ return start;
- }
-
- static void
-@@ -516,28 +514,15 @@
- {
- size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
- if (offset == (size_t) -1)
-- {
--#ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1)
-- free(mb_properties);
--#endif /* MBS_SUPPORT */
-- return offset;
-- }
-+ goto failure;
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0)
- continue; /* It is a part of multibyte character. */
- #endif /* MBS_SUPPORT */
- beg += offset;
- len = kwsmatch.size[0];
-- if (exact)
-- {
-- *match_size = len;
--#ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1)
-- free (mb_properties);
--#endif /* MBS_SUPPORT */
-- return beg - buf;
-- }
-+ if (exact && !match_words)
-+ goto success_in_beg_and_len;
- if (match_lines)
- {
- if (beg > buf && beg[-1] != eol)
-@@ -547,31 +532,37 @@
- goto success;
- }
- else if (match_words)
-- for (try = beg; len; )
-- {
-- if (try > buf && WCHAR((unsigned char) try[-1]))
-- break;
-- if (try + len < buf + size && WCHAR((unsigned char) try[len]))
-- {
-- offset = kwsexec (kwset, beg, --len, &kwsmatch);
-- if (offset == (size_t) -1)
-- {
--#ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1)
-- free (mb_properties);
--#endif /* MBS_SUPPORT */
-- return offset;
-- }
-- try = beg + offset;
-- len = kwsmatch.size[0];
-- }
-- else
-- goto success;
-- }
-+ {
-+ while (offset >= 0)
-+ {
-+ if ((offset == 0 || !WCHAR ((unsigned char) beg[-1]))
-+ && (len == end - beg - 1 || !WCHAR ((unsigned char) beg[len])))
-+ {
-+ if (!exact)
-+ /* Returns the whole line now we know there's a word match. */
-+ goto success;
-+ else
-+ /* Returns just this word match. */
-+ goto success_in_beg_and_len;
-+ }
-+ if (len > 0)
-+ {
-+ /* Try a shorter length anchored at the same place. */
-+ --len;
-+ offset = kwsexec (kwset, beg, len, &kwsmatch);
-+ if (offset == -1) {
-+ break; /* Try a different anchor. */
-+ }
-+ beg += offset;
-+ len = kwsmatch.size[0];
-+ }
-+ }
-+ }
- else
- goto success;
- }
-
-+ failure:
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- free (mb_properties);
-@@ -583,7 +574,11 @@
- end++;
- while (buf < beg && beg[-1] != eol)
- --beg;
-- *match_size = end - beg;
-+ len = end - beg;
-+ /* FALLTHROUGH */
-+
-+ success_in_beg_and_len:
-+ *match_size = len;
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- free (mb_properties);
diff --git a/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch b/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch
deleted file mode 100644
index aff800c32d85..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-http://bugs.gentoo.org/113640
-
-2004-11-20 Benno Schulenberg <benno@nietvergeten.nl> (tiny change)
-
- * src/grep.c (reset): Move the stat check ...
- (grepfile): ... here, and also check for a fifo.
-
-Index: src/grep.c
-===================================================================
-RCS file: /cvsroot/grep/grep/src/grep.c,v
-retrieving revision 1.83
-retrieving revision 1.84
-diff -u -p -r1.83 -r1.84
---- src/grep.c 20 Nov 2004 16:15:57 -0000 1.83
-+++ src/grep.c 20 Nov 2004 16:20:38 -0000 1.84
-@@ -255,19 +255,6 @@ reset (int fd, char const *file, struct
- bufbeg[-1] = eolbyte;
- bufdesc = fd;
-
-- if (fstat (fd, &stats->stat) != 0)
-- {
-- error (0, errno, "fstat");
-- return 0;
-- }
-- if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
-- return 0;
--#ifndef DJGPP
-- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
--#else
-- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
--#endif
-- return 0;
- if (S_ISREG (stats->stat.st_mode))
- {
- if (file)
-@@ -928,6 +915,19 @@ grepfile (char const *file, struct stats
- }
- else
- {
-+ if (stat (file, &stats->stat) != 0)
-+ {
-+ suppressible_error (file, errno);
-+ return 1;
-+ }
-+ if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
-+ return 1;
-+#ifndef DJGPP
-+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
-+#else
-+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
-+#endif
-+ return 1;
- while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
- continue;
-
diff --git a/sys-apps/grep/files/grep-2.5.1-i18n.patch b/sys-apps/grep/files/grep-2.5.1-i18n.patch
deleted file mode 100644
index 6c081400fff5..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-i18n.patch
+++ /dev/null
@@ -1,305 +0,0 @@
-Ripped from Fedora
-
---- grep-2.5.1/src/dfa.c 2004-02-26 13:09:54.000000000 +0000
-+++ grep-2.5.1/src/dfa.c 2004-05-18 16:43:31.189200479 +0100
-@@ -414,7 +414,7 @@
-
- /* This function fetch a wide character, and update cur_mb_len,
- used only if the current locale is a multibyte environment. */
--static wchar_t
-+static wint_t
- fetch_wc (char const *eoferr)
- {
- wchar_t wc;
-@@ -423,7 +423,7 @@
- if (eoferr != 0)
- dfaerror (eoferr);
- else
-- return -1;
-+ return WEOF;
- }
-
- cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
-@@ -459,7 +459,7 @@
- static void
- parse_bracket_exp_mb ()
- {
-- wchar_t wc, wc1, wc2;
-+ wint_t wc, wc1, wc2;
-
- /* Work area to build a mb_char_classes. */
- struct mb_char_classes *work_mbc;
-@@ -496,7 +496,7 @@
- work_mbc->invert = 0;
- do
- {
-- wc1 = -1; /* mark wc1 is not initialized". */
-+ wc1 = WEOF; /* mark wc1 is not initialized". */
-
- /* Note that if we're looking at some other [:...:] construct,
- we just treat it as a bunch of ordinary characters. We can do
-@@ -586,7 +586,7 @@
- work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
- }
- }
-- wc1 = wc = -1;
-+ wc1 = wc = WEOF;
- }
- else
- /* We treat '[' as a normal character here. */
-@@ -600,7 +600,7 @@
- wc = fetch_wc(("Unbalanced ["));
- }
-
-- if (wc1 == -1)
-+ if (wc1 == WEOF)
- wc1 = fetch_wc(_("Unbalanced ["));
-
- if (wc1 == L'-')
-@@ -630,17 +630,17 @@
- }
- REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
- range_sts_al, work_mbc->nranges + 1);
-- work_mbc->range_sts[work_mbc->nranges] = wc;
-+ work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
- REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
- range_ends_al, work_mbc->nranges + 1);
-- work_mbc->range_ends[work_mbc->nranges++] = wc2;
-+ work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
- }
-- else if (wc != -1)
-+ else if (wc != WEOF)
- /* build normal characters. */
- {
- REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
- work_mbc->nchars + 1);
-- work_mbc->chars[work_mbc->nchars++] = wc;
-+ work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
- }
- }
- while ((wc = wc1) != L']');
-@@ -2552,6 +2552,8 @@
- }
-
- /* match with a character? */
-+ if (case_fold)
-+ wc = towlower (wc);
- for (i = 0; i<work_mbc->nchars; i++)
- {
- if (wc == work_mbc->chars[i])
---- grep-2.5.1/src/grep.c.i18n 2002-03-26 15:54:12.000000000 +0000
-+++ grep-2.5.1/src/grep.c 2004-02-26 13:09:54.000000000 +0000
-@@ -30,6 +30,12 @@
- # include <sys/time.h>
- # include <sys/resource.h>
- #endif
-+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
-+/* We can handle multibyte string. */
-+# define MBS_SUPPORT
-+# include <wchar.h>
-+# include <wctype.h>
-+#endif
- #include <stdio.h>
- #include "system.h"
- #include "getopt.h"
-@@ -1697,6 +1703,37 @@
- if (!install_matcher (matcher) && !install_matcher ("default"))
- abort ();
-
-+#ifdef MBS_SUPPORT
-+ if (MB_CUR_MAX != 1 && match_icase)
-+ {
-+ wchar_t wc;
-+ mbstate_t cur_state, prev_state;
-+ int i, len = strlen(keys);
-+
-+ memset(&cur_state, 0, sizeof(mbstate_t));
-+ for (i = 0; i <= len ;)
-+ {
-+ size_t mbclen;
-+ mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state);
-+ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
-+ {
-+ /* An invalid sequence, or a truncated multibyte character.
-+ We treat it as a singlebyte character. */
-+ mbclen = 1;
-+ }
-+ else
-+ {
-+ if (iswupper((wint_t)wc))
-+ {
-+ wc = towlower((wint_t)wc);
-+ wcrtomb(keys + i, wc, &cur_state);
-+ }
-+ }
-+ i += mbclen;
-+ }
-+ }
-+#endif /* MBS_SUPPORT */
-+
- (*compile)(keys, keycc);
-
- if ((argc - optind > 1 && !no_filenames) || with_filenames)
---- grep-2.5.1/src/search.c.i18n 2004-02-26 13:09:54.000000000 +0000
-+++ grep-2.5.1/src/search.c 2004-02-26 13:17:12.000000000 +0000
-@@ -149,15 +149,16 @@
- static char*
- check_multibyte_string(char const *buf, size_t size)
- {
-- char *mb_properties = malloc(size);
-+ char *mb_properties = xmalloc(size);
- mbstate_t cur_state;
-+ wchar_t wc;
- int i;
- memset(&cur_state, 0, sizeof(mbstate_t));
- memset(mb_properties, 0, sizeof(char)*size);
- for (i = 0; i < size ;)
- {
- size_t mbclen;
-- mbclen = mbrlen(buf + i, size - i, &cur_state);
-+ mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state);
-
- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
- {
-@@ -165,6 +166,14 @@
- We treat it as a singlebyte character. */
- mbclen = 1;
- }
-+ else if (match_icase)
-+ {
-+ if (iswupper((wint_t)wc))
-+ {
-+ wc = towlower((wint_t)wc);
-+ wcrtomb(buf + i, wc, &cur_state);
-+ }
-+ }
- mb_properties[i] = mbclen;
- i += mbclen;
- }
-@@ -233,7 +242,7 @@
- static char const line_end[] = "\\)$";
- static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\(";
- static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)";
-- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
-+ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
- size_t i;
- strcpy (n, match_lines ? line_beg : word_beg);
- i = strlen (n);
-@@ -316,7 +325,7 @@
- static char const line_end[] = ")$";
- static char const word_beg[] = "(^|[^[:alnum:]_])(";
- static char const word_end[] = ")([^[:alnum:]_]|$)";
-- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
-+ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
- size_t i;
- strcpy (n, match_lines ? line_beg : word_beg);
- i = strlen(n);
-@@ -339,14 +348,20 @@
- char eol = eolbyte;
- int backref, start, len;
- struct kwsmatch kwsm;
-- size_t i;
-+ size_t i, ret_val;
- #ifdef MBS_SUPPORT
- char *mb_properties = NULL;
--#endif /* MBS_SUPPORT */
--
--#ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1 && kwset)
-- mb_properties = check_multibyte_string(buf, size);
-+ if (MB_CUR_MAX > 1)
-+ {
-+ if (match_icase)
-+ {
-+ char *case_buf = xmalloc(size);
-+ memcpy(case_buf, buf, size);
-+ buf = case_buf;
-+ }
-+ if (kwset)
-+ mb_properties = check_multibyte_string(buf, size);
-+ }
- #endif /* MBS_SUPPORT */
-
- buflim = buf + size;
-@@ -455,8 +470,13 @@
-
- failure:
- #ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1 && mb_properties)
-- free (mb_properties);
-+ if (MB_CUR_MAX > 1)
-+ {
-+ if (mb_properties)
-+ free (mb_properties);
-+ if (match_icase)
-+ free ((char *) buf);
-+ }
- #endif /* MBS_SUPPORT */
- return (size_t) -1;
-
-@@ -467,8 +487,13 @@
-
- success_in_start_and_len:
- #ifdef MBS_SUPPORT
-- if (MB_CUR_MAX > 1 && mb_properties)
-- free (mb_properties);
-+ if (MB_CUR_MAX > 1)
-+ {
-+ if (mb_properties)
-+ free (mb_properties);
-+ if (match_icase)
-+ free ((char *) buf);
-+ }
- #endif /* MBS_SUPPORT */
- *match_size = len;
- return start;
-@@ -504,10 +529,19 @@
- register size_t len;
- char eol = eolbyte;
- struct kwsmatch kwsmatch;
-+ size_t ret_val;
- #ifdef MBS_SUPPORT
-- char *mb_properties;
-+ char *mb_properties = NULL;
- if (MB_CUR_MAX > 1)
-- mb_properties = check_multibyte_string (buf, size);
-+ {
-+ if (match_icase)
-+ {
-+ char *case_buf = xmalloc(size);
-+ memcpy(case_buf, buf, size);
-+ buf = case_buf;
-+ }
-+ mb_properties = check_multibyte_string(buf, size);
-+ }
- #endif /* MBS_SUPPORT */
-
- for (beg = buf; beg <= buf + size; ++beg)
-@@ -565,7 +599,12 @@
- failure:
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
-- free (mb_properties);
-+ {
-+ if (match_icase)
-+ free((char *) buf);
-+ if (mb_properties)
-+ free(mb_properties);
-+ }
- #endif /* MBS_SUPPORT */
- return -1;
-
-@@ -581,7 +620,12 @@
- *match_size = len;
- #ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
-- free (mb_properties);
-+ {
-+ if (mb_properties)
-+ free (mb_properties);
-+ if (match_icase)
-+ free ((char *) buf);
-+ }
- #endif /* MBS_SUPPORT */
- return beg - buf;
- }
diff --git a/sys-apps/grep/files/grep-2.5.1-libintl.patch b/sys-apps/grep/files/grep-2.5.1-libintl.patch
deleted file mode 100644
index 0bf601cabc17..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-libintl.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-Add libintl detection for BSD systems.
-
-Patch by Diego Pettenò.
-http://bugs.gentoo.org/92586
-
- #--- configure.in
- #+++ configure.in
- #@@ -72,6 +72,7 @@
- # dnl I18N feature
- # ALL_LINGUAS="cs de el eo es et fr gl hr id it ja ko nl no pl pt_BR ru sl sv"
- # AM_GNU_GETTEXT
- #+AC_CHECK_LIB(intl, libintl_gettext)
- #
- # dnl DOS file name convention
- # dnl sets HAVE_DOS_FILE_NAMES
-
---- configure
-+++ configure
-@@ -7754,6 +8827,80 @@
-
-
-
-+echo "$as_me:$LINENO: checking for libintl_gettext in -lintl" >&5
-+echo $ECHO_N "checking for libintl_gettext in -lintl... $ECHO_C" >&6
-+if test "${ac_cv_lib_intl_libintl_gettext+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lintl $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+
-+/* Override any gcc2 internal prototype to avoid an error. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char libintl_gettext ();
-+int
-+main ()
-+{
-+libintl_gettext ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+ (eval $ac_link) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest$ac_exeext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_lib_intl_libintl_gettext=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_lib_intl_libintl_gettext=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_libintl_gettext" >&5
-+echo "${ECHO_T}$ac_cv_lib_intl_libintl_gettext" >&6
-+if test $ac_cv_lib_intl_libintl_gettext = yes; then
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBINTL 1
-+_ACEOF
-+
-+ LIBS="-lintl $LIBS"
-+
-+fi
-+
-+
-
- echo "$as_me:$LINENO: checking for dos file convention" >&5
- echo $ECHO_N "checking for dos file convention... $ECHO_C" >&6
diff --git a/sys-apps/grep/files/grep-2.5.1-manpage.patch b/sys-apps/grep/files/grep-2.5.1-manpage.patch
deleted file mode 100644
index 2f7145f05551..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-manpage.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Ripped from Fedora
-
---- grep-2.5.1/doc/grep.1.manpage 2002-01-22 13:20:04.000000000 +0000
-+++ grep-2.5.1/doc/grep.1 2003-10-08 09:37:32.000000000 +0100
-@@ -191,6 +191,7 @@
- .I PATTERN
- as a list of fixed strings, separated by newlines,
- any of which is to be matched.
-+.TP
- .BR \-P ", " \-\^\-perl-regexp
- Interpret
- .I PATTERN
-@@ -302,7 +303,7 @@
- This is especially useful for tools like zgrep, e.g.
- .B "gzip -cd foo.gz |grep --label=foo something"
- .TP
--.BR \-\^\-line-buffering
-+.BR \-\^\-line-buffered
- Use line buffering, it can be a performance penality.
- .TP
- .BR \-q ", " \-\^\-quiet ", " \-\^\-silent
diff --git a/sys-apps/grep/files/grep-2.5.1-oi.patch b/sys-apps/grep/files/grep-2.5.1-oi.patch
deleted file mode 100644
index 563c8372322e..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-oi.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Ripped from Fedora
-
---- grep-2.5.1/lib/posix/regex.h.oi 2004-01-05 12:09:12.984391131 +0000
-+++ grep-2.5.1/lib/posix/regex.h 2004-01-05 12:09:24.717990622 +0000
-@@ -109,6 +109,10 @@
- If not set, \{, \}, {, and } are literals. */
- #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
-
-+/* If this bit is set, then ignore case when matching.
-+ If not set, then case is significant. */
-+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
-+
- /* If this bit is set, +, ? and | aren't recognized as operators.
- If not set, they are. */
- #define RE_LIMITED_OPS (RE_INTERVALS << 1)
---- grep-2.5.1/src/search.c.oi 2004-01-05 12:07:00.550199415 +0000
-+++ grep-2.5.1/src/search.c 2004-01-05 12:07:00.566197505 +0000
-@@ -31,7 +31,7 @@
-
- #include "system.h"
- #include "grep.h"
--#include "regex.h"
-+#include <regex.h>
- #include "dfa.h"
- #include "kwset.h"
- #include "error.h"
-@@ -190,7 +190,7 @@
- size_t total = size;
- char const *motif = pattern;
-
-- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
-+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
- dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
-
- /* For GNU regex compiler we have to pass the patterns separately to detect
-@@ -268,12 +268,12 @@
-
- if (strcmp (matcher, "awk") == 0)
- {
-- re_set_syntax (RE_SYNTAX_AWK);
-+ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
- dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
- }
- else
- {
-- re_set_syntax (RE_SYNTAX_POSIX_EGREP);
-+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
- dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
- }
-
diff --git a/sys-apps/grep/files/grep-2.5.1-perl-segv.patch b/sys-apps/grep/files/grep-2.5.1-perl-segv.patch
deleted file mode 100644
index 46218a1f4614..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-perl-segv.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix from upstream to fix a corner case segfault.
-
-http://bugs.gentoo.org/95495
-
---- grep-2.5.1/src/search.c
-+++ grep-2.5.1/src/search.c
-@@ -701,8 +701,10 @@
- char eol = eolbyte;
- if (!exact)
- {
-- end = memchr (end, eol, buflim - end);
-- end++;
-+ if (!(end = memchr (end, eol, buflim - end)))
-+ end = buflim;
-+ else
-+ end++;
- while (buf < beg && beg[-1] != eol)
- --beg;
- }
diff --git a/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch b/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch
deleted file mode 100644
index 2294e9c2372a..000000000000
--- a/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/posix/regex.h
-+++ lib/posix/regex.h
-@@ -533,7 +533,8 @@ extern int re_exec _RE_ARGS ((const char
- /* For now unconditionally define __restrict_arr to expand to nothing.
- Ideally we would have a test for the compiler which allows defining
- it to restrict. */
-+#undef __restrict_arr
- #define __restrict_arr
-
- /* POSIX compatibility. */
- extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
diff --git a/sys-apps/grep/files/grep-2.5.1a-nls.patch b/sys-apps/grep/files/grep-2.5.1a-nls.patch
deleted file mode 100644
index 91fb49798b3b..000000000000
--- a/sys-apps/grep/files/grep-2.5.1a-nls.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Index: grep-2.5.1a/src/dfa.c
-===================================================================
---- grep-2.5.1a.orig/src/dfa.c
-+++ grep-2.5.1a/src/dfa.c
-@@ -102,7 +102,7 @@ extern void free();
- /* If we (don't) have I18N. */
- /* glibc defines _ */
- #ifndef _
--# ifdef HAVE_LIBINTL_H
-+# if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
- # include <libintl.h>
- # ifndef _
- # define _(Str) gettext (Str)
-Index: grep-2.5.1a/lib/obstack.c
-===================================================================
---- grep-2.5.1a.orig/lib/obstack.c
-+++ grep-2.5.1a/lib/obstack.c
-@@ -451,7 +451,7 @@ _obstack_memory_used (h)
-
- /* Define the error handler. */
- #ifndef _
--# ifdef HAVE_LIBINTL_H
-+# if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
- # include <libintl.h>
- # ifndef _
- # define _(Str) gettext (Str)
-Index: grep-2.5.1a/lib/regex.c
-===================================================================
---- grep-2.5.1a.orig/lib/regex.c
-+++ grep-2.5.1a/lib/regex.c
-@@ -112,7 +112,7 @@
- #endif
-
- /* This is for other GNU distributions with internationalized messages. */
--#if HAVE_LIBINTL_H || defined _LIBC
-+#if ENABLE_NLS && (HAVE_LIBINTL_H || defined _LIBC)
- # include <libintl.h>
- # ifdef _LIBC
- # undef gettext
diff --git a/sys-apps/grep/files/grep-2.5.3-yesno-test-fix.patch b/sys-apps/grep/files/grep-2.5.3-yesno-test-fix.patch
deleted file mode 100644
index 3c6e1ab75650..000000000000
--- a/sys-apps/grep/files/grep-2.5.3-yesno-test-fix.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Fix from upstream CVS disabling tests that are known to fail.
-
---- tests/yesno.sh 2005/11/13 08:15:16 1.1
-+++ tests/yesno.sh 2008/02/07 03:43:27 1.2
-@@ -63,7 +63,6 @@
- '-m,4,-C,1,-o' "$c$d$e$h$z0$XI$XJ$XK$XL$XM$XN" \
- '-m,5' "$C$D$E$H$I$z0$XJ$XK$XL$XM$XN" \
- '-m,5,-o' "$c$d$e$h$i$z0$XJ$XK$XL$XM$XN" \
-- '-m,5,-C,1' "$rB$C$D$E$rF$rG$H$I$z0$XJ$XK$XL$XM$XN" \
- '-m,5,-C,1,-o' "$c$d$e$h$i$z0$XJ$XK$XL$XM$XN" \
- '-m,6' "$C$D$E$H$I$M$z0$XN" \
- '-m,6,-o' "$c$d$e$h$i$m$z0$XN" \
-@@ -79,14 +78,17 @@
- '-m,1,-v,-C,1,-o' "$z0$XB$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,2,-v' "$A$B$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,2,-v,-o' "$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
-- '-m,2,-v,-C,1' "$A$B$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
-- '-m,2,-v,-C,1,-o' "$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,3,-v' "$A$B$F$z0$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,3,-v,-o' "$z0$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,3,-v,-C,1' "$A$B$rC$s$rE$F$z0$XG$XH$XI$XJ$XK$XL$XM$XN" \
- '-m,3,-v,-C,1,-o' "$rc$s$re$z0$XG$XH$XI$XJ$XK$XL$XM$XN" \
- x
- shift
-+# Comment out cases that are known to fail. These should be uncommented after the 2.5.4 release. TAA.
-+# These should be added back in above and fixed in the code. TAA.
-+# '-m,5,-C,1' "$rB$C$D$E$rF$rG$H$I$z0$XJ$XK$XL$XM$XN" \
-+# '-m,2,-v,-C,1' "$A$B$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
-+# '-m,2,-v,-C,1,-o' "$z0$XC$XD$XE$XF$XG$XH$XI$XJ$XK$XL$XM$XN" \
-
- # Test execution and reporting.
- t=1