aboutsummaryrefslogtreecommitdiff
path: root/gl/regexec.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-01-15 04:22:57 -0500
committerGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-01-15 05:19:08 -0500
commit71cdb52799220f8d9052643baf1d3e9836a9c755 (patch)
tree27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/regexec.c
parentf7afa46586645e50498d8b2d0c67884f014dc3a4 (diff)
downloadmonitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz
Sync with gnulib
Diffstat (limited to 'gl/regexec.c')
-rw-r--r--gl/regexec.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gl/regexec.c b/gl/regexec.c
index ac6c258e..5452ef78 100644
--- a/gl/regexec.c
+++ b/gl/regexec.c
@@ -1,6 +1,6 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -701,7 +701,8 @@ re_search_internal (const regex_t *preg,
fl_longest_match = (nmatch != 0 || dfa->nbackref);
err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
- preg->translate, preg->syntax & RE_ICASE, dfa);
+ preg->translate, (preg->syntax & RE_ICASE) != 0,
+ dfa);
if (BE (err != REG_NOERROR, 0))
goto free_return;
mctx.input.stop = stop;
@@ -1044,6 +1045,11 @@ prune_impossible_nodes (re_match_context_t *mctx)
re_node_set_free (&sctx.limits);
if (BE (ret != REG_NOERROR, 0))
goto free_return;
+ if (sifted_states[0] == NULL)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
}
re_free (mctx->state_log);
mctx->state_log = sifted_states;
@@ -3078,7 +3084,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
const re_dfa_t *const dfa = mctx->dfa;
bool ok;
Idx cur_idx;
+#ifdef RE_ENABLE_I18N
reg_errcode_t err = REG_NOERROR;
+#endif
re_node_set union_set;
re_node_set_init_empty (&union_set);
for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)
@@ -3467,7 +3475,7 @@ out_free:
CONTEXT_NEWLINE);
if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
goto out_free;
- }
+ }
else
{
dest_states_word[i] = dest_states[i];