]> Savannah Git Hosting - gnulib.git/log
gnulib.git
9 years agomisc: port better to gcc -fsanitize=address
Paul Eggert [Sun, 7 Feb 2016 02:11:48 +0000 (18:11 -0800)]
misc: port better to gcc -fsanitize=address

Without these patches, ./configure CFLAGS='-fsanitize=address'
would compute incorrect values.  This patch fixes some (but not all)
test failures with recent glibc, with this configuration.
* m4/acl.m4 (gl_ACL_GET_FILE):
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF):
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS):
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO):
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE):
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL):
* m4/getdelim.m4 (gl_FUNC_GETDELIM):
* m4/getgroups.m4 (gl_FUNC_GETGROUPS):
* m4/getline.m4 (gl_FUNC_GETLINE):
* m4/malloc.m4 (_AC_FUNC_MALLOC_IF):
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF):
* m4/regex.m4 (gl_REGEX):
* m4/strndup.m4 (gl_FUNC_STRNDUP):
* tests/test-calloc-gnu.c (main):
* tests/test-duplocale.c (main):
* tests/test-getgroups.c (main):
* tests/test-getline.c (main):
* tests/test-inttostr.c (main):
* tests/test-localename.c (test_locale_name)
(test_locale_name_thread, test_locale_name_environ)
(test_locale_name_default):
* tests/test-regex.c (main):
* tests/test-setlocale1.c (main):
* tests/test-stat.h (test_stat_func):
Free heap-allocated storage before exiting.
* m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX):
Don't match *_foo symbols inserted by AddressSanitizer.
* tests/test-regex.c, tests/test-stat.c: Include stdlib.h, for 'free'.

9 years agoupdate from texinfo
Karl Berry [Fri, 5 Feb 2016 16:50:20 +0000 (08:50 -0800)]
update from texinfo

9 years agoautoupdate
Karl Berry [Fri, 5 Feb 2016 16:49:30 +0000 (08:49 -0800)]
autoupdate

9 years agoverify-tests: also remove stray test-verify.Tpo
Jim Meyering [Wed, 3 Feb 2016 05:39:44 +0000 (21:39 -0800)]
verify-tests: also remove stray test-verify.Tpo

* modules/verify-tests (Makefile.am): Arrange for "make clean"
to remove the test-verify.Tpo file that is left behind by
the automake-generated rule upon compilation failure.
Otherwise, that .Tpo file would cause a failed "make distcheck"
at least for grep.

9 years agostd-gnu11: new module
Paul Eggert [Tue, 2 Feb 2016 22:29:53 +0000 (14:29 -0800)]
std-gnu11: new module

