[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regex module broken
From: |
Paul Eggert |
Subject: |
Re: regex module broken |
Date: |
Thu, 13 Apr 2006 15:15:22 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
"Derek R. Price" <address@hidden> writes:
> The base problem appears to be using the C99 wctype_t
> without protection when <wctype.h> may not have been present and
> therefore not included.
Thanks for reporting that. I installed the following patch into gnulib
(and shortly into coreutils).
2006-04-13 Paul Eggert <address@hidden>
* regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
--- lib/regcomp.c 10 Apr 2006 19:15:08 -0000 1.7
+++ lib/regcomp.c 13 Apr 2006 22:11:29 -0000
@@ -836,15 +836,17 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
#ifndef _LIBC
char *codeset_name;
#endif
+#ifdef RE_ENABLE_I18N
+ size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
+#else
+ size_t max_i18n_object_size = 0;
+#endif
size_t max_object_size =
MAX (sizeof (struct re_state_table_entry),
MAX (sizeof (re_token_t),
MAX (sizeof (re_node_set),
MAX (sizeof (regmatch_t),
- MAX (sizeof (regoff_t),
- MAX (sizeof (wchar_t),
- MAX (sizeof (wctype_t),
- sizeof (Idx))))))));
+ max_i18n_object_size))));
memset (dfa, '\0', sizeof (re_dfa_t));