]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agotempname: Add tests.
Bruno Haible [Tue, 16 Aug 2022 13:27:50 +0000 (15:27 +0200)]
tempname: Add tests.

* tests/test-tempname.c: New file.
* modules/tempname-tests: New file.

2 years agotempname: Fix a comment.
Bruno Haible [Mon, 15 Aug 2022 21:21:05 +0000 (23:21 +0200)]
tempname: Fix a comment.

* lib/tempname.c (try_tempname_len): Use of entropy makes the function
more, not less, secure.

2 years agotempname: remove incorrect comment
Paul Eggert [Mon, 15 Aug 2022 20:04:08 +0000 (13:04 -0700)]
tempname: remove incorrect comment

* lib/tempname.c, lib/tempname.h: Remove incorrect comment,
as the names are not necessarily hard to predict (Bug#57129).

2 years agostdbool: port to C23
Paul Eggert [Sun, 14 Aug 2022 03:00:02 +0000 (20:00 -0700)]
stdbool: port to C23

* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Copy from bleeding-edge
Autoconf.  Don’t define if Autoconf 2.72 or later.
* tests/test-stdbool.c (bool, false, true)
(__bool_true_false_are_defined): Do not require these to be
defined.  C23 still requires __bool_true_false_are_defined but
marks it as obsolescent, and it’s no longer worth testing.
(WORKING_BOOL): New macro, which also tests __STDC_VERSION__.
Use it in tests for working bool.
Test for bool instead of for _Bool, which C23 says is obsolescent.

2 years agohamt: fix technically undefined behavior
Marc Nieper-Wißkirchen [Fri, 12 Aug 2022 14:00:23 +0000 (16:00 +0200)]
hamt: fix technically undefined behavior

Bug reported by Bruno Haible in
<https://lists.gnu.org/r/bug-gnulib/2022-04/msg00023.html>.
* lib/hamt.c (entry_insert): Remove technically undefined
behavior when shifting an integer of N bits by N or more bits.

2 years agoverify: port ‘assume’ to C23 non-GCC
Paul Eggert [Wed, 10 Aug 2022 06:20:48 +0000 (23:20 -0700)]
verify: port ‘assume’ to C23 non-GCC

* lib/verify.h (assume): Use C23's unreachable if available
and if GCC and/or MSC primitives are not available.

2 years agogendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).
Bruno Haible [Sun, 31 Jul 2022 05:16:34 +0000 (07:16 +0200)]
gendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).

* build-aux/gendocs.sh (PERL): Use double-quotes, not single-quotes.

2 years agoautoupdate
Karl Berry [Tue, 26 Jul 2022 14:55:39 +0000 (07:55 -0700)]
autoupdate

2 years agoAvoid DoS vulnerability through unsafe default assignment.
Bruno Haible [Sat, 23 Jul 2022 10:01:35 +0000 (12:01 +0200)]
Avoid DoS vulnerability through unsafe default assignment.

See https://www.shellcheck.net/wiki/SC2223 .

