From: Paul Eggert Date: Sun, 16 Dec 2018 16:11:35 +0000 (-0800) Subject: Update from Gnulib X-Git-Tag: emacs-27.0.90~3984 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f74595aace4b1240402562b0073b06c170969327;p=emacs.git Update from Gnulib This incorporates: 2018-12-16 regex: propagate fix for glibc bug 18040 2018-12-16 obstack, libc-config: Support HP-UX cc in C99 mode 2018-12-15 regex: work around a bug in glibc-2.27 and prior 2018-12-13 localtime-buffer: Avoid endless recursion * build-aux/config.guess, build-aux/config.sub, lib/cdefs.h: * lib/gettext.h, lib/localtime-buffer.c, lib/regexec.c, m4/regex.m4: Copy from Gnulib. --- diff --git a/build-aux/config.guess b/build-aux/config.guess index 47d7bed50c5..94c4ac154a3 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-11-28' +timestamp='2018-12-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -96,8 +96,7 @@ fi tmp= # shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { : "${TMPDIR=/tmp}" diff --git a/build-aux/config.sub b/build-aux/config.sub index 46708056af3..a5081b8e0d1 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-11-28' +timestamp='2018-12-16' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ case $# in esac # Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <= 199901L +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif __GNUC_PREREQ (2,97) diff --git a/lib/gettext.h b/lib/gettext.h index f2d7458f4a8..8eef008e7ce 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -185,7 +185,7 @@ npgettext_aux (const char *domain, #include #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ == 199901L + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else diff --git a/lib/localtime-buffer.c b/lib/localtime-buffer.c index df11f4321db..910c8bcfed3 100644 --- a/lib/localtime-buffer.c +++ b/lib/localtime-buffer.c @@ -34,6 +34,7 @@ struct tm *localtime_buffer_addr = &tm_zero_buffer; struct tm * rpl_localtime (time_t const *timep) +#undef localtime { struct tm *tm = localtime (timep); @@ -46,6 +47,7 @@ rpl_localtime (time_t const *timep) /* Same as above, since gmtime and localtime use the same buffer. */ struct tm * rpl_gmtime (time_t const *timep) +#undef gmtime { struct tm *tm = gmtime (timep); diff --git a/lib/regexec.c b/lib/regexec.c index 8b82ea50d44..c7d099c38e4 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -2783,8 +2783,11 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx) return REG_ESPACE; err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node, bkref_str_idx); + buf = (const char *) re_string_get_buffer (&mctx->input); if (err == REG_NOMATCH) continue; + if (__glibc_unlikely (err != REG_NOERROR)) + return err; } } return REG_NOERROR; diff --git a/m4/regex.m4 b/m4/regex.m4 index 055d71b5aaa..3a39b1a2044 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -# serial 67 +# serial 68 # Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc. # @@ -213,6 +213,17 @@ AC_DEFUN([gl_REGEX], if (! REG_STARTEND) result |= 64; + /* Matching with the compiled form of this regexp would provoke + an assertion failure prior to glibc-2.28: + regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed + With glibc-2.28, compilation fails and reports the invalid + back reference. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex); + if (!s || strcmp (s, "Invalid back reference")) + result |= 64; + #if 0 /* It would be nice to reject hosts whose regoff_t values are too narrow (including glibc on hosts with 64-bit ptrdiff_t and