This makes it easier for applications to prefer C11 and C++11
to older variants, when compiling C and C++ code.
Unlike most m4/*.m4 files, m4/std-gnu11.m4 is GPLed, as it copies
a nontrivial chunk of GPLed Autoconf source code.
* COPYING: Mention the m4/*.m4 copyright situation.
* MODULES.html.sh (std-gnu11): New module.
* m4/std-gnu11.m4, modules/std-gnu11: New files.

9 years agoupdate from texinfo
Karl Berry [Tue, 2 Feb 2016 18:07:32 +0000 (10:07 -0800)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Sun, 31 Jan 2016 22:49:50 +0000 (14:49 -0800)]
update from texinfo

9 years agoget-permissions, strftime: fix grammar in comments
Paul Eggert [Mon, 25 Jan 2016 15:45:56 +0000 (07:45 -0800)]
get-permissions, strftime: fix grammar in comments

* lib/get-permissions.c, lib/strftime.c: Merge into the comments
some grammar fixes Alan Mackenzie made to GNU Emacs.

9 years agogettext: mark as obsolete
Daiki Ueno [Mon, 25 Jan 2016 02:07:33 +0000 (11:07 +0900)]
gettext: mark as obsolete

Suggested by Paul Eggert in:
https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00101.html
* modules/gettext (Status): Mark as obsolete.
(Notice): Suggest to use 'gettext-h' instead.
* modules/gettext-h (Description): Suggest GNU gettext, instead of
the 'gettext' module.

9 years agognulib-tool: don't give up on ln -s so easily
Paul Eggert [Sun, 24 Jan 2016 22:24:35 +0000 (14:24 -0800)]
gnulib-tool: don't give up on ln -s so easily

* gnulib-tool (func_ln_s): Don't give up on a later ln -s merely
because an earlier one failed.  The targets could be on different
file systems.  Problem reported by KO Myung-Hun in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00081.html

9 years agoclosedir: fix OS/2-related typos
Paul Eggert [Sun, 24 Jan 2016 22:13:41 +0000 (14:13 -0800)]
closedir: fix OS/2-related typos

Problem reported by KO Myung-Hun in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00107.html
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Fix a couple of typos
in the last couple of changes.

9 years agoopenat_proc_name: fix that last '/' is overwritten on OS/2 kLIBC
KO Myung-Hun [Sun, 24 Jan 2016 12:04:48 +0000 (21:04 +0900)]
openat_proc_name: fix that last '/' is overwritten on OS/2 kLIBC

* lib/openat-proc.c (openat_proc_name): Increase dirlen by 1 after
copying a directory.

9 years agoregex: treat [x] as x if x is a unibyte encoding error
Paul Eggert [Sun, 24 Jan 2016 08:55:44 +0000 (00:55 -0800)]
regex: treat [x] as x if x is a unibyte encoding error

Problem reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00091.html
* lib/regcomp.c (parse_byte) [!_LIBC && RE_ENABLE_I18N]: New function.
(build_range_exp) [!_LIBC && RE_ENABLE_I18N]: Use it.

9 years agoclosedir, dirfd, opendir: port to OpenSolaris 5.10
Paul Eggert [Sun, 24 Jan 2016 08:28:19 +0000 (00:28 -0800)]
closedir, dirfd, opendir: port to OpenSolaris 5.10

* m4/closedir.m4 (gl_FUNC_CLOSEDIR):
* m4/dirfd.m4 (gl_FUNC_DIRFD):
* m4/opendir.m4 (gl_FUNC_OPENDIR):
Don't use ${word##pat} substitution, as it doesn't work in
OpenSolaris 5.10 /bin/sh.  Problem reported by Assaf Gordon in:
http://bugs.gnu.org/22443#11

9 years agobootstrap: use American spelling
Paul Eggert [Sun, 24 Jan 2016 06:41:14 +0000 (22:41 -0800)]
bootstrap: use American spelling

* build-aux/bootstrap: Honor American spelling.

9 years ago@item needed inside @itemize
Karl Berry [Fri, 22 Jan 2016 16:21:35 +0000 (08:21 -0800)]
@item needed inside @itemize

9 years agohash-pjw-bare: fix comment
Bruno Haible [Thu, 21 Jan 2016 15:55:34 +0000 (07:55 -0800)]
hash-pjw-bare: fix comment

* lib/hash-pjw-bare.h (hash_pjw_bare): Fix comment.

9 years agowcwidth: Replace also on OpenBSD 5.8
Bruno Haible [Thu, 21 Jan 2016 10:32:20 +0000 (11:32 +0100)]
wcwidth: Replace also on OpenBSD 5.8

* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Check the value of wcwidth(0xFF1A).
* doc/posix-functions/wcwidth.texi: Update.

9 years agoupdate from texinfo
Karl Berry [Thu, 21 Jan 2016 00:17:35 +0000 (16:17 -0800)]
update from texinfo

9 years agognu-web-doc-update: fix addition of new files
Pádraig Brady [Wed, 20 Jan 2016 14:10:30 +0000 (14:10 +0000)]
gnu-web-doc-update: fix addition of new files

If there were already added (emnpty) dirs,
then cvs aborts the add with the message:
  cvs [add aborted]: there is a version in <./dirname> already

* build-aux/gnu-web-doc-update: Add directories separately
to the addition of files, to avoid the above issue
impacting the addition of files.

9 years agoutimens-tests: avoid pulling gettext .m4 files
Daiki Ueno [Tue, 19 Jan 2016 01:15:36 +0000 (10:15 +0900)]
utimens-tests: avoid pulling gettext .m4 files

Although this is not the right fix to the original problem:
http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00086.html
it makes it possible again for consumer projects to use arbitrary
version of gettext, through the steps described at:
http://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html
See here for details:
https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00079.html
* modules/futimens-tests (Depends-on): Add 'gettext-h' in place of
'gettext'.
* modules/utimens-tests (Depends-on): Add 'gettext-h' in place of
'gettext'.

9 years agoregex: pacify static checkers
Paul Eggert [Mon, 18 Jan 2016 18:34:18 +0000 (10:34 -0800)]
regex: pacify static checkers

Problem and draft fix reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
* lib/regcomp.c (build_charclass_op, create_tree) [lint]:
Clear memory to pacify static checkers.

9 years agoregex: fix [ diagnostic
Paul Eggert [Mon, 18 Jan 2016 18:32:26 +0000 (10:32 -0800)]
regex: fix [ diagnostic

Problem and fix reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
* lib/regcomp.c (REG_EBRACK_IDX): Fix misleading diagnostic about [.

* lib/regcomp.c (build_range_exp, build_charclass_op)

9 years agoregex: fix memory leaks
Paul Eggert [Mon, 18 Jan 2016 18:31:07 +0000 (10:31 -0800)]
regex: fix memory leaks

Problem and draft fix reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
* lib/regcomp.c (build_range_exp, build_charclass_op):
* lib/regex_internal.c (re_dfa_add_node):
Fix memory leak on failure.

9 years agofts: don't unconditionally use leaf optimization for NFS
Pádraig Brady [Mon, 18 Jan 2016 17:29:28 +0000 (17:29 +0000)]
fts: don't unconditionally use leaf optimization for NFS

NFS st_nlink are not accurate on all implementations,
leading to aborts() if that assumption is made.
See <https://bugzilla.redhat.com/1299169>
* lib/fts.c (leaf_optimization_applies): Remove NFS from
the white list, and document the issue.

9 years ago* gnulib-tool: fix stray debug line in previous patch
Paul Eggert [Fri, 15 Jan 2016 18:12:41 +0000 (10:12 -0800)]
* gnulib-tool: fix stray debug line in previous patch

9 years agognulib-tool: don't assume ln -s works
Paul Eggert [Wed, 1 May 2013 04:39:22 +0000 (13:39 +0900)]
gnulib-tool: don't assume ln -s works

* gnulib-tool (func_ln_s): New function.
(func_ln): Use it.

9 years agoutimes: detect utimes() correctly on OS/2 kLIBC
KO Myung-Hun [Fri, 28 Nov 2014 07:43:14 +0000 (16:43 +0900)]
utimes: detect utimes() correctly on OS/2 kLIBC

utimes() of OS/2 kLIBC has some limitations.

1. OS/2 itself supports a file date since 1980 year in local time.
2. OS/2 itself supports only even seconds for a file time.
3. utimes() of OS/2 kLIBC does not work on an opened file.

* m4/utimes.m4: Detect utimes() correctly on OS/2 kLIBC.
* doc/posix-functions/utimes.texi: Document the above limitations of
utimes() on OS/2 kLIBC.

9 years agoopenat_proc_name: port to OS/2 kLIBC
Paul Eggert [Sat, 17 Jan 2015 09:54:05 +0000 (18:54 +0900)]
openat_proc_name: port to OS/2 kLIBC

OS/2 kLIBC provides a function to retrive a path from a fd. Use it
instead of /proc/self/fd.
* lib/openat-proc.c (openat_proc_name):
Don't assume file name length is less than INT_MAX.
Port to OS/2 kLIBC with __libc_Back_ioFHToPath().

9 years agostdint: check _INTPTR_T_DECLARED for intptr_t etc.
KO Myung-Hun [Fri, 15 Jan 2016 18:06:57 +0000 (10:06 -0800)]
stdint: check _INTPTR_T_DECLARED for intptr_t etc.

OS/2 kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
definitions of intptr_t and uintptr_t (which use int and unsigned)
to avoid clashes with declarations of system functions like sbrk.

* lib/stdint.in.h (intptr_t, uintptr_t): Check
_INTPTR_T_DECLARED before defining them.

9 years agodoc: mention unfixed issues with unsupported localtime() values
Pádraig Brady [Fri, 15 Jan 2016 16:12:03 +0000 (16:12 +0000)]
doc: mention unfixed issues with unsupported localtime() values

Note perl has configure time checks in place to avoid this.

* doc/posix-functions/localtime.texi: Mention that FreeBSD 10
returns nonsense for localtime(2^56).
* doc/posix-functions/localtime_r.texi: Likewise.

9 years agoGo back to gettext-0.19.7
Paul Eggert [Fri, 15 Jan 2016 06:05:19 +0000 (22:05 -0800)]
Go back to gettext-0.19.7

9 years agoopendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:49 +0000 (11:23 +0900)]
opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC

* lib/closedir.c (closedir): Unregister fd if closedir() succeeds.
* lib/dirent.in.h (_gl_register_dirp_fd, _gl_unregister_dirp_fd):
Declare on kLIBC.
* lib/dirfd.c (struct dirp_fd_list): New. Structures to keep track of
fd associated with dirp.
(_gl_register_dirp_fd): New. Register fd associated with dirp to
dirp_fd_list.
(_gl_unregister_dirp_fd): New. Unregister fd with closing it.
(dirfd): Implemented for kLIBC.
* lib/fdopendir.c (fdopendir): Implemented for kLIBC.
* lib/opendir.c (opendir): New. Register fd and dirp pair if open()
succeeds.
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Replace if OS/2.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
(REPLACE_DIRFD): Define to 1 if replaced.
* m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise.
* modules/closedir (Depends-on): Add dirfd.
* modules/dirfd (Depends-on): Add 'test $REPLACE_DIRFD = 1' to errno
condition.
(configure.ac): Add dirfd to LIBOBJS if $REPLACE_DIRFD = 1 as well.
* modules/opendir (Depends-on): Add dirfd.

9 years agodup, dup2, fcntl: support a directory fd on OS/2 kLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:47 +0000 (11:23 +0900)]
dup, dup2, fcntl: support a directory fd on OS/2 kLIBC

On OS/2 kLIBC, dup(), dup2() and fcntl() do not work on a directory
fd.

* lib/dup.c (dup_nothrow): New.
* lib/dup2.c (klibc_dup2dirfd): New. dup2() for a directory fd.
(klibc_dup2): New.
* lib/fcntl.c (klibc_fcntl): New.
* m4/dup.m4 (gl_FUNC_DUP): Check if dup() works on a directory fd.
* m4/dup2.m4 (gl_FUNC_DUP2): Check if dup2() works on a directory fd.
* m4/fcntl.m4 (gl_FUNC_FCNTL): Check if F_DUPFD works on a directory
fd.

9 years agopipe_filter_ii_execute: port to OS/2 kLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:46 +0000 (11:23 +0900)]
pipe_filter_ii_execute: port to OS/2 kLIBC

Pipes on kLIBC do not support O_NONBLOCK like Win32.

* lib/pipe-filter-ii.c (start_wrapper, _beginthreadex, CloseHandle,
WaiForSingleObject, WaitForMultipleObjects): New on OS/2 kLIBC.
Reuse Win32 code on OS/2 kLIBC.
* lib/spawn-pipe.c: Reuse Win32 code on OS/2 kLIBC.
* lib/w32spawn.h: Do not include windows.h on OS/2 kLIBC.

9 years agowchar: fix "conflicting types" error for __wcwidth on OS/2 kLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:45 +0000 (11:23 +0900)]
wchar: fix "conflicting types" error for __wcwidth on OS/2 kLIBC

On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
static inline function.  The implementation of wcwidth in wcwidth.c
causes a "conflicting types" error.
* lib/wchar.in.h: Undefine wcwidth on OS/2 kLIBC.

9 years agow32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:44 +0000 (11:23 +0900)]
w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC

spawn() on OS/2 kLIBC is not silly like one on Windows

* libc/w32spawn.h (SHELL_SPECIAL_CHARS, SHELL_SPACE_CHAR): Set both to
empty string on OS/2 kLIBC.

9 years agopipe-filter-aux: undefine HAVE_SELECT on KLIBC
KO Myung-Hun [Thu, 14 Jan 2016 02:23:43 +0000 (11:23 +0900)]
pipe-filter-aux: undefine HAVE_SELECT on KLIBC

On OS/2 kLIBC, select() works only on sockets.

* lib/pipe-filter-aux.h (HAVE_SELECT): Undefine on OS/2 kLIBC.

9 years agobinary-io: don't put fd in binary mode if it is a console on EMX
KO Myung-Hun [Thu, 14 Jan 2016 02:23:42 +0000 (11:23 +0900)]
binary-io: don't put fd in binary mode if it is a console on EMX

* lib/binary-io.h (SET_BINARY): Don't put fd in binary mode if it is
a console on EMX.

9 years agodoc: mention setlocale() issues on OpenBSD
Pádraig Brady [Thu, 14 Jan 2016 10:04:58 +0000 (10:04 +0000)]
doc: mention setlocale() issues on OpenBSD

* doc/posix-functions/setlocale.texi: Mention setlocale(LC_ALL,"")
never fails, and the need to check categories individually.

9 years agosig2str: list all signals on FreeBSD >= 7
Pádraig Brady [Thu, 14 Jan 2016 09:47:39 +0000 (09:47 +0000)]
sig2str: list all signals on FreeBSD >= 7

FreeBSD >= 7 is contravening POSIX by not defining NSIG
to the maximal statically defined signal value.
It does define _SIG_MAXSIG though, so base SIGNUM_BOUND on that.

* lib/sig2str.h (SIGNUM_BOUND): Define to (_SIG_MAXSIG - 2)
where available, even when NSIG is defined.

9 years agoacl-permissions: port to USE_ACL==0 platforms
Paul Eggert [Wed, 13 Jan 2016 19:10:28 +0000 (11:10 -0800)]
acl-permissions: port to USE_ACL==0 platforms

I ran into this problem when building bleeding-edge GNU Emacs
with gcc -fsanitize=address on Fedora 23.  On this platform
the ACL library does not pass the 'configure' test and Emacs
then does not build due in part to what appear to be typos in the
ACL part of Gnulib.
* lib/acl-internal.c (free_permission_context):
* lib/acl-internal.h (struct permission_context):
Test whether USE_ACL is nonzero, not whether it is defined.

9 years agomktime: rename macro to avoid glibc clash
Martin Sebor [Wed, 13 Jan 2016 07:09:35 +0000 (23:09 -0800)]
mktime: rename macro to avoid glibc clash

* lib/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME.  See:
https://sourceware.org/ml/libc-alpha/2016-01/msg00267.html

9 years agoPort "$@" to OpenIndiana ksh93
Paul Eggert [Tue, 12 Jan 2016 23:20:39 +0000 (15:20 -0800)]
Port "$@" to OpenIndiana ksh93

In http://lists.gnu.org/archive/html/bug-autoconf/2015-12/msg00000.html
Pavel Raiskup reports that ${1+"$@"} runs afoul of a bug in /bin/sh
(derived from ksh 93t+ 2010-03-05).  ${1+"$@"} works around an ancient
bug long-dead shells, so remove the workaround.
* build-aux/announce-gen, build-aux/do-release-commit-and-tag:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/prefix-gnulib-mk, build-aux/update-copyright:
* build-aux/useless-if-before-free, tests/test-update-copyright.sh:
Use "$@" instead of ${1+"$@"}.

9 years agoautoupdate
Paul Eggert [Tue, 12 Jan 2016 20:53:28 +0000 (12:53 -0800)]
autoupdate

9 years agoPort Universal Time settings to strict POSIX
Paul Eggert [Tue, 12 Jan 2016 17:29:40 +0000 (09:29 -0800)]
Port Universal Time settings to strict POSIX

* build-aux/announce-gen, build-aux/bootstrap:
* build-aux/do-release-commit-and-tag, build-aux/git-version-gen:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/gnupload, build-aux/mkinstalldirs:
* build-aux/move-if-change, build-aux/prefix-gnulib-mk:
* build-aux/update-copyright, build-aux/useless-if-before-free:
* build-aux/vc-list-files, tests/test-strftime.c:
Use TZ="UTC0", not TZ="UTC".  Either works on GNU platforms,
but POSIX says the behavior of TZ="UTC" is undefined.

9 years agoupdate from texinfo
Karl Berry [Fri, 8 Jan 2016 00:04:04 +0000 (16:04 -0800)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Mon, 4 Jan 2016 22:36:17 +0000 (14:36 -0800)]
update from texinfo

9 years agomsvc-inval: fix problem with unset shell var
Paul Eggert [Sun, 3 Jan 2016 00:19:53 +0000 (16:19 -0800)]
msvc-inval: fix problem with unset shell var

Problem reported by Karl Berry in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00004.html
* modules/msvc-inval (Depends-on):
AC_REQUIRE gl_MSVC_INVAL instead of merely calling it.
* modules/msvc-nothrow (Depends-on): Likewise for gl_MSVC_NOTHROW.

9 years agoautoupdate
Karl Berry [Fri, 1 Jan 2016 16:52:06 +0000 (08:52 -0800)]
autoupdate

9 years agotests: for compare_(), use cmp -s where available
Pádraig Brady [Wed, 25 Nov 2015 14:26:59 +0000 (14:26 +0000)]
tests: for compare_(), use cmp -s where available

* tests/init.sh (compare_): Only fall back to cmp without
the POSIX defined -s option, where this is not available.

9 years agoversion-etc: new year
Paul Eggert [Fri, 1 Jan 2016 08:56:19 +0000 (00:56 -0800)]
version-etc: new year

* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.

9 years agohuman: fix output buffer overrun by 1
Paul Eggert [Thu, 31 Dec 2015 21:16:55 +0000 (13:16 -0800)]
human: fix output buffer overrun by 1

* lib/human.c (human_readable): Fix off-by-one typo in buffer
calculation that could lead to a one-byte buffer overrun.

9 years agoautoupdate
Karl Berry [Thu, 31 Dec 2015 16:04:07 +0000 (08:04 -0800)]
autoupdate

9 years agomaint: add missing ChangeLog entry for previous commit
Daiki Ueno [Sun, 27 Dec 2015 23:16:02 +0000 (08:16 +0900)]
maint: add missing ChangeLog entry for previous commit

9 years agomaint: fix operator precedence in mbrtowc test
Daiki Ueno [Sun, 27 Dec 2015 21:27:42 +0000 (06:27 +0900)]
maint: fix operator precedence in mbrtowc test

This is a fix for test breakage introduced by commit 45228d96; the
equality expression must be parenthesized when negated with '!',
otherwise we always get:

  test-mbrtowc.c:49: assertion 'ret == (size_t)(-2)' failed

* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Negate the entire expression.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): Likewise.

9 years agoautoupdate
Karl Berry [Thu, 24 Dec 2015 16:58:41 +0000 (08:58 -0800)]
autoupdate

9 years agoregexprops-generic: update from regex.h
James Youngman [Wed, 23 Dec 2015 19:22:40 +0000 (19:22 +0000)]
regexprops-generic: update from regex.h

* doc/regexprops-generic.texi: update by running the regexprops binary
from findutils (the command line is 'regexprops "Regular Expressions"
generic').  The recent (ish) change (5a5a9388) to regex.h aligning
gnulib with GNU grep had made this document out-of-date.

9 years agostrftime-tests: avoid false failure on OS X
Pádraig Brady [Tue, 22 Dec 2015 15:45:56 +0000 (15:45 +0000)]
strftime-tests: avoid false failure on OS X

* tests/test-strftime.c (struct localtime_rz_test): Add an
ahistorical member which is used to warn rather than fail
when tm_isdst isn't set for such entries.  This is the case for
"1970-01-01 13:00:00 +1300 (NZDT)" on Darwin 13/14 at least.

9 years agoupdate from texinfo
Karl Berry [Wed, 23 Dec 2015 00:02:59 +0000 (16:02 -0800)]
update from texinfo

9 years agofts: ensure leaf optimization is used for NFS
Kamil Dudka [Wed, 9 Dec 2015 06:34:56 +0000 (07:34 +0100)]
fts: ensure leaf optimization is used for NFS

NFS provides usable dirent.d_type but not necessarily for all entries
of large directories.  See <https://bugzilla.redhat.com/1252549>
* lib/fts.c (leaf_optimization_applies): Append NFS on the white list.

9 years agofts: enable leaf optimization for XFS
Pádraig Brady [Sun, 20 Dec 2015 23:46:05 +0000 (23:46 +0000)]
fts: enable leaf optimization for XFS

XFS provides usable dirent.d_type only for DT_DIR,
but the noleaf optimization still applies, as confirmed with:

  test $(($(find . -maxdepth 1 -type d | wc -l) + 1)) = $(stat -c %h .)

Enabling this gives significant traversal speedup.
Testing with find(1) gives:

  $ time find/find-before /usr/share >/dev/null
  real    0m0.410s
  user    0m0.145s
  sys     0m0.266s

  $ time find/find-after /usr/share >/dev/null
  real    0m0.278s
  user    0m0.147s
  sys     0m0.131s

* lib/fts.c (leaf_optimization_applies): Add XFS to the white list.

9 years agonon-recursive-gnulib-prefix-hack: preserve V_GPERF lines
Daiki Ueno [Fri, 18 Dec 2015 22:42:27 +0000 (07:42 +0900)]
non-recursive-gnulib-prefix-hack: preserve V_GPERF lines

* build-aux/prefix-gnulib-mk (prefix_assignment): Don't change the RHS
of 'V_GPERF.* = ' lines.  Reported by Assaf Gordon in:
https://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00015.html

9 years agointprops: comment fix
Paul Eggert [Fri, 18 Dec 2015 07:06:29 +0000 (23:06 -0800)]
intprops: comment fix

* lib/intprops.h: Fix comment. Reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00013.html

9 years agoupdate from texinfo
Karl Berry [Thu, 17 Dec 2015 21:46:39 +0000 (13:46 -0800)]
update from texinfo

9 years agointprops-test: work around GCC bug 68971
Paul Eggert [Thu, 17 Dec 2015 20:56:55 +0000 (12:56 -0800)]
intprops-test: work around GCC bug 68971

Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00011.html
* tests/test-intprops.c: Ignore -Woverflow in GCC 6 and earlier.
(main): Add a case that better tests 64-bit long in this area.

9 years agoautoupdate
Karl Berry [Mon, 14 Dec 2015 14:37:38 +0000 (06:37 -0800)]
autoupdate

9 years agognulib-tool: allow multiple --local-dir usage
Pavel Raiskup [Sat, 21 Nov 2015 13:09:15 +0000 (14:09 +0100)]
gnulib-tool: allow multiple --local-dir usage

* gnulib-tool: Use --local-dir to construct compound
$local_gnulib_path path instead of $local_gnulib_dir.  Determine
PATH_SEPARATOR early.
(local_gnulib_dir): Rename into $local_gnulib_path everywhere.
(func_gnulib_dir): Cut out PATH_SEPARATOR detection code into
func_determine_path_separator because that needs to be detected
earlier now.
(func_determine_path_separator): New function.
(func_path_foreach, func_path_foreach_inner): New functions.
(func_path_prepend, func_path_append): Likewise.
(func_lookup_local_file, func_lookup_local_file_cb): Likewise.
(func_lookup_file, func_all_modules): Use new functions to work
with local_gnulib_path.
(func_modules_in_dir, func_exists_module): New callbacks for
func_path_foreach.
(func_exists_module, func_get_tests_module): Likewise.
(func_is_local_file, func_should_symlink): New helper methods.
(func_add_file, func_update_file): Use new func_should_symlink
instead, DRY.
(func_reconstruct_cached_local_gnulib_path): New helper.
(func_reconstruct_cached_dir): New callback.
(func_import): The cached_local_gnulib_dir renamed to
cached_local_gnulib_path similarly to local_gnulib_dir.
Use new func_reconstruct_cached_local_gnulib_path.
(func_count_relative_local_gnulib_path): New sub-method.
(func_create_testdir): Use func_should_symlink, DRY.
(func_create_megatestdir): Use new functions to work with
local_gnulib_path correctly.
(func_append_local_dir): New helper.

9 years agofix freadptr to work with ungetc on all uClibc configs
Pádraig Brady [Tue, 8 Dec 2015 15:30:56 +0000 (15:30 +0000)]
fix freadptr to work with ungetc on all uClibc configs

This was noticed at https://bugs.busybox.net/show_bug.cgi?id=4099
where GNU coreutils cut fails like:

  $echo '3:0:0:' | cut -d : -f 2
  30

The reason is because GNU cut uses ungetc(),
and that wasn't handled appropriately on uClibc
when __UCLIBC_HAS_STDIO_GETC_MACRO__ is not defined.

* lib/freadptr.c (freadptr): Return NULL if there are
ungotten chars.  In this case freadseek() will iterate
again to process the ungotten character.

9 years agoupdate from texinfo
Karl Berry [Sat, 28 Nov 2015 16:37:07 +0000 (08:37 -0800)]
update from texinfo

9 years agoautoupdate
Karl Berry [Thu, 26 Nov 2015 17:22:55 +0000 (09:22 -0800)]
autoupdate

9 years agoparse-datetime: relax license to LGPLv2+, for OSTree
Giuseppe Scrivano [Tue, 24 Nov 2015 09:00:31 +0000 (10:00 +0100)]
parse-datetime: relax license to LGPLv2+, for OSTree

* modules/parse-datetime (License): Change from GPL to LGPLv2+.

9 years agoupdate from texinfo
Karl Berry [Wed, 25 Nov 2015 00:56:55 +0000 (16:56 -0800)]
update from texinfo

9 years agoautoupdate
Karl Berry [Tue, 24 Nov 2015 14:16:59 +0000 (06:16 -0800)]
autoupdate

9 years agoautoupdate
Karl Berry [Thu, 19 Nov 2015 16:30:30 +0000 (08:30 -0800)]
autoupdate

9 years agoupdate from texinfo
Karl Berry [Tue, 17 Nov 2015 15:42:47 +0000 (07:42 -0800)]
update from texinfo

9 years agoxalloc-oversized: improve performance with GCC 5
Paul Eggert [Fri, 13 Nov 2015 20:27:57 +0000 (12:27 -0800)]
xalloc-oversized: improve performance with GCC 5

* lib/xalloc-oversized.h (xalloc_oversized):
Improve performance with GCC 5 by using __builtin_mul_overflow.

9 years agointprops: new public macro EXPR_SIGNED
Paul Eggert [Tue, 10 Nov 2015 20:31:38 +0000 (12:31 -0800)]
intprops: new public macro EXPR_SIGNED

Emacs can use this macro, so make it public.
* doc/intprops.texi (Arithmetic Type Properties): Rename from
'Integer Type Determination', since some of these macros apply
to non-integer types.  Clarify what kinds of constant expressions
these macros return.  Say when the arguments can be non-integers.
Mention newly published macro EXPR_SIGNED.
* lib/intprops.h (EXPR_SIGNED): Rename from _GL_INT_SIGNED, to
make it public.  All uses changed.

9 years agointprops: fix typo in clang port
Paul Eggert [Tue, 10 Nov 2015 17:35:16 +0000 (09:35 -0800)]
intprops: fix typo in clang port

* lib/intprops.h (_GL_INT_OP_WRAPV): Fix misspelling of
'__builtin_add_overflow' that is not caught by compiler.

9 years agotest-timespec: fix typo in previous change
Paul Eggert [Fri, 6 Nov 2015 02:32:03 +0000 (18:32 -0800)]
test-timespec: fix typo in previous change

* tests/test-timespec.c (main): Fix typo that reduced test quality.

9 years agotimespec-sub: fix overflow bug; add tests
Paul Eggert [Fri, 6 Nov 2015 01:41:43 +0000 (17:41 -0800)]
timespec-sub: fix overflow bug; add tests

* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Work even if time_t is narrower than int (a theoretical
possibility).  Redo code for a bit more clarity.
* lib/timespec-sub.c (timespec_sub):
Fix off-by-2 bug if a.tv_sec == TYPE_MINIMUM (time_t) and 0 < b.tv_sec.
* modules/timespec-tests, tests/test-timespec.c: New files.

9 years agointprops-test: suppress -Woverlength-strings
Paul Eggert [Thu, 5 Nov 2015 15:46:32 +0000 (07:46 -0800)]
intprops-test: suppress -Woverlength-strings

Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00008.html
It is not worth the hassle to port this test to compilers that
cannot handle long strings in diagnostics.
* tests/test-intprops.c [__GNUC__]: Ignore -Woverlength-strings.

9 years agomaint: add missing ChangeLog entry for previous commit
Pádraig Brady [Wed, 4 Nov 2015 23:21:03 +0000 (23:21 +0000)]
maint: add missing ChangeLog entry for previous commit

9 years agoquotearg: add quotearg_n_style_colon()
Pádraig Brady [Wed, 4 Nov 2015 23:01:25 +0000 (23:01 +0000)]
quotearg: add quotearg_n_style_colon()

This quotes with default options of the specified style,
but with quoting enabled for instances of ':'.

While this can be simulated by temporarily modifying
the default quoting style, this is a little awkward,
and care must be taken with such an implementation
to avoid inlining leading to bloated text.

* lib/quotearg.h (quotearg_n_style_colon): Description and declaration.
* lib/quotearg.c (quotearg_n_style_colon): New function implementation.

9 years agointprops: revise _WRAPV macros, revert _OVERFLOW
Paul Eggert [Wed, 4 Nov 2015 16:27:57 +0000 (08:27 -0800)]
intprops: revise _WRAPV macros, revert _OVERFLOW

The incompatible changes to the _OVERFLOW macros were too much of
a hassle in practice, so revert them.  Instead, change the new
_WRAPV macros to make them closer in behavior to GCC 5's new
builtin_add_overflow etc. functions.  No other software was using
these newly-added macros yet, so this should be OK.
* NEWS: Revert previous change, since the incompatible change
has been reverted, and nobody used the incompatible version.
* doc/intprops.texi (Wraparound Arithmetic, Integer Type Overflow):
Document revised behavior.
(Integer Range Overflow): Adjust example to match above revisions.
* lib/intprops.h (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW)
(INT_MULTIPLY_OVERFLOW): Revert previous change, so that
these can be used in integer constant expressions again.
(INT_CONST_ADD_OVERFLOW, INT_CONST_SUBTRACT_OVERFLOW)
(INT_CONST_MULTIPLY_OVERFLOW): Remove, as these are no longer
needed.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, INT_LEFT_SHIFT_WRAPV):
Remove, as they did not seem that useful.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV)
(_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH)
(_GL_INT_OP_WRAPV_VIA_UNSIGNED):
Support new semantics.
(__has_builtin): New macro, if not alreay defined.
(_GL__GENERIC_BOGUS, _GL_INT_OP_CALC, _GL_INT_OP_CALC1): New macros.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): Remove.
(CHECK_SBINOP, CHECK_SSUM, CHECK_SUM1, CHECK_SSUM1)
(CHECK_SDIFFERENCE, CHECK_SPRODUCT, CHECK_PRODUCT1, CHECK_SPRODUCT1):
New macros.
(CHECK_BINOP, CHECK_UNOP, main, CHECK_SUM): Test new behavior.

9 years agointprops: add parentheses for when OP has precedence lower than "-"
Jim Meyering [Tue, 3 Nov 2015 16:32:27 +0000 (08:32 -0800)]
intprops: add parentheses for when OP has precedence lower than "-"

* lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): In "a OP b - c",
"a OP b" must be parenthesized for when OP is like "<<", which has
lower precedence than the following "-". Reported by Pádraig Brady.

9 years agoquotearg: constify get_quoting_style parameters
Pádraig Brady [Tue, 3 Nov 2015 10:59:55 +0000 (10:59 +0000)]
quotearg: constify get_quoting_style parameters

* lib/quotearg.h (get_quoting_style): Mark parameter as const.
* lib/quotearg.c (get_quoting_style): Likewise.

9 years agoquotearg: add support for $'' shell escaping
Pádraig Brady [Fri, 30 Oct 2015 22:49:16 +0000 (22:49 +0000)]
quotearg: add support for $'' shell escaping

* lib/quotearg.h: Add "shell-escape" and "shell-escape-always"
items and descriptions.
* lib/quotearg.c (quotearg_buffer_restyled): Add support for the
above types by quoting like "shell", but using $'...' syntax
for non printable characters, which should provide unambiguous
printable output for any input.
* tests/test-quotearg-simple.c: Update accordingly.

9 years agomaint: use a more standard return from mbrtowc test
Pádraig Brady [Mon, 2 Nov 2015 11:25:47 +0000 (11:25 +0000)]
maint: use a more standard return from mbrtowc test

* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Don't return 1
from the test program as this is non standard and often
indicates an unhandled case in the test program.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): Likewise.

9 years agointprops: add WRAPV and const flavors for GCC 5
Paul Eggert [Fri, 30 Oct 2015 20:45:26 +0000 (13:45 -0700)]
intprops: add WRAPV and const flavors for GCC 5

If available, use GCC 5's builtin functions for efficient integer
overflow checking.  Also, add macros like INT_ADD_WRAPV that efficently
and safely compute the low-order bits of the correct answer.
A downside of these efficient functions is that they cannot be
used in constant expressions, so add macros like INT_CONST_ADD_OVERFLOW
and INT_CONST_ADD_WRAPV that can be used even in constant expressions.
* NEWS: Document the incompatible changes to INT_ADD_OVERFLOW etc.
* doc/intprops.texi (Integer Properties, Integer Type Overflow):
Document the changes.
(Wraparound Arithmetic): New section.
(Integer Range Overflow):
Put this subsection last, since it's least useful.
* lib/intprops.h (INT_CONST_ADD_OVERFLOW)
(INT_CONST_SUBTRACT_OVERFLOW, INT_CONST_MULTIPLY_OVERFLOW):
New macros, with the meaning that INT_ADD_OVERFLOW etc. used to have.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, _GL_INT_OP_WRAPV, _GL_EXPR_CAST)
(_GL_INT_OP_WRAPV_LONGISH, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV, _GL_OP_OVERFLOW, _GL_OP_WRAPV, _GL_OP_WRAPV_GENSYM):
New macros.
(INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW, INT_MULTIPLY_OVERFLOW):
Generate calls to GCC builtins if available, for speed.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): New macros.
(main, CHECK_BINOP, CHECK_UNOP, CHECK_SUM, CHECK_PRODUCT)
(CHECK_QUOTIENT, CHECK_REMAINDER):
Test WRAPV and CONST flavors (when available) too.

9 years agodoc: use extended timezone format in iso-8601 example
Pádraig Brady [Fri, 23 Oct 2015 02:15:40 +0000 (03:15 +0100)]
doc: use extended timezone format in iso-8601 example

* doc/parse-datetime.texi: The standard states that extended
format (separated with ':') is to be used consistently throughout.
Note that lib/parse-datetime.y can handle either tz format.

9 years agoupdate from texinfo
Karl Berry [Fri, 30 Oct 2015 15:40:41 +0000 (08:40 -0700)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Tue, 27 Oct 2015 15:34:31 +0000 (08:34 -0700)]
update from texinfo

9 years agoupdate from texinfo
Karl Berry [Mon, 26 Oct 2015 14:02:41 +0000 (07:02 -0700)]
update from texinfo

9 years agostdalign: port to Sun C 5.9
Paul Eggert [Sun, 25 Oct 2015 08:10:47 +0000 (01:10 -0700)]
stdalign: port to Sun C 5.9

* doc/posix-headers/stdalign.texi: Document this.
* lib/stdalign.in.h (_Alignas): Sun C 5.9 also supports
__attribute__ ((__aligned__ (...))).

9 years agoautoupdate
Karl Berry [Sat, 24 Oct 2015 12:30:54 +0000 (05:30 -0700)]
autoupdate

9 years agoupdate from texinfo
Karl Berry [Thu, 22 Oct 2015 13:01:11 +0000 (06:01 -0700)]
update from texinfo

9 years agoautoupdate
Karl Berry [Wed, 21 Oct 2015 13:44:22 +0000 (06:44 -0700)]
autoupdate

9 years agotime_rz: fix comment about tzalloc
Paul Eggert [Wed, 21 Oct 2015 06:16:52 +0000 (23:16 -0700)]
time_rz: fix comment about tzalloc

* lib/time_rz.c (tzalloc): Fix comment.

9 years agoupdate from texinfo
Karl Berry [Tue, 20 Oct 2015 14:43:59 +0000 (07:43 -0700)]
update from texinfo