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.
This commit is contained in:
bouyer 2004-07-06 20:36:58 +00:00
parent 92233ed67d
commit 41084745a7
2 changed files with 26 additions and 6 deletions

View file

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.5 2003/09/18 19:13:52 wiz Exp $
$NetBSD: distinfo,v 1.6 2004/07/06 20:36:58 bouyer Exp $
SHA1 (grep-2.5.1.tar.bz2) = 551db1f0014e44d428e1c3482ac9418ff5d15950
Size (grep-2.5.1.tar.bz2) = 559232 bytes
SHA1 (patch-aa) = f08f91903053a32c497c1a8a453116bfa9029ed6
SHA1 (patch-ab) = 353f079d4b6c6853a16eb00c79462e32e8e1cf19
SHA1 (patch-ab) = 2e92dab9e1a66ad5bc10f08faf68a0926fea6a87
SHA1 (patch-ac) = f0e672a0f29bc9a41e9918114e527f0ce1947f51

View file

@ -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);