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

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

grep 2.5 compile error


From: Albert Chin-A-Young
Subject: grep 2.5 compile error
Date: Mon, 18 Mar 2002 00:13:11 -0600
User-agent: Mutt/1.2.5i

On HP-UX 10.20, 11.00, IRIX 6.5, and Solaris 2.5.1 with the vendor C
compiler:

  cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I../lib
  -DLOCALEDIR=\"/opt/TWWfsw/grep25/share/locale\"
  -I/opt/TWWfsw/libpcre37/include  -mr -Qn -xstrconst -xO2
  -xtarget=generic -c `test -f dfa.c || echo './'`dfa.c
  "/usr/include/locale.h", line 56: warning: macro redefined: LC_MESSAGES
  "dfa.c", line 1055: non-constant initializer: op "NAME"
  "dfa.c", line 1055: non-constant initializer: op "NAME"
  "dfa.c", line 1059: non-constant initializer: op "NAME"
  "dfa.c", line 1103: cannot recover from previous errors

Patch attached.

-- 
albert chin (address@hidden)

-- snip snip
--- src/dfa.c.orig      Sun Mar 17 23:58:18 2002
+++ src/dfa.c   Mon Mar 18 00:04:42 2002
@@ -1052,12 +1052,19 @@
                          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);



reply via email to

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