From: Bruno Haible Date: Wed, 9 Feb 2005 11:21:03 +0000 (+0000) Subject: Make it compile with Solaris cc. X-Git-Tag: v0.14.2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9512554eec8edecfbc6a6c3411020c108c4fac13;p=thirdparty%2Fgettext.git Make it compile with Solaris cc. --- diff --git a/gettext-tools/libgrep/ChangeLog b/gettext-tools/libgrep/ChangeLog index 6c830cb1f..88bdad0d2 100644 --- a/gettext-tools/libgrep/ChangeLog +++ b/gettext-tools/libgrep/ChangeLog @@ -1,3 +1,7 @@ +2003-07-08 David Kaelbling + + * dfa.c (lex): Remove non-constant initializers. + 2005-02-08 Bruno Haible * kwset.h (kwsincr, kwsprep): Change return type to 'const char *'. diff --git a/gettext-tools/libgrep/dfa.c b/gettext-tools/libgrep/dfa.c index b52ed6333..536f0aafa 100644 --- a/gettext-tools/libgrep/dfa.c +++ b/gettext-tools/libgrep/dfa.c @@ -1029,12 +1029,17 @@ lex (void) setbit_case_fold (c, ccl); } else { /* POSIX locales are painful - leave the decision to libc */ - char expr[6] = { '[', c, '-', c2, ']', '\0' }; regex_t re; + char expr[6]; /* = { '[', c, '-', c2, ']', '\0' }; */ + + expr[0] = '['; expr[1] = c; expr[2] = '-'; + expr[3] = c2; expr[4] = ']'; expr[5] = '\0'; if (regcomp (&re, expr, case_fold ? REG_ICASE : 0) == REG_NOERROR) { for (c = 0; c < NOTCHAR; ++c) { - char buf[2] = { c, '\0' }; regmatch_t mat; + char buf[2]; /* = { c, '\0' }; */ + + buf[0] = c; buf[1] = '\0'; if (regexec (&re, buf, 1, &mat, 0) == REG_NOERROR && mat.rm_so == 0 && mat.rm_eo == 1) setbit_case_fold (c, ccl);