gnulib.git
12 years agoREADME-release: various improvements
Reuben Thomas [Thu, 9 Feb 2012 13:05:57 +0000 (13:05 +0000)]
README-release: various improvements

12 years agoautoupdate
Karl Berry [Fri, 10 Feb 2012 19:26:09 +0000 (11:26 -0800)]
autoupdate

12 years agomaint: replace FSF snail-mail addresses with URLs
Paul Eggert [Fri, 10 Feb 2012 05:39:05 +0000 (21:39 -0800)]
maint: replace FSF snail-mail addresses with URLs

* config/argz.mk, lib/accept4.c, lib/alignof.h, lib/alloca.in.h:
* lib/alphasort.c, lib/arcfour.c, lib/arcfour.h, lib/arctwo.c:
* lib/arctwo.h, lib/argz.c, lib/arpa_inet.in.h, lib/asnprintf.c:
* lib/asprintf.c, lib/assert.in.h, lib/base32.c, lib/base32.h:
* lib/base64.c, lib/base64.h, lib/c-ctype.c, lib/c-ctype.h:
* lib/c-strcase.h, lib/c-strcasecmp.c, lib/c-strncasecmp.c:
* lib/check-version.c, lib/check-version.h, lib/config.charset:
* lib/ctype.in.h, lib/des.c, lib/des.h, lib/dup3.c, lib/errno.in.h:
* lib/float+.h, lib/fnmatch.c, lib/fnmatch.in.h, lib/fnmatch_loop.c:
* lib/fseeko.c, lib/gai_strerror.c, lib/gc-gnulib.c:
* lib/gc-libgcrypt.c, lib/gc-pbkdf2-sha1.c, lib/gc.h:
* lib/getaddrinfo.c, lib/getdelim.c, lib/getfilecon.c, lib/getline.c:
* lib/getlogin_r.c, lib/getpass.c, lib/getpass.h, lib/gettext.h:
* lib/gettimeofday.c, lib/glob.in.h, lib/glthread/cond.c:
* lib/glthread/cond.h, lib/glthread/lock.c, lib/glthread/lock.h:
* lib/glthread/thread.c, lib/glthread/thread.h:
* lib/glthread/threadlib.c, lib/glthread/yield.h, lib/hmac-md5.c:
* lib/hmac-sha1.c, lib/hmac.h, lib/iconv.c, lib/iconv.in.h:
* lib/iconv_close.c, lib/iconv_open.c, lib/inet_ntop.c, lib/isfinite.c:
* lib/isinf.c, lib/iswblank.c, lib/langinfo.in.h, lib/link.c:
* lib/localcharset.c, lib/localcharset.h, lib/lseek.c, lib/malloc.c:
* lib/malloca.c, lib/malloca.h, lib/md2.c, lib/md2.h, lib/md4.c:
* lib/md4.h, lib/md5.c, lib/md5.h, lib/memmem.c, lib/mempcpy.c:
* lib/memset.c, lib/memxor.c, lib/memxor.h, lib/minmax.h, lib/mktime.c:
* lib/msvc-inval.c, lib/msvc-inval.h, lib/msvc-nothrow.c:
* lib/msvc-nothrow.h, lib/netdb.in.h, lib/netinet_in.in.h, lib/nproc.c:
* lib/nproc.h, lib/obstack_printf.c, lib/pathmax.h, lib/pipe.c:
* lib/pipe2.c, lib/poll.c, lib/poll.in.h, lib/printf-args.c:
* lib/printf-args.h, lib/printf-parse.c, lib/printf-parse.h:
* lib/pselect.c, lib/pthread.in.h, lib/pty-private.h, lib/pty.in.h:
* lib/read-file.c, lib/read-file.h, lib/ref-add.sin, lib/ref-del.sin:
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, lib/rijndael-alg-fst.c:
* lib/rijndael-alg-fst.h, lib/rijndael-api-fst.c:
* lib/rijndael-api-fst.h, lib/rint.c, lib/rintf.c, lib/rintl.c:
* lib/round.c, lib/roundf.c, lib/roundl.c, lib/scandir.c, lib/select.c:
* lib/sha1.c, lib/sha1.h, lib/size_max.h, lib/snprintf.c:
* lib/stdalign.in.h, lib/stdarg.in.h, lib/stdbool.in.h:
* lib/stddef.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/str-kmp.h:
* lib/str-two-way.h, lib/strcasecmp.c, lib/strcasestr.c, lib/strdup.c:
* lib/striconv.c, lib/striconv.h, lib/string.in.h, lib/strings.in.h:
* lib/strncasecmp.c, lib/strndup.c, lib/strnlen.c, lib/strpbrk.c:
* lib/strptime.c, lib/strsep.c, lib/strstr.c, lib/strverscmp.c:
* lib/sys_file.in.h, lib/sys_ioctl.in.h, lib/sys_select.in.h:
* lib/sys_socket.in.h, lib/sys_stat.in.h, lib/sys_time.in.h:
* lib/sys_times.in.h, lib/sys_types.in.h, lib/sys_uio.in.h:
* lib/sys_utsname.in.h, lib/sys_wait.in.h, lib/tcgetsid.c:
* lib/termios.in.h, lib/time.in.h, lib/time_r.c, lib/timegm.c:
* lib/times.c, lib/unictype/3level.h, lib/unictype/3levelbit.h:
* lib/unistd.in.h, lib/vasnprintf.c, lib/vasnprintf.h, lib/vasprintf.c:
* lib/vsnprintf.c, lib/waitpid.c, lib/wchar.in.h, lib/wctype.in.h:
* lib/xsize.h, tests/test-closein.c, tests/test-des.c:
* tests/test-fclose.c, tests/test-fgetc.c, tests/test-filevercmp.c:
* tests/test-fputc.c, tests/test-fread.c, tests/test-fwrite.c:
* tests/test-gc-arcfour.c, tests/test-gc-arctwo.c, tests/test-gc-des.c:
* tests/test-gc-hmac-md5.c, tests/test-gc-hmac-sha1.c:
* tests/test-gc-md2.c, tests/test-gc-md4.c, tests/test-gc-md5.c:
* tests/test-gc-pbkdf2-sha1.c, tests/test-gc-rijndael.c:
* tests/test-gc-sha1.c, tests/test-gc.c, tests/test-getdelim.c:
* tests/test-getline.c, tests/test-getndelim2.c, tests/test-md2.c:
* tests/test-md4.c, tests/test-parse-datetime.c, tests/test-perror.c:
* tests/test-perror2.c, tests/test-pipe.c, tests/test-pipe2.c:
* tests/test-poll.c, tests/test-quotearg-simple.c:
* tests/test-quotearg.c, tests/test-quotearg.h:
* tests/test-round-ieee.c, tests/test-round1.c:
* tests/test-roundf-ieee.c, tests/test-roundf1.c:
* tests/test-roundl-ieee.c, tests/test-roundl.c:
* tests/test-safe-alloc.c, tests/test-sigpipe.c:
* tests/test-spawn-pipe-child.c, tests/test-spawn-pipe-main.c:
* tests/test-strerror.c, tests/test-strerror_r.c:
* tests/test-strsignal.c, tests/test-strverscmp.c:
* tests/test-xmemdup0.c:
Replace FSF snail mail addresses with URLs, as per GNU coding
standards.  See glibc bug
<http://sourceware.org/bugzilla/show_bug.cgi?id=13673>.

