]>
Savannah Git Hosting - gnulib.git/log
Bruno Haible [Sat, 2 May 2020 21:21:00 +0000 (23:21 +0200)]
list: Add get_first, get_last, set_first, set_last operations.
* lib/gl_list.h (gl_list_get_first, gl_list_get_last,
gl_list_nx_set_first, gl_list_nx_set_last): New functions.
* lib/gl_xlist.h (gl_list_set_first, gl_list_set_last): New functions.
Bruno Haible [Sat, 2 May 2020 19:14:29 +0000 (21:14 +0200)]
list: Remove redundant code for remove_first and remove_last operations.
* lib/gl_list.h (struct gl_list_implementation): Remove fields
remove_first, remove_last.
(gl_list_remove_first, gl_list_remove_last): Implement in a generic way.
* lib/gl_array_list.c: Revert last change.
* lib/gl_carray_list.c: Likewise.
* lib/gl_anylinked_list2.h: Likewise.
* lib/gl_linked_list.c: Likewise.
* lib/gl_linkedhash_list.c: Likewise.
* lib/gl_anytree_list2.h: Likewise.
* lib/gl_avltree_list.c: Likewise.
* lib/gl_avltreehash_list.c: Likewise.
* lib/gl_rbtree_list.c: Likewise.
* lib/gl_rbtreehash_list.c: Likewise.
* lib/gl_sublist.c: Likewise.
Karl Berry [Sat, 2 May 2020 16:10:58 +0000 (09:10 -0700)]
autoupdate
Bruno Haible [Sat, 2 May 2020 15:36:56 +0000 (17:36 +0200)]
bison-i18n: Fix typo in last commit.
* m4/bison-i18n.m4 (BISON_I18N): Fix typo in the --help output.
Bruno Haible [Sat, 2 May 2020 15:23:01 +0000 (17:23 +0200)]
bison-i18n: Add support for cross-compilation.
Reported by Hongxu Jia <hongxu.jia@windriver.com> in
<https://lists.gnu.org/archive/html/bison-patches/2016-02/msg00000.html>
via Akim Demaille <akim@lrde.epita.fr>.
* m4/bison-i18n.m4 (BISON_I18N): Accept a configure option
--with-bison-prefix=PREFIX and use it to determine BISON_LOCALEDIR.
Don't use bison's --print-localedir option when cross-compiling.
Also, fix an error message and a comment.
Bruno Haible [Fri, 1 May 2020 23:56:17 +0000 (01:56 +0200)]
list: Add remove_first and remove_last operations.
Suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00092.html>.
* lib/gl_list.h (struct gl_list_implementation): Add fields
remove_first, remove_last.
(gl_list_remove_first, gl_list_remove_last): New functions.
* lib/gl_array_list.c (gl_array_remove_first, gl_array_remove_last): New
functions, based on gl_array_remove_at.
(gl_array_list_implementation): Implement the new operations.
* lib/gl_carray_list.c (gl_carray_remove_first, gl_carray_remove_last):
New functions, based on gl_carray_remove_at.
(gl_carray_list_implementation): Implement the new operations.
* lib/gl_anylinked_list2.h (gl_linked_remove_first,
gl_linked_remove_last): New functions, based on gl_linked_remove_at.
* lib/gl_linked_list.c (gl_linked_list_implementation): Implement the
new operations.
* lib/gl_linkedhash_list.c (gl_linkedhash_list_implementation):
Likewise.
* lib/gl_anytree_list2.h (gl_tree_remove_first, gl_tree_remove_last):
New functions, based on gl_tree_remove_at.
* lib/gl_avltree_list.c (gl_avltree_list_implementation): Implement the
new operations.
* lib/gl_avltreehash_list.c (gl_avltreehash_list_implementation):
Likewise.
* lib/gl_rbtree_list.c (gl_rbtree_list_implementation): Likewise.
* lib/gl_rbtreehash_list.c (gl_rbtreehash_list_implementation):
Likewise.
* lib/gl_sublist.c (gl_sublist_remove_first, gl_sublist_remove_last):
New functions, based on gl_sublist_remove_at.
(gl_sublist_list_implementation): Implement the new operations.
* lib/gl_list.hh (class gl_List): Add methods remove_first,
remove_last.
* tests/test-array_list.c (main): Test also gl_list_remove_first and
gl_list_remove_last.
* tests/test-avltree_list.c (main): Likewise.
* tests/test-avltreehash_list.c (main): Likewise.
* tests/test-carray_list.c (main): Likewise.
* tests/test-linked_list.c (main): Likewise.
* tests/test-linkedhash_list.c (main): Likewise.
* tests/test-rbtree_list.c (main): Likewise.
* tests/test-rbtreehash_list.c (main): Likewise.
Bruno Haible [Fri, 1 May 2020 16:11:13 +0000 (18:11 +0200)]
parse-datetime: Fix a build failure with an older bison version.
* modules/parse-datetime (Makefile.am): Don't do the post-processing of
parse-datetime.tab.c if a suitable version of bison was not found.
Bruno Haible [Fri, 1 May 2020 16:06:05 +0000 (18:06 +0200)]
bison: New module.
* m4/bison.m4 (gl_PROG_BISON): New macro, extracted from
m4/parse-datetime.m4.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Invoke gl_PROG_BISON.
* modules/bison: New file.
* modules/parse-datetime (Files): Remove m4/bison.m4.
(Depends-on): Add bison.
Jose E. Marchesi [Fri, 1 May 2020 10:26:45 +0000 (12:26 +0200)]
Add poke to users.txt
Bruno Haible [Tue, 28 Apr 2020 10:35:19 +0000 (12:35 +0200)]
posix_spawn_file_actions_addfchdir tests: Enhance test.
* tests/test-posix_spawn5.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Add
findprog.
Bruno Haible [Tue, 28 Apr 2020 10:34:19 +0000 (12:34 +0200)]
posix_spawn_file_actions_addchdir tests: Enhance test.
* tests/test-posix_spawn4.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addchdir-tests (Depends-on): Add
findprog.
Bruno Haible [Tue, 28 Apr 2020 10:29:04 +0000 (12:29 +0200)]
posix_spawn_file_actions_destroy: Fix a crash (bug from 2019-06-10).
* lib/spawn_faction_destroy.c (posix_spawn_file_actions_destroy): Don't
access elements of the wrong union member.
Bruno Haible [Mon, 27 Apr 2020 23:50:17 +0000 (01:50 +0200)]
getdate: Remove deprecated module.
* modules/getdate: Remove file.
* doc/getdate.texi: Remove file.
* lib/getdate.h: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:43:26 +0000 (01:43 +0200)]
realloc: Remove deprecated module.
* modules/realloc: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:41:55 +0000 (01:41 +0200)]
calloc: Remove deprecated module.
* modules/calloc: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:40:19 +0000 (01:40 +0200)]
malloc: Remove deprecated module.
* modules/malloc: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:37:35 +0000 (01:37 +0200)]
fnmatch-posix: Remove deprecated module.
* modules/fnmatch-posix: Remove file.
* MODULES.html.sh (Enhancements for POSIX:2008 functions): Update.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:33:26 +0000 (01:33 +0200)]
pipe: Remove deprecated module.
* modules/pipe: Remove file.
* lib/pipe.h: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:29:16 +0000 (01:29 +0200)]
getopt: Remove deprecated module.
* modules/getopt: Remove file.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:25:01 +0000 (01:25 +0200)]
remove-dest-slash: Remove deprecated module.
* modules/rename-dest-slash: Remove file.
* MODULES.html.sh (Compatibility checks for POSIX:2008 functions):
Update.
* NEWS: Mention the removal.
Bruno Haible [Mon, 27 Apr 2020 23:18:11 +0000 (01:18 +0200)]
unictype/bidicategory-*: Remove deprecated modules.
* modules/unictype/bidicategory-all: Remove file.
* modules/unictype/bidicategory-byname: Remove file.
* modules/unictype/bidicategory-name: Remove file.
* modules/unictype/bidicategory-of: Remove file.
* modules/unictype/bidicategory-test: Remove file.
* MODULES.html.sh (Unicode string functions): Update.
* NEWS: Mention the removals.
Karl Berry [Sun, 26 Apr 2020 16:03:54 +0000 (09:03 -0700)]
autoupdate
Paul Eggert [Sat, 25 Apr 2020 18:02:53 +0000 (11:02 -0700)]
Tune fts for FTS_LOGICAL+FTS_NOSTAT
From a suggestion by Askar Safin in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00074.html
* lib/fts.c (fts_build): If file types are known, optimize
FTS_LOGICAL+FTS_NOSTAT for non-symlinks and non-directories the
same way that we already optimize FTS_PHYSICAL+FTS_NOSTAT for
non-directories.
Karl Berry [Sat, 25 Apr 2020 16:17:48 +0000 (09:17 -0700)]
autoupdate
Bruno Haible [Sun, 19 Apr 2020 15:02:16 +0000 (17:02 +0200)]
vasnprintf: Add support for printing wide characters using escapes.
* lib/vasnprintf.c (ENABLE_WCHAR_FALLBACK): Document optional macro.
(wctomb_fallback): New function.
(local_wctomb): New function.
(local_wcrtomb): New function or macro.
(MAX_ROOM_NEEDED): Adjust estimate for %lc.
(VASNPRINTF): Simplify %ls code by use of local_wcrtomb. Add code for
%lc.
Paul Eggert [Thu, 16 Apr 2020 03:50:32 +0000 (20:50 -0700)]
fts: remove NOSTAT_LEAF_OPTIMIZATION
It caused ‘find’ and ‘du’ to dump core, and it was useful
only for obsolescent Linux filesystems anyway. Problem reported in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html
Quite possibly there is still a serious underlying fts bug with
tight-loop-check and mutating file systems, but if so this patch
should cause the bug to be triggered less often.
* lib/fts.c (enum leaf_optimization): Remove
NOSTAT_LEAF_OPTIMIZATION, as it’s problematic.
(S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed.
(leaf_optimization): Remove special cases for ReiserFS and XFS.
(fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code.
* lib/fts_.h (struct _ftsent.fts_n_dirs_remaining):
Remove. All uses removed.
Bastien Roucariès [Mon, 13 Apr 2020 22:48:16 +0000 (00:48 +0200)]
explicit_bzero: Improve code style.
* lib/explicit_bzero.c (explicit_bzero): Use '\0' instead of 0.
Bastien Roucariès [Sun, 12 Apr 2020 23:09:15 +0000 (01:09 +0200)]
explicit_bzero: On native Windows, use SecureZeroMemory().
* lib/explicit_bzero.c: Include <windows.h>.
(explicit_bzero): On native Windows, use SecureZeroMemory.
Signed-off-by: Bastien Roucariès <rouca@debian.org>
Bastien Roucariès [Sun, 12 Apr 2020 23:09:14 +0000 (01:09 +0200)]
explicit_bzero: Use memset_s() when available.
Some OS define memset_s instead of explicit_bzero. Use it.
* lib/explicit_bzero.c (__STDC_WANT_LIB_EXT1__): Define.
(explicit_bzero): Use memset_s when available.
* m4/explicit_bzero.m4 (gl_PREREQ_EXPLICIT_BZERO): Test for memset_s.
Signed-off-by: Bastien Roucariès <rouca@debian.org>
Bastien Roucariès [Sun, 12 Apr 2020 23:09:13 +0000 (01:09 +0200)]
explicit_bzero tests: Fix test failure on OpenBSD 6.5.
Some implementation could add canaries after free failling the test.
* tests/test-explicit_bzero.c (test_heap): Handle implementations of
free() that overwrite the memory with canaries.
Signed-off-by: Bastien Roucariès <rouca@debian.org>
Akim Demaille [Mon, 13 Apr 2020 15:39:38 +0000 (17:39 +0200)]
bootstrap: recommend git submodule update --init
Reported by Bruno Haible.
<https://lists.gnu.org/r/bug-gnulib/2020-03/msg00101.html>
* build-aux/bootstrap: recommand "git submodule update --init"
rather than "git submodule init".
Bruno Haible [Sun, 12 Apr 2020 19:00:10 +0000 (21:00 +0200)]
explicit_bzero: Add tests.
* tests/test-explicit_bzero.c: New file.
* modules/explicit_bzero-tests: New file.
Bruno Haible [Sat, 11 Apr 2020 23:00:47 +0000 (01:00 +0200)]
explicit_bzero: Relicense under LGPLv2+.
Approved by Paul Eggert.
* modules/explicit_bzero (License): Change to LGPLv2+.
Bruno Haible [Fri, 10 Apr 2020 13:57:10 +0000 (15:57 +0200)]
findprog, relocatable-prog: Ignore directories during PATH search.
Reported by Frederick Eaton via Dmitry Goncharov in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>.
* lib/findprog.c (find_in_path): When the file found in a PATH element
is a directory, continue searching.
* modules/findprog (Depends-on): Add sys_stat, stat.
* modules/findprog-lgpl (Depends-on): Likewise.
* lib/progreloc.c (maybe_executable): When the file found in a PATH
element is a directory, continue searching.
* lib/relocwrapper.c: Update comments.
* modules/relocatable-prog-wrapper (Files): Add m4/largefile.m4.
(configure.ac-early): New section.
Bruno Haible [Fri, 10 Apr 2020 12:21:47 +0000 (14:21 +0200)]
MODULES.html.sh: Support for reproducible builds from git-less tarballs.
Reported by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00061.html>.
* MODULES.html.sh: In a git-less tarball, use the date of the first
ChangeLog entry.
Bruno Haible [Sat, 4 Apr 2020 15:34:32 +0000 (17:34 +0200)]
Fix comments: The gettext library is under LGPL 2.1, not LGPL 2.0.
* m4/gettext.m4: Fix comments regarding the gettext library.
* m4/intl-thread-locale.m4: Likewise.
* m4/intlmacosx.m4: Likewise.
* m4/lcmessage.m4: Likewise.
* m4/nls.m4: Likewise.
* m4/po.m4: Likewise.
* m4/progtest.m4: Likewise.
Jim Meyering [Sat, 4 Apr 2020 15:14:04 +0000 (08:14 -0700)]
ChangeLog: s/g/git/ in previous description.
Jim Meyering [Sat, 4 Apr 2020 15:11:47 +0000 (08:11 -0700)]
maint: remove a stray inter-word space in a 6x-repeated comment
Induce the changes by running this:
re='by perl'; g grep -l "$re"|xargs perl -pi -e "s/$re/by perl/"
* build-aux/announce-gen: Change "by perl" to "by perl".
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/prefix-gnulib-mk: Likewise.
* build-aux/update-copyright: Likewise.
* build-aux/useless-if-before-free: Likewise.
* tests/test-update-copyright.sh: Likewise.
Karl Berry [Wed, 1 Apr 2020 16:52:15 +0000 (09:52 -0700)]
autoupdate
Bruno Haible [Sat, 28 Mar 2020 14:54:12 +0000 (15:54 +0100)]
Use module 'filename' instead of module 'dosname'.
* lib/at-func.c: Include filename.h instead of dosname.h.
* lib/unlinkat.c: Likewise.
* modules/areadlinkat (Depends-on): Add filename. Remove dosname.
* modules/areadlinkat-with-size (Depends-on): Likewise.
* modules/faccessat (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fchownat (Depends-on): Likewise.
* modules/fstatat (Depends-on): Likewise.
* modules/mkdirat (Depends-on): Likewise.
* modules/mkfifoat (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/selinux-at (Depends-on): Likewise.
* modules/symlinkat (Depends-on): Likewise.
* modules/unlinkat (Depends-on): Likewise.
* modules/utimensat (Depends-on): Likewise.
* lib/at-func2.c: Include filename.h instead of dosname.h.
* modules/linkat (Depends-on): Add filename. Remove dosname.
* modules/renameatu (Depends-on): Likewise.
* lib/canonicalize.c: Include filename.h instead of dosname.h.
* lib/canonicalize-lgpl.c: Likewise.
* modules/canonicalize (Depends-on): Add filename.
* modules/canonicalize-lgpl (Depends-on): Likewise.
* lib/dirname.h: Include filename.h instead of dosname.h.
* modules/dirname-lgpl (Depends-on): Add filename. Remove dosname.
* lib/fchdir.c: Include filename.h instead of dosname.h.
* modules/fchdir (Depends-on): Add filename. Remove dosname.
* lib/openat.c: Include filename.h instead of dosname.h.
* modules/openat (Depends-on): Add filename. Remove dosname.
* lib/rmdir.c: Include filename.h instead of dosname.h.
* modules/rmdir (Depends-on): Add filename. Remove dosname.
* lib/savewd.c: Include filename.h instead of dosname.h.
* modules/savewd (Depends-on): Add filename. Remove dosname.
* lib/unlink.c: Include filename.h instead of dosname.h.
* modules/unlink (Depends-on): Add filename. Remove dosname.
* modules/relocatable-prog-wrapper (Depends-on): Add filename.
* lib/relocwrapper.c: Update comments.
* modules/lstat (Depends-on): Remove dosname.
Bruno Haible [Sat, 28 Mar 2020 14:12:41 +0000 (15:12 +0100)]
dosname: Redirect to 'filename'.
Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00042.html>.
* lib/dosname.h: Remove all definitions. Just include filename.h.
* modules/dosname (Status, Notice): Mark as deprecated.
(Depends-on): Add 'filename'.
Bruno Haible [Sat, 28 Mar 2020 13:59:24 +0000 (14:59 +0100)]
dosname: Change IS_RELATIVE_FILE_NAME.
* lib/dosname.h (IS_RELATIVE_FILE_NAME): On native Windows, OS/2, DOS,
change the definition so that IS_RELATIVE_FILE_NAME("c:") is false.
* NEWS: Mention the change.
Bruno Haible [Sat, 28 Mar 2020 13:06:05 +0000 (14:06 +0100)]
filename: Copy some definitions from module 'dosname'.
* lib/filename.h: Include <string.h>, for IS_FILE_NAME_WITH_DIR.
(HAS_DEVICE): Document macro.
(FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): New macro.
(IS_ABSOLUTE_FILE_NAME): Consider
FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE.
(IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New macros.
(IS_ABSOLUTE_PATH, IS_PATH_WITH_DIR): Define as deprecated aliases.
* lib/relocatable.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(DllMain): Update.
* lib/progreloc.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(find_executable): Update.
* NEWS: Document the deprecations.
Paul Eggert [Wed, 25 Mar 2020 19:13:33 +0000 (12:13 -0700)]
getopt-posix: port __GETOPT_PREFIX to macOS
* lib/getopt-pfx-core.h (_GETOPT) [__APPLE__ && __GETOPT_PREFIX]:
Define to work around a problem with asm on macOS (Bug#40205).
Bruno Haible [Sun, 22 Mar 2020 17:11:49 +0000 (18:11 +0100)]
MODULES.html.sh: Add support for reproducible builds.
Reported by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00024.html>.
* MODULES.html.sh: Print the date of the last gnulib commit, not the
current date.
Bruno Haible [Sun, 22 Mar 2020 12:38:45 +0000 (13:38 +0100)]
Several modules: Depend on stat.
* modules/acl-permissions (Depends-on): Add stat.
* modules/canonicalize (Depends-on): Likewise.
* modules/file-has-acl (Depends-on): Likewise.
* modules/fstat (Depends-on): Likewise.
* modules/fstatat (Depends-on): Likewise.
* modules/glob (Depends-on): Likewise.
* modules/javacomp (Depends-on): Likewise.
* modules/linkat (Depends-on): Likewise.
* modules/mkdir (Depends-on): Likewise.
* modules/pt_chown (Depends-on): Likewise.
* modules/ptsname_r (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/rename (Depends-on): Likewise.
* modules/renameatu (Depends-on): Likewise.
* modules/tmpdir (Depends-on): Likewise.
* modules/utimens (Depends-on): Likewise.
* modules/relocatable-prog-wrapper (Depends-on): Add largefile.
* modules/same (Depends-on): Remove stat.
Bruno Haible [Sun, 22 Mar 2020 12:08:53 +0000 (13:08 +0100)]
acl-permissions: Improve autoconf macro.
* m4/acl.m4 (gl_FUNC_ACL): Test the value of gl_need_lib_has_acl
more reliably.
Bruno Haible [Sun, 22 Mar 2020 12:02:57 +0000 (13:02 +0100)]
file-has-acl: Fix module description.
* modules/file-has-acl (Files): Add lib/acl-internal.h, m4/acl.m4.
(Depends-on): Depend on acl-permissions unconditionally.
Bruno Haible [Sun, 22 Mar 2020 01:41:16 +0000 (02:41 +0100)]
unlink: Ensure errno also on native Windows.
* modules/unlink (Depends-on): Add malloc-posix.
Paul Eggert [Sat, 21 Mar 2020 23:13:28 +0000 (16:13 -0700)]
unlink: fix malloc errno typo
Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html
* lib/unlink.c (rpl_unlink): Don’t mask malloc errno.
Bruno Haible [Mon, 16 Mar 2020 13:14:52 +0000 (14:14 +0100)]
*printf-posix: Fix m4 error (regression from 2020-03-08).
* m4/printf.m4 (gl_SNPRINTF_DIRECTIVE_N): Enable interpretation of
brackets in AC_COMPILE_IFELSE invocation.
Bruno Haible [Sun, 8 Mar 2020 23:55:56 +0000 (00:55 +0100)]
crypto/af_alg, renameatu, same, term-style-control: Depend on fstat.
* modules/crypto/af_alg (Depends-on): Add fstat.
* modules/renameatu (Depends-on): Likewise.
* modules/same (Depends-on): Likewise.
* modules/term-style-control (Depends-on): Likewise.
Bruno Haible [Sun, 8 Mar 2020 21:54:02 +0000 (22:54 +0100)]
*printf-posix: Document why it's overridden on some glibc systems.
Reported by Adrian Bunk <bunk@stusta.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00011.html>.
* doc/posix-functions/*printf.texi: Document the problem with the %n
directive on some glibc systems.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N): Adjust
the cross-compilation guesses accordingly.
Bruno Haible [Sat, 7 Mar 2020 19:44:47 +0000 (20:44 +0100)]
Revert my last commit, due to compilation errors.
Paul Eggert [Sat, 7 Mar 2020 19:02:05 +0000 (11:02 -0800)]
open, openat: port to (O_RDWR | O_RDONLY) != 0
Potential portability problem reported by Dan Gohman in:
https://lists.gnu.org/r/bug-gnulib/2020-03/msg00000.html
* lib/open.c (open):
* lib/openat.c (rpl_openat):
Don’t assume O_RDONLY is disjoint from O_RDWR.
Bruno Haible [Sat, 7 Mar 2020 18:56:33 +0000 (19:56 +0100)]
findprog, relocatable-prog: Ignore directories during PATH search.
Reported by Frederick Eaton via Dmitry Goncharov in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>.
* lib/findprog.c (find_in_path): When the file found in a PATH element
is a directory, continue searching.
* lib/progreloc.c (maybe_executable): Likewise.
Bruno Haible [Sat, 7 Mar 2020 17:35:25 +0000 (18:35 +0100)]
openat: Fix theoretically possible issue on GNU/Hurd.
Reported by Dan Gohman <sunfish@mozilla.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00000.html>.
* lib/openat.c (rpl_openat): When testing whether flags contains O_RDWR,
ignore the bits that are also set in O_RDONLY.
Bruno Haible [Mon, 24 Feb 2020 20:19:28 +0000 (21:19 +0100)]
getloadavg: Don't use /usr/local when cross-compiling on AIX.
Reported by Jens Rehsack <sno@netbsd.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00136.html>.
* m4/getloadavg.m4 (gl_GETLOADAVG): Don't look in /usr/local/lib when
cross-compiling.
Bruno Haible [Mon, 24 Feb 2020 20:05:10 +0000 (21:05 +0100)]
fcntl: Add witness of gnulib override.
Reported by Jens Rehsack <sno@netbsd.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00137.html>.
* lib/fcntl.in.h (GNULIB_defined_rpl_fcntl, GNULIB_defined_fcntl): New
macros.
Assaf Gordon [Mon, 24 Feb 2020 06:07:42 +0000 (23:07 -0700)]
users.txt: Add datamash, time
* users.txt: Add datamash, time.
Bruno Haible [Sun, 23 Feb 2020 13:16:53 +0000 (14:16 +0100)]
uni*/base: Use 'restrict'.
* lib/unitypes.in.h (_UC_RESTRICT): New macro, based on '_Restrict_'
from lib/regex.h.
* lib/unistr.in.h (u8_cpy, u16_cpy, u32_cpy, u8_strcpy, u16_strcpy,
u32_strcpy, u8_stpcpy, u16_stpcpy, u32_stpcpy, u8_strncpy, u16_strncpy,
u32_strncpy, u8_stpncpy, u16_stpncpy, u32_stpncpy, u8_strcat,
u16_strcat, u32_strcat, u8_strncat, u16_strncat, u32_strncat, u8_strtok,
u16_strtok, u32_strtok): Use '_UC_RESTRICT'.
* lib/uninorm.in.h (u8_normalize, u16_normalize, u32_normalize): Use
'_UC_RESTRICT'.
* lib/uniconv.in.h (u8_conv_to_encoding, u16_conv_to_encoding,
u32_conv_to_encoding): Use '_UC_RESTRICT'.
* lib/unicase.in.h (u8_toupper, u16_toupper, u32_toupper, u8_tolower,
u16_tolower, u32_tolower, u8_totitle, u16_totitle, u32_totitle,
u8_ct_toupper, u16_ct_toupper, u32_ct_toupper, u8_ct_tolower,
u16_ct_tolower, u32_ct_tolower, u8_ct_totitle, u16_ct_totitle,
u32_ct_totitle, u8_casefold, u16_casefold, u32_casefold, u8_ct_casefold,
u16_ct_casefold, u32_ct_casefold, u8_casexfrm, u16_casexfrm,
u32_casexfrm, ulc_casexfrm): Use '_UC_RESTRICT'.
* lib/unilbrk.in.h (u8_possible_linebreaks, u16_possible_linebreaks,
u32_possible_linebreaks, ulc_possible_linebreaks, u8_width_linebreaks,
u16_width_linebreaks, u32_width_linebreaks, ulc_width_linebreaks): Use
'_UC_RESTRICT'.
* lib/uniwbrk.in.h (ulc_wordbreaks): Use '_UC_RESTRICT'.
* lib/unistdio.in.h (ulc_sprintf, ulc_snprintf, ulc_asnprintf,
ulc_vsprintf, ulc_vsnprintf, ulc_vasnprintf, u8_u8_sprintf,
u8_u8_snprintf, u8_u8_asnprintf, u8_u8_vsprintf, u8_u8_vsnprintf,
u8_u8_vasnprintf, u16_u16_sprintf, u16_u16_snprintf, u16_u16_asnprintf,
u16_u16_vsprintf, u16_u16_vsnprintf, u16_u16_vasnprintf,
u32_u32_sprintf, u32_u32_snprintf, u32_u32_asnprintf, u32_u32_vsprintf,
u32_u32_vsnprintf, u32_u32_vasnprintf): Use '_UC_RESTRICT'.
Bruno Haible [Sun, 23 Feb 2020 13:24:04 +0000 (14:24 +0100)]
glob, spawn: Use improved '_Restrict_' definition.
* lib/glob.in.h (_Restrict_): Use same definition as in lib/regex.h.
* lib/spawn.in.h (_Restrict_, _Restrict_arr_): Likewise.
Bruno Haible [Sun, 23 Feb 2020 12:29:14 +0000 (13:29 +0100)]
crypto/gc: Use 'restrict'.
* lib/gc.h (gc_pbkdf2_hmac, gc_pbkdf2_sha1): Use 'restrict'.
* m4/gc.m4 (gl_GC): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:27:35 +0000 (13:27 +0100)]
crypto/hmac-*: Use 'restrict'.
* lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use
'restrict'.
* modules/crypto/hmac-md5 (configure.ac): Require AC_C_RESTRICT.
* modules/crypto/hmac-sha1 (configure.ac): Likewise.
* modules/crypto/hmac-sha256 (configure.ac): Likewise.
* modules/crypto/hmac-sha512 (configure.ac): Likewise.
Bruno Haible [Sun, 23 Feb 2020 12:25:28 +0000 (13:25 +0100)]
crypto/sm3: Use 'restrict'.
* lib/sm3.h (sm3_finish_ctx, sm3_read_ctx, sm3_buffer): Use 'restrict'.
* m4/sm3.m4 (gl_SM3): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:22:42 +0000 (13:22 +0100)]
crypto/*-buffer: Use 'restrict'.
* lib/gl_openssl.h (GL_CRYPTO_FN (_finish_ctx), GL_CRYPTO_FN (_buffer),
GL_CRYPTO_FN (_read_ctx)): Use 'restrict'.
Bruno Haible [Sun, 23 Feb 2020 12:20:18 +0000 (13:20 +0100)]
crypto/sha512-buffer: Use 'restrict'.
* lib/sha512.h (sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx,
sha384_read_ctx, sha512_buffer, sha384_buffer): Use 'restrict'.
* modules/crypto/sha512-buffer (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:18:33 +0000 (13:18 +0100)]
crypto/sha256-buffer: Use 'restrict'.
* lib/sha256.h (sha256_finish_ctx, sha224_finish_ctx, sha256_read_ctx,
sha224_read_ctx, sha256_buffer, sha224_buffer): Use 'restrict'.
* modules/crypto/sha256-buffer (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:16:44 +0000 (13:16 +0100)]
crypto/sha1-buffer: Use 'restrict'.
* lib/sha1.h (sha1_finish_ctx, sha1_read_ctx, sha1_buffer): Use
'restrict'.
* modules/crypto/sha1-buffer (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:15:15 +0000 (13:15 +0100)]
crypto/md5-buffer: Use 'restrict'.
* lib/md5.h (__md5_finish_ctx, __md5_read_ctx, __md5_buffer): Use
'restrict'.
* modules/crypto/md5-buffer (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:13:38 +0000 (13:13 +0100)]
crypto/md4: Use 'restrict'.
* lib/md4.h (md4_finish_ctx, md4_read_ctx, md4_buffer): Use 'restrict'.
* modules/crypto/md4 (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:12:16 +0000 (13:12 +0100)]
crypto/md2: Use 'restrict'.
* lib/md2.h (md2_finish_ctx, md2_read_ctx, md2_buffer): Use 'restrict'.
* modules/crypto/md2 (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:08:14 +0000 (13:08 +0100)]
crypto/rijndael: Use 'restrict'.
* lib/rijndael-api-fst.h (rijndaelBlockEncrypt, rijndaelPadEncrypt,
rijndaelBlockDecrypt, rijndaelPadDecrypt): Use 'restrict'.
* modules/crypto/rijndael (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:05:57 +0000 (13:05 +0100)]
crypto/arctwo: Use 'restrict'.
* lib/arctwo.h (arctwo_encrypt, arctwo_decrypt): Use 'restrict'.
* modules/crypto/arctwo (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 12:04:13 +0000 (13:04 +0100)]
crypto/arcfour: Use 'restrict'.
* lib/arcfour.h (arcfour_stream): Use 'restrict'.
* modules/crypto/arcfour (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:35:14 +0000 (12:35 +0100)]
careadlinkat: Use 'restrict'.
* lib/careadlinkat.h (careadlinkat): Use 'restrict'.
* modules/careadlinkat (configure.ac): Require AC_C_RESTRICT.
* modules/relocatable-prog-wrapper (configure.ac): Likewise.
Bruno Haible [Sun, 23 Feb 2020 11:33:37 +0000 (12:33 +0100)]
regex-quote: Use 'restrict'.
* lib/regex-quote.h (regex_quote_copy): Use 'restrict'.
* modules/regex-quote (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:32:25 +0000 (12:32 +0100)]
system-quote: Use 'restrict'.
* lib/system-quote.h (system_quote_copy): Use 'restrict'.
* modules/system-quote (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:31:00 +0000 (12:31 +0100)]
sh-quote: Use 'restrict'.
* lib/sh-quote.h (shell_quote_copy): Use 'restrict'.
* modules/sh-quote (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:29:41 +0000 (12:29 +0100)]
quotearg: Use 'restrict'.
* lib/quotearg.h (quotearg_buffer): Use 'restrict'.
* m4/quotearg.m4 (gl_QUOTEARG): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:27:58 +0000 (12:27 +0100)]
parse-datetime: Use 'restrict'.
* lib/parse-datetime.h (parse_datetime, parse_datetime2): Use
'restrict'.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:25:42 +0000 (12:25 +0100)]
nstrftime: Use 'restrict'.
* lib/strftime.h (nstrftime): Use 'restrict'.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:24:01 +0000 (12:24 +0100)]
mbstok_r: Use 'restrict'.
* lib/string.in.h (mbstok_r): Use 'restrict'.
Bruno Haible [Sun, 23 Feb 2020 11:20:35 +0000 (12:20 +0100)]
xmemcoll: Use 'restrict'.
* lib/xmemcoll.h (xmemcoll): Use 'restrict'.
* modules/xmemcoll (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:19:28 +0000 (12:19 +0100)]
memcoll: Use 'restrict'.
* lib/memcoll.h (memcoll): Use 'restrict'.
* m4/memcoll.m4 (gl_MEMCOLL): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:17:44 +0000 (12:17 +0100)]
vasnprintf: Use 'restrict'.
* lib/vasnprintf.h (asnprintf, vasnprintf): Use 'restrict'.
* modules/vasnprintf (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:15:09 +0000 (12:15 +0100)]
c-vasnprintf: Use 'restrict'.
* lib/c-vasnprintf.h (c_vasnprintf): Use 'restrict'.
* modules/c-vasnprintf (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:13:40 +0000 (12:13 +0100)]
c-vsnprintf: Use 'restrict'.
* lib/c-vsnprintf.h (c_vsnprintf): Use 'restrict'.
* modules/c-vsnprintf (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:12:09 +0000 (12:12 +0100)]
c-snprintf: Use 'restrict'.
* lib/c-snprintf.h (c_snprintf): Use 'restrict'.
* modules/c-snprintf (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:06:29 +0000 (12:06 +0100)]
astrxfrm: Use 'restrict'.
* lib/astrxfrm.h (astrxfrm): Use 'restrict'.
* modules/astrxfrm (configure.ac): Require AC_C_RESTRICT.
Bruno Haible [Sun, 23 Feb 2020 11:04:46 +0000 (12:04 +0100)]
amemxfrm: Use 'restrict'.
* lib/amemxfrm.h (amemxfrm): Use 'restrict'.
* modules/amemxfrm (configure.ac): Require AC_C_RESTRICT.
Paul Eggert [Sun, 23 Feb 2020 06:47:06 +0000 (22:47 -0800)]
fchmodat, lchmod: simplify
It appears that we may have overengineered lchmod and fchmodat,
in that the code was prepared for some hypothetical platforms but
was so complicated that it was hard to understand. I attempted to
improve the situation by simplifying the code when this
simplification should not hurt on real platforms; we can re-add
complexity later to port to platforms I didn’t know about.
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod):
Put the ‘defined __linux__ || defined __ANDROID__’ #ifdef only
around the /proc code that needs it.
* lib/fchmodat.c (fchmodat): Coalese calls to orig_fchmodat.
* lib/lchmod.c (__need_system_sys_stat_h): Omit; no longer needed.
Do not include <config.h> twice.
(orig_lchmod) [HAVE_LCHMOD]: Remove, since we need not wrap
lchmod on any known hosts.
(lchmod): Do not defer to fchmodat, so that the lchmod module
need not depend on the fchmodat module (which is a circular
dependency). Do not use openat, since ‘open’ suffices.
Coalesce calls to lchmod/chmod.
* lib/lchmod.c, lib/sys_stat.in.h (lchmod):
* m4/sys_stat_h.m4 (REPLACE_FSTAT):
* modules/lchmod (Depends-on, configure.ac):
* modules/sys_stat (Depends-on):
Do not worry about replacing lchmod, since that shouldn’t happen.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not check for fchmodat.
Do not worry about whether lchmod works on non-symlinks,
since every known lchmod works on non-symlinks.
* modules/lchmod (Depends-on):
Remove circular dependency on fchmodat.
Bruno Haible [Sat, 22 Feb 2020 23:44:20 +0000 (00:44 +0100)]
lchmod: Fix link error on Solaris 10 (regression from 2020-02-16).
* lib/lchmod.c (lchmod): Use the code with lstat and chmod also when
NEED_LCHMOD_NONSYMLINK_FIX is not defined.
Bruno Haible [Sat, 22 Feb 2020 19:57:30 +0000 (20:57 +0100)]
Use 'restrict' in all POSIX function declarations.
* lib/iconv.in.h (iconv): Use 'restrict'.
* lib/inttypes.in.h (strtoimax, strtoumax): Likewise.
* lib/monetary.in.h (strfmon_l): Likewise.
* lib/pthread.in.h (pthread_create, pthread_mutex_init,
pthread_mutexattr_gettype, pthread_mutexattr_getrobust,
pthread_mutex_timedlock, pthread_rwlock_init,
pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock,
pthread_cond_init, pthread_cond_wait, pthread_cond_timedwait): Likewise.
* lib/search.in.h (tdelete): Likewise.
* lib/signal.in.h (pthread_sigmask, sigprocmask): Likewise.
* lib/stdio.in.h (dprintf, fgets, fopen, fprintf, fputs, fread, freopen,
fscanf, fwrite, getdelim, getline, printf, scanf, snprintf, sprintf,
vdprintf, vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf):
Likewise.
* lib/stdlib.in.h (mbtowc, realpath, strtod, strtold, strtoll,
strtoull): Likewise.
* lib/string.in.h (strncat): Likewise.
* lib/sys_socket.in.h (accept, getpeername, getsockname, getsockopt,
recvfrom): Likewise.
* lib/sys_stat.in.h (fstatat, lstat, stat): Likewise.
* lib/time.in.h (strftime): Likewise.
* lib/unistd.in.h (readlink, readlinkat): Likewise.
* lib/wchar.in.h (mbrtowc, mbrlen, mbsrtowcs, mbsnrtowcs, wcrtomb,
wcsrtombs, wcsnrtombs, wmemcpy, wcscpy, wcpcpy, wcsncpy, wcpncpy,
wcscat, wcsncat, wcsxfrm, wcsstr, wcstok, wcsftime): Likewise.
* m4/iconv_h.m4 (gl_ICONV_H): Require AC_C_RESTRICT.
* m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Likewise.
* m4/monetary_h.m4 (gl_MONETARY_H): Likewise.
* m4/search_h.m4 (gl_SEARCH_H): Likewise.
* m4/signal_h.m4 (gl_SIGNAL_H): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H): Likewise.
* m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Make consistent with the
other *_h.m4 files.
* m4/time_h.m4 (gl_HEADER_TIME_H): Likewise.
Bruno Haible [Sat, 22 Feb 2020 22:47:00 +0000 (23:47 +0100)]
Update NEWS.
* NEWS: Mention the last change.
Paul Eggert [Sat, 22 Feb 2020 20:09:11 +0000 (12:09 -0800)]
chmodat, chownat: new modules
These are split from fchmodat, fchownat. GNU Emacs needs the
POSIX-specified fchmodat, but not the gnulib-specified chmodat and
lchmodat. Split the latter two into a new module chmodat.
Similarly for fchownat. This the same basic idea for why statat
was split from fstatat on 2013-01-23.
* lib/chmodat.c, lib/openat.h (CHMODAT_INLINE):
Rename from FCHMODAT_INLINE. All uses changed.
* lib/chownat.c, lib/openat.h (CHOWNAT_INLINE):
Rename from FCHOWNAT_INLINE. All uses changed.
* lib/openat.h:
(chownat, lchownat): Define if GNULIB_CHOWNAT, not GNULIB_FCHOWNAT.
(chmodat, lchmodat): Define if GNULIB_CHMODAT, not GNULIB_FCHMODAT.
* modules/chmodat, modules/chownat, tests/test-chownat.c: New files.
* modules/fchmodat (Files:): Remove lib/fchmodat.c.
(configure.ac): Remove fchmodat module indicator.
(Makefile.am): Omit chmodat.c.
(Maintainer): Add self.
* modules/fchownat: Similarly, but for chown.
* tests/test-fchownat.c (BASE): Don't define if already defined.
(do_chown, do_lchown) [!TEST_CHOWNAT]: Test fchownat instead.
Bruno Haible [Sat, 22 Feb 2020 17:42:50 +0000 (18:42 +0100)]
users.txt: Add groff.
Reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is>.
* users.txt: Add groff.
Bruno Haible [Sat, 22 Feb 2020 14:19:36 +0000 (15:19 +0100)]
Update gnulib-tool.py.TODO.
Bruno Haible [Sat, 22 Feb 2020 14:15:01 +0000 (15:15 +0100)]
gnulib-tool: Ensure copied files are writable.
Reported by Benno Fünfstück <benno.fuenfstueck@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00101.html>.
* gnulib-tool (func_ensure_writable): New function.
(func_ln_s, func_hardlink, func_lookup_file, func_import,
func_create_testdir, copy-file): Invoke it after copying a file.
Bruno Haible [Sat, 22 Feb 2020 13:53:02 +0000 (14:53 +0100)]
users.txt: Update.
* users.txt: Update URLs to projects that have moved or switched to git.
Use canonical host names. Prefer gitweb over cgit. Prefer the tree view
over the summary view. Add gawk.