* MODULES.html.sh (func_tmpdir): Surround default assignment with
double-quotes.
* build-aux/bootstrap: Likewise.
* build-aux/csharpcomp.sh.in (func_tmpdir): Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/libtool-next-version (func_tmpdir): Likewise.
* config/srclist-update: Likewise.
* gnulib-tool (func_tmpdir): Likewise.
* posix-modules (func_tmpdir): Likewise.
* tests/test-atexit.sh: Likewise.
* tests/test-btoc32-1.sh: Likewise.
* tests/test-btoc32-2.sh: Likewise.
* tests/test-btowc1.sh: Likewise.
* tests/test-btowc2.sh: Likewise.
* tests/test-c-dtoastr.sh: Likewise.
* tests/test-c-ldtoastr.sh: Likewise.
* tests/test-c-snprintf.sh: Likewise.
* tests/test-c-strcase.sh: Likewise.
* tests/test-c-vasprintf.sh: Likewise.
* tests/test-c-vsnprintf.sh: Likewise.
* tests/test-c-xvasprintf.sh: Likewise.
* tests/test-c32isalnum.sh: Likewise.
* tests/test-c32isalpha.sh: Likewise.
* tests/test-c32isblank.sh: Likewise.
* tests/test-c32iscntrl.sh: Likewise.
* tests/test-c32isdigit.sh: Likewise.
* tests/test-c32isgraph.sh: Likewise.
* tests/test-c32islower.sh: Likewise.
* tests/test-c32isprint.sh: Likewise.
* tests/test-c32ispunct.sh: Likewise.
* tests/test-c32isspace.sh: Likewise.
* tests/test-c32isupper.sh: Likewise.
* tests/test-c32isxdigit.sh: Likewise.
* tests/test-c32rtomb.sh: Likewise.
* tests/test-c32snrtombs-1.sh: Likewise.
* tests/test-c32snrtombs-2.sh: Likewise.
* tests/test-c32snrtombs-3.sh: Likewise.
* tests/test-c32snrtombs-4.sh: Likewise.
* tests/test-c32srtombs-1.sh: Likewise.
* tests/test-c32srtombs-2.sh: Likewise.
* tests/test-c32srtombs-3.sh: Likewise.
* tests/test-c32srtombs-4.sh: Likewise.
* tests/test-c32stombs-1.sh: Likewise.
* tests/test-c32stombs-2.sh: Likewise.
* tests/test-c32stombs-3.sh: Likewise.
* tests/test-c32stombs-4.sh: Likewise.
* tests/test-closein.sh: Likewise.
* tests/test-copy-acl.sh (func_tmpdir): Likewise.
* tests/test-copy-file.sh (func_tmpdir): Likewise.
* tests/test-dprintf-posix.sh: Likewise.
* tests/test-execl.sh: Likewise.
* tests/test-execle.sh: Likewise.
* tests/test-execlp.sh: Likewise.
* tests/test-execv.sh: Likewise.
* tests/test-execve.sh: Likewise.
* tests/test-execvp.sh: Likewise.
* tests/test-execvpe.sh: Likewise.
* tests/test-file-has-acl.sh (func_tmpdir): Likewise.
* tests/test-fprintf-posix.sh: Likewise.
* tests/test-init.sh: Likewise.
* tests/test-iswdigit.sh: Likewise.
* tests/test-iswxdigit.sh: Likewise.
* tests/test-mbmemcasecmp1.sh: Likewise.
* tests/test-mbmemcasecmp2.sh: Likewise.
* tests/test-mbmemcasecmp3.sh: Likewise.
* tests/test-mbmemcasecoll1.sh: Likewise.
* tests/test-mbmemcasecoll2.sh: Likewise.
* tests/test-mbmemcasecoll3.sh: Likewise.
* tests/test-mbrtoc32-1.sh: Likewise.
* tests/test-mbrtoc32-2.sh: Likewise.
* tests/test-mbrtoc32-3.sh: Likewise.
* tests/test-mbrtoc32-4.sh: Likewise.
* tests/test-mbrtowc1.sh: Likewise.
* tests/test-mbrtowc2.sh: Likewise.
* tests/test-mbrtowc3.sh: Likewise.
* tests/test-mbrtowc4.sh: Likewise.
* tests/test-mbscasecmp.sh: Likewise.
* tests/test-mbscasestr2.sh: Likewise.
* tests/test-mbscasestr3.sh: Likewise.
* tests/test-mbscasestr4.sh: Likewise.
* tests/test-mbschr.sh: Likewise.
* tests/test-mbscspn.sh: Likewise.
* tests/test-mbsinit.sh: Likewise.
* tests/test-mbsncasecmp.sh: Likewise.
* tests/test-mbsnrtoc32s-1.sh: Likewise.
* tests/test-mbsnrtoc32s-2.sh: Likewise.
* tests/test-mbsnrtoc32s-3.sh: Likewise.
* tests/test-mbsnrtoc32s-4.sh: Likewise.
* tests/test-mbsnrtowcs1.sh: Likewise.
* tests/test-mbsnrtowcs2.sh: Likewise.
* tests/test-mbsnrtowcs3.sh: Likewise.
* tests/test-mbsnrtowcs4.sh: Likewise.
* tests/test-mbspbrk.sh: Likewise.
* tests/test-mbspcasecmp.sh: Likewise.
* tests/test-mbsrchr.sh: Likewise.
* tests/test-mbsrtoc32s-1.sh: Likewise.
* tests/test-mbsrtoc32s-2.sh: Likewise.
* tests/test-mbsrtoc32s-3.sh: Likewise.
* tests/test-mbsrtoc32s-4.sh: Likewise.
* tests/test-mbsrtowcs1.sh: Likewise.
* tests/test-mbsrtowcs2.sh: Likewise.
* tests/test-mbsrtowcs3.sh: Likewise.
* tests/test-mbsrtowcs4.sh: Likewise.
* tests/test-mbsspn.sh: Likewise.
* tests/test-mbsstr2.sh: Likewise.
* tests/test-mbsstr3.sh: Likewise.
* tests/test-mbstoc32s-1.sh: Likewise.
* tests/test-mbstoc32s-2.sh: Likewise.
* tests/test-mbstoc32s-3.sh: Likewise.
* tests/test-mbstoc32s-4.sh: Likewise.
* tests/test-nl_langinfo.sh: Likewise.
* tests/test-parse-duration.sh (func_tmpdir): Likewise.
* tests/test-perror.sh: Likewise.
* tests/test-printf-posix.sh: Likewise.
* tests/test-set-mode-acl.sh (func_tmpdir): Likewise.
* tests/test-setlocale1.sh: Likewise.
* tests/test-strtod1.sh: Likewise.
* tests/test-strtold1.sh: Likewise.
* tests/test-unicodeio2.sh: Likewise.
* tests/test-unicodeio3.sh: Likewise.
* tests/test-vasnprintf-posix2.sh: Likewise.
* tests/test-vc-list-files-cvs.sh: Likewise.
* tests/test-vc-list-files-git.sh: Likewise.
* tests/test-vdprintf-posix.sh: Likewise.
* tests/test-vfprintf-posix.sh: Likewise.
* tests/test-vprintf-posix.sh: Likewise.
* tests/test-wcrtomb.sh: Likewise.
* tests/test-wcsnrtombs1.sh: Likewise.
* tests/test-wcsnrtombs2.sh: Likewise.
* tests/test-wcsnrtombs3.sh: Likewise.
* tests/test-wcsnrtombs4.sh: Likewise.
* tests/test-wcsrtombs1.sh: Likewise.
* tests/test-wcsrtombs2.sh: Likewise.
* tests/test-wcsrtombs3.sh: Likewise.
* tests/test-wcsrtombs4.sh: Likewise.
* tests/test-xprintf-posix.sh: Likewise.
* tests/test-xstrtoimax.sh: Likewise.
* tests/test-xstrtol.sh: Likewise.
* tests/test-xstrtoll.sh: Likewise.
* tests/test-xstrtoumax.sh: Likewise.
* tests/test-yesno.sh: Likewise.
* tests/unicase/test-locale-language.sh: Likewise.
* tests/unicase/test-ulc-casecmp1.sh: Likewise.
* tests/unicase/test-ulc-casecmp2.sh: Likewise.
* tests/unicase/test-ulc-casecoll1.sh: Likewise.
* tests/unicase/test-ulc-casecoll2.sh: Likewise.
* tests/unigbrk/test-ulc-grapheme-breaks.sh: Likewise.
* tests/unistdio/test-u16-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u16-vasnprintf3.sh: Likewise.
* tests/unistdio/test-u32-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u32-vasnprintf3.sh: Likewise.
* tests/unistdio/test-u8-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u8-vasnprintf3.sh: Likewise.
* tests/unistdio/test-ulc-vasnprintf2.sh: Likewise.
* tests/unistdio/test-ulc-vasnprintf3.sh: Likewise.
* tests/uniwbrk/test-ulc-wordbreaks.sh: Likewise.
* tests/uniwidth/test-uc_width2.sh: Likewise.

2 years agodoc: Update README.
Bruno Haible [Sun, 17 Jul 2022 10:55:05 +0000 (12:55 +0200)]
doc: Update README.

* doc/README: Fix stale links (reported by Tzvetelin Katchov). Clarify
the relation to build-aux/gnu-web-doc-update.

2 years agodoc: Fix typo.
Bruno Haible [Thu, 14 Jul 2022 19:57:16 +0000 (21:57 +0200)]
doc: Fix typo.

Reported by Eric Gallager <egall@gwmail.gwu.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-07/msg00045.html>.

* doc/posix-functions/mmap.texi: Add parenthesis.

