diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-02-04 21:46:34 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-02-04 21:46:34 +0200 |
commit | e8cbbd49aa49195de2cff403cf0e6b4da0971717 (patch) | |
tree | 337563d9e8af492f469419c5c1d564c71607ccd5 | |
parent | ae0d3255ddd792402650ad0caaf611dcc3ada091 (diff) | |
download | egawk-e8cbbd49aa49195de2cff403cf0e6b4da0971717.tar.gz egawk-e8cbbd49aa49195de2cff403cf0e6b4da0971717.tar.bz2 egawk-e8cbbd49aa49195de2cff403cf0e6b4da0971717.zip |
Pull in some regex fixes.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | regcomp.c | 2 | ||||
-rw-r--r-- | regex.c | 2 | ||||
-rw-r--r-- | regex_internal.c | 2 | ||||
-rw-r--r-- | regexec.c | 19 |
5 files changed, 26 insertions, 12 deletions
@@ -1,3 +1,16 @@ +2013-02-04 Arnold D. Robbins <arnold@skeeve.com> + + * regcomp.c, regex.c, regex_internal.c, regexec.c: Update + copyright years to sync with GLIBC. + + From: http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html, + by Andreas Schwab <schwab@suse.de>: + + * regexec.c (extend_buffers): Add parameter min_len. + (check_matching): Pass minimum needed length. + (clean_state_log_if_needed): Likewise. + (get_subexp): Likewise.` + 2013-02-03 Arnold D. Robbins <arnold@skeeve.com> * configure.ac: Add Automake test for cross compiling. @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2007,2009,2010,2011,2012 Free Software Foundation, Inc. + Copyright (C) 2002-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2012 Free Software Foundation, Inc. + Copyright (C) 2002-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. diff --git a/regex_internal.c b/regex_internal.c index 80991613..5f77bcb0 100644 --- a/regex_internal.c +++ b/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2006, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2002-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -1,6 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2005,2007,2009,2010,2011,2013 - Free Software Foundation, Inc. + Copyright (C) 2002-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -198,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa, static int check_node_accept (const re_match_context_t *mctx, const re_token_t *node, int idx) internal_function; -static reg_errcode_t extend_buffers (re_match_context_t *mctx) +static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) internal_function; #ifdef GAWK @@ -1168,7 +1167,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match, || (BE (next_char_idx >= mctx->input.valid_len, 0) && mctx->input.valid_len < mctx->input.len)) { - err = extend_buffers (mctx); + err = extend_buffers (mctx, next_char_idx + 1); if (BE (err != REG_NOERROR, 0)) { assert (err == REG_ESPACE); @@ -1748,7 +1747,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx) && mctx->input.valid_len < mctx->input.len)) { reg_errcode_t err; - err = extend_buffers (mctx); + err = extend_buffers (mctx, next_state_log_idx + 1); if (BE (err != REG_NOERROR, 0)) return err; } @@ -2802,7 +2801,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) if (bkref_str_off >= mctx->input.len) break; - err = extend_buffers (mctx); + err = extend_buffers (mctx, bkref_str_off + 1); if (BE (err != REG_NOERROR, 0)) return err; @@ -4112,7 +4111,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node, static reg_errcode_t internal_function __attribute_warn_unused_result__ -extend_buffers (re_match_context_t *mctx) +extend_buffers (re_match_context_t *mctx, int min_len) { reg_errcode_t ret; re_string_t *pstr = &mctx->input; @@ -4121,8 +4120,10 @@ extend_buffers (re_match_context_t *mctx) if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) return REG_ESPACE; - /* Double the lengthes of the buffers. */ - ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2)); + /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */ + ret = re_string_realloc_buffers (pstr, + MAX (min_len, + MIN (pstr->len, pstr->bufs_len * 2))); if (BE (ret != REG_NOERROR, 0)) return ret; |