aboutsummaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/ChangeLog5
-rw-r--r--support/regcomp.c9
-rw-r--r--support/regex.c2
-rw-r--r--support/regex.h2
-rw-r--r--support/regex_internal.c6
-rw-r--r--support/regex_internal.h5
-rw-r--r--support/regexec.c16
7 files changed, 24 insertions, 21 deletions
diff --git a/support/ChangeLog b/support/ChangeLog
index 54756048..ec54675a 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
+ regexec.c: Sync with GLIBC.
+
2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
* intprops.h: Sync with GNULIB.
diff --git a/support/regcomp.c b/support/regcomp.c
index 5ac53701..c45e91fc 100644
--- a/support/regcomp.c
+++ b/support/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -961,8 +961,9 @@ static void
internal_function
init_word_char (re_dfa_t *dfa)
{
- int i, j, ch;
dfa->word_ops_used = 1;
+ int i = 0;
+ int ch = 0;
#ifndef GAWK
if (BE (dfa->map_notascii == 0, 1))
{
@@ -996,8 +997,8 @@ init_word_char (re_dfa_t *dfa)
}
#endif
- for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
- for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ for (; i < BITSET_WORDS; ++i)
+ for (int j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
if (isalnum (ch) || ch == '_')
dfa->word_char[i] |= (bitset_word_t) 1 << j;
}
diff --git a/support/regex.c b/support/regex.c
index 9f133fab..d3a44851 100644
--- a/support/regex.c
+++ b/support/regex.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/support/regex.h b/support/regex.h
index 143b3afa..adddd9ee 100644
--- a/support/regex.h
+++ b/support/regex.h
@@ -1,6 +1,6 @@
/* Definitions for data structures and routines for the regular
expression library.
- Copyright (C) 1985, 1989-2016 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/support/regex_internal.c b/support/regex_internal.c
index 18641ef1..2b3120c2 100644
--- a/support/regex_internal.c
+++ b/support/regex_internal.c
@@ -840,7 +840,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
}
static unsigned char
-internal_function __attribute__ ((__pure__))
+internal_function __attribute ((pure))
re_string_peek_byte_case (const re_string_t *pstr, int idx)
{
int ch, off;
@@ -1372,7 +1372,7 @@ re_node_set_insert_last (re_node_set *set, int elem)
return 1 if SET1 and SET2 are equivalent, return 0 otherwise. */
static int
-internal_function __attribute__ ((__pure__))
+internal_function __attribute ((pure))
re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
{
int i;
@@ -1387,7 +1387,7 @@ re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
/* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */
static int
-internal_function __attribute__ ((__pure__))
+internal_function __attribute ((pure))
re_node_set_contains (const re_node_set *set, int elem)
{
unsigned int idx, right, mid;
diff --git a/support/regex_internal.h b/support/regex_internal.h
index 01465e76..9f4ff070 100644
--- a/support/regex_internal.h
+++ b/support/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -44,9 +44,6 @@
#if defined HAVE_STDINT_H || defined _LIBC
# include <stdint.h>
#endif /* HAVE_STDINT_H || _LIBC */
-
-#include "intprops.h"
-
#if defined _LIBC
# include <libc-lock.h>
#else
diff --git a/support/regexec.c b/support/regexec.c
index c8f11e52..14813596 100644
--- a/support/regexec.c
+++ b/support/regexec.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -55,7 +55,8 @@ static int re_search_stub (struct re_pattern_buffer *bufp,
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 reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
+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_state_context (const re_match_context_t *mctx,
@@ -362,12 +363,10 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
{
const char *str;
int rval;
- int len;
+ int len = length1 + length2;
char *s = NULL;
- if (BE ((length1 < 0 || length2 < 0 || stop < 0
- || INT_ADD_WRAPV (length1, length2, &len)),
- 0))
+ if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
return -2;
/* Concatenate the strings. */
@@ -939,6 +938,7 @@ re_search_internal (const regex_t *preg, const char *string, int length,
}
static reg_errcode_t
+internal_function __attribute_warn_unused_result__
prune_impossible_nodes (re_match_context_t *mctx)
{
const re_dfa_t *const dfa = mctx->dfa;
@@ -1034,7 +1034,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
since initial states may have constraints like "\<", "^", etc.. */
static inline re_dfastate_t *
-__attribute__ ((always_inline)) internal_function
+__attribute ((always_inline)) internal_function
acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
int idx)
{
@@ -2395,7 +2395,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
/* Skip bytes in the input that correspond to part of a
multi-byte match, then look in the log for a state
from which to restart matching. */
-static re_dfastate_t *
+re_dfastate_t *
internal_function
find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
{