2 years agosigsegv: Optimize stackvma implementation for AIX 7.
Bruno Haible [Sun, 10 Jul 2022 21:19:03 +0000 (23:19 +0200)]
sigsegv: Optimize stackvma implementation for AIX 7.

Reported by Neha Jain <nehajain29@in.ibm.com> in
<https://lists.gnu.org/archive/html/bug-m4/2022-06/msg00005.html>
via Eric Blake.

* lib/stackvma.c: For AIX, add implementation that uses /proc/$pid/map,
based on lib/vma-iter.c.
(sigsegv_get_vma): Use it on AIX 7 or higher.

2 years agovma-iter: Add support for AIX 7.
Bruno Haible [Sun, 10 Jul 2022 19:52:11 +0000 (21:52 +0200)]
vma-iter: Add support for AIX 7.

* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on AIX.
* lib/vma-iter.c (vma_iterate): Add code for AIX, known to work on
AIX 7.
* lib/get-rusage-as.c: Update comments.
* lib/get-rusage-data.c: Likewise.
* tests/test-get-rusage-as.c (main): Take into account the special
address space organization on AIX in 32-bit mode.

2 years agohavelib: Fix 'configure --help' output.
Bruno Haible [Mon, 4 Jul 2022 22:48:36 +0000 (00:48 +0200)]
havelib: Fix 'configure --help' output.

* m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Fix m4 quoting bug.

2 years agosupersede: Support the file name "/dev/null" on native Windows.
Bruno Haible [Sun, 3 Jul 2022 09:58:03 +0000 (11:58 +0200)]
supersede: Support the file name "/dev/null" on native Windows.

* lib/supersede.c (open_supersede): On native Windows, map "/dev/null"
to "NUL".

2 years agomaint.mk: fix syntax-check for unnecessary hash.h header use
Jim Meyering [Thu, 23 Jun 2022 15:12:44 +0000 (08:12 -0700)]
maint.mk: fix syntax-check for unnecessary hash.h header use

* top/maint.mk (_hash_re): Correct the regexp. It had two problems:
- lacked the "hash_" prefix, so would match non-uses
- failed to detect uses of the hash_x?initialize functions
The former led to an excess/unneeded use of hash.h in coreutils' cut.c.
The latter would have led to a FP "not needed" report for copy.c.

2 years agofchmodat: Fix test failure on native Windows.
Bruno Haible [Tue, 21 Jun 2022 23:46:37 +0000 (01:46 +0200)]
fchmodat: Fix test failure on native Windows.

* modules/fchmodat (Depends-on): Add 'chmod'.

2 years agochmod: Add tests.
Bruno Haible [Tue, 21 Jun 2022 23:45:33 +0000 (01:45 +0200)]
chmod: Add tests.

* tests/test-chmod.c: New file, based on tests/test-lchmod.c.
* modules/chmod-tests: New file.

2 years agochmod: New module.
Bruno Haible [Tue, 21 Jun 2022 23:43:52 +0000 (01:43 +0200)]
chmod: New module.

* lib/sys_stat.in.h (chmod): Declare when GNULIB_CHMOD is 1.
* lib/chmod.c: New file, based on lib/lchmod.c.
* m4/chmod.m4: New file, based on m4/fchmodat.m4.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H): Test whether chmod is declared.
(gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize GNULIB_CHMOD.
(gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_CHMOD.
* modules/sys_stat (Makefile.am): Substitute GNULIB_CHMOD,
REPLACE_CHMOD.
* modules/chmod: New file, based on modules/lchmod.
* doc/posix-functions/chmod.texi: Mention the new module and the
problems on IRIX and Windows.

2 years agolchmod: Simplify.
Bruno Haible [Tue, 21 Jun 2022 21:19:07 +0000 (23:19 +0200)]
lchmod: Simplify.

* lib/lchmod.c: Remove unnecessary include, obsolete since 2020-02-23.

2 years agojavacomp-script, javaexec-script: Add support for disabling Java.
Bruno Haible [Mon, 20 Jun 2022 05:20:53 +0000 (07:20 +0200)]
javacomp-script, javaexec-script: Add support for disabling Java.

* m4/javacomp.m4 (gt_JAVACOMP_DISABLED): New macro.
* m4/javaexec.m4 (gt_JAVAEXEC_DISABLED): New macro.

2 years agolchmod: port back to AIX 7.2
Paul Eggert [Mon, 20 Jun 2022 04:30:01 +0000 (23:30 -0500)]
lchmod: port back to AIX 7.2

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html
* lib/lchmod.c: Include string.h, for strlen.
(lchmod): Do not depend on HAVE_READLINK since we now depend on
the readlink module.  Check for AIX 7.2 bug.
* m4/lchmod.m4 (gl_PREREQ_LCHMOD): Do not check for readlink
since we now depend on the readlink module.
* modules/lchmod (Depends-on): Depend on readlink.

2 years agofchmodat: pacify gcc -Wunused-variable
Paul Eggert [Mon, 20 Jun 2022 04:29:07 +0000 (23:29 -0500)]
fchmodat: pacify gcc -Wunused-variable

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html
* lib/fchmodat.c (fchmodat): Remove unused local.

2 years agogetlogin, getlogin_r tests: Really avoid test failure.
Bruno Haible [Sun, 19 Jun 2022 14:14:19 +0000 (16:14 +0200)]
getlogin, getlogin_r tests: Really avoid test failure.

Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00037.html>.

* tests/test-getlogin.h (test_getlogin_result): Parse the contents of
/proc/self/loginuid as an unsigned integer.

2 years agofchmodat: port better to MS-Windows etc.
Paul Eggert [Sun, 12 Jun 2022 20:46:52 +0000 (13:46 -0700)]
fchmodat: port better to MS-Windows etc.

MS-Windows problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00041.html
Although I don’t use MS-Windows I see some related fstatat etc.
problems and am trying to fix them with this further patch.
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod):
* lib/lchown.c (lchown)
[!HAVE_LCHOWN && HAVE_CHOWN && !CHOWN_MODIFIES_SYMLINK]:
* lib/renameatu.c (renameatu)
[HAVE_RENAME && RENAME_TRAILING_SLASH_SOURCE_BUG]:
Use readlinkat/readlink instead of fstatat/lstat to test merely
whether a string names a symlink, as this avoids problems
with EOVERFLOW.  Also, I hope it works around the MS-Windows
issues that Bruno noted.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT):
Check for readlinkat, not lchmod.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not require AC_CANONICAL_HOST
or check for lstat.
(gl_PREREQ_LCHMOD): Check for readlink.
* modules/lchown (Depends-on): Add readlink.  Do not depend on
lstat merely because !HAVE_LCHOWN.
* modules/renameatu (Depends-on): Add fstatat, readlinkat.

