emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f74595a: Update from Gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master f74595a: Update from Gnulib
Date: Sun, 16 Dec 2018 11:12:28 -0500 (EST)

branch: master
commit f74595aace4b1240402562b0073b06c170969327
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 build-aux/config.guess |  5 ++---
 build-aux/config.sub   |  6 +++---
 lib/cdefs.h            |  2 +-
 lib/gettext.h          |  2 +-
 lib/localtime-buffer.c |  2 ++
 lib/regexec.c          |  3 +++
 m4/regex.m4            | 13 ++++++++++++-
 7 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 47d7bed..94c4ac1 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 4670805..a5081b8 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 <<EOF
+IFS="-" read field1 field2 field3 field4 <<EOF
 $1
 EOF
 
@@ -918,7 +918,7 @@ case $basic_machine in
                ;;
 
        *-*)
-               IFS="-" read -r cpu vendor <<EOF
+               IFS="-" read cpu vendor <<EOF
 $basic_machine
 EOF
                ;;
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 2d620cc..70fb638 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -139,7 +139,7 @@
    Headers that should use flexible arrays only if they're "real"
    (e.g. only if they won't affect sizeof()) should test
    #if __glibc_c99_flexarr_available.  */
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 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 f2d7458..8eef008 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -185,7 +185,7 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #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 df11f43..910c8bc 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 8b82ea5..c7d099c 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 055d71b..3a39b1a 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 (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+            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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]