summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gl')
-rw-r--r--gl/lib/Makefile.am73
-rw-r--r--gl/lib/Makefile.in220
-rw-r--r--gl/lib/argp-fmtstream.h12
-rw-r--r--gl/lib/argp.h12
-rw-r--r--gl/lib/assure.h24
-rw-r--r--gl/lib/at-func.c2
-rw-r--r--gl/lib/at-func2.c2
-rw-r--r--gl/lib/attribute.h215
-rw-r--r--gl/lib/canonicalize-lgpl.c2
-rw-r--r--gl/lib/canonicalize.c2
-rw-r--r--gl/lib/chown.c2
-rw-r--r--gl/lib/ctype.in.h57
-rw-r--r--gl/lib/dirent-private.h4
-rw-r--r--gl/lib/dirent.in.h10
-rw-r--r--gl/lib/dirname.h2
-rw-r--r--gl/lib/dosname.h52
-rw-r--r--gl/lib/error.h12
-rw-r--r--gl/lib/fchdir.c2
-rw-r--r--gl/lib/filename.h88
-rw-r--r--gl/lib/fnmatch.c429
-rw-r--r--gl/lib/fnmatch_loop.c573
-rw-r--r--gl/lib/getlogin_r.c3
-rw-r--r--gl/lib/getopt-pfx-core.h8
-rw-r--r--gl/lib/getprogname.c2
-rw-r--r--gl/lib/gettimeofday.c18
-rw-r--r--gl/lib/gl_anylinked_list2.h18
-rw-r--r--gl/lib/gl_anytree_list2.h14
-rw-r--r--gl/lib/gl_list.h164
-rw-r--r--gl/lib/gl_map.h20
-rw-r--r--gl/lib/gl_set.h10
-rw-r--r--gl/lib/gl_xlist.h20
-rw-r--r--gl/lib/hash.h27
-rw-r--r--gl/lib/isblank.c33
-rw-r--r--gl/lib/libc-config.h3
-rw-r--r--gl/lib/limits.in.h23
-rw-r--r--gl/lib/mbrtowc.c9
-rw-r--r--gl/lib/nonblocking.c4
-rw-r--r--gl/lib/open.c6
-rw-r--r--gl/lib/openat-proc.c5
-rw-r--r--gl/lib/openat.c10
-rw-r--r--gl/lib/opendir.c10
-rw-r--r--gl/lib/readdir.c4
-rw-r--r--gl/lib/rename.c4
-rw-r--r--gl/lib/rewinddir.c4
-rw-r--r--gl/lib/rmdir.c2
-rw-r--r--gl/lib/select.c12
-rw-r--r--gl/lib/stat-w32.c37
-rw-r--r--gl/lib/stat.c7
-rw-r--r--gl/lib/stdio-read.c4
-rw-r--r--gl/lib/stdio-write.c4
-rw-r--r--gl/lib/stdio.in.h10
-rw-r--r--gl/lib/stdlib.in.h10
-rw-r--r--gl/lib/string.in.h36
-rw-r--r--gl/lib/unistd.in.h27
-rw-r--r--gl/lib/unlink.c7
-rw-r--r--gl/lib/unlinkat.c2
-rw-r--r--gl/lib/utime.c6
-rw-r--r--gl/lib/vasnprintf.c330
-rw-r--r--gl/lib/vasnprintf.h12
-rw-r--r--gl/lib/verify.h20
-rw-r--r--gl/lib/warn-on-use.h21
-rw-r--r--gl/lib/wchar.in.h33
-rw-r--r--gl/lib/windows-rwlock.c4
-rw-r--r--gl/lib/wmemchr-impl.h27
-rw-r--r--gl/lib/wmemchr.c23
-rw-r--r--gl/lib/wmempcpy.c28
-rw-r--r--gl/lib/xalloc.h7
-rw-r--r--gl/lib/xmalloc.c31
-rw-r--r--gl/lib/xsize.h23
-rw-r--r--gl/lib/xvasprintf.h12
-rw-r--r--gl/m4/ctype.m432
-rw-r--r--gl/m4/fnmatch.m46
-rw-r--r--gl/m4/getdelim.m43
-rw-r--r--gl/m4/glob.m43
-rw-r--r--gl/m4/gnulib-common.m4229
-rw-r--r--gl/m4/gnulib-comp.m434
-rw-r--r--gl/m4/isblank.m417
-rw-r--r--gl/m4/manywarnings.m424
-rw-r--r--gl/m4/memmem.m44
-rw-r--r--gl/m4/printf.m428
-rw-r--r--gl/m4/regex.m492
-rw-r--r--gl/m4/unistd_h.m47
-rw-r--r--gl/m4/wchar_h.m47
-rw-r--r--gl/m4/wint_t.m412
-rw-r--r--gl/m4/wmemchr.m432
-rw-r--r--gl/m4/wmempcpy.m421
-rw-r--r--gl/po/POTFILES.in7
-rw-r--r--gl/po/af.po2
-rw-r--r--gl/po/be.po2
-rw-r--r--gl/po/bg.gmobin6044 -> 6091 bytes
-rw-r--r--gl/po/bg.po8
-rw-r--r--gl/po/ca.po2
-rw-r--r--gl/po/cs.po2
-rw-r--r--gl/po/da.po2
-rw-r--r--gl/po/de.po2
-rw-r--r--gl/po/el.po2
-rw-r--r--gl/po/eo.po2
-rw-r--r--gl/po/es.po2
-rw-r--r--gl/po/et.po2
-rw-r--r--gl/po/eu.po2
-rw-r--r--gl/po/fi.po2
-rw-r--r--gl/po/fr.po2
-rw-r--r--gl/po/ga.po2
-rw-r--r--gl/po/gl.po2
-rw-r--r--gl/po/hu.po2
-rw-r--r--gl/po/it.po2
-rw-r--r--gl/po/ja.po2
-rw-r--r--gl/po/ko.po2
-rw-r--r--gl/po/man-db-gnulib.pot4
-rw-r--r--gl/po/ms.po2
-rw-r--r--gl/po/nb.po2
-rw-r--r--gl/po/nl.po2
-rw-r--r--gl/po/pl.po2
-rw-r--r--gl/po/pt.po2
-rw-r--r--gl/po/pt_BR.po2
-rw-r--r--gl/po/ro.po2
-rw-r--r--gl/po/ru.po2
-rw-r--r--gl/po/rw.po2
-rw-r--r--gl/po/sk.po2
-rw-r--r--gl/po/sl.po2
-rw-r--r--gl/po/sr.gmobin4867 -> 5850 bytes
-rw-r--r--gl/po/sr.po278
-rw-r--r--gl/po/sv.gmobin4638 -> 4667 bytes
-rw-r--r--gl/po/sv.po54
-rw-r--r--gl/po/tr.po2
-rw-r--r--gl/po/uk.po2
-rw-r--r--gl/po/vi.po2
-rw-r--r--gl/po/zh_CN.po2
-rw-r--r--gl/po/zh_TW.po2
129 files changed, 2685 insertions, 1236 deletions
diff --git a/gl/lib/Makefile.am b/gl/lib/Makefile.am
index f027de60..a2ad9a34 100644
--- a/gl/lib/Makefile.am
+++ b/gl/lib/Makefile.am
@@ -219,6 +219,13 @@ libgnu_la_SOURCES += openat-priv.h openat-proc.c
## end gnulib module at-internal
+## begin gnulib module attribute
+
+
+EXTRA_DIST += attribute.h
+
+## end gnulib module attribute
+
## begin gnulib module bitrotate
libgnu_la_SOURCES += bitrotate.h bitrotate.c
@@ -295,6 +302,33 @@ EXTRA_libgnu_la_SOURCES += closedir.c
## end gnulib module closedir
+## begin gnulib module ctype
+
+BUILT_SOURCES += ctype.h
+
+# We need the following in order to create <ctype.h> when the system
+# doesn't have one that works with the given compiler.
+ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
+ -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/ctype.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += ctype.h ctype.h-t
+
+EXTRA_DIST += ctype.in.h
+
+## end gnulib module ctype
+
## begin gnulib module dirent
BUILT_SOURCES += dirent.h
@@ -370,13 +404,6 @@ EXTRA_DIST += dirname.h
## end gnulib module dirname-lgpl
-## begin gnulib module dosname
-
-
-EXTRA_DIST += dosname.h
-
-## end gnulib module dosname
-
## begin gnulib module dup
@@ -971,6 +998,15 @@ EXTRA_libgnu_la_SOURCES += ioctl.c
## end gnulib module ioctl
+## begin gnulib module isblank
+
+
+EXTRA_DIST += isblank.c
+
+EXTRA_libgnu_la_SOURCES += isblank.c
+
+## end gnulib module isblank
+
## begin gnulib module langinfo
BUILT_SOURCES += langinfo.h
@@ -2782,6 +2818,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GNULIB_GETENTROPY)/g' \
-e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
@@ -2830,6 +2867,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
-e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
@@ -2899,6 +2937,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -3066,6 +3105,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
-e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
-e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GNULIB_WMEMPCPY)/g' \
-e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
-e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
-e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
@@ -3106,6 +3146,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
-e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
-e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
-e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
-e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
-e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
@@ -3251,6 +3292,24 @@ EXTRA_libgnu_la_SOURCES += windows-rwlock.c
## end gnulib module windows-rwlock
+## begin gnulib module wmemchr
+
+
+EXTRA_DIST += wmemchr-impl.h wmemchr.c
+
+EXTRA_libgnu_la_SOURCES += wmemchr.c
+
+## end gnulib module wmemchr
+
+## begin gnulib module wmempcpy
+
+
+EXTRA_DIST += wmempcpy.c
+
+EXTRA_libgnu_la_SOURCES += wmempcpy.c
+
+## end gnulib module wmempcpy
+
## begin gnulib module xalloc
libgnu_la_SOURCES += xmalloc.c
diff --git a/gl/lib/Makefile.in b/gl/lib/Makefile.in
index 37aa0e98..fbce89f4 100644
--- a/gl/lib/Makefile.in
+++ b/gl/lib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -229,9 +229,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/chdir-long.m4 $(top_srcdir)/gl/m4/chown.m4 \
$(top_srcdir)/gl/m4/clock_time.m4 $(top_srcdir)/gl/m4/close.m4 \
$(top_srcdir)/gl/m4/closedir.m4 $(top_srcdir)/gl/m4/codeset.m4 \
- $(top_srcdir)/gl/m4/d-ino.m4 $(top_srcdir)/gl/m4/d-type.m4 \
- $(top_srcdir)/gl/m4/dirent_h.m4 $(top_srcdir)/gl/m4/dirfd.m4 \
- $(top_srcdir)/gl/m4/dirname.m4 \
+ $(top_srcdir)/gl/m4/ctype.m4 $(top_srcdir)/gl/m4/d-ino.m4 \
+ $(top_srcdir)/gl/m4/d-type.m4 $(top_srcdir)/gl/m4/dirent_h.m4 \
+ $(top_srcdir)/gl/m4/dirfd.m4 $(top_srcdir)/gl/m4/dirname.m4 \
$(top_srcdir)/gl/m4/double-slash-root.m4 \
$(top_srcdir)/gl/m4/dup.m4 $(top_srcdir)/gl/m4/dup2.m4 \
$(top_srcdir)/gl/m4/eealloc.m4 $(top_srcdir)/gl/m4/environ.m4 \
@@ -270,6 +270,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/intmax_t.m4 \
$(top_srcdir)/gl/m4/inttypes.m4 \
$(top_srcdir)/gl/m4/inttypes_h.m4 $(top_srcdir)/gl/m4/ioctl.m4 \
+ $(top_srcdir)/gl/m4/isblank.m4 \
$(top_srcdir)/gl/m4/langinfo_h.m4 \
$(top_srcdir)/gl/m4/largefile.m4 $(top_srcdir)/gl/m4/lchown.m4 \
$(top_srcdir)/gl/m4/lib-ignore.m4 \
@@ -366,6 +367,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \
$(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \
$(top_srcdir)/gl/m4/wctype_h.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
+ $(top_srcdir)/gl/m4/wmemchr.m4 $(top_srcdir)/gl/m4/wmempcpy.m4 \
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xgetcwd.m4 \
$(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
$(top_srcdir)/gl/m4/xvasprintf.m4 \
@@ -470,56 +472,57 @@ am__depfiles_remade = ./$(DEPDIR)/alloca.Plo \
./$(DEPDIR)/hash-pjw.Plo ./$(DEPDIR)/hash-triple.Plo \
./$(DEPDIR)/hash.Plo ./$(DEPDIR)/idpriv-drop.Plo \
./$(DEPDIR)/idpriv-droptemp.Plo ./$(DEPDIR)/ioctl.Plo \
- ./$(DEPDIR)/itold.Plo ./$(DEPDIR)/lc-charset-dispatch.Plo \
- ./$(DEPDIR)/lchown.Plo ./$(DEPDIR)/localcharset.Plo \
- ./$(DEPDIR)/localeconv.Plo ./$(DEPDIR)/localtime-buffer.Plo \
- ./$(DEPDIR)/lstat.Plo ./$(DEPDIR)/malloc.Plo \
- ./$(DEPDIR)/malloca.Plo ./$(DEPDIR)/mbrtowc.Plo \
- ./$(DEPDIR)/mbsinit.Plo ./$(DEPDIR)/mbsrtowcs-state.Plo \
- ./$(DEPDIR)/mbsrtowcs.Plo ./$(DEPDIR)/mbtowc-lock.Plo \
- ./$(DEPDIR)/mbtowc.Plo ./$(DEPDIR)/memchr.Plo \
- ./$(DEPDIR)/memmem.Plo ./$(DEPDIR)/mempcpy.Plo \
- ./$(DEPDIR)/memrchr.Plo ./$(DEPDIR)/mkdir.Plo \
- ./$(DEPDIR)/mkdtemp.Plo ./$(DEPDIR)/mkstemp.Plo \
- ./$(DEPDIR)/msvc-inval.Plo ./$(DEPDIR)/msvc-nothrow.Plo \
- ./$(DEPDIR)/nanosleep.Plo ./$(DEPDIR)/nl_langinfo.Plo \
- ./$(DEPDIR)/nonblocking.Plo ./$(DEPDIR)/open.Plo \
- ./$(DEPDIR)/openat-die.Plo ./$(DEPDIR)/openat-proc.Plo \
- ./$(DEPDIR)/openat.Plo ./$(DEPDIR)/opendir.Plo \
- ./$(DEPDIR)/pipe-safer.Plo ./$(DEPDIR)/printf-args.Plo \
- ./$(DEPDIR)/printf-parse.Plo ./$(DEPDIR)/progname.Plo \
- ./$(DEPDIR)/raise.Plo ./$(DEPDIR)/rawmemchr.Plo \
- ./$(DEPDIR)/readdir.Plo ./$(DEPDIR)/readlink.Plo \
- ./$(DEPDIR)/realloc.Plo ./$(DEPDIR)/regcomp.Plo \
- ./$(DEPDIR)/regex.Plo ./$(DEPDIR)/regex_internal.Plo \
- ./$(DEPDIR)/regexec.Plo ./$(DEPDIR)/rename.Plo \
- ./$(DEPDIR)/renameat.Plo ./$(DEPDIR)/renameatu.Plo \
- ./$(DEPDIR)/rewinddir.Plo ./$(DEPDIR)/rmdir.Plo \
- ./$(DEPDIR)/same.Plo ./$(DEPDIR)/save-cwd.Plo \
- ./$(DEPDIR)/select.Plo ./$(DEPDIR)/setenv.Plo \
- ./$(DEPDIR)/setlocale-lock.Plo ./$(DEPDIR)/setlocale_null.Plo \
- ./$(DEPDIR)/sig-handler.Plo ./$(DEPDIR)/sigaction.Plo \
- ./$(DEPDIR)/sigprocmask.Plo ./$(DEPDIR)/sleep.Plo \
- ./$(DEPDIR)/sockets.Plo ./$(DEPDIR)/stat-time.Plo \
- ./$(DEPDIR)/stat-w32.Plo ./$(DEPDIR)/stat.Plo \
- ./$(DEPDIR)/statat.Plo ./$(DEPDIR)/stdio-read.Plo \
- ./$(DEPDIR)/stdio-write.Plo ./$(DEPDIR)/stdopen.Plo \
- ./$(DEPDIR)/strcasecmp.Plo ./$(DEPDIR)/strcasestr.Plo \
- ./$(DEPDIR)/strchrnul.Plo ./$(DEPDIR)/strdup.Plo \
- ./$(DEPDIR)/strerror-override.Plo ./$(DEPDIR)/strerror.Plo \
- ./$(DEPDIR)/stripslash.Plo ./$(DEPDIR)/strncasecmp.Plo \
- ./$(DEPDIR)/strndup.Plo ./$(DEPDIR)/strnlen.Plo \
- ./$(DEPDIR)/strnlen1.Plo ./$(DEPDIR)/strsep.Plo \
- ./$(DEPDIR)/sys_socket.Plo ./$(DEPDIR)/tempname.Plo \
- ./$(DEPDIR)/timespec.Plo ./$(DEPDIR)/unistd.Plo \
- ./$(DEPDIR)/unlink.Plo ./$(DEPDIR)/unlinkat.Plo \
- ./$(DEPDIR)/unsetenv.Plo ./$(DEPDIR)/utime.Plo \
- ./$(DEPDIR)/utimens.Plo ./$(DEPDIR)/vasnprintf.Plo \
- ./$(DEPDIR)/vasprintf.Plo ./$(DEPDIR)/vsnprintf.Plo \
- ./$(DEPDIR)/wcrtomb.Plo ./$(DEPDIR)/wctype-h.Plo \
- ./$(DEPDIR)/windows-mutex.Plo ./$(DEPDIR)/windows-once.Plo \
- ./$(DEPDIR)/windows-recmutex.Plo \
- ./$(DEPDIR)/windows-rwlock.Plo ./$(DEPDIR)/xalloc-die.Plo \
+ ./$(DEPDIR)/isblank.Plo ./$(DEPDIR)/itold.Plo \
+ ./$(DEPDIR)/lc-charset-dispatch.Plo ./$(DEPDIR)/lchown.Plo \
+ ./$(DEPDIR)/localcharset.Plo ./$(DEPDIR)/localeconv.Plo \
+ ./$(DEPDIR)/localtime-buffer.Plo ./$(DEPDIR)/lstat.Plo \
+ ./$(DEPDIR)/malloc.Plo ./$(DEPDIR)/malloca.Plo \
+ ./$(DEPDIR)/mbrtowc.Plo ./$(DEPDIR)/mbsinit.Plo \
+ ./$(DEPDIR)/mbsrtowcs-state.Plo ./$(DEPDIR)/mbsrtowcs.Plo \
+ ./$(DEPDIR)/mbtowc-lock.Plo ./$(DEPDIR)/mbtowc.Plo \
+ ./$(DEPDIR)/memchr.Plo ./$(DEPDIR)/memmem.Plo \
+ ./$(DEPDIR)/mempcpy.Plo ./$(DEPDIR)/memrchr.Plo \
+ ./$(DEPDIR)/mkdir.Plo ./$(DEPDIR)/mkdtemp.Plo \
+ ./$(DEPDIR)/mkstemp.Plo ./$(DEPDIR)/msvc-inval.Plo \
+ ./$(DEPDIR)/msvc-nothrow.Plo ./$(DEPDIR)/nanosleep.Plo \
+ ./$(DEPDIR)/nl_langinfo.Plo ./$(DEPDIR)/nonblocking.Plo \
+ ./$(DEPDIR)/open.Plo ./$(DEPDIR)/openat-die.Plo \
+ ./$(DEPDIR)/openat-proc.Plo ./$(DEPDIR)/openat.Plo \
+ ./$(DEPDIR)/opendir.Plo ./$(DEPDIR)/pipe-safer.Plo \
+ ./$(DEPDIR)/printf-args.Plo ./$(DEPDIR)/printf-parse.Plo \
+ ./$(DEPDIR)/progname.Plo ./$(DEPDIR)/raise.Plo \
+ ./$(DEPDIR)/rawmemchr.Plo ./$(DEPDIR)/readdir.Plo \
+ ./$(DEPDIR)/readlink.Plo ./$(DEPDIR)/realloc.Plo \
+ ./$(DEPDIR)/regcomp.Plo ./$(DEPDIR)/regex.Plo \
+ ./$(DEPDIR)/regex_internal.Plo ./$(DEPDIR)/regexec.Plo \
+ ./$(DEPDIR)/rename.Plo ./$(DEPDIR)/renameat.Plo \
+ ./$(DEPDIR)/renameatu.Plo ./$(DEPDIR)/rewinddir.Plo \
+ ./$(DEPDIR)/rmdir.Plo ./$(DEPDIR)/same.Plo \
+ ./$(DEPDIR)/save-cwd.Plo ./$(DEPDIR)/select.Plo \
+ ./$(DEPDIR)/setenv.Plo ./$(DEPDIR)/setlocale-lock.Plo \
+ ./$(DEPDIR)/setlocale_null.Plo ./$(DEPDIR)/sig-handler.Plo \
+ ./$(DEPDIR)/sigaction.Plo ./$(DEPDIR)/sigprocmask.Plo \
+ ./$(DEPDIR)/sleep.Plo ./$(DEPDIR)/sockets.Plo \
+ ./$(DEPDIR)/stat-time.Plo ./$(DEPDIR)/stat-w32.Plo \
+ ./$(DEPDIR)/stat.Plo ./$(DEPDIR)/statat.Plo \
+ ./$(DEPDIR)/stdio-read.Plo ./$(DEPDIR)/stdio-write.Plo \
+ ./$(DEPDIR)/stdopen.Plo ./$(DEPDIR)/strcasecmp.Plo \
+ ./$(DEPDIR)/strcasestr.Plo ./$(DEPDIR)/strchrnul.Plo \
+ ./$(DEPDIR)/strdup.Plo ./$(DEPDIR)/strerror-override.Plo \
+ ./$(DEPDIR)/strerror.Plo ./$(DEPDIR)/stripslash.Plo \
+ ./$(DEPDIR)/strncasecmp.Plo ./$(DEPDIR)/strndup.Plo \
+ ./$(DEPDIR)/strnlen.Plo ./$(DEPDIR)/strnlen1.Plo \
+ ./$(DEPDIR)/strsep.Plo ./$(DEPDIR)/sys_socket.Plo \
+ ./$(DEPDIR)/tempname.Plo ./$(DEPDIR)/timespec.Plo \
+ ./$(DEPDIR)/unistd.Plo ./$(DEPDIR)/unlink.Plo \
+ ./$(DEPDIR)/unlinkat.Plo ./$(DEPDIR)/unsetenv.Plo \
+ ./$(DEPDIR)/utime.Plo ./$(DEPDIR)/utimens.Plo \
+ ./$(DEPDIR)/vasnprintf.Plo ./$(DEPDIR)/vasprintf.Plo \
+ ./$(DEPDIR)/vsnprintf.Plo ./$(DEPDIR)/wcrtomb.Plo \
+ ./$(DEPDIR)/wctype-h.Plo ./$(DEPDIR)/windows-mutex.Plo \
+ ./$(DEPDIR)/windows-once.Plo ./$(DEPDIR)/windows-recmutex.Plo \
+ ./$(DEPDIR)/windows-rwlock.Plo ./$(DEPDIR)/wmemchr.Plo \
+ ./$(DEPDIR)/wmempcpy.Plo ./$(DEPDIR)/xalloc-die.Plo \
./$(DEPDIR)/xasprintf.Plo ./$(DEPDIR)/xgetcwd.Plo \
./$(DEPDIR)/xmalloc.Plo ./$(DEPDIR)/xsize.Plo \
./$(DEPDIR)/xstdopen.Plo ./$(DEPDIR)/xstrndup.Plo \
@@ -741,6 +744,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@
GNULIB_GETDELIM = @GNULIB_GETDELIM@
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETENTROPY = @GNULIB_GETENTROPY@
GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
GNULIB_GETLINE = @GNULIB_GETLINE@
@@ -764,6 +768,7 @@ GNULIB_IMAXABS = @GNULIB_IMAXABS@
GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
GNULIB_IOCTL = @GNULIB_IOCTL@
GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
GNULIB_ISWDIGIT = @GNULIB_ISWDIGIT@
@@ -974,6 +979,7 @@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMPCPY = @GNULIB_WMEMPCPY@
GNULIB_WMEMSET = @GNULIB_WMEMSET@
GNULIB_WRITE = @GNULIB_WRITE@
GNULIB__EXIT = @GNULIB__EXIT@
@@ -1060,6 +1066,7 @@ HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
HAVE_FUTIMENS = @HAVE_FUTIMENS@
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
HAVE_GETGROUPS = @HAVE_GETGROUPS@
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
HAVE_GETLOGIN = @HAVE_GETLOGIN@
@@ -1076,6 +1083,7 @@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
HAVE_INITSTATE = @HAVE_INITSTATE@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
HAVE_ISWBLANK = @HAVE_ISWBLANK@
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
@@ -1243,6 +1251,7 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
HAVE_WMEMCMP = @HAVE_WMEMCMP@
HAVE_WMEMCPY = @HAVE_WMEMCPY@
HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
HAVE_WMEMSET = @HAVE_WMEMSET@
HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
@@ -1311,6 +1320,7 @@ MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
@@ -1344,6 +1354,7 @@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_AS_FIRST_DIRECTIVE_UTIME_H = @NEXT_AS_FIRST_DIRECTIVE_UTIME_H@
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_CTYPE_H = @NEXT_CTYPE_H@
NEXT_DIRENT_H = @NEXT_DIRENT_H@
NEXT_ERRNO_H = @NEXT_ERRNO_H@
NEXT_FCNTL_H = @NEXT_FCNTL_H@
@@ -1615,6 +1626,7 @@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_NLS = @USE_NLS@
@@ -1733,35 +1745,37 @@ uncompress = @uncompress@
unlzip = @unlzip@
unlzma = @unlzma@
unxz = @unxz@
+unzstd = @unzstd@
vgrind = @vgrind@
xz = @xz@
+zstd = @zstd@
AUTOMAKE_OPTIONS = 1.11 gnits subdir-objects
SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES = libgnu.la
-EXTRA_DIST = alloca.c alloca.in.h areadlink.h assure.h btowc.c \
- canonicalize.h canonicalize-lgpl.c chdir-long.c chdir-long.h \
- chown.c fchown-stub.c cloexec.h close.c closedir.c \
- dirent-private.h dirent.in.h dirfd.c stripslash.c dirname.h \
- dosname.h dup.c dup2.c errno.in.h error.c error.h exitfail.h \
- fchdir.c fcntl.c fcntl.in.h fd-hook.h fdopendir.c file-set.h \
- filename.h filenamecat.h flexmember.h float.c float.in.h \
- itold.c flock.c fnmatch.c fnmatch_loop.c fnmatch.in.h fstat.c \
- stat-w32.c stat-w32.h at-func.c fstatat.c futimens.c getcwd.c \
- getcwd-lgpl.c getdelim.c getdtablesize.c getline.c \
- getlogin_r.c getopt-cdefs.in.h getopt-core.h getopt-ext.h \
- getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h \
- getopt1.c getopt_int.h gettimeofday.c \
+EXTRA_DIST = alloca.c alloca.in.h areadlink.h assure.h attribute.h \
+ btowc.c canonicalize.h canonicalize-lgpl.c chdir-long.c \
+ chdir-long.h chown.c fchown-stub.c cloexec.h close.c \
+ closedir.c dirent-private.h ctype.in.h dirent.in.h dirfd.c \
+ stripslash.c dirname.h dup.c dup2.c errno.in.h error.c error.h \
+ exitfail.h fchdir.c fcntl.c fcntl.in.h fd-hook.h fdopendir.c \
+ file-set.h filename.h filenamecat.h flexmember.h float.c \
+ float.in.h itold.c flock.c fnmatch.c fnmatch_loop.c \
+ fnmatch.in.h fstat.c stat-w32.c stat-w32.h at-func.c fstatat.c \
+ futimens.c getcwd.c getcwd-lgpl.c getdelim.c getdtablesize.c \
+ getline.c getlogin_r.c getopt-cdefs.in.h getopt-core.h \
+ getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c \
+ getopt.in.h getopt1.c getopt_int.h gettimeofday.c \
$(top_srcdir)/build-aux/gitlog-to-changelog glob.c \
glob_internal.h glob_pattern_p.c globfree.c glob-libc.h \
glob.in.h $(top_srcdir)/build-aux/gnupload hard-locale.h \
hash.h hash-triple.h $(top_srcdir)/build-aux/config.rpath \
idpriv.h idpriv.h intprops.h inttypes.in.h ioctl.c w32sock.h \
- langinfo.in.h lchown.c cdefs.h libc-config.h limits.in.h \
- localcharset.h locale.in.h localeconv.c localtime-buffer.c \
- localtime-buffer.h lstat.c malloc.c malloc.c malloca.h \
- lc-charset-dispatch.c lc-charset-dispatch.h \
+ isblank.c langinfo.in.h lchown.c cdefs.h libc-config.h \
+ limits.in.h localcharset.h locale.in.h localeconv.c \
+ localtime-buffer.c localtime-buffer.h lstat.c malloc.c \
+ malloc.c malloca.h lc-charset-dispatch.c lc-charset-dispatch.h \
mbrtowc-impl-utf8.h mbrtowc-impl.h mbrtowc.c mbtowc-lock.c \
mbtowc-lock.h windows-initguard.h mbsinit.c mbsrtowcs-impl.h \
mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h mbtowc.c memchr.c \
@@ -1796,23 +1810,24 @@ EXTRA_DIST = alloca.c alloca.in.h areadlink.h assure.h btowc.c \
windows-initguard.h windows-mutex.c windows-mutex.h \
windows-once.c windows-once.h windows-initguard.h \
windows-recmutex.c windows-recmutex.h windows-initguard.h \
- windows-rwlock.c windows-rwlock.h xalloc.h xalloc-oversized.h \
- xgetcwd.h xstdopen.h xalloc.h
-BUILT_SOURCES = $(ALLOCA_H) dirent.h $(ERRNO_H) fcntl.h $(FLOAT_H) \
- $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) $(GLOB_H) \
- inttypes.h langinfo.h $(LIMITS_H) locale.h signal.h \
+ windows-rwlock.c windows-rwlock.h wmemchr-impl.h wmemchr.c \
+ wmempcpy.c xalloc.h xalloc-oversized.h xgetcwd.h xstdopen.h \
+ xalloc.h
+BUILT_SOURCES = $(ALLOCA_H) ctype.h dirent.h $(ERRNO_H) fcntl.h \
+ $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) \
+ $(GLOB_H) inttypes.h langinfo.h $(LIMITS_H) locale.h signal.h \
$(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
stdio.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h \
sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h \
sys/uio.h $(SYSEXITS_H) time.h unistd.h $(UTIME_H) wchar.h \
wctype.h
SUFFIXES =
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
- dirent.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \
- float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t \
- getopt-cdefs.h getopt-cdefs.h-t glob.h glob.h-t inttypes.h \
- inttypes.h-t langinfo.h langinfo.h-t limits.h limits.h-t \
- locale.h locale.h-t signal.h signal.h-t stdalign.h \
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \
+ ctype.h-t dirent.h dirent.h-t errno.h errno.h-t fcntl.h \
+ fcntl.h-t float.h float.h-t fnmatch.h fnmatch.h-t getopt.h \
+ getopt.h-t getopt-cdefs.h getopt-cdefs.h-t glob.h glob.h-t \
+ inttypes.h inttypes.h-t langinfo.h langinfo.h-t limits.h \
+ limits.h-t locale.h locale.h-t signal.h signal.h-t stdalign.h \
stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \
stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
stdlib.h stdlib.h-t string.h string.h-t strings.h strings.h-t \
@@ -1870,8 +1885,8 @@ EXTRA_libgnu_la_SOURCES = alloca.c btowc.c canonicalize-lgpl.c \
stat-w32.c at-func.c fstatat.c futimens.c getcwd.c \
getcwd-lgpl.c getdelim.c getdtablesize.c getline.c \
getlogin_r.c getopt.c getopt1.c gettimeofday.c glob.c \
- glob_pattern_p.c globfree.c ioctl.c lchown.c localeconv.c \
- localtime-buffer.c lstat.c malloc.c malloc.c \
+ glob_pattern_p.c globfree.c ioctl.c isblank.c lchown.c \
+ localeconv.c localtime-buffer.c lstat.c malloc.c malloc.c \
lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c mbsinit.c \
mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c memmem.c \
mempcpy.c memrchr.c mkdir.c mkdtemp.c mkstemp.c msvc-inval.c \
@@ -1886,7 +1901,8 @@ EXTRA_libgnu_la_SOURCES = alloca.c btowc.c canonicalize-lgpl.c \
unlink.c at-func.c unlinkat.c unsetenv.c utime.c asnprintf.c \
printf-args.c printf-parse.c vasnprintf.c asprintf.c \
vasprintf.c vsnprintf.c wcrtomb.c windows-mutex.c \
- windows-once.c windows-recmutex.c windows-rwlock.c
+ windows-once.c windows-recmutex.c windows-rwlock.c wmemchr.c \
+ wmempcpy.c
libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LIBSOCKET) \
$(LIBTHREAD) $(LIB_CLOCK_GETTIME) $(LIB_GETLOGIN) \
$(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_NANOSLEEP) \
@@ -2085,6 +2101,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idpriv-drop.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idpriv-droptemp.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lc-charset-dispatch.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Plo@am__quote@ # am--include-marker
@@ -2183,6 +2200,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-once.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-recmutex.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-rwlock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmemchr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmempcpy.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetcwd.Plo@am__quote@ # am--include-marker
@@ -2529,6 +2548,7 @@ distclean: distclean-recursive
-rm -f ./$(DEPDIR)/idpriv-drop.Plo
-rm -f ./$(DEPDIR)/idpriv-droptemp.Plo
-rm -f ./$(DEPDIR)/ioctl.Plo
+ -rm -f ./$(DEPDIR)/isblank.Plo
-rm -f ./$(DEPDIR)/itold.Plo
-rm -f ./$(DEPDIR)/lc-charset-dispatch.Plo
-rm -f ./$(DEPDIR)/lchown.Plo
@@ -2627,6 +2647,8 @@ distclean: distclean-recursive
-rm -f ./$(DEPDIR)/windows-once.Plo
-rm -f ./$(DEPDIR)/windows-recmutex.Plo
-rm -f ./$(DEPDIR)/windows-rwlock.Plo
+ -rm -f ./$(DEPDIR)/wmemchr.Plo
+ -rm -f ./$(DEPDIR)/wmempcpy.Plo
-rm -f ./$(DEPDIR)/xalloc-die.Plo
-rm -f ./$(DEPDIR)/xasprintf.Plo
-rm -f ./$(DEPDIR)/xgetcwd.Plo
@@ -2770,6 +2792,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/idpriv-drop.Plo
-rm -f ./$(DEPDIR)/idpriv-droptemp.Plo
-rm -f ./$(DEPDIR)/ioctl.Plo
+ -rm -f ./$(DEPDIR)/isblank.Plo
-rm -f ./$(DEPDIR)/itold.Plo
-rm -f ./$(DEPDIR)/lc-charset-dispatch.Plo
-rm -f ./$(DEPDIR)/lchown.Plo
@@ -2868,6 +2891,8 @@ maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/windows-once.Plo
-rm -f ./$(DEPDIR)/windows-recmutex.Plo
-rm -f ./$(DEPDIR)/windows-rwlock.Plo
+ -rm -f ./$(DEPDIR)/wmemchr.Plo
+ -rm -f ./$(DEPDIR)/wmempcpy.Plo
-rm -f ./$(DEPDIR)/xalloc-die.Plo
-rm -f ./$(DEPDIR)/xasprintf.Plo
-rm -f ./$(DEPDIR)/xgetcwd.Plo
@@ -2931,6 +2956,24 @@ uninstall-am:
@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+# We need the following in order to create <ctype.h> when the system
+# doesn't have one that works with the given compiler.
+ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
+ -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/ctype.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
# We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -4000,6 +4043,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GNULIB_GETENTROPY)/g' \
-e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
@@ -4048,6 +4092,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
-e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
@@ -4117,6 +4162,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -4177,6 +4223,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
-e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
-e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GNULIB_WMEMPCPY)/g' \
-e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
-e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
-e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
@@ -4217,6 +4264,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
-e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
-e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
-e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
-e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
-e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
diff --git a/gl/lib/argp-fmtstream.h b/gl/lib/argp-fmtstream.h
index e7713c4f..8e4bc0dd 100644
--- a/gl/lib/argp-fmtstream.h
+++ b/gl/lib/argp-fmtstream.h
@@ -28,18 +28,6 @@
#include <string.h>
#include <unistd.h>
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
/* line_wrap_stream is available, so use that. */
#define ARGP_FMTSTREAM_USE_LINEWRAP
diff --git a/gl/lib/argp.h b/gl/lib/argp.h
index 4cc65639..808c900b 100644
--- a/gl/lib/argp.h
+++ b/gl/lib/argp.h
@@ -34,18 +34,6 @@
# define __NTH(fct) fct __THROW
#endif
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
/* GCC 2.95 and later have "__restrict"; C99 compilers have
"restrict", and "configure" may have defined "restrict".
Other compilers use __restrict, __restrict__, and _Restrict, and
diff --git a/gl/lib/assure.h b/gl/lib/assure.h
index 8ea2f6e4..09a4edfa 100644
--- a/gl/lib/assure.h
+++ b/gl/lib/assure.h
@@ -21,12 +21,32 @@
#define _GL_ASSURE_H
#include <assert.h>
+#include "verify.h"
+
+/* Evaluate an assertion E that is guaranteed to be true.
+ If NDEBUG is not defined, abort the program if E is false.
+ If NDEBUG is defined, the compiler can assume E and behavior is
+ undefined if E is false, fails to evaluate, or has side effects.
+
+ Unlike standard 'assert', this macro evaluates E even when NDEBUG
+ is defined, so as to catch typos, avoid some GCC warnings, and
+ improve performance when E is simple enough.
+
+ Also see the documentation for 'assume' in verify.h. */
+
+#ifdef NDEBUG
+# define affirm(E) assume (E)
+#else
+# define affirm(E) assert (E)
+#endif
/* Check E's value at runtime, and report an error and abort if not.
However, do nothing if NDEBUG is defined.
- Unlike standard 'assert', this macro always compiles E even when NDEBUG
- is defined, so as to catch typos and avoid some GCC warnings. */
+ Unlike standard 'assert', this macro compiles E even when NDEBUG
+ is defined, so as to catch typos and avoid some GCC warnings.
+ Unlike 'affirm', it is OK for E to use hard-to-optimize features,
+ since E is not executed if NDEBUG is defined. */
#ifdef NDEBUG
# define assure(E) ((void) (0 && (E)))
diff --git a/gl/lib/at-func.c b/gl/lib/at-func.c
index 4a1c909d..90022e05 100644
--- a/gl/lib/at-func.c
+++ b/gl/lib/at-func.c
@@ -16,7 +16,7 @@
/* written by Jim Meyering */
-#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
# include <errno.h>
diff --git a/gl/lib/at-func2.c b/gl/lib/at-func2.c
index bc2e2fa1..51baf3d1 100644
--- a/gl/lib/at-func2.c
+++ b/gl/lib/at-func2.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <unistd.h>
-#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "filenamecat.h"
#include "openat.h"
#include "same-inode.h"
diff --git a/gl/lib/attribute.h b/gl/lib/attribute.h
new file mode 100644
index 00000000..2836b99d
--- /dev/null
+++ b/gl/lib/attribute.h
@@ -0,0 +1,215 @@
+/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
+
+ Copyright 2020 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 Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
+ macros used within Gnulib. */
+
+/* These attributes can be placed in two ways:
+ - At the start of a declaration (i.e. even before storage-class
+ specifiers!); then they apply to all entities that are declared
+ by the declaration.
+ - Immediately after the name of an entity being declared by the
+ declaration; then they apply to that entity only. */
+
+#ifndef _GL_ATTRIBUTE_H
+#define _GL_ATTRIBUTE_H
+
+
+/* This file defines two types of attributes:
+ * C2X standard attributes. These have macro names that do not begin with
+ 'ATTRIBUTE_'.
+ * Selected GCC attributes; see:
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html
+ These names begin with 'ATTRIBUTE_' to avoid name clashes. */
+
+
+/* =============== Attributes for specific kinds of functions =============== */
+
+/* Attributes for functions that should not be used. */
+
+/* Warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+
+/* If a function call is not optimized way, warn with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING (msg)
+
+/* If a function call is not optimized way, report an error with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR (msg)
+
+
+/* Attributes for memory-allocating functions. */
+
+/* The function returns a pointer to freshly allocated memory. */
+/* Applies to: functions. */
+#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
+
+/* ATTRIBUTE_ALLOC_SIZE ((N)) - The Nth argument of the function
+ is the size of the returned memory block.
+ ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
+ to determine the size of the returned memory block. */
+/* Applies to: function, pointer to function, function types. */
+#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
+
+
+/* Attributes for variadic functions. */
+
+/* The variadic function expects a trailing NULL argument.
+ ATTRIBUTE_SENTINEL () - The last argument is NULL.
+ ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos)
+
+
+/* ================== Attributes for compiler diagnostics ================== */
+
+/* Attributes that help the compiler diagnose programmer mistakes.
+ Some of them may also help for some compiler optimizations. */
+
+/* ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) -
+ The STRING-INDEXth function argument is a format string of style
+ ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT (spec)
+
+/* ATTRIBUTE_NONNULL ((N1, N2,...)) - Arguments N1, N2,... must not be NULL.
+ ATTRIBUTE_NONNULL () - All pointer arguments must not be null. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args)
+
+/* The function's return value is a non-NULL pointer. */
+/* Applies to: functions. */
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
+
+/* Warn if the caller does not use the return value,
+ unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#define NODISCARD _GL_ATTRIBUTE_NODISCARD
+
+
+/* Attributes that disable false alarms when the compiler diagnoses
+ programmer "mistakes". */
+
+/* Do not warn if the entity is not used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* The contents of a character array is not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
+
+/* Do not warn if control flow falls through to the immediately
+ following 'case' or 'default' label. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
+
+
+/* ================== Attributes for debugging information ================== */
+
+/* Attributes regarding debugging information emitted by the compiler. */
+
+/* Omit the function from stack traces when debugging. */
+/* Applies to: function. */
+#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
+
+/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+
+
+/* ========== Attributes that mainly direct compiler optimizations ========== */
+
+/* The function does not throw exceptions. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
+
+/* Do not inline the function. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
+
+/* Always inline the function, and report an error if the compiler
+ cannot inline. */
+/* Applies to: function. */
+#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
+
+/* The function does not affect observable state, and always returns a value.
+ Compilers can omit duplicate calls with the same arguments if
+ observable state is not changed between calls. (This attribute is
+ looser than ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+
+/* The function neither depends on nor affects observable state,
+ and always returns a value. Compilers can omit duplicate calls with
+ the same arguments. (This attribute is stricter than ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+
+/* The function is rarely executed. */
+/* Applies to: functions. */
+#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
+
+/* If called from some other compilation unit, the function executes
+ code from that unit only by return or by exception handling,
+ letting the compiler optimize that unit more aggressively. */
+/* Applies to: functions. */
+#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
+
+/* For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
+
+
+/* ================ Attributes that make invalid code valid ================ */
+
+/* Attributes that prevent fatal compiler optimizations for code that is not
+ fully ISO C compliant. */
+
+/* Pointers to the type may point to the same storage as pointers to
+ other types, thus disabling strict aliasing optimization. */
+/* Applies to: types. */
+#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
+
+
+#endif /* _GL_ATTRIBUTE_H */
diff --git a/gl/lib/canonicalize-lgpl.c b/gl/lib/canonicalize-lgpl.c
index 7d3c710f..9f990988 100644
--- a/gl/lib/canonicalize-lgpl.c
+++ b/gl/lib/canonicalize-lgpl.c
@@ -51,7 +51,7 @@
# define __realpath realpath
# include "pathmax.h"
# include "malloca.h"
-# include "dosname.h"
+# include "filename.h"
# if HAVE_GETCWD
# if IN_RELOCWRAPPER
/* When building the relocatable program wrapper, use the system's getcwd
diff --git a/gl/lib/canonicalize.c b/gl/lib/canonicalize.c
index 67fc76ec..8bb32541 100644
--- a/gl/lib/canonicalize.c
+++ b/gl/lib/canonicalize.c
@@ -30,7 +30,7 @@
#include "pathmax.h"
#include "xalloc.h"
#include "xgetcwd.h"
-#include "dosname.h"
+#include "filename.h"
#define MULTIPLE_BITS_SET(i) (((i) & ((i) - 1)) != 0)
diff --git a/gl/lib/chown.c b/gl/lib/chown.c
index 46e753e0..6a8a76c9 100644
--- a/gl/lib/chown.c
+++ b/gl/lib/chown.c
@@ -87,7 +87,7 @@ rpl_chown (const char *file, uid_t uid, gid_t gid)
on the symlink itself. To work around that, we open the
file (but this can fail due to lack of read or write permission) and
use fchown on the resulting descriptor. */
- int open_flags = O_NONBLOCK | O_NOCTTY;
+ int open_flags = O_NONBLOCK | O_NOCTTY | O_CLOEXEC;
int fd = open (file, O_RDONLY | open_flags);
if (0 <= fd
|| (errno == EACCES
diff --git a/gl/lib/ctype.in.h b/gl/lib/ctype.in.h
new file mode 100644
index 00000000..555677a4
--- /dev/null
+++ b/gl/lib/ctype.in.h
@@ -0,0 +1,57 @@
+/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
+
+ Copyright (C) 2009-2020 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 Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible. */
+
+/*
+ * ISO C 99 <ctype.h> for platforms on which it is incomplete.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <ctype.h>. */
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+#define _@GUARD_PREFIX@_CTYPE_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Return non-zero if c is a blank, i.e. a space or tab character. */
+#if @GNULIB_ISBLANK@
+# if !@HAVE_ISBLANK@
+_GL_EXTERN_C int isblank (int c);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef isblank
+# if HAVE_RAW_DECL_ISBLANK
+_GL_WARN_ON_USE (isblank, "isblank is unportable - "
+ "use gnulib module isblank for portability");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
diff --git a/gl/lib/dirent-private.h b/gl/lib/dirent-private.h
index 4b4eba4e..a3c68443 100644
--- a/gl/lib/dirent-private.h
+++ b/gl/lib/dirent-private.h
@@ -20,6 +20,10 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+/* Don't assume that UNICODE is not defined. */
+#undef WIN32_FIND_DATA
+#define WIN32_FIND_DATA WIN32_FIND_DATAA
+
struct gl_directory
{
/* Status, or error code to produce in next readdir() call.
diff --git a/gl/lib/dirent.in.h b/gl/lib/dirent.in.h
index f7c26810..6fa44f0d 100644
--- a/gl/lib/dirent.in.h
+++ b/gl/lib/dirent.in.h
@@ -57,10 +57,12 @@ typedef struct gl_directory DIR;
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The attribute __pure__ was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
diff --git a/gl/lib/dirname.h b/gl/lib/dirname.h
index 8c12d93b..5379e8e3 100644
--- a/gl/lib/dirname.h
+++ b/gl/lib/dirname.h
@@ -21,7 +21,7 @@
# include <stdbool.h>
# include <stddef.h>
-# include "dosname.h"
+# include "filename.h"
# ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
diff --git a/gl/lib/dosname.h b/gl/lib/dosname.h
deleted file mode 100644
index 57829600..00000000
--- a/gl/lib/dosname.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* File names on MS-DOS/Windows systems.
-
- Copyright (C) 2000-2001, 2004-2006, 2009-2020 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 Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-
- From Paul Eggert and Jim Meyering. */
-
-#ifndef _DOSNAME_H
-#define _DOSNAME_H
-
-#if (defined _WIN32 || defined __CYGWIN__ \
- || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
- /* This internal macro assumes ASCII, but all hosts that support drive
- letters use ASCII. */
-# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
- <= 'z' - 'a')
-# define FILE_SYSTEM_PREFIX_LEN(Filename) \
- (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
-# ifndef __CYGWIN__
-# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
-# endif
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-# define ISSLASH(C) ((C) == '/')
-#endif
-
-#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
-#endif
-
-#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
-# else
-# define IS_ABSOLUTE_FILE_NAME(F) \
- (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
-#endif
-#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
-
-#endif /* DOSNAME_H_ */
diff --git a/gl/lib/error.h b/gl/lib/error.h
index bad47a16..a351606f 100644
--- a/gl/lib/error.h
+++ b/gl/lib/error.h
@@ -19,18 +19,6 @@
#ifndef _ERROR_H
#define _ERROR_H 1
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
/* On mingw, the flavor of printf depends on whether the extensions module
* is in use; the check for <stdio.h> determines the witness macro. */
#ifndef _GL_ATTRIBUTE_SPEC_PRINTF
diff --git a/gl/lib/fchdir.c b/gl/lib/fchdir.c
index c27914bb..20ecd3c1 100644
--- a/gl/lib/fchdir.c
+++ b/gl/lib/fchdir.c
@@ -29,7 +29,7 @@
#include <sys/stat.h>
#include "assure.h"
-#include "dosname.h"
+#include "filename.h"
#include "filenamecat.h"
#ifndef REPLACE_OPEN_DIRECTORY
diff --git a/gl/lib/filename.h b/gl/lib/filename.h
index d4c70203..4598fb1d 100644
--- a/gl/lib/filename.h
+++ b/gl/lib/filename.h
@@ -14,38 +14,94 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* From Paul Eggert and Jim Meyering. */
+
#ifndef _FILENAME_H
#define _FILENAME_H
+#include <string.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-/* Pathname support.
- ISSLASH(C) tests whether C is a directory separator character.
- IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
- it may be concatenated to a directory pathname.
- IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
+/* Filename support.
+ ISSLASH(C) tests whether C is a directory separator
+ character.
+ HAS_DEVICE(Filename) tests whether Filename contains a device
+ specification.
+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
+ at the beginning of Filename,
+ index of the part consisting of
+ alternating components and slashes.
+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ 1 when a non-empty device specification
+ can be followed by an empty or relative
+ part,
+ 0 when a non-empty device specification
+ must be followed by a slash,
+ 0 when device specification don't exist.
+ IS_ABSOLUTE_FILE_NAME(Filename)
+ tests whether Filename is independent of
+ any notion of "current directory".
+ IS_RELATIVE_FILE_NAME(Filename)
+ tests whether Filename may be concatenated
+ to a directory filename.
+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+ relative file name!
+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
+ or directory specification.
*/
-#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
- ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
- && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
-# define IS_PATH_WITH_DIR(P) \
- (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
-# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+ /* Internal macro: Tests whether a character is a drive letter. */
+# define _IS_DRIVE_LETTER(C) \
+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+ /* Help the compiler optimizing it. This assumes ASCII. */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+ /* On native Windows, OS/2, DOS, the system has the notion of a
+ "current directory" on each drive. */
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+ || HAS_DEVICE (Filename))
#else
/* Unix */
# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
-# define FILE_SYSTEM_PREFIX_LEN(P) 0
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
#endif
+/* Deprecated macros. For backward compatibility with old users of the
+ 'filename' module. */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
#ifdef __cplusplus
}
diff --git a/gl/lib/fnmatch.c b/gl/lib/fnmatch.c
index 0338bb3d..3937ce37 100644
--- a/gl/lib/fnmatch.c
+++ b/gl/lib/fnmatch.c
@@ -1,20 +1,22 @@
-/* Copyright (C) 1991-1993, 1996-2007, 2009-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2020 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
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <https://www.gnu.org/licenses/>. */
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
#ifndef _LIBC
-# include <config.h>
+# include <libc-config.h>
#endif
/* Enable GNU extensions in fnmatch.h. */
@@ -24,116 +26,87 @@
#include <fnmatch.h>
-#include <alloca.h>
#include <assert.h>
-#include <ctype.h>
#include <errno.h>
-#include <stddef.h>
-#include <stdbool.h>
-#include <stdlib.h>
+#include <ctype.h>
#include <string.h>
-
-#define WIDE_CHAR_SUPPORT \
- (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \
- && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
-
-/* For platform which support the ISO C amendment 1 functionality we
- support user defined character classes. */
-#if defined _LIBC || WIDE_CHAR_SUPPORT
-# include <wctype.h>
-# include <wchar.h>
+#include <stdlib.h>
+#if defined _LIBC || HAVE_ALLOCA
+# include <alloca.h>
#endif
+#include <wchar.h>
+#include <wctype.h>
+#include <stddef.h>
+#include <stdbool.h>
/* We need some of the locale data (the collation sequence information)
but there is no interface to get this information in general. Therefore
we support a correct implementation only in glibc. */
#ifdef _LIBC
# include "../locale/localeinfo.h"
-# include "../locale/elem-hash.h"
# include "../locale/coll-lookup.h"
# include <shlib-compat.h>
# define CONCAT(a,b) __CONCAT(a,b)
+# define btowc __btowc
+# define iswctype __iswctype
# define mbsrtowcs __mbsrtowcs
+# define mempcpy __mempcpy
+# define strnlen __strnlen
+# define towlower __towlower
+# define wcscat __wcscat
+# define wcslen __wcslen
+# define wctype __wctype
+# define wmemchr __wmemchr
+# define wmempcpy __wmempcpy
# define fnmatch __fnmatch
extern int fnmatch (const char *pattern, const char *string, int flags);
#endif
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
-#include "flexmember.h"
-
-#ifndef FALLTHROUGH
+#ifdef _LIBC
# if __GNUC__ < 7
# define FALLTHROUGH ((void) 0)
# else
# define FALLTHROUGH __attribute__ ((__fallthrough__))
# endif
+#else
+# include "attribute.h"
#endif
+#include <intprops.h>
+#include <flexmember.h>
+
/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */
#define NO_LEADING_PERIOD(flags) \
((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself, and have not detected a bug
- in the library. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand 'configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
-
-
-# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
-# define isblank(c) ((c) == ' ' || (c) == '\t')
+#ifndef _LIBC
+# if HAVE_ALLOCA
+/* The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots. */
+# define __libc_use_alloca(n) ((n) < 4032)
+# else
+/* Just use malloc. */
+# define __libc_use_alloca(n) false
+# undef alloca
+# define alloca(n) malloc (n)
# endif
+# define alloca_account(size, avar) ((avar) += (size), alloca (size))
+#endif
-# define STREQ(s1, s2) (strcmp (s1, s2) == 0)
-
-# if defined _LIBC || WIDE_CHAR_SUPPORT
-/* The GNU C library provides support for user-defined character classes
- and the functions from ISO C amendment 1. */
-# ifdef CHARCLASS_NAME_MAX
-# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
-# else
+/* Provide support for user-defined character classes, based on the functions
+ from ISO C 90 amendment 1. */
+#ifdef CHARCLASS_NAME_MAX
+# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
+#else
/* This shouldn't happen but some implementation might still have this
problem. Use a reasonable default value. */
-# define CHAR_CLASS_MAX_LENGTH 256
-# endif
-
-# ifdef _LIBC
-# define IS_CHAR_CLASS(string) __wctype (string)
-# else
-# define IS_CHAR_CLASS(string) wctype (string)
-# endif
-
-# ifdef _LIBC
-# define ISWCTYPE(WC, WT) __iswctype (WC, WT)
-# else
-# define ISWCTYPE(WC, WT) iswctype (WC, WT)
-# endif
-
-# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC
-/* In this case we are implementing the multibyte character handling. */
-# define HANDLE_MULTIBYTE 1
-# endif
+# define CHAR_CLASS_MAX_LENGTH 256
+#endif
-# else
-# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, 'xdigit'. */
-
-# define IS_CHAR_CLASS(string) \
- (STREQ (string, "alpha") || STREQ (string, "upper") \
- || STREQ (string, "lower") || STREQ (string, "digit") \
- || STREQ (string, "alnum") || STREQ (string, "xdigit") \
- || STREQ (string, "space") || STREQ (string, "print") \
- || STREQ (string, "punct") || STREQ (string, "graph") \
- || STREQ (string, "cntrl") || STREQ (string, "blank"))
-# endif
+#define IS_CHAR_CLASS(string) wctype (string)
/* Avoid depending on library functions or files
whose names are inconsistent. */
@@ -141,68 +114,53 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
/* Global variable. */
static int posixly_correct;
-# ifndef internal_function
-/* Inside GNU libc we mark some function in a special way. In other
- environments simply ignore the marking. */
-# define internal_function
-# endif
-
/* Note that this evaluates C many times. */
-# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
-# define CHAR char
-# define UCHAR unsigned char
-# define INT int
-# define FCT internal_fnmatch
-# define EXT ext_match
-# define END end_pattern
-# define L_(CS) CS
-# ifdef _LIBC
-# define BTOWC(C) __btowc (C)
-# else
-# define BTOWC(C) btowc (C)
-# endif
-# define STRLEN(S) strlen (S)
-# define STRCAT(D, S) strcat (D, S)
-# ifdef _LIBC
-# define MEMPCPY(D, S, N) __mempcpy (D, S, N)
-# else
-# if HAVE_MEMPCPY
-# define MEMPCPY(D, S, N) mempcpy (D, S, N)
-# else
-# define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
-# endif
-# endif
-# define MEMCHR(S, C, N) memchr (S, C, N)
-# include "fnmatch_loop.c"
-
-
-# if HANDLE_MULTIBYTE
-# define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c))
-# define CHAR wchar_t
-# define UCHAR wint_t
-# define INT wint_t
-# define FCT internal_fnwmatch
-# define EXT ext_wmatch
-# define END end_wpattern
-# define L_(CS) L##CS
-# define BTOWC(C) (C)
-# ifdef _LIBC
-# define STRLEN(S) __wcslen (S)
-# define STRCAT(D, S) __wcscat (D, S)
-# define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
-# else
-# define STRLEN(S) wcslen (S)
-# define STRCAT(D, S) wcscat (D, S)
-# if HAVE_WMEMPCPY
-# define MEMPCPY(D, S, N) wmempcpy (D, S, N)
-# else
-# define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N))
-# endif
-# endif
-# define MEMCHR(S, C, N) wmemchr (S, C, N)
-# define WIDE_CHAR_VERSION 1
-
-# undef IS_CHAR_CLASS
+#define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
+#define CHAR char
+#define UCHAR unsigned char
+#define INT int
+#define FCT internal_fnmatch
+#define EXT ext_match
+#define END end_pattern
+#define STRUCT fnmatch_struct
+#define L_(CS) CS
+#define BTOWC(C) btowc (C)
+#define STRLEN(S) strlen (S)
+#define STRCAT(D, S) strcat (D, S)
+#define MEMPCPY(D, S, N) mempcpy (D, S, N)
+#define MEMCHR(S, C, N) memchr (S, C, N)
+#define WIDE_CHAR_VERSION 0
+#ifdef _LIBC
+# include <locale/weight.h>
+# define FINDIDX findidx
+#endif
+#include "fnmatch_loop.c"
+
+
+#define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c))
+#define CHAR wchar_t
+#define UCHAR wint_t
+#define INT wint_t
+#define FCT internal_fnwmatch
+#define EXT ext_wmatch
+#define END end_wpattern
+#define L_(CS) L##CS
+#define BTOWC(C) (C)
+#define STRLEN(S) wcslen (S)
+#define STRCAT(D, S) wcscat (D, S)
+#define MEMPCPY(D, S, N) wmempcpy (D, S, N)
+#define MEMCHR(S, C, N) wmemchr (S, C, N)
+#define WIDE_CHAR_VERSION 1
+#ifdef _LIBC
+/* Change the name the header defines so it doesn't conflict with
+ the <locale/weight.h> version included above. */
+# define findidx findidxwc
+# include <locale/weightwc.h>
+# undef findidx
+# define FINDIDX findidxwc
+#endif
+
+#undef IS_CHAR_CLASS
/* We have to convert the wide character string in a multibyte string. But
we know that the character class names consist of alphanumeric characters
from the portable character set, and since the wide character encoding
@@ -218,11 +176,11 @@ is_char_class (const wchar_t *wcs)
do
{
/* Test for a printable character from the portable character set. */
-# ifdef _LIBC
+#ifdef _LIBC
if (*wcs < 0x20 || *wcs > 0x7e
|| *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60)
return (wctype_t) 0;
-# else
+#else
switch (*wcs)
{
case L' ': case L'!': case L'"': case L'#': case L'%':
@@ -249,7 +207,7 @@ is_char_class (const wchar_t *wcs)
default:
return (wctype_t) 0;
}
-# endif
+#endif
/* Avoid overrunning the buffer. */
if (cp == s + CHAR_CLASS_MAX_LENGTH)
@@ -261,96 +219,137 @@ is_char_class (const wchar_t *wcs)
*cp = '\0';
-# ifdef _LIBC
- return __wctype (s);
-# else
return wctype (s);
-# endif
}
-# define IS_CHAR_CLASS(string) is_char_class (string)
+#define IS_CHAR_CLASS(string) is_char_class (string)
-# include "fnmatch_loop.c"
-# endif
+#include "fnmatch_loop.c"
int
fnmatch (const char *pattern, const char *string, int flags)
{
-# if HANDLE_MULTIBYTE
-# define ALLOCA_LIMIT 2000
- if (__builtin_expect (MB_CUR_MAX, 1) != 1)
+ if (__glibc_unlikely (MB_CUR_MAX != 1))
{
mbstate_t ps;
- size_t patsize;
- size_t strsize;
- size_t totsize;
+ size_t n;
+ const char *p;
+ wchar_t *wpattern_malloc = NULL;
wchar_t *wpattern;
+ wchar_t *wstring_malloc = NULL;
wchar_t *wstring;
- int res;
+ size_t alloca_used = 0;
- /* Calculate the size needed to convert the strings to
- wide characters. */
+ /* Convert the strings into wide characters. */
memset (&ps, '\0', sizeof (ps));
- patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1;
- if (__builtin_expect (patsize != 0, 1))
+ p = pattern;
+ n = strnlen (pattern, 1024);
+ if (__glibc_likely (n < 1024))
+ {
+ wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+ alloca_used);
+ n = mbsrtowcs (wpattern, &p, n + 1, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ return -1;
+ if (p)
+ {
+ memset (&ps, '\0', sizeof (ps));
+ goto prepare_wpattern;
+ }
+ }
+ else
{
+ prepare_wpattern:
+ n = mbsrtowcs (NULL, &pattern, 0, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ return -1;
+ if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
+ {
+ __set_errno (ENOMEM);
+ return -2;
+ }
+ wpattern_malloc = wpattern
+ = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
assert (mbsinit (&ps));
- strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1;
- if (__builtin_expect (strsize != 0, 1))
+ if (wpattern == NULL)
+ return -2;
+ (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
+ }
+
+ assert (mbsinit (&ps));
+ n = strnlen (string, 1024);
+ p = string;
+ if (__glibc_likely (n < 1024))
+ {
+ wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+ alloca_used);
+ n = mbsrtowcs (wstring, &p, n + 1, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ {
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which
+ mbsrtows hasn't already done? */
+ free_return:
+ free (wpattern_malloc);
+ return -1;
+ }
+ if (p)
{
- assert (mbsinit (&ps));
- totsize = patsize + strsize;
- if (__builtin_expect (! (patsize <= totsize
- && totsize <= SIZE_MAX / sizeof (wchar_t)),
- 0))
- {
- errno = ENOMEM;
- return -1;
- }
-
- /* Allocate room for the wide characters. */
- if (__builtin_expect (totsize < ALLOCA_LIMIT, 1))
- wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t));
- else
- {
- wpattern = malloc (totsize * sizeof (wchar_t));
- if (__builtin_expect (! wpattern, 0))
- {
- errno = ENOMEM;
- return -1;
- }
- }
- wstring = wpattern + patsize;
-
- /* Convert the strings into wide characters. */
- mbsrtowcs (wpattern, &pattern, patsize, &ps);
- assert (mbsinit (&ps));
- mbsrtowcs (wstring, &string, strsize, &ps);
-
- res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1,
- flags & FNM_PERIOD, flags);
-
- if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0))
- free (wpattern);
- return res;
+ memset (&ps, '\0', sizeof (ps));
+ goto prepare_wstring;
}
}
- }
+ else
+ {
+ prepare_wstring:
+ n = mbsrtowcs (NULL, &string, 0, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ goto free_return;
+ if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
+ {
+ free (wpattern_malloc);
+ __set_errno (ENOMEM);
+ return -2;
+ }
+
+ wstring_malloc = wstring
+ = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+ if (wstring == NULL)
+ {
+ free (wpattern_malloc);
+ return -2;
+ }
+ assert (mbsinit (&ps));
+ (void) mbsrtowcs (wstring, &string, n + 1, &ps);
+ }
+
+ int res = internal_fnwmatch (wpattern, wstring, wstring + n,
+ flags & FNM_PERIOD, flags, NULL,
+ alloca_used);
+
+ free (wstring_malloc);
+ free (wpattern_malloc);
-# endif /* HANDLE_MULTIBYTE */
+ return res;
+ }
return internal_fnmatch (pattern, string, string + strlen (string),
- flags & FNM_PERIOD, flags);
+ flags & FNM_PERIOD, flags, NULL, 0);
}
-# ifdef _LIBC
-# undef fnmatch
+#undef fnmatch
versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3)
strong_alias (__fnmatch, __fnmatch_old)
compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
-# endif
+#endif
libc_hidden_ver (__fnmatch, fnmatch)
-# endif
-
-#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/gl/lib/fnmatch_loop.c b/gl/lib/fnmatch_loop.c
index 50064abd..ebd6af36 100644
--- a/gl/lib/fnmatch_loop.c
+++ b/gl/lib/fnmatch_loop.c
@@ -1,33 +1,47 @@
-/* Copyright (C) 1991-1993, 1996-2006, 2009-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2020 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
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <https://www.gnu.org/licenses/>. */
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# include <stdint.h>
+#endif
+
+struct STRUCT
+{
+ const CHAR *pattern;
+ const CHAR *string;
+ bool no_leading_period;
+};
/* Match STRING against the file name pattern PATTERN, returning zero if
it matches, nonzero if not. */
+static int FCT (const CHAR *pattern, const CHAR *string,
+ const CHAR *string_end, bool no_leading_period, int flags,
+ struct STRUCT *ends, size_t alloca_used);
static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
- const CHAR *string_end, bool no_leading_period, int flags)
- internal_function;
-static const CHAR *END (const CHAR *patternp) internal_function;
+ const CHAR *string_end, bool no_leading_period, int flags,
+ size_t alloca_used);
+static const CHAR *END (const CHAR *patternp);
static int
-internal_function
FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
- bool no_leading_period, int flags)
+ bool no_leading_period, int flags, struct STRUCT *ends, size_t alloca_used)
{
- register const CHAR *p = pattern, *n = string;
- register UCHAR c;
+ const CHAR *p = pattern, *n = string;
+ UCHAR c;
#ifdef _LIBC
# if WIDE_CHAR_VERSION
const char *collseq = (const char *)
@@ -46,12 +60,10 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
switch (c)
{
case L_('?'):
- if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
{
- int res;
-
- res = EXT (c, p, n, string_end, no_leading_period,
- flags);
+ int res = EXT (c, p, n, string_end, no_leading_period,
+ flags, alloca_used);
if (res != -1)
return res;
}
@@ -78,15 +90,20 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
break;
case L_('*'):
- if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
{
- int res;
-
- res = EXT (c, p, n, string_end, no_leading_period,
- flags);
+ int res = EXT (c, p, n, string_end, no_leading_period,
+ flags, alloca_used);
if (res != -1)
return res;
}
+ else if (ends != NULL)
+ {
+ ends->pattern = p - 1;
+ ends->string = n;
+ ends->no_leading_period = no_leading_period;
+ return 0;
+ }
if (n != string_end && *n == L_('.') && no_leading_period)
return FNM_NOMATCH;
@@ -111,7 +128,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* There isn't another character; no match. */
return FNM_NOMATCH;
else if (*n == L_('/')
- && __builtin_expect (flags & FNM_FILE_NAME, 0))
+ && __glibc_unlikely (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under
FNM_FILE_NAME. */
return FNM_NOMATCH;
@@ -147,49 +164,61 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
else
{
const CHAR *endp;
+ struct STRUCT end;
+ end.pattern = NULL;
endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'),
string_end - n);
if (endp == NULL)
endp = string_end;
if (c == L_('[')
- || (__builtin_expect (flags & FNM_EXTMATCH, 0) != 0
+ || (__glibc_unlikely (flags & FNM_EXTMATCH)
&& (c == L_('@') || c == L_('+') || c == L_('!'))
&& *p == L_('(')))
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
- bool no_leading_period2 = no_leading_period;
- for (--p; n < endp; ++n, no_leading_period2 = false)
- if (FCT (p, n, string_end, no_leading_period2, flags2)
- == 0)
- return 0;
+ for (--p; n < endp; ++n, no_leading_period = false)
+ if (FCT (p, n, string_end, no_leading_period, flags2,
+ &end, alloca_used) == 0)
+ goto found;
}
else if (c == L_('/') && (flags & FNM_FILE_NAME))
{
while (n < string_end && *n != L_('/'))
++n;
if (n < string_end && *n == L_('/')
- && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags)
- == 0))
+ && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
+ NULL, alloca_used) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
- int no_leading_period2 = no_leading_period;
if (c == L_('\\') && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
- for (--p; n < endp; ++n, no_leading_period2 = false)
+ for (--p; n < endp; ++n, no_leading_period = false)
if (FOLD ((UCHAR) *n) == c
- && (FCT (p, n, string_end, no_leading_period2, flags2)
- == 0))
- return 0;
+ && (FCT (p, n, string_end, no_leading_period, flags2,
+ &end, alloca_used) == 0))
+ {
+ found:
+ if (end.pattern == NULL)
+ return 0;
+ break;
+ }
+ if (end.pattern != NULL)
+ {
+ p = end.pattern;
+ n = end.string;
+ no_leading_period = end.no_leading_period;
+ continue;
+ }
}
}
@@ -201,7 +230,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* Nonzero if the sense of the character class is inverted. */
const CHAR *p_init = p;
const CHAR *n_init = n;
- register bool not;
+ bool not;
CHAR cold;
UCHAR fn;
@@ -227,8 +256,6 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
c = *p++;
for (;;)
{
- bool is_range = false;
-
if (!(flags & FNM_NOESCAPE) && c == L_('\\'))
{
if (*p == L_('\0'))
@@ -243,9 +270,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* Leave room for the null. */
CHAR str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
-#if defined _LIBC || WIDE_CHAR_SUPPORT
wctype_t wt;
-#endif
const CHAR *startp = p;
for (;;)
@@ -273,35 +298,19 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
}
str[c1] = L_('\0');
-#if defined _LIBC || WIDE_CHAR_SUPPORT
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
-# if defined _LIBC && ! WIDE_CHAR_VERSION
+#if defined _LIBC && ! WIDE_CHAR_VERSION
/* The following code is glibc specific but does
there a good job in speeding up the code since
we can avoid the btowc() call. */
if (_ISCTYPE ((UCHAR) *n, wt))
goto matched;
-# else
- if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
- goto matched;
-# endif
#else
- if ((STREQ (str, L_("alnum")) && isalnum ((UCHAR) *n))
- || (STREQ (str, L_("alpha")) && isalpha ((UCHAR) *n))
- || (STREQ (str, L_("blank")) && isblank ((UCHAR) *n))
- || (STREQ (str, L_("cntrl")) && iscntrl ((UCHAR) *n))
- || (STREQ (str, L_("digit")) && isdigit ((UCHAR) *n))
- || (STREQ (str, L_("graph")) && isgraph ((UCHAR) *n))
- || (STREQ (str, L_("lower")) && islower ((UCHAR) *n))
- || (STREQ (str, L_("print")) && isprint ((UCHAR) *n))
- || (STREQ (str, L_("punct")) && ispunct ((UCHAR) *n))
- || (STREQ (str, L_("space")) && isspace ((UCHAR) *n))
- || (STREQ (str, L_("upper")) && isupper ((UCHAR) *n))
- || (STREQ (str, L_("xdigit")) && isxdigit ((UCHAR) *n)))
+ if (iswctype (BTOWC ((UCHAR) *n), wt))
goto matched;
#endif
c = *p++;
@@ -309,7 +318,12 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
#ifdef _LIBC
else if (c == L_('[') && *p == L_('='))
{
- UCHAR str[1];
+ /* It's important that STR be a scalar variable rather
+ than a one-element array, because GCC (at least 4.9.2
+ -O2 on x86-64) can be confused by the array and
+ diagnose a "used initialized" in a dead branch in the
+ findidx function. */
+ UCHAR str;
uint32_t nrules =
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
const CHAR *startp = p;
@@ -321,7 +335,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
c = L_('[');
goto normal_bracket;
}
- str[0] = c;
+ str = c;
c = *++p;
if (c != L_('=') || p[1] != L_(']'))
@@ -334,7 +348,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
if (nrules == 0)
{
- if ((UCHAR) *n == str[0])
+ if ((UCHAR) *n == str)
goto matched;
}
else
@@ -342,28 +356,21 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
const int32_t *table;
# if WIDE_CHAR_VERSION
const int32_t *weights;
- const int32_t *extra;
+ const wint_t *extra;
# else
const unsigned char *weights;
const unsigned char *extra;
# endif
const int32_t *indirect;
int32_t idx;
- const UCHAR *cp = (const UCHAR *) str;
-
- /* This #include defines a local function! */
-# if WIDE_CHAR_VERSION
-# include <locale/weightwc.h>
-# else
-# include <locale/weight.h>
-# endif
+ const UCHAR *cp = (const UCHAR *) &str;
# if WIDE_CHAR_VERSION
table = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC);
weights = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC);
- extra = (const int32_t *)
+ extra = (const wint_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC);
indirect = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC);
@@ -378,7 +385,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
# endif
- idx = findidx (&cp);
+ idx = FINDIDX (table, indirect, extra, &cp, 1);
if (idx != 0)
{
/* We found a table entry. Now see whether the
@@ -388,7 +395,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
int32_t idx2;
const UCHAR *np = (const UCHAR *) n;
- idx2 = findidx (&np);
+ idx2 = FINDIDX (table, indirect, extra,
+ &np, string_end - n);
if (idx2 != 0
&& (idx >> 24) == (idx2 >> 24)
&& len == weights[idx2 & 0xffffff])
@@ -422,6 +430,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
}
else
{
+ bool is_range = false;
+
#ifdef _LIBC
bool is_seqval = false;
@@ -468,25 +478,11 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
{
int32_t table_size;
const int32_t *symb_table;
-# ifdef WIDE_CHAR_VERSION
- char str[c1];
- size_t strcnt;
-# else
-# define str (startp + 1)
-# endif
const unsigned char *extra;
int32_t idx;
int32_t elem;
- int32_t second;
- int32_t hash;
-
-# ifdef WIDE_CHAR_VERSION
- /* We have to convert the name to a single-byte
- string. This is possible since the names
- consist of ASCII characters and the internal
- representation is UCS4. */
- for (strcnt = 0; strcnt < c1; ++strcnt)
- str[strcnt] = startp[1 + strcnt];
+# if WIDE_CHAR_VERSION
+ CHAR *wextra;
# endif
table_size =
@@ -499,81 +495,65 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_EXTRAMB);
- /* Locate the character in the hashing table. */
- hash = elem_hash (str, c1);
-
- idx = 0;
- elem = hash % table_size;
- if (symb_table[2 * elem] != 0)
- {
- second = hash % (table_size - 2) + 1;
-
- do
- {
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- && (c1
- == extra[symb_table[2 * elem + 1]])
- && memcmp (str,
- &extra[symb_table[2 * elem
- + 1]
- + 1], c1) == 0)
- {
- /* Yep, this is the entry. */
- idx = symb_table[2 * elem + 1];
- idx += 1 + extra[idx];
- break;
- }
-
- /* Next entry. */
- elem += second;
- }
- while (symb_table[2 * elem] != 0);
- }
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element. */
+ idx += 1 + extra[idx];
+# if WIDE_CHAR_VERSION
+ /* Skip the byte sequence of the
+ collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+
+ wextra = (CHAR *) &extra[idx + 4];
+
+ if (/* Compare the length of the sequence. */
+ c1 == wextra[0]
+ /* Compare the wide char sequence. */
+ && (__wmemcmp (startp + 1, &wextra[1],
+ c1)
+ == 0))
+ /* Yep, this is the entry. */
+ break;
+# else
+ if (/* Compare the length of the sequence. */
+ c1 == extra[idx]
+ /* Compare the byte sequence. */
+ && memcmp (startp + 1,
+ &extra[idx + 1], c1) == 0)
+ /* Yep, this is the entry. */
+ break;
+# endif
+ }
- if (symb_table[2 * elem] != 0)
+ if (elem < table_size)
{
/* Compare the byte sequence but only if
this is not part of a range. */
-# ifdef WIDE_CHAR_VERSION
- int32_t *wextra;
+ if (! is_range
- idx += 1 + extra[idx];
- /* Adjust for the alignment. */
- idx = (idx + 3) & ~3;
-
- wextra = (int32_t *) &extra[idx + 4];
-# endif
-
- if (! is_range)
- {
-# ifdef WIDE_CHAR_VERSION
- for (c1 = 0;
- (int32_t) c1 < wextra[idx];
- ++c1)
- if (n[c1] != wextra[1 + c1])
- break;
-
- if ((int32_t) c1 == wextra[idx])
- goto matched;
+# if WIDE_CHAR_VERSION
+ && __wmemcmp (n, &wextra[1], c1) == 0
# else
- for (c1 = 0; c1 < extra[idx]; ++c1)
- if (n[c1] != extra[1 + c1])
- break;
-
- if (c1 == extra[idx])
- goto matched;
+ && memcmp (n, &extra[idx + 1], c1) == 0
# endif
+ )
+ {
+ n += c1 - 1;
+ goto matched;
}
/* Get the collation sequence value. */
is_seqval = true;
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
cold = wextra[1 + wextra[idx]];
# else
- /* Adjust for the alignment. */
idx += 1 + extra[idx];
- idx = (idx + 3) & ~4;
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
cold = *((int32_t *) &extra[idx]);
# endif
@@ -583,10 +563,10 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
{
/* No valid character. Match it as a
single byte. */
- if (!is_range && *n == str[0])
+ if (!is_range && *n == startp[1])
goto matched;
- cold = str[0];
+ cold = startp[1];
c = *p++;
}
else
@@ -594,7 +574,6 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
}
}
else
-# undef str
#endif
{
c = FOLD (c);
@@ -614,7 +593,6 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
outside of is_seqval's scope. */
is_seqval = false;
#endif
-
cold = c;
c = *p++;
}
@@ -634,7 +612,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
uint32_t lcollseq;
UCHAR cend = *p++;
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
/* Search in the 'names' array for the characters. */
fcollseq = __collseq_table_lookup (collseq, fn);
if (fcollseq == ~((uint32_t) 0))
@@ -689,25 +667,11 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
{
int32_t table_size;
const int32_t *symb_table;
-# ifdef WIDE_CHAR_VERSION
- char str[c1];
- size_t strcnt;
-# else
-# define str (startp + 1)
-# endif
const unsigned char *extra;
int32_t idx;
int32_t elem;
- int32_t second;
- int32_t hash;
-
-# ifdef WIDE_CHAR_VERSION
- /* We have to convert the name to a single-byte
- string. This is possible since the names
- consist of ASCII characters and the internal
- representation is UCS4. */
- for (strcnt = 0; strcnt < c1; ++strcnt)
- str[strcnt] = startp[1 + strcnt];
+# if WIDE_CHAR_VERSION
+ CHAR *wextra;
# endif
table_size =
@@ -720,71 +684,64 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_EXTRAMB);
- /* Locate the character in the hashing
- table. */
- hash = elem_hash (str, c1);
-
- idx = 0;
- elem = hash % table_size;
- if (symb_table[2 * elem] != 0)
- {
- second = hash % (table_size - 2) + 1;
-
- do
- {
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- && (c1
- == extra[symb_table[2 * elem + 1]])
- && memcmp (str,
- &extra[symb_table[2 * elem + 1]
- + 1], c1) == 0)
- {
- /* Yep, this is the entry. */
- idx = symb_table[2 * elem + 1];
- idx += 1 + extra[idx];
- break;
- }
-
- /* Next entry. */
- elem += second;
- }
- while (symb_table[2 * elem] != 0);
- }
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating
+ element. */
+ idx += 1 + extra[idx];
+# if WIDE_CHAR_VERSION
+ /* Skip the byte sequence of the
+ collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+
+ wextra = (CHAR *) &extra[idx + 4];
+
+ if (/* Compare the length of the
+ sequence. */
+ c1 == wextra[0]
+ /* Compare the wide char sequence. */
+ && (__wmemcmp (startp + 1,
+ &wextra[1], c1)
+ == 0))
+ /* Yep, this is the entry. */
+ break;
+# else
+ if (/* Compare the length of the
+ sequence. */
+ c1 == extra[idx]
+ /* Compare the byte sequence. */
+ && memcmp (startp + 1,
+ &extra[idx + 1], c1) == 0)
+ /* Yep, this is the entry. */
+ break;
+# endif
+ }
- if (symb_table[2 * elem] != 0)
+ if (elem < table_size)
{
- /* Compare the byte sequence but only if
- this is not part of a range. */
-# ifdef WIDE_CHAR_VERSION
- int32_t *wextra;
-
- idx += 1 + extra[idx];
- /* Adjust for the alignment. */
- idx = (idx + 3) & ~4;
-
- wextra = (int32_t *) &extra[idx + 4];
-# endif
/* Get the collation sequence value. */
is_seqval = true;
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
cend = wextra[1 + wextra[idx]];
# else
- /* Adjust for the alignment. */
idx += 1 + extra[idx];
- idx = (idx + 3) & ~4;
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
cend = *((int32_t *) &extra[idx]);
# endif
}
- else if (symb_table[2 * elem] != 0 && c1 == 1)
+ else if (c1 == 1)
{
- cend = str[0];
+ cend = startp[1];
c = *p++;
}
else
return FNM_NOMATCH;
}
-# undef str
}
else
{
@@ -799,7 +756,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
characters which are not mentioned in the
collation specification. */
if (
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
lcollseq == 0xffffffff ||
# endif
lcollseq <= fcollseq)
@@ -811,7 +768,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
hcollseq = cend;
else
{
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
hcollseq =
__collseq_table_lookup (collseq, cend);
if (hcollseq == ~((uint32_t) 0))
@@ -832,7 +789,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
if (lcollseq <= hcollseq && fcollseq <= hcollseq)
goto matched;
}
-# ifdef WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
range_not_matched:
# endif
#else
@@ -848,7 +805,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
return FNM_NOMATCH;
/* It is a range. */
- if (cold <= fn && fn <= cend)
+ if ((UCHAR) cold <= fn && fn <= cend)
goto matched;
#endif
@@ -866,11 +823,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
matched:
/* Skip the rest of the [...] that already matched. */
- do
+ while ((c = *p++) != L_(']'))
{
- ignore_next:
- c = *p++;
-
if (c == L_('\0'))
/* [... (unterminated) loses. */
return FNM_NOMATCH;
@@ -898,12 +852,11 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
if (c < L_('a') || c >= L_('z'))
{
- p = startp;
- goto ignore_next;
+ p = startp - 2;
+ break;
}
}
p += 2;
- c = *p++;
}
else if (c == L_('[') && *p == L_('='))
{
@@ -914,25 +867,21 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
if (c != L_('=') || p[1] != L_(']'))
return FNM_NOMATCH;
p += 2;
- c = *p++;
}
else if (c == L_('[') && *p == L_('.'))
{
- ++p;
while (1)
{
c = *++p;
- if (c == '\0')
+ if (c == L_('\0'))
return FNM_NOMATCH;
- if (*p == L_('.') && p[1] == L_(']'))
+ if (c == L_('.') && p[1] == L_(']'))
break;
}
p += 2;
- c = *p++;
}
}
- while (c != L_(']'));
if (not)
return FNM_NOMATCH;
}
@@ -941,11 +890,10 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
case L_('+'):
case L_('@'):
case L_('!'):
- if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
{
- int res;
-
- res = EXT (c, p, n, string_end, no_leading_period, flags);
+ int res = EXT (c, p, n, string_end, no_leading_period, flags,
+ alloca_used);
if (res != -1)
return res;
}
@@ -983,7 +931,6 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
static const CHAR *
-internal_function
END (const CHAR *pattern)
{
const CHAR *p = pattern;
@@ -1013,7 +960,12 @@ END (const CHAR *pattern)
}
else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@')
|| *p == L_('!')) && p[1] == L_('('))
- p = END (p + 1);
+ {
+ p = END (p + 1);
+ if (*p == L_('\0'))
+ /* This is an invalid pattern. */
+ return pattern;
+ }
else if (*p == L_(')'))
break;
@@ -1022,29 +974,33 @@ END (const CHAR *pattern)
static int
-internal_function
EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
- bool no_leading_period, int flags)
+ bool no_leading_period, int flags, size_t alloca_used)
{
const CHAR *startp;
size_t level;
struct patternlist
{
struct patternlist *next;
+ CHAR malloced;
CHAR str[FLEXIBLE_ARRAY_MEMBER];
} *list = NULL;
struct patternlist **lastp = &list;
size_t pattern_len = STRLEN (pattern);
+ bool any_malloced = false;
const CHAR *p;
const CHAR *rs;
- enum { ALLOCA_LIMIT = 8000 };
+ int retval = 0;
/* Parse the pattern. Store the individual parts in the list. */
level = 0;
for (startp = p = pattern + 1; ; ++p)
if (*p == L_('\0'))
- /* This is an invalid pattern. */
- return -1;
+ {
+ /* This is an invalid pattern. */
+ retval = -1;
+ goto out;
+ }
else if (*p == L_('['))
{
/* Handle brackets special. */
@@ -1061,8 +1017,11 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* Skip over all characters of the list. */
while (*p != L_(']'))
if (*p++ == L_('\0'))
- /* This is no valid pattern. */
- return -1;
+ {
+ /* This is no valid pattern. */
+ retval = -1;
+ goto out;
+ }
}
else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@')
|| *p == L_('!')) && p[1] == L_('('))
@@ -1075,22 +1034,34 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* This means we found the end of the pattern. */
#define NEW_PATTERN \
struct patternlist *newp; \
- size_t plen; \
- size_t plensize; \
- size_t newpsize; \
- \
- plen = (opt == L_('?') || opt == L_('@') \
- ? pattern_len \
- : p - startp + 1UL); \
- plensize = plen * sizeof (CHAR); \
- newpsize = FLEXSIZEOF (struct patternlist, str, plensize); \
- if ((size_t) -1 / sizeof (CHAR) < plen \
- || newpsize < offsetof (struct patternlist, str) \
- || ALLOCA_LIMIT <= newpsize) \
- return -1; \
- newp = (struct patternlist *) alloca (newpsize); \
- *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \
+ size_t plen = (opt == L_('?') || opt == L_('@') \
+ ? pattern_len : (p - startp + 1UL)); \
+ ptrdiff_t slen = FLEXSIZEOF (struct patternlist, str, 0); \
+ ptrdiff_t new_used = alloca_used + slen; \
+ ptrdiff_t plensize; \
+ if (INT_MULTIPLY_WRAPV (plen, sizeof (CHAR), &plensize) \
+ || INT_ADD_WRAPV (new_used, plensize, &new_used)) \
+ { \
+ retval = -2; \
+ goto out; \
+ } \
+ slen += plensize; \
+ bool malloced = ! __libc_use_alloca (new_used); \
+ if (__glibc_unlikely (malloced)) \
+ { \
+ newp = malloc (slen); \
+ if (newp == NULL) \
+ { \
+ retval = -2; \
+ goto out; \
+ } \
+ any_malloced = true; \
+ } \
+ else \
+ newp = alloca_account (slen, alloca_used); \
newp->next = NULL; \
+ newp->malloced = malloced; \
+ *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \
*lastp = newp; \
lastp = &newp->next
NEW_PATTERN;
@@ -1112,8 +1083,9 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
switch (opt)
{
case L_('*'):
- if (FCT (p, string, string_end, no_leading_period, flags) == 0)
- return 0;
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+ alloca_used) == 0)
+ goto success;
FALLTHROUGH;
case L_('+'):
do
@@ -1122,7 +1094,8 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* First match the prefix with the current pattern with the
current pattern. */
if (FCT (list->str, string, rs, no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0
/* This was successful. Now match the rest with the rest
of the pattern. */
&& (FCT (p, rs, string_end,
@@ -1130,7 +1103,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags),
flags & FNM_FILE_NAME
- ? flags : flags & ~FNM_PERIOD) == 0
+ ? flags : flags & ~FNM_PERIOD, NULL, alloca_used) == 0
/* This didn't work. Try the whole pattern. */
|| (rs != string
&& FCT (pattern - 1, rs, string_end,
@@ -1138,18 +1111,21 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags),
flags & FNM_FILE_NAME
- ? flags : flags & ~FNM_PERIOD) == 0)))
+ ? flags : flags & ~FNM_PERIOD, NULL,
+ alloca_used) == 0)))
/* It worked. Signal success. */
- return 0;
+ goto success;
}
while ((list = list->next) != NULL);
/* None of the patterns lead to a match. */
- return FNM_NOMATCH;
+ retval = FNM_NOMATCH;
+ break;
case L_('?'):
- if (FCT (p, string, string_end, no_leading_period, flags) == 0)
- return 0;
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+ alloca_used) == 0)
+ goto success;
FALLTHROUGH;
case L_('@'):
do
@@ -1159,13 +1135,15 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
pattern list. */
if (FCT (STRCAT (list->str, p), string, string_end,
no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0)
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0)
/* It worked. Signal success. */
- return 0;
+ goto success;
while ((list = list->next) != NULL);
/* None of the patterns lead to a match. */
- return FNM_NOMATCH;
+ retval = FNM_NOMATCH;
+ break;
case L_('!'):
for (rs = string; rs <= string_end; ++rs)
@@ -1174,7 +1152,8 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
for (runp = list; runp != NULL; runp = runp->next)
if (FCT (runp->str, string, rs, no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0)
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0)
break;
/* If none of the patterns matched see whether the rest does. */
@@ -1183,22 +1162,35 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
rs == string
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags),
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD)
- == 0))
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0))
/* This is successful. */
- return 0;
+ goto success;
}
/* None of the patterns together with the rest of the pattern
lead to a match. */
- return FNM_NOMATCH;
+ retval = FNM_NOMATCH;
+ break;
default:
assert (! "Invalid extended matching operator");
+ retval = -1;
break;
}
- return -1;
+ success:
+ out:
+ if (any_malloced)
+ while (list != NULL)
+ {
+ struct patternlist *old = list;
+ list = list->next;
+ if (old->malloced)
+ free (old);
+ }
+
+ return retval;
}
@@ -1209,9 +1201,12 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
#undef FCT
#undef EXT
#undef END
+#undef STRUCT
#undef MEMPCPY
#undef MEMCHR
#undef STRLEN
#undef STRCAT
#undef L_
#undef BTOWC
+#undef WIDE_CHAR_VERSION
+#undef FINDIDX
diff --git a/gl/lib/getlogin_r.c b/gl/lib/getlogin_r.c
index 799ffa42..a461112c 100644
--- a/gl/lib/getlogin_r.c
+++ b/gl/lib/getlogin_r.c
@@ -30,6 +30,9 @@
#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Don't assume that UNICODE is not defined. */
+# undef GetUserName
+# define GetUserName GetUserNameA
#else
# if !HAVE_DECL_GETLOGIN
extern char *getlogin (void);
diff --git a/gl/lib/getopt-pfx-core.h b/gl/lib/getopt-pfx-core.h
index da0a6d0c..ec545c1b 100644
--- a/gl/lib/getopt-pfx-core.h
+++ b/gl/lib/getopt-pfx-core.h
@@ -48,6 +48,14 @@
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
+/* Work around a a problem on macOS, which declares getopt with a
+ trailing __DARWIN_ALIAS(getopt) that would expand to something like
+ __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
+ hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
+# ifdef __APPLE__
+# define _GETOPT
+# endif
+
/* The system's getopt.h may have already included getopt-core.h to
declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that
getopt-core.h declares them with prefixes. */
diff --git a/gl/lib/getprogname.c b/gl/lib/getprogname.c
index 9f69f5a5..b9667ff7 100644
--- a/gl/lib/getprogname.c
+++ b/gl/lib/getprogname.c
@@ -223,7 +223,7 @@ getprogname (void)
int fd;
sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
- fd = open (filename, O_RDONLY);
+ fd = open (filename, O_RDONLY | O_CLOEXEC);
if (0 <= fd)
{
prpsinfo_t buf;
diff --git a/gl/lib/gettimeofday.c b/gl/lib/gettimeofday.c
index b63f8f29..057cebdb 100644
--- a/gl/lib/gettimeofday.c
+++ b/gl/lib/gettimeofday.c
@@ -33,9 +33,15 @@
#ifdef WINDOWS_NATIVE
+/* Don't assume that UNICODE is not defined. */
+# undef LoadLibrary
+# define LoadLibrary LoadLibraryA
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+
/* Avoid warnings from gcc -Wcast-function-type. */
-# define GetProcAddress \
- (void *) GetProcAddress
+# define GetProcAddress \
+ (void *) GetProcAddress
/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */
typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
@@ -54,6 +60,12 @@ initialize (void)
initialized = TRUE;
}
+# else
+
+# define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime
+
+# endif
+
#endif
/* This is a wrapper for gettimeofday. It is used only on systems
@@ -84,8 +96,10 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
<http://www.windowstimestamp.com/description>. */
FILETIME current_time;
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
if (!initialized)
initialize ();
+# endif
if (GetSystemTimePreciseAsFileTimeFunc != NULL)
GetSystemTimePreciseAsFileTimeFunc (&current_time);
else
diff --git a/gl/lib/gl_anylinked_list2.h b/gl/lib/gl_anylinked_list2.h
index 114106c7..3e01f8fa 100644
--- a/gl/lib/gl_anylinked_list2.h
+++ b/gl/lib/gl_anylinked_list2.h
@@ -76,11 +76,11 @@ gl_linked_nx_create_empty (gl_list_implementation_t implementation,
static gl_list_t
gl_linked_nx_create (gl_list_implementation_t implementation,
- gl_listelement_equals_fn equals_fn,
- gl_listelement_hashcode_fn hashcode_fn,
- gl_listelement_dispose_fn dispose_fn,
- bool allow_duplicates,
- size_t count, const void **contents)
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
{
struct gl_list_impl *list =
(struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
@@ -170,13 +170,15 @@ gl_linked_size (gl_list_t list)
}
static const void * _GL_ATTRIBUTE_PURE
-gl_linked_node_value (gl_list_t list, gl_list_node_t node)
+gl_linked_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
return node->value;
}
static int
-gl_linked_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+gl_linked_node_nx_set_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node,
const void *elt)
{
#if WITH_HASHTABLE
@@ -1021,7 +1023,7 @@ gl_linked_iterator_next (gl_list_iterator_t *iterator,
}
static void
-gl_linked_iterator_free (gl_list_iterator_t *iterator)
+gl_linked_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
diff --git a/gl/lib/gl_anytree_list2.h b/gl/lib/gl_anytree_list2.h
index c5a67dbd..939b7974 100644
--- a/gl/lib/gl_anytree_list2.h
+++ b/gl/lib/gl_anytree_list2.h
@@ -60,13 +60,15 @@ gl_tree_size (gl_list_t list)
}
static const void *
-gl_tree_node_value (gl_list_t list, gl_list_node_t node)
+gl_tree_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
return node->value;
}
static int
-gl_tree_node_nx_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
+gl_tree_node_nx_set_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node, const void *elt)
{
#if WITH_HASHTABLE
if (elt != node->value)
@@ -101,7 +103,8 @@ gl_tree_node_nx_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
}
static gl_list_node_t _GL_ATTRIBUTE_PURE
-gl_tree_next_node (gl_list_t list, gl_list_node_t node)
+gl_tree_next_node (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
if (node->right != NULL)
{
@@ -119,7 +122,8 @@ gl_tree_next_node (gl_list_t list, gl_list_node_t node)
}
static gl_list_node_t _GL_ATTRIBUTE_PURE
-gl_tree_previous_node (gl_list_t list, gl_list_node_t node)
+gl_tree_previous_node (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
if (node->left != NULL)
{
@@ -628,7 +632,7 @@ gl_tree_iterator_next (gl_list_iterator_t *iterator,
}
static void
-gl_tree_iterator_free (gl_list_iterator_t *iterator)
+gl_tree_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
diff --git a/gl/lib/gl_list.h b/gl/lib/gl_list.h
index 39d14401..53d6e5da 100644
--- a/gl/lib/gl_list.h
+++ b/gl/lib/gl_list.h
@@ -74,7 +74,11 @@ extern "C" {
gl_list_next_node O(1) O(1) O(log n) O(1) O(log n)
gl_list_previous_node O(1) O(1) O(log n) O(1) O(log n)
gl_list_get_at O(1) O(n) O(log n) O(n) O(log n)
+ gl_list_get_first O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_get_last O(1) O(1) O(log n) O(1) O(log n)
gl_list_set_at O(1) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_list_set_first O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_set_last O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
gl_list_search O(n) O(n) O(n) O(n)/O(1) O(log n)/O(1)
gl_list_search_from O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
gl_list_search_from_to O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
@@ -88,6 +92,8 @@ extern "C" {
gl_list_add_at O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
gl_list_remove_node O(n) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
gl_list_remove_at O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_list_remove_first O(n)/O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_remove_last O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
gl_list_remove O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
gl_list_iterator O(1) O(1) O(log n) O(1) O(log n)
gl_list_iterator_from_to O(1) O(n) O(log n) O(n) O(log n)
@@ -191,10 +197,7 @@ extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
/* Likewise. Returns 0 upon success, -1 upon out-of-memory. */
extern int gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Returns the node immediately after the given node in the list, or NULL
if the given node is the last (rightmost) one in the list. */
@@ -208,6 +211,14 @@ extern gl_list_node_t gl_list_previous_node (gl_list_t list, gl_list_node_t node
POSITION must be >= 0 and < gl_list_size (list). */
extern const void * gl_list_get_at (gl_list_t list, size_t position);
+/* Returns the element at the first position in the list.
+ The list must be non-empty. */
+extern const void * gl_list_get_first (gl_list_t list);
+
+/* Returns the element at the last position in the list.
+ The list must be non-empty. */
+extern const void * gl_list_get_last (gl_list_t list);
+
/* Replaces the element at a given position in the list.
POSITION must be >= 0 and < gl_list_size (list).
Returns its node. */
@@ -217,10 +228,25 @@ extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
/* Likewise. Returns NULL upon out-of-memory. */
extern gl_list_node_t gl_list_nx_set_at (gl_list_t list, size_t position,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
+
+/* Replaces the element at the first position in the list.
+ Returns its node.
+ The list must be non-empty. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_list_node_t gl_list_nx_set_first (gl_list_t list, const void *elt)
+ _GL_ATTRIBUTE_NODISCARD;
+
+/* Replaces the element at the last position in the list.
+ Returns its node.
+ The list must be non-empty. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_list_node_t gl_list_nx_set_last (gl_list_t list, const void *elt)
+ _GL_ATTRIBUTE_NODISCARD;
/* Searches whether an element is already in the list.
Returns its node if found, or NULL if not present in the list. */
@@ -263,10 +289,7 @@ extern size_t gl_list_indexof_from_to (gl_list_t list,
extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
/* Likewise. Returns NULL upon out-of-memory. */
extern gl_list_node_t gl_list_nx_add_first (gl_list_t list, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Adds an element as the last element of the list.
Returns its node. */
@@ -274,10 +297,7 @@ extern gl_list_node_t gl_list_nx_add_first (gl_list_t list, const void *elt)
extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
/* Likewise. Returns NULL upon out-of-memory. */
extern gl_list_node_t gl_list_nx_add_last (gl_list_t list, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Adds an element before a given element node of the list.
Returns its node. */
@@ -288,10 +308,7 @@ extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
extern gl_list_node_t gl_list_nx_add_before (gl_list_t list,
gl_list_node_t node,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Adds an element after a given element node of the list.
Returns its node. */
@@ -301,10 +318,7 @@ extern gl_list_node_t gl_list_add_after (gl_list_t list, gl_list_node_t node,
/* Likewise. Returns NULL upon out-of-memory. */
extern gl_list_node_t gl_list_nx_add_after (gl_list_t list, gl_list_node_t node,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Adds an element at a given position in the list.
POSITION must be >= 0 and <= gl_list_size (list). */
@@ -314,10 +328,7 @@ extern gl_list_node_t gl_list_add_at (gl_list_t list, size_t position,
/* Likewise. Returns NULL upon out-of-memory. */
extern gl_list_node_t gl_list_nx_add_at (gl_list_t list, size_t position,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Removes an element from the list.
Returns true. */
@@ -328,6 +339,14 @@ extern bool gl_list_remove_node (gl_list_t list, gl_list_node_t node);
Returns true. */
extern bool gl_list_remove_at (gl_list_t list, size_t position);
+/* Removes the element at the first position from the list.
+ Returns true if it was found and removed, or false if the list was empty. */
+extern bool gl_list_remove_first (gl_list_t list);
+
+/* Removes the element at the last position from the list.
+ Returns true if it was found and removed, or false if the list was empty. */
+extern bool gl_list_remove_last (gl_list_t list);
+
/* Searches and removes an element from the list.
Returns true if it was found and removed. */
extern bool gl_list_remove (gl_list_t list, const void *elt);
@@ -453,10 +472,7 @@ extern gl_list_node_t gl_sortedlist_add (gl_list_t list,
extern gl_list_node_t gl_sortedlist_nx_add (gl_list_t list,
gl_listelement_compar_fn compar,
const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Searches and removes an element from the list.
The list is assumed to be sorted with COMPAR.
@@ -593,10 +609,7 @@ gl_list_node_value (gl_list_t list, gl_list_node_t node)
->node_value (list, node);
}
-GL_LIST_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD int
gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
const void *elt)
{
@@ -625,16 +638,37 @@ gl_list_get_at (gl_list_t list, size_t position)
->get_at (list, position);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE const void *
+gl_list_get_first (gl_list_t list)
+{
+ return gl_list_get_at (list, 0);
+}
+
+GL_LIST_INLINE const void *
+gl_list_get_last (gl_list_t list)
+{
+ return gl_list_get_at (list, gl_list_size (list) - 1);
+}
+
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_set_at (gl_list_t list, size_t position, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_set_at (list, position, elt);
}
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
+gl_list_nx_set_first (gl_list_t list, const void *elt)
+{
+ return gl_list_nx_set_at (list, 0, elt);
+}
+
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
+gl_list_nx_set_last (gl_list_t list, const void *elt)
+{
+ return gl_list_nx_set_at (list, gl_list_size (list) - 1, elt);
+}
+
GL_LIST_INLINE gl_list_node_t
gl_list_search (gl_list_t list, const void *elt)
{
@@ -683,50 +717,35 @@ gl_list_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
->indexof_from_to (list, start_index, end_index, elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_add_first (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_first (list, elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_add_last (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_last (list, elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_before (list, node, elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_after (list, node, elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_list_nx_add_at (gl_list_t list, size_t position, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
@@ -748,6 +767,26 @@ gl_list_remove_at (gl_list_t list, size_t position)
}
GL_LIST_INLINE bool
+gl_list_remove_first (gl_list_t list)
+{
+ size_t size = gl_list_size (list);
+ if (size > 0)
+ return gl_list_remove_at (list, 0);
+ else
+ return false;
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_last (gl_list_t list)
+{
+ size_t size = gl_list_size (list);
+ if (size > 0)
+ return gl_list_remove_at (list, size - 1);
+ else
+ return false;
+}
+
+GL_LIST_INLINE bool
gl_list_remove (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
@@ -817,10 +856,7 @@ gl_sortedlist_indexof_from_to (gl_list_t list, gl_listelement_compar_fn compar,
elt);
}
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
gl_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
diff --git a/gl/lib/gl_map.h b/gl/lib/gl_map.h
index 8a203b62..977457ce 100644
--- a/gl/lib/gl_map.h
+++ b/gl/lib/gl_map.h
@@ -146,10 +146,7 @@ extern bool gl_map_search (gl_map_t map, const void *key, const void **valuep);
extern bool gl_map_put (gl_map_t map, const void *key, const void *value);
/* Likewise. Returns -1 upon out-of-memory. */
extern int gl_map_nx_put (gl_map_t map, const void *key, const void *value)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Adds a pair to a map and retrieves the previous value.
Returns true if a pair with the given key was not already in the map and so
@@ -162,10 +159,7 @@ extern bool gl_map_getput (gl_map_t map, const void *key, const void *value,
/* Likewise. Returns -1 upon out-of-memory. */
extern int gl_map_nx_getput (gl_map_t map, const void *key, const void *value,
const void **oldvaluep)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Removes a pair from a map.
Returns true if the key was found and its pair removed.
@@ -286,10 +280,7 @@ gl_map_search (gl_map_t map, const void *key, const void **valuep)
->search (map, key, valuep);
}
-GL_MAP_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_MAP_INLINE _GL_ATTRIBUTE_NODISCARD int
gl_map_nx_getput (gl_map_t map, const void *key, const void *value,
const void **oldvaluep)
{
@@ -340,10 +331,7 @@ gl_map_get (gl_map_t map, const void *key)
return value;
}
-GL_MAP_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_MAP_INLINE _GL_ATTRIBUTE_NODISCARD int
gl_map_nx_put (gl_map_t map, const void *key, const void *value)
{
const void *oldvalue;
diff --git a/gl/lib/gl_set.h b/gl/lib/gl_set.h
index 0c1f9a3c..3d48f7e3 100644
--- a/gl/lib/gl_set.h
+++ b/gl/lib/gl_set.h
@@ -126,10 +126,7 @@ extern bool gl_set_search (gl_set_t set, const void *elt);
extern bool gl_set_add (gl_set_t set, const void *elt);
/* Likewise. Returns -1 upon out-of-memory. */
extern int gl_set_nx_add (gl_set_t set, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
- ;
+ _GL_ATTRIBUTE_NODISCARD;
/* Removes an element from a set.
Returns true if it was found and removed. */
@@ -233,10 +230,7 @@ gl_set_search (gl_set_t set, const void *elt)
return ((const struct gl_set_impl_base *) set)->vtable->search (set, elt);
}
-GL_SET_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
- __attribute__ ((__warn_unused_result__))
-#endif
+GL_SET_INLINE _GL_ATTRIBUTE_NODISCARD int
gl_set_nx_add (gl_set_t set, const void *elt)
{
return ((const struct gl_set_impl_base *) set)->vtable->nx_add (set, elt);
diff --git a/gl/lib/gl_xlist.h b/gl/lib/gl_xlist.h
index ef6b93f6..7bf9c239 100644
--- a/gl/lib/gl_xlist.h
+++ b/gl/lib/gl_xlist.h
@@ -52,6 +52,8 @@ extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
const void *elt);
extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
const void *elt);
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
@@ -114,6 +116,24 @@ gl_list_set_at (gl_list_t list, size_t position, const void *elt)
}
GL_XLIST_INLINE gl_list_node_t
+gl_list_set_first (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_set_first (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_set_last (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_set_last (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
gl_list_add_first (gl_list_t list, const void *elt)
{
gl_list_node_t result = gl_list_nx_add_first (list, elt);
diff --git a/gl/lib/hash.h b/gl/lib/hash.h
index 2ff4266a..e5af43c0 100644
--- a/gl/lib/hash.h
+++ b/gl/lib/hash.h
@@ -27,24 +27,6 @@
# include <stdio.h>
# include <stdbool.h>
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The warn_unused_result attribute appeared first in gcc-3.4.0. */
-# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# define _GL_ATTRIBUTE_WUR __attribute__ ((__warn_unused_result__))
-# else
-# define _GL_ATTRIBUTE_WUR /* empty */
-# endif
-
-# ifndef _GL_ATTRIBUTE_DEPRECATED
-/* The __attribute__((__deprecated__)) feature
- is available in gcc versions 3.1 and newer. */
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
-# define _GL_ATTRIBUTE_DEPRECATED /* empty */
-# else
-# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
-# endif
-# endif
-
typedef size_t (*Hash_hasher) (const void *, size_t);
typedef bool (*Hash_comparator) (const void *, const void *);
typedef void (*Hash_data_freer) (void *);
@@ -88,16 +70,17 @@ size_t hash_string (const char *, size_t) _GL_ATTRIBUTE_PURE;
void hash_reset_tuning (Hash_tuning *);
Hash_table *hash_initialize (size_t, const Hash_tuning *,
Hash_hasher, Hash_comparator,
- Hash_data_freer) _GL_ATTRIBUTE_WUR;
+ Hash_data_freer) _GL_ATTRIBUTE_NODISCARD;
Hash_table *hash_xinitialize (size_t, const Hash_tuning *,
Hash_hasher, Hash_comparator,
- Hash_data_freer) _GL_ATTRIBUTE_WUR;
+ Hash_data_freer) _GL_ATTRIBUTE_NODISCARD;
void hash_clear (Hash_table *);
void hash_free (Hash_table *);
/* Insertion and deletion. */
-bool hash_rehash (Hash_table *, size_t) _GL_ATTRIBUTE_WUR;
-void *hash_insert (Hash_table *, const void *) _GL_ATTRIBUTE_WUR;
+bool hash_rehash (Hash_table *, size_t) _GL_ATTRIBUTE_NODISCARD;
+void *hash_insert (Hash_table *, const void *) _GL_ATTRIBUTE_NODISCARD;
+void *hash_xinsert (Hash_table *, const void *);
int hash_insert_if_absent (Hash_table *table, const void *entry,
const void **matched_ent);
diff --git a/gl/lib/isblank.c b/gl/lib/isblank.c
new file mode 100644
index 00000000..48994045
--- /dev/null
+++ b/gl/lib/isblank.c
@@ -0,0 +1,33 @@
+/* Test whether a character is a blank.
+
+ Copyright (C) 2009-2020 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 Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <ctype.h>
+
+int
+isblank (int c)
+{
+ /* On all known platforms, in all predefined locales, isblank(c) is likely
+ equivalent with (c == ' ' || c == '\t'). Look at the glibc definition
+ (in glibc/localedata/locales/i18n): The "blank" characters are '\t', ' ',
+ U+1680, U+180E, U+2000..U+2006, U+2008..U+200A, U+205F, U+3000, and none
+ except the first two is present in a common 8-bit encoding. Therefore
+ the substitute for other platforms is not more complicated than this. */
+ return (c == ' ' || c == '\t');
+}
diff --git a/gl/lib/libc-config.h b/gl/lib/libc-config.h
index 124f1d77..1300c3a2 100644
--- a/gl/lib/libc-config.h
+++ b/gl/lib/libc-config.h
@@ -180,4 +180,5 @@
/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */
#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
-#define versioned_symbol(lib, local, symbol, version)
+#define compat_symbol(lib, local, symbol, version) extern int dummy
+#define versioned_symbol(lib, local, symbol, version) extern int dummy
diff --git a/gl/lib/limits.in.h b/gl/lib/limits.in.h
index 90c273fa..d25c5237 100644
--- a/gl/lib/limits.in.h
+++ b/gl/lib/limits.in.h
@@ -15,16 +15,32 @@
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 _@GUARD_PREFIX@_LIMITS_H
-
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
-/* The include_next requires a split double-inclusion guard. */
+#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+/* Special invocation convention:
+ On Haiku/x86_64, we have a sequence of nested includes
+ <limits.h> -> <syslimits.h> -> <limits.h>.
+ In this situation, LONG_MAX and INT_MAX are not yet defined,
+ therefore we should not attempt to define LONG_BIT. */
+
#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+
+# define _GL_ALREADY_INCLUDING_LIMITS_H
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+# undef _GL_ALREADY_INCLUDING_LIMITS_H
+
#ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H
@@ -102,3 +118,4 @@
#endif /* _@GUARD_PREFIX@_LIMITS_H */
#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif
diff --git a/gl/lib/mbrtowc.c b/gl/lib/mbrtowc.c
index 6cb52675..a71d3943 100644
--- a/gl/lib/mbrtowc.c
+++ b/gl/lib/mbrtowc.c
@@ -50,18 +50,11 @@
# endif
+# include "attribute.h"
# include "verify.h"
# include "lc-charset-dispatch.h"
# include "mbtowc-lock.h"
-# ifndef FALLTHROUGH
-# if __GNUC__ < 7
-# define FALLTHROUGH ((void) 0)
-# else
-# define FALLTHROUGH __attribute__ ((__fallthrough__))
-# endif
-# endif
-
verify (sizeof (mbstate_t) >= 4);
static char internal_state[4];
diff --git a/gl/lib/nonblocking.c b/gl/lib/nonblocking.c
index b354e74c..0c4e5f8e 100644
--- a/gl/lib/nonblocking.c
+++ b/gl/lib/nonblocking.c
@@ -38,6 +38,10 @@
# include <io.h>
# endif
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
int
get_nonblocking_flag (int desc)
{
diff --git a/gl/lib/open.c b/gl/lib/open.c
index 487194f6..751b42d7 100644
--- a/gl/lib/open.c
+++ b/gl/lib/open.c
@@ -110,7 +110,9 @@ open (const char *filename, int flags, ...)
directories,
- if O_WRONLY or O_RDWR is specified, open() must fail because the
file does not contain a '.' directory. */
- if (flags & (O_CREAT | O_WRONLY | O_RDWR))
+ if ((flags & O_CREAT)
+ || (flags & O_ACCMODE) == O_RDWR
+ || (flags & O_ACCMODE) == O_WRONLY)
{
size_t len = strlen (filename);
if (len > 0 && filename[len - 1] == '/')
@@ -122,7 +124,7 @@ open (const char *filename, int flags, ...)
#endif
fd = orig_open (filename,
- flags & ~(have_cloexec <= 0 ? O_CLOEXEC : 0), mode);
+ flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
if (flags & O_CLOEXEC)
{
diff --git a/gl/lib/openat-proc.c b/gl/lib/openat-proc.c
index 9111cd3d..b5aaee8b 100644
--- a/gl/lib/openat-proc.c
+++ b/gl/lib/openat-proc.c
@@ -73,8 +73,9 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
problem is exhibited on code that built on Solaris 8 and
running on Solaris 10. */
- int proc_self_fd = open ("/proc/self/fd",
- O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+ int proc_self_fd =
+ open ("/proc/self/fd",
+ O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_CLOEXEC);
if (proc_self_fd < 0)
proc_status = -1;
else
diff --git a/gl/lib/openat.c b/gl/lib/openat.c
index d2c84e8f..baf65662 100644
--- a/gl/lib/openat.c
+++ b/gl/lib/openat.c
@@ -100,7 +100,9 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
directories,
- if O_WRONLY or O_RDWR is specified, open() must fail because the
file does not contain a '.' directory. */
- if (flags & (O_CREAT | O_WRONLY | O_RDWR))
+ if ((flags & O_CREAT)
+ || (flags & O_ACCMODE) == O_RDWR
+ || (flags & O_ACCMODE) == O_WRONLY)
{
size_t len = strlen (filename);
if (len > 0 && filename[len - 1] == '/')
@@ -112,7 +114,7 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
# endif
fd = orig_openat (dfd, filename,
- flags & ~(have_cloexec <= 0 ? O_CLOEXEC : 0), mode);
+ flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
if (flags & O_CLOEXEC)
{
@@ -165,7 +167,7 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
#else /* !HAVE_OPENAT */
-# include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
# include "openat-priv.h"
# include "save-cwd.h"
@@ -289,7 +291,7 @@ bool
openat_needs_fchdir (void)
{
bool needs_fchdir = true;
- int fd = open ("/", O_SEARCH);
+ int fd = open ("/", O_SEARCH | O_CLOEXEC);
if (0 <= fd)
{
diff --git a/gl/lib/opendir.c b/gl/lib/opendir.c
index 162ae4a0..500fa44f 100644
--- a/gl/lib/opendir.c
+++ b/gl/lib/opendir.c
@@ -45,6 +45,16 @@
# include <fcntl.h>
#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined. */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef GetFullPathName
+# define GetFullPathName GetFullPathNameA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
DIR *
opendir (const char *dir_name)
{
diff --git a/gl/lib/readdir.c b/gl/lib/readdir.c
index 1a02ce41..91a35165 100644
--- a/gl/lib/readdir.c
+++ b/gl/lib/readdir.c
@@ -24,6 +24,10 @@
#include "dirent-private.h"
+/* Don't assume that UNICODE is not defined. */
+#undef FindNextFile
+#define FindNextFile FindNextFileA
+
struct dirent *
readdir (DIR *dirp)
{
diff --git a/gl/lib/rename.c b/gl/lib/rename.c
index 09881e8c..108dc40c 100644
--- a/gl/lib/rename.c
+++ b/gl/lib/rename.c
@@ -39,6 +39,10 @@
# include "dirname.h"
+/* Don't assume that UNICODE is not defined. */
+# undef MoveFileEx
+# define MoveFileEx MoveFileExA
+
/* Rename the file SRC to DST. This replacement is necessary on
Windows, on which the system rename function will not replace
an existing DST. */
diff --git a/gl/lib/rewinddir.c b/gl/lib/rewinddir.c
index d8ae7140..a18943d7 100644
--- a/gl/lib/rewinddir.c
+++ b/gl/lib/rewinddir.c
@@ -23,6 +23,10 @@
#include "dirent-private.h"
+/* Don't assume that UNICODE is not defined. */
+#undef FindFirstFile
+#define FindFirstFile FindFirstFileA
+
void
rewinddir (DIR *dirp)
{
diff --git a/gl/lib/rmdir.c b/gl/lib/rmdir.c
index 2f517cc6..2155224b 100644
--- a/gl/lib/rmdir.c
+++ b/gl/lib/rmdir.c
@@ -23,7 +23,7 @@
#include <errno.h>
#include <string.h>
-#include "dosname.h"
+#include "filename.h"
#undef rmdir
diff --git a/gl/lib/select.c b/gl/lib/select.c
index 6748c21b..e35746bb 100644
--- a/gl/lib/select.c
+++ b/gl/lib/select.c
@@ -47,6 +47,18 @@
#undef select
+/* Don't assume that UNICODE is not defined. */
+#undef GetModuleHandle
+#define GetModuleHandle GetModuleHandleA
+#undef PeekConsoleInput
+#define PeekConsoleInput PeekConsoleInputA
+#undef CreateEvent
+#define CreateEvent CreateEventA
+#undef PeekMessage
+#define PeekMessage PeekMessageA
+#undef DispatchMessage
+#define DispatchMessage DispatchMessageA
+
/* Avoid warnings from gcc -Wcast-function-type. */
#define GetProcAddress \
(void *) GetProcAddress
diff --git a/gl/lib/stat-w32.c b/gl/lib/stat-w32.c
index 296ccf18..19bdfaa3 100644
--- a/gl/lib/stat-w32.c
+++ b/gl/lib/stat-w32.c
@@ -21,8 +21,10 @@
#if defined _WIN32 && ! defined __CYGWIN__
/* Ensure that <windows.h> defines FILE_ID_INFO. */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT _WIN32_WINNT_WIN8
+#if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+# undef _WIN32_WINNT
+# define _WIN32_WINNT _WIN32_WINNT_WIN8
+#endif
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,21 +40,29 @@
#include "pathmax.h"
#include "verify.h"
+/* Don't assume that UNICODE is not defined. */
+#undef LoadLibrary
+#define LoadLibrary LoadLibraryA
+#undef GetFinalPathNameByHandle
+#define GetFinalPathNameByHandle GetFinalPathNameByHandleA
+
+#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA)
+
/* Avoid warnings from gcc -Wcast-function-type. */
-#define GetProcAddress \
- (void *) GetProcAddress
+# define GetProcAddress \
+ (void *) GetProcAddress
-#if _GL_WINDOWS_STAT_INODES == 2
+# if _GL_WINDOWS_STAT_INODES == 2
/* GetFileInformationByHandleEx was introduced only in Windows Vista. */
typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,
FILE_INFO_BY_HANDLE_CLASS fiClass,
LPVOID lpBuffer,
DWORD dwBufferSize);
static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL;
-#endif
+# endif
/* GetFinalPathNameByHandle was introduced only in Windows Vista. */
typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
- LPTSTR lpFilePath,
+ LPSTR lpFilePath,
DWORD lenFilePath,
DWORD dwFlags);
static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL;
@@ -64,16 +74,23 @@ initialize (void)
HMODULE kernel32 = LoadLibrary ("kernel32.dll");
if (kernel32 != NULL)
{
-#if _GL_WINDOWS_STAT_INODES == 2
+# if _GL_WINDOWS_STAT_INODES == 2
GetFileInformationByHandleExFunc =
(GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx");
-#endif
+# endif
GetFinalPathNameByHandleFunc =
(GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA");
}
initialized = TRUE;
}
+#else
+
+# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx
+# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle
+
+#endif
+
/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
#if _GL_WINDOWS_STAT_TIMESPEC
struct timespec
@@ -132,8 +149,10 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
DWORD type = GetFileType (h);
if (type == FILE_TYPE_DISK)
{
+#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA)
if (!initialized)
initialize ();
+#endif
/* st_mode can be determined through
GetFileAttributesEx
diff --git a/gl/lib/stat.c b/gl/lib/stat.c
index e074e6a0..9d3965d3 100644
--- a/gl/lib/stat.c
+++ b/gl/lib/stat.c
@@ -65,6 +65,13 @@ orig_stat (const char *filename, struct stat *buf)
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include "stat-w32.h"
+/* Don't assume that UNICODE is not defined. */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
#endif
#ifdef WINDOWS_NATIVE
diff --git a/gl/lib/stdio-read.c b/gl/lib/stdio-read.c
index 874c9b11..e63a3276 100644
--- a/gl/lib/stdio-read.c
+++ b/gl/lib/stdio-read.c
@@ -43,6 +43,10 @@
# include <io.h>
# endif
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
# define CALL_WITH_ERRNO_FIX(RETTYPE, EXPRESSION, FAILED) \
if (ferror (stream)) \
return (EXPRESSION); \
diff --git a/gl/lib/stdio-write.c b/gl/lib/stdio-write.c
index 41bc74c6..778e7cf1 100644
--- a/gl/lib/stdio-write.c
+++ b/gl/lib/stdio-write.c
@@ -45,6 +45,10 @@
# include <io.h>
# endif
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
# if GNULIB_NONBLOCKING
# define CLEAR_ERRNO \
errno = 0;
diff --git a/gl/lib/stdio.in.h b/gl/lib/stdio.in.h
index 4a95f323..6c338dd6 100644
--- a/gl/lib/stdio.in.h
+++ b/gl/lib/stdio.in.h
@@ -62,10 +62,12 @@
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+# endif
#endif
/* _GL_ATTRIBUTE_FORMAT_PRINTF
diff --git a/gl/lib/stdlib.in.h b/gl/lib/stdlib.in.h
index ec5f124a..59f9e6c7 100644
--- a/gl/lib/stdlib.in.h
+++ b/gl/lib/stdlib.in.h
@@ -101,10 +101,12 @@ struct random_data
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The attribute __pure__ was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
#endif
/* The definition of _Noreturn is copied here. */
diff --git a/gl/lib/string.in.h b/gl/lib/string.in.h
index 596c99bf..a08e7057 100644
--- a/gl/lib/string.in.h
+++ b/gl/lib/string.in.h
@@ -54,10 +54,12 @@
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The attribute __pure__ was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
#endif
/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
@@ -332,9 +334,10 @@ _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
GB18030 and the character to be searched is a digit. */
# undef strchr
/* Assume strchr is always declared. */
-_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
- "in some multibyte locales - "
- "use mbschr if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strchr, const char *, (const char *, int),
+ "strchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbschr if you care about internationalization");
#endif
/* Find the first occurrence of C in S or the final NUL byte. */
@@ -526,15 +529,17 @@ _GL_CXXALIASWARN (strpbrk);
locale encoding is GB18030 and one of the characters to be searched is a
digit. */
# undef strpbrk
-_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
- "in multibyte locales - "
- "use mbspbrk if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *),
+ "strpbrk cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbspbrk if you care about internationalization");
# endif
#elif defined GNULIB_POSIXCHECK
# undef strpbrk
# if HAVE_RAW_DECL_STRPBRK
-_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
- "use gnulib module strpbrk for portability");
+_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *),
+ "strpbrk is unportable - "
+ "use gnulib module strpbrk for portability");
# endif
#endif
@@ -553,9 +558,10 @@ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
GB18030 and the character to be searched is a digit. */
# undef strrchr
/* Assume strrchr is always declared. */
-_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
- "in some multibyte locales - "
- "use mbsrchr if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strrchr, const char *, (const char *, int),
+ "strrchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbsrchr if you care about internationalization");
#endif
/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
diff --git a/gl/lib/unistd.in.h b/gl/lib/unistd.in.h
index c9b9ac95..b211e4d6 100644
--- a/gl/lib/unistd.in.h
+++ b/gl/lib/unistd.in.h
@@ -118,6 +118,17 @@
# include <netdb.h>
#endif
+/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
+ <sys/random.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
+ && ((defined __APPLE__ && defined __MACH__) || defined __sun \
+ || defined __ANDROID__) \
+ && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
+ && !defined __GLIBC__
+# include <sys/random.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__ \
@@ -763,6 +774,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
#endif
+#if @GNULIB_GETENTROPY@
+/* Fill a buffer with random bytes. */
+# if !@HAVE_GETENTROPY@
+_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIASWARN (getentropy);
+#elif defined GNULIB_POSIXCHECK
+# undef getentropy
+# if HAVE_RAW_DECL_GETENTROPY
+_GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
+ "use gnulib module getentropy for portability");
+# endif
+#endif
+
+
#if @GNULIB_GETGROUPS@
/* Return the supplemental groups that the current process belongs to.
It is unspecified whether the effective group id is in the list.
diff --git a/gl/lib/unlink.c b/gl/lib/unlink.c
index b7daa7cd..35463fd1 100644
--- a/gl/lib/unlink.c
+++ b/gl/lib/unlink.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <sys/stat.h>
-#include "dosname.h"
+#include "filename.h"
#undef unlink
@@ -65,10 +65,7 @@ rpl_unlink (char const *name)
/* Trailing NUL will overwrite the trailing slash. */
char *short_name = malloc (len);
if (!short_name)
- {
- errno = EPERM;
- return -1;
- }
+ return -1;
memcpy (short_name, name, len);
while (len && ISSLASH (short_name[len - 1]))
short_name[--len] = '\0';
diff --git a/gl/lib/unlinkat.c b/gl/lib/unlinkat.c
index 7c0302e2..44236864 100644
--- a/gl/lib/unlinkat.c
+++ b/gl/lib/unlinkat.c
@@ -28,7 +28,7 @@
#include <stdlib.h>
-#include "dosname.h"
+#include "filename.h"
#include "openat.h"
#if HAVE_UNLINKAT
diff --git a/gl/lib/utime.c b/gl/lib/utime.c
index 77968dca..c35eb169 100644
--- a/gl/lib/utime.c
+++ b/gl/lib/utime.c
@@ -29,6 +29,12 @@
# include "filename.h"
# include "malloca.h"
+/* Don't assume that UNICODE is not defined. */
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef GetFileAttributes
+# define GetFileAttributes GetFileAttributesA
+
int
_gl_utimens_windows (const char *name, struct timespec ts[2])
{
diff --git a/gl/lib/vasnprintf.c b/gl/lib/vasnprintf.c
index e3a1e9fa..62f8fbf4 100644
--- a/gl/lib/vasnprintf.c
+++ b/gl/lib/vasnprintf.c
@@ -41,7 +41,14 @@
DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t.
DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t.
- DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */
+ DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t.
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ ENABLE_WCHAR_FALLBACK Set to 1 to avoid EILSEQ during conversion of wide
+ characters (wchar_t) and wide character strings
+ (wchar_t[]) to multibyte sequences. The fallback is the
+ hexadecimal escape syntax (\unnnn or \Unnnnnnnn) or,
+ if wchar_t is not Unicode encoded, \wnnnn or \Wnnnnnnnn.
+ */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
@@ -87,6 +94,7 @@
/* Checked size_t computations. */
#include "xsize.h"
+#include "attribute.h"
#include "verify.h"
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
@@ -118,14 +126,6 @@
# include "fpucw.h"
#endif
-#ifndef FALLTHROUGH
-# if __GNUC__ < 7
-# define FALLTHROUGH ((void) 0)
-# else
-# define FALLTHROUGH __attribute__ ((__fallthrough__))
-# endif
-#endif
-
/* Default parameters. */
#ifndef VASNPRINTF
# if WIDE_CHAR_VERSION
@@ -277,6 +277,74 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
# endif
#endif
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+# if ENABLE_WCHAR_FALLBACK
+static size_t
+wctomb_fallback (char *s, wchar_t wc)
+{
+ static char hex[16] = "0123456789ABCDEF";
+
+ s[0] = '\\';
+ if (sizeof (wchar_t) > 2 && wc > 0xffff)
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'U';
+# else
+ s[1] = 'W';
+# endif
+ s[2] = hex[(wc & 0xf0000000U) >> 28];
+ s[3] = hex[(wc & 0xf000000U) >> 24];
+ s[4] = hex[(wc & 0xf00000U) >> 20];
+ s[5] = hex[(wc & 0xf0000U) >> 16];
+ s[6] = hex[(wc & 0xf000U) >> 12];
+ s[7] = hex[(wc & 0xf00U) >> 8];
+ s[8] = hex[(wc & 0xf0U) >> 4];
+ s[9] = hex[wc & 0xfU];
+ return 10;
+ }
+ else
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'u';
+# else
+ s[1] = 'w';
+# endif
+ s[2] = hex[(wc & 0xf000U) >> 12];
+ s[3] = hex[(wc & 0xf00U) >> 8];
+ s[4] = hex[(wc & 0xf0U) >> 4];
+ s[5] = hex[wc & 0xfU];
+ return 6;
+ }
+}
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+static size_t
+local_wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+{
+ size_t count = wcrtomb (s, wc, ps);
+ if (count == (size_t)(-1))
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# else
+static int
+local_wctomb (char *s, wchar_t wc)
+{
+ int count = wctomb (s, wc);
+ if (count < 0)
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# define local_wcrtomb(S, WC, PS) local_wctomb ((S), (WC))
+# endif
+# else
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+# define local_wcrtomb(S, WC, PS) wcrtomb ((S), (WC), (PS))
+# else
+# define local_wcrtomb(S, WC, PS) wctomb ((S), (WC))
+# endif
+# endif
+#endif
+
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
/* Determine the decimal-point character according to the current locale. */
# ifndef decimal_point_char_defined
@@ -1677,7 +1745,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
case 'c':
# if HAVE_WINT_T && !WIDE_CHAR_VERSION
if (type == TYPE_WIDE_CHAR)
- tmp_length = MB_CUR_MAX;
+ {
+ tmp_length = MB_CUR_MAX;
+# if ENABLE_WCHAR_FALLBACK
+ if (tmp_length < (sizeof (wchar_t) > 2 ? 10 : 6))
+ tmp_length = (sizeof (wchar_t) > 2 ? 10 : 6);
+# endif
+ }
else
# endif
tmp_length = 1;
@@ -2394,7 +2468,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
else if (dp->conversion == 's'
# if WIDE_CHAR_VERSION
&& a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2669,11 +2743,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
-# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- count = wcrtomb (cbuf, *arg_end, &state);
-# else
- count = wctomb (cbuf, *arg_end);
-# endif
+ count = local_wcrtomb (cbuf, *arg_end, &state);
if (count < 0)
{
/* Cannot convert. */
@@ -2714,11 +2784,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
-# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- count = wcrtomb (cbuf, *arg_end, &state);
-# else
- count = wctomb (cbuf, *arg_end);
-# endif
+ count = local_wcrtomb (cbuf, *arg_end, &state);
if (count < 0)
{
/* Cannot convert. */
@@ -2763,11 +2829,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- count = wcrtomb (cbuf, *arg, &state);
-# else
- count = wctomb (cbuf, *arg);
-# endif
+ count = local_wcrtomb (cbuf, *arg, &state);
if (count <= 0)
/* Inconsistency. */
abort ();
@@ -2844,11 +2906,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- count = wcrtomb (cbuf, *arg, &state);
-# else
- count = wctomb (cbuf, *arg);
-# endif
+ count = local_wcrtomb (cbuf, *arg, &state);
if (count <= 0)
/* Inconsistency. */
abort ();
@@ -2873,11 +2931,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- count = wcrtomb (cbuf, *arg, &state);
-# else
- count = wctomb (cbuf, *arg);
-# endif
+ count = local_wcrtomb (cbuf, *arg, &state);
if (count <= 0)
{
/* Cannot convert. */
@@ -2913,6 +2967,210 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
}
#endif
+#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION
+ else if (dp->conversion == 'c'
+ && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)
+ {
+ /* Implement the 'lc' directive ourselves, in order to provide
+ the fallback that avoids EILSEQ. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ /* %lc in vasnprintf. See the specification of fprintf. */
+ {
+ wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ verify (sizeof (TCHAR_T) == 1);
+ TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+# endif
+ {
+ /* Count the number of bytes. */
+ characters = 0;
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Inconsistency. */
+ abort ();
+ characters = count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ if (characters > 0) /* implies arg != 0 */
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpsrc, cbuf, count);
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (w < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+ {
+ /* We know the number of bytes in advance. */
+ ENSURE_ALLOCATION (xsum (length, characters));
+ if (characters > 0) /* implies arg != 0 */
+ {
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (result + length, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ length += count;
+ }
+ }
+ else
+ {
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ }
+ }
+# else
+ ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+#endif
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
else if ((dp->conversion == 'a' || dp->conversion == 'A')
# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
diff --git a/gl/lib/vasnprintf.h b/gl/lib/vasnprintf.h
index f63399a5..16080142 100644
--- a/gl/lib/vasnprintf.h
+++ b/gl/lib/vasnprintf.h
@@ -23,18 +23,6 @@
/* Get size_t. */
#include <stddef.h>
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/gl/lib/verify.h b/gl/lib/verify.h
index d9ab89a5..f1097612 100644
--- a/gl/lib/verify.h
+++ b/gl/lib/verify.h
@@ -277,10 +277,22 @@ template <int w>
#endif
/* Assume that R always holds. Behavior is undefined if R is false,
- fails to evaluate, or has side effects. Although assuming R can
- help a compiler generate better code or diagnostics, performance
- can suffer if R uses hard-to-optimize features such as function
- calls not inlined by the compiler. */
+ fails to evaluate, or has side effects.
+
+ 'assume (R)' is a directive from the programmer telling the
+ compiler that R is true so the compiler needn't generate code to
+ test R. This is why 'assume' is in verify.h: it's related to
+ static checking (in this case, static checking done by the
+ programmer), not dynamic checking.
+
+ 'assume (R)' can affect compilation of all the code, not just code
+ that happens to be executed after the assume (R) is "executed".
+ For example, if the code mistakenly does 'assert (R); assume (R);'
+ the compiler is entitled to optimize away the 'assert (R)'.
+
+ Although assuming R can help a compiler generate better code or
+ diagnostics, performance can suffer if R uses hard-to-optimize
+ features such as function calls not inlined by the compiler. */
#if _GL_HAS_BUILTIN_UNREACHABLE
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
diff --git a/gl/lib/warn-on-use.h b/gl/lib/warn-on-use.h
index 1be2cbb9..23c10fdd 100644
--- a/gl/lib/warn-on-use.h
+++ b/gl/lib/warn-on-use.h
@@ -100,23 +100,28 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
#endif
/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
- is like _GL_WARN_ON_USE (function, "string"), except that the function is
- declared with the given prototype, consisting of return type, parameters,
- and attributes.
+ is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the
+ function is declared with the given prototype, consisting of return type,
+ parameters, and attributes.
This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
not work in this case. */
#ifndef _GL_WARN_ON_USE_CXX
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if !defined __cplusplus
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+ _GL_WARN_ON_USE (function, msg)
+# else
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes
-# else /* Unsupported. */
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
# endif
#endif
diff --git a/gl/lib/wchar.in.h b/gl/lib/wchar.in.h
index fe5cb153..7640a14b 100644
--- a/gl/lib/wchar.in.h
+++ b/gl/lib/wchar.in.h
@@ -94,10 +94,12 @@
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The attribute __pure__ was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -622,6 +624,29 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
#endif
+/* Copy N wide characters of SRC to DEST.
+ Return pointer to wide characters after the last written wide character. */
+#if @GNULIB_WMEMPCPY@
+# if !@HAVE_WMEMPCPY@
+_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmempcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmempcpy
+# if HAVE_RAW_DECL_WMEMPCPY
+_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
+ "use gnulib module wmempcpy for portability");
+# endif
+#endif
+
+
/* Set N wide characters of S to C. */
#if @GNULIB_WMEMSET@
# if !@HAVE_WMEMSET@
diff --git a/gl/lib/windows-rwlock.c b/gl/lib/windows-rwlock.c
index aafc5ddd..64e761cd 100644
--- a/gl/lib/windows-rwlock.c
+++ b/gl/lib/windows-rwlock.c
@@ -25,6 +25,10 @@
#include <errno.h>
#include <stdlib.h>
+/* Don't assume that UNICODE is not defined. */
+#undef CreateEvent
+#define CreateEvent CreateEventA
+
/* In this file, the waitqueues are implemented as circular arrays. */
#define glwthread_waitqueue_t glwthread_carray_waitqueue_t
diff --git a/gl/lib/wmemchr-impl.h b/gl/lib/wmemchr-impl.h
new file mode 100644
index 00000000..55231b30
--- /dev/null
+++ b/gl/lib/wmemchr-impl.h
@@ -0,0 +1,27 @@
+/* Search wide character array for a wide character.
+ Copyright (C) 1999, 2011-2020 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ 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 Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+wchar_t *
+wmemchr (const wchar_t *s, wchar_t c, size_t n)
+{
+ for (; n > 0; s++, n--)
+ {
+ if (*s == c)
+ return (wchar_t *) s;
+ }
+ return NULL;
+}
diff --git a/gl/lib/wmemchr.c b/gl/lib/wmemchr.c
new file mode 100644
index 00000000..b4f19701
--- /dev/null
+++ b/gl/lib/wmemchr.c
@@ -0,0 +1,23 @@
+/* Search wide character array for a wide character.
+ Copyright (C) 2011-2020 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemchr-impl.h"
diff --git a/gl/lib/wmempcpy.c b/gl/lib/wmempcpy.c
new file mode 100644
index 00000000..2e96ed84
--- /dev/null
+++ b/gl/lib/wmempcpy.c
@@ -0,0 +1,28 @@
+/* Copy wide character array, return pointer after last written wide character.
+ Copyright (C) 2020 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 Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+/* Copy N wide characters of SRC to DEST.
+ Return pointer to wide characters after the last written wide character. */
+wchar_t *
+wmempcpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ return wmemcpy (dest, src, n) + n;
+}
diff --git a/gl/lib/xalloc.h b/gl/lib/xalloc.h
index 19c64acb..24273ffb 100644
--- a/gl/lib/xalloc.h
+++ b/gl/lib/xalloc.h
@@ -36,13 +36,6 @@ extern "C" {
#endif
-#if ! defined __clang__ && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
-#else
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
-#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
diff --git a/gl/lib/xmalloc.c b/gl/lib/xmalloc.c
index 48687360..69c4e7df 100644
--- a/gl/lib/xmalloc.c
+++ b/gl/lib/xmalloc.c
@@ -24,14 +24,26 @@
#include <stdlib.h>
#include <string.h>
-/* 1 if calloc is known to be compatible with GNU calloc. This
- matters if we are not also using the calloc module, which defines
- HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms. */
+/* 1 if calloc, malloc and realloc are known to be compatible with GNU.
+ This matters if we are not also using the calloc-gnu, malloc-gnu
+ and realloc-gnu modules, which define HAVE_CALLOC_GNU,
+ HAVE_MALLOC_GNU and HAVE_REALLOC_GNU and support the GNU API even
+ on non-GNU platforms. */
#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
enum { HAVE_GNU_CALLOC = 1 };
#else
enum { HAVE_GNU_CALLOC = 0 };
#endif
+#if defined HAVE_MALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
+enum { HAVE_GNU_MALLOC = 1 };
+#else
+enum { HAVE_GNU_MALLOC = 0 };
+#endif
+#if defined HAVE_REALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
+enum { HAVE_GNU_REALLOC = 1 };
+#else
+enum { HAVE_GNU_REALLOC = 0 };
+#endif
/* Allocate N bytes of memory dynamically, with error checking. */
@@ -39,7 +51,7 @@ void *
xmalloc (size_t n)
{
void *p = malloc (n);
- if (!p && n != 0)
+ if (!p && (HAVE_GNU_MALLOC || n))
xalloc_die ();
return p;
}
@@ -50,18 +62,17 @@ xmalloc (size_t n)
void *
xrealloc (void *p, size_t n)
{
- if (!n && p)
+ if (!HAVE_GNU_REALLOC && !n && p)
{
- /* The GNU and C99 realloc behaviors disagree here. Act like
- GNU, even if the underlying realloc is C99. */
+ /* The GNU and C99 realloc behaviors disagree here. Act like GNU. */
free (p);
return NULL;
}
- p = realloc (p, n);
- if (!p && n)
+ void *r = realloc (p, n);
+ if (!r && (n || (HAVE_GNU_REALLOC && !p)))
xalloc_die ();
- return p;
+ return r;
}
/* If P is null, allocate a block of at least *PN bytes; otherwise,
diff --git a/gl/lib/xsize.h b/gl/lib/xsize.h
index 45d41661..26ef20b6 100644
--- a/gl/lib/xsize.h
+++ b/gl/lib/xsize.h
@@ -27,6 +27,9 @@
# include <stdint.h>
#endif
+/* Get ATTRIBUTE_PURE. */
+#include "attribute.h"
+
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
@@ -56,10 +59,7 @@ _GL_INLINE_HEADER_BEGIN
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
/* Sum of two sizes, with overflow check. */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
xsum (size_t size1, size_t size2)
{
size_t sum = size1 + size2;
@@ -67,30 +67,21 @@ xsum (size_t size1, size_t size2)
}
/* Sum of three sizes, with overflow check. */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
xsum3 (size_t size1, size_t size2, size_t size3)
{
return xsum (xsum (size1, size2), size3);
}
/* Sum of four sizes, with overflow check. */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
{
return xsum (xsum (xsum (size1, size2), size3), size4);
}
/* Maximum of two sizes, with overflow check. */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
xmax (size_t size1, size_t size2)
{
/* No explicit check is needed here, because for any n:
diff --git a/gl/lib/xvasprintf.h b/gl/lib/xvasprintf.h
index 8a64f535..ff43d1bb 100644
--- a/gl/lib/xvasprintf.h
+++ b/gl/lib/xvasprintf.h
@@ -20,18 +20,6 @@
/* Get va_list. */
#include <stdarg.h>
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/gl/m4/ctype.m4 b/gl/m4/ctype.m4
new file mode 100644
index 00000000..0b123d50
--- /dev/null
+++ b/gl/m4/ctype.m4
@@ -0,0 +1,32 @@
+# ctype_h.m4 serial 6
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_CTYPE_H],
+[
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+
+ dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_NEXT_HEADERS([ctype.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <ctype.h>
+ ]], [isblank])
+])
+
+AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_CTYPE_H_DEFAULTS],
+[
+ GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK])
+])
diff --git a/gl/m4/fnmatch.m4 b/gl/m4/fnmatch.m4
index 0f41f8c7..2f8e4a8f 100644
--- a/gl/m4/fnmatch.m4
+++ b/gl/m4/fnmatch.m4
@@ -1,4 +1,4 @@
-# Check for fnmatch - serial 14. -*- coding: utf-8 -*-
+# Check for fnmatch - serial 15. -*- coding: utf-8 -*-
# Copyright (C) 2000-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -149,7 +149,5 @@ AC_DEFUN([gl_PREREQ_FNMATCH],
[
dnl Prerequisites of lib/fnmatch.c.
AC_REQUIRE([AC_TYPE_MBSTATE_T])
- AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
- AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
- AC_CHECK_HEADERS_ONCE([wctype.h])
+ AC_CHECK_FUNCS_ONCE([mbsrtowcs])
])
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 9f4c7f6e..ac3917b1 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 14
+# getdelim.m4 serial 15
dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
dnl
@@ -42,6 +42,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
int len = getdelim (&line, &siz, '\n', in);
if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
{ free (line); fclose (in); return 2; }
+ free (line);
}
{
/* Test result for a NULL buffer and a non-zero size.
diff --git a/gl/m4/glob.m4 b/gl/m4/glob.m4
index dbd09e8f..d4cd03fc 100644
--- a/gl/m4/glob.m4
+++ b/gl/m4/glob.m4
@@ -1,4 +1,4 @@
-# glob.m4 serial 23
+# glob.m4 serial 24
dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -47,6 +47,7 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1
[[glob_t found;
if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
return 1;
+ globfree (&found);
]])],
[gl_cv_glob_lists_symlinks=yes],
[gl_cv_glob_lists_symlinks=no],
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index b4795c18..f4ba5e3a 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 48
+# gnulib-common.m4 serial 50
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,15 @@ AC_DEFUN([gl_COMMON], [
AC_REQUIRE([gl_ZZGNULIB])
])
AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
AH_VERBATIM([_Noreturn],
[/* The _Noreturn keyword of C11. */
#ifndef _Noreturn
@@ -31,12 +40,12 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _Noreturn [[noreturn]]
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ || _GL_GNUC_PREREQ (4, 7) \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))
/* _Noreturn works as-is. */
-# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
+# elif _GL_GNUC_PREREQ (2, 8) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
@@ -55,48 +64,206 @@ AC_DEFUN([gl_COMMON_BODY], [
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
# define __GNUC_STDC_INLINE__ 1
#endif])
- AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to declarations that might not
- be used. This helps to reduce warnings, such as from
- GCC -Wunused-parameter. */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
+ AH_VERBATIM([attribute],
+[/* Attributes. */
+#ifdef __has_attribute
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
-# define _GL_UNUSED
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
- is a misnomer outside of parameter lists. */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* gcc supports the "unused" attribute on possibly unused labels, and
- g++ has since version 4.5. Note to support C++ as well as C,
- _GL_UNUSED_LABEL should be used with a trailing ; */
-#if !defined __cplusplus || __GNUC__ > 4 \
- || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-# define _GL_UNUSED_LABEL _GL_UNUSED
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+[
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
#else
-# define _GL_UNUSED_LABEL
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
#endif
-/* The __pure__ attribute was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
-/* The __const__ attribute was added in gcc 2.95. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+#else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+#endif
+
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (const)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
-# define _GL_ATTRIBUTE_CONST /* empty */
+# define _GL_ATTRIBUTE_CONST
#endif
-/* The __malloc__ attribute was added in gcc 3. */
-#if 3 <= __GNUC__
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+#else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+
+/* FALLTHROUGH is special, because it always expands to something. */
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+#if _GL_HAS_ATTRIBUTE (may_alias)
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#elif _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
+/* Earlier spellings of this macro. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+#if _GL_HAS_ATTRIBUTE (malloc)
# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
#else
-# define _GL_ATTRIBUTE_MALLOC /* empty */
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
+[
+/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */
+#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
+#else
+# define _GL_UNUSED_LABEL
#endif
])
AH_VERBATIM([async_safe],
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 39025961..c57bb014 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -51,6 +51,7 @@ AC_DEFUN([gl_EARLY],
# Code from module array-list:
# Code from module assure:
# Code from module at-internal:
+ # Code from module attribute:
# Code from module bitrotate:
# Code from module btowc:
# Code from module builtin-expect:
@@ -64,13 +65,13 @@ AC_DEFUN([gl_EARLY],
# Code from module cloexec:
# Code from module close:
# Code from module closedir:
+ # Code from module ctype:
# Code from module d-ino:
# Code from module d-type:
# Code from module dirent:
# Code from module dirfd:
# Code from module dirname:
# Code from module dirname-lgpl:
- # Code from module dosname:
# Code from module double-slash-root:
# Code from module dup:
# Code from module dup2:
@@ -128,6 +129,7 @@ AC_DEFUN([gl_EARLY],
# Code from module intprops:
# Code from module inttypes-incomplete:
# Code from module ioctl:
+ # Code from module isblank:
# Code from module langinfo:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
@@ -272,6 +274,8 @@ AC_DEFUN([gl_EARLY],
# Code from module windows-once:
# Code from module windows-recmutex:
# Code from module windows-rwlock:
+ # Code from module wmemchr:
+ # Code from module wmempcpy:
# Code from module xalloc:
# Code from module xalloc-die:
# Code from module xalloc-oversized:
@@ -352,6 +356,7 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([closedir])
fi
gl_DIRENT_MODULE_INDICATOR([closedir])
+ gl_CTYPE_H
gl_CHECK_TYPE_STRUCT_DIRENT_D_INO
gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
gl_DIRENT_H
@@ -536,6 +541,12 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([ioctl])
fi
gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
+ gl_FUNC_ISBLANK
+ if test $HAVE_ISBLANK = 0; then
+ AC_LIBOBJ([isblank])
+ fi
+ gl_MODULE_INDICATOR([isblank])
+ gl_CTYPE_MODULE_INDICATOR([isblank])
gl_LANGINFO_H
AC_REQUIRE([gl_LARGEFILE])
gl_FUNC_LCHOWN
@@ -978,6 +989,16 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([windows-rwlock])
;;
esac
+ gl_FUNC_WMEMCHR
+ if test $HAVE_WMEMCHR = 0; then
+ AC_LIBOBJ([wmemchr])
+ fi
+ gl_WCHAR_MODULE_INDICATOR([wmemchr])
+ gl_FUNC_WMEMPCPY
+ if test $HAVE_WMEMPCPY = 0; then
+ AC_LIBOBJ([wmempcpy])
+ fi
+ gl_WCHAR_MODULE_INDICATOR([wmempcpy])
gl_XALLOC
gl_XGETCWD
gl_XSIZE
@@ -1148,6 +1169,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/assure.h
lib/at-func.c
lib/at-func2.c
+ lib/attribute.h
lib/basename-lgpl.c
lib/basename.c
lib/bitrotate.c
@@ -1165,13 +1187,13 @@ AC_DEFUN([gl_FILE_LIST], [
lib/cloexec.h
lib/close.c
lib/closedir.c
+ lib/ctype.in.h
lib/dirent-private.h
lib/dirent.in.h
lib/dirfd.c
lib/dirname-lgpl.c
lib/dirname.c
lib/dirname.h
- lib/dosname.h
lib/dup-safer-flag.c
lib/dup-safer.c
lib/dup.c
@@ -1282,6 +1304,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/intprops.h
lib/inttypes.in.h
lib/ioctl.c
+ lib/isblank.c
lib/itold.c
lib/langinfo.in.h
lib/lc-charset-dispatch.c
@@ -1466,6 +1489,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/windows-recmutex.h
lib/windows-rwlock.c
lib/windows-rwlock.h
+ lib/wmemchr-impl.h
+ lib/wmemchr.c
+ lib/wmempcpy.c
lib/xalloc-die.c
lib/xalloc-oversized.h
lib/xalloc.h
@@ -1496,6 +1522,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/close.m4
m4/closedir.m4
m4/codeset.m4
+ m4/ctype.m4
m4/d-ino.m4
m4/d-type.m4
m4/dirent_h.m4
@@ -1549,6 +1576,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/inttypes.m4
m4/inttypes_h.m4
m4/ioctl.m4
+ m4/isblank.m4
m4/langinfo_h.m4
m4/largefile.m4
m4/lchown.m4
@@ -1680,6 +1708,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/wcrtomb.m4
m4/wctype_h.m4
m4/wint_t.m4
+ m4/wmemchr.m4
+ m4/wmempcpy.m4
m4/xalloc.m4
m4/xgetcwd.m4
m4/xsize.m4
diff --git a/gl/m4/isblank.m4 b/gl/m4/isblank.m4
new file mode 100644
index 00000000..5e1b7831
--- /dev/null
+++ b/gl/m4/isblank.m4
@@ -0,0 +1,17 @@
+# isblank.m4 serial 3
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISBLANK],
+[
+ dnl Persuade glibc <ctype.h> to declare isblank().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([isblank])
+ if test $ac_cv_func_isblank = no; then
+ HAVE_ISBLANK=0
+ fi
+])
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 783620da..719bafb2 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 18
+# manywarnings.m4 serial 19
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -117,6 +117,23 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Waddress-of-packed-member \
-Waggressive-loop-optimizations \
-Wall \
+ -Wanalyzer-double-fclose \
+ -Wanalyzer-double-free \
+ -Wanalyzer-exposure-through-output-file \
+ -Wanalyzer-file-leak \
+ -Wanalyzer-free-of-non-heap \
+ -Wanalyzer-malloc-leak \
+ -Wanalyzer-null-argument \
+ -Wanalyzer-null-dereference \
+ -Wanalyzer-possible-null-argument \
+ -Wanalyzer-possible-null-dereference \
+ -Wanalyzer-stale-setjmp-buffer \
+ -Wanalyzer-tainted-array-index \
+ -Wanalyzer-too-complex \
+ -Wanalyzer-unsafe-call-within-signal-handler \
+ -Wanalyzer-use-after-free \
+ -Wanalyzer-use-of-pointer-in-stale-stack-frame \
+ -Warith-conversion \
-Wattribute-warning \
-Wattributes \
-Wbad-function-cast \
@@ -150,9 +167,11 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wempty-body \
-Wendif-labels \
-Wenum-compare \
+ -Wenum-conversion \
-Wexpansion-to-defined \
-Wextra \
-Wformat-contains-nul \
+ -Wformat-diag \
-Wformat-extra-args \
-Wformat-nonliteral \
-Wformat-security \
@@ -231,6 +250,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wstrict-aliasing \
-Wstrict-overflow \
-Wstrict-prototypes \
+ -Wstring-compare \
-Wstringop-truncation \
-Wsuggest-attribute=cold \
-Wsuggest-attribute=const \
@@ -242,6 +262,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wsuggest-final-types \
-Wswitch \
-Wswitch-bool \
+ -Wswitch-outside-range \
-Wswitch-unreachable \
-Wsync-nand \
-Wsystem-headers \
@@ -269,6 +290,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wvla \
-Wvolatile-register-var \
-Wwrite-strings \
+ -Wzero-length-bounds \
\
; do
gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
diff --git a/gl/m4/memmem.m4 b/gl/m4/memmem.m4
index e034d7bd..35a5bb19 100644
--- a/gl/m4/memmem.m4
+++ b/gl/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 26
+# memmem.m4 serial 27
dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
/* Check for empty needle behavior. */
{
const char *haystack = "AAA";
- if (memmem (haystack, 3, NULL, 0) != haystack)
+ if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
result |= 2;
}
return result;
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 9df21534..df473d87 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 62
+# printf.m4 serial 64
dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -711,6 +711,16 @@ int main ()
[gl_cv_func_printf_directive_n=yes],
[gl_cv_func_printf_directive_n=no],
[case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_printf_directive_n="guessing yes"],
+ [gl_cv_func_printf_directive_n="guessing no"])
+ ;;
# Guess no on Android.
linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
# Guess no on native Windows.
@@ -1412,10 +1422,18 @@ int main ()
[gl_cv_func_snprintf_directive_n=yes],
[gl_cv_func_snprintf_directive_n=no],
[
-changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_snprintf_directive_n="guessing yes"],
+ [gl_cv_func_snprintf_directive_n="guessing no"])
+ ;;
+changequote(,)dnl
# Guess yes on musl systems.
*-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on FreeBSD >= 5.
@@ -1448,8 +1466,8 @@ changequote(,)dnl
mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
- esac
changequote([,])dnl
+ esac
])
])
])
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index 65f51858..e723f591 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,4 +1,4 @@
-# serial 69
+# serial 70
# Copyright (C) 1996-2001, 2003-2020 Free Software Foundation, Inc.
#
@@ -90,11 +90,14 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern (pat, sizeof pat - 1, &regex);
if (s)
result |= 1;
- else if (re_search (&regex, data, sizeof data - 1,
- 0, sizeof data - 1, &regs)
- != -1)
- result |= 1;
- regfree (&regex);
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
}
{
@@ -125,8 +128,8 @@ AC_DEFUN([gl_REGEX],
0, sizeof data - 1, 0);
if (i != 0 && i != 21)
result |= 1;
+ regfree (&regex);
}
- regfree (&regex);
}
if (! setlocale (LC_ALL, "C"))
@@ -139,9 +142,13 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[^x]b", 6, &regex);
if (s)
result |= 2;
- /* This should fail, but succeeds for glibc-2.5. */
- else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
- result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
/* This regular expression is from Spencer ere test number 75
in grep-2.3. */
@@ -153,7 +160,10 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)
- result |= 4;
+ {
+ result |= 4;
+ regfree (&regex);
+ }
/* Ensure that [b-a] is diagnosed as invalid, when
using RE_NO_EMPTY_RANGES. */
@@ -161,13 +171,18 @@ AC_DEFUN([gl_REGEX],
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("a[b-a]", 6, &regex);
if (s == 0)
- result |= 8;
+ {
+ result |= 8;
+ regfree (&regex);
+ }
/* This should succeed, but does not for glibc-2.1.3. */
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("{1", 2, &regex);
if (s)
result |= 8;
+ else
+ regfree (&regex);
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
@@ -175,17 +190,35 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[an\371]*n", 7, &regex);
if (s)
result |= 8;
- /* This should match, but does not for glibc-2.2.1. */
- else if (re_match (&regex, "an", 2, 0, &regs) != 2)
- result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 8;
- /* glibc-2.2.93 does not work with a negative RANGE argument. */
- else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
- result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* The version of regex.c in older versions of gnulib
ignored RE_ICASE. Detect that problem too. */
@@ -194,8 +227,17 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 16;
- else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
- result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* Catch a bug reported by Vin Shelton in
https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
@@ -207,6 +249,8 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
if (s)
result |= 32;
+ else
+ regfree (&regex);
/* REG_STARTEND was added to glibc on 2004-01-15.
Reject older versions. */
@@ -221,8 +265,14 @@ AC_DEFUN([gl_REGEX],
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
- if (!s || strcmp (s, "Invalid back reference"))
+ if (!s)
result |= 64;
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ regfree (&regex);
+ }
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index e776f3bd..dfa38f85 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 78
+# unistd_h.m4 serial 80
dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -43,7 +43,7 @@ AC_DEFUN([gl_UNISTD_H],
#endif
]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
- getgroups gethostname getlogin getlogin_r getpagesize getpass
+ getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
getusershell setusershell endusershell
group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
readlink readlinkat rmdir sethostname sleep symlink symlinkat
@@ -82,6 +82,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
+ GNULIB_GETENTROPY=0; AC_SUBST([GNULIB_GETENTROPY])
GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
@@ -129,6 +130,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
+ HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY])
HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
@@ -198,6 +200,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
+ UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index be09020b..6c4e8a6c 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 45
+# wchar_h.m4 serial 46
AC_DEFUN([gl_WCHAR_H],
[
@@ -52,7 +52,8 @@ AC_DEFUN([gl_WCHAR_H],
#include <wchar.h>
]],
[btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+ wcsrtombs wcsnrtombs wcwidth
+ wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset
wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
@@ -159,6 +160,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP])
GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY])
GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE])
+ GNULIB_WMEMPCPY=0; AC_SUBST([GNULIB_WMEMPCPY])
GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET])
GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN])
GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN])
@@ -198,6 +200,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY])
HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE])
+ HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY])
HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET])
HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN])
HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index 877fd86c..5e6c1780 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,4 +1,4 @@
-# wint_t.m4 serial 7
+# wint_t.m4 serial 8
dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([gt_TYPE_WINT_T],
AC_CACHE_CHECK([whether wint_t is too small],
[gl_cv_type_wint_t_too_small],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
+ [AC_LANG_PROGRAM([[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
@@ -46,10 +46,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
# include <time.h>
#endif
#include <wchar.h>
- int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
- ]])],
- [gl_cv_type_wint_t_too_small=no],
- [gl_cv_type_wint_t_too_small=yes])])
+ int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+ ]])],
+ [gl_cv_type_wint_t_too_small=no],
+ [gl_cv_type_wint_t_too_small=yes])])
if test $gl_cv_type_wint_t_too_small = yes; then
GNULIB_OVERRIDES_WINT_T=1
else
diff --git a/gl/m4/wmemchr.m4 b/gl/m4/wmemchr.m4
new file mode 100644
index 00000000..62bd89ca
--- /dev/null
+++ b/gl/m4/wmemchr.m4
@@ -0,0 +1,32 @@
+# wmemchr.m4 serial 4
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMCHR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ dnl We cannot use AC_CHECK_FUNCS here, because the MSVC 9 header files
+ dnl provide this function as an inline function definition.
+ AC_CACHE_CHECK([for wmemchr], [gl_cv_func_wmemchr],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]],
+ [[return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);]])
+ ],
+ [gl_cv_func_wmemchr=yes],
+ [gl_cv_func_wmemchr=no])
+ ])
+ if test $gl_cv_func_wmemchr = no; then
+ HAVE_WMEMCHR=0
+ fi
+])
diff --git a/gl/m4/wmempcpy.m4 b/gl/m4/wmempcpy.m4
new file mode 100644
index 00000000..1795fc83
--- /dev/null
+++ b/gl/m4/wmempcpy.m4
@@ -0,0 +1,21 @@
+# wmempcpy.m4 serial 1
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMPCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ dnl Persuade glibc <wchar.h> to declare wmempcpy().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The wmempcpy() declaration in lib/wchar.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_FUNCS_ONCE([wmempcpy])
+ if test $ac_cv_func_wmempcpy = no; then
+ HAVE_WMEMPCPY=0
+ fi
+])
diff --git a/gl/po/POTFILES.in b/gl/po/POTFILES.in
index 9349e677..24f3088e 100644
--- a/gl/po/POTFILES.in
+++ b/gl/po/POTFILES.in
@@ -46,6 +46,7 @@ gl/lib/asprintf.c
gl/lib/assure.h
gl/lib/at-func.c
gl/lib/at-func2.c
+gl/lib/attribute.h
gl/lib/basename-lgpl.c
gl/lib/basename.c
gl/lib/bitrotate.c
@@ -63,13 +64,13 @@ gl/lib/cloexec.c
gl/lib/cloexec.h
gl/lib/close.c
gl/lib/closedir.c
+gl/lib/ctype.in.h
gl/lib/dirent-private.h
gl/lib/dirent.in.h
gl/lib/dirfd.c
gl/lib/dirname-lgpl.c
gl/lib/dirname.c
gl/lib/dirname.h
-gl/lib/dosname.h
gl/lib/dup-safer-flag.c
gl/lib/dup-safer.c
gl/lib/dup.c
@@ -180,6 +181,7 @@ gl/lib/idpriv.h
gl/lib/intprops.h
gl/lib/inttypes.in.h
gl/lib/ioctl.c
+gl/lib/isblank.c
gl/lib/itold.c
gl/lib/langinfo.in.h
gl/lib/lc-charset-dispatch.c
@@ -364,6 +366,9 @@ gl/lib/windows-recmutex.c
gl/lib/windows-recmutex.h
gl/lib/windows-rwlock.c
gl/lib/windows-rwlock.h
+gl/lib/wmemchr-impl.h
+gl/lib/wmemchr.c
+gl/lib/wmempcpy.c
gl/lib/xalloc-die.c
gl/lib/xalloc-oversized.h
gl/lib/xalloc.h
diff --git a/gl/po/af.po b/gl/po/af.po
index 2d3eed98..e10cafe6 100644
--- a/gl/po/af.po
+++ b/gl/po/af.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: coreutils 5.2.1\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2004-03-17 11:58+0200\n"
"Last-Translator: Petri Jooste <rkwjpj@puk.ac.za>\n"
"Language-Team: Afrikaans <i18n@af.org.za>\n"
diff --git a/gl/po/be.po b/gl/po/be.po
index ad9cf620..1ad7eb60 100644
--- a/gl/po/be.po
+++ b/gl/po/be.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: coreutils 5.0.91\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2003-10-30 01:10+0200\n"
"Last-Translator: Ales Nyakhaychyk <nab@mail.by>\n"
"Language-Team: Belarusian <i18n@mova.org>\n"
diff --git a/gl/po/bg.gmo b/gl/po/bg.gmo
index f8852fe3..f0a00f32 100644
--- a/gl/po/bg.gmo
+++ b/gl/po/bg.gmo
Binary files differ
diff --git a/gl/po/bg.po b/gl/po/bg.po
index ef8b60fd..61aa5154 100644
--- a/gl/po/bg.po
+++ b/gl/po/bg.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
-"PO-Revision-Date: 2019-05-19 18:14+0200\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
+"PO-Revision-Date: 2020-03-10 09:45+0100\n"
"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
"Language-Team: Bulgarian <dict@ludost.net>\n"
"Language: bg\n"
@@ -103,7 +103,7 @@ msgstr "извеждане на версията на програмата"
#: gl/lib/argp-parse.c:171
msgid "(PROGRAM ERROR) No version known!?"
-msgstr "ГРЕШКА: Неизвестна версия!"
+msgstr "(ДЕФЕКТ В ПРОГРАМАТА) Неизвестна версия!"
#: gl/lib/argp-parse.c:624
#, c-format
@@ -112,7 +112,7 @@ msgstr "%s: Твърде много аргументи\n"
#: gl/lib/argp-parse.c:770
msgid "(PROGRAM ERROR) Option should have been recognized!?"
-msgstr "ГРЕШКА: Непозната опция, а трябва да се разпознава!"
+msgstr "(ДЕФЕКТ В ПРОГРАМАТА) Опцията би трябвало да е била разпозната!"
#: gl/lib/getopt.c:278
#, c-format
diff --git a/gl/po/ca.po b/gl/po/ca.po
index 8be91cde..df6aef42 100644
--- a/gl/po/ca.po
+++ b/gl/po/ca.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mailutils 0.6.90\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2005-05-21 04:10+0200\n"
"Last-Translator: Jordi Mallach <jordi@gnu.org>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
diff --git a/gl/po/cs.po b/gl/po/cs.po
index 469cfabf..cfaa91d4 100644
--- a/gl/po/cs.po
+++ b/gl/po/cs.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2011-12-04 08:50+0100\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
diff --git a/gl/po/da.po b/gl/po/da.po
index c5db0e09..897d8814 100644
--- a/gl/po/da.po
+++ b/gl/po/da.po
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2011-01-20 22:11+0100\n"
"Last-Translator: Keld Simonsen <keld@keldix.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
diff --git a/gl/po/de.po b/gl/po/de.po
index 75efcd7b..4c84fc20 100644
--- a/gl/po/de.po
+++ b/gl/po/de.po
@@ -35,7 +35,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU gnulib-4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-22 20:00+0200\n"
"Last-Translator: Roland Illig <roland.illig@gmx.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
diff --git a/gl/po/el.po b/gl/po/el.po
index 895f3829..32e6a7a5 100644
--- a/gl/po/el.po
+++ b/gl/po/el.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2012-03-11 11:25+0100\n"
"Last-Translator: Simos Xenitellis <simos.lists@googlemail.com>\n"
"Language-Team: Greek <team@lists.gnome.gr>\n"
diff --git a/gl/po/eo.po b/gl/po/eo.po
index 7c1a49c8..3b6d39d3 100644
--- a/gl/po/eo.po
+++ b/gl/po/eo.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-19 18:26-0300\n"
"Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
diff --git a/gl/po/es.po b/gl/po/es.po
index 431afbfa..406dc5dc 100644
--- a/gl/po/es.po
+++ b/gl/po/es.po
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2011-08-24 11:23-0500\n"
"Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n"
"Language-Team: Spanish <es@li.org>\n"
diff --git a/gl/po/et.po b/gl/po/et.po
index 29df73bf..572835fb 100644
--- a/gl/po/et.po
+++ b/gl/po/et.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2011-05-19 15:10+0300\n"
"Last-Translator: Toomas Soome <Toomas.Soome@microlink.ee>\n"
"Language-Team: Estonian <linux-ee@lists.eenet.ee>\n"
diff --git a/gl/po/eu.po b/gl/po/eu.po
index 7cb01e99..87559f73 100644
--- a/gl/po/eu.po
+++ b/gl/po/eu.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: coreutils-5.2.1\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2005-01-04 20:27+0100\n"
"Last-Translator: Mikel Olasagasti <hey_neken@mundurat.net>\n"
"Language-Team: Basque <translation-team-eu@lists.sourceforge.net>\n"
diff --git a/gl/po/fi.po b/gl/po/fi.po
index 61c83b70..559e8041 100644
--- a/gl/po/fi.po
+++ b/gl/po/fi.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-12-26 12:28+0200\n"
"Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
diff --git a/gl/po/fr.po b/gl/po/fr.po
index 61429c55..ab0a57bb 100644
--- a/gl/po/fr.po
+++ b/gl/po/fr.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib-4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-21 20:15+0200\n"
"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
"Language-Team: French <traduc@traduc.org>\n"
diff --git a/gl/po/ga.po b/gl/po/ga.po
index 09f012d1..444df576 100644
--- a/gl/po/ga.po
+++ b/gl/po/ga.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 1.1\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2007-07-20 12:24-0600\n"
"Last-Translator: Kevin Scannell <kscanne@gmail.com>\n"
"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
diff --git a/gl/po/gl.po b/gl/po/gl.po
index e97e972b..026eb460 100644
--- a/gl/po/gl.po
+++ b/gl/po/gl.po
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2012-11-11 13:26+0200\n"
"Last-Translator: Leandro Regueiro <leandro.regueiro@gmail.com>\n"
"Language-Team: Galician <proxecto@trasno.net>\n"
diff --git a/gl/po/hu.po b/gl/po/hu.po
index 90ac632d..b40eea57 100644
--- a/gl/po/hu.po
+++ b/gl/po/hu.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2014-06-25 19:51+0200\n"
"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
"Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
diff --git a/gl/po/it.po b/gl/po/it.po
index 050135ac..95799f21 100644
--- a/gl/po/it.po
+++ b/gl/po/it.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib-4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-21 14:07+0200\n"
"Last-Translator: Milo Casagrande <milo@milo.name>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
diff --git a/gl/po/ja.po b/gl/po/ja.po
index 163cda5a..227bf778 100644
--- a/gl/po/ja.po
+++ b/gl/po/ja.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2011-09-02 18:39+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
diff --git a/gl/po/ko.po b/gl/po/ko.po
index 12b7b464..dfeeff21 100644
--- a/gl/po/ko.po
+++ b/gl/po/ko.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU textutils 2.0.22\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2002-07-22 20:02+0900\n"
"Last-Translator: Changwoo Ryu <cwryu@debian.org>\n"
"Language-Team: Korean <translation-team-ko@lists.sourceforge.net>\n"
diff --git a/gl/po/man-db-gnulib.pot b/gl/po/man-db-gnulib.pot
index 113e378b..89f87ca0 100644
--- a/gl/po/man-db-gnulib.pot
+++ b/gl/po/man-db-gnulib.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: man-db 2.9.1\n"
+"Project-Id-Version: man-db 2.9.2\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/gl/po/ms.po b/gl/po/ms.po
index e2af1d96..53434d1d 100644
--- a/gl/po/ms.po
+++ b/gl/po/ms.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: coreutils 5.0.90\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2003-08-10 16:00+0800\n"
"Last-Translator: Hasbullah Bin Pit <sebol@ikhlas.com>\n"
"Language-Team: Malay <translation-team-ms@lists.sourceforge.net>\n"
diff --git a/gl/po/nb.po b/gl/po/nb.po
index 54b22492..d5f80a84 100644
--- a/gl/po/nb.po
+++ b/gl/po/nb.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU textutils 2.0.20\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2002-01-27 21:35+0100\n"
"Last-Translator: Eivind Tagseth <eivindt@multinet.no>\n"
"Language-Team: Norwegian <i18n-nb@lister.ping.uio.no>\n"
diff --git a/gl/po/nl.po b/gl/po/nl.po
index 6d7d4c9f..e26088e7 100644
--- a/gl/po/nl.po
+++ b/gl/po/nl.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib-4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-29 13:31+0200\n"
"Last-Translator: Benno Schulenberg <vertaling@coevern.nl>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
diff --git a/gl/po/pl.po b/gl/po/pl.po
index edcb8eb4..e6bc269a 100644
--- a/gl/po/pl.po
+++ b/gl/po/pl.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-19 20:02+0200\n"
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
diff --git a/gl/po/pt.po b/gl/po/pt.po
index 753c8ecf..59806671 100644
--- a/gl/po/pt.po
+++ b/gl/po/pt.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-26 10:40+0100\n"
"Last-Translator: Pedro Albuquerque <palbuquerque73@gmail.com>\n"
"Language-Team: Portuguese <translation-team-pt@lists.sourceforge.net>\n"
diff --git a/gl/po/pt_BR.po b/gl/po/pt_BR.po
index 241880cb..3da55319 100644
--- a/gl/po/pt_BR.po
+++ b/gl/po/pt_BR.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-08-28 15:29-0300\n"
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
diff --git a/gl/po/ro.po b/gl/po/ro.po
index c5d37dd6..fcc41684 100644
--- a/gl/po/ro.po
+++ b/gl/po/ro.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mailutils 0.4\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2003-12-10 08:55+0200\n"
"Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n"
"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
diff --git a/gl/po/ru.po b/gl/po/ru.po
index 0b890abd..f54be6e7 100644
--- a/gl/po/ru.po
+++ b/gl/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-21 18:46+0300\n"
"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
"Language-Team: Russian <gnu@d07.ru>\n"
diff --git a/gl/po/rw.po b/gl/po/rw.po
index 3e795303..2e1a731e 100644
--- a/gl/po/rw.po
+++ b/gl/po/rw.po
@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mailutils 0.6\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2005-04-04 10:55-0700\n"
"Last-Translator: Steven Michael Murphy <murf@e-tools.com>\n"
"Language-Team: Kinyarwanda <translation-team-rw@lists.sourceforge.net>\n"
diff --git a/gl/po/sk.po b/gl/po/sk.po
index 69936b0b..f6577c4a 100644
--- a/gl/po/sk.po
+++ b/gl/po/sk.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: textutils 2.0.14\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2001-06-08 22:10 +02:00\n"
"Last-Translator: Stanislav Meduna <stano@trillian.eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
diff --git a/gl/po/sl.po b/gl/po/sl.po
index b4679f7b..2f1c4454 100644
--- a/gl/po/sl.po
+++ b/gl/po/sl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2012-05-20 13:08+0200\n"
"Last-Translator: Primož Peterlin <primozz.peterlin@gmail.com>\n"
"Language-Team: Slovenian <translation-team-sl@lists.sourceforge.net>\n"
diff --git a/gl/po/sr.gmo b/gl/po/sr.gmo
index 7a606755..4e5de435 100644
--- a/gl/po/sr.gmo
+++ b/gl/po/sr.gmo
Binary files differ
diff --git a/gl/po/sr.po b/gl/po/sr.po
index 539f7dd7..6594df92 100644
--- a/gl/po/sr.po
+++ b/gl/po/sr.po
@@ -1,22 +1,23 @@
# Serbian translation of gnulib.
-# Copyright (C) 2013 Free Software Foundation, Inc.
+# Copyright © 2020 Free Software Foundation, Inc.
# This file is distributed under the same license as the gnulib package.
-# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2013.
+# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2013—2020.
msgid ""
msgstr ""
-"Project-Id-Version: gnulib-3.0.0.6062.a6b16\n"
+"Project-Id-Version: gnulib-4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
-"PO-Revision-Date: 2013-11-17 16:47+0200\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
+"PO-Revision-Date: 2020-04-20 09:38+0200\n"
"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
"Language-Team: Serbian <(nothing)>\n"
"Language: sr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Virtaal 0.7.1\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
#: gl/lib/argp-help.c:158
#, c-format
@@ -59,7 +60,7 @@ msgid " [OPTION...]"
msgstr " [ОПЦИЈА...]"
#: gl/lib/argp-help.c:1670
-#, fuzzy, c-format
+#, c-format
msgid "Try '%s --help' or '%s --usage' for more information.\n"
msgstr "Покушајте „%s --help“ или „%s --usage“ за више података.\n"
@@ -114,29 +115,29 @@ msgid "(PROGRAM ERROR) Option should have been recognized!?"
msgstr "(ГРЕШКА ПРОГРАМА) Опција треба да буде препозната!?"
#: gl/lib/getopt.c:278
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '%s%s' is ambiguous\n"
-msgstr "%s: опција „-W %s“ је нејасна\n"
+msgstr "%s: опција „%s%s“ је нејасна\n"
#: gl/lib/getopt.c:284
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '%s%s' is ambiguous; possibilities:"
-msgstr "%s: опција „%s“ је нејасна; могућности:"
+msgstr "%s: опција „%s%s“ је нејасна; могућности:"
#: gl/lib/getopt.c:319
-#, fuzzy, c-format
+#, c-format
msgid "%s: unrecognized option '%s%s'\n"
-msgstr "%s: непозната опција „%c%s“\n"
+msgstr "%s: непозната опција „%s%s“\n"
#: gl/lib/getopt.c:345
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '%s%s' doesn't allow an argument\n"
-msgstr "%s: опција „%c%s“ не дозвољава аргумент\n"
+msgstr "%s: опција „%s%s“ не дозвољава аргумент\n"
#: gl/lib/getopt.c:360
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '%s%s' requires an argument\n"
-msgstr "%s: опција „--%s“ захтева аргумент\n"
+msgstr "%s: опција „%s%s“ захтева аргумент\n"
#: gl/lib/getopt.c:621
#, c-format
@@ -187,17 +188,16 @@ msgid "Invalid back reference"
msgstr "Неисправна повратна упута"
#: gl/lib/regcomp.c:156
-#, fuzzy
msgid "Unmatched [, [^, [:, [., or [="
-msgstr "Непоклопљено [ или [^"
+msgstr "Неупарено [, [^, [:, [., или [="
#: gl/lib/regcomp.c:159
msgid "Unmatched ( or \\("
-msgstr "Непоклопљено ( или \\("
+msgstr "Неупарено ( или \\("
#: gl/lib/regcomp.c:162
msgid "Unmatched \\{"
-msgstr "Непоклопљено \\{"
+msgstr "Неупарено \\{"
#: gl/lib/regcomp.c:165
msgid "Invalid content of \\{\\}"
@@ -238,7 +238,7 @@ msgstr "меморија је потрошена"
#: gl/lib/xstdopen.c:34
#, c-format
msgid "standard file descriptors"
-msgstr ""
+msgstr "стандардни описници датотеке"
#~ msgid "invalid argument %s for %s"
#~ msgstr "неисправан аргумент „%s“ за „%s“"
@@ -249,8 +249,51 @@ msgstr ""
#~ msgid "Valid arguments are:"
#~ msgstr "Исправни аргументи су:"
-#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
-#~ msgstr "%.*s: „ARGP_HELP_FMT“ параметар мора бити позитиван"
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u битсет_доделе, %u ослобођених (%.2f%%).\n"
+
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_поставки, %u кешираних (%.2f%%)\n"
+
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_повраћаја, %u кешираних (%.2f%%)\n"
+
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_тестова, %u кешираних (%.2f%%)\n"
+
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u битсет_спискова\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "број хистограма дневника\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "величина хистограма дневника\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "хистограм густине\n"
+
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Статистике битсета:\n"
+#~ "\n"
+
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Нагомиланих покретања = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "не могу да читам датотеку стања"
+
+#~ msgid "bad stats file size\n"
+#~ msgstr "лоша величина датотеке стања\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "не могу да пишем датотеку стања"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "не могу да отворим датотеку стања за упис"
#~ msgid "program error"
#~ msgstr "грешка програма"
@@ -281,29 +324,56 @@ msgstr ""
#~ msgid "preserving permissions for %s"
#~ msgstr "причувавам овлашћења за %s"
-#~ msgid "error while opening \"%s\" for reading"
+#~ msgid "error while opening %s for reading"
#~ msgstr "грешка приликом отварања „%s“ за читање"
-#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgid "cannot open backup file %s for writing"
#~ msgstr "не могу да отворим датотеку резерве „%s“ за упис"
-#~ msgid "error reading \"%s\""
+#~ msgid "error reading %s"
#~ msgstr "грешка читања „%s“"
-#~ msgid "error writing \"%s\""
+#~ msgid "error writing %s"
#~ msgstr "грешка писања „%s“"
-#~ msgid "error after reading \"%s\""
+#~ msgid "error after reading %s"
#~ msgstr "грешка након читања „%s“"
#~ msgid "fdopen() failed"
#~ msgstr "није успела функција „fdopen()“"
-#~ msgid "C# compiler not found, try installing pnet"
-#~ msgstr "нисам нашао Ц# преводиоца, покушајте да инсталирате пнет"
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "нисам нашао Ц# преводиоца, покушајте да инсталирате моно"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "нисам нашао Ц# виртуелну машину, покушајте да инсталирате моно"
+
+#~ msgid "unbalanced ["
+#~ msgstr "неуравнотежена ["
+
+#~ msgid "invalid character class"
+#~ msgstr "неисправна класа знака"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "синтакса класе знака је [[:space:]], а не [:space:]"
-#~ msgid "C# virtual machine not found, try installing pnet"
-#~ msgstr "нисам нашао Ц# виртуелну машину, покушајте да инсталирате пнет"
+#~ msgid "unfinished \\ escape"
+#~ msgstr "недовршена \\ излаза"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "неисправан садржај \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "регуларни израз је превелик"
+
+#~ msgid "unbalanced ("
+#~ msgstr "неуравнотежена ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "није наведена синтакса"
+
+#~ msgid "unbalanced )"
+#~ msgstr "неуравнотежена )"
#~ msgid "%s subprocess failed"
#~ msgstr "%s потпроцес није успео"
@@ -317,21 +387,9 @@ msgstr ""
#~ msgid "directory"
#~ msgstr "директоријум"
-#~ msgid "block special file"
-#~ msgstr "посебна датотека блока"
-
-#~ msgid "character special file"
-#~ msgstr "посебна датотека знака"
-
-#~ msgid "fifo"
-#~ msgstr "пупи"
-
#~ msgid "symbolic link"
#~ msgstr "симболичка веза"
-#~ msgid "socket"
-#~ msgstr "прикључница"
-
#~ msgid "message queue"
#~ msgstr "ред порука"
@@ -344,6 +402,51 @@ msgstr ""
#~ msgid "typed memory object"
#~ msgstr "типски меморијски објекат"
+#~ msgid "block special file"
+#~ msgstr "посебна датотека блока"
+
+#~ msgid "character special file"
+#~ msgstr "посебна датотека знака"
+
+#~ msgid "contiguous data"
+#~ msgstr "непрекидни подаци"
+
+#~ msgid "fifo"
+#~ msgstr "пупи"
+
+#~ msgid "door"
+#~ msgstr "врата"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "специјална датотека мултиплексираног блока"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "специјална датотека мултиплексираног знака"
+
+#~ msgid "multiplexed file"
+#~ msgstr "мултиплексирана датотека"
+
+#~ msgid "named file"
+#~ msgstr "именована датотека"
+
+#~ msgid "network special file"
+#~ msgstr "посебна датотека мреже"
+
+#~ msgid "migrated file with data"
+#~ msgstr "премештена датотека са подацима"
+
+#~ msgid "migrated file without data"
+#~ msgstr "премештена датотека без података"
+
+#~ msgid "port"
+#~ msgstr "порт"
+
+#~ msgid "socket"
+#~ msgstr "прикључница"
+
+#~ msgid "whiteout"
+#~ msgstr "празнина"
+
#~ msgid "weird file"
#~ msgstr "чудна датотека"
@@ -404,18 +507,6 @@ msgstr ""
#~ msgid "Unknown error"
#~ msgstr "Непозната грешка"
-#~ msgid "%s: option '--%s' doesn't allow an argument\n"
-#~ msgstr "%s: опција „--%s“ не дозвољава аргумент\n"
-
-#~ msgid "%s: unrecognized option '--%s'\n"
-#~ msgstr "%s: непозната опција „--%s“\n"
-
-#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
-#~ msgstr "%s: опција „-W %s“ не дозвољава аргумент\n"
-
-#~ msgid "%s: option '-W %s' requires an argument\n"
-#~ msgstr "%s: опција „-W %s“ захтева аргумент\n"
-
#~ msgid "invalid source_version argument to compile_java_class"
#~ msgstr "неисправан аргумент издања_извора за преведи_јава_разред"
@@ -441,6 +532,9 @@ msgstr ""
#~ msgid "%s subprocess I/O error"
#~ msgstr "У/И грешка %s потпроцеса"
+#~ msgid "cannot stat %s"
+#~ msgstr "не могу да добавим податке за „%s“"
+
#~ msgid "cannot change permissions of %s"
#~ msgstr "не могу да променим овлашћења за „%s“"
@@ -474,9 +568,6 @@ msgstr ""
#~ msgid "%s subprocess terminated with exit code %d"
#~ msgstr "%s потпроцес је окончан са излазном шифром %d"
-#~ msgid "Franc,ois Pinard"
-#~ msgstr "Франсуа Пинард"
-
#~ msgid "`"
#~ msgstr "„"
@@ -606,6 +697,18 @@ msgstr ""
#~ msgid "Unknown signal %d"
#~ msgstr "Непознати сигнал %d"
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Времена извршења (секунди)"
+
+#~ msgid "CPU user"
+#~ msgstr "ЦПЈ корисник"
+
+#~ msgid "CPU system"
+#~ msgstr "ЦПЈ систем"
+
+#~ msgid "wall clock"
+#~ msgstr "зидни сат"
+
#~ msgid "iconv function not usable"
#~ msgstr "иконв функција није употребљива"
@@ -643,19 +746,13 @@ msgstr ""
#~ msgstr "©"
#~ msgid ""
-#~ "\n"
-#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
-#~ "html>.\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
#~ "This is free software: you are free to change and redistribute it.\n"
#~ "There is NO WARRANTY, to the extent permitted by law.\n"
-#~ "\n"
#~ msgstr ""
-#~ "\n"
-#~ "Лиценца ОЈЛв3+: ГНУ ОЈЛ издање 3 или касније <http://gnu.org/licenses/gpl."
-#~ "html>.\n"
+#~ "Лиценца ОЈЛи3+: ГНУ ОЈЛ издање 3 или новије <%s>.\n"
#~ "Ово је слободан софтвер: слободни сте да га мењате и расподељујете.\n"
#~ "Не постоји НИКАКВА ГАРАНЦИЈА, у оквирима дозвољеним законом.\n"
-#~ "\n"
#~ msgid "Written by %s.\n"
#~ msgstr "Написао је %s.\n"
@@ -721,12 +818,8 @@ msgstr ""
#~ "%s, %s, %s, %s,\n"
#~ "%s, %s, и други.\n"
-#~ msgid ""
-#~ "\n"
-#~ "Report bugs to: %s\n"
-#~ msgstr ""
-#~ "\n"
-#~ "Грешке пријавите на: %s\n"
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Грешке пријавите на: %s\n"
#~ msgid "Report %s bugs to: %s\n"
#~ msgstr "Грешке програма „%s“ пријавите на: %s\n"
@@ -734,11 +827,8 @@ msgstr ""
#~ msgid "%s home page: <%s>\n"
#~ msgstr "%s матична страница: <%s>\n"
-#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
-#~ msgstr "%s матична страница: <http://www.gnu.org/software/%s/>\n"
-
-#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
-#~ msgstr "Општа помоћ користећи ГНУ софтвер: <http://www.gnu.org/gethelp/>\n"
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Општа помоћ користећи ГНУ софтвер: <%s>\n"
#~ msgid "_open_osfhandle failed"
#~ msgstr "„_open_osfhandle“ није успело"
@@ -752,6 +842,9 @@ msgstr ""
#~ msgid "%s subprocess got fatal signal %d"
#~ msgstr "%s потпроцес је добио кобни сигнал %d"
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "нисам успео да подесим текстуални/бинарни режим описника датотеке"
+
#~ msgid "stdin"
#~ msgstr "стдулаз"
@@ -779,11 +872,32 @@ msgstr ""
#~ msgid "cannot perform formatted output"
#~ msgstr "не могу да извршим обликовани излаз"
-#~ msgid "invalid %s%s argument `%s'"
+#~ msgid "invalid %s%s argument '%s'"
#~ msgstr "неисправан %s%s аргумент „%s“"
-#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgid "invalid suffix in %s%s argument '%s'"
#~ msgstr "неисправан суфикс у %s%s аргумент „%s“"
-#~ msgid "%s%s argument `%s' too large"
+#~ msgid "%s%s argument '%s' too large"
#~ msgstr "%s%s аргумент „%s“ је превелик"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: „ARGP_HELP_FMT“ параметар мора бити позитиван"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „--%s“ не дозвољава аргумент\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: непозната опција „--%s“\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „-W %s“ не дозвољава аргумент\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: опција „-W %s“ захтева аргумент\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Франсуа Пинард"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s матична страница: <http://www.gnu.org/software/%s/>\n"
diff --git a/gl/po/sv.gmo b/gl/po/sv.gmo
index e081639c..4599839b 100644
--- a/gl/po/sv.gmo
+++ b/gl/po/sv.gmo
Binary files differ
diff --git a/gl/po/sv.po b/gl/po/sv.po
index 7617f17c..a6af57ea 100644
--- a/gl/po/sv.po
+++ b/gl/po/sv.po
@@ -1,21 +1,21 @@
# Swedish messages for gnulib.
-# Copyright © 1997, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019 Free Software Foundation, Inc.
+# Copyright © 1997, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019, 2020 Free Software Foundation, Inc.
# This file is distributed under the same license as the gnulib package.
# Peter Antman <peter.antman@abc.se>, 1997.
# Thomas Olsson <cid95tho@lustudat.student.lu.se>, 1997.
# Daniel Resare <daniel@resare.com>, 1999, 2000.
-# Göran Uddeborg <goeran@uddeborg.se>, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019.
+# Göran Uddeborg <goeran@uddeborg.se>, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019, 2020.
#
-# $Revision: 1.14 $
+# $Revision: 1.19 $
#
msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
-"PO-Revision-Date: 2019-05-21 10:41+0200\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
+"PO-Revision-Date: 2020-05-28 21:40+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
-"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language-Team: Swedish <tp-sv-list@lists.sourceforge.net>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -31,7 +31,7 @@ msgstr "ARGP_HELP_FMT: värdet på %s är mindre än eller lika med %s"
#: gl/lib/argp-help.c:234
#, c-format
msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
-msgstr "%.*s: ARGP_HELP_FMT parametern kräver ett värde"
+msgstr "%.*s: ARGP_HELP_FMT-parametern kräver ett värde"
#: gl/lib/argp-help.c:244
#, c-format
@@ -73,7 +73,8 @@ msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information
msgid "Report bugs to %s.\n"
msgstr ""
"Rapportera fel till %s.\n"
-"Skicka synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n"
+"Skicka synpunkter på översättningen till <tp-sv-list@lists.sourceforge."
+"net>.\n"
#: gl/lib/argp-help.c:1898 gl/lib/error.c:195
msgid "Unknown system error"
@@ -148,12 +149,12 @@ msgstr "%s: flaggan ”%s%s” kräver ett argument\n"
#: gl/lib/getopt.c:621
#, c-format
msgid "%s: invalid option -- '%c'\n"
-msgstr "%s: ogiltig flagga -- \"%c\"\n"
+msgstr "%s: ogiltig flagga -- ”%c”\n"
#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
#, c-format
msgid "%s: option requires an argument -- '%c'\n"
-msgstr "%s: flaggan kräver ett argument -- \"%c\"\n"
+msgstr "%s: flaggan kräver ett argument -- ”%c”\n"
#: gl/lib/openat-die.c:38
#, c-format
@@ -203,7 +204,7 @@ msgstr "Ensam ( eller \\("
#: gl/lib/regcomp.c:162
msgid "Unmatched \\{"
-msgstr "Ensam \\\\{"
+msgstr "Ensam \\{"
#: gl/lib/regcomp.c:165
msgid "Invalid content of \\{\\}"
@@ -256,16 +257,16 @@ msgstr "standard filbeskrivare"
#~ msgstr "Giltiga argument är:"
#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
-#~ msgstr "%u bitset-allokeringar, %u friade (%.2f%%).\n"
+#~ msgstr "%u bitset-allokeringar, %u frigjorda (%.2f %%).\n"
#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
-#~ msgstr "%u bitset-mängder, %u cachade (%.2f%%)\n"
+#~ msgstr "%u bitset-mängder, %u cachade (%.2f %%)\n"
#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
-#~ msgstr "%u bitset-återställningar, %u cachade (%.2f%%)\n"
+#~ msgstr "%u bitset-återställningar, %u cachade (%.2f %%)\n"
#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
-#~ msgstr "%u bitset-tester, %u cachade (%.2f%%)\n"
+#~ msgstr "%u bitset-tester, %u cachade (%.2f %%)\n"
#~ msgid "%u bitset_lists\n"
#~ msgstr "%u bitset-listor\n"
@@ -332,7 +333,7 @@ msgstr "standard filbeskrivare"
#~ msgstr "fel när %s öppnades för läsning"
#~ msgid "cannot open backup file %s for writing"
-#~ msgstr "det går inte att öppna säkerthetskopiefil %s för skrivning"
+#~ msgstr "det går inte att öppna säkerhetskopiefilen %s för skrivning"
#~ msgid "error reading %s"
#~ msgstr "fel vid läsning av %s"
@@ -350,7 +351,7 @@ msgstr "standard filbeskrivare"
#~ msgstr "C#-kompilator hittades inte, försök installera mono"
#~ msgid "C# virtual machine not found, try installing mono"
-#~ msgstr "virtuell C#-maskinen hittades inte, försök installera mono"
+#~ msgstr "den virtuella C#-maskinen hittades inte, försök installera mono"
#~ msgid "unbalanced ["
#~ msgstr "obalanserad ["
@@ -494,10 +495,10 @@ msgstr "standard filbeskrivare"
#~ msgstr "Bearbetar pågående begäran"
#~ msgid "Request canceled"
-#~ msgstr "Begäran annulerad"
+#~ msgstr "Begäran annullerad"
#~ msgid "Request not canceled"
-#~ msgstr "Begäran inte annulerad"
+#~ msgstr "Begäran inte annullerad"
#~ msgid "All requests done"
#~ msgstr "Alla begäran utförda"
@@ -518,7 +519,7 @@ msgstr "standard filbeskrivare"
#~ msgstr "ogiltigt target_version-argument till compile_java_class"
#~ msgid "failed to create \"%s\""
-#~ msgstr "det gick inte att skapa \"%s\""
+#~ msgstr "det gick inte att skapa ”%s”"
#~ msgid "error while writing \"%s\" file"
#~ msgstr "fel vid skrivning av filen ”%s”"
@@ -656,10 +657,10 @@ msgstr "standard filbeskrivare"
#~ msgstr "Begränsning av filstorlek överskriden"
#~ msgid "Virtual timer expired"
-#~ msgstr "Alarmklocka - virtuell tid"
+#~ msgstr "Alarmklocka - virtuell tid gick ut"
#~ msgid "Profiling timer expired"
-#~ msgstr "Profileringsklocka"
+#~ msgstr "Profileringsklocka gick ut"
#~ msgid "Window changed"
#~ msgstr "Ändrat fönster"
@@ -695,7 +696,7 @@ msgstr "standard filbeskrivare"
#~ msgstr "kan inte skapa rör"
#~ msgid "Real-time signal %d"
-#~ msgstr "Realtidsignal %d"
+#~ msgstr "Realtidssignal %d"
#~ msgid "Unknown signal %d"
#~ msgstr "Okänd signal %d"
@@ -825,13 +826,14 @@ msgstr "standard filbeskrivare"
#~ msgid "Report bugs to: %s\n"
#~ msgstr ""
#~ "Rapportera fel till: %s\n"
-#~ "Skicka synpunkter på översättningen till: tp-sv@listor.tp-sv.se\n"
+#~ "Skicka synpunkter på översättningen till: tp-sv-list@lists.sourceforg."
+#~ "net\n"
#~ msgid "Report %s bugs to: %s\n"
#~ msgstr "Rapportera %s-fel till: %s\n"
#~ msgid "%s home page: <%s>\n"
-#~ msgstr "%s hemsida: <%s>\n"
+#~ msgstr "Webbsida för %s: <%s>\n"
#~ msgid "General help using GNU software: <%s>\n"
#~ msgstr "Allmän hjälp med att använda GNU-program: <%s>\n"
@@ -849,7 +851,7 @@ msgstr "standard filbeskrivare"
#~ msgstr "%s-underprocess fick ödesdiger signal %d"
#~ msgid "failed to set file descriptor text/binary mode"
-#~ msgstr "misslyckades att filbeskrivaren i text-/binärt läge"
+#~ msgstr "misslyckades att sätta filbeskrivaren i text-/binärt läge"
#~ msgid "stdin"
#~ msgstr "standard in"
diff --git a/gl/po/tr.po b/gl/po/tr.po
index 41f28cf2..1509d9f2 100644
--- a/gl/po/tr.po
+++ b/gl/po/tr.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: coreutils 5.3.0\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2005-03-14 04:17+0200\n"
"Last-Translator: Deniz Akkus Kanca <deniz@arayan.com>\n"
"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
diff --git a/gl/po/uk.po b/gl/po/uk.po
index 8f143494..eadd2408 100644
--- a/gl/po/uk.po
+++ b/gl/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-05-19 14:26+0300\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
diff --git a/gl/po/vi.po b/gl/po/vi.po
index 998de73f..4631c144 100644
--- a/gl/po/vi.po
+++ b/gl/po/vi.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib-3.0.0.6062.a6b16\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2014-01-13 08:31+0700\n"
"Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n"
"Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n"
diff --git a/gl/po/zh_CN.po b/gl/po/zh_CN.po
index ea3f96a7..40a2f83e 100644
--- a/gl/po/zh_CN.po
+++ b/gl/po/zh_CN.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2010-02-26 09:54+0800\n"
"Last-Translator: Ji ZhengYu <zhengyuji@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
diff --git a/gl/po/zh_TW.po b/gl/po/zh_TW.po
index 378b0c80..a2d53f35 100644
--- a/gl/po/zh_TW.po
+++ b/gl/po/zh_TW.po
@@ -14,7 +14,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnulib 4.0.0.2567\n"
"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
-"POT-Creation-Date: 2020-02-25 16:53+0000\n"
+"POT-Creation-Date: 2020-06-01 17:02+0100\n"
"PO-Revision-Date: 2019-12-15 13:01+0800\n"
"Last-Translator: pan93412 <pan93412@gmail.com>\n"
"Language-Team: Chinese (traditional) <zh-l10n@lists.linux.org.tw>\n"