Eric Blake [Sat, 13 Jan 2007 05:23:36 +0000 (05:23 +0000)]
Provide a robust <wchar.h>. Further simplifications are now
possible in other modules, but not included here.
* modules/wchar: New module.
* m4/wchar.m4: New file.
* lib/wchar_.h: Likewise.
* modules/mbchar (Depends-on): Depend on wchar, as the first use
of the new module.
* MODULES.html.sh (Extended multibyte and wide character utilities):
New section.
Paul Eggert [Fri, 12 Jan 2007 21:54:50 +0000 (21:54 +0000)]
* lib/xreadlink.c (SYMLINK_MAX) [!defined SYMLINK_MAX]: Define
to a reasonable default for memory allocation.
(xreadlink): Don't allocate a huge buffer, to work around a buggy
file system that reports garbage st_size values for symlinks.
Problem reported by Liyang Hu.
Paul Eggert [Wed, 10 Jan 2007 22:25:03 +0000 (22:25 +0000)]
Use @...@ consistently in lib/wctype_.h.
* lib/wctype_.h [HAVE_WINT_T]: Go back to using @...@, but rely
on it being set to 1 or 0.
* m4/wctype.m4 (gl_WCTYPE_H): Set HAVE_WINT_T to 1 or 0, and
go back to AC_SUBSTing it.
* modules/wctype (Makefile.am): Undo previous change.
Eric Blake [Wed, 10 Jan 2007 18:25:49 +0000 (18:25 +0000)]
* lib/wctype_.h [HAVE_WINT_T]: Rely on AC_DEFINE.
* m4/wctype.m4 (gl_WCTYPE_H): No need to AC_SUBST(HAVE_WINT_T).
* modules/wctype (Makefile.am): Likewise.
Reported by Chris McGuire.
Jim Meyering [Wed, 10 Jan 2007 17:25:09 +0000 (17:25 +0000)]
fts.c: a small readability/maintainability improvement
* lib/fts.c (fts_read): Make this code slightly more readable and
maintainable by hoisting the "sp->fts_cur = p" assignments to
immediately follow the statements that set P. Derived from
the patch by Miloslav Trmac in http://bugzilla.redhat.com/222089.
Eric Blake [Wed, 10 Jan 2007 13:46:26 +0000 (13:46 +0000)]
* lib/wctype_.h [HAVE_WINT_T]: Include <stddef.h> before
<wchar.h>, to work around BSDI bug in BSD/OS 4.0.1.
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
* m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise.
Reported by Chris McGuire.
Paul Eggert [Mon, 8 Jan 2007 22:55:35 +0000 (22:55 +0000)]
* m4/wctype.m4 (gl_WCTYPE_H): Compute ABSOLUTE_WCTYPE_H even if
WCTYPE_H is empty, for the benefit of builds from non-distclean
directories. Problem reported by Eric Blake in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00157.html>.
Jim Meyering [Mon, 8 Jan 2007 10:32:58 +0000 (10:32 +0000)]
Use a more robust test for a "can't happen" condition.
* lib/fts.c (fts_read): Revert the change of 2006-11-22, since it
narrowed the st_size value. Presuming the "can't happen" condition
is true, that narrowing could conceivably convert an invalid st_size
value into a valid one. Instead, use a change based on Matthew
Woehlke's original patch.
Jim Meyering [Mon, 8 Jan 2007 10:30:47 +0000 (10:30 +0000)]
Slight readability improvement: use an assert-like macro
in place of literal "abort ()" uses.
* lib/fts.c (fts_assert): Define.
(fts_set_stat_required, cwd_advance_fd, fts_read, fd_ring_check):
Use this macro instead of a bare 'abort'.
Paul Eggert [Sat, 6 Jan 2007 00:27:48 +0000 (00:27 +0000)]
Don't worry about using IRIX 5.3's wctype.h broken definitions;
simply work around them.
* lib/wctype_.h: Remove test for HAVE_WCTYPE_CTMP_BUG.
(iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph, iswlower):
(iswprint, iswpunct, iswspace, iswupper, iswxdigit): Undef before declaring.
Don't bother to define as macros, since the standard doesn't require it.
* m4/wctype.m4 (WCTYPE_H, ABSOLUTE_WCTYPE_H): Simplify, since we no
longer worry about IRIX 5.3.
(HAVE_WCTYPE_CTMP_BUG): Remove.
Paul Eggert [Thu, 4 Jan 2007 19:21:42 +0000 (19:21 +0000)]
* lib/wctype_.h (_ctmp_) [HAVE_WCTYPE_CTMP_BUG]: Now of type wchar_t,
not wint_t. Also, include <ctype.h>, to fix another IRIX bug.
* m4/wctype.m4 (gl_WCTYPE_H): Likewise.
Problems reported by Georg Schwarz for IRIX 5.3.
Paolo Bonzini [Wed, 3 Jan 2007 10:51:18 +0000 (10:51 +0000)]
2007-01-03 Paolo Bonzini <bonzini@gnu.org>
Yoann Vandoorselaere <yoann.v@prelude-ids.com>
* lib/poll.c (poll): Use recv on Mac OS X to distinguish connected
sockets, server sockets, and other file descriptors. Count errors
to compute the return value. Reorder the code a bit to be easier
to follow. Don't set event bits that were not requested (except
POLLERR and POLLHUP).