diff -rNC3 sed-4.0.5/lib/regcomp.c sed-4.0.6/lib/regcomp.c *** sed-4.0.5/lib/regcomp.c Fri Nov 22 12:04:08 2002 --- sed-4.0.6/lib/regcomp.c Mon Feb 17 10:19:33 2003 *************** *** 18,73 **** Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - #include - #include - #include - #include - #include - #include - #include - - #if defined HAVE_WCHAR_H || defined _LIBC - # include - #endif /* HAVE_WCHAR_H || _LIBC */ - #if defined HAVE_WCTYPE_H || defined _LIBC - # include - #endif /* HAVE_WCTYPE_H || _LIBC */ - - /* In case that the system doesn't have isblank(). */ - #if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank - # define isblank(ch) ((ch) == ' ' || (ch) == '\t') - #endif - - #ifdef _LIBC - # ifndef _RE_DEFINE_LOCALE_FUNCTIONS - # define _RE_DEFINE_LOCALE_FUNCTIONS 1 - # include - # include - # include - # endif - #endif - - /* This is for other GNU distributions with internationalized messages. */ - #if HAVE_LIBINTL_H || defined _LIBC - # include - # ifdef _LIBC - # undef gettext - # define gettext(msgid) \ - INTUSE(__dcgettext) (INTUSE(_libc_intl_domainname), msgid, LC_MESSAGES) - # endif - #else - # define gettext(msgid) (msgid) - #endif - - #ifndef gettext_noop - /* This define is so xgettext can find the internationalizable - strings. */ - # define gettext_noop(String) String - #endif - - #include - #include "regex_internal.h" - static void re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, char *fastmap); --- 18,23 ---- *************** *** 1951,1957 **** mbc_remain = create_tree (NULL, NULL, 0, new_idx); tree = create_tree (tree, mbc_remain, CONCAT, 0); if (BE (new_idx == -1 || mbc_remain == NULL || tree == NULL, 0)) ! return *err = REG_ESPACE, NULL; } } #endif --- 1901,1910 ---- mbc_remain = create_tree (NULL, NULL, 0, new_idx); tree = create_tree (tree, mbc_remain, CONCAT, 0); if (BE (new_idx == -1 || mbc_remain == NULL || tree == NULL, 0)) ! { ! *err = REG_ESPACE; ! return NULL; ! } } } #endif *************** *** 2052,2058 **** new_idx = re_dfa_add_node (dfa, *token, 0); tree = create_tree (NULL, NULL, 0, new_idx); if (BE (new_idx == -1 || tree == NULL, 0)) ! return *err = REG_ESPACE, NULL; } /* We must return here, since ANCHORs can't be followed by repetition operators. --- 2005,2014 ---- new_idx = re_dfa_add_node (dfa, *token, 0); tree = create_tree (NULL, NULL, 0, new_idx); if (BE (new_idx == -1 || tree == NULL, 0)) ! { ! *err = REG_ESPACE; ! return NULL; ! } } /* We must return here, since ANCHORs can't be followed by repetition operators. diff -rNC3 sed-4.0.5/lib/regex.c sed-4.0.6/lib/regex.c *** sed-4.0.5/lib/regex.c Sat Dec 14 09:30:02 2002 --- sed-4.0.6/lib/regex.c Mon Feb 17 10:27:50 2003 *************** *** 41,64 **** # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) #endif ! #ifdef HAVE_CONFIG_H ! #include "config.h" ! #endif ! ! #if (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC) || _LIBC ! #define RE_ENABLE_I18N ! #endif ! ! #if _LIBC || __GNUC__ >= 3 ! # define BE(expr, val) __builtin_expect (expr, val) ! #else ! # define BE(expr, val) (expr) ! # define inline ! #endif #include "regcomp.c" #include "regexec.c" - #include "regex_internal.c" /* Binary backward compatibility. */ #if _LIBC --- 41,55 ---- # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) #endif ! /* POSIX says that must be included (by the caller) before ! . */ ! #include ! #include ! #include "regex_internal.h" + #include "regex_internal.c" #include "regcomp.c" #include "regexec.c" /* Binary backward compatibility. */ #if _LIBC diff -rNC3 sed-4.0.5/lib/regex_internal.c sed-4.0.6/lib/regex_internal.c *** sed-4.0.5/lib/regex_internal.c Sat Dec 14 09:23:46 2002 --- sed-4.0.6/lib/regex_internal.c Mon Feb 17 10:20:14 2003 *************** *** 18,67 **** Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - #include - #include - #include - #include - #include - #include - - #if defined HAVE_WCHAR_H || defined _LIBC - # include - #endif /* HAVE_WCHAR_H || _LIBC */ - #if defined HAVE_WCTYPE_H || defined _LIBC - # include - #endif /* HAVE_WCTYPE_H || _LIBC */ - - #ifdef _LIBC - # ifndef _RE_DEFINE_LOCALE_FUNCTIONS - # define _RE_DEFINE_LOCALE_FUNCTIONS 1 - # include - # include - # include - # endif - #endif - - /* This is for other GNU distributions with internationalized messages. */ - #if HAVE_LIBINTL_H || defined _LIBC - # include - # ifdef _LIBC - # undef gettext - # define gettext(msgid) \ - INTUSE(__dcgettext) (_libc_intl_domainname_internal, msgid, LC_MESSAGES) - # endif - #else - # define gettext(msgid) (msgid) - #endif - - #ifndef gettext_noop - /* This define is so xgettext can find the internationalizable - strings. */ - # define gettext_noop(String) String - #endif - - #include "regex.h" - #include "regex_internal.h" - static void re_string_construct_common (const char *str, int len, re_string_t *pstr, RE_TRANSLATE_TYPE trans, int icase); --- 18,23 ---- diff -rNC3 sed-4.0.5/lib/regex_internal.h sed-4.0.6/lib/regex_internal.h *** sed-4.0.5/lib/regex_internal.h Fri Nov 22 12:18:11 2002 --- sed-4.0.6/lib/regex_internal.h Mon Feb 17 10:25:28 2003 *************** *** 21,26 **** --- 21,90 ---- #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + + #include + #include + #include + #include + #include + #include + + #if defined HAVE_LOCALE_H || defined _LIBC + #include + #endif + #if defined HAVE_WCHAR_H || defined _LIBC + # include + #endif /* HAVE_WCHAR_H || _LIBC */ + #if defined HAVE_WCTYPE_H || defined _LIBC + # include + #endif /* HAVE_WCTYPE_H || _LIBC */ + + /* In case that the system doesn't have isblank(). */ + #if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank + # define isblank(ch) ((ch) == ' ' || (ch) == '\t') + #endif + + #ifdef _LIBC + # ifndef _RE_DEFINE_LOCALE_FUNCTIONS + # define _RE_DEFINE_LOCALE_FUNCTIONS 1 + # include + # include + # include + # endif + #endif + + /* This is for other GNU distributions with internationalized messages. */ + #if HAVE_LIBINTL_H || defined _LIBC + # include + # ifdef _LIBC + # undef gettext + # define gettext(msgid) \ + INTUSE(__dcgettext) (INTUSE(_libc_intl_domainname), msgid, LC_MESSAGES) + # endif + #else + # define gettext(msgid) (msgid) + #endif + + #ifndef gettext_noop + /* This define is so xgettext can find the internationalizable + strings. */ + # define gettext_noop(String) String + #endif + + #if (defined (MB_CUR_MAX) && HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC) || _LIBC + #define RE_ENABLE_I18N + #endif + + #if _LIBC || __GNUC__ >= 3 + # define BE(expr, val) __builtin_expect (expr, val) + #else + # define BE(expr, val) (expr) + # define inline + #endif + /* Number of bits in a byte. */ #define BYTE_BITS 8 /* Number of single byte character. */ diff -rNC3 sed-4.0.5/lib/regexec.c sed-4.0.6/lib/regexec.c *** sed-4.0.5/lib/regexec.c Fri Nov 22 12:19:43 2002 --- sed-4.0.6/lib/regexec.c Mon Feb 17 10:19:54 2003 *************** *** 18,48 **** Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - #include - #include - #include - #include - #include - - #if defined HAVE_WCHAR_H || defined _LIBC - # include - #endif /* HAVE_WCHAR_H || _LIBC */ - #if defined HAVE_WCTYPE_H || defined _LIBC - # include - #endif /* HAVE_WCTYPE_H || _LIBC */ - - #ifdef _LIBC - # ifndef _RE_DEFINE_LOCALE_FUNCTIONS - # define _RE_DEFINE_LOCALE_FUNCTIONS 1 - # include - # include - # include - # endif - #endif - - #include "regex.h" - #include "regex_internal.h" - static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, re_string_t *input, int n); static void match_ctx_free (re_match_context_t *cache); --- 18,23 ----