diff options
Diffstat (limited to 'lib')
344 files changed, 850 insertions, 816 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 719813e..0649bbf 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # # 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 @@ -197,7 +197,7 @@ if GL_GENERATE_ALLOCA_H alloca.h: alloca.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca.in.h; \ + sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \ } > $@-t && \ mv -f $@-t $@ else @@ -2313,6 +2313,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \ -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ @@ -2326,7 +2327,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \ + -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ @@ -2344,8 +2347,10 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ @@ -2354,6 +2359,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ @@ -2361,11 +2367,14 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ diff --git a/lib/Makefile.in b/lib/Makefile.in index e1501aa..5622ed4 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # # 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 @@ -697,6 +697,7 @@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +FUZZ_LIBS = @FUZZ_LIBS@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ GETOPT_H = @GETOPT_H@ @@ -944,6 +945,7 @@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLD = @GNULIB_STRTOLD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ @@ -1025,6 +1027,7 @@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ @@ -1116,6 +1119,7 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -1141,6 +1145,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MBTOWC = @HAVE_MBTOWC@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ @@ -1194,6 +1199,7 @@ HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -1214,6 +1220,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLD = @HAVE_STRTOLD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ @@ -1522,6 +1529,7 @@ REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ REPLACE_IOCTL = @REPLACE_IOCTL@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ @@ -1574,6 +1582,7 @@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM = @REPLACE_RANDOM@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ @@ -1587,6 +1596,7 @@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SELECT = @REPLACE_SELECT@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ @@ -1608,6 +1618,7 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ @@ -1730,7 +1741,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -3022,7 +3032,7 @@ uninstall-am: @GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status @GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ @GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -@GL_GENERATE_ALLOCA_H_TRUE@ cat $(srcdir)/alloca.in.h; \ +@GL_GENERATE_ALLOCA_H_TRUE@ sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \ @GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \ @GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@ @GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status @@ -3695,6 +3705,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \ -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ @@ -3708,7 +3719,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \ + -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ @@ -3726,8 +3739,10 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ @@ -3736,6 +3751,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ @@ -3743,11 +3759,14 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h index 94fdfaf..7594e4b 100644 --- a/lib/_Noreturn.h +++ b/lib/_Noreturn.h @@ -1,8 +1,11 @@ #ifndef _Noreturn -# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# if (defined __cplusplus \ + && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ + || (defined _MSC_VER && 1900 <= _MSC_VER))) # define _Noreturn [[noreturn]] -# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) +# elif ((!defined __cplusplus || defined __clang__) \ + && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))) /* _Noreturn works as-is. */ # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) diff --git a/lib/accept.c b/lib/accept.c index 9659c71..8ea3f3e 100644 --- a/lib/accept.c +++ b/lib/accept.c @@ -1,6 +1,6 @@ /* accept.c --- wrappers for Windows accept function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/af_alg.c b/lib/af_alg.c index e0e9583..c19f418 100644 --- a/lib/af_alg.c +++ b/lib/af_alg.c @@ -1,5 +1,5 @@ /* af_alg.c - Compute message digests from file streams and buffers. - Copyright (C) 2018 Free Software Foundation, Inc. + Copyright (C) 2018-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff --git a/lib/af_alg.h b/lib/af_alg.h index 7f3ae00..f30867f 100644 --- a/lib/af_alg.h +++ b/lib/af_alg.h @@ -1,5 +1,5 @@ /* af_alg.h - Compute message digests from file streams and buffers. - Copyright (C) 2018 Free Software Foundation, Inc. + Copyright (C) 2018-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -66,7 +66,7 @@ afalg_buffer (const char *buffer, size_t len, const char *alg, STREAM is an open file stream. The last operation on STREAM should not be 'ungetc', and if STREAM is also open for writing it should have been fflushed since its last write. Read from the current - position to the end of STREAM. Handle regular files efficently. + position to the end of STREAM. Handle regular files efficiently. ALG is the message digest algorithm; see the file /proc/crypto. diff --git a/lib/alloca.c b/lib/alloca.c index ee0f018..d0476d5 100644 --- a/lib/alloca.c +++ b/lib/alloca.c @@ -350,16 +350,16 @@ i00afunc (long *address) /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ - if (trailer == 0) + if (trailer == NULL) abort (); /* Discard segments that do not contain our argument address. */ - while (trailer != 0) + while (trailer != NULL) { block = (long *) trailer->this_address; size = trailer->this_size; - if (block == 0 || size == 0) + if (block == NULL || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) @@ -371,7 +371,7 @@ i00afunc (long *address) result = address - block; - if (trailer == 0) + if (trailer == NULL) { return result; } @@ -383,7 +383,7 @@ i00afunc (long *address) result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } - while (trailer != 0); + while (trailer != NULL); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed diff --git a/lib/alloca.in.h b/lib/alloca.in.h index 5ad8af8..a581d58 100644 --- a/lib/alloca.in.h +++ b/lib/alloca.in.h @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2018 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -36,6 +36,12 @@ #ifndef alloca # ifdef __GNUC__ + /* Some version of mingw have an <alloca.h> that causes trouble when + included after 'alloca' gets defined as a macro. As a workaround, include + this <alloca.h> first and define 'alloca' as a macro afterwards. */ +# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ +# include_next <alloca.h> +# endif # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca diff --git a/lib/arg-nonnull.h b/lib/arg-nonnull.h index 5f03408..ad8c26c 100644 --- a/lib/arg-nonnull.h +++ b/lib/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h index 3253d79..1109921 100644 --- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -1,6 +1,6 @@ /* A GNU-like <arpa/inet.h>. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/array-mergesort.h b/lib/array-mergesort.h index 6988dfe..eede2ec 100644 --- a/lib/array-mergesort.h +++ b/lib/array-mergesort.h @@ -1,5 +1,5 @@ /* Stable-sorting of an array using mergesort. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/asnprintf.c b/lib/asnprintf.c index 2298455..d2a8c09 100644 --- a/lib/asnprintf.c +++ b/lib/asnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/asprintf.c b/lib/asprintf.c index 061072f..6cbd062 100644 --- a/lib/asprintf.c +++ b/lib/asprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2007, 2009-2018 Free Software Foundation, + Copyright (C) 1999, 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/base32.c b/lib/base32.c index 20c85ec..c0bd434 100644 --- a/lib/base32.c +++ b/lib/base32.c @@ -1,5 +1,5 @@ /* base32.c -- Encode binary data using printable characters. - Copyright (C) 1999-2001, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/base32.h b/lib/base32.h index 6c408e8..d63d1d4 100644 --- a/lib/base32.h +++ b/lib/base32.h @@ -1,5 +1,5 @@ /* base32.h -- Encode binary data using printable characters. - Copyright (C) 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2009-2019 Free Software Foundation, Inc. Adapted from Simon Josefsson's base64 code by Gijs van Tulder. This program is free software; you can redistribute it and/or modify diff --git a/lib/basename-lgpl.c b/lib/basename-lgpl.c index 33f9994..0ae04ee 100644 --- a/lib/basename-lgpl.c +++ b/lib/basename-lgpl.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2018 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/basename.c b/lib/basename.c index 02adb8c..1b6e0ea 100644 --- a/lib/basename.c +++ b/lib/basename.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2018 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/binary-io.c b/lib/binary-io.c index f9cc4dd..01e0bf6 100644 --- a/lib/binary-io.c +++ b/lib/binary-io.c @@ -1,5 +1,5 @@ /* Binary mode I/O. - Copyright 2017-2018 Free Software Foundation, Inc. + Copyright 2017-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/binary-io.h b/lib/binary-io.h index 1f21fc0..720b08c 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -1,5 +1,5 @@ /* Binary mode I/O. - Copyright (C) 2001, 2003, 2005, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* bind.c --- wrappers for Windows bind function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/btowc.c b/lib/btowc.c index 54124b2..9e2496d 100644 --- a/lib/btowc.c +++ b/lib/btowc.c @@ -1,5 +1,5 @@ /* Convert unibyte character to wide character. - Copyright (C) 2008, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2008, 2010-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/byteswap.in.h b/lib/byteswap.in.h index 547e384..273855d 100644 --- a/lib/byteswap.in.h +++ b/lib/byteswap.in.h @@ -1,5 +1,5 @@ /* byteswap.h - Byte swapping - Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2019 Free Software Foundation, Inc. Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005. This program is free software: you can redistribute it and/or modify diff --git a/lib/c++defs.h b/lib/c++defs.h index 72ff1ff..87d0716 100644 --- a/lib/c++defs.h +++ b/lib/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/c-ctype.h b/lib/c-ctype.h index d55d4f6..4d52176 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -5,7 +5,7 @@ <ctype.h> functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/c-strcase.h b/lib/c-strcase.h index 41f439e..b67c9b5 100644 --- a/lib/c-strcase.h +++ b/lib/c-strcase.h @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions in C locale. - Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2018 Free Software + Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c index 2b1ac99..ec50f1a 100644 --- a/lib/c-strcasecmp.c +++ b/lib/c-strcasecmp.c @@ -1,5 +1,5 @@ /* c-strcasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/c-strcaseeq.h b/lib/c-strcaseeq.h index 9bde9de..bcc81fc 100644 --- a/lib/c-strcaseeq.h +++ b/lib/c-strcaseeq.h @@ -1,5 +1,5 @@ /* Optimized case-insensitive string comparison in C locale. - Copyright (C) 2001-2002, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/c-strcasestr.c b/lib/c-strcasestr.c index 5865d7b..f3174db 100644 --- a/lib/c-strcasestr.c +++ b/lib/c-strcasestr.c @@ -1,5 +1,5 @@ /* c-strcasestr.c -- case insensitive substring search in C locale - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2005. This program is free software: you can redistribute it and/or modify diff --git a/lib/c-strcasestr.h b/lib/c-strcasestr.h index c5d7df2..871b0e6 100644 --- a/lib/c-strcasestr.h +++ b/lib/c-strcasestr.h @@ -1,5 +1,5 @@ /* Case-insensitive searching in a string in C locale. - Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c index 8151c1a..513c353 100644 --- a/lib/c-strncasecmp.c +++ b/lib/c-strncasecmp.c @@ -1,5 +1,5 @@ /* c-strncasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/cdefs.h b/lib/cdefs.h index 2d620cc..96d2616 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992-2019 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 @@ -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) @@ -340,7 +340,7 @@ semantics. clang++ identifies itself as gcc-4.2, but has support for GNU inlining - semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and + semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and __GNUC_GNU_INLINE__ macro definitions. */ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ diff --git a/lib/cloexec.c b/lib/cloexec.c index 238ab18..db42576 100644 --- a/lib/cloexec.c +++ b/lib/cloexec.c @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 1991, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1991, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/cloexec.h b/lib/cloexec.h index 5902805..06ad945 100644 --- a/lib/cloexec.h +++ b/lib/cloexec.h @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 2004, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/close.c b/lib/close.c index 01c326a..40ce845 100644 --- a/lib/close.c +++ b/lib/close.c @@ -1,5 +1,5 @@ /* close replacement. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/connect.c b/lib/connect.c index 300a594..9106a0d 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -1,6 +1,6 @@ /* connect.c --- wrappers for Windows connect function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/dirname-lgpl.c b/lib/dirname-lgpl.c index a40f6a9..7cf89d8 100644 --- a/lib/dirname-lgpl.c +++ b/lib/dirname-lgpl.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2018 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/dirname.c b/lib/dirname.c index 766f862..1e042a5 100644 --- a/lib/dirname.c +++ b/lib/dirname.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2018 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/dirname.h b/lib/dirname.h index 8b51111..5791659 100644 --- a/lib/dirname.h +++ b/lib/dirname.h @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2018 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/dosname.h b/lib/dosname.h index fef3b6d..c0ab684 100644 --- a/lib/dosname.h +++ b/lib/dosname.h @@ -1,6 +1,6 @@ /* File names on MS-DOS/Windows systems. - Copyright (C) 2000-2001, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/dup-safer-flag.c b/lib/dup-safer-flag.c index aa28194..485f741 100644 --- a/lib/dup-safer-flag.c +++ b/lib/dup-safer-flag.c @@ -1,7 +1,7 @@ /* Duplicate a file descriptor result, avoiding clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2001, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/dup-safer.c b/lib/dup-safer.c index 1f1679e..c0c5f2a 100644 --- a/lib/dup-safer.c +++ b/lib/dup-safer.c @@ -1,6 +1,6 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/errno.in.h b/lib/errno.in.h index b95c4e9..3bd27f1 100644 --- a/lib/errno.in.h +++ b/lib/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like <errno.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/error.c b/lib/error.c index adc8733..7e532f0 100644 --- a/lib/error.c +++ b/lib/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/error.h b/lib/error.h index 36401e1..3759f8a 100644 --- a/lib/error.h +++ b/lib/error.h @@ -1,5 +1,5 @@ /* Declaration for error-reporting function - Copyright (C) 1995-1997, 2003, 2006, 2008-2018 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/exitfail.c b/lib/exitfail.c index 19c5cba..69b3513 100644 --- a/lib/exitfail.c +++ b/lib/exitfail.c @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/exitfail.h b/lib/exitfail.h index a42057b..480ad1a 100644 --- a/lib/exitfail.h +++ b/lib/exitfail.h @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c index 9d795f7..c9153f1 100644 --- a/lib/fatal-signal.c +++ b/lib/fatal-signal.c @@ -1,5 +1,5 @@ /* Emergency actions in case of a fatal signal. - Copyright (C) 2003-2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2004, 2006-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software: you can redistribute it and/or modify @@ -107,7 +107,7 @@ init_fatal_signals (void) /* ========================================================================= */ -typedef void (*action_t) (void); +typedef _GL_ASYNC_SAFE void (*action_t) (int sig); /* Type of an entry in the actions array. The 'action' field is accessed from within the fatal_signal_handler(), @@ -131,7 +131,7 @@ static struct sigaction saved_sigactions[64]; /* Uninstall the handlers. */ -static void +static _GL_ASYNC_SAFE void uninstall_handlers (void) { size_t i; @@ -148,7 +148,7 @@ uninstall_handlers (void) /* The signal handler. It gets called asynchronously. */ -static void +static _GL_ASYNC_SAFE void fatal_signal_handler (int sig) { for (;;) @@ -162,7 +162,7 @@ fatal_signal_handler (int sig) actions_count = n; action = actions[n].action; /* Execute the action. */ - action (); + action (sig); } /* Now execute the signal's default action. @@ -284,3 +284,20 @@ unblock_fatal_signals (void) init_fatal_signal_set (); sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); } + + +unsigned int +get_fatal_signals (int signals[64]) +{ + init_fatal_signal_set (); + + { + int *p = signals; + size_t i; + + for (i = 0; i < num_fatal_signals; i++) + if (fatal_signals[i] >= 0) + *p++ = fatal_signals[i]; + return p - signals; + } +} diff --git a/lib/fatal-signal.h b/lib/fatal-signal.h index 41b4af7..8ac57cf 100644 --- a/lib/fatal-signal.h +++ b/lib/fatal-signal.h @@ -1,5 +1,5 @@ /* Emergency actions in case of a fatal signal. - Copyright (C) 2003-2004, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2004, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software: you can redistribute it and/or modify @@ -36,7 +36,8 @@ extern "C" { occurs. Restrictions for the cleanup function: - - The cleanup function can do all kinds of system calls. + - The cleanup function can do all kinds of system calls. It may also + modify (clobber) errno. - It can also access application dependent memory locations and data structures provided they are in a consistent state. One way to ensure this is through block_fatal_signals()/unblock_fatal_signals(), see @@ -51,7 +52,7 @@ extern "C" { The cleanup function is executed asynchronously. It is unspecified whether during its execution the catchable fatal signals are blocked or not. */ -extern void at_fatal_signal (void (*function) (void)); +extern void at_fatal_signal (_GL_ASYNC_SAFE void (*function) (int sig)); /* Sometimes it is necessary to block the usually fatal signals while the @@ -71,6 +72,12 @@ extern void block_fatal_signals (void); extern void unblock_fatal_signals (void); +/* Return the list of signals that block_fatal_signals/unblock_fatal_signals + would block or unblock. + Fills signals[0..count-1] and returns count. */ +extern unsigned int get_fatal_signals (int signals[64]); + + #ifdef __cplusplus } #endif diff --git a/lib/fcntl.c b/lib/fcntl.c index 74e0f5d..51f62ef 100644 --- a/lib/fcntl.c +++ b/lib/fcntl.c @@ -1,6 +1,6 @@ /* Provide file descriptor control. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -545,7 +545,7 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) #ifdef __KLIBC__ static int -klibc_fcntl (int fd, int action, /* arg */...); +klibc_fcntl (int fd, int action, /* arg */...) { va_list arg_ptr; int arg; diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index a1e7d35..eb70dc6 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -1,6 +1,6 @@ /* Like <fcntl.h>, but with non-working flags defined to 0. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fd-hook.c b/lib/fd-hook.c index 95a0662..7879119 100644 --- a/lib/fd-hook.c +++ b/lib/fd-hook.c @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/fd-hook.h b/lib/fd-hook.h index dbc5b67..bf07f00 100644 --- a/lib/fd-hook.h +++ b/lib/fd-hook.h @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/fd-safer-flag.c b/lib/fd-safer-flag.c index b757484..7c026ef 100644 --- a/lib/fd-safer-flag.c +++ b/lib/fd-safer-flag.c @@ -1,7 +1,7 @@ /* Adjust a file descriptor result so that it avoids clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fd-safer.c b/lib/fd-safer.c index 1ea9a49..b5113e1 100644 --- a/lib/fd-safer.c +++ b/lib/fd-safer.c @@ -1,6 +1,6 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fflush.c b/lib/fflush.c index a140b7a..22b26f2 100644 --- a/lib/fflush.c +++ b/lib/fflush.c @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/filename.h b/lib/filename.h index a7ad7e7..3ba3105 100644 --- a/lib/filename.h +++ b/lib/filename.h @@ -1,5 +1,5 @@ /* Basic filename support macros. - Copyright (C) 2001-2004, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/flexmember.h b/lib/flexmember.h index 7e3f598..0d65f6d 100644 --- a/lib/flexmember.h +++ b/lib/flexmember.h @@ -1,6 +1,6 @@ /* Sizes of structs with flexible array members. - Copyright 2016-2018 Free Software Foundation, Inc. + Copyright 2016-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/float+.h b/lib/float+.h index 2cb858f..5af861f 100644 --- a/lib/float+.h +++ b/lib/float+.h @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2007. This program is free software; you can redistribute it and/or modify diff --git a/lib/float.c b/lib/float.c index 7caca83..8872deb 100644 --- a/lib/float.c +++ b/lib/float.c @@ -1,5 +1,5 @@ /* Auxiliary definitions for <float.h>. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/lib/float.in.h b/lib/float.in.h index 2cdbd12..ba094a8 100644 --- a/lib/float.in.h +++ b/lib/float.in.h @@ -1,6 +1,6 @@ /* A correct <float.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/flock.c b/lib/flock.c index 4c7285c..d804e57 100644 --- a/lib/flock.c +++ b/lib/flock.c @@ -6,7 +6,7 @@ Written by Richard W.M. Jones <rjones.at.redhat.com> - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 0fa0a3d..dbcd290 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1993, 1996-2007, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-1993, 1996-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fnmatch.in.h b/lib/fnmatch.in.h index af896bd..2ead782 100644 --- a/lib/fnmatch.in.h +++ b/lib/fnmatch.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <fnmatch.h>. - Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2018 Free + Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c index dcf5a15..82a7cee 100644 --- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1993, 1996-2006, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-1993, 1996-2006, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify diff --git a/lib/fopen.c b/lib/fopen.c index 2c9a75d..6d97077 100644 --- a/lib/fopen.c +++ b/lib/fopen.c @@ -1,5 +1,5 @@ /* Open a stream to a file. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fpurge.c b/lib/fpurge.c index f9c82cd..f04d972 100644 --- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -1,5 +1,5 @@ /* Flushing buffers of a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/freading.c b/lib/freading.c index 790f92c..029d0e1 100644 --- a/lib/freading.c +++ b/lib/freading.c @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/freading.h b/lib/freading.h index 31d71fd..2d8f064 100644 --- a/lib/freading.h +++ b/lib/freading.h @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fseek.c b/lib/fseek.c index e0b5877..bb22fe0 100644 --- a/lib/fseek.c +++ b/lib/fseek.c @@ -1,5 +1,5 @@ /* An fseek() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fseeko.c b/lib/fseeko.c index 5bd7d66..859d212 100644 --- a/lib/fseeko.c +++ b/lib/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/fstat.c b/lib/fstat.c index 41ee761..a892b8f 100644 --- a/lib/fstat.c +++ b/lib/fstat.c @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,10 +40,14 @@ orig_fstat (int fd, struct stat *buf) #endif /* Specification. */ +#ifdef __osf__ /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc eliminates this include because of the preliminary #include <sys/stat.h> above. */ -#include "sys/stat.h" +# include "sys/stat.h" +#else +# include <sys/stat.h> +#endif #include "stat-time.h" diff --git a/lib/ftell.c b/lib/ftell.c index 74a1da8..fabaa35 100644 --- a/lib/ftell.c +++ b/lib/ftell.c @@ -1,5 +1,5 @@ /* An ftell() function that works around platform bugs. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/ftello.c b/lib/ftello.c index 495c254..31fa046 100644 --- a/lib/ftello.c +++ b/lib/ftello.c @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/futimens.c b/lib/futimens.c index abcba9e..cc03796 100644 --- a/lib/futimens.c +++ b/lib/futimens.c @@ -1,5 +1,5 @@ /* Set the access and modification time of an open fd. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/gai_strerror.c b/lib/gai_strerror.c index bc5b599..cfe1563 100644 --- a/lib/gai_strerror.c +++ b/lib/gai_strerror.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2018 Free Software +/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997. diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c index ec24e38..ca4e2e6 100644 --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -1,5 +1,5 @@ /* Get address information (partial implementation). - Copyright (C) 1997, 2001-2002, 2004-2018 Free Software Foundation, Inc. + Copyright (C) 1997, 2001-2002, 2004-2019 Free Software Foundation, Inc. Contributed by Simon Josefsson <simon@josefsson.org>. This program is free software; you can redistribute it and/or modify diff --git a/lib/getdelim.c b/lib/getdelim.c index cc1e9fe..528678c 100644 --- a/lib/getdelim.c +++ b/lib/getdelim.c @@ -1,5 +1,5 @@ /* getdelim.c --- Implementation of replacement getdelim function. - Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2018 Free Software + Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c index ac05bc4..03a9243 100644 --- a/lib/getdtablesize.c +++ b/lib/getdtablesize.c @@ -1,5 +1,5 @@ /* getdtablesize() function: Return maximum possible file descriptor value + 1. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/getgroups.c b/lib/getgroups.c index cd6f4d7..d8c77e9 100644 --- a/lib/getgroups.c +++ b/lib/getgroups.c @@ -1,6 +1,6 @@ /* provide consistent interface to getgroups for systems that don't allow N==0 - Copyright (C) 1996, 1999, 2003, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1996, 1999, 2003, 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/getline.c b/lib/getline.c index 59397ea..40882fb 100644 --- a/lib/getline.c +++ b/lib/getline.c @@ -1,5 +1,5 @@ /* getline.c --- Implementation of replacement getline function. - Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/lib/getopt-cdefs.in.h b/lib/getopt-cdefs.in.h index 12b5a87..049145b 100644 --- a/lib/getopt-cdefs.in.h +++ b/lib/getopt-cdefs.in.h @@ -1,5 +1,5 @@ /* getopt-on-non-glibc compatibility macros. - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/lib/getopt-core.h b/lib/getopt-core.h index e51b6c7..6360ad6 100644 --- a/lib/getopt-core.h +++ b/lib/getopt-core.h @@ -1,5 +1,5 @@ /* Declarations for getopt (basic, portable features only). - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/lib/getopt-ext.h b/lib/getopt-ext.h index cb41206..13cb007 100644 --- a/lib/getopt-ext.h +++ b/lib/getopt-ext.h @@ -1,5 +1,5 @@ /* Declarations for getopt (GNU extensions). - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h index c62f9e2..8fac269 100644 --- a/lib/getopt-pfx-core.h +++ b/lib/getopt-pfx-core.h @@ -1,5 +1,5 @@ /* getopt (basic, portable features) gnulib wrapper header. - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h index 753f129..0e21aef 100644 --- a/lib/getopt-pfx-ext.h +++ b/lib/getopt-pfx-ext.h @@ -1,5 +1,5 @@ /* getopt (GNU extensions) gnulib wrapper header. - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/lib/getopt.c b/lib/getopt.c index 11e36ee..8ee075a 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -1,5 +1,5 @@ /* Getopt for GNU. - Copyright (C) 1987-2018 Free Software Foundation, Inc. + Copyright (C) 1987-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/lib/getopt.in.h b/lib/getopt.in.h index 5fb58dd..c77f34c 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library, which supplies a different version of diff --git a/lib/getopt1.c b/lib/getopt1.c index 9c7fff4..883aa6b 100644 --- a/lib/getopt1.c +++ b/lib/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2018 Free Software Foundation, Inc. + Copyright (C) 1987-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/lib/getopt_int.h b/lib/getopt_int.h index b0e9a6d..e63706f 100644 --- a/lib/getopt_int.h +++ b/lib/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/lib/getpass.c b/lib/getpass.c index e787e44..4bd5bfe 100644 --- a/lib/getpass.c +++ b/lib/getpass.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2001, 2003-2007, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992-2001, 2003-2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/getpeername.c b/lib/getpeername.c index 6f3eceb..be1b748 100644 --- a/lib/getpeername.c +++ b/lib/getpeername.c @@ -1,6 +1,6 @@ /* getpeername.c --- wrappers for Windows getpeername function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/getprogname.c b/lib/getprogname.c index 58da144..22d71eb 100644 --- a/lib/getprogname.c +++ b/lib/getprogname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,10 +70,10 @@ getprogname (void) p = "?"; return last_component (p); # elif HAVE_DECL___ARGV /* mingw, MSVC */ - /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */ + /* https://docs.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv */ const char *p = __argv && __argv[0] ? __argv[0] : "?"; return last_component (p); -# elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */ +# elif HAVE_VAR___PROGNAME /* OpenBSD, Android, QNX */ /* https://man.openbsd.org/style.9 */ /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */ /* Be careful to declare this only when we absolutely need it @@ -82,7 +82,11 @@ getprogname (void) malfunction (have zero length) with Fedora 25's glibc. */ extern char *__progname; const char *p = __progname; +# if defined __ANDROID__ + return last_component (p); +# else return p && p[0] ? p : "?"; +# endif # elif _AIX /* AIX */ /* Idea by Bastien ROUCARIÈS, https://lists.gnu.org/r/bug-gnulib/2010-12/msg00095.html diff --git a/lib/getprogname.h b/lib/getprogname.h index ee6688f..1590b38 100644 --- a/lib/getprogname.h +++ b/lib/getprogname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/getsockname.c b/lib/getsockname.c index fc8f6f5..fe281a6 100644 --- a/lib/getsockname.c +++ b/lib/getsockname.c @@ -1,6 +1,6 @@ /* getsockname.c --- wrappers for Windows getsockname function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/gettext.h b/lib/gettext.h index f2d7458..c7c0fdb 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU <libintl.h>. - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2018 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -184,9 +184,16 @@ npgettext_aux (const char *domain, #include <string.h> -#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ == 199901L - || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ) +/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported. + This relates to the -Wvla and -Wvla-larger-than warnings, enabled in + the default GCC many warnings set. This allows programs to disable use + of VLAs, which may be unintended, or may be awkward to support portably, + or may have security implications due to non-deterministic stack usage. */ + +#if (!defined GNULIB_NO_VLA \ + && (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) + || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 diff --git a/lib/gettime.c b/lib/gettime.c index bb59c44..1fd153f 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -1,6 +1,6 @@ /* gettime -- get the system clock - Copyright (C) 2002, 2004-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2004-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 1bd50fa..e728bf4 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -1,6 +1,6 @@ /* Provide gettimeofday for systems that don't have it or for which it's broken. - Copyright (C) 2001-2003, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,10 +72,10 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz) /* On native Windows, there are two ways to get the current time: GetSystemTimeAsFileTime - <https://msdn.microsoft.com/en-us/library/ms724397.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime> or GetSystemTimePreciseAsFileTime - <https://msdn.microsoft.com/en-us/library/hh706895.aspx>. + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. GetSystemTimeAsFileTime produces values that jump by increments of 15.627 milliseconds (!) on average. Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2 @@ -92,7 +92,7 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz) GetSystemTimeAsFileTime (¤t_time); /* Convert from FILETIME to 'struct timeval'. */ - /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */ ULONGLONG since_1601 = ((ULONGLONG) current_time.dwHighDateTime << 32) | (ULONGLONG) current_time.dwLowDateTime; diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h index 7ac3857..ea8f090 100644 --- a/lib/gl_openssl.h +++ b/lib/gl_openssl.h @@ -1,6 +1,6 @@ /* Wrap openssl crypto hash routines in gnulib interface. -*- coding: utf-8 -*- - Copyright (C) 2013-2018 Free Software Foundation, Inc. + Copyright (C) 2013-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c index f166d7c..a4498cb 100644 --- a/lib/glthread/lock.c +++ b/lib/glthread/lock.c @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index 30aa730..636b089 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -416,6 +416,9 @@ extern "C" { # pragma weak pth_rwlock_acquire # pragma weak pth_rwlock_release # pragma weak pth_once +# pragma weak pth_cond_init +# pragma weak pth_cond_await +# pragma weak pth_cond_notify # pragma weak pth_cancel # define pth_in_use() (pth_cancel != NULL) diff --git a/lib/glthread/threadlib.c b/lib/glthread/threadlib.c index e8b484a..a5ebd9b 100644 --- a/lib/glthread/threadlib.c +++ b/lib/glthread/threadlib.c @@ -1,5 +1,5 @@ /* Multithreading primitives. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/group-member.c b/lib/group-member.c index 3747dfe..ad61cf0 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -1,6 +1,6 @@ /* group-member.c -- determine whether group id is in calling user's group list - Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2018 Free Software + Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/hard-locale.c b/lib/hard-locale.c index 49bc6ca..dcfcad6 100644 --- a/lib/hard-locale.c +++ b/lib/hard-locale.c @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2018 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/hard-locale.h b/lib/hard-locale.h index 22eecc5..8f1da96 100644 --- a/lib/hard-locale.h +++ b/lib/hard-locale.h @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/iconv.in.h b/lib/iconv.in.h index f8f7262..090581b 100644 --- a/lib/iconv.in.h +++ b/lib/iconv.in.h @@ -1,6 +1,6 @@ /* A GNU-like <iconv.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index 4ef8fd4..14c38d2 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -1,6 +1,6 @@ /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/intprops.h b/lib/intprops.h index cdaf658..1a44ae5 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index c7d7968..d3c735c 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2018 Free Software Foundation, Inc. +/* Copyright (C) 2006-2019 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. diff --git a/lib/ioctl.c b/lib/ioctl.c index 140c7b6..c4e388d 100644 --- a/lib/ioctl.c +++ b/lib/ioctl.c @@ -1,6 +1,6 @@ /* ioctl.c --- wrappers for Windows ioctl function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/iswblank.c b/lib/iswblank.c index bdd86cb..6d7a6df 100644 --- a/lib/iswblank.c +++ b/lib/iswblank.c @@ -1,5 +1,5 @@ /* Test wide character for being blank. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/itold.c b/lib/itold.c index 6a43bd8..bca01eb 100644 --- a/lib/itold.c +++ b/lib/itold.c @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h index 96c237a..6d40635 100644 --- a/lib/langinfo.in.h +++ b/lib/langinfo.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <langinfo.h>. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/libc-config.h b/lib/libc-config.h index d7b4093..57c6966 100644 --- a/lib/libc-config.h +++ b/lib/libc-config.h @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2018 Free Software Foundation, Inc. + Copyright 2017-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff --git a/lib/limits.in.h b/lib/limits.in.h index 89d7195..39750b3 100644 --- a/lib/limits.in.h +++ b/lib/limits.in.h @@ -1,6 +1,6 @@ /* A GNU-like <limits.h>. - Copyright 2016-2018 Free Software Foundation, Inc. + Copyright 2016-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -1,6 +1,6 @@ /* Emulate link on platforms that lack it, namely native Windows platforms. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/listen.c b/lib/listen.c index 00627f6..600b7c5 100644 --- a/lib/listen.c +++ b/lib/listen.c @@ -1,6 +1,6 @@ /* listen.c --- wrappers for Windows listen function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/localcharset.c b/lib/localcharset.c index 58c5718..38e27e6 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/localcharset.h b/lib/localcharset.h index e4ba296..7d0d771 100644 --- a/lib/localcharset.h +++ b/lib/localcharset.h @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify diff --git a/lib/locale.in.h b/lib/locale.in.h index 123df7a..5f33ed1 100644 --- a/lib/locale.in.h +++ b/lib/locale.in.h @@ -1,5 +1,5 @@ /* A POSIX <locale.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/localeconv.c b/lib/localeconv.c index 87cface..b5a965f 100644 --- a/lib/localeconv.c +++ b/lib/localeconv.c @@ -1,5 +1,5 @@ /* Query locale dependent information for formatting numbers. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/localtime-buffer.c b/lib/localtime-buffer.c index df11f43..b65ea45 100644 --- a/lib/localtime-buffer.c +++ b/lib/localtime-buffer.c @@ -1,6 +1,6 @@ /* Provide access to the last buffer returned by localtime() or gmtime(). - Copyright (C) 2001-2003, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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/localtime-buffer.h b/lib/localtime-buffer.h index f381ff0..031111a 100644 --- a/lib/localtime-buffer.h +++ b/lib/localtime-buffer.h @@ -1,6 +1,6 @@ /* Provide access to the last buffer returned by localtime() or gmtime(). - Copyright (C) 2001-2003, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/lseek.c b/lib/lseek.c index 9125b98..46f7a3f 100644 --- a/lib/lseek.c +++ b/lib/lseek.c @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/lstat.c b/lib/lstat.c index 5873bbd..a3e40d8 100644 --- a/lib/lstat.c +++ b/lib/lstat.c @@ -1,6 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,10 +42,14 @@ orig_lstat (const char *filename, struct stat *buf) } /* Specification. */ +# ifdef __osf__ /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc eliminates this include because of the preliminary #include <sys/stat.h> above. */ -# include "sys/stat.h" +# include "sys/stat.h" +# else +# include <sys/stat.h> +# endif # include "stat-time.h" diff --git a/lib/malloc.c b/lib/malloc.c index 471c3ab..76e6ff7 100644 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/malloca.c b/lib/malloca.c index c54e1e0..f60c5fb 100644 --- a/lib/malloca.c +++ b/lib/malloca.c @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003, 2018. This program is free software; you can redistribute it and/or modify diff --git a/lib/malloca.h b/lib/malloca.h index 1e47813..d80c316 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software; you can redistribute it and/or modify diff --git a/lib/mbchar.c b/lib/mbchar.c index 6d2a47e..aa8012b 100644 --- a/lib/mbchar.c +++ b/lib/mbchar.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/mbchar.h b/lib/mbchar.h index 55c07e3..2d26075 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/mbiter.h b/lib/mbiter.h index 49e50a3..8d8535a 100644 --- a/lib/mbiter.h +++ b/lib/mbiter.h @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c index 2f6df28..bbe3f7a 100644 --- a/lib/mbrtowc.c +++ b/lib/mbrtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbsinit.c b/lib/mbsinit.c index e23a5ad..5ecaef7 100644 --- a/lib/mbsinit.c +++ b/lib/mbsinit.c @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbsrtowcs-impl.h b/lib/mbsrtowcs-impl.h index 2588a88..110d692 100644 --- a/lib/mbsrtowcs-impl.h +++ b/lib/mbsrtowcs-impl.h @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbsrtowcs-state.c b/lib/mbsrtowcs-state.c index 2ab2618..59525e7 100644 --- a/lib/mbsrtowcs-state.c +++ b/lib/mbsrtowcs-state.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbsrtowcs.c b/lib/mbsrtowcs.c index 1da1ce5..14f241e 100644 --- a/lib/mbsrtowcs.c +++ b/lib/mbsrtowcs.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbtowc-impl.h b/lib/mbtowc-impl.h index 633832f..f4ab981 100644 --- a/lib/mbtowc-impl.h +++ b/lib/mbtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/lib/mbtowc.c b/lib/mbtowc.c index a212b22..77a8472 100644 --- a/lib/mbtowc.c +++ b/lib/mbtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify @@ -1,6 +1,6 @@ /* Functions to compute MD2 message digest of files or memory blocks. according to the definition of MD2 in RFC 1319 from April 1992. - Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2018 Free Software + Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for MD2 sum library functions. - Copyright (C) 2000-2001, 2003, 2005, 2008-2018 Free Software Foundation, + Copyright (C) 2000-2001, 2003, 2005, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -1,6 +1,6 @@ /* Functions to compute MD4 message digest of files or memory blocks. according to the definition of MD4 in RFC 1320 from April 1992. - Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2018 Free Software + Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for MD4 sum library functions. - Copyright (C) 2000-2001, 2003, 2005, 2008-2018 Free Software Foundation, + Copyright (C) 2000-2001, 2003, 2005, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -1,6 +1,6 @@ /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2018 Free Software + Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -1,6 +1,6 @@ /* Declaration of functions and data types used for MD5 sum computing library functions. - Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2018 Free Software + Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/memchr.c b/lib/memchr.c index 0b47546..4e0c5f9 100644 --- a/lib/memchr.c +++ b/lib/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2018 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2019 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff --git a/lib/memrchr.c b/lib/memrchr.c index 99acfd9..9602283 100644 --- a/lib/memrchr.c +++ b/lib/memrchr.c @@ -1,6 +1,6 @@ /* memrchr -- find the last occurrence of a byte in a memory block - Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2018 Free Software + Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2019 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), @@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n) if (*--char_ptr == c) return (void *) char_ptr; - longword_ptr = (const longword *) char_ptr; + longword_ptr = (const void *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ diff --git a/lib/minmax.h b/lib/minmax.h index 33a5305..d7f6bea 100644 --- a/lib/minmax.h +++ b/lib/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2018 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/mkdir.c b/lib/mkdir.c index 37d5a0f..b8320d0 100644 --- a/lib/mkdir.c +++ b/lib/mkdir.c @@ -1,7 +1,7 @@ /* On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001, 2003, 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/mkostemp.c b/lib/mkostemp.c index df9ecf8..bbfe9db 100644 --- a/lib/mkostemp.c +++ b/lib/mkostemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2018 Free Software +/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2019 Free Software Foundation, Inc. This file is derived from the one in the GNU C Library. diff --git a/lib/mkstemp.c b/lib/mkstemp.c index 02a7b65..7ef0420 100644 --- a/lib/mkstemp.c +++ b/lib/mkstemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2018 Free Software +/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2019 Free Software Foundation, Inc. This file is derived from the one in the GNU C Library. diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h index 31cf3a4..d13d89c 100644 --- a/lib/mktime-internal.h +++ b/lib/mktime-internal.h @@ -1,6 +1,6 @@ /* mktime variant that also uses an offset guess - Copyright 2016-2018 Free Software Foundation, Inc. + Copyright 2016-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff --git a/lib/mktime.c b/lib/mktime.c index 557712f..e3783d7 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -1,5 +1,5 @@ /* Convert a 'struct tm' to a time_t value. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert <eggert@twinsun.com>. @@ -17,12 +17,6 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ -/* Define this to 1 to have a standalone program to test this implementation of - mktime. */ -#ifndef DEBUG_MKTIME -# define DEBUG_MKTIME 0 -#endif - /* The following macros influence what gets defined when this file is compiled: Macro/expression Which gnulib module This compilation unit @@ -34,12 +28,10 @@ || NEED_MKTIME_WINDOWS NEED_MKTIME_INTERNAL mktime-internal mktime_internal - - DEBUG_MKTIME (defined manually) my_mktime, main */ -#if !defined _LIBC && !DEBUG_MKTIME -# include <config.h> +#ifndef _LIBC +# include <libc-config.h> #endif /* Assume that leap seconds are possible, unless told otherwise. @@ -51,6 +43,7 @@ #include <time.h> +#include <errno.h> #include <limits.h> #include <stdbool.h> #include <stdlib.h> @@ -59,13 +52,6 @@ #include <intprops.h> #include <verify.h> -#if DEBUG_MKTIME -# include <stdio.h> -/* Make it work even if the system's libc has its own mktime routine. */ -# undef mktime -# define mktime my_mktime -#endif /* DEBUG_MKTIME */ - #ifndef NEED_MKTIME_INTERNAL # define NEED_MKTIME_INTERNAL 0 #endif @@ -73,7 +59,7 @@ # define NEED_MKTIME_WINDOWS 0 #endif #ifndef NEED_MKTIME_WORKING -# define NEED_MKTIME_WORKING DEBUG_MKTIME +# define NEED_MKTIME_WORKING 0 #endif #include "mktime-internal.h" @@ -86,7 +72,7 @@ my_tzset (void) /* Rectify the value of the environment variable TZ. There are four possible kinds of such values: - Traditional US time zone names, e.g. "PST8PDT". Syntax: see - <https://msdn.microsoft.com/en-us/library/90s5c885.aspx> + <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset> - Time zone names based on geography, that contain one or more slashes, e.g. "Europe/Moscow". - Time zone names based on geography, without slashes, e.g. @@ -119,11 +105,12 @@ my_tzset (void) #if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL /* A signed type that can represent an integer number of years - multiplied by three times the number of seconds in a year. It is + multiplied by four times the number of seconds in a year. It is needed when converting a tm_year value times the number of seconds - in a year. The factor of three comes because these products need + in a year. The factor of four comes because these products need to be subtracted from each other, and sometimes with an offset - added to them, without worrying about overflow. + added to them, and then with another timestamp added, without + worrying about overflow. Much of the code uses long_int to represent time_t values, to lessen the hassle of dealing with platforms where time_t is @@ -131,12 +118,12 @@ my_tzset (void) time_t values that mktime can generate even on platforms where time_t is excessively wide. */ -#if INT_MAX <= LONG_MAX / 3 / 366 / 24 / 60 / 60 +#if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60 typedef long int long_int; #else typedef long long int long_int; #endif -verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 3 / 366 / 24 / 60 / 60); +verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60); /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. B should be in the range 0 <= B @@ -210,9 +197,10 @@ isdst_differ (int a, int b) were not adjusted between the timestamps. The YEAR values uses the same numbering as TP->tm_year. Values - need not be in the usual range. However, YEAR1 must not overflow - when multiplied by three times the number of seconds in a year, and - likewise for YDAY1 and three times the number of seconds in a day. */ + need not be in the usual range. However, YEAR1 - YEAR0 must not + overflow even when multiplied by three times the number of seconds + in a year, and likewise for YDAY1 - YDAY0 and three times the + number of seconds in a day. */ static long_int ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1, @@ -247,43 +235,25 @@ long_int_avg (long_int a, long_int b) return shr (a, 1) + shr (b, 1) + ((a | b) & 1); } -/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), - assuming that T corresponds to *TP and that no clock adjustments - occurred between *TP and the desired time. - Although T and the returned value are of type long_int, - they represent time_t values and must be in time_t range. - If TP is null, return a value not equal to T; this avoids false matches. +/* Return a long_int value corresponding to (YEAR-YDAY HOUR:MIN:SEC) + minus *TP seconds, assuming no clock adjustments occurred between + the two timestamps. + YEAR and YDAY must not be so large that multiplying them by three times the number of seconds in a year (or day, respectively) would overflow long_int. - If the returned value would be out of range, yield the minimal or - maximal in-range value, except do not yield a value equal to T. */ + *TP should be in the usual range. */ static long_int -guess_time_tm (long_int year, long_int yday, int hour, int min, int sec, - long_int t, const struct tm *tp) +tm_diff (long_int year, long_int yday, int hour, int min, int sec, + struct tm const *tp) { - if (tp) - { - long_int result; - long_int d = ydhms_diff (year, yday, hour, min, sec, - tp->tm_year, tp->tm_yday, - tp->tm_hour, tp->tm_min, tp->tm_sec); - if (! INT_ADD_WRAPV (t, d, &result)) - return result; - } - - /* Overflow occurred one way or another. Return the nearest result - that is actually in range, except don't report a zero difference - if the actual difference is nonzero, as that would cause a false - match; and don't oscillate between two values, as that would - confuse the spring-forward gap detector. */ - return (t < long_int_avg (mktime_min, mktime_max) - ? (t <= mktime_min + 1 ? t + 1 : mktime_min) - : (mktime_max - 1 <= t ? t - 1 : mktime_max)); + return ydhms_diff (year, yday, hour, min, sec, + tp->tm_year, tp->tm_yday, + tp->tm_hour, tp->tm_min, tp->tm_sec); } /* Use CONVERT to convert T to a struct tm value in *TM. T must be in - range for time_t. Return TM if successful, NULL if T is out of - range for CONVERT. */ + range for time_t. Return TM if successful, NULL (setting errno) on + failure. */ static struct tm * convert_time (struct tm *(*convert) (const time_t *, struct tm *), long_int t, struct tm *tm) @@ -295,47 +265,48 @@ convert_time (struct tm *(*convert) (const time_t *, struct tm *), /* Use CONVERT to convert *T to a broken down time in *TP. If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. - A value is in range if it fits in both time_t and long_int. */ + A value is in range if it fits in both time_t and long_int. + Return TP on success, NULL (setting errno) on failure. */ static struct tm * ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), long_int *t, struct tm *tp) { - struct tm *r; - if (*t < mktime_min) - *t = mktime_min; - else if (mktime_max < *t) - *t = mktime_max; - r = convert_time (convert, *t, tp); - - if (!r && *t) + long_int t1 = (*t < mktime_min ? mktime_min + : *t <= mktime_max ? *t : mktime_max); + struct tm *r = convert_time (convert, t1, tp); + if (r) { - long_int bad = *t; - long_int ok = 0; + *t = t1; + return r; + } + if (errno != EOVERFLOW) + return NULL; - /* BAD is a known unconvertible value, and OK is a known good one. - Use binary search to narrow the range between BAD and OK until - they differ by 1. */ - while (true) - { - long_int mid = long_int_avg (ok, bad); - if (mid != ok && mid != bad) - break; - r = convert_time (convert, mid, tp); - if (r) - ok = mid; - else - bad = mid; - } + long_int bad = t1; + long_int ok = 0; + struct tm oktm; oktm.tm_sec = -1; - if (!r && ok) - { - /* The last conversion attempt failed; - revert to the most recent successful attempt. */ - r = convert_time (convert, ok, tp); - } + /* BAD is a known out-of-range value, and OK is a known in-range one. + Use binary search to narrow the range between BAD and OK until + they differ by 1. */ + while (true) + { + long_int mid = long_int_avg (ok, bad); + if (mid == ok || mid == bad) + break; + if (convert_time (convert, mid, tp)) + ok = mid, oktm = *tp; + else if (errno != EOVERFLOW) + return NULL; + else + bad = mid; } - return r; + if (oktm.tm_sec < 0) + return NULL; + *t = ok; + *tp = oktm; + return tp; } @@ -344,13 +315,14 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), Use *OFFSET to keep track of a guess at the offset of the result, compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. + If successful, set *TP to the canonicalized struct tm; + otherwise leave *TP alone, return ((time_t) -1) and set errno. This function is external because it is used also by timegm.c. */ time_t __mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), mktime_offset_t *offset) { - long_int t, gt, t0, t1, t2, dt; struct tm tm; /* The maximum number of probes (calls to CONVERT) should be enough @@ -370,7 +342,7 @@ __mktime_internal (struct tm *tp, int isdst = tp->tm_isdst; /* 1 if the previous probe was DST. */ - int dst2; + int dst2 = 0; /* Ensure that mon is in range, and set year accordingly. */ int mon_remainder = mon % 12; @@ -398,7 +370,7 @@ __mktime_internal (struct tm *tp, if (LEAP_SECONDS_POSSIBLE) { /* Handle out-of-range seconds specially, - since ydhms_tm_diff assumes every minute has 60 seconds. */ + since ydhms_diff assumes every minute has 60 seconds. */ if (sec < 0) sec = 0; if (59 < sec) @@ -409,33 +381,46 @@ __mktime_internal (struct tm *tp, time. */ INT_SUBTRACT_WRAPV (0, off, &negative_offset_guess); - t0 = ydhms_diff (year, yday, hour, min, sec, - EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, negative_offset_guess); + long_int t0 = ydhms_diff (year, yday, hour, min, sec, + EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, + negative_offset_guess); + long_int t = t0, t1 = t0, t2 = t0; /* Repeatedly use the error to improve the guess. */ - for (t = t1 = t2 = t0, dst2 = 0; - (gt = guess_time_tm (year, yday, hour, min, sec, t, - ranged_convert (convert, &t, &tm)), - t != gt); - t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) - if (t == t1 && t != t2 - && (tm.tm_isdst < 0 - || (isdst < 0 - ? dst2 <= (tm.tm_isdst != 0) - : (isdst != 0) != (tm.tm_isdst != 0)))) - /* We can't possibly find a match, as we are oscillating - between two values. The requested time probably falls - within a spring-forward gap of size GT - T. Follow the common - practice in this case, which is to return a time that is GT - T - away from the requested time, preferring a time whose - tm_isdst differs from the requested value. (If no tm_isdst - was requested and only one of the two values has a nonzero - tm_isdst, prefer that value.) In practice, this is more - useful than returning -1. */ - goto offset_found; - else if (--remaining_probes == 0) - return -1; + while (true) + { + if (! ranged_convert (convert, &t, &tm)) + return -1; + long_int dt = tm_diff (year, yday, hour, min, sec, &tm); + if (dt == 0) + break; + + if (t == t1 && t != t2 + && (tm.tm_isdst < 0 + || (isdst < 0 + ? dst2 <= (tm.tm_isdst != 0) + : (isdst != 0) != (tm.tm_isdst != 0)))) + /* We can't possibly find a match, as we are oscillating + between two values. The requested time probably falls + within a spring-forward gap of size DT. Follow the common + practice in this case, which is to return a time that is DT + away from the requested time, preferring a time whose + tm_isdst differs from the requested value. (If no tm_isdst + was requested and only one of the two values has a nonzero + tm_isdst, prefer that value.) In practice, this is more + useful than returning -1. */ + goto offset_found; + + remaining_probes--; + if (remaining_probes == 0) + { + __set_errno (EOVERFLOW); + return -1; + } + + t1 = t2, t2 = t, t += dt, dst2 = tm.tm_isdst != 0; + } /* We have a match. Check whether tm.tm_isdst has the requested value, if any. */ @@ -477,25 +462,38 @@ __mktime_internal (struct tm *tp, if (! INT_ADD_WRAPV (t, delta * direction, &ot)) { struct tm otm; - ranged_convert (convert, &ot, &otm); + if (! ranged_convert (convert, &ot, &otm)) + return -1; if (! isdst_differ (isdst, otm.tm_isdst)) { /* We found the desired tm_isdst. Extrapolate back to the desired time. */ - t = guess_time_tm (year, yday, hour, min, sec, ot, &otm); - ranged_convert (convert, &t, &tm); - goto offset_found; + long_int gt = ot + tm_diff (year, yday, hour, min, sec, + &otm); + if (mktime_min <= gt && gt <= mktime_max) + { + if (convert_time (convert, gt, &tm)) + { + t = gt; + goto offset_found; + } + if (errno != EOVERFLOW) + return -1; + } } } } + + __set_errno (EOVERFLOW); + return -1; } offset_found: /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS. This is just a heuristic to speed up the next mktime call, and correctness is unaffected if integer overflow occurs here. */ - INT_SUBTRACT_WRAPV (t, t0, &dt); - INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset); + INT_SUBTRACT_WRAPV (t, t0, offset); + INT_SUBTRACT_WRAPV (*offset, negative_offset_guess, offset); if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec) { @@ -505,8 +503,12 @@ __mktime_internal (struct tm *tp, sec_adjustment -= sec; sec_adjustment += sec_requested; if (INT_ADD_WRAPV (t, sec_adjustment, &t) - || ! (mktime_min <= t && t <= mktime_max) - || ! convert_time (convert, t, &tm)) + || ! (mktime_min <= t && t <= mktime_max)) + { + __set_errno (EOVERFLOW); + return -1; + } + if (! convert_time (convert, t, &tm)) return -1; } @@ -545,146 +547,3 @@ weak_alias (mktime, timelocal) libc_hidden_def (mktime) libc_hidden_weak (timelocal) #endif - -#if DEBUG_MKTIME - -static int -not_equal_tm (const struct tm *a, const struct tm *b) -{ - return ((a->tm_sec ^ b->tm_sec) - | (a->tm_min ^ b->tm_min) - | (a->tm_hour ^ b->tm_hour) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_mon ^ b->tm_mon) - | (a->tm_year ^ b->tm_year) - | (a->tm_yday ^ b->tm_yday) - | isdst_differ (a->tm_isdst, b->tm_isdst)); -} - -static void -print_tm (const struct tm *tp) -{ - if (tp) - printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", - tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, - tp->tm_hour, tp->tm_min, tp->tm_sec, - tp->tm_yday, tp->tm_wday, tp->tm_isdst); - else - printf ("0"); -} - -static int -check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) -{ - if (tk != tl || !lt || not_equal_tm (&tmk, lt)) - { - printf ("mktime ("); - print_tm (lt); - printf (")\nyields ("); - print_tm (&tmk); - printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); - return 1; - } - - return 0; -} - -int -main (int argc, char **argv) -{ - int status = 0; - struct tm tm, tmk, tml; - struct tm *lt; - time_t tk, tl, tl1; - char trailer; - - /* Sanity check, plus call tzset. */ - tl = 0; - if (! localtime (&tl)) - { - printf ("localtime (0) fails\n"); - status = 1; - } - - if ((argc == 3 || argc == 4) - && (sscanf (argv[1], "%d-%d-%d%c", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) - == 3) - && (sscanf (argv[2], "%d:%d:%d%c", - &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) - == 3)) - { - tm.tm_year -= TM_YEAR_BASE; - tm.tm_mon--; - tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); - tmk = tm; - tl = mktime (&tmk); - lt = localtime_r (&tl, &tml); - printf ("mktime returns %ld == ", (long int) tl); - print_tm (&tmk); - printf ("\n"); - status = check_result (tl, tmk, tl, lt); - } - else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) - { - time_t from = atol (argv[1]); - time_t by = atol (argv[2]); - time_t to = atol (argv[3]); - - if (argc == 4) - for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) - { - lt = localtime_r (&tl, &tml); - if (lt) - { - tmk = tml; - tk = mktime (&tmk); - status |= check_result (tk, tmk, tl, &tml); - } - else - { - printf ("localtime_r (%ld) yields 0\n", (long int) tl); - status = 1; - } - tl1 = tl + by; - if ((tl1 < tl) != (by < 0)) - break; - } - else - for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) - { - /* Null benchmark. */ - lt = localtime_r (&tl, &tml); - if (lt) - { - tmk = tml; - tk = tl; - status |= check_result (tk, tmk, tl, &tml); - } - else - { - printf ("localtime_r (%ld) yields 0\n", (long int) tl); - status = 1; - } - tl1 = tl + by; - if ((tl1 < tl) != (by < 0)) - break; - } - } - else - printf ("Usage:\ -\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ -\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ -\t%s FROM BY TO - # Do not test those values (for benchmark).\n", - argv[0], argv[0], argv[0]); - - return status; -} - -#endif /* DEBUG_MKTIME */ - -/* -Local Variables: -compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime" -End: -*/ diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c index 0f19a09..75b5a07 100644 --- a/lib/msvc-inval.c +++ b/lib/msvc-inval.c @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/msvc-inval.h b/lib/msvc-inval.h index 8e7ff30..9d3aa1f 100644 --- a/lib/msvc-inval.h +++ b/lib/msvc-inval.h @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ extern void gl_msvc_inval_ensure_handler (void); /* Gnulib can define its own status codes, as described in the page "Raising Software Exceptions" on microsoft.com - <https://msdn.microsoft.com/en-us/library/het71c37.aspx>. + <https://docs.microsoft.com/en-us/cpp/cpp/raising-software-exceptions>. Our status codes are composed of - 0xE0000000, mandatory for all user-defined status codes, - 0x474E550, a API identifier ("GNU"), @@ -106,7 +106,7 @@ extern void gl_msvc_inval_ensure_handler (void); # if defined _MSC_VER /* A compiler that supports __try/__except, as described in the page "try-except statement" on microsoft.com - <https://msdn.microsoft.com/en-us/library/s58ftw19.aspx>. + <https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement>. With __try/__except, we can use the multithread-safe exception handling. */ # ifdef __cplusplus diff --git a/lib/msvc-nothrow.c b/lib/msvc-nothrow.c index 785733e..49b709c 100644 --- a/lib/msvc-nothrow.c +++ b/lib/msvc-nothrow.c @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/msvc-nothrow.h b/lib/msvc-nothrow.h index a9671c3..8d3ca78 100644 --- a/lib/msvc-nothrow.h +++ b/lib/msvc-nothrow.h @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/nanosleep.c b/lib/nanosleep.c index 2cc3909..3150ff9 100644 --- a/lib/nanosleep.c +++ b/lib/nanosleep.c @@ -1,6 +1,6 @@ /* Provide a replacement for the POSIX nanosleep function. - Copyright (C) 1999-2000, 2002, 2004-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002, 2004-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -194,7 +194,7 @@ static sig_atomic_t volatile suspended; /* Handle SIGCONT. */ -static void +static _GL_ASYNC_SAFE void sighandler (int sig) { suspended = 1; diff --git a/lib/netdb.in.h b/lib/netdb.in.h index 07ab17b..2f298a6 100644 --- a/lib/netdb.in.h +++ b/lib/netdb.in.h @@ -1,5 +1,5 @@ /* Provide a netdb.h header file for systems lacking it (read: MinGW). - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/lib/netinet_in.in.h b/lib/netinet_in.in.h index 0f26cf5..98575b2 100644 --- a/lib/netinet_in.in.h +++ b/lib/netinet_in.in.h @@ -1,5 +1,5 @@ /* Substitute for <netinet/in.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c index ea26730..e8a5595 100644 --- a/lib/nl_langinfo.c +++ b/lib/nl_langinfo.c @@ -1,6 +1,6 @@ /* nl_langinfo() replacement: query locale dependent information. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/pathmax.h b/lib/pathmax.h index 7052e6a..9463a1f 100644 --- a/lib/pathmax.h +++ b/lib/pathmax.h @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2018 Free Software + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -68,7 +68,7 @@ # if defined _WIN32 && ! defined __CYGWIN__ /* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, section "Maximum Path Length Limitation", - <https://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath> + <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation> explains that the maximum size of a filename, including the terminating NUL byte, is 260 = 3 + 256 + 1. This is the same value as diff --git a/lib/pipe-safer.c b/lib/pipe-safer.c index 1669d90..6201739 100644 --- a/lib/pipe-safer.c +++ b/lib/pipe-safer.c @@ -1,5 +1,5 @@ /* Invoke pipe, but avoid some glitches. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ /* Create a pipe. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/pipe2-safer.c b/lib/pipe2-safer.c index 71fef9e..390d96b 100644 --- a/lib/pipe2-safer.c +++ b/lib/pipe2-safer.c @@ -1,5 +1,5 @@ /* Invoke pipe2, but avoid some glitches. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/pipe2.c b/lib/pipe2.c index c16d935..15a5dec 100644 --- a/lib/pipe2.c +++ b/lib/pipe2.c @@ -1,5 +1,5 @@ /* Create a pipe, with specific opening flags. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/printf-args.c b/lib/printf-args.c index 1079e0a..e45cfbe 100644 --- a/lib/printf-args.c +++ b/lib/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2018 Free Software + Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/printf-args.h b/lib/printf-args.h index 111e8a5..866cba0 100644 --- a/lib/printf-args.h +++ b/lib/printf-args.h @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2018 Free Software + Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/printf-parse.c b/lib/printf-parse.c index e625145..8596fd5 100644 --- a/lib/printf-parse.c +++ b/lib/printf-parse.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/printf-parse.h b/lib/printf-parse.h index 16d817e..746bb3f 100644 --- a/lib/printf-parse.h +++ b/lib/printf-parse.h @@ -1,5 +1,5 @@ /* Parse printf format string. - Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2018 Free Software + Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/quote.h b/lib/quote.h index eedc283..5cef8ff 100644 --- a/lib/quote.h +++ b/lib/quote.h @@ -1,6 +1,6 @@ /* quote.h - prototypes for quote.c - Copyright (C) 1998-2001, 2003, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2001, 2003, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/quotearg.c b/lib/quotearg.c index fe68dca..773d53f 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -1,6 +1,6 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998-2002, 2004-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/quotearg.h b/lib/quotearg.h index 0584c56..0f07e02 100644 --- a/lib/quotearg.h +++ b/lib/quotearg.h @@ -1,6 +1,6 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998-2002, 2004, 2006, 2008-2018 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/raise.c b/lib/raise.c index 8a93bea..e750b7a 100644 --- a/lib/raise.c +++ b/lib/raise.c @@ -1,6 +1,6 @@ /* Provide a non-threads replacement for the POSIX raise function. - Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c index 912bfeb..7df6151 100644 --- a/lib/rawmemchr.c +++ b/lib/rawmemchr.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* recv.c --- wrappers for Windows recv function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/regcomp.c b/lib/regcomp.c index 0b05a63..892139a 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length, return NULL; return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); } -#ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) -#endif /* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax) re_syntax_options = syntax; return ret; } -#ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) -#endif int re_compile_fastmap (struct re_pattern_buffer *bufp) @@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) bufp->fastmap_accurate = 1; return 0; } -#ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) -#endif static inline void __attribute__ ((always_inline)) @@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, the return codes and their meanings.) */ int -regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) +regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED @@ -515,16 +509,14 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) return (int) ret; } -#ifdef _LIBC libc_hidden_def (__regcomp) weak_alias (__regcomp, regcomp) -#endif /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, +regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, size_t errbuf_size) { const char *msg; @@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, return msg_size; } -#ifdef _LIBC weak_alias (__regerror, regerror) -#endif #ifdef RE_ENABLE_I18N @@ -657,10 +647,8 @@ regfree (regex_t *preg) re_free (preg->translate); preg->translate = NULL; } -#ifdef _LIBC libc_hidden_def (__regfree) weak_alias (__regfree, regfree) -#endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -1812,8 +1800,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) token->word_char = 0; #ifdef RE_ENABLE_I18N token->mb_partial = 0; - if (input->mb_cur_max > 1 && - !re_string_first_byte (input, re_string_cur_idx (input))) + if (input->mb_cur_max > 1 + && !re_string_first_byte (input, re_string_cur_idx (input))) { token->type = CHARACTER; token->mb_partial = 1; @@ -2000,8 +1988,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) token->type = OP_PERIOD; break; case '^': - if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) && - re_string_cur_idx (input) != 0) + if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) + && re_string_cur_idx (input) != 0) { char prev = re_string_peek_byte (input, -1); if (!(syntax & RE_NEWLINE_ALT) || prev != '\n') @@ -2011,8 +1999,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) token->opr.ctx_type = LINE_FIRST; break; case '$': - if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) && - re_string_cur_idx (input) + 1 != re_string_length (input)) + if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) + && re_string_cur_idx (input) + 1 != re_string_length (input)) { re_token_t next; re_string_skip_bytes (input, 1); @@ -2046,8 +2034,8 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) token->opr.c = c; #ifdef RE_ENABLE_I18N - if (input->mb_cur_max > 1 && - !re_string_first_byte (input, re_string_cur_idx (input))) + if (input->mb_cur_max > 1 + && !re_string_first_byte (input, re_string_cur_idx (input))) { token->type = CHARACTER; return 1; @@ -2345,8 +2333,8 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, } FALLTHROUGH; case OP_CLOSE_SUBEXP: - if ((token->type == OP_CLOSE_SUBEXP) && - !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)) + if ((token->type == OP_CLOSE_SUBEXP) + && !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)) { *err = REG_ERPAREN; return NULL; diff --git a/lib/regex.c b/lib/regex.c index 2a86e10..eab7a48 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -20,10 +20,10 @@ #ifndef _LIBC # include <libc-config.h> -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" # endif -# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 3) # pragma GCC diagnostic ignored "-Wold-style-definition" # pragma GCC diagnostic ignored "-Wtype-limits" # endif diff --git a/lib/regex.h b/lib/regex.h index f2ac950..77ac1a5 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2019 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/lib/regex_internal.c b/lib/regex_internal.c index f13def3..b592f06 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. diff --git a/lib/regex_internal.h b/lib/regex_internal.h index b0e49cd..a3aedda 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -144,13 +144,8 @@ # define __mbrtowc mbrtowc # define __wcrtomb wcrtomb # define __regfree regfree -# define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) -# define __attribute__(arg) -#endif - #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif @@ -868,23 +863,6 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx) } #endif /* RE_ENABLE_I18N */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -#if __GNUC_PREREQ (3,4) -# undef __attribute_warn_unused_result__ -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif - #ifndef FALLTHROUGH # if __GNUC__ < 7 # define FALLTHROUGH ((void) 0) diff --git a/lib/regexec.c b/lib/regexec.c index 8b82ea5..f464869 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -189,7 +189,7 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len); We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, +regexec (const regex_t *__restrict preg, const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { reg_errcode_t err; @@ -232,8 +232,8 @@ __typeof__ (__regexec) __compat_regexec; int attribute_compat_text_section -__compat_regexec (const regex_t *_Restrict_ preg, - const char *_Restrict_ string, size_t nmatch, +__compat_regexec (const regex_t *__restrict preg, + const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { return regexec (preg, string, nmatch, pmatch, @@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, else if (naccepted) { char *buf = (char *) re_string_get_buffer (&mctx->input); - if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, - naccepted) != 0) + if (mctx->input.valid_len - *pidx < naccepted + || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, + naccepted) + != 0)) return -1; } } @@ -2202,12 +2204,12 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, int naccepted; /* Check the node can accept "multi byte". */ naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx); - if (naccepted > 0 && str_idx + naccepted <= max_str_idx && - !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted], - dfa->nexts[node_idx])) + if (naccepted > 0 && str_idx + naccepted <= max_str_idx + && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted], + dfa->nexts[node_idx])) /* The node can't accept the "multi byte", or the destination was already thrown away, then the node - could't accept the current input "multi byte". */ + couldn't accept the current input "multi byte". */ naccepted = 0; /* Otherwise, it is sure that the node could accept 'naccepted' bytes input. */ @@ -2783,8 +2785,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; @@ -3777,10 +3782,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, /* FIXME: I don't think this if is needed, as both '\n' and '\0' are char_len == 1. */ /* '.' accepts any one character except the following two cases. */ - if ((!(dfa->syntax & RE_DOT_NEWLINE) && - re_string_byte_at (input, str_idx) == '\n') || - ((dfa->syntax & RE_DOT_NOT_NULL) && - re_string_byte_at (input, str_idx) == '\0')) + if ((!(dfa->syntax & RE_DOT_NEWLINE) + && re_string_byte_at (input, str_idx) == '\n') + || ((dfa->syntax & RE_DOT_NOT_NULL) + && re_string_byte_at (input, str_idx) == '\0')) return 0; return char_len; } diff --git a/lib/sched.in.h b/lib/sched.in.h index 34e9655..1fd64b9 100644 --- a/lib/sched.in.h +++ b/lib/sched.in.h @@ -1,5 +1,5 @@ /* A GNU-like <sched.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/secure_getenv.c b/lib/secure_getenv.c index ebe98db..fee7a20 100644 --- a/lib/secure_getenv.c +++ b/lib/secure_getenv.c @@ -1,6 +1,6 @@ /* Look up an environment variable, returning NULL in insecure situations. - Copyright 2013-2018 Free Software Foundation, Inc. + Copyright 2013-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/select.c b/lib/select.c index 670a3e1..ee2f019 100644 --- a/lib/select.c +++ b/lib/select.c @@ -1,7 +1,7 @@ /* Emulation for select(2) Contributed by Paolo Bonzini. - Copyright 2008-2018 Free Software Foundation, Inc. + Copyright 2008-2019 Free Software Foundation, Inc. This file is part of gnulib. @@ -1,6 +1,6 @@ /* send.c --- wrappers for Windows send function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/setsockopt.c b/lib/setsockopt.c index 1a7b583..6048138 100644 --- a/lib/setsockopt.c +++ b/lib/setsockopt.c @@ -1,6 +1,6 @@ /* setsockopt.c --- wrappers for Windows setsockopt function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,7 +1,7 @@ /* sha1.c - Functions to compute SHA1 message digest of files or memory blocks according to the NIST specification FIPS-180-1. - Copyright (C) 2000-2001, 2003-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2003-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA1 sum library functions. - Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2018 Free Software + Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff --git a/lib/sha256.c b/lib/sha256.c index c518517..721e944 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -1,7 +1,7 @@ /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sha256.h b/lib/sha256.h index 19ed3cc..b1ccb2a 100644 --- a/lib/sha256.h +++ b/lib/sha256.h @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA256 and SHA224 sum library functions. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sha512.c b/lib/sha512.c index e854951..e7f5bd5 100644 --- a/lib/sha512.c +++ b/lib/sha512.c @@ -1,7 +1,7 @@ /* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sha512.h b/lib/sha512.h index 2c39ab1..7e8cc28 100644 --- a/lib/sha512.h +++ b/lib/sha512.h @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA512 and SHA384 sum library functions. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sig-handler.h b/lib/sig-handler.h index 9ea3394..b289473 100644 --- a/lib/sig-handler.h +++ b/lib/sig-handler.h @@ -1,6 +1,6 @@ /* Convenience declarations when working with <signal.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sigaction.c b/lib/sigaction.c index 7e4af5f..abedfdc 100644 --- a/lib/sigaction.c +++ b/lib/sigaction.c @@ -1,5 +1,5 @@ /* POSIX compatible signal blocking. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Eric Blake <ebb9@byu.net>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/signal.in.h b/lib/signal.in.h index 7d4927b..a6960a2 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -1,6 +1,6 @@ /* A GNU-like <signal.h>. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sigprocmask.c b/lib/sigprocmask.c index 7a49bcd..d6cd3f8 100644 --- a/lib/sigprocmask.c +++ b/lib/sigprocmask.c @@ -1,5 +1,5 @@ /* POSIX compatible signal blocking. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2006. This program is free software: you can redistribute it and/or modify diff --git a/lib/size_max.h b/lib/size_max.h index 00500b5..e265fb9 100644 --- a/lib/size_max.h +++ b/lib/size_max.h @@ -1,5 +1,5 @@ /* size_max.h -- declare SIZE_MAX through system headers - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/lib/snprintf.c b/lib/snprintf.c index 8a9971b..5cf1ede 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2019 Free Software Foundation, Inc. Written by Simon Josefsson and Paul Eggert. This program is free software; you can redistribute it and/or modify diff --git a/lib/socket.c b/lib/socket.c index 84f4d94..745057b 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -1,6 +1,6 @@ /* socket.c --- wrappers for Windows socket function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sockets.c b/lib/sockets.c index eec1ec8..834c2b8 100644 --- a/lib/sockets.c +++ b/lib/sockets.c @@ -1,6 +1,6 @@ /* sockets.c --- wrappers for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sockets.h b/lib/sockets.h index 5a83332..137e834 100644 --- a/lib/sockets.h +++ b/lib/sockets.h @@ -1,6 +1,6 @@ /* sockets.h - wrappers for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c index ec9bd9d..3af5167 100644 --- a/lib/spawn-pipe.c +++ b/lib/spawn-pipe.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2019 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn-pipe.h b/lib/spawn-pipe.h index 52576d0..0d70968 100644 --- a/lib/spawn-pipe.h +++ b/lib/spawn-pipe.h @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001-2003, 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006, 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn.c b/lib/spawn.c index f15e0cd..94a6106 100644 --- a/lib/spawn.c +++ b/lib/spawn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn.in.h b/lib/spawn.in.h index 7460c65..df95e4a 100644 --- a/lib/spawn.in.h +++ b/lib/spawn.in.h @@ -1,5 +1,5 @@ /* Definitions for POSIX spawn interface. - Copyright (C) 2000, 2003-2004, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2000, 2003-2004, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_faction_addclose.c b/lib/spawn_faction_addclose.c index bac6cff..3ad244a 100644 --- a/lib/spawn_faction_addclose.c +++ b/lib/spawn_faction_addclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_faction_adddup2.c b/lib/spawn_faction_adddup2.c index fc25fb8..cbc97e0 100644 --- a/lib/spawn_faction_adddup2.c +++ b/lib/spawn_faction_adddup2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_faction_addopen.c b/lib/spawn_faction_addopen.c index 8fa1141..6b4422f 100644 --- a/lib/spawn_faction_addopen.c +++ b/lib/spawn_faction_addopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_faction_destroy.c b/lib/spawn_faction_destroy.c index 1b20ef6..6d9ec80 100644 --- a/lib/spawn_faction_destroy.c +++ b/lib/spawn_faction_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_faction_init.c b/lib/spawn_faction_init.c index 6bd628c..72e2c73 100644 --- a/lib/spawn_faction_init.c +++ b/lib/spawn_faction_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawn_int.h b/lib/spawn_int.h index f4b4be6..06b8004 100644 --- a/lib/spawn_int.h +++ b/lib/spawn_int.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2008-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawnattr_destroy.c b/lib/spawnattr_destroy.c index 57cc89b..01bd927 100644 --- a/lib/spawnattr_destroy.c +++ b/lib/spawnattr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawnattr_init.c b/lib/spawnattr_init.c index 954c377..6fd6ca9 100644 --- a/lib/spawnattr_init.c +++ b/lib/spawnattr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawnattr_setflags.c b/lib/spawnattr_setflags.c index c4e06c2..a8f557c 100644 --- a/lib/spawnattr_setflags.c +++ b/lib/spawnattr_setflags.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2004, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2004, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawnattr_setsigmask.c b/lib/spawnattr_setsigmask.c index e9d7526..e1713c5 100644 --- a/lib/spawnattr_setsigmask.c +++ b/lib/spawnattr_setsigmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawni.c b/lib/spawni.c index 05dc8b4..39e99a0 100644 --- a/lib/spawni.c +++ b/lib/spawni.c @@ -1,5 +1,5 @@ /* Guts of POSIX spawn interface. Generic POSIX.1 version. - Copyright (C) 2000-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/spawnp.c b/lib/spawnp.c index dcb4d29..0f15069 100644 --- a/lib/spawnp.c +++ b/lib/spawnp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009-2018 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/lib/stat-time.h b/lib/stat-time.h index 69ebe85..38a1f55 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -1,6 +1,6 @@ /* stat-related time functions. - Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -171,7 +171,7 @@ get_stat_birthtime (struct stat const *st _GL_UNUSED) #elif defined _WIN32 && ! defined __CYGWIN__ /* Native Windows platforms (but not Cygwin) put the "file creation time" in st_ctime (!). See - <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */ + <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>. */ # if _GL_WINDOWS_STAT_TIMESPEC t = st->st_ctim; # else diff --git a/lib/stat-w32.c b/lib/stat-w32.c index c7a53f9..60fe5f6 100644 --- a/lib/stat-w32.c +++ b/lib/stat-w32.c @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,7 +80,7 @@ struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft) { struct timespec result; - /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */ unsigned long long since_1601 = ((unsigned long long) ft->dwHighDateTime << 32) | (unsigned long long) ft->dwLowDateTime; @@ -104,7 +104,7 @@ _gl_convert_FILETIME_to_timespec (const FILETIME *ft) time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft) { - /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */ unsigned long long since_1601 = ((unsigned long long) ft->dwHighDateTime << 32) | (unsigned long long) ft->dwLowDateTime; @@ -128,7 +128,7 @@ int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) { /* GetFileType - <https://msdn.microsoft.com/en-us/library/aa364960.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletype> */ DWORD type = GetFileType (h); if (type == FILE_TYPE_DISK) { @@ -137,16 +137,16 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) /* st_mode can be determined through GetFileAttributesEx - <https://msdn.microsoft.com/en-us/library/aa364946.aspx> - <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data> or through GetFileInformationByHandle - <https://msdn.microsoft.com/en-us/library/aa364952.aspx> - <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information> or through GetFileInformationByHandleEx with argument FileBasicInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/aa364217.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info> The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ BY_HANDLE_FILE_INFORMATION info; if (! GetFileInformationByHandle (h, &info)) @@ -162,12 +162,12 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) #if _GL_WINDOWS_STAT_INODES /* st_ino can be determined through GetFileInformationByHandle - <https://msdn.microsoft.com/en-us/library/aa364952.aspx> - <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information> as 64 bits, or through GetFileInformationByHandleEx with argument FileIdInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/hh802691.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_id_info> as 128 bits. The latter requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher. */ /* Experiments show that GetFileInformationByHandleEx does not provide @@ -238,11 +238,11 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) If the file name is already known, use it. Otherwise, for non-empty files, it can be determined through GetFinalPathNameByHandle - <https://msdn.microsoft.com/en-us/library/aa364962.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea> or through GetFileInformationByHandleEx with argument FileNameInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/aa364388.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_name_info> Both require -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) { @@ -277,12 +277,12 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) /* st_nlink can be determined through GetFileInformationByHandle - <https://msdn.microsoft.com/en-us/library/aa364952.aspx> - <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information> or through GetFileInformationByHandleEx with argument FileStandardInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/aa364401.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info> The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ buf->st_nlink = (info.nNumberOfLinks > SHRT_MAX ? SHRT_MAX : info.nNumberOfLinks); @@ -295,19 +295,19 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) /* st_size can be determined through GetFileSizeEx - <https://msdn.microsoft.com/en-us/library/aa364957.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfilesizeex> or through GetFileAttributesEx - <https://msdn.microsoft.com/en-us/library/aa364946.aspx> - <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data> or through GetFileInformationByHandle - <https://msdn.microsoft.com/en-us/library/aa364952.aspx> - <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information> or through GetFileInformationByHandleEx with argument FileStandardInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/aa364401.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info> The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ if (sizeof (buf->st_size) <= 4) /* Range check already done above. */ @@ -317,19 +317,19 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) /* st_atime, st_mtime, st_ctime can be determined through GetFileTime - <https://msdn.microsoft.com/en-us/library/ms724320.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletime> or through GetFileAttributesEx - <https://msdn.microsoft.com/en-us/library/aa364946.aspx> - <https://msdn.microsoft.com/en-us/library/aa365739.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data> or through GetFileInformationByHandle - <https://msdn.microsoft.com/en-us/library/aa364952.aspx> - <https://msdn.microsoft.com/en-us/library/aa363788.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information> or through GetFileInformationByHandleEx with argument FileBasicInfo - <https://msdn.microsoft.com/en-us/library/aa364953.aspx> - <https://msdn.microsoft.com/en-us/library/aa364217.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex> + <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info> The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */ #if _GL_WINDOWS_STAT_TIMESPEC buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime); diff --git a/lib/stat-w32.h b/lib/stat-w32.h index 9a3ecc1..6b961d7 100644 --- a/lib/stat-w32.h +++ b/lib/stat-w32.h @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ /* Work around platform bugs in stat. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,10 +42,14 @@ orig_stat (const char *filename, struct stat *buf) #endif /* Specification. */ +#ifdef __osf__ /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc eliminates this include because of the preliminary #include <sys/stat.h> above. */ -#include "sys/stat.h" +# include "sys/stat.h" +#else +# include <sys/stat.h> +#endif #include "stat-time.h" @@ -107,7 +111,7 @@ rpl_stat (char const *name, struct stat *buf) <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */ /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work around length limitations - <https://msdn.microsoft.com/en-us/library/aa365247.aspx> ? */ + <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */ /* POSIX <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13> specifies: "More than two leading <slash> characters shall be treated as @@ -190,8 +194,8 @@ rpl_stat (char const *name, struct stat *buf) /* Open a handle to the file. CreateFile - <https://msdn.microsoft.com/en-us/library/aa363858.aspx> - <https://msdn.microsoft.com/en-us/library/aa363874.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea> + <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */ HANDLE h = CreateFile (rname, FILE_READ_ATTRIBUTES, @@ -232,13 +236,13 @@ rpl_stat (char const *name, struct stat *buf) /* Get the details about the directory entry. This can be done through FindFirstFile - <https://msdn.microsoft.com/en-us/library/aa364418.aspx> - <https://msdn.microsoft.com/en-us/library/aa365740.aspx> + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea> + <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa> or through FindFirstFileEx with argument FindExInfoBasic - <https://msdn.microsoft.com/en-us/library/aa364419.aspx> - <https://msdn.microsoft.com/en-us/library/aa364415.aspx> - <https://msdn.microsoft.com/en-us/library/aa365740.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa> + <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ne-minwinbase-findex_info_levels> + <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa> */ WIN32_FIND_DATA info; HANDLE h = FindFirstFile (rname, &info); if (h == INVALID_HANDLE_VALUE) diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index bbfa9ac..d988d7c 100644 --- a/lib/stdalign.in.h +++ b/lib/stdalign.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C11 <stdalign.h>. - Copyright 2011-2018 Free Software Foundation, Inc. + Copyright 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h index ebf1a2f..8158b00 100644 --- a/lib/stdbool.in.h +++ b/lib/stdbool.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2006-2018 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2019 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software; you can redistribute it and/or modify diff --git a/lib/stddef.in.h b/lib/stddef.in.h index 8329a9b..5aad121 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 94e7c81..21dd8d2 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2018 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2019 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h index 393ef0c..4260468 100644 --- a/lib/stdio-impl.h +++ b/lib/stdio-impl.h @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -61,6 +61,11 @@ # define _r pub._r # define _w pub._w # elif defined __ANDROID__ /* Android */ +# ifdef __LP64__ +# define _gl_flags_file_t int +# else +# define _gl_flags_file_t short +# endif /* Up to this commit from 2015-10-12 <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a> the innards of FILE were public, and fp_ub could be defined like for OpenBSD, @@ -70,8 +75,8 @@ # define fp_ ((struct { unsigned char *_p; \ int _r; \ int _w; \ - int _flags; \ - int _file; \ + _gl_flags_file_t _flags; \ + _gl_flags_file_t _file; \ struct { unsigned char *_base; size_t _size; } _bf; \ int _lbfsize; \ void *_cookie; \ diff --git a/lib/stdio-write.c b/lib/stdio-write.c index e01a780..3fbd272 100644 --- a/lib/stdio-write.c +++ b/lib/stdio-write.c @@ -1,5 +1,5 @@ /* POSIX compatible FILE stream write function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/stdio.in.h b/lib/stdio.in.h index ff7c9c8..4a8aa55 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdio.h>. - Copyright (C) 2004, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -118,6 +118,13 @@ # include <unistd.h> #endif +/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ + && ! defined __GLIBC__ +# include <sys/stat.h> +#endif + /* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include it before we #define perror rpl_perror. */ /* But in any case avoid namespace pollution on glibc systems. */ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 441c018..f829525 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdlib.h>. - Copyright (C) 1995, 2001-2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -306,9 +306,18 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); # else +# if !@HAVE_MBTOWC@ +_GL_FUNCDECL_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# endif _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); # endif _GL_CXXALIASWARN (mbtowc); +#elif defined GNULIB_POSIXCHECK +# undef mbtowc +# if HAVE_RAW_DECL_MBTOWC +_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " + "use gnulib module mbtowc for portability"); +# endif #endif #if @GNULIB_MKDTEMP@ @@ -573,10 +582,19 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " #if @GNULIB_RANDOM@ -# if !@HAVE_RANDOM@ +# if @REPLACE_RANDOM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random +# define random rpl_random +# endif +_GL_FUNCDECL_RPL (random, long, (void)); +_GL_CXXALIAS_RPL (random, long, (void)); +# else +# if !@HAVE_RANDOM@ _GL_FUNCDECL_SYS (random, long, (void)); -# endif +# endif _GL_CXXALIAS_SYS (random, long, (void)); +# endif _GL_CXXALIASWARN (random); #elif defined GNULIB_POSIXCHECK # undef random @@ -587,10 +605,19 @@ _GL_WARN_ON_USE (random, "random is unportable - " #endif #if @GNULIB_RANDOM@ -# if !@HAVE_RANDOM@ +# if @REPLACE_RANDOM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom +# define srandom rpl_srandom +# endif +_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); +_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); +# else +# if !@HAVE_RANDOM@ _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); -# endif +# endif _GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); +# endif _GL_CXXALIASWARN (srandom); #elif defined GNULIB_POSIXCHECK # undef srandom @@ -601,31 +628,52 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - " #endif #if @GNULIB_RANDOM@ -# if !@HAVE_RANDOM@ || !@HAVE_DECL_INITSTATE@ +# if @REPLACE_INITSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate +# define initstate rpl_initstate +# endif +_GL_FUNCDECL_RPL (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size)); +# else +# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ _GL_FUNCDECL_SYS (initstate, char *, (unsigned int seed, char *buf, size_t buf_size) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (initstate, char *, (unsigned int seed, char *buf, size_t buf_size)); +# endif _GL_CXXALIASWARN (initstate); #elif defined GNULIB_POSIXCHECK # undef initstate -# if HAVE_RAW_DECL_INITSTATE_R +# if HAVE_RAW_DECL_INITSTATE _GL_WARN_ON_USE (initstate, "initstate is unportable - " "use gnulib module random for portability"); # endif #endif #if @GNULIB_RANDOM@ -# if !@HAVE_RANDOM@ || !@HAVE_DECL_SETSTATE@ +# if @REPLACE_SETSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate +# define setstate rpl_setstate +# endif +_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); +# else +# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); -# endif +# endif _GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); +# endif _GL_CXXALIASWARN (setstate); #elif defined GNULIB_POSIXCHECK # undef setstate -# if HAVE_RAW_DECL_SETSTATE_R +# if HAVE_RAW_DECL_SETSTATE _GL_WARN_ON_USE (setstate, "setstate is unportable - " "use gnulib module random for portability"); # endif @@ -881,6 +929,7 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define strtod rpl_strtod # endif +# define GNULIB_defined_strtod_function 1 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); @@ -900,6 +949,32 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - " # endif #endif +#if @GNULIB_STRTOLD@ + /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ +# if @REPLACE_STRTOLD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtold rpl_strtold +# endif +# define GNULIB_defined_strtold_function 1 +_GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp)); +# else +# if !@HAVE_STRTOLD@ +_GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp)); +# endif +_GL_CXXALIASWARN (strtold); +#elif defined GNULIB_POSIXCHECK +# undef strtold +# if HAVE_RAW_DECL_STRTOLD +_GL_WARN_ON_USE (strtold, "strtold is unportable - " + "use gnulib module strtold for portability"); +# endif +#endif + #if @GNULIB_STRTOLL@ /* Parse a signed integer whose textual representation starts at STRING. The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, diff --git a/lib/str-two-way.h b/lib/str-two-way.h index 85489d1..9155e6b 100644 --- a/lib/str-two-way.h +++ b/lib/str-two-way.h @@ -1,5 +1,5 @@ /* Byte-wise substring search, using the Two-Way algorithm. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Eric Blake <ebb9@byu.net>, 2008. diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c index 49f22c5..6cd0e1e 100644 --- a/lib/strcasecmp.c +++ b/lib/strcasecmp.c @@ -1,5 +1,5 @@ /* Case-insensitive string comparison function. - Copyright (C) 1998-1999, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strchrnul.c b/lib/strchrnul.c index 8b3cd88..0f5dd81 100644 --- a/lib/strchrnul.c +++ b/lib/strchrnul.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strdup.c b/lib/strdup.c index ce43940..717cf65 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2018 Free Software +/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/streq.h b/lib/streq.h index bde1b95..326537b 100644 --- a/lib/streq.h +++ b/lib/streq.h @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/strerror-override.c b/lib/strerror-override.c index d3ad21e..558a010 100644 --- a/lib/strerror-override.c +++ b/lib/strerror-override.c @@ -1,6 +1,6 @@ /* strerror-override.c --- POSIX compatible system error routine - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strerror-override.h b/lib/strerror-override.h index a96fd08..255febc 100644 --- a/lib/strerror-override.h +++ b/lib/strerror-override.h @@ -1,6 +1,6 @@ /* strerror-override.h --- POSIX compatible system error routine - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strerror.c b/lib/strerror.c index 36397bb..f5900fd 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strerror_r.c b/lib/strerror_r.c index 7a11be1..85b9c6b 100644 --- a/lib/strerror_r.c +++ b/lib/strerror_r.c @@ -1,6 +1,6 @@ /* strerror_r.c --- POSIX compatible system error routine - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -129,22 +129,13 @@ static int safe_copy (char *buf, size_t buflen, const char *msg) { size_t len = strlen (msg); - int ret; + size_t moved = len < buflen ? len : buflen - 1; - if (len < buflen) - { - /* Although POSIX allows memcpy() to corrupt errno, we don't - know of any implementation where this is a real problem. */ - memcpy (buf, msg, len + 1); - ret = 0; - } - else - { - memcpy (buf, msg, buflen - 1); - buf[buflen - 1] = '\0'; - ret = ERANGE; - } - return ret; + /* Although POSIX lets memmove corrupt errno, we don't + know of any implementation where this is a real problem. */ + memmove (buf, msg, moved); + buf[moved] = '\0'; + return len < buflen ? 0 : ERANGE; } diff --git a/lib/string.in.h b/lib/string.in.h index 29f4ba6..4a9292f 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1,6 +1,6 @@ /* A GNU-like <string.h>. - Copyright (C) 1995-1996, 2001-2018 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strings.in.h b/lib/strings.in.h index b9d0a67..21b1a85 100644 --- a/lib/strings.in.h +++ b/lib/strings.in.h @@ -1,6 +1,6 @@ /* A substitute <strings.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/stripslash.c b/lib/stripslash.c index 60c6781..dfc15b4 100644 --- a/lib/stripslash.c +++ b/lib/stripslash.c @@ -1,6 +1,6 @@ /* stripslash.c -- remove redundant trailing slashes from a file name - Copyright (C) 1990, 2001, 2003-2006, 2009-2018 Free Software Foundation, + Copyright (C) 1990, 2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/strncasecmp.c b/lib/strncasecmp.c index f750679..034011c 100644 --- a/lib/strncasecmp.c +++ b/lib/strncasecmp.c @@ -1,5 +1,5 @@ /* strncasecmp.c -- case insensitive string comparator - Copyright (C) 1998-1999, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strndup.c b/lib/strndup.c index b5c18dd..5b74828 100644 --- a/lib/strndup.c +++ b/lib/strndup.c @@ -1,6 +1,6 @@ /* A replacement function, for systems that lack strndup. - Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2018 Free Software + Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff --git a/lib/strnlen.c b/lib/strnlen.c index f0b1b8b..9fb6635 100644 --- a/lib/strnlen.c +++ b/lib/strnlen.c @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/lib/strnlen1.c b/lib/strnlen1.c index 4459f6b..666a557 100644 --- a/lib/strnlen1.c +++ b/lib/strnlen1.c @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strnlen1.h b/lib/strnlen1.h index 896a180..5d95244 100644 --- a/lib/strnlen1.h +++ b/lib/strnlen1.h @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/strpbrk.c b/lib/strpbrk.c index 38e8099..87c595e 100644 --- a/lib/strpbrk.c +++ b/lib/strpbrk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006, 2009-2018 Free Software +/* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006, 2009-2019 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. diff --git a/lib/strptime.c b/lib/strptime.c index 6994ec4..995b5fb 100644 --- a/lib/strptime.c +++ b/lib/strptime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2004-2005, 2007, 2009-2018 Free Software Foundation, +/* Copyright (C) 2002, 2004-2005, 2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -277,7 +277,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) } /* Any character but '%' must be matched by the same character - in the iput string. */ + in the input string. */ if (*fmt != '%') { match_char (*fmt++, *rp++); diff --git a/lib/strtok_r.c b/lib/strtok_r.c index ef8e41d..d043ec7 100644 --- a/lib/strtok_r.c +++ b/lib/strtok_r.c @@ -1,5 +1,5 @@ /* Reentrant string tokenizer. Generic version. - Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2018 Free Software + Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/strtol.c b/lib/strtol.c index f6f5c32..1d920af 100644 --- a/lib/strtol.c +++ b/lib/strtol.c @@ -1,6 +1,6 @@ /* Convert string representation of a number into an integer value. - Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2018 Free Software + Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C diff --git a/lib/strtoll.c b/lib/strtoll.c index 8aa10f4..038362a 100644 --- a/lib/strtoll.c +++ b/lib/strtoll.c @@ -1,5 +1,5 @@ /* Function to parse a 'long long int' from text. - Copyright (C) 1995-1997, 1999, 2001, 2009-2018 Free Software Foundation, + Copyright (C) 1995-1997, 1999, 2001, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/symlink.c b/lib/symlink.c index c1c4b40..16432ee 100644 --- a/lib/symlink.c +++ b/lib/symlink.c @@ -1,5 +1,5 @@ /* Stub for symlink(). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys-limits.h b/lib/sys-limits.h index d7ab5fa..f407eff 100644 --- a/lib/sys-limits.h +++ b/lib/sys-limits.h @@ -1,6 +1,6 @@ /* System call limits - Copyright 2018 Free Software Foundation, Inc. + Copyright 2018-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>. */ -#ifndef _SYS_LIMITS_H -#define _SYS_LIMITS_H +#ifndef _GL_SYS_LIMITS_H +#define _GL_SYS_LIMITS_H #include <limits.h> diff --git a/lib/sys_file.in.h b/lib/sys_file.in.h index efbf458..5096421 100644 --- a/lib/sys_file.in.h +++ b/lib/sys_file.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/file.h. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_ioctl.in.h b/lib/sys_ioctl.in.h index 42a5ca4..7b4393e 100644 --- a/lib/sys_ioctl.in.h +++ b/lib/sys_ioctl.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <sys/ioctl.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 154e570..4cf7cfc 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/select.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index ef65dc6..654932c 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify @@ -169,7 +169,7 @@ struct sockaddr_storage code may not run on older Windows releases then. My Windows 2000 box was not able to run the code, for example. The situation is slightly confusing because - <https://msdn.microsoft.com/en-us/library/ms738520> + <https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo> suggests that getaddrinfo should be available on all Windows releases. */ diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 6ae6ac5..9ddd1a8 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat.h header file. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,9 +54,16 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ +/* Before doing "#define mknod rpl_mknod" below, we need to include all + headers that may declare mknod(). OS/2 kLIBC declares mknod() in + <unistd.h>, not in <sys/stat.h>. */ +#ifdef __KLIBC__ +# include <unistd.h> +#endif + /* Before doing "#define mkdir rpl_mkdir" below, we need to include all headers that may declare mkdir(). Native Windows platforms declare mkdir - in <io.h> and/or <direct.h>, not in <unistd.h>. */ + in <io.h> and/or <direct.h>, not in <sys/stat.h>. */ #if defined _WIN32 && ! defined __CYGWIN__ # include <io.h> /* mingw32, mingw64 */ # include <direct.h> /* mingw64, MSVC 9 */ diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index b4a0e49..5397688 100644 --- a/lib/sys_time.in.h +++ b/lib/sys_time.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/time.h. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h index 7f8c1c4..237e206 100644 --- a/lib/sys_types.in.h +++ b/lib/sys_types.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_uio.in.h b/lib/sys_uio.in.h index 0b5790b..d040a50 100644 --- a/lib/sys_uio.in.h +++ b/lib/sys_uio.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/uio.h>. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h index 4612930..10973f7 100644 --- a/lib/sys_wait.in.h +++ b/lib/sys_wait.in.h @@ -1,5 +1,5 @@ /* A POSIX-like <sys/wait.h>. - Copyright (C) 2001-2003, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/tempname.c b/lib/tempname.c index da81263..be62ed9 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -1,6 +1,6 @@ /* tempname.c - generate the name of a temporary file. - Copyright (C) 1991-2003, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1991-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/tempname.h b/lib/tempname.h index 4020c73..fb203d3 100644 --- a/lib/tempname.h +++ b/lib/tempname.h @@ -1,6 +1,6 @@ /* Create a temporary file or directory. - Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/time.in.h b/lib/time.in.h index 3128f44..dd3b212 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -1,6 +1,6 @@ /* A more-standard <time.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/time_r.c b/lib/time_r.c index 3029780..a701ccc 100644 --- a/lib/time_r.c +++ b/lib/time_r.c @@ -1,6 +1,6 @@ /* Reentrant time functions like localtime_r. - Copyright (C) 2003, 2006-2007, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2010-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/timegm.c b/lib/timegm.c index 9d9ab11..2ca5744 100644 --- a/lib/timegm.c +++ b/lib/timegm.c @@ -1,6 +1,6 @@ /* Convert UTC calendar time to simple time. Like mktime but assumes UTC. - Copyright (C) 1994-2018 Free Software Foundation, Inc. + Copyright (C) 1994-2019 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/lib/timespec.h b/lib/timespec.h index cc49668..26f1bc1 100644 --- a/lib/timespec.h +++ b/lib/timespec.h @@ -1,6 +1,6 @@ /* timespec -- System time interface - Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2018 Free Software + Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/tmpdir.c b/lib/tmpdir.c index fa84965..7b50914 100644 --- a/lib/tmpdir.c +++ b/lib/tmpdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001-2002, 2006, 2009-2018 Free Software Foundation, +/* Copyright (C) 1999, 2001-2002, 2006, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/tmpdir.h b/lib/tmpdir.h index 53d3c0f..5689da4 100644 --- a/lib/tmpdir.h +++ b/lib/tmpdir.h @@ -1,5 +1,5 @@ /* Determine a temporary directory. - Copyright (C) 2001-2002, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* uint64_t-like operations that work even on hosts lacking uint64_t - Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/unicase.in.h b/lib/unicase.in.h index f97b68c..b6d12f1 100644 --- a/lib/unicase.in.h +++ b/lib/unicase.in.h @@ -1,5 +1,5 @@ /* Unicode character case mappings. - Copyright (C) 2002, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/unicase/cased.c b/lib/unicase/cased.c index d5f7c53..626a515 100644 --- a/lib/unicase/cased.c +++ b/lib/unicase/cased.c @@ -1,5 +1,5 @@ /* Test whether a Unicode character is cased. - Copyright (C) 2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/caseprop.h b/lib/unicase/caseprop.h index f1e47b3..d424ce2 100644 --- a/lib/unicase/caseprop.h +++ b/lib/unicase/caseprop.h @@ -1,5 +1,5 @@ /* Case related properties of Unicode characters. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/context.h b/lib/unicase/context.h index 64d331e..382af86 100644 --- a/lib/unicase/context.h +++ b/lib/unicase/context.h @@ -1,5 +1,5 @@ /* Case-mapping contexts of UTF-8/UTF-16/UTF-32 substring. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/empty-prefix-context.c b/lib/unicase/empty-prefix-context.c index 01a362b..357630a 100644 --- a/lib/unicase/empty-prefix-context.c +++ b/lib/unicase/empty-prefix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of empty prefix string. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/empty-suffix-context.c b/lib/unicase/empty-suffix-context.c index 16be069..f28d00d 100644 --- a/lib/unicase/empty-suffix-context.c +++ b/lib/unicase/empty-suffix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of empty suffix string. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/ignorable.c b/lib/unicase/ignorable.c index 85ba619..dbde735 100644 --- a/lib/unicase/ignorable.c +++ b/lib/unicase/ignorable.c @@ -1,5 +1,5 @@ /* Test whether a Unicode character is case-ignorable. - Copyright (C) 2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/simple-mapping.h b/lib/unicase/simple-mapping.h index 628b08e..2c984d6 100644 --- a/lib/unicase/simple-mapping.h +++ b/lib/unicase/simple-mapping.h @@ -1,5 +1,5 @@ /* Simple case mapping for Unicode characters. - Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/special-casing.c b/lib/unicase/special-casing.c index 5deee94..a75a9e6 100644 --- a/lib/unicase/special-casing.c +++ b/lib/unicase/special-casing.c @@ -1,5 +1,5 @@ /* Special casing table. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/special-casing.in.h b/lib/unicase/special-casing.in.h index 9672f97..7df3bb1 100644 --- a/lib/unicase/special-casing.in.h +++ b/lib/unicase/special-casing.in.h @@ -1,5 +1,5 @@ /* Special casing table. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/tolower.c b/lib/unicase/tolower.c index 55c5f1c..b8d24b1 100644 --- a/lib/unicase/tolower.c +++ b/lib/unicase/tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/u-casemap.h b/lib/unicase/u-casemap.h index adf77ca..7e83d60 100644 --- a/lib/unicase/u-casemap.h +++ b/lib/unicase/u-casemap.h @@ -1,5 +1,5 @@ /* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unicase/u8-casemap.c b/lib/unicase/u8-casemap.c index 4562843..72e05d6 100644 --- a/lib/unicase/u8-casemap.c +++ b/lib/unicase/u8-casemap.c @@ -1,5 +1,5 @@ /* Case mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it @@ -27,7 +27,7 @@ #include "unistr.h" #include "unictype.h" #include "uninorm.h" -#include "caseprop.h" +#include "unicase/caseprop.h" #include "context.h" #include "unicase/special-casing.h" diff --git a/lib/unicase/u8-tolower.c b/lib/unicase/u8-tolower.c index ed7e8de..b012f17 100644 --- a/lib/unicase/u8-tolower.c +++ b/lib/unicase/u8-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it @@ -22,7 +22,7 @@ #include <stddef.h> -#include "unicasemap.h" +#include "unicase/unicasemap.h" #include "unicase/special-casing.h" uint8_t * diff --git a/lib/unicase/unicasemap.h b/lib/unicase/unicasemap.h index 3b29587..51b18e8 100644 --- a/lib/unicase/unicasemap.h +++ b/lib/unicase/unicasemap.h @@ -1,5 +1,5 @@ /* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unictype.in.h b/lib/unictype.in.h index 067cefd..02e3ad3 100644 --- a/lib/unictype.in.h +++ b/lib/unictype.in.h @@ -1,5 +1,5 @@ /* Unicode character classification and properties. - Copyright (C) 2002, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/unictype/bitmap.h b/lib/unictype/bitmap.h index 45dbafa..63ef660 100644 --- a/lib/unictype/bitmap.h +++ b/lib/unictype/bitmap.h @@ -1,5 +1,5 @@ /* Three-level bitmap lookup. - Copyright (C) 2000-2002, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2002, 2005-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2000-2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unictype/combiningclass.c b/lib/unictype/combiningclass.c index 81b5001..c7e21d0 100644 --- a/lib/unictype/combiningclass.c +++ b/lib/unictype/combiningclass.c @@ -1,5 +1,5 @@ /* Combining classes of Unicode characters. - Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unictype/pr_soft_dotted.c b/lib/unictype/pr_soft_dotted.c index 5fa3c5f..aba504e 100644 --- a/lib/unictype/pr_soft_dotted.c +++ b/lib/unictype/pr_soft_dotted.c @@ -1,5 +1,5 @@ /* Properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm.in.h b/lib/uninorm.in.h index 0ac78e0..f8fc603 100644 --- a/lib/uninorm.in.h +++ b/lib/uninorm.in.h @@ -1,5 +1,5 @@ /* Normalization forms (composition and decomposition) of Unicode strings. - Copyright (C) 2001-2002, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm/decompose-internal.c b/lib/uninorm/decompose-internal.c index e8448d3..b9ff494 100644 --- a/lib/uninorm/decompose-internal.c +++ b/lib/uninorm/decompose-internal.c @@ -1,5 +1,5 @@ /* Decomposition of Unicode strings. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm/decompose-internal.h b/lib/uninorm/decompose-internal.h index 039bf60..4faac3d 100644 --- a/lib/uninorm/decompose-internal.h +++ b/lib/uninorm/decompose-internal.h @@ -1,5 +1,5 @@ /* Decomposition of Unicode strings. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm/normalize-internal.h b/lib/uninorm/normalize-internal.h index ed41695..b6b2ff7 100644 --- a/lib/uninorm/normalize-internal.h +++ b/lib/uninorm/normalize-internal.h @@ -1,5 +1,5 @@ /* Normalization of Unicode strings. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm/u-normalize-internal.h b/lib/uninorm/u-normalize-internal.h index 86d5e26..6c23e9c 100644 --- a/lib/uninorm/u-normalize-internal.h +++ b/lib/uninorm/u-normalize-internal.h @@ -1,5 +1,5 @@ /* Decomposition and composition of Unicode strings. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uninorm/u8-normalize.c b/lib/uninorm/u8-normalize.c index abdcac4..68ab888 100644 --- a/lib/uninorm/u8-normalize.c +++ b/lib/uninorm/u8-normalize.c @@ -1,5 +1,5 @@ /* Normalization of UTF-8 strings. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it @@ -28,7 +28,7 @@ #include "unistr.h" #include "unictype.h" #include "normalize-internal.h" -#include "decompose-internal.h" +#include "uninorm/decompose-internal.h" #define FUNC u8_normalize #define UNIT uint8_t diff --git a/lib/unistd--.h b/lib/unistd--.h index a6c5266..1268854 100644 --- a/lib/unistd--.h +++ b/lib/unistd--.h @@ -1,6 +1,6 @@ /* Like unistd.h, but redefine some names to avoid glitches. - Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/unistd-safer.h b/lib/unistd-safer.h index 5baf339..8eebffc 100644 --- a/lib/unistd-safer.h +++ b/lib/unistd-safer.h @@ -1,6 +1,6 @@ /* Invoke unistd-like functions, but avoid some glitches. - Copyright (C) 2001, 2003, 2005, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 66f254d..7778d25 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,9 +68,11 @@ # include <stdio.h> #endif -/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */ +/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in + <unistd.h>. */ /* But avoid namespace pollution on glibc systems. */ -#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \ +#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ + && (defined __CYGWIN__ || defined __ANDROID__) \ && ! defined __GLIBC__ # include <fcntl.h> #endif @@ -113,6 +115,13 @@ # include <netdb.h> #endif +/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ + && !defined __GLIBC__ +# include <sys/stat.h> +#endif + /* MSVC defines off_t in <sys/types.h>. May also define off_t to a 64-bit type on native Windows. */ #if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ diff --git a/lib/unistr.in.h b/lib/unistr.in.h index b0fbce8..68f60f1 100644 --- a/lib/unistr.in.h +++ b/lib/unistr.in.h @@ -1,5 +1,5 @@ /* Elementary Unicode string functions. - Copyright (C) 2001-2002, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/unistr/u-cpy.h b/lib/unistr/u-cpy.h index e45b5c9..e6a11c1 100644 --- a/lib/unistr/u-cpy.h +++ b/lib/unistr/u-cpy.h @@ -1,5 +1,5 @@ /* Copy piece of UTF-8/UTF-16/UTF-32 string. - Copyright (C) 1999, 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it @@ -26,7 +26,8 @@ FUNC (UNIT *dest, const UNIT *src, size_t n) for (; n > 0; n--) *destptr++ = *src++; #else - memcpy ((char *) dest, (const char *) src, n * sizeof (UNIT)); + if (n > 0) + memcpy ((char *) dest, (const char *) src, n * sizeof (UNIT)); #endif return dest; } diff --git a/lib/unistr/u8-cpy.c b/lib/unistr/u8-cpy.c index ba7283e..8abd286 100644 --- a/lib/unistr/u8-cpy.c +++ b/lib/unistr/u8-cpy.c @@ -1,5 +1,5 @@ /* Copy piece of UTF-8 string. - Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unistr/u8-mbtouc-unsafe-aux.c b/lib/unistr/u8-mbtouc-unsafe-aux.c index 9b42cb8..62e5b9e 100644 --- a/lib/unistr/u8-mbtouc-unsafe-aux.c +++ b/lib/unistr/u8-mbtouc-unsafe-aux.c @@ -1,5 +1,5 @@ /* Conversion UTF-8 to UCS-4. - Copyright (C) 2001-2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2001. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unistr/u8-mbtouc-unsafe.c b/lib/unistr/u8-mbtouc-unsafe.c index 43cf82f..e33bcca 100644 --- a/lib/unistr/u8-mbtouc-unsafe.c +++ b/lib/unistr/u8-mbtouc-unsafe.c @@ -1,5 +1,5 @@ /* Look at first character in UTF-8 string. - Copyright (C) 1999-2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2001. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unistr/u8-strlen.c b/lib/unistr/u8-strlen.c index 6d3c09d..b3694e6 100644 --- a/lib/unistr/u8-strlen.c +++ b/lib/unistr/u8-strlen.c @@ -1,5 +1,5 @@ /* Determine length of UTF-8 string. - Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unistr/u8-uctomb-aux.c b/lib/unistr/u8-uctomb-aux.c index dcaa4e8..fa63fd6 100644 --- a/lib/unistr/u8-uctomb-aux.c +++ b/lib/unistr/u8-uctomb-aux.c @@ -1,5 +1,5 @@ /* Conversion UCS-4 to UTF-8. - Copyright (C) 2002, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unistr/u8-uctomb.c b/lib/unistr/u8-uctomb.c index ec4e904..1ebcb49 100644 --- a/lib/unistr/u8-uctomb.c +++ b/lib/unistr/u8-uctomb.c @@ -1,5 +1,5 @@ /* Store a character in UTF-8 string. - Copyright (C) 2002, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unitypes.in.h b/lib/unitypes.in.h index 13ed4cb..631654b 100644 --- a/lib/unitypes.in.h +++ b/lib/unitypes.in.h @@ -1,5 +1,5 @@ /* Elementary types and macros for the GNU UniString library. - Copyright (C) 2002, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/uniwidth.in.h b/lib/uniwidth.in.h index 0cacc29..80c5eea 100644 --- a/lib/uniwidth.in.h +++ b/lib/uniwidth.in.h @@ -1,5 +1,5 @@ /* Display width functions. - Copyright (C) 2001-2002, 2005, 2007, 2009-2018 Free Software Foundation, + Copyright (C) 2001-2002, 2005, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uniwidth/cjk.h b/lib/uniwidth/cjk.h index f7f822c..9870422 100644 --- a/lib/uniwidth/cjk.h +++ b/lib/uniwidth/cjk.h @@ -1,5 +1,5 @@ /* Test for CJK encoding. - Copyright (C) 2001-2002, 2005-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c index cd27d61..a7f59b1 100644 --- a/lib/uniwidth/width.c +++ b/lib/uniwidth/width.c @@ -1,5 +1,5 @@ /* Determine display width of Unicode character. - Copyright (C) 2001-2002, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it diff --git a/lib/unlink.c b/lib/unlink.c index ea1f525..90dc9d3 100644 --- a/lib/unlink.c +++ b/lib/unlink.c @@ -1,6 +1,6 @@ /* Work around unlink bugs. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h index e3f0fcf..ee1c062 100644 --- a/lib/unlocked-io.h +++ b/lib/unlocked-io.h @@ -1,6 +1,6 @@ /* Prefer faster, non-thread-safe stdio functions if available. - Copyright (C) 2001-2004, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/unused-parameter.h b/lib/unused-parameter.h index 40a0ff8..5e57de1 100644 --- a/lib/unused-parameter.h +++ b/lib/unused-parameter.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific function parameters are not used. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/utime.c b/lib/utime.c index 1893c87..6d29045 100644 --- a/lib/utime.c +++ b/lib/utime.c @@ -1,5 +1,5 @@ /* Work around platform bugs in utime. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -83,8 +83,8 @@ _gl_utimens_windows (const char *name, struct timespec ts[2]) /* Open a handle to the file. CreateFile - <https://msdn.microsoft.com/en-us/library/aa363858.aspx> - <https://msdn.microsoft.com/en-us/library/aa363874.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea> + <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */ HANDLE handle = CreateFile (rname, FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES, @@ -105,7 +105,7 @@ _gl_utimens_windows (const char *name, struct timespec ts[2]) if (check_dir) { /* GetFileAttributes - <https://msdn.microsoft.com/en-us/library/aa364944.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesa> */ DWORD attributes = GetFileAttributes (rname); if (attributes == INVALID_FILE_ATTRIBUTES) { @@ -125,18 +125,18 @@ _gl_utimens_windows (const char *name, struct timespec ts[2]) { /* Use SetFileTime(). See - <https://msdn.microsoft.com/en-us/library/ms724933.aspx> - <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime> + <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */ FILETIME last_access_time; FILETIME last_write_time; if (ts == NULL) { /* GetSystemTimeAsFileTime is the same as GetSystemTime followed by SystemTimeToFileTime. - <https://msdn.microsoft.com/en-us/library/ms724397.aspx>. + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>. It would be overkill to use GetSystemTimePreciseAsFileTime - <https://msdn.microsoft.com/en-us/library/hh706895.aspx>. */ + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. */ FILETIME current_time; GetSystemTimeAsFileTime (¤t_time); last_access_time = current_time; diff --git a/lib/utime.in.h b/lib/utime.in.h index 07fdb30..f4b2804 100644 --- a/lib/utime.in.h +++ b/lib/utime.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <utime.h>. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/utimens.c b/lib/utimens.c index f6c4fe3..c9b65ef 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -1,6 +1,6 @@ /* Set file access and modification times. - Copyright (C) 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -288,8 +288,8 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2]) #ifdef USE_SETFILETIME /* On native Windows, use SetFileTime(). See - <https://msdn.microsoft.com/en-us/library/ms724933.aspx> - <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime> + <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */ if (0 <= fd) { HANDLE handle; @@ -307,10 +307,10 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2]) if (ts == NULL || ts[0].tv_nsec == UTIME_NOW || ts[1].tv_nsec == UTIME_NOW) { /* GetSystemTimeAsFileTime - <https://msdn.microsoft.com/en-us/library/ms724397.aspx>. + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>. It would be overkill to use GetSystemTimePreciseAsFileTime - <https://msdn.microsoft.com/en-us/library/hh706895.aspx>. */ + <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. */ GetSystemTimeAsFileTime (¤t_time); } diff --git a/lib/utimens.h b/lib/utimens.h index a24e62c..b174096 100644 --- a/lib/utimens.h +++ b/lib/utimens.h @@ -1,6 +1,6 @@ /* Set file access and modification times. - Copyright 2012-2018 Free Software Foundation, Inc. + Copyright 2012-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 5757175..b3854e3 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4874,6 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ && !defined __UCLIBC__) \ || (defined __APPLE__ && defined __MACH__) \ + || defined __ANDROID__ \ || (defined _WIN32 && ! defined __CYGWIN__)) fbp[1] = '%'; fbp[2] = 'n'; @@ -4895,6 +4896,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, On Mac OS X 10.13 or newer, the use of %n in format strings in writable memory by default crashes the program, so we should avoid it in this situation. */ + /* On Android, we know that snprintf's return value conforms to + ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and + gl_SNPRINTF_TRUNCATION_C99 pass. + Therefore we can avoid using %n in this situation. + Starting on 2018-03-07, the use of %n in format strings + produces a fatal error (see + <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>), + so we should avoid it. */ /* On native Windows systems (such as mingw), we can avoid using %n because: - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, @@ -4908,7 +4917,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, Windows Vista, the use of %n in format strings by default crashes the program. See <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and - <https://msdn.microsoft.com/en-us/library/ms175782.aspx> + <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output> So we should avoid %n in this situation. */ fbp[1] = '\0'; # endif diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h index 3eaaa7e..5b192b2 100644 --- a/lib/vasnprintf.h +++ b/lib/vasnprintf.h @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2004, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/vasprintf.c b/lib/vasprintf.c index aacb306..f5857ca 100644 --- a/lib/vasprintf.c +++ b/lib/vasprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/verify.h b/lib/verify.h index 3b57dde..6930645 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ here generates easier-to-read diagnostics when verify (R) fails. Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. - This will likely be supported by future GCC versions, in C++ mode. + This is supported by GCC 6.1.0 and later, in C++ mode. Use this only with GCC. If we were willing to slow 'configure' down we could also use it with other compilers, but since this @@ -36,9 +36,7 @@ && !defined __cplusplus) # define _GL_HAVE__STATIC_ASSERT 1 #endif -/* The condition (99 < __GNUC__) is temporary, until we know about the - first G++ release that supports static_assert. */ -#if (99 < __GNUC__) && defined __cplusplus +#if (6 <= __GNUC__) && defined __cplusplus # define _GL_HAVE_STATIC_ASSERT 1 #endif diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c index e11ab6c..6a209f7 100644 --- a/lib/vsnprintf.c +++ b/lib/vsnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2019 Free Software Foundation, Inc. Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>. This program is free software; you can redistribute it and/or modify diff --git a/lib/w32sock.h b/lib/w32sock.h index 1e5e584..3cbedd9 100644 --- a/lib/w32sock.h +++ b/lib/w32sock.h @@ -1,6 +1,6 @@ /* w32sock.h --- internal auxiliary functions for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/w32spawn.h b/lib/w32spawn.h index 3f675eb..941ff1a 100644 --- a/lib/w32spawn.h +++ b/lib/w32spawn.h @@ -1,5 +1,5 @@ /* Auxiliary functions for the creation of subprocesses. Native Windows API. - Copyright (C) 2001, 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software: you can redistribute it and/or modify diff --git a/lib/wait-process.c b/lib/wait-process.c index 9e59c08..7c69933 100644 --- a/lib/wait-process.c +++ b/lib/wait-process.c @@ -1,5 +1,5 @@ /* Waiting for a subprocess to finish. - Copyright (C) 2001-2003, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify @@ -80,7 +80,7 @@ static size_t slaves_allocated = SIZEOF (static_slaves); #endif /* The cleanup action. It gets called asynchronously. */ -static void +static _GL_ASYNC_SAFE void cleanup_slaves (void) { for (;;) @@ -102,6 +102,14 @@ cleanup_slaves (void) } } +/* The cleanup action, taking a signal argument. + It gets called asynchronously. */ +static _GL_ASYNC_SAFE void +cleanup_slaves_action (int sig _GL_UNUSED) +{ + cleanup_slaves (); +} + /* Register a subprocess as being a slave process. This means that the subprocess will be terminated when its creator receives a catchable fatal signal or exits normally. Registration ends when wait_subprocess() @@ -113,7 +121,7 @@ register_slave_subprocess (pid_t child) if (!cleanup_slaves_registered) { atexit (cleanup_slaves); - at_fatal_signal (cleanup_slaves); + at_fatal_signal (cleanup_slaves_action); cleanup_slaves_registered = true; } diff --git a/lib/wait-process.h b/lib/wait-process.h index 0e73e71..08470fb 100644 --- a/lib/wait-process.h +++ b/lib/wait-process.h @@ -1,5 +1,5 @@ /* Waiting for a subprocess to finish. - Copyright (C) 2001-2003, 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006, 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify diff --git a/lib/waitpid.c b/lib/waitpid.c index b2e346a..a9dace6 100644 --- a/lib/waitpid.c +++ b/lib/waitpid.c @@ -1,5 +1,5 @@ /* Wait for process state change. - Copyright (C) 2001-2003, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h index 72d67cc..7d11a15 100644 --- a/lib/warn-on-use.h +++ b/lib/warn-on-use.h @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 51a5dda..17d5691 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/wcrtomb.c b/lib/wcrtomb.c index 8f01972..8e56732 100644 --- a/lib/wcrtomb.c +++ b/lib/wcrtomb.c @@ -1,5 +1,5 @@ /* Convert wide character to multibyte character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify @@ -27,8 +27,8 @@ size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps) { - /* This implementation of wcrtomb on top of wctomb() supports only - stateless encodings. ps must be in the initial state. */ + /* This implementation of wcrtomb supports only stateless encodings. + ps must be in the initial state. */ if (ps != NULL && !mbsinit (ps)) { errno = EINVAL; @@ -40,10 +40,21 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps) return 1; else { +#if defined __ANDROID__ + /* Implement consistently with mbrtowc(): through a 1:1 correspondence, + as in ISO-8859-1. */ + if (wc >= 0 && wc <= 0xff) + { + *s = (unsigned char) wc; + return 1; + } +#else + /* Implement on top of wctomb(). */ int ret = wctomb (s, wc); if (ret >= 0) return ret; +#endif else { errno = EILSEQ; diff --git a/lib/wctype.in.h b/lib/wctype.in.h index 3c6e5f2..0a7471f 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wctype.h>, for platforms that lack it. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/wcwidth.c b/lib/wcwidth.c index d33b6a9..1f081cc 100644 --- a/lib/wcwidth.c +++ b/lib/wcwidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a character. - Copyright (C) 2006-2007, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/write.c b/lib/write.c index 0616624..ffa0d06 100644 --- a/lib/write.c +++ b/lib/write.c @@ -1,5 +1,5 @@ /* POSIX compatible write() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c index bfe6109..295f8d8 100644 --- a/lib/xalloc-die.c +++ b/lib/xalloc-die.c @@ -1,6 +1,6 @@ /* Report a memory allocation failure and exit. - Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2018 Free Software + Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h index 3426e10..e3068c8 100644 --- a/lib/xalloc-oversized.h +++ b/lib/xalloc-oversized.h @@ -1,6 +1,6 @@ /* xalloc-oversized.h -- memory allocation size checking - Copyright (C) 1990-2000, 2003-2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/xalloc.h b/lib/xalloc.h index c419a2d..fc7e86b 100644 --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -1,6 +1,6 @@ /* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-2000, 2003-2004, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/xmalloc.c b/lib/xmalloc.c index 9a30d67..cbe9a4f 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -1,6 +1,6 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-2000, 2002-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2002-2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/xmemdup0.c b/lib/xmemdup0.c index 1b53d11..57c1b59 100644 --- a/lib/xmemdup0.c +++ b/lib/xmemdup0.c @@ -1,6 +1,6 @@ /* xmemdup0.c -- copy a block of arbitrary bytes, plus a trailing NUL - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,8 @@ char * xmemdup0 (void const *p, size_t s) { char *result = xcharalloc (s + 1); - memcpy (result, p, s); + if (s > 0) + memcpy (result, p, s); result[s] = 0; return result; } diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h index d182028..768f0b2 100644 --- a/lib/xmemdup0.h +++ b/lib/xmemdup0.h @@ -1,6 +1,6 @@ /* xmemdup0.h -- copy a block of arbitrary bytes, plus a trailing NUL - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,13 +25,6 @@ extern "C" { # endif -/* This function is always triggered when memory is exhausted. - It must be defined by the application, either explicitly - or by using gnulib's xalloc-die module. This is the - function to call when one wants the program to die because of a - memory allocation failure. */ -extern _Noreturn void xalloc_die (void); - char *xmemdup0 (void const *p, size_t s); # ifdef __cplusplus diff --git a/lib/xsize.h b/lib/xsize.h index 8aeb3b7..ecfd478 100644 --- a/lib/xsize.h +++ b/lib/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2008-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/xstrndup.c b/lib/xstrndup.c index 3b1700a..a973829 100644 --- a/lib/xstrndup.c +++ b/lib/xstrndup.c @@ -1,6 +1,6 @@ /* Duplicate a bounded initial segment of a string, with out-of-memory checking. - Copyright (C) 2003, 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lib/xstrndup.h b/lib/xstrndup.h index 54b0967..360ccfd 100644 --- a/lib/xstrndup.h +++ b/lib/xstrndup.h @@ -1,6 +1,6 @@ /* Duplicate a bounded initial segment of a string, with out-of-memory checking. - Copyright (C) 2003, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2003, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by |