aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2019-02-02 13:13:45 -0800
committerPaul Eggert2019-02-02 13:15:10 -0800
commitadc31c6bdcdb52c2bc0240982d3e8ce870af1fab (patch)
tree7019058dda25743b71ebc584351f6fd0e89bca0e /lib
parent6f52478e0c42f02cba940c21b18242f05e1ea2a1 (diff)
downloademacs-adc31c6bdcdb52c2bc0240982d3e8ce870af1fab.tar.gz
emacs-adc31c6bdcdb52c2bc0240982d3e8ce870af1fab.zip
Update from Gnulib
This incorporates: 2019-02-02 dtoastr, ftoastr, ldtoastr: port to c-strtod changes 2019-02-01 c-strtod, c-strtold: use the bug fixes 2019-01-30 strtold: New module * doc/misc/texinfo.tex, lib/ftoastr.c, lib/regexec.c, lib/stdlib.in.h: * m4/stdlib_h.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * m4/c-strtod.m4: Remove.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftoastr.c6
-rw-r--r--lib/gnulib.mk.in8
-rw-r--r--lib/regexec.c6
-rw-r--r--lib/stdlib.in.h27
4 files changed, 40 insertions, 7 deletions
diff --git a/lib/ftoastr.c b/lib/ftoastr.c
index 6c0ce261dca..55f1e02e80f 100644
--- a/lib/ftoastr.c
+++ b/lib/ftoastr.c
@@ -40,9 +40,7 @@
40# define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND 40# define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND
41# define FTOASTR ldtoastr 41# define FTOASTR ldtoastr
42# define PROMOTED_FLOAT long double 42# define PROMOTED_FLOAT long double
43# if HAVE_C99_STRTOLD 43# define STRTOF strtold
44# define STRTOF strtold
45# endif
46#elif LENGTH == 2 44#elif LENGTH == 2
47# define FLOAT double 45# define FLOAT double
48# define FLOAT_DIG DBL_DIG 46# define FLOAT_DIG DBL_DIG
@@ -63,7 +61,7 @@
63# endif 61# endif
64#endif 62#endif
65 63
66/* On pre-C99 hosts, approximate strtof and strtold with strtod. This 64/* On pre-C99 hosts, approximate strtof with strtod. This
67 may generate one or two extra digits, but that's better than not 65 may generate one or two extra digits, but that's better than not
68 working at all. */ 66 working at all. */
69#ifndef STRTOF 67#ifndef STRTOF
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index fdf45d61c4c..d8e51ad403b 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -176,7 +176,6 @@ BUILD_DETAILS = @BUILD_DETAILS@
176BYTESWAP_H = @BYTESWAP_H@ 176BYTESWAP_H = @BYTESWAP_H@
177CAIRO_CFLAGS = @CAIRO_CFLAGS@ 177CAIRO_CFLAGS = @CAIRO_CFLAGS@
178CAIRO_LIBS = @CAIRO_LIBS@ 178CAIRO_LIBS = @CAIRO_LIBS@
179CANNOT_DUMP = @CANNOT_DUMP@
180CC = @CC@ 179CC = @CC@
181CFLAGS = @CFLAGS@ 180CFLAGS = @CFLAGS@
182CFLAGS_SOUND = @CFLAGS_SOUND@ 181CFLAGS_SOUND = @CFLAGS_SOUND@
@@ -432,6 +431,7 @@ GNULIB_STRSTR = @GNULIB_STRSTR@
432GNULIB_STRTOD = @GNULIB_STRTOD@ 431GNULIB_STRTOD = @GNULIB_STRTOD@
433GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ 432GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
434GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ 433GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
434GNULIB_STRTOLD = @GNULIB_STRTOLD@
435GNULIB_STRTOLL = @GNULIB_STRTOLL@ 435GNULIB_STRTOLL = @GNULIB_STRTOLL@
436GNULIB_STRTOULL = @GNULIB_STRTOULL@ 436GNULIB_STRTOULL = @GNULIB_STRTOULL@
437GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ 437GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
@@ -634,6 +634,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@
634HAVE_STRPTIME = @HAVE_STRPTIME@ 634HAVE_STRPTIME = @HAVE_STRPTIME@
635HAVE_STRSEP = @HAVE_STRSEP@ 635HAVE_STRSEP = @HAVE_STRSEP@
636HAVE_STRTOD = @HAVE_STRTOD@ 636HAVE_STRTOD = @HAVE_STRTOD@
637HAVE_STRTOLD = @HAVE_STRTOLD@
637HAVE_STRTOLL = @HAVE_STRTOLL@ 638HAVE_STRTOLL = @HAVE_STRTOLL@
638HAVE_STRTOULL = @HAVE_STRTOULL@ 639HAVE_STRTOULL = @HAVE_STRTOULL@
639HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ 640HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
@@ -934,6 +935,7 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
934REPLACE_STRTOD = @REPLACE_STRTOD@ 935REPLACE_STRTOD = @REPLACE_STRTOD@
935REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ 936REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
936REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ 937REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
938REPLACE_STRTOLD = @REPLACE_STRTOLD@
937REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ 939REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
938REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ 940REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
939REPLACE_SYMLINK = @REPLACE_SYMLINK@ 941REPLACE_SYMLINK = @REPLACE_SYMLINK@
@@ -959,6 +961,7 @@ REPLACE_WRITE = @REPLACE_WRITE@
959RSVG_CFLAGS = @RSVG_CFLAGS@ 961RSVG_CFLAGS = @RSVG_CFLAGS@
960RSVG_LIBS = @RSVG_LIBS@ 962RSVG_LIBS = @RSVG_LIBS@
961SEPCHAR = @SEPCHAR@ 963SEPCHAR = @SEPCHAR@
964SETFATTR = @SETFATTR@
962SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ 965SETTINGS_CFLAGS = @SETTINGS_CFLAGS@
963SETTINGS_LIBS = @SETTINGS_LIBS@ 966SETTINGS_LIBS = @SETTINGS_LIBS@
964SHELL = @SHELL@ 967SHELL = @SHELL@
@@ -2546,6 +2549,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
2546 -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ 2549 -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
2547 -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ 2550 -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
2548 -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ 2551 -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
2552 -e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \
2549 -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ 2553 -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
2550 -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ 2554 -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
2551 -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ 2555 -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
@@ -2582,6 +2586,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
2582 -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ 2586 -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
2583 -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ 2587 -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
2584 -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ 2588 -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
2589 -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
2585 -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ 2590 -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
2586 -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ 2591 -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
2587 -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ 2592 -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
@@ -2605,6 +2610,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
2605 -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ 2610 -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
2606 -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ 2611 -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
2607 -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ 2612 -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
2613 -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
2608 -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ 2614 -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
2609 -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ 2615 -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
2610 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ 2616 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
diff --git a/lib/regexec.c b/lib/regexec.c
index 2f7cb5dcb1f..7fcd1a509ae 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
1293 else if (naccepted) 1293 else if (naccepted)
1294 { 1294 {
1295 char *buf = (char *) re_string_get_buffer (&mctx->input); 1295 char *buf = (char *) re_string_get_buffer (&mctx->input);
1296 if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, 1296 if (mctx->input.valid_len - *pidx < naccepted
1297 naccepted) != 0) 1297 || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
1298 naccepted)
1299 != 0))
1298 return -1; 1300 return -1;
1299 } 1301 }
1300 } 1302 }
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index be8ab3b86c2..f829525c104 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -929,6 +929,7 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
929# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 929# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
930# define strtod rpl_strtod 930# define strtod rpl_strtod
931# endif 931# endif
932# define GNULIB_defined_strtod_function 1
932_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) 933_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
933 _GL_ARG_NONNULL ((1))); 934 _GL_ARG_NONNULL ((1)));
934_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); 935_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
@@ -948,6 +949,32 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
948# endif 949# endif
949#endif 950#endif
950 951
952#if @GNULIB_STRTOLD@
953 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
954# if @REPLACE_STRTOLD@
955# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
956# define strtold rpl_strtold
957# endif
958# define GNULIB_defined_strtold_function 1
959_GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp)
960 _GL_ARG_NONNULL ((1)));
961_GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp));
962# else
963# if !@HAVE_STRTOLD@
964_GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp)
965 _GL_ARG_NONNULL ((1)));
966# endif
967_GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp));
968# endif
969_GL_CXXALIASWARN (strtold);
970#elif defined GNULIB_POSIXCHECK
971# undef strtold
972# if HAVE_RAW_DECL_STRTOLD
973_GL_WARN_ON_USE (strtold, "strtold is unportable - "
974 "use gnulib module strtold for portability");
975# endif
976#endif
977
951#if @GNULIB_STRTOLL@ 978#if @GNULIB_STRTOLL@
952/* Parse a signed integer whose textual representation starts at STRING. 979/* Parse a signed integer whose textual representation starts at STRING.
953 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, 980 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,