12 years agoREADME-release: capitalize a word and split a line
Reuben Thomas [Thu, 9 Feb 2012 10:06:39 +0000 (11:06 +0100)]
README-release: capitalize a word and split a line

* top/README-release: Fix punctuation and spacing.

12 years agofatal-signal: use C prototypes (with explicit void).
Akim Demaille [Wed, 8 Feb 2012 09:36:20 +0000 (10:36 +0100)]
fatal-signal: use C prototypes (with explicit void).

* lib/fatal-signal.c (uninstall_handlers, install_handlers)
(init_fatal_signal_set, block_fatal_signals): Fix signatures.

12 years agoregex: spelling fix
Paul Eggert [Wed, 8 Feb 2012 07:07:48 +0000 (23:07 -0800)]
regex: spelling fix

* lib/regexec.c: spelling fix

12 years agoregex: rely on stdint.h for SIZE_MAX
Paul Eggert [Wed, 8 Feb 2012 07:06:43 +0000 (23:06 -0800)]
regex: rely on stdint.h for SIZE_MAX

* lib/regex_internal.h (SIZE_MAX): Remove; stdint.h supplies this now.

12 years agoregex: merge glibc changes
Paul Eggert [Wed, 8 Feb 2012 06:47:01 +0000 (22:47 -0800)]
regex: merge glibc changes

* lib/regcomp.c (init_dfa): Tighten overflow checks to test
for IDX_MAX too, since IDX_MAX can be much less than SIZE_MAX.
(init_word_char): Work even if bitset words are not exactly 32 or
64 bits wide.  Don't assume there are no padding bits.
* lib/regex.c [_LIBC]: Do not include <config.h>.
[!_LIBC]: Add pragmas to ignore -Wsuggest-attributes=pure
and -Wtype-limits.
* lib/regex.h (__USE_GNU): Renamed from __USE_GNU_REGEX, to avoid
needless disagreement with glibc.  All uses changed.  Define it to
1 only if _GNU_SOURCE, to match glibc.
(_REG_RM_NAME): Remove; no longer needed, since the names in
question are now all protected by __USE_GNU.
(_REG_RE_NAME): Remove; replaced by glibc's __REPB_PREFIX.
(REG_TRANSLATE_TYPE): Remove; replaced by glibc's __RE_TRANSLATE_TYPE.
* lib/regex_internal.h (MIN): New macro.

2012-01-03 Ulrich Drepper <drepper@gmail.com>
* lib/regcomp.c (init_word_char): Optimize regex a bit.

2011-12-30 Jakub Jelinek <jakub@redhat.com>
* lib/regex_internal.c (re_string_fetch_byte_case):
Fix up regcomp/regexec.  The problem is that parse_bracket_symbol
is miscompiled, and it turns out it is because of an incorrect
attribute on re_string_fetch_byte_case.  Unlike
re_string_peek_byte_case, this one is really not pure, it modifies
memory (increments pstr->cur_idx), and with the pure attribute GCC
assumed it doesn't and it cached the presumed value of
regexp->cur_idx in a variable across the
 for (;; ++i)
   {
     if (i >= BRACKET_NAME_BUF_SIZE)
       return REG_EBRACK;
     if (token->type == OP_OPEN_CHAR_CLASS)
       ch = re_string_fetch_byte_case (regexp);
     else
       ch = re_string_fetch_byte (regexp);
     if (re_string_eoi(regexp))
       return REG_EBRACK;
     if (ch == delim && re_string_peek_byte (regexp, 0) == ']')
       break;
     elem->opr.name[i] = ch;
   }

2011-11-29 Andreas Schwab <schwab@redhat.com>
* lib/regcomp.c (build_equiv_class):
Fix access after end of search string in regex matcher.

2011-11-12 Ulrich Drepper <drepper@redhat.com>
* lib/regex_internal.c, lib/regex_internal.h: Fix warnings in regex.

2011-10-12 Ulrich Drepper <drepper@redhat.com>
* lib/regcomp.c (parse_branch): One more regex memory leak fixed.

2011-10-11 Ulrich Drepper <drepper@redhat.com>
* lib/regcomp.c (parse_branch, parse_sub_exp):
More regex memory leak fixes and tests.
(parse_sub_exp, parse_bracket_exp):
Fix memory leak for some invalid regular expressions.

2011-05-28 Ulrich Drepper <drepper@gmail.com>
* lib/regex_internal.c, lib/regexec.c:
Fix unnecessary overallocation due to incomplete character.  When
incomplete characters are found at the end of a string the code
ran amok and allocated lots of memory.  Stricter limits are now in
place.

2011-05-20 Reuben Thomas <rrt@sc3d.org>
* lib/regex.h: Update documentation.

2011-05-16 Aharon Robbins <arnold@skeeve.com>
* lib/regex.h: Update RE_SYNTAX*_AWK constants.

2010-05-05 Andreas Schwab <schwab@redhat.com>
* lib/regexec.c (find_collation_sequence_value):
Fix lookup of collation sequence value during regexp matching.

2010-01-22 Ulrich Drepper <drepper@redhat.com>
* lib/regex_internal.c (re_dfa_add_node): Extend overflow detection.

2008-01-16 Ulrich Drepper <drepper@redhat.com>
* lib/regex.h: Cleanup namespace.

2007-11-26 Ulrich Drepper <drepper@redhat.com>
* lib/regex.h (REG_ENOSYS): Define REG_ENOSYS also for __USE_XOPEN2K.

2007-08-26 Ulrich Drepper <drepper@redhat.com>
* lib/regex_internal.h: Prevent some declarations and definitions
to be seen when used in tests.

2005-05-06 Ulrich Drepper <drepper@redhat.com>
* lib/regex_internal.h: Include bits/libc-lock.h or define dummy
__libc_lock_* macros if not _LIBC.
(struct re_dfa_t): Add lock.

12 years agomaint.mk: also prohibit lower-case @var@
Eric Blake [Thu, 2 Feb 2012 21:11:40 +0000 (14:11 -0700)]
maint.mk: also prohibit lower-case @var@

