I installed this into gnulib and filed a glibc bug report. This handles all pending regex problems that I know about in gnulib. Does anyone know of any others? If not, I'd like to start pushing these changes into glibc.
2005-08-23 Paul Eggert <[EMAIL PROTECTED]> * config/srclist.txt: Add glibc bug 1231. * lib/regex_internal.c (re_string_skip_chars, register_state): (calc_state_hash): Remove forward decls; no longer needed now that we use prototypes. * lib/regexec.c (acquire_init_state_context, check_halt_node_context): (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes): (clean_state_log_if_needed): Likewise. --- config/srclist.txt 21 Aug 2005 05:01:20 -0000 1.78 +++ config/srclist.txt 23 Aug 2005 18:27:39 -0000 @@ -112,6 +112,7 @@ $LIBCSRC/posix/regex.c lib gpl # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1218 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1220 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1226 +# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1231 #$LIBCSRC/posix/regex_internal.c lib gpl # # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054 @@ -122,6 +123,7 @@ $LIBCSRC/posix/regex.c lib gpl # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1220 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1225 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1227 +# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1231 #$LIBCSRC/posix/regexec.c lib gpl # # c89 changes $LIBCSRC/string/strdup.c lib gpl --- lib/regex_internal.c 21 Aug 2005 03:31:46 -0000 1.5 +++ lib/regex_internal.c 23 Aug 2005 18:22:42 -0000 @@ -21,12 +21,6 @@ static void re_string_construct_common ( re_string_t *pstr, RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa) internal_function; -#ifdef RE_ENABLE_I18N -static int re_string_skip_chars (re_string_t *pstr, int new_raw_idx, - wint_t *last_wc) internal_function; -#endif /* RE_ENABLE_I18N */ -static reg_errcode_t register_state (re_dfa_t *dfa, re_dfastate_t *newstate, - unsigned int hash) internal_function; static re_dfastate_t *create_ci_newstate (re_dfa_t *dfa, const re_node_set *nodes, unsigned int hash) internal_function; @@ -34,8 +28,6 @@ static re_dfastate_t *create_cd_newstate const re_node_set *nodes, unsigned int context, unsigned int hash) internal_function; -static inline unsigned int calc_state_hash (const re_node_set *nodes, - unsigned int context) internal_function; /* Functions for string operation. */ --- lib/regexec.c 21 Aug 2005 05:01:20 -0000 1.5 +++ lib/regexec.c 23 Aug 2005 18:22:43 -0000 @@ -51,32 +51,21 @@ static int re_search_stub (struct re_pat int ret_len) internal_function; static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, int nregs, int regs_allocated) internal_function; -static inline re_dfastate_t *acquire_init_state_context - (reg_errcode_t *err, const re_match_context_t *mctx, int idx) - __attribute ((always_inline)) internal_function; static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) internal_function; static int check_matching (re_match_context_t *mctx, int fl_longest_match, int *p_match_first) internal_function; -static int check_halt_node_context (const re_dfa_t *dfa, int node, - unsigned int context) internal_function; static int check_halt_state_context (const re_match_context_t *mctx, const re_dfastate_t *state, int idx) internal_function; static void update_regs (re_dfa_t *dfa, regmatch_t *pmatch, regmatch_t *prev_idx_match, int cur_node, int cur_idx, int nmatch) internal_function; -static int proceed_next_node (const re_match_context_t *mctx, - int nregs, regmatch_t *regs, - int *pidx, int node, re_node_set *eps_via_nodes, - struct re_fail_stack_t *fs) internal_function; static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs, int str_idx, int dest_node, int nregs, regmatch_t *regs, re_node_set *eps_via_nodes) internal_function; -static int pop_fail_stack (struct re_fail_stack_t *fs, int *pidx, int nregs, - regmatch_t *regs, re_node_set *eps_via_nodes) internal_function; static reg_errcode_t set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, regmatch_t *pmatch, @@ -100,9 +89,6 @@ static reg_errcode_t update_cur_sifted_s static reg_errcode_t add_epsilon_src_nodes (re_dfa_t *dfa, re_node_set *dest_nodes, const re_node_set *candidates) internal_function; -static reg_errcode_t sub_epsilon_src_nodes (re_dfa_t *dfa, int node, - re_node_set *dest_nodes, - const re_node_set *and_nodes) internal_function; static int check_dst_limits (re_match_context_t *mctx, re_node_set *limits, int dst_node, int dst_idx, int src_node, int src_idx) internal_function; @@ -122,8 +108,6 @@ static reg_errcode_t check_subexp_limits static reg_errcode_t sift_states_bkref (re_match_context_t *mctx, re_sift_context_t *sctx, int str_idx, const re_node_set *candidates) internal_function; -static reg_errcode_t clean_state_log_if_needed (re_match_context_t *mctx, - int next_state_log_idx) internal_function; static reg_errcode_t merge_state_array (re_dfa_t *dfa, re_dfastate_t **dst, re_dfastate_t **src, int num) internal_function; static re_dfastate_t *find_recover_state (reg_errcode_t *err, @@ -996,7 +980,7 @@ prune_impossible_nodes (re_match_context since initial states may have constraints like "\<", "^", etc.. */ static inline re_dfastate_t * -internal_function +__attribute ((always_inline)) internal_function acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, int idx) { _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib