diff options
author | bouyer <bouyer@pkgsrc.org> | 2004-07-06 20:36:58 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2004-07-06 20:36:58 +0000 |
commit | 41084745a787e558a7bc49ea895ac2f0904a3520 (patch) | |
tree | 63d2c8c9548af7d8359f8b5b6fe3d00afda9c8b9 /textproc/grep/patches | |
parent | 92233ed67dc933158bba68a059334194dbaff770 (diff) | |
download | pkgsrc-41084745a787e558a7bc49ea895ac2f0904a3520.tar.gz |
Apply patch from
http://lists.gnu.org/archive/html/bug-gnu-utils/2002-03/msg00359.html
requested by Georg Schwarz in private mail: make it compile with non-gcc
compilers.
Diffstat (limited to 'textproc/grep/patches')
-rw-r--r-- | textproc/grep/patches/patch-ab | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/textproc/grep/patches/patch-ab b/textproc/grep/patches/patch-ab index 75c18f73a4a..158c9b8e84a 100644 --- a/textproc/grep/patches/patch-ab +++ b/textproc/grep/patches/patch-ab @@ -1,8 +1,8 @@ -$NetBSD: patch-ab,v 1.1 2002/12/25 19:50:35 wiz Exp $ +$NetBSD: patch-ab,v 1.2 2004/07/06 20:36:58 bouyer Exp $ ---- src/dfa.c.orig Wed Sep 26 18:57:55 2001 -+++ src/dfa.c -@@ -44,7 +44,7 @@ extern void free(); +--- src/dfa.c.orig 2001-09-26 18:57:55.000000000 +0200 ++++ src/dfa.c 2004-07-06 22:33:02.000000000 +0200 +@@ -44,7 +44,7 @@ # include <locale.h> #endif @@ -11,3 +11,23 @@ $NetBSD: patch-ab,v 1.1 2002/12/25 19:50:35 wiz Exp $ /* We can handle multibyte string. */ # define MBS_SUPPORT #endif +@@ -1052,12 +1052,17 @@ + setbit_case_fold (c, ccl); + } else { + /* POSIX locales are painful - leave the decision to libc */ +- char expr[6] = { '[', c, '-', c2, ']', '\0' }; ++ char expr[6] = { '[', '\0', '-', '\0', ']', '\0' }; + regex_t re; ++ ++ expr[1] = c; ++ expr[3] = c2; + if (regcomp (&re, expr, case_fold ? REG_ICASE : 0) == REG_NOERROR) { + for (c = 0; c < NOTCHAR; ++c) { +- char buf[2] = { c, '\0' }; ++ char buf[2] = { '\0', '\0' }; + regmatch_t mat; ++ ++ buf[0] = c; + if (regexec (&re, buf, 1, &mat, 0) == REG_NOERROR + && mat.rm_so == 0 && mat.rm_eo == 1) + setbit_case_fold (c, ccl); |