* top/maint.mk (sc_makefile_at_at_check): Enhance check to cover
lower case, like @top_srcdir@.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoautoupdate
Karl Berry [Tue, 7 Feb 2012 16:57:18 +0000 (08:57 -0800)]
autoupdate

12 years agomaint: spelling fixes
Paul Eggert [Sun, 5 Feb 2012 21:42:03 +0000 (13:42 -0800)]
maint: spelling fixes

12 years agocanonicalize: avoid uninitialized memory use
Eric Blake [Sat, 4 Feb 2012 18:11:40 +0000 (11:11 -0700)]
canonicalize: avoid uninitialized memory use

When DOUBLE_SLASH_IS_DISTINCT_ROOT is non-zero, then we were
reading the contents of rpath[1] even when we had never written
anything there, which meant that "///" would usually canonicalize
to "/" but sometimes to "//" if a '/' was leftover in the heap.
This condition could also occur via 'ln -s / //some/path' and
canonicalizing //some/path, where we rewind rpath but do not
clear out the previous round.  Platforms where "//" and "/" are
equivalent do not suffer from this read-beyond-written bounds.

* lib/canonicalize-lgpl.c (__realpath): Avoid possibility of
random '/' left in dest.
* lib/canonicalize.c (canonicalize_filename_mode): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoisatty: Fix test failure of ptsname_r on native Windows.
Bruno Haible [Sat, 4 Feb 2012 18:13:34 +0000 (19:13 +0100)]
isatty: Fix test failure of ptsname_r on native Windows.

* lib/isatty.c (_isatty_nothrow): Upon exception, return 0, not -1,
and don't set errno.
(isatty): Test first whether fd is valid. Set errno when returning 0.

12 years agospawn-pipe tests: Fix a NULL program name in a diagnostic.
Bruno Haible [Sat, 4 Feb 2012 17:20:11 +0000 (18:20 +0100)]
spawn-pipe tests: Fix a NULL program name in a diagnostic.

* tests/test-spawn-pipe-main.c: Include progname.h.
(main): Invoke set_program_name.
* modules/spawn-pipe-tests (Depends-on): Add progname.

12 years agononblocking-socket tests: Fix a NULL program name in a diagnostic.
Bruno Haible [Sat, 4 Feb 2012 17:19:11 +0000 (18:19 +0100)]
nonblocking-socket tests: Fix a NULL program name in a diagnostic.

* tests/test-nonblocking-socket-main.c: Include progname.h.
(main): Invoke set_program_name.
* modules/nonblocking-socket-tests (Depends-on): Add progname.

12 years agononblocking-pipe tests: Fix a NULL program name in a diagnostic.
Bruno Haible [Sat, 4 Feb 2012 17:18:37 +0000 (18:18 +0100)]
nonblocking-pipe tests: Fix a NULL program name in a diagnostic.

* tests/test-nonblocking-pipe-main.c: Include progname.h.
(main): Invoke set_program_name.
* modules/nonblocking-pipe-tests (Depends-on): Add progname.

12 years agocanonicalize-lgpl: fix // handling
Eric Blake [Sat, 4 Feb 2012 17:03:29 +0000 (10:03 -0700)]
canonicalize-lgpl: fix // handling

Same as the previous patch, for the lgpl version.

* lib/canonicalize-lgpl.c (__realpath): Don't convert /// to //.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agocanonicalize: fix // handling
Eric Blake [Sat, 4 Feb 2012 16:46:32 +0000 (09:46 -0700)]
canonicalize: fix // handling

On Cygwin, and other platforms where // is detected as distinct
from / at configure time, the canonicalize routines were incorrectly
treating all instances of multiple leading slashes as //.
See also coreutils bug http://debbugs.gnu.org/10472

* lib/canonicalize.c (canonicalize_filename_mode): Don't convert
/// to //, since only // is special.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoioctl: Fix test failure on native Windows.
Bruno Haible [Sat, 4 Feb 2012 15:39:30 +0000 (16:39 +0100)]
ioctl: Fix test failure on native Windows.

* lib/ioctl.c: Include msvc-nothrow.h.
(primary_ioctl): If fd is not a valid handle, set errno to EBADF.

12 years agofsync: Avoid test failure on native Windows.
Bruno Haible [Sat, 4 Feb 2012 13:59:43 +0000 (14:59 +0100)]
fsync: Avoid test failure on native Windows.

* lib/fsync.c (fsync) [Windows]: Don't fail if the handle is merely
read-only.

12 years ago* lib/sys_select.in.h [OpenBSD]: When /usr/include/pthread.h is
Bruno Haible [Sat, 4 Feb 2012 13:56:18 +0000 (14:56 +0100)]
* lib/sys_select.in.h [OpenBSD]: When /usr/include/pthread.h is

currently being included, just include the system's <sys/select.h>.

2012-02-04  Bruno Haible  <bruno@clisp.org>

sys_select: Avoid syntax error on OpenBSD 5.0.

12 years agosys_select: Avoid syntax error on OpenBSD 5.0.
Bruno Haible [Sat, 4 Feb 2012 13:50:20 +0000 (14:50 +0100)]
sys_select: Avoid syntax error on OpenBSD 5.0.

* lib/sys_select.in.h: Include <signal.h> only after the include_next
<sys/select.h>, not before.
Reported by Jiri B <jirib@devio.us>.

12 years agoget-rusage-as, get-rusage-data tests: Avoid test failure with gcc-4.7.
Bruno Haible [Sat, 4 Feb 2012 11:59:00 +0000 (12:59 +0100)]
get-rusage-as, get-rusage-data tests: Avoid test failure with gcc-4.7.

* tests/test-get-rusage-as.c (main): Assign the malloc() results to
global variables.
* tests/test-get-rusage-data.c (main): Likewise.
Reported by Jim Meyering.

12 years agostdioext: Fix last commit.
Bruno Haible [Sat, 4 Feb 2012 11:56:33 +0000 (12:56 +0100)]
stdioext: Fix last commit.

* lib/fwritable.c [EPLAN9]: Include <fcntl.h>.

12 years agostdioext: Add tentative support for Plan9.
Bruno Haible [Fri, 3 Feb 2012 21:58:33 +0000 (22:58 +0100)]
stdioext: Add tentative support for Plan9.

* lib/stdio-impl.h: Include <errno.h>.
* lib/fseterr.c (fseterr) [EPLAN9]: Add conditional code.
* lib/freadable.c (freadable): Likewise.
* lib/fwritable.c (fwritable): Likewise.
* lib/fbufmode.c (fbufmode): Likewise.
* lib/freading.c (freading): Likewise.
* lib/fwriting.c (fwriting): Likewise.
* lib/freadptr.c (freadptr): Likewise.
* lib/freadseek.c (freadptrinc): Likewise.
* lib/freadahead.c (freadahead): Likewise.
* lib/fpurge.c (fpurge): Likewise.
* lib/fseeko.c (rpl_fseeko): Likewise.
* m4/fpending.m4 (gl_PREREQ_FPENDING): Add a variant for Plan9.
Reported by Jens Staal <staal1978@gmail.com>.