2 years agodoc: Update O_PATH platforms list.
Bruno Haible [Sun, 12 Jun 2022 14:52:30 +0000 (16:52 +0200)]
doc: Update O_PATH platforms list.

* doc/posix-headers/fcntl.texi: Update O_PATH platforms list.

2 years agofcntl: document O_PATH
Paul Eggert [Sat, 11 Jun 2022 23:59:12 +0000 (16:59 -0700)]
fcntl: document O_PATH

* doc/posix-headers/fcntl.texi: Mention O_PATH.

2 years agofchmodat: port to old Linux kernel + newer headers
Paul Eggert [Sat, 11 Jun 2022 23:58:25 +0000 (16:58 -0700)]
fchmodat: port to old Linux kernel + newer headers

Problem reported by Lance Fredrickson in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00038.html
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod): Do not rely on AT_EMPTY_PATH as to
whether syscalls work on ""; instead, if a call fails with
ENOENT assume that those syscalls do not work.
Do not use fstatat to determine whether a file is a symlink,
as this has problems with EOVERFLOW.  Use readlinkat instead,
and if it fails with EINVAL then the file is not a symlink.
Remove #if tests on __linux__ || __ANDROID__ || __CYGWIN__
as this has been a maintenance hassle and it’s unlikely
these days that a new platform would #define O_PATH without also
either supporting /proc or keeping it absent.
* modules/fchmodat (Depends-on): Remove fstatat.
There should be no need for either fchmodat or lchmod to depend on
readlinkat, since they use readlinkat only in contexts where it
should work without Gnulib intervention.

2 years agofopen-gnu: Make this module work again (regression 2022-01-03).
Bruno Haible [Mon, 6 Jun 2022 14:34:48 +0000 (16:34 +0200)]
fopen-gnu: Make this module work again (regression 2022-01-03).

Reported by Nelson H. F. Beebe <beebe@math.utah.edu> in
<https://lists.gnu.org/archive/html/platform-testers/2022-04/msg00005.html>.

* modules/fopen-gnu (configure.ac): Invoke gl_STDIO_MODULE_INDICATOR.

2 years agogetlogin, getlogin_r tests: Avoid test failure in specific environments.
Bruno Haible [Mon, 6 Jun 2022 09:55:04 +0000 (11:55 +0200)]
getlogin, getlogin_r tests: Avoid test failure in specific environments.

Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00001.html>.

* modules/getlogin-tests (Depends-on): Add stdbool.
* modules/getlogin_r-tests (Depends-on): Likewise.
* tests/test-getlogin.h: Include stdbool.h.
(test_getlogin_result): On Linux, skip the test if /proc/self/loginuid
contains "-1".

2 years agodoc: Add section to attract more people towards the GNU project.
Bruno Haible [Sun, 5 Jun 2022 22:03:30 +0000 (00:03 +0200)]
doc: Add section to attract more people towards the GNU project.

Inspired by a suggestion from José E. Marchesi <jemarch@gnu.org> on
the gnu-prog-discuss mailing list.

* doc/join-gnu.texi: New file.
* doc/gnulib-readme.texi: Include it.

2 years agodoc: Add section to attract more people towards the GNU project.
Bruno Haible [Sun, 5 Jun 2022 17:21:43 +0000 (19:21 +0200)]
doc: Add section to attract more people towards the GNU project.

Inspired by a suggestion from José E. Marchesi <jemarch@gnu.org> on
the gnu-prog-discuss mailing list.

* doc/join-gnu.texi: New file.
* doc/gnulib-readme.texi: Include it.

2 years agodoc: Fix warnings about regex chapter structure (regression 2022-05-15).
Bruno Haible [Sun, 5 Jun 2022 17:09:15 +0000 (19:09 +0200)]
doc: Fix warnings about regex chapter structure (regression 2022-05-15).

* doc/regex.texi (GNU Operators): Fix menu.

2 years agoregex-quote: \} -> } in EREs
Paul Eggert [Sat, 4 Jun 2022 16:55:28 +0000 (09:55 -0700)]
regex-quote: \} -> } in EREs

* lib/regex-quote.c (ere_special): Don’t use \} in EREs,
as POSIX says the interpretation is undefined.
* tests/test-regex-quote.c (test_bre, test_ere):
Add tests for }.

2 years agodfa: do not warn about \] and \}
Paul Eggert [Sat, 4 Jun 2022 01:46:37 +0000 (18:46 -0700)]
dfa: do not warn about \] and \}

* lib/dfa.c (lex): Do not warn about \] and \}, since they’re
surely universally supported even though POSIX says their
interpretation is undefined.

2 years agoregex-quote: \] -> ] in EREs and BREs
Paul Eggert [Sat, 4 Jun 2022 00:52:19 +0000 (17:52 -0700)]
regex-quote: \] -> ] in EREs and BREs

* build-aux/bootstrap:
* build-aux/bootstrap.conf (gettext_external):
* check-AC_LIBOBJ:
* lib/regex-quote.c (bre_special, ere_special):
* gnulib-tool (func_modules_transitive_closure)
(func_emit_autoconf_snippet, func_import, func_create_testdir):
* tests/test-regex-quote.c (test_bre, test_ere):
* top/maint.mk (longopt_re, gpg_key_ID):
Don’t use \] in BREs and EREs, as POSIX says the interpretation is
undefined.

2 years agofilevercmp: don’t treat entire filename as suffix
Paul Eggert [Sat, 4 Jun 2022 00:27:44 +0000 (17:27 -0700)]
filevercmp: don’t treat entire filename as suffix

Problem reported by Artém S. Tashkinóv in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00012.html
* lib/filevercmp.c (file_prefixlen): When stripping
(\.[A-Za-z~][A-Za-z0-9~]*)*$ suffixes, do not strip
the entire file name.
* tests/test-filevercmp.c (examples): Adjust to match new behavior.

