bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for grep 2.5 on HP/UX


From: Petter Reinholdtsen
Subject: Patch for grep 2.5 on HP/UX
Date: Sun, 6 Oct 2002 10:26:16 +0200

Hello

I had to apply the following patch to get grep version 2.5 to compile
on HP/UX.  Apparently the compiler do not handle non-const array
initializers.

diff -ur src-2.5/src/dfa.c src-2.5-local/src/dfa.c
--- src-2.5/src/dfa.c   2001-09-26 18:57:55.000000000 +0200
+++ src-2.5-local/src/dfa.c     2002-10-06 10:12:35.000000000 +0200
@@ -1052,11 +1052,16 @@
                          setbit_case_fold (c, ccl);
                      } else {
                        /* POSIX locales are painful - leave the decision to 
libc */
-                       char expr[6] = { '[', c, '-', c2, ']', '\0' };
+                       /* char expr[6] = { '[', c, '-', c2, ']', '\0' }; */
+                       char expr[6] = "[c-c]";
+                       expr[1] = c;
+                       expr[3] = c2;
                        regex_t re;
                        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] = { c, '\0' }; */
+                           char buf[2] = "c";
+                           buf[0] = c;
                            regmatch_t mat;
                            if (regexec (&re, buf, 1, &mat, 0) == REG_NOERROR
                                && mat.rm_so == 0 && mat.rm_eo == 1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]