12 years agofile-has-acl: suppress a warning from gcc -Wsuggest-attribute=const
Jim Meyering [Thu, 2 Feb 2012 08:12:13 +0000 (09:12 +0100)]
file-has-acl: suppress a warning from gcc -Wsuggest-attribute=const

* lib/file-has-acl.c (file_has_acl): This function (for some #ifdefs)
would evoke a new gcc warning.  Given all of the #ifdefs, it is better
not even to try to add the attribute.  Instead, add a pragma to suppress
the suggestion/warning.

12 years agoSpelling fixes.
Paul Eggert [Wed, 1 Feb 2012 05:12:29 +0000 (21:12 -0800)]
Spelling fixes.

12 years agotypo
Karl Berry [Tue, 31 Jan 2012 22:24:40 +0000 (14:24 -0800)]
typo

12 years agoautoupdate
Karl Berry [Tue, 31 Jan 2012 17:03:05 +0000 (09:03 -0800)]
autoupdate

12 years agopopen: Make more robust on Windows.
Bruno Haible [Tue, 31 Jan 2012 11:15:46 +0000 (12:15 +0100)]
popen: Make more robust on Windows.

* lib/popen.c: On native Windows, use the _popen based code even if
HAVE_POPEN is set.
* doc/posix-functions/popen.texi: Mention necessity of COMSPEC
environment variable on native Windows.

12 years agoFix date of recent ChangeLog entries.
Bruno Haible [Tue, 31 Jan 2012 11:13:29 +0000 (12:13 +0100)]
Fix date of recent ChangeLog entries.

12 years agopclose: Fix typo.
Bruno Haible [Tue, 31 Jan 2012 02:02:53 +0000 (03:02 +0100)]
pclose: Fix typo.

* lib/stdio.in.h (pclose): Fix typo in warning message.

12 years agodoc about getlogin_r, setstate.
Bruno Haible [Mon, 30 Jan 2012 21:47:22 +0000 (22:47 +0100)]
doc about getlogin_r, setstate.

* doc/posix-functions/getlogin_r.texi: List the incompatible
declaration problem under "not fixed by gnulib".
* doc/posix-functions/setstate.texi: Mention incompatible declaration
problem on Solaris 11 and other platforms.

12 years agopoll tests: Make test more robust.
Chuanchang Jia [Mon, 30 Jan 2012 21:39:01 +0000 (22:39 +0100)]
poll tests: Make test more robust.

* tests/test-poll.c: Include macros.h.
(test_accept_first, test_pair, test_socket_pair, test_pipe): Verify
return value of various I/O operations.
* modules/poll-tests (Files): Add tests/macros.h.

12 years agosys_stat: Fix support for mingw64 and MSVC.
Bruno Haible [Mon, 30 Jan 2012 20:43:40 +0000 (21:43 +0100)]
sys_stat: Fix support for mingw64 and MSVC.

* lib/sys_stat.in.h (stat) [AIX]: Don't redefine 'stat' if the system
header files already do it.
(stat) [mingw, msvc]: Redefine the symbol to which stat is defined, not
stat itself.
Reported by Marc-André Lureau <marcandre.lureau@redhat.com>.

12 years agowcwidth: Work around bug in UTF-8 locale on OpenBSD 5.0.
Bruno Haible [Mon, 30 Jan 2012 20:31:57 +0000 (21:31 +0100)]
wcwidth: Work around bug in UTF-8 locale on OpenBSD 5.0.

* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Test also wcwidth of U+05B0.
* doc/posix-functions/wcwidth.texi: Mention the OpenBSD 5.0 bug.

12 years agoquotearg: Fix test failure on MacOS X 10.5.
Bruno Haible [Mon, 30 Jan 2012 19:32:33 +0000 (20:32 +0100)]
quotearg: Fix test failure on MacOS X 10.5.

* tests/test-quotearg-simple.c: Include localcharset.h.
(main): If the locale encoding is not ASCII, bypass the tests of
locale_quoting_style and clocale_quoting_style.
* modules/quotearg-tests (Depends-on): Add 'localcharset'.

12 years agomaint.mk: sc_prohibit_canonicalize_without_use: avoid false positive
Jim Meyering [Sun, 29 Jan 2012 21:30:20 +0000 (22:30 +0100)]
maint.mk: sc_prohibit_canonicalize_without_use: avoid false positive

* top/maint.mk (sc_prohibit_canonicalize_without_use): Also
detect uses of canonicalize_file_name.

12 years agoautoupdate
Karl Berry [Sun, 29 Jan 2012 16:00:40 +0000 (08:00 -0800)]
autoupdate

12 years agotest-framework-sh: Fix test failure with AIX 7.1 diff.
Bruno Haible [Sat, 28 Jan 2012 22:29:16 +0000 (23:29 +0100)]
test-framework-sh: Fix test failure with AIX 7.1 diff.

* tests/init.sh (compare_): Don't use 'diff -u' if it inserts a space
in column 1, like 'diff -c' does.
* tests/test-init.sh (test_compare): Don't repeat the test from init.sh
whether 'diff -u' is used. Instead, test whether the output contains
some '@' character.

12 years agostrtoimax: eliminate need for stdint.h, inttypes.h checks
Paul Eggert [Sat, 28 Jan 2012 21:31:06 +0000 (13:31 -0800)]
strtoimax: eliminate need for stdint.h, inttypes.h checks

* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Don't use
gl_AC_HEADER_STDINT_H or gl_AC_HEADER_INTTYPES_H.  This reduces
the prerequisites for a recently-introduced strtoimax test.
I guess this might cause strtoimax to be replaced when not
strictly necessary on older hosts, but this shouldn't introduce
any bugs and it should make Emacs 'configure' faster on typical
modern hosts.  Problem discovered when importing the latest gnulib
to an Emacs test version.
* modules/strtoimax (Files): Remove m4/stdint_h.m4, m4/inttypes_h.m4.

12 years agosys_time: Override 'struct timeval' on some native Windows platforms.
Bruno Haible [Sat, 28 Jan 2012 17:12:10 +0000 (18:12 +0100)]
sys_time: Override 'struct timeval' on some native Windows platforms.

* m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Test whether tv_sec
has the right type. Set REPLACE_STRUCT_TIMEVAL if not.
(gl_HEADER_SYS_TIME_H_DEFAULTS): Initialize REPLACE_STRUCT_TIMEVAL.
* lib/sys_time.in.h: Include <winsock2.h> also when 'struct timeval'
needs to be overridden.
(timeval): Override if REPLACE_STRUCT_TIMEVAL is set.
* modules/sys_time (Makefile.am): Substitute REPLACE_STRUCT_TIMEVAL.
* tests/test-sys_select.c: Check that the tv_sec member has the same
size as a 'time_t'.
* tests/test-sys_time.c: Likewise.
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): If REPLACE_STRUCT_TIMEVAL
is set, set also REPLACE_GETTIMEOFDAY.
* lib/gettimeofday.c (gettimeofday): If 'struct timeval' is overridden,
convert the resulting 'struct timeval' before returning.
* lib/select.c: Include <sys/time.h>.
(select, timeval): Undefine at the right place.
* modules/select (Depends-on): Add sys_time.
* doc/posix-headers/sys_time.texi: Mention the problem with tv_sec on
some Windows platforms.
Reported by Marc-André Lureau <marcandre.lureau@redhat.com>.