2 years agosetlocale: Update after Turkey changed its name.
Bruno Haible [Fri, 3 Jun 2022 15:46:27 +0000 (17:46 +0200)]
setlocale: Update after Turkey changed its name.

* lib/setlocale.c: Update comments.

2 years agoautoupdate
Karl Berry [Thu, 26 May 2022 14:24:56 +0000 (07:24 -0700)]
autoupdate

2 years agoGNU Emacs Operator node deleted from regex.texi
Karl Berry [Wed, 25 May 2022 14:55:36 +0000 (07:55 -0700)]
GNU Emacs Operator node deleted from regex.texi

2 years agoautoupdate
Karl Berry [Wed, 25 May 2022 14:54:30 +0000 (07:54 -0700)]
autoupdate

2 years agoautoupdate
Karl Berry [Wed, 25 May 2022 14:53:56 +0000 (07:53 -0700)]
autoupdate

2 years agodfa: new options DFA_STAR_WARN, DFA_PLUS_WARN
Paul Eggert [Tue, 24 May 2022 23:03:29 +0000 (16:03 -0700)]
dfa: new options DFA_STAR_WARN, DFA_PLUS_WARN

This lets ‘grep -E '(*a|+b)'’ warn about the * and the +.
* lib/dfa.h (DFA_STAR_WARN, DFA_PLUS_WARN): New flags.
* lib/dfa.c (lex): Support them.

2 years agodfa: '\n' is not governed by RE_LIMITED_OPS
Paul Eggert [Mon, 23 May 2022 19:17:49 +0000 (12:17 -0700)]
dfa: '\n' is not governed by RE_LIMITED_OPS

* lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when
deciding how to parse '\n', since regcomp.c doesn’t.

2 years agodfa: new option DFA_STRAY_BACKSLASH_WARN
Paul Eggert [Mon, 23 May 2022 19:05:14 +0000 (12:05 -0700)]
dfa: new option DFA_STRAY_BACKSLASH_WARN

This is for grep, which wants to warn about stray backslashes that
lead to unspecified behavior.  For example, "grep -oi '\a'"
surprisingly is not equivalent to "grep -oi 'a'", so the stray
backslash should be warned about.
* lib/dfa.c: Include wctype.h, for iswprint and iswspace.
(lex): Add support for DFA_STRAY_BACKSLASH_WARN.
* lib/dfa.h (DFA_STRAY_BACKSLASH_WARN): New constant.

2 years agodfa: new option DFA_CONFUSING_BRACKETS_ERROR
Paul Eggert [Mon, 23 May 2022 17:04:18 +0000 (10:04 -0700)]
dfa: new option DFA_CONFUSING_BRACKETS_ERROR

This is for grep, which wants [:alpha:] to be an error
at the top level.
* lib/dfa.c (struct regex_syntax): New member dfaopts,
replacing anchor.  All uses changed.
(parse_bracket_exp): Error, not warn, if DFA_CONFUSING_BRACKETS_ERROR.
* lib/dfa.h (DFA_CONFUSING_BRACKETS_ERROR): New constant.

2 years agostrstr-simple: pacify GCC 12.1
Paul Eggert [Sat, 21 May 2022 20:38:29 +0000 (13:38 -0700)]
strstr-simple: pacify GCC 12.1

* lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1
-Wsuggest-attribute=pure (x86-64, -O2).

2 years agodfa: steer cleer of POSIX-reserved symbols
Paul Eggert [Fri, 20 May 2022 23:55:34 +0000 (16:55 -0700)]
dfa: steer cleer of POSIX-reserved symbols

* lib/dfa.c (str_eq): Rename from streq.  All uses changed.
(c_isdigit): Rename from isasciidigit.  The function worked in
EBCDIC so it wasn’t ASCII-specific anyway.  All uses changed.

2 years agoautoupdate
Karl Berry [Fri, 20 May 2022 14:55:14 +0000 (07:55 -0700)]
autoupdate

2 years agoparse-datetime: support 'J' military time zone
Paul Eggert [Tue, 17 May 2022 22:47:35 +0000 (15:47 -0700)]
parse-datetime: support 'J' military time zone

Requested by Brian Inglis in:
https://savannah.gnu.org/support/?110644
* lib/parse-datetime.y (parser_control): New member J_zones_seen.
(item): New item 'J'.
(military_table): Add 'J'.
(parse_datetime_body): Set and use J_zones_seen.
* tests/test-parse-datetime.c (main): Test "J".

2 years agodoc: remove Emacs-specific documentation; match code
Reuben Thomas [Wed, 11 May 2022 10:47:00 +0000 (11:47 +0100)]
doc: remove Emacs-specific documentation; match code