12 years agoaccept4, fcntl, socket modules: Avoid warnings on x86_64 mingw64.
Marc-André Lureau [Sat, 28 Jan 2012 12:23:31 +0000 (13:23 +0100)]
accept4, fcntl, socket modules: Avoid warnings on x86_64 mingw64.

* lib/accept4.c (accept4): Use intptr_t to convert handle pointer to
an integer.
* lib/fcntl.c (dupfd): Likewise.
* lib/w32sock.h (SOCKET_TO_FD): Likewise.

12 years agofcntl: Avoid compilation error on native Windows.
Bruno Haible [Sat, 28 Jan 2012 12:15:36 +0000 (13:15 +0100)]
fcntl: Avoid compilation error on native Windows.

* modules/fcntl (Depends-on): Add 'close'.

12 years agoselect, poll, isatty: Avoid warnings on x86_64 mingw64.
Marc-André Lureau [Sat, 28 Jan 2012 11:39:43 +0000 (12:39 +0100)]
select, poll, isatty: Avoid warnings on x86_64 mingw64.

* lib/select.c (IsConsoleHandle): Use intptr_t to convert handle
pointer to an integer.
* lib/poll.c (IsConsoleHandle): Likewise.
* lib/isatty.c (IsConsoleHandle): Likewise.

12 years agodoc: clarify README-release
Jim Meyering [Sat, 28 Jan 2012 09:49:35 +0000 (10:49 +0100)]
doc: clarify README-release

* top/README-release: Clarify: you should make a point to have
the latest stable versions of build tools in your PATH, and the
reference to buildreq is solely for its list of tool names, not
for its minimal-functional version numbers.
Prompted by discussion with Reuben Thomas and Gary V. Vaughan.

12 years agomaint.mk: use more readable (yet functionally equivalent) quoting
Jim Meyering [Sat, 28 Jan 2012 09:16:25 +0000 (10:16 +0100)]
maint.mk: use more readable (yet functionally equivalent) quoting

It is common to quote a single quote in a single quoted string like
this:  '...'\''...'.  Unless you know the idiom, that looks like
gibberish, so prefer to double-quote the string when possible.
Then you can use a more readable, lone single quote: "...'..."
* top/maint.mk (sc_cast_of_argument_to_free): Quoting like this
"don't" is more readable than the equivalent 'don'\''t'.
(sc_cast_of_x_alloc_return_value): Likewise.
(sc_cast_of_alloca_return_value): Likewise.
(sc_makefile_path_separator_check): Similar: use ":" in '...',
rather than '\'':'\''.

12 years agostdalign: relax _Alignof and tighten _Alignas test
Paul Eggert [Sat, 28 Jan 2012 06:17:42 +0000 (22:17 -0800)]
stdalign: relax _Alignof and tighten _Alignas test

* m4/stdalign.m4 (gl_STDALIGN_H): Relax the _Alignof test,
as it was too strict: alignof must divide offsetof, but it need
not equal offsetof.  Inspired by Joseph S. Myers's comment
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023#c10>.
Conversely, tighten the _Alignas test a bit, as the resulting
alignment must be exactly 8.

12 years agostdalign: Document the last change.
Bruno Haible [Fri, 27 Jan 2012 20:20:39 +0000 (21:20 +0100)]
stdalign: Document the last change.

* doc/posix-headers/stdalign.texi: Mention GCC bug 52023.

12 years agoFix bug# typo in previous patch.
Paul Eggert [Fri, 27 Jan 2012 18:22:51 +0000 (10:22 -0800)]
Fix bug# typo in previous patch.

12 years agostdalign: check that alignof and offsetof are consistent
Paul Eggert [Fri, 27 Jan 2012 18:17:18 +0000 (10:17 -0800)]
stdalign: check that alignof and offsetof are consistent

* m4/stdalign.m4 (gl_STDALIGN_H): Check for GCC bug 52023.
Problem reported for gnulib by Richard W.M. Jones in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00340.html>.

12 years agoupdate-copyright: accept new option: UPDATE_COPYRIGHT_USE_INTERVALS=2
Jim Meyering [Fri, 27 Jan 2012 09:19:26 +0000 (10:19 +0100)]
update-copyright: accept new option: UPDATE_COPYRIGHT_USE_INTERVALS=2

* build-aux/update-copyright: When UPDATE_COPYRIGHT_USE_INTERVALS=2,
convert a sequence with gaps to the minimal containing range.
For example, convert 2000, 2004-2007, 2009 to 2000-2009.
* tests/test-update-copyright.sh: Test for this.
The FSF confirmed it is ok to do this, assuming there is at
least one significant change per year in the affected range:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29554/focus=29860

12 years agobuild-aux/ylwrap: restore x bit
Eric Blake [Fri, 27 Jan 2012 04:21:53 +0000 (21:21 -0700)]
build-aux/ylwrap: restore x bit

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agopipe2: refine doc about thread-safety
Bruno Haible [Thu, 26 Jan 2012 21:21:45 +0000 (22:21 +0100)]
pipe2: refine doc about thread-safety

* doc/glibc-functions/pipe2.texi: Clarify the extent of the
multithread-safety problem.
* doc/glibc-functions/accept4.texi: Likewise.

12 years agoposix_spawn_file_actions_addopen: Fix 2012-01-08 commit.
Bruno Haible [Thu, 26 Jan 2012 17:11:47 +0000 (18:11 +0100)]
posix_spawn_file_actions_addopen: Fix 2012-01-08 commit.

* m4/posix_spawn.m4 (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN):
In the test program, include <fcntl.h>, for O_RDONLY.