* doc/regex.texi: Remove mention of both Emacs and non-Emacs syntax tables,
as these are no longer supported by the code. Document the word character
class (alnum + _).   Add documentation for \s and \S.  Replace mentions
of #defining emacs with RE_NO_GNU_OPS (which takes effect in the opposite
sense); merge the node “GNU Emacs Operators” into “GNU Operators”.  For \`
and \', refer to the “whole string” rather than the (Emacs) “buffer”.

2 years agostring, wchar: Fix compilation error on MSVC (regression 2021-09-07).
Bruno Haible [Sun, 15 May 2022 11:25:46 +0000 (13:25 +0200)]
string, wchar: Fix compilation error on MSVC (regression 2021-09-07).

* lib/string.in.h (free): For MSVC, add the dllimport specification if
the MSVC headers have it.
* lib/wchar.in.h (free): Likewise.

2 years agoglob tests: Fix a warning (regression from 2022-03-23).
Bruno Haible [Sat, 14 May 2022 20:34:12 +0000 (22:34 +0200)]
glob tests: Fix a warning (regression from 2022-03-23).

* tests/test-glob.c: Include <fcntl.h>.
* modules/glob-tests (Depends-on): Add fcntl-h.

2 years agotermcap: Fix link error when no suitable library is found.
Bruno Haible [Sat, 14 May 2022 19:59:58 +0000 (21:59 +0200)]
termcap: Fix link error when no suitable library is found.

* m4/termcap.m4 (gl_TERMCAP_BODY): If no suitable library is found,
set LIBTERMCAP and LTLIBTERMCAP to empty.

2 years agodfa: fix bug with ‘.’ and UTF-8 Hangul Syllables
Paul Eggert [Sat, 14 May 2022 06:23:35 +0000 (23:23 -0700)]
dfa: fix bug with ‘.’ and UTF-8 Hangul Syllables

This fixes a bug introduced in 2019-12-18T05:41:27Z!eggert@cs.ucla.edu,
an earlier patch that fixed dfa.c to not match invalid UTF-8.
Unfortunately that patch had a couple of typos when dfa.c is
matching against the regular expression ‘.’ (dot).  One typo
caused dfa.c to incorrectly reject the valid UTF-8 sequences
(ED)(90-9F)(80-BF) corresponding to U+D400 through U+D7FF, which
are some Hangul Syllables and Hangul Jamo Extended-B.  The other
typo caused dfa.c to incorrectly reject the valid sequences
(F4)(88-8F)(80-BF)(80-BF) which correspond to U+108000 through
U+10FFFF (Supplemental Private Use Area plane B).
* lib/dfa.c (utf8_classes): Fix typos.
* tests/test-dfa-match.sh: Test the fix.

2 years agomanywarnings: update C warnings for GCC 12
Paul Eggert [Thu, 12 May 2022 22:13:04 +0000 (15:13 -0700)]
manywarnings: update C warnings for GCC 12

Adjust for C programs compiled by GCC 12.
(A C++ expert still needs to look at manywarnings-c++.m4.)
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 12.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbidi-chars=any,ucn
and -Wuse-after-free=3.  Although not enabled by -Wall or -Wextra
they seem suitable for Gnulib-using C code.

2 years agoparse-datetime: remove Emacs cruft
Paul Eggert [Wed, 11 May 2022 16:35:45 +0000 (09:35 -0700)]
parse-datetime: remove Emacs cruft

* lib/parse-datetime.y: Remove an ‘ifdef emacs’.  Emacs has never
used this module.  The module is derived from code taken from
Emacs, but that code was removed from Emacs in the 1990s.

2 years agoalloca: Remove old code for Emacs, unused since 2009.
Bruno Haible [Wed, 11 May 2022 11:00:53 +0000 (13:00 +0200)]
alloca: Remove old code for Emacs, unused since 2009.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-05/msg00032.html>.

* lib/alloca.c: Remove Emacs specific code.

2 years agoSay that it is not the old interface
Paul Eggert [Mon, 9 May 2022 19:20:24 +0000 (12:20 -0700)]
Say that it is not the old interface

2 years agoautoupdate
Karl Berry [Mon, 9 May 2022 15:33:17 +0000 (08:33 -0700)]
autoupdate

3 years agolibc-config: update to match cdefs
Paul Eggert [Thu, 5 May 2022 21:37:21 +0000 (14:37 -0700)]
libc-config: update to match cdefs

* lib/libc-config.h (__attribute_alloc_align__)
(__attribute_maybe_unused, __fortified_attr_access)
(__glibc_fortify, __glibc_fortify_n, __glibc_likely)
(__glibc_safe_len_cond, __glibc_safe_or_unknown_len)
(__glibc_unsafe_len, __glibc_unsigned_or_positive, __wur):
Undef these too, since lib/cdefs.h now defines them
unconditionally.

3 years agocdefs: merge from glibc
Paul Eggert [Thu, 5 May 2022 21:34:23 +0000 (14:34 -0700)]
cdefs: merge from glibc

* lib/cdefs.h (__glibc_safe_or_unknown_len):
Use glibc’s newer version.

3 years agogettime-res: help the compiler
Paul Eggert [Mon, 2 May 2022 16:52:48 +0000 (09:52 -0700)]
gettime-res: help the compiler

* lib/gettime-res.c (gettime_res): Pacify GCC versions that
incorrectly complain about earlier.tv_sec not being initialized.
Let GCC know that gcd args are always positive.

3 years agoaf_alg: port to Ubuntu 22.04
Paul Eggert [Mon, 2 May 2022 16:01:08 +0000 (09:01 -0700)]
af_alg: port to Ubuntu 22.04

Without this patch, maintainer builds of coreutils fail on Ubuntu
22.04 with diagnostics like "./lib/gl_openssl.h:79:1: error:
'MD5_Init' is deprecated: Since OpenSSL 3.0
[-Werror=deprecated-declarations]".  From
<https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes>
it appears that Gnulib needs to either define OPENSSL_API_COMPAT
to a version less than 3.0, or use a compatibility layer, or
assume OpenSSL 1.1.0 or later.  The simplest workaround is to
define OPENSSL_API_COMPAT for 1.1.1, the oldest OpenSSL release
still supported.  A better fix would be to rewrite the code to
assume OpenSSL 1.1.1 or later, and stop using the older API.
* lib/md5.h, lib/sha1.h, lib/sha256.h, lib/sha512.h, lib/sm3.h:
Define OPENSSL_API_COMPAT to 0x10101000L to suppress
the deprecation warnings on Ubuntu 22.04.

3 years agovasnprintf: Simplify. Reduce binary code size.
Paul Eggert [Sun, 1 May 2022 21:24:02 +0000 (23:24 +0200)]
vasnprintf: Simplify. Reduce binary code size.

* lib/vasnprintf.c (VASNPRINTF): Coalesce cleanup code.

3 years agovasnprintf: Simplify 'result' variable.
Paul Eggert [Sun, 1 May 2022 20:48:07 +0000 (22:48 +0200)]
vasnprintf: Simplify 'result' variable.

* lib/vasnprintf.c (VASNPRINTF): Simplify initialization and test of
'result' variable.

3 years agovasnprintf: Simplify a free() call.
Paul Eggert [Sun, 1 May 2022 20:38:50 +0000 (22:38 +0200)]
vasnprintf: Simplify a free() call.

* lib/vasnprintf.c (divide): Just call
free (x) instead of doing ‘if (x != NULL) free (x);’.

3 years agostring: Avoid syntax error on glibc systems with GCC 11.
Bruno Haible [Sat, 30 Apr 2022 12:09:00 +0000 (14:09 +0200)]
string: Avoid syntax error on glibc systems with GCC 11.

Reported by Tom Tromey <tromey@adacore.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00075.html>
and by Satadru Pramanik <satadru@umich.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00076.html>.

* lib/string.in.h (strndup): Don't rededeclare strndup if it is defined
as a macro.

3 years agostdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).
Simon Marchi [Thu, 28 Apr 2022 23:47:55 +0000 (01:47 +0200)]
stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).

* lib/stdlib.in.h (free): Add exception specification like glibc does.

3 years agoglob: improve config and test cleanup
Paul Eggert [Thu, 28 Apr 2022 21:40:48 +0000 (14:40 -0700)]
glob: improve config and test cleanup

Config problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00071.html
* m4/glob.m4 (gl_GLOB): Clean up temporary file.
Also, name it conf$$-file not conf-file, so it’s cleaned
up on interrupt.
* modules/glob-tests (MOSTLYCLEANFILES):
Append test-glob.tglobfile, test-glob.tgloblink[123].

3 years agoFix ChangeLog typo
Paul Eggert [Tue, 26 Apr 2022 22:00:24 +0000 (15:00 -0700)]
Fix ChangeLog typo

3 years agoglob: port to NetBSD 9.2
Paul Eggert [Tue, 26 Apr 2022 21:54:26 +0000 (14:54 -0700)]
glob: port to NetBSD 9.2

Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html
* doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability
bugs.  Remove an old common about errno that is no longer true
of POSIX 2018.
* lib/glob.c (glob_in_dir): Convert dirfd arg from void *
to DIR * before passing it to dirfd.

3 years agoregex: match [...---...] like V7 grep
Paul Eggert [Fri, 22 Apr 2022 01:56:12 +0000 (18:56 -0700)]
regex: match [...---...] like V7 grep

Problem reported by Arnold Robbins in:
https://bugs.gnu.org/20657
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00053.html
* lib/regcomp.c (peek_token_bracket): Let [...---...] match '-'.
This is an extension to POSIX, and matches V7 Unix grep.

3 years agobackupfile: fix bug when renaming simple backups
Paul Eggert [Thu, 21 Apr 2022 02:34:57 +0000 (19:34 -0700)]
backupfile: fix bug when renaming simple backups

* lib/backupfile.c (backupfile_internal): Fix bug when RENAME
and when doing simple backups.  Problem reported by Steve Ward in:
https://bugs.gnu.org/55029

3 years agogettime-res: more-robust sampling
Paul Eggert [Wed, 20 Apr 2022 17:42:51 +0000 (10:42 -0700)]
gettime-res: more-robust sampling

* lib/gettime-res.c (gettime_res): If adjacent timestamps are
identical search for a differing timestamp.  Also, stop collecting
samples thereafter since they surely won’t help.

3 years agoPort _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99
Paul Eggert [Wed, 20 Apr 2022 01:23:37 +0000 (18:23 -0700)]
Port _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99

* m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE):
Disable -Wpedantic if using __has_c_attribute and this is not C2x.

3 years agoverify: port to pedantic gcc -std=c99
Paul Eggert [Wed, 20 Apr 2022 01:02:43 +0000 (18:02 -0700)]
verify: port to pedantic gcc -std=c99

* lib/verify.h (_GL_VERIFY): If we lack both _Static_assert and
static_assert, suppress -Wnexted-externs.

3 years agogettime-res: add tests
Paul Eggert [Tue, 19 Apr 2022 22:13:09 +0000 (15:13 -0700)]
gettime-res: add tests

* modules/gettime-res-tests, tests/test-gettime-res.c: New files.

3 years agoautoupdate
Karl Berry [Tue, 19 Apr 2022 14:48:24 +0000 (07:48 -0700)]
autoupdate

3 years agoverify: port to Mac OS 10.7.5
Paul Eggert [Sun, 17 Apr 2022 02:18:03 +0000 (19:18 -0700)]
verify: port to Mac OS 10.7.5

Mac OS 10.7.5 clang sets __clang_major__ to 4 even though it was
derived from Clang 3.2.  Problem reported by Werner Lemberg in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00779.html
* lib/verify.h (_GL_HAVE__STATIC_ASSERT): Don’t define to 1
when __clang_major__ == 4 && !__cplusplus
&& __STDC_VERSION__ < 201112L && !defined __STRICT_ANSI__.

3 years agosigsegv: Fix compilation error on arceb CPUs.
Bruno Haible [Sat, 16 Apr 2022 01:01:51 +0000 (03:01 +0200)]
sigsegv: Fix compilation error on arceb CPUs.

Reported by Fabrice Fontaine <fontaine.fabrice@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00028.html>.

* m4/stack-direction.m4 (SV_STACK_DIRECTION): Treat the 'arc' variants
like 'arc'.

3 years agostring, wchar: Fix error in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 22:52:26 +0000 (00:52 +0200)]
string, wchar: Fix error in C++ mode on glibc systems with clang.

* lib/string.in.h (free): Add exception specification like glibc does.
* lib/wchar.in.h (free): Likewise.

3 years agostring: Fix errors in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 22:29:04 +0000 (00:29 +0200)]
string: Fix errors in C++ mode on glibc systems with clang.

* lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
strstr, strcasestr): Use _GL_CXXALIASWARN1 also with clang, and add
exception specification.

3 years agomath: Fix errors in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 21:43:05 +0000 (23:43 +0200)]
math: Fix errors in C++ mode on glibc systems with clang.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISFINITE,
GNULIB_NAMESPACE_LACKS_ISINF, GNULIB_NAMESPACE_LACKS_ISNAN,
GNULIB_NAMESPACE_LACKS_SIGNBIT): New macros.
* tests/test-math-c++.cc (isfinite): Skip test if
GNULIB_NAMESPACE_LACKS_ISFINITE is 1.
(isinf): Skip test if GNULIB_NAMESPACE_LACKS_ISINF is 1.
(isnan): Skip test if GNULIB_NAMESPACE_LACKS_ISNAN is 1.
(signbit): Skip test if GNULIB_NAMESPACE_LACKS_SIGNBIT is 1.

3 years agoautoupdate
Karl Berry [Sun, 10 Apr 2022 14:10:12 +0000 (07:10 -0700)]
autoupdate

3 years agolibgmp: pacify Clang too
Paul Eggert [Fri, 8 Apr 2022 23:45:11 +0000 (16:45 -0700)]
libgmp: pacify Clang too

* lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang.
Problem reported for Emacs by Mattias Engdegård.

3 years agoinit.sh: don’t assume gzip
Paul Eggert [Mon, 4 Apr 2022 17:53:12 +0000 (10:53 -0700)]
init.sh: don’t assume gzip

* tests/init.sh (rand_bytes_): Don’t assume gzip is installed.
I found this while testing gzip installation on a platform where I
had removed the installed gzip.  gzip is executed only on
platforms lacking mktemp and /dev/urandom so this code is rarely
used; however, these platforms might also lack gzip since gzip
is neither specified by POSIX or required by the GNU Coding Standards.

3 years agoglob: sync better with glibc
Paul Eggert [Wed, 30 Mar 2022 23:29:11 +0000 (16:29 -0700)]
glob: sync better with glibc

* lib/glob.c (dirfd) [_LIBC]: Use #undef instead of #ifdef.
Problem reported by DJ Delorie.

3 years agoglob: test for glibc bug 25659
Paul Eggert [Wed, 23 Mar 2022 17:22:51 +0000 (10:22 -0700)]
glob: test for glibc bug 25659

https://sourceware.org/bugzilla/show_bug.cgi?id=25659
* m4/glob.m4 (gl_GLOB): Replace glob if it has bug 25659.
* tests/test-glob.c (main): Test for glibc bug 25659.

3 years agoglob: fix symlink and // issues; improve speed
Paul Eggert [Wed, 23 Mar 2022 16:52:58 +0000 (09:52 -0700)]
glob: fix symlink and // issues; improve speed

* lib/glob.c: Include fcntl.h.
(dirfd) [_LIBC]: New macro.
(GLOB_STAT64, GLOB_LSTAT64): Remove.  Replace all uses with ...
(GLOB_FSTATAT64): ... this new macro.
(glob_in_dir): Treat DT_LNK like DT_UNKNOWN.
Use directory-relative fstatat unless GLOB_ALTDIRFUNC, or dirfd fails.
Avoid duplicate strlen (directory).
Work even if directory is "/", without turning it into "//".
Use a scratch buffer instead of by-hand alloca stuff.
Use mempcpy and memcpy instead of stpcpy and strcpy.
* modules/glob (Depends-on): Add dirfd, fstatat.  Remove stat.
(License): Change from LGPLv2+ to GPL, since it depends on
fstatat.

3 years agoglob: resolve DT_UNKNOWN via is_dir
DJ Delorie [Wed, 23 Mar 2022 16:39:37 +0000 (09:39 -0700)]
glob: resolve DT_UNKNOWN via is_dir

The DT_* values returned by getdents (readdir) are only hints and
not required.  In fact, some Linux filesystems return DT_UNKNOWN
for most entries, regardless of actual type.  This causes make
to mis-match patterns with a trailing slash (via GLOB_ONLYDIR)
(see make's functions/wildcard test case).  Thus, this patch
detects that case and uses is_dir() to make the type known enough
for proper operation.

Performance in non-DT_UNKNOWN cases is not affected.

The lack of DT_* is a well known issue on older XFS installations
(for example, RHEL 7 and 8, Fedora 28) but can be recreated by
creating an XFS filesystem with flags that mimic older behavior:

$ fallocate -l 10G /xfs.fs
$ mkfs.xfs -n ftype=0 -m crc=0 -f /xfs.fs
$ mkdir /xfs
$ mount -o loop /xfs.fs /xfs

3 years agomaint: bootstrap: split a too-long line
Jim Meyering [Mon, 21 Mar 2022 01:38:50 +0000 (18:38 -0700)]
maint: bootstrap: split a too-long line

* build-aux/bootstrap (git_modules_config): Split longer-than-80 line.

3 years agoautoupdate
Karl Berry [Sun, 20 Mar 2022 15:39:33 +0000 (08:39 -0700)]
autoupdate

3 years agomaintainer-makefile: Improve GnuPG announce-gen options.
Simon Josefsson [Mon, 14 Mar 2022 10:14:50 +0000 (11:14 +0100)]
maintainer-makefile: Improve GnuPG announce-gen options.

* top/maint.mk (gpg_key_emil): New variable.
(gpg_keyring_url): New variable.
(announcement): Pass them as --gpg-key-email and
--gpg-keyring-url.

3 years agoannounce-gen: Modernize GnuPG key retrieval suggestions.
Simon Josefsson [Mon, 14 Mar 2022 10:13:45 +0000 (11:13 +0100)]
announce-gen: Modernize GnuPG key retrieval suggestions.

Based on patch by Darshit Shah in:
https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00022.html

* build-aux/announce-gen (usage): Add --gpg-key-email and
--gpg-keyring-url.
(main): Support the new options.
(main): Don't suggest 'gpg --keyserver' since the situation with
public key servers is complicated and GnuPG version dependent.

3 years agoNEWS: Document Automake 1.14 requirement here too.
Ben Pfaff [Sun, 13 Mar 2022 19:16:40 +0000 (12:16 -0700)]
NEWS: Document Automake 1.14 requirement here too.

It had been documented there before for the Automake 1.11 requirement.
* NEWS: Mention the change.

3 years agosigsegv: Add support for Linux/PowerPC (32-bit) with musl libc.
Bruno Haible [Sun, 13 Mar 2022 14:12:46 +0000 (15:12 +0100)]
sigsegv: Add support for Linux/PowerPC (32-bit) with musl libc.

Reported by Khem Raj <raj.khem@gmail.com> in
<https://lists.gnu.org/archive/html/m4-patches/2022-03/msg00000.html>.

* src/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): In the Linux/PowerPC
32-bit case, handle musl libc differently.
* modules/sigsegv (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

3 years agoregex: fix double-free
Paul Eggert [Sat, 12 Mar 2022 01:23:53 +0000 (17:23 -0800)]
regex: fix double-free

* lib/regex_internal.c (re_dfa_add_node): Don’t free storage
twice if an allocation fails.

3 years agoregex: fix minor over-allocation
Paul Eggert [Fri, 11 Mar 2022 21:34:07 +0000 (13:34 -0800)]
regex: fix minor over-allocation

* lib/regexec.c (push_fail_stack): Fix off-by-one error that
over-allocated the stack.

3 years agoregex: fix free_fail_stack undefined behavior
Paul Eggert [Fri, 11 Mar 2022 21:27:33 +0000 (13:27 -0800)]
regex: fix free_fail_stack undefined behavior

* lib/regexec.c (push_fail_stack): Don’t increment number of
re_fail_stack_t entries until after successful allocation.  This
prevents a crash if re_realloc or re_malloc fails here, and a
later free_fail_stack examines regs or a later pop_fail_stack
examines node.  Problem discovered by Coverity scan sent
2022-03-11 11:03:52Z.