12 years agopipe2, assign4: document lack of thread-safety in replacement
Eric Blake [Thu, 26 Jan 2012 15:31:48 +0000 (08:31 -0700)]
pipe2, assign4: document lack of thread-safety in replacement

* doc/glibc-functions/pipe2.texi (pipe2): Mention thread safety
issue in replacement.
* doc/glibc-functions/accept4.texi (accept4): Likewise.
Based on a report by Eric Wong.

12 years agomalloca: Avoid warnings on x86_64 mingw64.
Marc-André Lureau [Tue, 24 Jan 2012 12:21:56 +0000 (13:21 +0100)]
malloca: Avoid warnings on x86_64 mingw64.

* lib/malloca.c: Include <stdint.h>.
(mmalloca, freea): Use uintptr_t to convert pointers to integers.
* modules/malloca (Depends-on): Add stdint.
* modules/relocatable-prog-wrapper (Depends-on): Likewise.

12 years agoobstack: remove __STDC__ conditionals
Paul Eggert [Wed, 25 Jan 2012 19:08:01 +0000 (11:08 -0800)]
obstack: remove __STDC__ conditionals

* lib/obstack.h: Remove __STDC__ conditionals, as suggested by Joseph
S. Myers in <http://cygwin.com/ml/libc-alpha/2012-01/msg00104.html>.
This leaves lib/localcharset.c, m4/iconv.m4, and a confusing comment in
m4/include_next.m4 as the only gnulib-maintained places that still
refer to __STDC__.

12 years agohavelib: Modern quoting.
Bruno Haible [Tue, 24 Jan 2012 12:06:35 +0000 (13:06 +0100)]
havelib: Modern quoting.

* build-aux/config.rpath: Quote 'like this', not `like this', as per
the recent change to the GNU coding standards.

12 years agostdint: Improve support for Android.
Bruno Haible [Tue, 24 Jan 2012 11:22:41 +0000 (12:22 +0100)]
stdint: Improve support for Android.

* lib/stdint.in.h: Test __ANDROID__, not __BIONIC__.
Reported by Simon Josefsson <simon@josefsson.org>.

12 years agodoc: omit trailing empty lines from INSTALL etc.
Paul Eggert [Tue, 17 Jan 2012 23:48:12 +0000 (15:48 -0800)]
doc: omit trailing empty lines from INSTALL etc.

* doc/Makefile (INSTALL): Omit trailing empty lines.
(INSTALL.ISO, INSTALL.UTF-8): Build from INSTALL, so that these also
omit trailing empty lines.  This simplifies the build procedure.

12 years agotests: avoid spurious warnings about gl_sockets_startup
Jim Meyering [Mon, 23 Jan 2012 14:51:02 +0000 (15:51 +0100)]
tests: avoid spurious warnings about gl_sockets_startup

Fedora rawhide's gcc version 4.7.0 20120119 with -Wunused-value
would warn about every use of "gl_sockets_startup (SOCKETS_1_1);"
reporting a "statement with no effect".
* tests/test-accept.c (main): Mark as "(void)".
* tests/test-accept4.c (main): Likewise.
* tests/test-bind.c (main): Likewise.
* tests/test-connect.c (main): Likewise.
* tests/test-getpeername.c (main): Likewise.
* tests/test-getsockname.c (main): Likewise.
* tests/test-getsockopt.c (main): Likewise.
* tests/test-listen.c (main): Likewise.
* tests/test-recv.c (main): Likewise.
* tests/test-recvfrom.c (main): Likewise.
* tests/test-send.c (main): Likewise.
* tests/test-sendto.c (main): Likewise.
* tests/test-setsockopt.c (main): Likewise.
* tests/test-shutdown.c (main): Likewise.

12 years agolocale-fr.m4: Fix for Android.
Bruno Haible [Sat, 21 Jan 2012 13:39:02 +0000 (14:39 +0100)]
locale-fr.m4: Fix for Android.

* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Avoid compilation
failure of the test program on Bionic libc.

12 years agobootstrap: fail when bootstrap_post_import_hook fails
Jim Meyering [Sat, 21 Jan 2012 17:12:30 +0000 (18:12 +0100)]
bootstrap: fail when bootstrap_post_import_hook fails

Otherwise, it's far too easy to miss diagnostics emitted
between gnulib-tool's output and that of running configure.
* build-aux/bootstrap: Fail when bootstrap_post_import_hook fails.

12 years agoupdate from texinfo
Karl Berry [Sat, 21 Jan 2012 16:17:48 +0000 (08:17 -0800)]
update from texinfo

12 years agomaint: enable sc_trailing_blank
Jim Meyering [Tue, 17 Jan 2012 17:48:21 +0000 (18:48 +0100)]
maint: enable sc_trailing_blank

* build-aux/pmccabe.css: Remove trailing blanks.
* doc/acl-cygwin.txt: Likewise.
* doc/gnu-oids.texi: Likewise
* cfg.mk: Enable sc_trailing_blank.
Exempt build-aux/texinfo.tex and doc/Copyright/assign.future.manual.

12 years agomaint: enable sc_prohibit_openat_without_use
Jim Meyering [Tue, 17 Jan 2012 17:41:18 +0000 (18:41 +0100)]
maint: enable sc_prohibit_openat_without_use

* cfg.mk: Enable sc_prohibit_openat_without_use.
Exempt lib/selinux-at.c.

12 years agomaint: enable sc_prohibit_cloexec_without_use
Jim Meyering [Tue, 17 Jan 2012 17:30:09 +0000 (18:30 +0100)]
maint: enable sc_prohibit_cloexec_without_use

* cfg.mk: Enable sc_prohibit_cloexec_without_use.
* lib/dup-safer-flag.c: Don't include "cloexec.h".  Not needed.

12 years agomaint: enable sc_prohibit_intprops_without_use
Jim Meyering [Tue, 17 Jan 2012 17:21:34 +0000 (18:21 +0100)]
maint: enable sc_prohibit_intprops_without_use

* cfg.mk: Enable sc_prohibit_intprops_without_use
* tests/test-nanosleep.c: Don't include "intprops.h".  Not needed.
* lib/ftoastr.c: Likewise.

12 years agomaint: enable sc_prohibit_hash_pjw_without_use
Jim Meyering [Tue, 17 Jan 2012 17:10:01 +0000 (18:10 +0100)]
maint: enable sc_prohibit_hash_pjw_without_use

* cfg.mk: Enable sc_prohibit_hash_pjw_without_use.
* top/maint.mk (sc_prohibit_hash_pjw_without_use): Adjust regexp
to match any use of \<hash_pjw\>, i.e., not necessarily with a
following " (".

12 years agomaint: enable double-word-prohibiting rule
Jim Meyering [Tue, 17 Jan 2012 17:05:45 +0000 (18:05 +0100)]
maint: enable double-word-prohibiting rule

* cfg.mk (local-checks-to-skip): Enable sc_prohibit_doubled_word.
Exempt three files.

12 years agomaint: remove empty lines at EOF, but excluding modules/*
Jim Meyering [Tue, 17 Jan 2012 16:56:22 +0000 (17:56 +0100)]
maint: remove empty lines at EOF, but excluding modules/*

Apply syntax rules at home as well as abroad.  Most changes
were induced by running this:
  make srcdir=. _build-aux=build-aux -f top/maint.mk \
    sc_prohibit_empty_lines_at_EOF | grep -v modules/ \
    | xargs perl -pi -0777 -e 's/\n\n+$/\n/'
* cfg.mk (local-checks-to-skip): Enable sc_prohibit_empty_lines_at_EOF.
Exempt modules/* and two binary files.
Also exclude doc/INSTALL*, per request from Bruno Haible.
* doc/regexprops-generic.texi: *Add* a newline at EOF.  There was none.
* doc/Copyright/assign.translation.manual: Remove empty lines at EOF.
* doc/Copyright/request-assign.future: Likewise.
* doc/Copyright/request-disclaim.changes: Likewise.
* doc/INSTALL: Likewise.
* doc/INSTALL.ISO: Likewise.
* doc/INSTALL.UTF-8: Likewise.
* doc/acl-cygwin.txt: Likewise.
* doc/acl-resources.txt: Likewise.
* doc/fdl-1.2.texi: Likewise.
* doc/fdl-1.3.texi: Likewise.
* doc/fdl.texi: Likewise.
* lib/argp-pin.c: Likewise.
* lib/round.c: Likewise.
* lib/unicase/u16-totitle.c: Likewise.
* lib/unictype/block_test.c: Likewise.
* lib/uninorm/canonical-decomposition.c: Likewise.
* m4/README: Likewise.
* m4/relocatable-lib.m4: Likewise.
* tests/test-isnand-nolibm.c: Likewise.
* tests/test-isnand.c: Likewise.
* tests/uninorm/NormalizationTest.txt: Likewise.

12 years agomaint: add framework to run syntax-check rules against gnulib sources
Jim Meyering [Tue, 17 Jan 2012 16:51:40 +0000 (17:51 +0100)]
maint: add framework to run syntax-check rules against gnulib sources

* cfg.mk: New file, to disable all currently-failing tests.
We'll enable them one by one, as they are made to pass.
* Makefile (sc_maint): New rule.

12 years agostdint: Add support for Android.
Bruno Haible [Sat, 21 Jan 2012 12:09:08 +0000 (13:09 +0100)]
stdint: Add support for Android.

* lib/stdint.in.h: When included from Bionic <sys/types.h>, just
include the system's <stdint.h>.
Reported by Simon Josefsson <simon@josefsson.org>.

12 years agoautoupdate
Karl Berry [Thu, 19 Jan 2012 17:37:34 +0000 (09:37 -0800)]
autoupdate

12 years agobootstrap: add bootstrap_post_import_hook
Jim Meyering [Thu, 19 Jan 2012 05:14:31 +0000 (06:14 +0100)]
bootstrap: add bootstrap_post_import_hook

Bison does still need something like the gnulib_mk_hook whose
invocation I had to remove along with slurp in commit 767ccd40.
Technically, we could get along without it, but doing so would
have required living with a warning and a mandatory post-bootstrap
automake rerun.
* build-aux/bootstrap (gnulib_mk_hook): Remove definition, too.
(bootstrap_post_import_hook): New function.
Invoke it after gnulib-tool --import and before autoreconf.

12 years agogitlog-to-changelog: don't use "no_"-prefixed variable name
Jim Meyering [Wed, 18 Jan 2012 07:53:23 +0000 (08:53 +0100)]
gitlog-to-changelog: don't use "no_"-prefixed variable name

* build-aux/gitlog-to-changelog (main): Use getopt's "!" attribute
to enable both --cluster and --no-cluster.  Change variable name,
s/\$no_cluster/$cluster/, and reverse usage to match.

12 years agogitlog-to-changelog: use "||", not "or" in expressions
Jim Meyering [Wed, 18 Jan 2012 07:45:29 +0000 (08:45 +0100)]
gitlog-to-changelog: use "||", not "or" in expressions

* build-aux/gitlog-to-changelog (main): Use "||", not "or" in
expressions.

12 years agogitlog-to-changelog: new option --no-cluster
Joel E. Denny [Tue, 17 Jan 2012 21:23:30 +0000 (16:23 -0500)]
gitlog-to-changelog: new option --no-cluster

* build-aux/gitlog-to-changelog: New option --no-cluster, disables
clustering of adjacent commit messages.

12 years agomaint: spell file systems with two words, not one
Jim Meyering [Tue, 17 Jan 2012 16:30:33 +0000 (17:30 +0100)]
maint: spell file systems with two words, not one

* m4/ls-mntd-fs.m4 (MOUNTED_INTERIX_STATVFS): Spell file systems with
two words, not one.

12 years agofix a typo
Jim Meyering [Mon, 16 Jan 2012 21:02:21 +0000 (22:02 +0100)]
fix a typo

12 years agobootstrap: add a FIXME comment to ensure we eventually remove the hack
Jim Meyering [Mon, 16 Jan 2012 20:56:31 +0000 (21:56 +0100)]
bootstrap: add a FIXME comment to ensure we eventually remove the hack

* build-aux/bootstrap (gnulib_tool_options): Add comment.

12 years agobootstrap: cater to autoconf 2.59
Eric Blake [Mon, 16 Jan 2012 17:55:56 +0000 (10:55 -0700)]
bootstrap: cater to autoconf 2.59

Autoconf didn't add --no-recursive until 2.59c, but gnulib supports
as far back as 2.59 for platforms like RHEL 5.

* build-aux/bootstrap (AUTORCONF): Work even when --no-recursive
is not available.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agobootstrap: properly check for libtool
Eric Blake [Mon, 16 Jan 2012 17:16:01 +0000 (10:16 -0700)]
bootstrap: properly check for libtool

Commit 767ccd40 changed things to invoke libtoolize before
gnulib-tool, but only for projects that use LT_INIT, even
though we had already probed for libtool via older spellings.

* build-aux/bootstrap (libtoolize): Also run libtool when older
usage is detected.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoImprove support for MSVC 9.
Bruno Haible [Sun, 15 Jan 2012 16:35:55 +0000 (17:35 +0100)]
Improve support for MSVC 9.

* lib/unistd.in.h: Include <io.h> when needed to avoid redefinition
clashes on MSVC.
* lib/fcntl.in.h: Likewise.
* lib/stdlib.in.h: Likewise.
* lib/sys_stat.in.h: Likewise.

12 years agognupload: we hold the master copy of this script now
Stefano Lattarini [Sun, 15 Jan 2012 15:49:11 +0000 (16:49 +0100)]
gnupload: we hold the master copy of this script now

For motivation and more information, see:
<http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00222.html>

* build-aux/gnupload: Make it clear in the heading comments that the
master copy of this file is maintained by gnulib.  Since we are at
it, bump its copyright year and ...
($scriptversion): ... the date in its version.
($usage): Patches and bug reports should be sent to the gnulib list,
not the automake one.
* config/srclist.txt: Don't try to sync 'gnupload' from automake
anymore.

12 years agoFix module 'random'.
Bruno Haible [Sun, 15 Jan 2012 12:19:33 +0000 (13:19 +0100)]
Fix module 'random'.

* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether random, srandom,
initstate, setstate are declared.

12 years agoTests for module 'random'.
Bruno Haible [Sat, 14 Jan 2012 14:22:49 +0000 (15:22 +0100)]
Tests for module 'random'.

* modules/random-tests: New file.
* tests/test-random.c: New file, based on tests/test-random_r.c.

12 years agoNew module 'random'.
Bruno Haible [Sat, 14 Jan 2012 14:15:28 +0000 (15:15 +0100)]
New module 'random'.

* lib/stdlib.in.h (random, srandom, initstate, setstate): New
declarations.
* lib/random.c: New file, based on glibc/stdlib/random.c.
* m4/random.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_RANDOM,
HAVE_RANDOM.
* modules/stdlib (Makefile.am): Substitute GNULIB_RANDOM, HAVE_RANDOM.
* modules/random: New file.
* config/srclist.txt: Add an entry for random.c.
* doc/posix-functions/random.texi: Mention the 'random' module.
* doc/posix-functions/initstate.texi: Likewise.
* doc/posix-functions/setstate.texi: Likewise.
* doc/posix-functions/srandom.texi: Likewise.

12 years agoautoupdate
Karl Berry [Fri, 13 Jan 2012 14:40:53 +0000 (06:40 -0800)]
autoupdate

12 years agorandom_r: Use common idioms.
Bruno Haible [Thu, 12 Jan 2012 21:55:13 +0000 (22:55 +0100)]
random_r: Use common idioms.

* lib/random_r.c: Include <stdlib.h> first.

12 years agorandom_r: Override incompatible API on AIX, OSF/1.
Bruno Haible [Thu, 12 Jan 2012 21:54:15 +0000 (22:54 +0100)]
random_r: Override incompatible API on AIX, OSF/1.

* lib/stdlib.in.h (random_r, srandom_r, initstate_r, setstate_r):
Override the system function if REPLACE_RANDOM_R is 1.
* m4/random_r.m4 (gl_FUNC_RANDOM_R): Require AC_CANONICAL_HOST. On AIX
and OSF/1, set REPLACE_RANDOM_R.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_RANDOM_R.
* modules/stdlib (Makefile.am): Substitute REPLACE_RANDOM_R.
* modules/random_r (configure.ac): Test REPLACE_RANDOM_R.
* doc/glibc-functions/initstate_r.texi: Mention the AIX, OSF/1 problem.
* doc/glibc-functions/random_r.texi: Likewise.
* doc/glibc-functions/setstate_r.texi: Likewise.

12 years agorandom_r: Support for MSVC 9.
Bruno Haible [Thu, 12 Jan 2012 20:58:09 +0000 (21:58 +0100)]
random_r: Support for MSVC 9.

* lib/random_r.c: Include stdint.h, not inttypes.h.

12 years agoinet_ntop: guard extra work by IF_LINT
Eric Blake [Thu, 12 Jan 2012 15:44:08 +0000 (08:44 -0700)]
inet_ntop: guard extra work by IF_LINT

No need to penalize the code just to silence a gcc warning, so
follow the conventions used elsewhere in gnulib.  Clients that
want to use extra warnings should also be using -Dlint.

* lib/inet_ntop.c (inet_ntop6): Mark spurious initialization, for
better code generation when not checking for warnings.
Suggested by Paul Eggert and Jim Meyering.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agostrptime: fix regression on mingw
Eric Blake [Thu, 12 Jan 2012 15:39:07 +0000 (08:39 -0700)]
strptime: fix regression on mingw

The previous change lost the side effect of skipping past a
time-zone offset sign.  Instead, fix things to rely on the
fact that _GL_UNUSED can be applied to any variable, even if
some compilation paths use it, to silence gcc on the paths
where it is not used.

* lib/strptime.c (__strptime_internal) [!_LIBC && !HAVE_TM_GMTOFF]:
Fix regression.  Reported by Bruno Haible.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agocopy-file: add error-code-returning variant.
Reuben Thomas [Thu, 12 Jan 2012 02:04:49 +0000 (03:04 +0100)]
copy-file: add error-code-returning variant.

* lib/copy-file.h (GL_COPY_ERR_*): New enumeration items.
(qcopy_file_preserving): New declaration.
* lib/copy-file.c (qcopy_file_preserving): Renamed from
copy_file_preserving. Change return type to 'int'. Don't emit an error
message here.
(copy_file_preserving): New function.
* tests/test-copy-file.c: Include <stdlib.h>.
(main): Test qcopy_file_preserving if the environment variable
NO_STDERR_OUTPUT is set.
* tests/test-copy-file-1.sh: Invoke test-copy-file.sh a second time,
with NO_STDERR_OUTPUT
* tests/test-copy-file-2.sh: Likewise.

12 years agocopy-file: Use 'quote' module consistently.
Bruno Haible [Wed, 11 Jan 2012 01:11:34 +0000 (02:11 +0100)]
copy-file: Use 'quote' module consistently.

* lib/copy-file.c (copy_file_preserving): Use quote().

12 years agocopy-file: Refactor.
Bruno Haible [Wed, 11 Jan 2012 01:01:45 +0000 (02:01 +0100)]
copy-file: Refactor.

* lib/copy-file.c: Include quote.h.
(copy_file_preserving): Call qcopy_acl instead of copy_acl. Emit error
message here.
* modules/copy-file (Depends-on): Add quote.

12 years agoacl: Export qcopy_acl.
Bruno Haible [Wed, 11 Jan 2012 00:54:25 +0000 (01:54 +0100)]
acl: Export qcopy_acl.

* lib/acl.h (qcopy_acl): New declaration.
* lib/copy-acl.c (qcopy_acl): Make non-static.

12 years agoacl: Rename a local variable.
Bruno Haible [Wed, 11 Jan 2012 00:52:23 +0000 (01:52 +0100)]
acl: Rename a local variable.

* lib/set-mode-acl.c (set_acl): Use same variable name as in copy_acl.