cf85e331af9ca0ade8f85323ecac5d1a51fc5a56
[gnulib.git] / lib / ChangeLog
1 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
2
3         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
4         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
5         brackets.  Other minor changes to suppress some compiler
6         warnings.
7
8 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
9
10         * getloadavg.c: Use __VMS, not VMS.
11         * getopt.c: Likewise.
12         * getpagesize.h: Likewise.
13         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
14         probably does not work.
15
16 2006-07-06  Derek R. Price  <derek@ximbiot.com>
17         and Paul Eggert  <eggert@cs.ucla.edu>
18
19         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
20         Don't worry about this obsolete case any more.
21         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
22         directories.
23         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
24         worry about this obsolete case any more.
25         * fts.c: Likewise.
26         * getcwd.c: Likewise.
27         * glob.h: Likewise.
28         * savedir.c: Likewise.
29
30 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
31
32         * .cppi-disable: Add wcwidth.
33         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
34         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
35         (ISGRAPH): Remove.  All uses changed to isgraph.
36         (FOLD) [!defined _LIBC]: Remove special case.
37         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
38         * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
39         HAVE_ISBLANK.
40         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
41
42 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
43
44         * strtod.c (strtod): cast the argument of tolower to unsigned char.
45
46 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
47
48         * memcasecmp.c: Include <limits.h>.
49         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
50         * strtod.c (strtod): Don't assume isspace works on negative chars.
51         Don't assume isdigit succeeds only on '0' through '9'.
52
53 2006-07-05  Derek R. Price  <derek@ximbiot.com>
54
55         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
56         All uses of is_space replaced by isspace.
57         * exit.h: Don't talk about STDC_HEADERS.
58         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
59         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
60         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
61         replaced by isprint etc.
62         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
63         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
64         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
65         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
66         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
67         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
68
69 2006-07-05  Eric Blake  <ebb9@byu.net>
70
71         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
72         missing from netdb.h.
73         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
74
75 2006-06-27  Bruno Haible  <bruno@clisp.org>
76
77         Assume ANSI C header files and <ctype.h> functions.
78         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
79         (mbsnwidth): Use isprint, iscntrl instead.
80
81 2006-07-03  Jim Meyering  <jim@meyering.net>
82
83         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
84         macro is used before the first cycle_check call.
85
86 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
87
88         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
89         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
90         reported by Mark D. Baushke, one in
91         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
92
93         Merge from coreutils.
94
95         * .cppi-disable: Add stdint_.h.
96         * .cvsignore: Add stdint.h.
97
98         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
99
100         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
101         both double and long double versions.
102         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
103         * xstrtold.c: New file.
104         * xstrtod.h (xstrtold): New decl.
105
106         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
107
108         * filemode.c (setst): Remove.
109         (strmode): Rewrite to avoid setst.  This makes the code shorter,
110         (arguably) clearer, and the generated code is a bit smaller on my
111         Debian GNU/Linux stable x86 host.
112
113         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
114
115         * filemode.c: Include "filemode.h" first, to test the interface.
116         Assume that filemode.h includes sys/types.h and sys/stat.h.
117         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
118         (ftypelet): Reorder to put common cases first, for efficiency.
119         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
120         to do 'M'.
121         (strmode): Renamed from mode_string, and now stores 12 bytes instead
122         of 10, for compatibility with FreeBSD.  All callers changed.
123         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
124         that can't be deduced solely from st_mode.  First arg is now a const
125         pointer.
126         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
127         (strmode): Renamed from mode_string.
128         (filemodestring): New decl.
129         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
130         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
131         (S_ISPORT, S_ISWHT): New macros, if not already defined.
132
133         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
134
135         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
136         fsusage.h now does that.  Include fsusage.h first, to test interface.
137         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
138         at most one method (the old code could have generated decls that
139         didn't conform to C89, not that this was ever exercised).
140         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
141
142         2006-03-19  Jim Meyering  <jim@meyering.net>
143
144         Work even in a chroot where d_ino values for entries in "/"
145         don't match the stat.st_ino values for the same names.
146         * getcwd.c (__getcwd): When no d_ino value matches the target inode
147         number, iterate through all entries again, using lstat instead.
148         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
149         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
150
151         * getcwd.c (__getcwd): Clarify a comment.
152         Use memcpy in place of a call to strcpy.
153
154         2006-03-12  Jim Meyering  <jim@meyering.net>
155
156         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
157         that of the current directory (which we're about to chdir ".." out of),
158         then save the dev-ino of the parent, instead.
159
160         * same-inode.h (SAME_INODE): New file/macro.
161         * chdir-safer.c (SAME_INODE): Remove definition.
162         Include "same-inode.h", instead.
163         * same.c: Likewise.
164         * cycle-check.h: Include "same-inode.h".
165         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
166         * cycle-check.c (SAME_INODE): Remove definition.
167         * root-dev-ino.h: Include "same-inode.h".
168
169         2006-03-11  Eric Blake  <ebb9@byu.net>
170
171         * same.c (same_name): s/base_name/last_component/
172         * backupfile.c (check_extension, numbered_backup): Likewise.
173         * filenamecat.c (file_name_concat): Likewise.
174
175         2006-03-11  Eric Blake  <ebb9@byu.net>,
176                     Paul Eggert  <eggert@cs.ucla.edu>
177
178         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
179         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
180         drive prefix.
181         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
182         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
183         (last_component): New method.
184         * dirname.c (dir_len): Determine when drive letters need a
185         subsequent slash.  Preserve // when it is special.
186         (dir_name): Don't append dot when drive letter is absolute.
187         [TEST_DIRNAME]: Move into a full-blown gnulib test.
188         * basename.c (base_name): New semantics - malloc the result.
189         Preserve // when it is special.  Preserve relative files that look
190         like drive letters.
191         (base_len): Preserve // when it is special.
192         (last_component): New method, similar to old base_name semantics.
193         * stripslash.c (strip_trailing_slashes): Use last_component, not
194         base_name.  Strip redundant slashes from ///.
195
196 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
197
198         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
199         both are 64 bits, since this seems to be the tradition, and this
200         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
201         we ever run into a host that prefers long long to long in this
202         case, we'll need another configure-time test.  Problem reported by
203         Jim Meyering.
204
205 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
206
207         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
208         possible collision with system files.
209         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
210         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
211         WCHAR_MIN and WCHAR_MAX in this case.
212         (<stddef.h>): Do not include; no longer needed.
213         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
214         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
215         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
216         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
217         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
218         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
219         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
220         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
221         !defined(__c99))]: Include in this case too, since it's harmless
222         now.
223         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
224         dangerous to do so.
225         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
226         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
227         (_STDINT_MIN, _STDINT_MAX): New macros.
228         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
229         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
230         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
231         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
232         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
233         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
234         macros, not typedefs; this simplifies things quite a bit.
235         Use long int for all types narrower than int64_t.
236         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
237         Define in terms of long long int or int64_t or long int,
238         not int64_t or int32_t.  This saves some compile-time testing.
239         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
240         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
241         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
242         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
243         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
244         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
245         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
246         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
247         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
248         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
249         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
250         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
251         undef any previous version and define our own version, for
252         simplicity and consistency with the new macros for types.
253         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
254         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
255         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
256         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
257         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
258         @WINT_T_SUFFIX@ to keep things simple here.
259         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
260         Simplify by assuming typical 8/16/32/64 host, since we're
261         already doing that elsewhere anyway.
262         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
263         and assume long long int is 64 bits if available.  This
264         speeds up 'configure'.
265
266 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
267
268         * getaddrinfo.c: fixed typo
269
270 2006-06-29  Eric Blake  <ebb9@byu.net>
271
272         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
273         unused static function.
274
275 2006-06-29  Eric Blake  <ebb9@byu.net>
276
277         * stat_.h: New file.
278
279 2006-06-29  Derek R. Price  <derek@ximbiot.com>
280
281         * strftime.c: Assume strftime() exists.
282
283 2006-06-28  Bruno Haible  <bruno@clisp.org>
284
285         * getaddrinfo.h: Fix POSIX URL.
286         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
287         (use_win32_p): Make static.
288         (getaddrinfo): Reject service name if it is empty or does not consist
289         solely of decimal digits, or if its value is > 65535.
290         (getnameinfo): Remove useless casts.
291
292 2006-06-28  Derek R. Price  <derek@ximbiot.com>
293
294         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
295         Autoconf 2.60 says this stuff was obsolete.
296
297 2006-05-12  Bruno Haible  <bruno@clisp.org>
298
299         * mkdtemp.c [MINGW]: Include <io.h>.
300         (mkdir): Define using _mkdir.
301
302 2006-06-28  Bruno Haible  <bruno@clisp.org>
303
304         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
305         declaration for wcwidth.
306         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
307
308 2006-06-28  Eric Blake  <ebb9@byu.net>
309
310         * xvasprintf.h: Fix comments.
311
312 2006-06-28  Eric Blake  <ebb9@byu.net>
313
314         * mbchar.h (wcwidth): Include wcwidth.h.
315         * mbswidth.c (wcwidth): Move from here...
316         * wcwidth.h: ...to this new file.
317
318 2006-06-28  Simon Josefsson  <jas@extundo.com>
319
320         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
321         functions there.  It will succeed on Windows XP, but on Windows
322         2000 and (presumably) earlier, it will fail, and use the internal
323         re-implementation.
324         (use_win32_p): New function.
325         (getaddrinfo): Use strtoul on servname, to support numeric ports.
326         Support AI_NUMERICSERV to disable getservbyname.
327         (getnameinfo): New function, only supports
328         NI_NUMERICHOST|NI_NUMERICSERV for now.
329
330         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
331         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
332         getnameinfo.
333
334 2006-06-27  Bruno Haible  <bruno@clisp.org>
335
336         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
337
338 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
339
340         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
341         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
342         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
343
344 2006-06-26  Bruno Haible  <bruno@clisp.org>
345
346         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
347         WCHAR_MAX.
348         Reported by Mark D. Baushke and Larry Jones.
349
350 2006-06-26  Bruno Haible  <bruno@clisp.org>
351
352         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
353         in pre-C99 mode.
354         Suggested by Mark D. Baushke and Larry Jones.
355
356 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
357
358         * stdint_.h: Treat BSD/OS like OpenBSD.
359
360 2006-06-23  Bruno Haible  <bruno@clisp.org>
361
362         * stdint_.h: Treat IRIX like OpenBSD.
363
364 2006-06-23  Bruno Haible  <bruno@clisp.org>
365
366         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
367         ISO C 99 Technical Corrigendum 1.
368
369 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
370
371         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
372         Some compiler complained about some of them.  Problem reported by
373         Larry Jones in
374         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
375
376 2006-06-21  Simon Josefsson  <jas@extundo.com>
377
378         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
379         variable.
380
381         * socket_.h: Don't define WINVER.
382
383         * inet_pton.h, inet_pton.c: New file, taken from glibc but
384         slightly modified to work in gnulib.
385
386 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
387
388         * read-file.c (fread_file): Start with buffer allocation of
389         0 bytes rather than 1 byte; this simplifies the code.
390         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
391         code to free buffer and save/restore errno.
392         (internal_read_file): Remove unused local.
393
394 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
395
396         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
397         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
398         Problem reported by Denis Excoffier in
399         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
400
401 2006-06-19  Simon Josefsson  <jas@extundo.com>
402
403         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
404
405 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
406
407         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
408
409 2006-06-17  Bruno Haible  <bruno@clisp.org>
410
411         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
412
413 2006-06-17  Bruno Haible  <bruno@clisp.org>
414
415         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
416         problem on Solaris 2.5.1.
417
418 2006-06-16  Eric Blake  <ebb9@byu.net>
419
420         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
421         * unicodeio.c [!defined errno]: Likewise.
422         * strtol.c [!defined errno]: Likewise.
423         * strtod.c [!defined errno]: Likewise.
424
425 2006-06-15  Bruno Haible  <bruno@clisp.org>
426
427         * stdint_.h: Rewritten to be fully auto-configured.
428         Fixes bug on HP-UX/IA64.
429
430 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
431
432         * getdate.y (__attribute__): Don't define if already defined.
433         Problem reported by Larry Jones.
434         * utimens.c (__attribute__): Likewise.
435
436 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
437
438         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
439         reported by Andreas Schwab.
440
441 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
442             Bruno Haible  <bruno@clisp.org>
443
444         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
445
446 2006-05-26  Martin Lambers  <marlam@marlam.de>
447
448         * getpass.c: Updates the test for the native W32 API, and adds
449         missing includes, thus fixing compilation warnings.
450
451 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
452
453         * tempname.c (small_open, large_open): New macros.
454         (__open, __open64) [!_LIBC]: Remove.
455         (__gen_tempname): Use small_open and large_open instead of __open
456         and __open64.  This fixes a portability bug on HP-UX 11.11i
457         reported by Simon Wing-Tang in
458         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
459
460 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
461
462         * exclude.c (exclude_fnmatch): New function.
463         (excluded_file_name): Call exclude_fnmatch.
464         * exclude.h (excluded_file_name): New prototype
465
466 2006-05-24  Bruno Haible  <bruno@clisp.org>
467
468         * printf-args.c (printf_fetchargs): Turn NULL pointers for
469         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
470         Reported by Thorsten Maerz <torte@netztorte.de> via
471         Aaron Stone <aaron@serendipity.cx>.
472
473 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
474
475         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
476         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
477         (my_usleep): Don't mishandle maximum value.
478
479 2006-05-19  Jim Meyering  <jim@meyering.net>
480
481         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
482
483 2006-05-17  Bruno Haible  <bruno@clisp.org>
484
485         Cygwin portability.
486         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
487
488 2006-05-17  Bruno Haible  <bruno@clisp.org>
489
490         * stdint_.h: Fix recognition of Cygwin.
491
492 2006-05-11  Jim Meyering  <jim@meyering.net>
493
494         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
495
496 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
497
498         * crc.c (crc32_update): Remove unnecessary L suffix.
499         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
500         unwanted sign propagation, e.g., on hosts with 64-bit int.
501         There still are some problems with reeelly weird theoretical hosts
502         (e.g., 33-bit int) but it's not worth worrying about now.
503         * sha1.c (rol): Likewise.
504         (K1, K2, K3, K4): Remove unnecessary L suffix.
505
506 2006-05-10  Bruno Haible  <bruno@clisp.org>
507
508         * des.c: Cast to avoid warnings.
509
510 2006-05-10  Simon Josefsson  <jas@extundo.com>
511
512         * md4.c: Typo fix, update copyright years.
513         (K1, K2): Don't use L because it turn computations into 64-bit on
514         64-bit platforms.
515
516 2006-05-09  Bruno Haible  <bruno@clisp.org>
517
518         * xvasprintf.c: Include limits.h, string.h, xsize.h.
519         (EOVERFLOW): Define fallback value.
520         (xstrcat): New function.
521         (xvasprintf): Recognize the special case of a string concatenation.
522
523 2006-05-01  Bruno Haible  <bruno@clisp.org>
524
525         * stdint_.h: Shorter URL.
526         * inttypes.h: Likewise.
527
528 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
529
530         * verify.h: Document the internals better.  Most of this change
531         was written by Bruno Haible.
532
533 2006-04-29  Bruno Haible  <bruno@clisp.org>
534
535         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
536         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
537
538 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
539
540         * getdate.y (get_date): When adding relative date, start with the
541         initial time, not with the result of the first mktime call.
542
543 2006-04-23  Bruno Haible  <bruno@clisp.org>
544
545         * copy-file.c: Include <unistd.h> unconditionally.
546         * execute.c: Likewise.
547         * fatal-signal.c: Likewise.
548         * findprog.c: Likewise.
549         * mkdtemp.c: Likewise.
550         * pipe.h: Likewise.
551         * pipe.c: Likewise.
552         * wait-process.h: Likewise.
553
554 2006-04-23  Bruno Haible  <bruno@clisp.org>
555
556         * fwriteerror.c (fwriteerror): Call fclose also when an error
557         condition was already detected.
558         Reported by Ben Pfaff <blp@cs.stanford.edu>.
559
560 2006-04-19  Derek Price  <derek@ximbiot.com>
561             Eric Blake  <ebb9@byu.net>
562
563         * inttypes.h: Correct grammar in comment.
564
565 2006-04-18  Derek Price  <derek@ximbiot.com>
566             Paul Eggert  <eggert@cs.ucla.edu>
567
568         * inttypes.h: New file.
569         * strtoimax.c: Assume <inttypes.h>.
570
571 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
572
573         * utimens.c (futimens): glibc futimesat messes up if /proc
574         isn't mounted.  Problem reported by Kir Kolyshkin.
575
576 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
577
578         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
579         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
580         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
581
582 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
583
584         Merge regex changes from libc, removing some of our
585         POSIX-conformance changes that were rejected and redoing them in a
586         less-intrusive way.
587
588         * regcomp.c (re_compile_internal, init_dfa):
589         Length arg is now size_t, not Idx.  All uses changed.
590         (peek_token): Forward decl now says internal_function.
591         (__re_error_msgid, __re_error_msgid_idx):
592         Now static rather than extern with attribute_hidden.
593         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
594         For some reason libc prefers K&R style defns for external functions.
595         (regerror) [!defined _LIBC]: Likewise.
596         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
597         (seek_collating_symbol_entry, lookup_collation_sequence_value):
598         (build_range_exp, build_collating_symbol):
599         Use K&R-style defn.
600         (re_compile_fastmap): Use '\0' to memset, not 0.
601         (utf8_sb_map): Make the calculations more obvious.
602         (init_dfa, parse_bracket_exp, build_charclass_op):
603         Call calloc and cast result, as glibc does.
604         (init_word_char, fetch_token, peek_token, peek_token_bracket):
605         (build_range_exp, build_collating_symbol):
606         Now internal functions.
607
608         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
609
610         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
611         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
612         Don't depend on VMS; depend on __VMS instead, for POSIX
613         namespace cleanness.
614         (regoff_t): Define to ssize_t, not long int.
615
616         Remove the REG_ macros named below.  Instead, make the old names
617         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
618         __USE_GNU_REGEX.
619         (REG_BACKSLASH_ESCAPE_IN_LISTS):
620         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
621         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
622         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
623         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
624         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
625         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
626         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
627         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
628         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
629         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
630         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
631         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
632         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
633         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
634         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
635         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
636         (REG_NREGS):
637         Remove.  All uses replaced by the old RE_* names.
638         (RE_BACKSLASH_ESCAPE_IN_LISTS):
639         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
640         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
641         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
642         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
643         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
644         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
645         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
646         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
647         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
648         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
649         Don't bother having these macros be independent of each others'
650         values, since they no longer exist in the POSIX name space.
651
652         Rename the following member names back to their old names,
653         unless !__USE_GNU_REGEX.  All uses changed back.
654         (buffer): Renamed from re_buffer.
655         (allocated): Renamed from re_allocated.
656         (used): Renamed from re_used.
657         (syntax): Renamed from re_syntax.
658         (fastmap): Renamed from re_fastmap.
659         (translate): Renamed from re_translate.
660         (can_be_null): Renamed from re_can_be_null.
661         (regs_allocated): Renamed from re_regs_allocated.
662         (fastmap_accurate): Renamed from re_fastmap_accurate.
663         (no_sub): Renamed from re_no_sub.
664         (not_bol): Renamed from re_not_bol.
665         (not_eol): Renamed from re_not_eol.
666         (newline_anchor): Renamed from re_newline_anchor.
667         (num_regs): Renamed from rm_num_regs.
668         (start): Renamed from rm_start.
669         (end): Renamed from rm_end.
670
671         (free_state): Move up a bit.
672
673         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
674         #define to be empty.
675         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
676         when that is what is intended.
677         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
678         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
679         (MAX): New macro.
680         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
681         All uses changed back to re_malloc, etc.  It's now the caller's
682         responsibility to check for overflow; all callers changed.
683         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
684         (re_x2nrealloc): Remove.
685         (free_state): Remove decl.
686
687         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
688         (re_set_registers, re_exec):
689         Use K&R-style defn.
690
691         2006-01-31  Roland McGrath  <roland@redhat.com>
692
693         * regcomp.c (calc_eclosure_iter): Remove dead variables.
694         Reported by Mike Frysinger <vapier@gentoo.org>.
695
696         2006-01-15  Andreas Jaeger  <aj@suse.de>
697
698         [BZ #1950]
699         * regex_internal.c (re_string_reconstruct): Adjust for
700         build_wcs_upper_buffer change.
701         (build_wcs_upper_buffer): Change return type.
702
703         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
704
705         * regex_internal.h: Include <stdint.h> if available.
706
707         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
708
709         * regex_internal.h (SIZE_MAX): Provide a default definition.
710
711         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
712
713         * regcomp.c: Adjust for changed secondary hash function.
714
715         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
716
717         * regex.h: Pretty printing.
718         Clean up namespace a bit.
719
720         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
721
722         * regexec.c (update_cur_sifted_state, check_arrival,
723         check_arrival_add_next_nodes): Avoid using uninitialized variable.
724
725         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
726                     Ulrich Drepper  <drepper@redhat.com>
727
728         [BZ #1302]
729         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
730         (bitset_word_t): Renamed from bitset_word.  All uses changed.
731
732         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
733
734         [BZ #281]
735         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
736         * regcomp.c: Remove unnecessary uses of
737         unsigned RE_TRANSLATE_TYPE.
738         * regex_internal.h: Likewise.
739         * regex_internal.c: Likewise.
740         * regexec.c: Likewise.
741         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
742
743         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
744
745         * regexec.c (find_recover_state): Remove unnecessary
746         initialization.
747         (transit_state_bkref): Make DFA a const pointer.
748         (get_subexp): Likewise.
749         (check_arrival): Likewise.
750         (update_cur_sifted_state): Likewise.
751         (re_search_internal): Likewise.
752         (prune_impossible_nodes): Likewise.
753         (acquire_init_state_context): Likewise.
754         (proceed_next_node): Likewise.
755         (set_regs): Likewise.
756         (free_fail_stack_return): Likewise.
757         (check_arrival_expand_ecl): Mark DFA parameter as const.
758         (check_arrival_expand_ecl_sub): Likewise.
759         (check_subexp_limits): Likewise.
760         (sub_epsilon_src_nodes):  Likewise.
761         (add_epsilon_src_nodes):  Likewise.
762         (merge_state_array): Likewise.
763         (update_regs): Likewise.
764         (build_trtable): Likewise.
765         (sift_states_backward): Mark MCTX parameter as const.
766         (build_sifted_states): Likewise.
767         (update_cur_sifted_state): Likewise.
768         (sift_states_mkref): Likewise.
769         (check_arrival_expand_ecl): Mark eclosure as const.
770         (check_dst_limits_calc_pos_1): Likewise.
771         * regex_internal.h (re_match_context_t): Make dfa a const
772         pointer.
773
774         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
775
776         * regexec.c (merge_state_with_log): Define dfa as const pointer.
777         (transit_state_sb): Likewise.
778         (transit_state_mb): Likewise.
779         (sift_states_iter_mb): Likewise.
780         (check_arrival_add_next_nodes): Likewise.
781         (check_node_accept_bytes): Change first parameter to pointer-to-const.
782         [_LIBC] (re_search_2_stub): Use mempcpy.
783
784         * regex_internal.c (re_string_reconstruct): Avoid calling
785         mbrtowc for very simple UTF-8 case.
786
787         * regex_internal.c (re_acquire_state): Make DFA pointer arg
788         a pointer-to-const.
789         (re_acquire_state_context): Likewise.
790         * regex_internal.h: Adjust prototypes.
791
792         * regex.c: Prevent using C++ compilers.
793
794         * regex_internal.c (re_acquire_state): Minor code rearrangement.
795         (re_acquire_state_context): Likewise.
796
797 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
798             Bruno Haible  <bruno@clisp.org>
799
800         * stdint_.h: On OpenBSD, don't redefine types already included in
801         <sys/types.h> and <inttypes.h>.
802
803 2006-03-24  Eric Blake  <ebb9@byu.net>
804
805         * time_r.c (copy_string_result): Remove, as it is no longer used.
806
807 2006-03-24  Simon Josefsson  <jas@extundo.com>
808
809         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
810         including some doc fixes.
811         (base64_encode_alloc): Fix +1 bug on allocation failures.
812
813 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
814
815         * base64.c (base64_encode): Do not read past end of array with
816         unsanitized input on systems with CHAR_BIT > 8.
817
818 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
819
820         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
821         Typedef to long int, not to off_, as POSIX will likely change
822         in that direction.
823
824 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
825
826         * argp-help.c (validate_uparams): Fix typo
827         * argp-parse.c (argp_default_options): Consistently begin help
828         messages with a lowercase letter.
829
830 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
831
832         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
833         overrun buffers and shouldn't be used (much as gets shouldn't be
834         used).
835         * time_r.c (asctime_r, ctime_r): Likewise.
836
837 2006-03-08  Simon Josefsson  <jas@extundo.com>
838
839         * gc-gnulib.c (randomize): Don't open files called 'no', they
840         signal that configure disabled the device.
841
842 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
843
844         * c-stack.c: Include unistd.h unconditionally, since we now assume
845         the unistd module.
846         * getlogin_r.c: Likewise.
847         * getlogin_r.h: Likewise.
848         * glob.c: Likewise.
849         * pagealign_alloc.c: Likewise.
850         * unistd_.h: Remove; no longer needed.
851
852 2006-03-07  Simon Josefsson  <jas@extundo.com>
853
854         * unistd_.h: New file.
855
856 2006-03-07  Simon Josefsson  <jas@extundo.com>
857
858         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
859
860 2006-03-01  Simon Josefsson  <jas@extundo.com>
861
862         * readline.c: Fix typo, tiny patch from Stepan Kasal
863         <kasal@ucw.cz>.
864
865 2006-02-28  Simon Josefsson  <jas@extundo.com>
866
867         * getopt.c: Protect #include of unistd.h, for MSVS.
868
869 2006-02-27  Simon Josefsson  <jas@extundo.com>
870
871         * base64.h: Indent #define's.  From Jim Meyering
872         <jim@meyering.net>.
873
874 2006-02-27  Jim Meyering  <jim@meyering.net>
875
876         Revert the change of 2006-02-24, so these files can continue
877         to be sync'd from gettext.
878         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
879         of `config.h'.
880
881 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
882
883         * glob.c: Say "invalid" rather than "illegal" in comments.
884
885 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
886
887         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
888
889 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
890
891         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
892         AT_FDCWD exceeds INT_MAX.
893         * openat.h (AT_FDCWD): Likewise.
894
895 2006-02-14  Jim Meyering  <jim@meyering.net>
896
897         Sync from coreutils.
898
899         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
900         failure on deficient systems, and simplify gnulib lgpl dependencies.
901         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
902         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
903
904         * xalloc-die.c: Remove unused definition of N_.
905
906 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
907
908         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
909
910 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
911
912         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
913         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
914
915 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
916
917         * argp-namefrob.h: Restore changes accidentally lost during the
918         "autoupdate" on 2005-12-12.
919
920 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
921
922         * fnmatch.c (L_): Renamed from L, to work around a bug in
923         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
924         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
925         All uses changed.
926
927 2006-01-26  Simon Josefsson  <jas@extundo.com>
928
929         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
930         prototype is visible on mingw32.
931
932         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
933         for mingw32.
934
935         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
936         mingw32).
937
938 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
939
940         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
941         attempt to open for write; this always fails, at least on POSIX
942         hosts.  This reinstates the 2006-01-09 change, which was
943         inadvertently removed.
944
945 2006-01-26  Bruno Haible  <bruno@clisp.org>
946             Paul Eggert  <eggert@cs.ucla.edu>
947
948         * stdbool_.h (_Bool)
949         [(! (defined __cplusplus || defined __BEOS__)
950           && !defined __GNUC__
951           && !(defined __HP_cc || defined __xlc__
952                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
953                || defined __sgi))]:
954         #define to signed char in these cases too; this simplifies
955         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
956         etc., separately) and makes it more conservative.
957
958 2006-01-21  Jim Meyering  <jim@meyering.net>
959
960         Sync from the stable (b5) branch of coreutils:
961
962         * fts.c (fts_children): Don't let close() clobber errno from
963         failed fchdir().
964
965         * fts.c (fts_stat): When following a symlink-to-directory,
966         don't necessarily interpret stat-fails+lstat-succeeds as indicating
967         a dangling symlink.  That can also happen at least for ELOOP.
968         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
969         FYI, this bug predates the inclusion of fts.c in coreutils.
970
971         * fts.c (fts_open): Put new maxarglen declaration and uses
972         in their own block, so pre-c99 compilers don't object.
973
974         Avoid the double-free (first in fts_read, second in fts_close) that
975         would occur when an `active' directory is made inaccessible (e.g.,
976         via chmod a-x) during a traversal.
977         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
978         before returning.  Reproduce this failure by
979         mkdir -p a/b; cd a; chmod a-x . b
980         Reported by Stavros Passas.
981
982 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
983
984         * argp-namefrob.h: Bugfix. Remove stray #
985
986 2006-01-25  Bruno Haible  <bruno@clisp.org>
987
988         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
989         warnings.
990         Reported by Paul Eggert.
991
992 2006-01-25  Jim Meyering  <jim@meyering.net>
993
994         * fileblocks.c: Remove more useless parentheses.
995         * readutmp.h: Likewise.
996
997 2006-01-24  Bruno Haible  <bruno@clisp.org>
998
999         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1000         has it.
1001         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1002         2005-11-26.
1003
1004         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1005         to avoid problems with the built-in _Bool type.
1006         Reported by Paul Eggert on 2005-11-26.
1007
1008 2006-01-24  Jim Meyering  <jim@meyering.net>
1009
1010         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1011
1012 2006-01-24  Simon Josefsson  <jas@extundo.com>
1013
1014         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1015         Bruno.
1016
1017 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1018
1019         Work around porting bugs reported by Dieter in
1020         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1021         * getopt.c (_NOPROTO): Remove; no longer needed.
1022         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1023         Include "getopt.h" first, to check interface.
1024         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1025         !HAVE_DECL_GETENV.
1026         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1027         (__strndup): Revert to K&R-style function dfns, the glibc style.
1028         * strnlen.c: Don't claim it's taken from glibc; it's not.
1029         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1030         Include strnlen.h first, to get prototype properly.
1031         (strnlen): Renamed from __strnlen.
1032         Remove weak alias.
1033
1034 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1035
1036         These changes imported from libc.
1037         * getopt.c: Use __fxprintf instead of inline stream orientation
1038         test and two separate function calls.
1039         * strndup.c (__strndup): Add libc_hidden_def.
1040
1041 2006-01-22  Bruno Haible  <bruno@clisp.org>
1042
1043         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1044         temporary buffer for sprintf, take into account the precision also
1045         for 'd', 'i', 'u', 'o', 'x', 'X'.
1046
1047 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1048
1049         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1050         to pacify gcc -Wswitch-default.
1051
1052 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1053
1054         * argp-help.c (usage_long_opt): Do not print DOC options.
1055         (__argp_base_name): Removed
1056         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1057         typo.
1058         (__argp_base_name): Provide macro definition or extern declaration
1059         depending on the configuration
1060
1061 2006-01-20  Simon Josefsson  <jas@extundo.com>
1062
1063         * inet_ntop.h: Unconditionally include sys/socket.h.
1064
1065 2006-01-19  Simon Josefsson  <jas@extundo.com>
1066
1067         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1068
1069 2006-01-12  Simon Josefsson  <jas@extundo.com>
1070
1071         * base64.c: Fix warning, reported by Bruno Haible
1072         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1073
1074 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1075
1076         Sync from coreutils.
1077         * md5.c: Fix commentary typos.
1078         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1079         * md5.h (__attribute__): Remove; unused.
1080         * sha1.c: Fix commentary to match md5 better.
1081         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1082         so that we don't need to worry about alignment.  All uses changed.
1083         This merges the 2005-10-28 md5 change into sha1.
1084
1085 2006-01-11  Jim Meyering  <jim@meyering.net>
1086
1087         Sync from coreutils.
1088         * md5.c (OP): Fix spacing.
1089
1090 2006-01-11  Simon Josefsson  <jas@extundo.com>
1091
1092         * stdint_.h (SIZE_MAX): Add missing (.
1093
1094 2006-01-10  Bruno Haible  <bruno@clisp.org>
1095
1096         * argp.h (__const): Remove macro. Use const instead.
1097         * argp-fmtstream.h (__const): Likewise.
1098         * glob_.h (__const): Remove macro.
1099         * glob-libc.h: Use const instead of __const.
1100
1101 2006-01-10  Jim Meyering  <jim@meyering.net>
1102
1103         Avoid the double-free (first in fts_read, second in fts_close) that
1104         would occur when an `active' directory is made inaccessible (e.g.,
1105         via chmod a-x) during a traversal.
1106         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1107         before returning.  Reproduce this failure by
1108         mkdir -p a/b; cd a; chmod a-x . b
1109         Reported by Stavros Passas.
1110
1111         Sync from coreutils.
1112         * sha1.c: Tweak grammar in a comment.
1113
1114 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1115
1116         * regex_internal.h (BITSET_WORD_BITS):
1117         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1118         preprocessor mishandles large unsigned values as if they were signed.
1119         Problem reported by Claudio Fontana in
1120         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1121
1122 2006-01-10  Simon Josefsson  <jas@extundo.com>
1123
1124         * socket_.h: New file.
1125
1126 2006-01-10  Bruno Haible  <bruno@clisp.org>
1127
1128         * localcharset.c: Update from GNU gettext.
1129
1130 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1131
1132         Sync from coreutils.
1133         * chdir-long.c (cdb_free): Don't bother trying to open directory
1134         for write access: POSIX says that must fail.
1135         * fts.c (diropen): Likewise.
1136         * save-cwd.c (save_cwd): Likewise.
1137         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1138         well, for minor improvements on hosts that lack O_DIRECTORY.
1139         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1140         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1141         Fall back on chown if open failed with EACCES.
1142
1143         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1144         Report an error at compile-time if only a 1-second nominal clock
1145         resolution is found.
1146
1147         * lchmod.h: New file.
1148         * mkdir-p.c: Include lchmod.h, lchown.h.
1149         (make_dir_parents): Use lchown rather than chown, and
1150         lchmod rather than chmod.
1151
1152         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1153         too.  Problem with "none" reported by Bob Proulx.  Problem with
1154         "proc" reported by n0dalus.
1155
1156         * mountlist.c: Include <limits.h>.
1157         (dev_from_mount_options)
1158         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1159         New function.  It no longer assumes "dev=" has the System V meaning
1160         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1161         (read_file_system_list)
1162         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1163         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1164         dev= in that case.
1165
1166         * posixtm.h (PDS_PRE_2000): New macro.
1167         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1168         All usages changed.  Reject dates outside the range 1969-1999 if
1169         PDS_PRE_2000 is used.
1170
1171 2006-01-09  Jim Meyering  <jim@meyering.net>
1172
1173         Sync from coreutils.
1174
1175         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1176
1177         * chdir-safer.h, chdir-safer.c: New files.
1178
1179         * modechange.c (mode_compile): Reject an invalid mode string
1180         that starts with an octal digit.  From Andreas Gruenbacher.
1181
1182         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1183         and dup to open_safer and dup_safer, respectively.
1184         (openat_permissive): Fix typo in comment.
1185
1186         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1187         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1188         (_): Remove; no longer needed.
1189         (openat): Renamed from rpl_openat; no need for rpl_openat
1190         since openat.h renames openat for us.
1191         Replace most of the body with a call to openat_permissive,
1192         to avoid duplicate code.
1193         Port to (probably hypothetical) environments were mode_t is
1194         wider than int.
1195         (openat_permissive): Require mode arg, so that we can check
1196         types better.  Put it just after flags.  Change cwd failure
1197         indicator from pointer-to-bool to pointer-to-errno-value.
1198         All callers changed.
1199         Invoke openat_save_fail and/or openat_restore_fail if
1200         cwd_errno is null, so that openat can call us.
1201         (openat_permissive, fdopendir, fstatat, unlinkat):
1202         Simplify errno handling to avoid some duplicate code,
1203         as it's OK to set errno on success.
1204         * openat.h: Revamp code so that function macros depend on
1205         __OPENAT_PREFIX only, not also on AT_FDCWD.
1206         (openat_ro): Remove.  Caller changed to use openat_permissive.
1207         (openat_permissive): Now a macro, if not a function.
1208         (openat_restore_fail, openat_save_fail): Now always functions,
1209         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1210
1211         * openat-priv.h: New file, defining macros used by mkdirat.c
1212         and openat.c.
1213         * mkdirat.c: Include openat-priv.h.
1214         Remove definitions of macros defined therein.
1215         * openat.c: Likewise.
1216
1217         * mkdirat.c (mkdirat): New file and function.
1218         * openat.h (mkdirat): Declare.
1219
1220         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1221
1222         * openat.h (openat_permissive): Declare.
1223         (openat_ro): Define.
1224
1225         * openat.c (EXPECTED_ERRNO): New macro.
1226         (openat_permissive): New function -- used in remove.c rewrite.
1227         (all functions): Set errno just before returning, only if there
1228         was an actual failure.
1229         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1230
1231         Emulate openat-family functions using Linux's procfs, if possible.
1232         Idea and some code based on Ulrich Drepper's glibc changes.
1233
1234         * openat.c: (BUILD_PROC_NAME): New macro.
1235         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1236         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1237         before falling back on save_cwd and restore_cwd.
1238         (fdopendir, fstatat, unlinkat): Likewise.
1239
1240         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1241         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1242
1243         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1244         as second argument to va_arg.  Otherwise, some versions of gcc
1245         warn that `if this code is reached, the program will abort'.
1246
1247 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1248
1249         Sync from coreutils.
1250
1251         Add POSIX ACL support
1252         * acl.h (copy_acl, set_acl): Add declarations.
1253         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1254         systems other than Linux.
1255         (chmod_or_fchmod): New function: use fchmod when possible,
1256         and chmod otherwise.
1257         (file_has_acl): Add a POSIX ACL implementation, with a
1258         Linux-specific subcase.
1259         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1260         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1261         acls are unsupported.
1262         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1263         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1264         are unsupported.
1265
1266 2006-01-09  Bruno Haible  <bruno@clisp.org>
1267
1268         * sysexit_.h (EX_OK): New macro.
1269         Suggested by Martin Lambers <marlam@marlam.de>.
1270
1271 2006-01-09  Bruno Haible  <bruno@clisp.org>
1272
1273         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1274         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1275         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1276         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1277
1278 2006-01-09  Bruno Haible  <bruno@clisp.org>
1279
1280         * stdint_.h (SIZE_MAX): Write the value without involving negative
1281         numbers.
1282
1283 2005-10-16  Bruno Haible  <bruno@clisp.org>
1284
1285         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1286         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1287
1288 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1289
1290         * strftime.c (tzname): Don't declare if it is already #defined.
1291         Problem reported for Mingw by Mark Junker.
1292
1293 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1294
1295         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1296         long int, not int, for nanosecond counts, so that people who are
1297         used to POSIX struct timespec won't be surprised.  Reported by Jim
1298         Meyering.
1299
1300 2005-12-16  Jim Meyering  <jim@meyering.net>
1301
1302         * fprintftime.c, fprintftime.h: New files.
1303
1304 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1305
1306         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1307         * argp-help.c (fill_in_uparams): Check if the constructed
1308         struct uparams is valid. Fall back to the default values if it is
1309         not.
1310
1311 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1312
1313         * argp-help.c (__argp_base_name): New function
1314         (__argp_short_program_name): Rewrite using __argp_base_name
1315         * argp-namefrob.h: Define program_invocation_name and
1316         program_invocation_short_name if requested
1317         (__argp_base_name): Add prototype
1318         * argp-parse.c (argp_def): Use gettext wrappers
1319         (argp_default_parser): Use __argp_base_name
1320         * argp-pin.c: New file. Defines program_invocation_name and
1321         program_invocation_short_name on systems that lack them.
1322
1323 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1324
1325         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1326         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1327         porting problem reported by Georg Schwarz in
1328         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1329
1330 2005-07-09  Bruno Haible  <bruno@clisp.org>
1331
1332         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1333         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1334         Reported by Mark Junker <mjscod@gmx.de>.
1335
1336 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1337
1338         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1339         (uintmax_t) [defined uintmax_t]: Do not declare.
1340         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1341         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1342         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1343         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1344         sake of portability to weird hosts that C allows (though we don't
1345         know of any practical examples).
1346
1347         * savedir.h (fdsavedir): New decl.
1348         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1349         contains most of the former guts of savedir.
1350         (savedir): Use savedirstream.
1351         Include "openat.h".
1352
1353 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1354
1355         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1356         coreutils no longer futzes with rounding modes.
1357
1358 2005-11-14  Jim Meyering  <jim@meyering.net>
1359
1360         * mkstemp-safer.c: Include <config.h>, required for possible
1361         replacement of mkstemp.
1362
1363 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1364
1365         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1366         business.
1367         (gethrxtime) [! (HAVE_NANOUPTIME
1368         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1369         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1370         our own approximation.
1371
1372 2005-11-10  Simon Josefsson  <jas@extundo.com>
1373
1374         * readline.c: Remove EOL.
1375
1376 2005-11-08  Eric Blake  <ebb9@byu.net>
1377
1378         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1379
1380 2005-11-08  Eric Blake  <ebb9@byu.net>
1381
1382         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1383
1384 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1385
1386         Fix porting problem reported by Theodoros V. Kalamatianos.
1387         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1388         Don't assume that futimes failing means we must fail.
1389
1390 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1391
1392         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1393         leave errno alone.  Problem reported by Dmitry V. Levin.
1394
1395 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1396
1397         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1398         errno alone.  Problem reported by Frederic Jolliton.
1399
1400 2005-10-28  Simon Josefsson  <jas@extundo.com>
1401
1402         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1403         "restrict" keywords, as per POSIX.  Protect the function
1404         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1405         Don't use K&R prototypes.  Check the sprintf return values.
1406         Re-define EAFNOSUPPORT if not present.  Indent.
1407
1408         * md5.h, md5.c: Simplify buffer handling visavi alignment,
1409         suggested by Bruno Haible <bruno@clisp.org>.
1410
1411         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1412
1413         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
1414
1415         * gc-libgcrypt.c: Add MD2 (which is not available through
1416         libgcrypt).
1417
1418         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
1419
1420         * md2.h, md2.c: New files.
1421
1422 2005-10-24  Simon Josefsson  <jas@extundo.com>
1423
1424         * md4.h: Shrink buffer size, now that we changed the type.
1425
1426 2005-10-22  Simon Josefsson  <jas@extundo.com>
1427
1428         * arcfour.h, arcfour.c: Use fixed size indices in the
1429         arcfour_context struct (simplify test vector testing in GNU
1430         Shishi).
1431
1432 2005-10-22  Simon Josefsson  <jas@extundo.com>
1433
1434         * md4.h, md4.c: Simplify buffer handling visavi alignment,
1435         suggested by Bruno Haible <bruno@clisp.org>.
1436
1437 2005-10-22  Simon Josefsson  <jas@extundo.com>
1438
1439         * crc.h: Include stddef.h, for size_t.
1440
1441 2005-10-21  Simon Josefsson  <jas@extundo.com>
1442
1443         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1444         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1445
1446 2005-10-21  Simon Josefsson  <jas@extundo.com>
1447
1448         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1449         block.
1450
1451 2005-10-21  Simon Josefsson  <jas@extundo.com>
1452
1453         * gc-gnulib.c: Support ARCTWO in CBC mode.
1454
1455 2005-10-21  Simon Josefsson  <jas@extundo.com>
1456
1457         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1458         <bruno@clisp.org>.
1459
1460         * hmac-sha1.c (hmac_sha1): Likewise.
1461
1462         * crc.c (crc32_update): Actually use crc parameter, suggested by
1463         Bruno Haible <bruno@clisp.org>.
1464
1465         * crc.h: Include stdint.h directly, suggested by Bruno Haible
1466         <bruno@clisp.org>.
1467
1468 2005-10-21  Simon Josefsson  <jas@extundo.com>
1469
1470         * des.h, des.c: New files.
1471
1472         * gc-gnulib.c: Support DES.c
1473
1474 2005-10-21  Simon Josefsson  <jas@extundo.com>
1475
1476         * arctwo.h, arctwo.c: New files.
1477
1478         * gc-gnulib.c: Support ARCTWO.
1479
1480 2005-10-21  Simon Josefsson  <jas@extundo.com>
1481
1482         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1483
1484 2005-10-19  Simon Josefsson  <jas@extundo.com>
1485
1486         * gc-gnulib.c: Support ARCFOUR.
1487
1488 2005-10-19  Simon Josefsson  <jas@extundo.com>
1489
1490         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1491         support.
1492
1493         * gc.h: Add ECB enum type.
1494
1495         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1496
1497 2005-10-19  Simon Josefsson  <jas@extundo.com>
1498
1499         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1500
1501 2005-10-18  Simon Josefsson  <jas@extundo.com>
1502
1503         * md4.h, md4.c: New files, based on md5.?.
1504
1505 2005-10-17  Simon Josefsson  <jas@extundo.com>
1506
1507         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1508
1509         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1510
1511 2005-10-17  Simon Josefsson  <jas@extundo.com>
1512
1513         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1514
1515 2005-10-17  Simon Josefsson  <jas@extundo.com>
1516
1517         * gc.h, gc-libgcrypt.c: Add ciphers.
1518
1519 2005-10-17  Simon Josefsson  <jas@extundo.com>
1520
1521         * sha1.c: Use uint32_t instead of md5_uint32.t
1522
1523         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1524         md5.h.
1525
1526         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
1527
1528         * md5.h: Use stdint.h and uint32_t.  Doc fix.
1529
1530 2005-10-15  Simon Josefsson  <jas@extundo.com>
1531
1532         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1533
1534         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1535
1536 2005-10-14  Simon Josefsson  <jas@extundo.com>
1537
1538         * arcfour.h, arcfour.c: New files.
1539
1540 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
1541
1542         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1543         include <wchar.h>; no longer needed.
1544
1545 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1546         and  Ulrich Drepper  <drepper@redhat.com>
1547
1548         Import from libc.
1549         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1550         instead of inline stream orientation test and two separate
1551         function calls.  Pay no attention to USE_IN_LIBIO.
1552
1553 2005-10-14  Roland McGrath  <roland@redhat.com>
1554
1555         Import from libc.  [BZ #1331]
1556         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1557         macro argument.
1558         Reported by Matej Vela <vela@debian.org>.
1559
1560 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1561
1562         * mkdir-p.c (make_dir_parents): Don't report an error if an
1563         intermediate directory is in a read-only file system.  Problem
1564         reported by Eric Blake.
1565
1566 2005-10-13  Simon Josefsson  <jas@extundo.com>
1567
1568         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1569         Move memory allocation outside of loop.
1570
1571 2005-10-12  Simon Josefsson  <jas@extundo.com>
1572
1573         * gc-pbkdf2-sha1.c: New file.
1574
1575         * gc.h: Add gc_pbkdf2_sha1 prototype.
1576
1577 2005-10-12  Simon Josefsson  <jas@extundo.com>
1578
1579         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1580         suggested by Bruno Haible <bruno@clisp.org>.
1581
1582 2005-10-12  Simon Josefsson  <jas@extundo.com>
1583
1584         * gc-libgcrypt.c (gc_hmac_sha1): New function.
1585
1586         * gc-gnulib.c (gc_hmac_sha1): New function.
1587
1588 2005-10-12  Simon Josefsson  <jas@extundo.com>
1589
1590         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
1591
1592 2005-10-12  Simon Josefsson  <jas@extundo.com>
1593
1594         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
1595         GC_USE_HMAC_MD5, respectively.
1596
1597         * gc-libgcrypt.c (gc_md5): Fix assert call.
1598         (gc_md5): Fix typo.
1599
1600         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
1601
1602         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
1603
1604         * gc-gnulib.c (gc_hash_buffer): Ditto.
1605
1606 2005-10-11  Bruno Haible  <bruno@clisp.org>
1607
1608         * c-strcasestr.h: New file, from GNU gettext.
1609         * c-strcasestr.c: New file, from GNU gettext.
1610
1611 2005-10-11  Bruno Haible  <bruno@clisp.org>
1612
1613         * c-strcase.h: New file, from GNU gettext.
1614         * c-strcasecmp.c: New file, from GNU gettext.
1615         * c-strncasecmp.c: New file, from GNU gettext.
1616
1617 2005-10-11  Simon Josefsson  <jas@extundo.com>
1618
1619         * crc.h, crc.c: New files.
1620
1621         * gc.h (gc_hash_buffer): Add doc.
1622
1623 2005-10-08  Simon Josefsson  <jas@extundo.com>
1624
1625         * gc.h: Add gc_hash and gc_hash_buffer.
1626
1627         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
1628
1629         * gc-libgcrypt.c (gc_hash_buffer): Add.
1630
1631 2005-10-11  Bruno Haible  <bruno@clisp.org>
1632
1633         * strcasecmp.c: Include limits.h.
1634         (strcasecmp): Avoid integer overflow on exotic platforms.
1635         * strncasecmp.c: Include limits.h.
1636         (strncasecmp): Avoid integer overflow on exotic platforms.
1637         Reported by Paul Eggert.
1638
1639 2005-10-06  Simon Josefsson  <jas@extundo.com>
1640
1641         * hmac-md5.c: New file.
1642
1643         * hmac.h: New file.
1644
1645 2005-10-06  Simon Josefsson  <jas@extundo.com>
1646
1647         * memxor.c (memxor): Avoid casts and warnings.
1648
1649 2005-10-05  Derek Price  <derek@ximbiot.com>
1650
1651         * getdelim.c (SIZE_MAX): New macro, if not already defined.
1652
1653 2005-10-05  Simon Josefsson  <jas@extundo.com>
1654
1655         * memxor.c (memxor): Fix compiler error.
1656
1657         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
1658         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
1659
1660         * memxor.h, memxor.c: New files.
1661
1662         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
1663         we assume all systems have it, suggested by Jim Meyering
1664         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
1665         any systems lack sys/socket.h; mingw32 is known to lack it, but we
1666         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
1667         same reasons.
1668
1669 2005-10-04  Bruno Haible  <bruno@clisp.org>
1670
1671         * verify.h (verify_true): Provide alternative definition for C++.
1672
1673 2005-10-04  Simon Josefsson  <jas@extundo.com>
1674
1675         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
1676         D. Baushke" <mdb@gnu.org>.
1677
1678 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
1679
1680         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
1681         (SSIZE_MAX): New macro, if not already defined.
1682         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1683         than 2 GiB.
1684
1685 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
1686
1687         * exclude.c: Include verify.h.
1688         (verify): Remove.  All callers changed to use verify.h's version.
1689         * strtoimax.c: Likewise.
1690         * utimecmp.c: Likewis.e
1691
1692         Sync from coreutils.
1693         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
1694         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
1695         * .cvsignore: Add fts.h, search.h, t-fpending.
1696         * settime.c (settime): Fix { typo in previous patch.  Also, don't
1697         bother returning ENOSYS if settimeofday or stime fails; just let
1698         them return whatever errno they want to return.
1699         * utimens.c: Include unistd.h, for dup2.
1700         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
1701         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
1702
1703 2005-10-02  Jim Meyering  <jim@meyering.net>
1704
1705         Sync from coreutils.
1706         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
1707         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
1708         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
1709         Remove AT_FDCWD test.
1710         Do not consume the fd unless successful.
1711         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
1712         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
1713         block, so that we don't even try to compile it if settimeofday is
1714         available.  This works around a compilation failure on OSF1 V5.1,
1715         due to stime requiring a `long int*' while tv_sec is `int'.
1716
1717 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
1718
1719         * getdelim.c (getdelim): Remove unused variables.
1720
1721 2005-10-01  Simon Josefsson  <jas@extundo.com>
1722
1723         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
1724         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
1725         AI_* and EAI_* definitions.  Protect function declarations.
1726
1727 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
1728
1729         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
1730         so that the code works even with ancient cpp.  Portability problem
1731         with GCC 2.7.2.1 reported by Thomas M.Ott.
1732
1733 2005-09-27  Jim Meyering  <jim@meyering.net>
1734
1735         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
1736
1737         * intprops.h (signed_type_or_expr__): Define.
1738         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
1739         for unsigned types.
1740
1741 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
1742
1743         * verify.h (verify_expr): Remove, replacing with:
1744         (verify_true): New macro that returns true instead of void.
1745         (verify_type__): Remove.
1746         (verify): Use verify_true rather than verify_type__.
1747
1748 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
1749
1750         * utimens.c (ENOSYS): Define if not already defined.
1751         (futimens): Support having a null PATH if the file descriptor
1752         is nonnegative.
1753
1754         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
1755         Remove.
1756         (__attribute): Define to empty unless GCC 3.1 or later.
1757         This works around a core dump on OpenBSD 3.4, which has GCC
1758         2.95.3, which dumps core when given __attribute__(()).  It also
1759         simplifies other tests, since we really don't want to bother with
1760         worrying about which ancient version of GCC supported what.
1761         Original problem reported by Yoann Vandoorselaere, with part of
1762         the fix suggested by Derek Price.
1763
1764 2005-09-24  Jim Meyering  <jim@meyering.net>
1765
1766         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
1767         so we can once again use a positive bitfield width of 1 -- now we
1768         don't have to explain why we were using a bitfield width of 2.
1769
1770 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
1771
1772         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
1773         Problem reported by Eric Blake.
1774         (getaddrinfo): Initialize se so that it's not garbage.
1775         Redo internal storage allocation so that it doesn't make unportable
1776         assumptions about alignment.
1777         Fix a memory leak.
1778
1779         * utimens.c (futimens): Use futimesat if available.
1780         Prefer it to futimes since it doesn't have the futimes bug.
1781
1782         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
1783         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
1784         Instead, declare a function that returns a pointer to an array,
1785         and use verify_type__ to declare the size of the array.
1786         Problem and germ of a solution reported by Bruno Haible.
1787         (verify_type__): Use 2, not 1, for bitfield size, to avoid
1788         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
1789
1790 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
1791
1792         Sync from coreutils.
1793
1794         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
1795         stat-time.h.
1796         * argmatch.h: Include verify.h
1797         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
1798         (ARGMATCH_ASSERT): Remove; unused.
1799         * canonicalize.c: Assume STDC_HEADERS.
1800         * exclude.c: Include "strcase.h".
1801         * regex_internal.h [!defined _LIBC]: Likewise.
1802         * getusershell.c: Include stdio--.h rather than stdio.h
1803         and stdio-safer.h.
1804         (getusershell): Call fopen, not fopen_safer.
1805         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
1806         Do not include unistd-safer.h.
1807         (save_cwd): Don't call fd_safer; no longer needed
1808         now that we include fcntl--.h.
1809
1810         * getdate.y (relative_time): New type.
1811         (RELATIVE_TIME_0): New constant.
1812         (parser_control): Use relative_time instead of doing it ourselves.
1813         (%union): Add new relative_time rel member.
1814         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
1815         Now typeless.
1816         (relunit, relunit_snumber): Now of type rel.
1817         (zone, rel, relunit, get_date): Adjust to above changes.
1818
1819         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
1820         Do not include unistd-safer.h.
1821         (getloadavg): Don't call fd_safer; no longer needed
1822         now that we include fcntl--.h.
1823
1824         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
1825         (make_dir_parents): Treat ENOSYS like EEXIST.
1826
1827         Improve quality of diagnostics on restore_cwd failure.
1828         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
1829         (make_dir_parents): Last arg is now int * (for errno), not bool *.
1830         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
1831         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
1832         each time through the loop.  Do not diagnose restore_cwd failure;
1833         that is the caller's job (and perhaps the caller does not care).
1834
1835         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
1836         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
1837         If the file already exists but is not a directory, don't bother
1838         to try to make its parents.
1839         Close potential file descriptor leak if we can't chdir("/") (!).
1840         Don't always return true if chdir($PWD) fails; return true only
1841         if the requested action was done successfully (except for the
1842         chdir($PWD)).
1843         Don't log final directory unless we actually made it.
1844         Refactor to avoid duplicate code to fix up permissions.
1845         Don't attempt to fix up parent permissions if chdir($PWD) fails.
1846
1847         * strftime.c (my_strftime): Rewrite the previous change slightly,
1848         to make it a bit faster and (I hope) clearer.
1849         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
1850         Fix bug in formats like %2N.
1851
1852         * verify.h: New file.
1853
1854 2005-09-22  Jim Meyering  <jim@meyering.net>
1855
1856         Sync from coreutils.
1857
1858         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
1859
1860         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
1861         the .tm_year member, since otherwise gcc-4.0 would now warn about
1862         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
1863
1864         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
1865         order to avoid an unsuppressible warning from gcc on 64-bit systems.
1866
1867         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
1868         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
1869         when run in a time zone for which daylight savings time is in effect
1870         for the starting date.
1871
1872         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
1873         stop us from restricting permissions of just-created absolute-named
1874         directories.
1875         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
1876         to restore initial working directory.
1877         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
1878         to tell caller if/when we change the working directory and are
1879         unable to return to the initial one.
1880         * mkdir-p.h (make_dir_parents): Update prototype.
1881         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
1882         `return false'.  This fixes a bug introduced on 2004-07-30.
1883
1884         * openat.c (fdopendir): Be sure to close the supplied
1885         file descriptor before returning.  This makes our replacement
1886         implementation a little closer to Solaris's, where fdopendir
1887         ties the file descriptor to the returned DIR* pointer.
1888         * openat.c (unlinkat): New function.
1889         * openat.h (unlinkat): Add prototype.
1890         * openat-die.c (openat_save_fail): Rename from openat_save_die.
1891         (openat_restore_fail): Rename from openat_restore_die.
1892         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
1893
1894         Provide an alternative to exiting immediately upon save_cwd or
1895         restore_cwd failure.  Now, an application can arrange e.g.,
1896         to perform a longjump in that case.
1897         * openat.c: Include dirname.h.
1898         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
1899         (rpl_openat, fdopendir, fstatat): Call openat_save_die
1900         and openat_restore_die rather than calling error directly.
1901         Don't include "error.h" or "exitfail.h"; they're no longer needed.
1902
1903         * openat-die.c (openat_save_die, openat_restore_die): New file.
1904         * openat.h (openat_save_die, openat_restore_die): Declare and define.
1905
1906         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1907         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1908                             int utc, int nanoseconds);
1909         Background:
1910         date should not have to allocate a megabyte of virtual memory to
1911         handle a format argument like +%1048575T.  When implemented with
1912         strftime, it must allocate such a buffer, use strftime to fill it
1913         in, print it, then free it.
1914         With fprintftime, it simply prints everything and exits.
1915         With no need for memory allocation, that's one fewer way to fail.
1916         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1917         optional field width, not before, so we accept %9:z, not %:9z.
1918         (my_strftime): Be sure to use L_('x') for literals.
1919
1920         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
1921         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
1922         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
1923         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
1924         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
1925         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
1926         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
1927         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
1928         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
1929
1930         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1931         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
1932         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1933         and don't include <sys/file.h>).
1934
1935 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
1936
1937         Sync from coreutils.
1938
1939         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
1940         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
1941         [!LDAV_DONE]: Avoid unused variable warning.
1942
1943 2005-09-21  Bruno Haible  <bruno@clisp.org>
1944
1945         * unicodeio.h (unicode_to_mb): New declaration.
1946
1947 2005-09-20  Derek Price  <derek@ximbiot.com>
1948
1949         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
1950
1951 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1952
1953         Use a consistent style for including <config.h>.
1954         * __fpending.c, acl.c, argmatch.c,
1955         argp-help.c, argp-parse.c,
1956         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
1957         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
1958         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
1959         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
1960         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
1961         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
1962         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
1963         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
1964         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
1965         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
1966         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
1967         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
1968         modechange.c, mountlist.c, open-safer.c, physmem.c,
1969         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
1970         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
1971         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
1972         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
1973         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
1974         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
1975         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
1976         userspec.c, utimecmp.c, version-etc-fsf.c,
1977         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
1978         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
1979         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
1980         Standardize inclusion of config.h.
1981         * __fpending.h, dirfd.h, getdate.h, human.h,
1982         inttostr.h:  Removed inclusion of config.h from header files.
1983         * inttostr.c:  Adjusted in-tree users.
1984         * timespec.h: Remove superfluous warning to include config.h.
1985         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
1986         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
1987         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
1988         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
1989
1990 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1991
1992         * stat-time.h: New file.
1993         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1994         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
1995         in a different way.
1996         (timespec_cmp): New function.
1997         * utimecmp.c: Include stat-time.h.
1998         (SYSCALL_RESOLUTION): Depend on whether various struct stat
1999         members exist, not on the obsolescent ST_MTIM_NSEC.
2000         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2001
2002 2005-09-15  Derek Price  <derek@ximbiot.com>
2003             Paul Eggert  <eggert@cs.ucla.edu>
2004
2005         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2006         changes, consolidating in...
2007         * regex_internal.h: ...this file.
2008
2009 2005-09-15  Derek Price  <derek@ximbiot.com>
2010
2011         * regex_internal.h: Blank `pure' for GNUC < 3.
2012         * regex_internal.c: Ditto, using this...
2013         (__GNUC_PREREQ): ...new macro.
2014         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2015         (__GNUC_PREREQ): ...this new macro.
2016
2017         * strstr.h: Include string.h. Define strstr as a macro here.
2018
2019 2005-09-13  Derek Price  <derek@ximbiot.com>
2020
2021         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2022         failure.
2023         Reported by Jim Meyering  <jim@meyering.net>.
2024
2025 2005-09-13  Jim Meyering  <jim@meyering.net>
2026
2027         * canon-host.c: Filter through gnu indent and reword comments slightly.
2028         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2029
2030 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2031
2032         * lib/base64.c: Typo.
2033         (base64_encode): Put b64str in initialized data section.
2034
2035 2005-09-12  Derek Price  <derek@ximbiot.com>
2036
2037         Return usable errors from canon-host.
2038         * canon-host.h: New file.
2039         * canon-host.c (canon_host): Wrap...
2040         (canon_host_r): ...this new function, which now relies exclusively on
2041         getaddrinfo.
2042         (ch_strerror): New function.
2043         (last_cherror): New global.
2044         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2045         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2046         void *.
2047         (freeaddrinfo): Free ai->ai_canonname when set.
2048
2049 2005-09-12  Derek Price  <derek@ximbiot.com>
2050             Paul Eggert  <eggert@cs.ucla.edu>
2051
2052         * glob-libc.h: Renamed from glob_.h.  The new version is
2053         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2054         protecting things that should be done only in gnulib contexts.
2055         * glob_.h: New file, containing only the glob things needed for
2056         gnulib.
2057         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2058         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2059         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2060         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2061         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2062         and to respect the namespace rules better.
2063
2064 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2065
2066         Merge glibc and coreutils changes into gnulib, plus a few
2067         extra fixes.
2068         * md5.c: Use #error rather than a string.
2069         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2070         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2071         (__attribute__): Define to empty for non recent-GCC.
2072         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2073         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2074         Renamed from their non-__ counterparts, with new macros replacing
2075         them if not _LIBC.  Add __THROW attribute.
2076         (rol): Remove.
2077         (struct md5_ctx): Align buffer if using GCC.
2078         * sha1.h (struct sha1_ctx): Likewise.
2079         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2080         The old name was backwards.
2081         (NOTSWAP): Remove; not used.
2082         (rol): New macro, moved here from md5.h.
2083         (sha1_process_block): Remove a FIXME that doesn't make sense.
2084
2085 2005-09-12  Derek Price  <derek@ximbiot.com>
2086
2087         * gai_strerror.c: Include config.h when available.  Include
2088         getaddrinfo.h before other headers to test interface.
2089         Reported by Larry Jones <lawrence.jones@ugs.com>.
2090
2091 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2092
2093         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2094         definitions, since that's the preferred style in glibc.
2095         Fix a minor spacing issue, and update copyright notice to match glibc's.
2096
2097 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2098
2099         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2100
2101 2005-09-06  Simon Josefsson  <jas@extundo.com>
2102
2103         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2104         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2105
2106 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2107
2108         Change bitset word type from unsigned int to unsigned long int,
2109         as this has better performance on typical 64-bit hosts.
2110         Port bitset code to hosts with unusual word sizes.
2111         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2112         (build_collating_symbol):
2113         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2114         argument is a bitset.  This is merely a style issue, but it makes
2115         it clearer that an entire array is expected.
2116         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2117         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2118         Port to the case where bitset_word is not the same as unsigned int.
2119         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2120         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2121         Likewise.
2122         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2123         (build_trtable, group_nodes_into_DFAstates):
2124         Likewise.
2125         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2126         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2127         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2128         * regexec.c (group_nodes_into_DFAstates): Likewise.
2129         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2130         * regcomp.c (optimize_subexps, lower_subexp):
2131         Work even if bitset_word has holes in its bitwise representation.
2132         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2133         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2134         Likewise.
2135         * regex_internal.c (re_string_reconstruct):
2136         Don't assume UCHAR_MAX == 255.
2137         * regex_internal.h (bitset_set_all): Likewise.
2138         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2139         All uses changed.
2140         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2141         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2142         All uses changed.
2143         (BITSET_WORD_MAX): New macro.
2144         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2145         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2146         (bitset_empty, bitset_copy):
2147         Prefer sizeof (bitset) to multiplying it out ourselves.
2148         (bitset_not_merge): Remove; unused.
2149         (bitset_contain): Return bool, not unsigned int with one bit on.
2150         All callers changed.
2151         * regexec.c (build_trtable): Don't assume bitset has no stricter
2152         alignment than re_node_set; do this by defining a new internal
2153         type struct dests_alloc and using it to allocate memory.
2154
2155 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2156
2157         Check for arithmetic overflow when calculating sizes, to prevent
2158         some buffer-overflow issues.  These patches are conservative, in the
2159         sense that when I couldn't determine whether an overflow was possible,
2160         I inserted a run-time check.
2161         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2162         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2163         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2164         (re_xnrealloc, re_x2nrealloc): New inline functions.
2165         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2166         (build_equiv_class, build_charclass): Check for arithmetic overflow
2167         in size expression calculations.
2168         * lib/regex_internal.c (re_string_realloc_buffers):
2169         (build_wcs_upper_buffer, re_node_set_add_intersect):
2170         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2171         (re_dfa_add_node, register_state): Likewise.
2172         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2173         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2174         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2175         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2176
2177 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2178
2179         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2180         to avoid a collision with bits/local_lim.h in glibc.
2181         All uses changed.  Problem reported by Dmitry V. Levin in
2182         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2183
2184         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2185         bugs in int versus size_t comparisons.
2186         (re_string_context_at): Fix bug where the code assumed that
2187         Idx is signed.
2188
2189         Use bool where appropriate.
2190         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2191         All callers changed.
2192         (calc_eclosure_iter): Likewise, for ROOT arg.
2193         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2194         (build_charclass_op): Likewise, for NON_MATCH arg.
2195         * regex_internal.c (re_string_allocate, re_string_construct):
2196         (re_string_construct_common): Likewise, for ICASE arg.
2197         * regexec.c (re_search_2_stub, re_search_stub):
2198         Likewise, for RET_LEN arg.
2199         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2200         (set_regs): Likewise, for FL_BACKTRACK arg.
2201         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2202         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2203         (calc_eclosure_iter, parse_bracket_exp):
2204         Use bool for internal variables that are booleans.
2205         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2206         (set_regs, build_sifted_states, sift_states_bkref):
2207         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2208         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2209         (find_collation_sequence_value):
2210         Likewise.
2211         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2212         (re_node_set_compare):
2213         Return bool, not int. All callers changed.
2214         * regexec.c (check_halt_node_context, check_dst_limits):
2215         (build_trtable, check_node_accept): Likewise.
2216         * regex_internal.h: Include stdbool.h.
2217
2218         Fix bugs uncovered when converting to bool.
2219         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2220         failure instead of charging ahead blindly.
2221         * regex_internal.c (register_state): Likewise.
2222         * regexec.c (re_search_2_stub): Use simpler method than boolean
2223         for freeing internal storage.
2224         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2225         bitset pieces used as boolean, to avoid undefined behavior
2226         on hosts that do int overflow checking.
2227
2228 2005-08-31  Derek Price  <derek@ximbiot.com>
2229
2230         * getdelim.c (getdelim): Return EOF on EOF.
2231         Reported by Larry Jones <lawrence.jones@ugs.com>.
2232
2233 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2234
2235         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2236         lengths fit in regoff_t; this isn't true if regoff_t is the same
2237         width as size_t.
2238         * regex.c (re_search_internal): 5th arg is LAST_START
2239         (= START + RANGE) instead of RANGE.  This avoids overflow
2240         problems when regoff_t is the same width as size_t.
2241         All callers changed.
2242         (re_search_2_stub): Check for overflow when adding the
2243         sizes of the two strings.
2244         (re_search_stub): Check for overflow when adding START
2245         to RANGE; if it occurs, substitute the extreme value.
2246
2247 2005-08-31  Jim Meyering  <jim@meyering.net>
2248
2249         * regcomp.c (search_duplicated_node): Make first pointer arg
2250         a pointer-to-const.
2251         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2252         (register_state): Likewise.
2253         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2254         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2255         (group_nodes_into_DFAstates): Likewise.
2256
2257 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2258
2259         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2260         old glibc regex code mishandles strings longer than 2**31 bytes.
2261         This patch fixes this when the regex code is used in gnulib
2262         (i.e., outside glibc).
2263
2264         This patch should not affect the use of the regex code inside
2265         glibc.  No doubt this problem also needs to be handled for glibc
2266         as well, but the result will be an incompatible change to the
2267         glibc ABI, and the old ABI will have to be supported too.  That
2268         can be the the subject for another patch.
2269
2270         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2271         governing whether the rest of this patch is active.  By default,
2272         the macro is disabled and the patch has no effect.
2273         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2274         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2275         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2276         (re_match_2, re_set_registers): Use the new types.
2277         * regex_internal.h (Idx, re_hashval_t): New types.
2278         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2279         New macros.
2280         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2281         (re_string_context_at, bin_tree_t, re_dfastate_t):
2282         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2283         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2284         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2285         (re_string_char_size_at, re_string_wchar_at):
2286         (re_string_elem_size_at):
2287         Use the new types and macros to port to 64-bit hosts.
2288         Use unsigned types for internal values, so that the code
2289         mostly works even for arrays larger than SSIZE_MAX.
2290         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2291         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2292         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2293         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2294         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2295         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2296         (calc_inveclosure, parse_dup_op, build_range_exp):
2297         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2298         (fetch_number, create_token_tree, mark_opt_subexp):
2299         Likewise.
2300         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2301         (create_cd_newstate, re_string_allocate, re_string_construct):
2302         (re_string_realloc_buffers, build_wcs_upper_buffer):
2303         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2304         (re_string_reconstruct, re_string_peek_byte_case):
2305         (re_string_fetch_byte_case, re_string_context_at):
2306         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2307         (re_node_set_init_copy, re_node_set_add_intersect):
2308         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2309         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2310         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2311         (re_acquire_state, re_acquire_state_context, register_state):
2312         Likewise.
2313         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2314         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2315         (re_search_internal, re_search_2_stub, re_search_stub)
2316         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2317         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2318         (update_cur_sifted_state, check_dst_limits):
2319         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2320         (check_subexp_limits, sift_states_bkref, merge_state_array):
2321         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2322         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2323         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2324         (expand_bkref_cache, check_node_accept_bytes):
2325         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2326         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2327         (acquire_init_state_context, check_halt_node_context):
2328         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2329         (sift_states_backward, clean_state_log_if_needed):
2330         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2331         (find_recover_state, transit_state_sb, transit_state_mb):
2332         (transit_state_bkref, build_trtable, match_ctx_clean):
2333         Likewise.
2334         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2335         to work around an assumption that REG_MISSING is negative.
2336
2337         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2338         (seek_collating_symbol_entry) [defined _LIBC]:
2339         (lookup_collation_sequence_value) [defined _LIBC]:
2340         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2341         Use prototypes rather than old-style function definitions.
2342         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2343         (transit_state_sb) [0]:
2344         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2345
2346         * regexec.c (re_search_internal): Simplify update of rm_so and
2347         rm_eo.
2348
2349         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2350         (optimize_subexps, lower_subexp):
2351         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2352         since the signed shift might overflow.  Use 1u<<31 instead.
2353         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2354         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2355         Likewise.
2356
2357         * regcomp.c (optimize_subexps, lower_subexp):
2358         Use CHAR_BIT rather than 8, for clarity.
2359         * regexec.c (check_dst_limits_calc_pos_1):
2360         (check_subexp_matching_top): Likewise.
2361         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2362         have to worry about portability issues when shifting it left.
2363         Remove no-longer-needed test for table_size > 0.
2364         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2365         in a word, as the resulting behavior is undefined.
2366         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2367         in one case, a <= should have been an <, and in another case the
2368         whole test was missing.
2369         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2370         the standard name CHAR_BIT.
2371         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2372         this is not true on one's complement and signed-magnitude hosts.
2373
2374         * regex_internal.h (re_sub_match_top_t): Remove unused member
2375         next_last_offset.
2376         (struct re_dfa_t): Remove unused member states_alloc.
2377         * regcomp.c (init_dfa): Don't initialize unused members.
2378
2379 2005-08-31  Bruno Haible  <bruno@clisp.org>
2380
2381         * strstr.c: Include <stddef.h>, for NULL.
2382         * strcasestr.c: Likewise.
2383         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2384
2385 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2386
2387         * iconvme.h: Add prototype for iconv_alloc.
2388
2389 2005-08-29  Simon Josefsson  <jas@extundo.com>
2390
2391         * iconvme.c: Fix errno.
2392
2393 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2394
2395         * iconvme.c: Split iconv_string into iconv_alloc.
2396
2397 2005-08-27  Jim Meyering  <jim@meyering.net>
2398
2399         * fopen-safer.c: Merge minor changes from coreutils.
2400         * dup-safer.c: Likewise.
2401         * fd-safer.c: Likewise.
2402
2403         Merge from coreutils.
2404         * stdio--.h: New file.
2405         * stdlib--.h: New file.
2406         * mkstemp-safer.c: New file.
2407
2408         GNU tar needs these.
2409         * pipe-safer.c: New file.
2410         * creat-safer.c: New file.
2411         * fcntl--.h (creat): Define to creat_safer.
2412         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2413         * unistd--.h (pipe): Define to pipe_safer.
2414         * unistd-safer.h: Declare pipe_safer.
2415
2416 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2417
2418         * regex_internal.h: Remove all references to
2419         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2420         or better.
2421         (bitset_not, bitset_merge, bitset_not_merge):
2422         (bitset_mask, re_string_allocate, re_string_construct):
2423         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2424         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2425         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2426         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2427         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2428         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2429         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2430         (re_acquire_state_context):
2431         Remove unnecessary forward decls.
2432         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2433         Put __attribute at function definition,
2434         now that the function decl has been removed.
2435         * lib/regex_internal.c (re_string_peek_byte_case):
2436         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2437         Likewise.
2438
2439 2005-08-26  Simon Josefsson  <jas@extundo.com>
2440
2441         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2442         Haible <bruno@clisp.org>.
2443
2444 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2445
2446         * regexec.c (set_regs): Don't alloca with an unbounded size.
2447
2448         alloca modernization/simplification for regex.
2449         * regex.c: Remove portability cruft for alloca.  This no longer
2450         needs to be at the start of the file, and can be moved into
2451         regex_internal.h and simplified.
2452         * regex_internal.h: Include <alloca.h>.
2453         (__libc_use_alloca) [!defined _LIBC]: New macro.
2454         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2455         now works outside glibc.
2456
2457 2005-08-24  Simon Josefsson  <jas@extundo.com>
2458
2459         * getpass.c: Add WIN32 implementation.  Conditionalize use of
2460         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
2461         GLIBC specific code.
2462
2463 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2464
2465         Make regex safe for g++.  This fixes one real bug (an "err"
2466         that should have been "*err").  g++ problem reported by
2467         Sam Steingold.
2468         * regex_internal.h (re_calloc): New macro, consistent with
2469         re_malloc etc.  All callers of calloc changed to use re_calloc.
2470         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2471         not int.  All callers changed.
2472         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2473         just use an array of size MB_LEN_MAX.
2474         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2475         (find_recover_state): Change "err" to "*err"; this fixes what
2476         appears to be a real bug.
2477         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2478         versus int.
2479
2480 2005-08-25  Jim Meyering  <jim@meyering.net>
2481
2482         * open-safer.c: Include <config.h>.
2483         Otherwise, we'd lose LARGEFILE support in any file using
2484         e.g. "fcntl--.h"
2485
2486 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2487
2488         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2489         * regex.h (regerror): Likewise.
2490
2491         * regex.c: Do not include <sys/types.h>, as POSIX no longer
2492         requires this.  (The code never needed it.)
2493
2494         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2495         All uses of recently-renamed identifiers changed to use the new,
2496         POSIX-compliant names.  The code will build and run just fine
2497         without these changes, but it's better to eat our own dog food
2498         and use the standard-conforming names.
2499
2500         * regex.h: Fix a multitude of POSIX name space violations.
2501         These changes have an effect only for programs that define
2502         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2503         do not change anything for programs compiled in the normal way.
2504         Also, there is no effect on the ABI.
2505
2506         (_REGEX_SOURCE): New macro.
2507         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2508         defined and _GNU_SOURCE is not; this fixes a name space violation.
2509
2510         Rename the following macros to obey POSIX requirements.
2511         The old names are still visible as macros if _REGEX_SOURCE is defined.
2512         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2513         RE_BACKSLASH_ESCAPE_IN_LISTS.
2514         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2515         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2516         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2517         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2518         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2519         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2520         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2521         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2522         (REG_INTERVALS): renamed from RE_INTERVALS.
2523         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2524         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2525         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2526         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2527         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2528         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2529         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2530         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2531         RE_UNMATCHED_RIGHT_PAREN_ORD.
2532         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2533         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2534         (REG_DEBUG): renamed from RE_DEBUG.
2535         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2536         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
2537         unusual, since we can't clash with the POSIX REG_ICASE.
2538         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2539         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2540         (REG_NO_SUB): renamed from RE_NO_SUB.
2541         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2542         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2543         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2544         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2545         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2546         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2547         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2548         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2549         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2550         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2551         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2552         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2553         RE_SYNTAX_POSIX_MINIMAL_BASIC.
2554         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2555         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2556         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2557         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
2558         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2559         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2560         (REG_FIXED): Renamed from REGS_FIXED.
2561         (REG_NREGS): Renamed from RE_NREGS.
2562
2563         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2564         of other REG_* macros, since POSIX says the user is allowed to
2565         #undef these macros selectively.
2566
2567         (reg_errcode_t): Update comment stating what other tables need
2568         to be consistent.
2569
2570         Rename the following enum values to obey POSIX requirements.
2571         The old names are still visible as macros.
2572         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
2573         is not defined, since GNU is supposed to be a superset of POSIX as
2574         much as possible, and since we want reg_errcode_t to be a signed
2575         type for implementation consistency.
2576         (_REG_NOERROR): Renamed from REG_NOERROR.
2577         (_REG_NOMATCH): Renamed from REG_NOMATCH.
2578         (_REG_BADPAT): Renamed from REG_BADPAT.
2579         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2580         (_REG_ECTYPE): Renamed from REG_ECTYPE.
2581         (_REG_EESCAPE): Renamed from REG_EESCAPE.
2582         (_REG_ESUBREG): Renamed from REG_ESUBREG.
2583         (_REG_EBRACK): Renamed from REG_EBRACK.
2584         (_REG_EPAREN): Renamed from REG_EPAREN.
2585         (_REG_EBRACE): Renamed from REG_EBRACE.
2586         (_REG_BADBR): Renamed from REG_BADBR.
2587         (_REG_ERANGE): Renamed from REG_ERANGE.
2588         (_REG_ESPACE): Renamed from REG_ESPACE.
2589         (_REG_BADRPT): Renamed from REG_BADRPT.
2590         (_REG_EEND): Renamed from REG_EEND.
2591         (_REG_ESIZE): Renamed from REG_ESIZE.
2592         (_REG_ERPAREN): Renamed from REG_ERPAREN.
2593         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
2594         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
2595         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
2596         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
2597
2598         (_REG_RE_NAME, _REG_RM_NAME): New macros.
2599         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
2600         changed.  But support the old name if the new one is not defined
2601         and if _REGEX_SOURCE.
2602
2603         Change the following member names in struct re_pattern_buffer.
2604         The old names are still supported if !_REGEX_SOURCE.
2605         The new names are always supported, regardless of _REGEX_SOURCE.
2606         (re_buffer): Renamed from buffer.
2607         (re_allocated): Renamed from allocated.
2608         (re_used): Renamed from used.
2609         (re_syntax): Renamed from syntax.
2610         (re_fastmap): Renamed from fastmap.
2611         (re_translate): Renamed from translate.
2612         (re_can_be_null): Renamed from can_be_null.
2613         (re_regs_allocated): Renamed from regs_allocated.
2614         (re_fastmap_accurate): Renamed from fastmap_accurate.
2615         (re_no_sub): Renamed from no_sub.
2616         (re_not_bol): Renamed from not_bol.
2617         (re_not_eol): Renamed from not_eol.
2618         (re_newline_anchor): Renamed from newline_anchor.
2619
2620         Change the following member names in struct re_registers.
2621         The old names are still supported if !_REGEX_SOURCE.
2622         The new names are always supported, regardless of _REGEX_SOURCE.
2623         (rm_num_regs): Renamed from num_regs.
2624         (rm_start): Renamed from start.
2625         (rm_end): Renamed from end.
2626
2627         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
2628         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
2629         Prepend __ to parameter names.
2630
2631         Undo yesterday's changes.
2632
2633 2005-08-24  Jim Meyering  <jim@meyering.net>
2634
2635         Sync from coreutils.
2636         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
2637
2638 2005-08-21  Bruno Haible  <bruno@clisp.org>
2639
2640         * lock.h: Add multiple inclusion guard.
2641         * tls.h: Add multiple inclusion guard.
2642
2643 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2644
2645         * regex.h (REG_NOSYS)
2646         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
2647         Define, since POSIX requires it as of 2001.
2648         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
2649         New private symbol, used to keep the enum signed in all cases.
2650         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
2651         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
2652
2653         * regex_internal.c (re_string_skip_chars, register_state):
2654         (calc_state_hash):
2655         Remove forward decls; no longer needed now that we use prototypes.
2656         * regexec.c (acquire_init_state_context, check_halt_node_context):
2657         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
2658         (clean_state_log_if_needed): Likewise.
2659
2660 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2661
2662         Fix problems reported by Sam Steingold in
2663         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
2664         * regexec.c (sift_states_bkref): Fix portability bug: the code
2665         assumed that reg_errcode_t is a signed type, which is not
2666         necessarily true if _XOPEN_SOURCE is not defined.
2667         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
2668         some compilers warn about it otherwise.
2669
2670 2005-08-20  Jim Meyering  <jim@meyering.net>
2671
2672         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2673         of unused local, dfa.
2674
2675 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2676
2677         * regcomp.c (create_initial_state): Remove duplicate decl.
2678         (init_word_char, create_initial_state, duplicate_node_closure):
2679         (fetch_token, peek_token_bracket, build_range_exp):
2680         (build_collating_symbol): Remove forward decls; no longer needed
2681         now that we use prototypes.
2682
2683         * regcomp.c:
2684         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
2685         (re_compile_fastmap_iter, regcomp, regerror, regfree):
2686         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
2687         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
2688         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
2689         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
2690         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
2691         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
2692         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
2693         (build_range_exp, build_collating_symbol, parse_bracket_exp):
2694         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
2695         (build_charclass, build_charclass_op, fetch_number, create_tree):
2696         (create_token_tree, mark_opt_subexp, duplicate_tree):
2697         Use prototypes rather than old-style definitions.
2698
2699         * regex_internal.c:
2700         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
2701         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
2702         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2703         (re_string_reconstruct, re_string_peek_byte_case):
2704         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
2705         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2706         (re_node_set_init_copy, re_node_set_add_intersect):
2707         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2708         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2709         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2710         (re_acquire_state, re_acquire_state_context, register_state):
2711         (create_ci_newstate, create_cd_newstate, free_state):
2712         Likewise.
2713         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
2714         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
2715         (re_search_internal, prune_impossible_nodes):
2716         (acquire_init_state_context, check_matching, static):
2717         (check_halt_node_context, check_halt_state_context, proceed_next_node):
2718         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
2719         (update_regs, sift_states_backward, build_sifted_states):
2720         (clean_state_log_if_needed, merge_state_array):
2721         (update_cur_sifted_state, add_epsilon_src_nodes):
2722         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
2723         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
2724         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
2725         (find_recover_state, check_subexp_matching_top, transit_state_mb):
2726         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
2727         (check_arrival, check_arrival_add_next_nodes):
2728         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2729         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2730         (check_node_accept_bytes, check_node_accept, extend_buffers):
2731         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
2732         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
2733         (sift_ctx_init):
2734         Likewise.
2735
2736         * regex_internal.h:
2737         (re_string_allocate, re_string_construct, re_string_reconstruct):
2738         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
2739         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
2740         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
2741         (re_string_context_at, re_string_peek_byte_case):
2742         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
2743         is defined, since we now use prototypes always.
2744
2745         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
2746         C89 or better.  All uses removed.
2747
2748 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2749
2750         * regex_internal.c (re_acquire_state, re_acquire_state_context)
2751         [defined lint]: Suppress bogus uninitialized-variable warnings.
2752
2753         * regcomp.c (duplicate_node): Return new index, not an error code,
2754         and let the caller return REG_ESPACE if out of space.  This
2755         removes an uninitialied-variable warning with GCC 4.0.1, and also
2756         avoids taking the address of a local variable.  All callers
2757         changed.
2758
2759 2005-08-19  Jim Meyering  <jim@meyering.net>
2760
2761         * regexec.c (proceed_next_node): Redo local variables to
2762         avoid GCC shadowing warnings.
2763
2764 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2765
2766         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
2767         (re_node_set_insert_last, re_dfa_add_node):
2768         Rename local variables to avoid GCC shadowing warnings.
2769
2770 2005-08-18  Bruno Haible  <bruno@clisp.org>
2771
2772         * strstr.c (strstr): Fix return value in multibyte case.
2773         * strcasestr.c (strcasestr): Likewise.
2774
2775 2005-08-17  Jim Meyering  <jim@meyering.net>
2776
2777         Make the %s format (seconds since the epoch) work for a negative
2778         number and when used with a zero-padded field width, e.g. %015s.
2779
2780         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
2781         label so that it precedes the code to set `digits'.  Otherwise,
2782         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
2783         print `00-22'.  Now, it prints `-0022', as it should.
2784
2785 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2786
2787         * regex.h: Remove useless space-before-tab.  From coreutils.
2788
2789 2005-08-17  Bruno Haible  <bruno@clisp.org>
2790
2791         * strcasestr.h: New file.
2792         * strcasestr.c: New file.
2793
2794 2005-08-17  Bruno Haible  <bruno@clisp.org>
2795
2796         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
2797         * strstr.c: Completely rewritten, with multibyte locale support.
2798
2799 2005-08-17  Bruno Haible  <bruno@clisp.org>
2800
2801         * strcasecmp.c: Use mbuiter.h.
2802
2803 2005-08-17  Bruno Haible  <bruno@clisp.org>
2804
2805         * mbuiter.h: New file.
2806
2807 2005-08-16  Bruno Haible  <bruno@clisp.org>
2808
2809         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
2810         (mbi_init): Update.
2811         (mbi_avail, mbi_advance): Let the iteration end before the terminating
2812         NUL byte, not after it.
2813
2814 2005-08-16  Bruno Haible  <bruno@clisp.org>
2815
2816         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
2817         the valid ones. Makes the comparison operations transitive:
2818         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
2819         * strcasecmp.c (strcasecmp): Use mb_casecmp.
2820
2821 2005-08-16  Bruno Haible  <bruno@clisp.org>
2822
2823         * strcase.h (strcasecmp): Add note in comments.
2824         * strncasecmp.c: Use code from strcasecmp.c.
2825         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
2826         (strcasecmp): Work correctly in multibyte locales.
2827
2828 2005-08-16  Bruno Haible  <bruno@clisp.org>
2829
2830         * strnlen1.h: New file.
2831         * strnlen1.c: New file.
2832
2833 2005-08-16  Bruno Haible  <bruno@clisp.org>
2834
2835         * mbfile.h: New file.
2836
2837 2005-08-16  Bruno Haible  <bruno@clisp.org>
2838
2839         * mbiter.h: New file.
2840
2841 2005-08-16  Bruno Haible  <bruno@clisp.org>
2842
2843         * mbchar.h: New file.
2844         * mbchar.c: New file.
2845
2846 2005-08-16  Bruno Haible  <bruno@clisp.org>
2847
2848         * tls.h: New file, from GNU gettext.
2849         * tls.c: New file, from GNU gettext.
2850
2851 2005-08-15  Bruno Haible  <bruno@clisp.org>
2852
2853         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
2854         is defined.
2855
2856 2005-08-14  Jim Meyering  <jim@meyering.net>
2857
2858         Sync from coreutils.
2859
2860         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
2861         Use the hash-table-based cycle-detection code not just when
2862         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
2863         Reported by James Youngman in
2864         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
2865         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2866         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2867         This lets us compile with -DFTS_DEBUG, once again.
2868         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
2869         * fts.c (fd_safer): Remove decl.
2870         Include fcntl--.h rather than unistd-safer.h
2871         (fts_safe_changedir): Don't call fd_safer; no longer needed
2872         now that we include fcntl--.h.
2873
2874 2005-08-11  Simon Josefsson  <jas@extundo.com>
2875
2876         * readline.h, readline.c: New file.
2877
2878 2005-08-11  Bruno Haible  <bruno@clisp.org>
2879
2880         * strnlen.h (strnlen): Change parameter name to match comment.
2881
2882 2005-08-10  Simon Josefsson  <jas@extundo.com>
2883
2884         * strndup.c: Use strnlen.h.
2885
2886         * strnlen.h: New file.
2887
2888 2005-08-02  Simon Josefsson  <jas@extundo.com>
2889
2890         * getline.h, getline.c: Rewrite.
2891
2892         * getdelim.h, getdelim.c: New files, ported from glibc.
2893
2894 2005-07-31  Bruno Haible  <bruno@clisp.org>
2895
2896         * lock.h (gl_lock_initializer): New macro.
2897         (gl_lock_define_initialized): Use it.
2898         (gl_rwlock_initializer): New macro.
2899         (gl_rwlock_define_initialized): Use it.
2900         (gl_recursive_lock_initializer): New macro.
2901         (gl_recursive_lock_define_initialized): Use it.
2902
2903 2005-07-26  Bruno Haible  <bruno@clisp.org>
2904
2905         * lock.h: Update from GNU gettext.
2906         * lock.c: Update from GNU gettext.
2907
2908 2005-07-18  Bruno Haible  <bruno@clisp.org>
2909
2910         * lock.h (gl_once_t): New type.
2911         (gl_once_define, gl_once): New macros.
2912         * lock.c (fresh_once): New variable.
2913         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
2914         functions.
2915
2916 2005-07-18  Simon Josefsson  <jas@extundo.com>
2917
2918         * check-version.c (check_version): Accept identical versions too.
2919
2920 2005-07-18  Bruno Haible  <bruno@clisp.org>
2921
2922         * lock.h: New file, from GNU gettext.
2923         * lock.c: New file, from GNU gettext.
2924
2925 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
2926
2927         * quotearg.c: Add translator comment suggested by Bruno Haible,
2928         with a minor change.
2929
2930 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2931
2932         * version-etc-fsf.c (version_etc_copyright): Parameterize the
2933         copyright symbol and the year.
2934         * version-etc.c (COPYRIGHT_YEAR): New constant.
2935         (version_etc_va): Use parameterized copyright notice.
2936         Reword to conform to the current GNU coding standards.
2937
2938 2005-07-11  Simon Josefsson  <jas@extundo.com>
2939
2940         * size_max.h: New file.
2941
2942 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2943
2944         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
2945         block of defines.
2946
2947 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
2948        and  Paul Eggert  <eggert@cs.ucla.edu>
2949
2950         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2951         in wint_t, not wchar_t.  Remove now-unnecessary cast.
2952
2953 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2954
2955         * regex.c, regex.h: Sync from libc.
2956         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
2957         New files, synced from libc, except that regex_internal.h
2958         currently has a small porting fix.
2959
2960 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
2961
2962         Remove the dependency of the strftime module on the tzset module.
2963         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2964         Copy the input structure, to work around some of the bug with
2965         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
2966         Solaris releases, you should also use the tzset module, but we won't
2967         require it as a dependency any more since we don't want LGPLed code
2968         to depend on GPLed code.
2969
2970 2005-07-02  Jim Meyering  <jim@meyering.net>
2971
2972         * backupfile.c (backup_args): Change a `0' to NULL.
2973
2974 2005-07-01  Jim Meyering  <jim@meyering.net>
2975
2976         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2977         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
2978         * save-cwd.c, tempname.c:
2979         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2980         and don't include <sys/file.h>).
2981
2982 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
2983
2984         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2985         declares only 'struct timespec;' (!).
2986
2987 2005-06-29  Jim Meyering  <jim@meyering.net>
2988
2989         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2990         type name.  Use the variable name instead.
2991         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2992
2993 2005-06-28  Simon Josefsson  <jas@extundo.com>
2994
2995         * check-version.h, check-version.c: New files.
2996
2997 2005-06-28  Simon Josefsson  <jas@extundo.com>
2998
2999         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3000         collision with global variable.  Better indentation.  Don't
3001         increment buffer pointer beyond buffer end.  Based on comments
3002         from Paul Eggert <eggert@cs.ucla.edu>.
3003
3004         * base64.h: Indent.
3005
3006 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3007
3008         * canon-host.c (canon-host): Append trailing "," to 0 in
3009         initializer of struct addrinfo, as an indication that we don't
3010         care how many members the structure has.
3011
3012 2005-06-24  Derek Price  <derek@ximbiot.com>
3013         and Bruno Haible  <bruno@clisp.org>
3014
3015         Remove stat module & update lstat.
3016         * stat.c: Remove this file...
3017         (slash_aware_lstat): ...moving this content and its support...
3018         * lstat.c (rpl_lstat): ...into here.
3019         * lstat.h: New file.
3020
3021 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3022
3023         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3024         (ranged_convert): Don't save conversion in a temporary struct.
3025         This causes a warning with GCC 4.0.0, and anyway in the typical
3026         case it's not worth the extra 100 bytes or so of code.
3027         (ranged_convert, __mktime_internal): When calling a function via a
3028         pointer P, use P () rather than (*P) (), as we now assume C89 or
3029         better.
3030
3031 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3032
3033         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3034         "who -r" failed to give output.  Problem reported by Tim Waugh.
3035
3036         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3037         (xcalloc): Use it to avoid needless tests.
3038         Problem reported by Jim Meyering.
3039
3040 2005-06-16  Jim Meyering  <jim@meyering.net>
3041
3042         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3043         when either N or S is zero.
3044
3045 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3046
3047         * argp.h (__option_is_short): Check upper limit of
3048         __key. Isprint() requires its argument to have the value
3049         of an unsigned char or EOF.
3050
3051 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3052
3053         * fnmatch.c (fnmatch): If there is an encoding error in a
3054         multibyte string or pattern, fall back on unibyte matching.
3055         Problem reported by James Youngman.
3056
3057 2005-06-08  Bruno Haible  <bruno@clisp.org>
3058
3059         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3060         warning on mingw.
3061
3062 2005-06-08  Bruno Haible  <bruno@clisp.org>
3063
3064         * csharpcomp.h: New file, from GNU gettext.
3065         * csharpcomp.c: New file, from GNU gettext.
3066         * csharpcomp.sh.in: New file, from GNU gettext.
3067
3068 2005-06-07  Derek Price  <derek@ximbiot.com>
3069
3070         Sync from CVS.
3071         * glob_.h: Indent nested #ifdef.
3072
3073 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3074
3075         Sync from coreutils.
3076         Use "file name" when talking about file names, instead of "filename"
3077         or "path", as per the GNU coding standards.
3078         * mkdir-p.c: Renamed from makepath.c.
3079         (make_dir_parents): Renamed from make_path.  All callers changed.
3080         * mkdir-p.h: Likewise.  All includers changed.
3081         * filenamecat.c: Renamed from path-concat.c.
3082         (file_name_concat): Renamed from path_concat.  All callers changed.
3083         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3084         * filenamecat.h: Likewise.  All includers changed.
3085         * acl.c: Don't use "path" or "filename" to mean "file name"
3086         in comments or local variable names.
3087         * basename.c: Likewise.
3088         * canonicalize.c, canonicalize.h: Likewise.
3089         * dirname.c, dirname.h: Likewise.
3090         * euidaccess.c: Likewise.
3091         * exclude.c: Likewise
3092         * fnmatch_.h, fnmatch_loop.c: Likewise.
3093         * fsusage.c, fsuage.h: Likewise.
3094         * fts.c, fts_.h: Likewise.
3095         * getcwd.c: Likewise.
3096         * getloadavg.c: Likewise.
3097         * mkstemp.c: Likewise.
3098         * mountlist.c, mountlist.h: Likewise.
3099         * openat.c, openat.h: Likewise.
3100         * readlink-stub.c: Likewise.
3101         * readutmp.c, readutmp.h: Likewise.
3102         * rename.c: Likewise.
3103         * rmdir.c: Likewise.
3104         * same.c: Likewise.
3105         * savedir.c: Likewise.
3106         * stripslash.c: Likewise.
3107         * tempname.c: Likewise.
3108         * xreadlink.c: Likewise.
3109         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3110         All uses changed.
3111         * exclude.h: Likewise.
3112
3113         * euidaccess.c (getuid, getgid, getuid, getegid)
3114         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3115         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3116         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3117         * pathmax.h: Include <limits.h> unconditionally, since other
3118         files have been getting away with it for years (MORE/BSD 4.3
3119         is extinct now).
3120         * userspec.c (getpwnam, getgrnam, getgrgid)
3121         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3122
3123         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3124         Define to 256, not 255, as per modern POSIX.
3125
3126 2005-06-01  Bruno Haible  <bruno@clisp.org>
3127
3128         * csharpexec.h: New file, from GNU gettext.
3129         * csharpexec.c: New file, from GNU gettext.
3130         * csharpexec.sh.in: New file, from GNU gettext.
3131
3132 2005-05-31  Derek Price  <derek@ximbiot.com>
3133             Paul Eggert  <eggert@cs.ucla.edu>
3134
3135         Sync from cvs.
3136         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3137
3138 2005-05-29  Derek Price  <derek@ximbiot.com>
3139             Paul Eggert  <eggert@cs.ucla.edu>
3140
3141         * glob_.h, glob.c: New files.
3142
3143 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3144
3145         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3146
3147         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3148         the configuration hassle isn't worth it.
3149         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3150         (LONGEST_MODIFIER, PRIuMAX): Remove.
3151
3152 2005-05-27  Bruno Haible  <bruno@clisp.org>
3153
3154         * getlogin_r.h: Remove second include of <stddef.h>.
3155
3156 2005-05-25  Bruno Haible  <bruno@clisp.org>
3157             Derek Price  <derek@ximbiot.com>
3158
3159         * getlogin_r.h: Simplify API documentation.
3160
3161 2005-05-25  Derek Price  <derek@ximbiot.com>
3162             Paul Eggert  <eggert@cs.ucla.edu>
3163
3164         * getlogin_r.c, getlogin_r.h: New files.
3165
3166 2005-05-22  Bruno Haible  <bruno@clisp.org>
3167
3168         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3169         Also include <sys/param.h> if it defines MIN, MAX.
3170         Based on a patch by Derek Price <derek@ximbiot.com>.
3171
3172 2005-05-22  Bruno Haible  <bruno@clisp.org>
3173
3174         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3175         (INT64_MIN): Fix definition.
3176         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3177
3178         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3179         NEED_SIGNED_INT_TYPES.
3180
3181         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3182         HAVE_SYSTEM_INTTYPES.
3183
3184 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3185
3186         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3187         so that unistd-safer.h (GPL'ed code) need not be included.
3188
3189 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3190
3191         New fts module.
3192         * fts.c: Don't include "cycle-check.h" or "hash.h".
3193         (setup_dir, free_dir): New functions.
3194         (enter_dir, leave_dir): Define trivial
3195         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3196         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3197         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3198         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3199         Move to fts-cycle.c.
3200         (fts_open): Use setup_dir.
3201         (fts_close): Use free_dir.
3202         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3203         This adds a label and some gotos, but the alternatives were messier.
3204         Check for memory allocation failure when entering a dir.
3205         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3206         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3207         (FTS): New member fts_cycle, that is a union that contains the
3208         old active_dir_ht and cycle_state.  All uses changed to mention
3209         fts_cycle.ht and fts_cycle.state.
3210         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3211         fts.c, with the following changes:
3212         (setup_dir, free_dir): New functions.
3213         (enter_dir): Now returns bool.  Return true if successful, false
3214         if memory exhausted.  All callers changed.
3215         Do not bother partly cleaning up on
3216         memory allocation failure; that is free_dir's job.
3217         However, free ad if hash_insert fails, to avoid memory leak.
3218         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3219         fts->fts_options to see which union member to use.
3220
3221 2005-05-20  Jim Meyering  <jim@meyering.net>
3222
3223         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3224         Now a macro, to pacify GCC.
3225
3226 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3227
3228         * chown.c (rpl_chown): Return -1 on failure.
3229
3230 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3231
3232         * canonicalize.c: Include canonicalize.h first, to test interface.
3233         Include <stddef.h> unconditionally, since we assume C89 now.
3234         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3235         * fts.c: Include fts_.h first, to check interface.
3236         Do not include intprops.h; no longer needed.
3237         Include cycle-check.h and hash.h, since fts_.h no longer does.
3238         Remove unnecessary casts of closedir to void.
3239         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3240         decide whether to decrement nlinks.
3241         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3242         (FTS): Use struct hash_table * instead of Hash_table, so that
3243         we no longer need to include hash.h here.
3244
3245 2005-05-17  Jim Meyering  <jim@meyering.net>
3246
3247         * fts.c, fts_.h: New files, from coreutils.
3248
3249 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3250
3251         Sync from coreutils.
3252         * unlinkdir.c, unlinkdir.h: New files.
3253         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3254         regex.h, unlocked-io.h, xtime.h:
3255         White space changes only.
3256         * makepath.c (make_path): Port to hosts where leading "//" is special.
3257         * yesno.c: Include getline.h, not ctype.h.
3258         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3259         Use getline to remove arbitrary restriction on response length.
3260
3261 2005-05-13  Bruno Haible  <bruno@clisp.org>
3262
3263         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3264         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3265         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3266         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3267         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3268         Add support for 64-bit integers in the MSVC compiler.
3269
3270 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3271
3272         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3273         Change the initial comment to refer to GPL, not LGPL.
3274         gnulib-tool will change it to LGPL as needed.
3275
3276         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3277         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3278         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3279         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3280         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3281         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3282         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3283         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3284         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3285         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3286         concatpath.c, config.charset, copy-file.c, copy-file.h,
3287         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3288         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3289         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3290         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3291         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3292         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3293         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3294         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3295         full-read.c, full-read.h, full-write.c, full-write.h,
3296         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3297         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3298         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3299         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3300         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3301         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3302         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3303         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3304         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3305         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3306         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3307         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3308         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3309         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3310         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3311         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3312         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3313         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3314         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3315         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3316         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3317         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3318         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3319         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3320         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3321         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3322         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3323         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3324         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3325         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3326         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3327         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3328         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3329         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3330         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3331         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3332         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3333         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3334         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3335         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3336         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3337         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3338         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3339         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3340         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3341         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3342         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3343         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3344         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3345         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3346         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3347         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3348         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3349         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3350         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3351         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3352         Update FSF postal mail address.
3353
3354 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3355
3356         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3357         specified in ai_socktype. Fix invalid ai_protocol
3358         check. ai_protocol is usually set to 0 or depending on
3359         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3360         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3361         ai_socktype / ai_protocol in the returned addrinfo structure.
3362
3363 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3364             Bruno Haible  <bruno@clisp.org>
3365
3366         * inet_ntop.h: New file.
3367         * inet_ntop.c: New file, from glibc with modifications.
3368
3369 2005-05-08  Jim Meyering  <jim@meyering.net>
3370
3371         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3372
3373 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3374
3375         Merge from coreutils.  Among other things,
3376         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3377         * fd-safer.c: New file.
3378         * fcntl-safer.h, open-safer.c: Remove.
3379         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3380         * dup-safer.c: Include unistd-safer.h first.
3381         Don't include errno.h.
3382         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3383         * file-type.h: Don't assume invoker included sys/stat.h first.
3384         * file-type.c: Rely on file-type.h change.
3385         * getloadavg.c: Include unistd-safer.h.
3386         (getloadavg): Use safer open.
3387         * getusershell.c: Include "stdio-safer.h".
3388         (getusershell): Use safer fopen.
3389         * long-options.c (long_options): Use NULL rather than 0.
3390         * modechange.h (mode_free): Remove; all callers changed to invoke
3391         'free'.
3392         * modechange.c: Likewise.
3393         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3394         (MODE_DONE): New constant.
3395         (struct mode_change): Remove 'next' member.
3396         (make_node_op_equals): New function; like the old one of the
3397         same name, except it allocates an array.
3398         (mode_compile, mode_create_from_ref): Use it.
3399         (mode_compile): Allocate result as an array, not a linked list.
3400         Parse octal string ourself, so that we catch mistakes like "+0".
3401         (mode_adjust): Arg is an array, not a linked list.
3402         * modechange.c: Include stat-macros.h, xalloc.h.
3403         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3404         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3405         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3406         Remove.  This is now stat-macros.h's job.
3407         (talloc): Remove.  All callers replaced by xalloc, so that
3408         our invokers don't have to worry about reporting memory failures.
3409         (make_node_op_equals): Remove.
3410         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3411         New constants.
3412         (struct mode_change): Moved here from modechange.h.
3413         (mode_append_entry): Remove.
3414         (mode_compile): Remove MASKED_OPS arg, since it encouraged
3415         apps to have incorrect behavior.  Use simpler algorithm for head
3416         and tail.  Don't futz with umask; that's now the job of mode_adjust.
3417         Detect more invalid usages rather than having somewhat-random behavior.
3418         Don't insert an "a=" action, as that leads to incorrect behavior.
3419         (mode_compile, mode_create_from_ref): Return NULL on error instead
3420         of an enum, since now there's only one way to have an error.  All
3421         callers changed.
3422         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3423         at the correct time.  Simplify calculation of "+u" and its ilk.
3424         Don't mishandle "+X".
3425         (mode_free): Remove "register" and localize decls.
3426         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3427         (struct mode_change): Move to modechange.c; callers don't
3428         need to see this stuff.
3429         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3430         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3431         (mode_change, mode_adjust): Reflect the new signatures noted above.
3432         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3433         that might redefine system include files.
3434         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3435         (my_usleep): Use NULL rather than (void *) 0.
3436         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3437         Use siginterrupt to specify that system calls should be interrupted.
3438         (rpl_nanosleep): Move initialization of suspended closer to call of
3439         my_usleep.
3440         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
3441         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
3442         (desirable_utmp_entry): New function.
3443         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3444         using x2nrealloc, to simplify logic.
3445         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3446         size calculation.  Do not assume utmp file is a regular file.
3447         * readutmp.h (UT_PID): Moved here from ../src/who.c.
3448         (READ_UTMP_CHECK_PIDS): New constant.
3449         * save-cwd.c: Include unistd-safer.h.
3450         (save_cwd): Use fd_safer.
3451         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3452         [!_LIBC] Include "stat-macros.h" instead.
3453         * unistd-safer.h (fd_safer): New decl.
3454
3455 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
3456
3457         * byteswap_.h: New file.
3458
3459 2005-04-25  Albert Chin  <china@thewrittenword.com>
3460
3461         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3462         Toolkit C bug.
3463
3464 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
3465
3466         * getdate.y (zone): Allow relunit_snumber after tZONE, so
3467         that "UTC +1 second" continues to work.  Problem reported
3468         by Dmitry V. Levin.
3469         (relunit_snumber): New rule.
3470         (relunit): Use it.
3471
3472 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
3473
3474         * getdate.y (universal_time_zone_table): New constant.
3475         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3476         universal_time_zone_table.
3477         (lookup_zone): Prefer universal_time_zone_table to
3478         local_time_zone_table, so that "GMT" time stamps are allowed in
3479         London during the summer.  Problem reported by Ian Abbott.
3480
3481 2005-04-12  Jim Meyering  <jim@meyering.net>
3482
3483         * human.c (humblock): Set *options even when returning due to
3484         xstrtoumax conversion failure.  Thanks to a used-uninitialized
3485         warning from gcc-4.
3486
3487 2005-04-09  Jim Meyering  <jim@meyering.net>
3488
3489         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3490         -Wuninitialized: initialize tm0.tm_year.
3491
3492 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3493
3494         * getdate.y (parser_control): rels_seen is now a boolean, not a
3495         count, since there's no maximum.  All uses changed.
3496         Add member dsts_seen.
3497         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3498         not being INT_MAX.
3499         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3500         Use pc_rels_seen to decide whther a date is absolute.
3501
3502         * getdate.y (number): Don't overwrite year.
3503         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3504         check.
3505
3506 2005-04-02  Simon Josefsson  <jas@extundo.com>
3507
3508         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3509         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3510
3511 2005-03-27  Jim Meyering  <jim@meyering.net>
3512
3513         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3514
3515 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
3516
3517         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3518         "one's complement" -> "ones' complement" in comment, as per Knuth.
3519         "value of type" -> "type or expression" in comment.
3520         * mktime.c, strftime.c: Propagate intprops.h comment nits.
3521
3522 2005-03-26  Jim Meyering  <jim@meyering.net>
3523
3524         Comment nits.
3525         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3526         Correct typos: s/or/of/.
3527
3528 2005-03-23  Jim Meyering  <jim@meyering.net>
3529
3530         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3531
3532 2005-03-21  Jim Meyering  <jim@meyering.net>
3533
3534         Changes imported from coreutils.
3535
3536         * cycle-check.c: Don't include xalloc.h.
3537
3538         * path-concat.c: Don't include assert.h.
3539         (path_concat): Remove assertion that would have triggered
3540         for ABASE starting with more than one slash.
3541         Reported by Andreas Schwab.
3542
3543         * path-concat.c (path_concat): Set *BASE_IN_RESULT
3544         properly when ABASE is an absolute file name.
3545         Correct the description of this function.
3546         Include <assert.h>.
3547         Add an assertion and a test driver.
3548         This fixes a bug introduced on 2004-07-02.
3549         Andreas Schwab reported the resulting failure of cp --parents:
3550         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3551
3552 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
3553
3554         * strftime.c (my_strftime): If the underlying strftime returns 0
3555         (which shouldn't happen), generate nothing instead of returning 0
3556         immediately, so that nstrftime (NULL, ...) doesn't return 0.
3557
3558 2005-03-16  Bruno Haible  <bruno@clisp.org>
3559
3560         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3561
3562 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
3563
3564         * strftime.c (my_strftime): Prepend space to format so that we can
3565         reliably distinguish strftime failure from empty output on POSIX
3566         hosts.
3567
3568 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3569
3570         * iconvme.c (SIZE_MAX): New macro, if not already defined.
3571         (iconv_string): Don't guess a size-zero buffer, as that might cause
3572         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
3573         result would be 'too large', where 'too large' is (heuristically)
3574         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3575         overflow concerns.  This will prevent some unwanted malloc failures
3576         when the inputs are very large.
3577
3578 2005-03-15  Bruno Haible  <bruno@clisp.org>
3579
3580         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3581         'negate'.
3582
3583         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
3584         variable.
3585
3586         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
3587
3588 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
3589
3590         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
3591         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
3592         intprops.h.
3593         * strtol.c: Likewise.
3594
3595 2005-03-14  Simon Josefsson  <jas@extundo.com>
3596
3597         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
3598         <fx@gnu.org>.
3599
3600 2005-03-14  Jim Meyering  <jim@meyering.net>
3601
3602         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
3603         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
3604         to be nonzero so that we (and caller) can detect the difference
3605         between a valid zero-length expansion and an error return, even
3606         when the underlying strftime fails before writing anything into
3607         that location.
3608
3609 2005-03-10  Jim Meyering  <jim@meyering.net>
3610
3611         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
3612         so that this module works on systems without fchdir.
3613
3614 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
3615
3616         Factor int-properties macros into a single file, except for
3617         glibc-related files.
3618         * intprops.h: New file.
3619         * getloadavg.c: Include it instead of limits.h.
3620         (INT_STRLEN_BOUND): Remove.
3621         * human.c: Include intprops.h.
3622         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
3623         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
3624         * inttostr.h: Include intprops.h instead of limits.h.
3625         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
3626         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
3627         for consistency with intprops.h.
3628         (time_t_is_integer, twos_complement_arithmetic): Use them.
3629         * sig2str.h: Include <signal.h>, intprops.h.
3630         (INT_STRLEN_BOUND): Remove.
3631         * strftime.c (TYPE_SIGNED): Remove.
3632         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
3633         * strtol.c: Adjust comments to match intprops.h.
3634         * userspec.c: Include intprops.h.
3635         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
3636         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
3637         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
3638         instead of rolling our own expressions.
3639         * xstrtol.c: Include xstrtol.h first, to test interface.
3640
3641         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
3642         instead of int.
3643         (my_strftime): Do not mishandle years close to INT_MAX, by doing
3644         the right thing even if adding 1900 would overflow.  Similarly
3645         for tm_mon + 1 and tm_yday + 1.
3646         Make %Y always equivalent to %C%y, and similarly for %G and %g.
3647         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
3648         (DO_SIGNED_NUMBER): New macro.
3649         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
3650
3651 2005-03-07  Bruno Haible  <bruno@clisp.org>
3652
3653         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
3654
3655 2005-03-03  Derek R. Price  <derek@ximbiot.com>
3656             Bruno Haible  <bruno@clisp.org>
3657
3658         * pagealign_alloc.h: New file.
3659         * pagealign_alloc.c: New file.
3660
3661 2005-01-28  Bruno Haible  <bruno@clisp.org>
3662
3663         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
3664         stpncpy.c uses it.
3665
3666 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
3667
3668         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
3669         The workaround isn't strictly needed for POSIX conformance, and
3670         it's too much of a pain to configure and maintain.  We'll ask
3671         people to fix their kernels instead.
3672         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
3673         (NANOSLEEP_BUG_WORKAROUND): Remove.
3674         (xnanosleep): Remove the workaround.
3675
3676 2005-02-12  Bruno Haible  <bruno@clisp.org>
3677
3678         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
3679
3680 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
3681
3682         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
3683         * timespec.h (gettime): Return void, since it always
3684         succeeds now.  All uses changed.
3685         * gettime.c (gettime) Likewise.
3686         [HAVE_NANOTIME]: Prefer nanotime.
3687         Assume gettimeofday succeeds, as POSIX requires.
3688         Assime time () succeeds, since other code already does.
3689         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
3690         (timespec_subtract): Remove.
3691         (NANOSLEEP_BUG_WORKAROUND): New constant.
3692         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
3693         things considerably.  Use it only on GNU/Linux hosts, since the
3694         workaround shouldn't be needed elsewhere.
3695
3696 2005-02-24  Bruno Haible  <bruno@clisp.org>
3697
3698         * gettext.h: Update from GNU gettext 0.14.2.
3699
3700 2005-02-24  Bruno Haible  <bruno@clisp.org>
3701
3702         * localcharset.c: Update from GNU gettext 0.14.2.
3703         * config.charset: Update from GNU gettext 0.14.2.
3704
3705 2005-02-22  Simon Josefsson  <jas@extundo.com>
3706
3707         * iconvme.h, iconvme.c: New files, from libc.
3708
3709 2005-02-20  Neil Conway  <neilc@samurai.com>
3710
3711         * xgethostname.c (xgethostname): Check for ENOMEM, which is
3712         returned by OSX/Darwin if the specified buffer is not large
3713         enough for the hostname.
3714
3715 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
3716
3717         * memrchr.h: New file.
3718         * chdir-long.c: Include it.
3719         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
3720         Don't bother including stddef.h.
3721
3722 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3723
3724         * argp-help.c (__argp_help): Create a fake struct argp_state and
3725         pass it to _help, otherwise the latter coredumps trying to
3726         dereference state.root_argp.
3727
3728 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
3729
3730         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
3731         inclusion.
3732         Include <sys/types.h>, for dev_t.
3733         (ME_DUMMY, ME_REMOTE): Move from here....
3734         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
3735         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
3736         Dmitry V. Levin.
3737         Include mountlist.h first, to test the interface.
3738
3739 2005-01-29  Bruno Haible  <bruno@clisp.org>
3740
3741         * progname.c (program_name): Initialize.
3742         Needed when linking statically on MacOS X.
3743
3744 2005-01-28  Bruno Haible  <bruno@clisp.org>
3745
3746         * javacomp.sh.in: New file, from GNU gettext.
3747         * javacomp.h: New file, from GNU gettext.
3748         * javacomp.c: New file, from GNU gettext.
3749
3750 2005-01-26  Bruno Haible  <bruno@clisp.org>
3751
3752         * javaexec.sh.in: New file, from GNU gettext.
3753         * javaexec.h: New file, from GNU gettext.
3754         * javaexec.c: New file, from GNU gettext.
3755
3756 2005-01-26  Simon Josefsson  <jas@extundo.com>
3757
3758         * gai_strerror.c: Use GPL in header.
3759
3760 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3761
3762         * argp-help.c (hol_entry_help): Avoid using non-constant
3763         initializers for struct pentry_state.
3764         (__argp_error): Check return value of __asprintf
3765         (__argp_failure): Translate error message
3766
3767         * argp-parse.c: Removed braces around the expansion of N_()
3768
3769 2005-01-21  Jim Meyering  <jim@meyering.net>
3770
3771         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
3772         same value as for Solaris 9.
3773
3774         * chdir-long.c (chdir_long): Rewrite to remove limitation on
3775         component length.  This included changing the parameter to be
3776         of type `char *' rather than `char const *'.
3777         * chdir-long.h (chdir_long): Update prototype.
3778
3779         * openat.c (fdopendir, fstatat): New functions.
3780         * openat.h: Include headers required for use of DIR and struct stat.
3781         [AT_SYMLINK_NOFOLLOW]: Define.
3782         (fdopendir, fstatat): Add prototypes.
3783
3784 2005-01-21  Bruno Haible  <bruno@clisp.org>
3785
3786         * classpath.h: New file, from GNU gettext.
3787         * classpath.c: New file, from GNU gettext.
3788
3789 2005-01-20  Simon Josefsson  <jas@extundo.com>
3790
3791         * version-etc-fsf.c: New file, with version_etc_copyright.
3792         * version-etc.c: Remove version_etc_copyright.
3793         * version-etc.h (version_etc_copyright): Use [] instead of * in
3794         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
3795
3796 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
3797
3798         * save-cwd.c (save_cwd): Remove code to support the case
3799         where fchdir is missing or flaky.
3800
3801 2005-01-20  Simon Josefsson  <jas@extundo.com>
3802
3803         * base64.h (isbase64): Add.
3804
3805         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
3806         using a unsigned prototype, don't inline.
3807         (base64_decode): Use it.
3808
3809 2005-01-19  Bruno Haible  <bruno@clisp.org>
3810
3811         * sh-quote.h: New file, from GNU gettext.
3812         * sh-quote.c: New file, from GNU gettext.
3813
3814 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
3815
3816         Merge changes from coreutils, as described below in several
3817         changelogs dated today.
3818
3819         * save-cwd.c: Include "save-cwd.h" before other include files.
3820         (O_DIRECTORY): Remove; not needed here, since "." must be
3821         a directory.  All uses removed.
3822         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
3823         universal on Suns, and we also need to test for IRIX.
3824         Revamp code to use 'if' rather than '#if'.
3825         Avoid unnecessary comparison of cwd->desc to 0.
3826
3827         * utimens.c (futimens): Robustify the previous patch, by checking
3828         for known valid error numbers rather than observed invalid ones.
3829
3830 2005-01-18  Jim Meyering  <jim@meyering.net>
3831
3832         * version-etc.c (version_etc_copyright): Update copyright date.
3833
3834         * utimens.c (futimens): Account for the fact that futimes
3835         can also fail with errno == ENOSYS or errno == ENOENT.
3836         Patch from Dmitry V. Levin.
3837
3838         Change the name of the robust chdir function from chdir to chdir_long.
3839         * save-cwd.c: Include chdir-long.h rather than chdir.h.
3840         (restore_cwd): Use chdir_long, not chdir.
3841         * chdir-long.c: Renamed from chdir.c.
3842         * chdir-long.h: Renamed from chdir.h.
3843         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
3844         Hurd.
3845
3846 2005-01-18  Bob Proulx  <bob@proulx.com>
3847
3848         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
3849         offsetof() macro construct to avoid compile failure with native HP-UX
3850         11.0 ANSI C compiler.
3851
3852 2005-01-06  Bruno Haible  <bruno@clisp.org>
3853
3854         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
3855         because stpncpy.m4 takes care of it.
3856
3857 2004-01-24  Bruno Haible  <bruno@clisp.org>
3858
3859         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
3860
3861 2003-10-09  Bruno Haible  <bruno@clisp.org>
3862
3863         * progreloc.c: Include xalloc.h instead of xmalloc.h.
3864
3865 2005-01-06  Bruno Haible  <bruno@clisp.org>
3866
3867         * fwriteerror.h (fwriteerror): Change specification to include fclose.
3868         * fwriteerror.c: Include <stdbool.h>.
3869         (fwriteerror): At the end, close the file stream. Record whether
3870         stdout was already closed.
3871
3872 2004-05-27  Bruno Haible  <bruno@clisp.org>
3873
3874         * execute.c (environ): Declare if needed.
3875         * pipe.c (environ): Likewise.
3876         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
3877
3878 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
3879
3880         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3881         definitions to be after all include files, to avoid collisions.
3882         Problem reported by Bob Proulx.
3883
3884 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
3885
3886         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3887         not needed.  This removes a dependency on the gettext module.
3888         [defined _LIBC]: Do not include <libintl.h>; not needed.
3889
3890 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
3891
3892         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3893         HAVE_DECL_STRTOLD.
3894
3895 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
3896
3897         * argp-parse.c: Include <stddef.h>.
3898         (alignof, alignto): New macros.
3899         (parser_init): Don't assume that void * is aligned sufficiently
3900         for struct option.
3901
3902         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
3903         need to extend the stack.
3904         (YYINITDEPTH): New macro, so that the initial stack isn't overly
3905         large.
3906
3907 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3908
3909         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
3910
3911 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
3912
3913         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3914         Remove now-obsolete comment about AIX.
3915         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3916         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3917         (YYMAXDEPTH): New macro.
3918
3919 2004-12-18  Bruno Haible  <bruno@clisp.org>
3920
3921         * fatal-signal.c (fatal_signals): Make non-const.
3922         (init_fatal_signals): New function.
3923         (uninstall_handlers, install_handlers): Ignore signals that were set to
3924         SIG_IGN.
3925         (at_fatal_signal): Call init_fatal_signals.
3926         (init_fatal_signal_set): Likewise. Ignore signals that were set to
3927         SIG_IGN.
3928         Reported by Paul Eggert.
3929
3930 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
3931
3932         * getdate.y (textint): New member "negative".
3933         (time_zone_hhmm): New function.
3934         Expect 14 shift-reduce conflicts, not 13.
3935         (o_colon_minutes): New rule.
3936         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3937         (yylex): Set the "negative" member of signed numbers.
3938
3939 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
3940
3941         Changes imported from coreutils.
3942         * hard-locale.c: Assume <locale.h> exists.
3943         Include "strdup.h".
3944         (GLIBC_VERSION): New macro.
3945         (hard_locale): Assume setlocale exists.
3946         Rewrite to avoid #ifdef.
3947         Use strdup rather than malloc + strcpy.
3948         * human.c: Assume <locale.h> exists.
3949         (human_readable): Assume localeconv exists.
3950
3951 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3952
3953         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
3954         convert T2, not T.  (Imported from libc.)
3955
3956 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
3957
3958         * getcwd.c (is_ENAMETOOLONG): New macro.
3959         (__getcwd.c): Don't restore errno; glibc doesn't.
3960         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3961         first, falling back to our code only if its results look suspicious.
3962         Ensure that the resulting buffer is only as large as necessary.
3963
3964         * readutmp.c: Include readutmp.h first.
3965         Include <errno.h>, since readutmp.h no longer does that.
3966         * readutmp.h: Don't include <errno.h>,
3967         <sys/param.h>, <time.h>; not needed to establish interface.
3968         (errno): Remove decl.
3969         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3970         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3971         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3972
3973 2004-11-28  Simon Josefsson  <jas@extundo.com>
3974
3975         * base64.h, base64.c: New file.
3976
3977 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
3978
3979         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
3980
3981 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
3982
3983         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3984         HP's ANSI C compiler.
3985         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3986         Declaring int functions causes warnings on some modern systems and
3987         shouldn't be needed to compile on ancient ones.
3988         * same.c (MIN) [defined MIN]: Don't define, since it's already
3989         defined.
3990
3991         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3992         with the following changes.
3993         (__set_errno): Parenthesize properly.
3994         Include <stdbool.h>.
3995         (MIN, MAX, MATCHING_INO): New macros.
3996         (__getcwd): Define with prototype, not K&R form.
3997         Use heuristics to allocate default buffer on stack if possible.
3998         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3999         behavior, and to avoid the PATH_MAX limit when computing
4000         ../../../../...
4001         Use MATCHING_INO to compare inode number to file.
4002         Check for arithmetic overflow in size calculations.
4003         Fix bug in reallocation of dot array that caused getcwd to fail
4004         on directories nested deeper than 75.
4005         Be more careful about saving errno on error.
4006         Do not use realloc; use only free+malloc, as this is a bit
4007         more flexible and avoids a needless copy operation.
4008         Do not inspect st_dev and st_ino for symbolic links; POSIX
4009         doesn't specify the latter.
4010         Check for closedir errors.
4011         Avoid needless casts.
4012         Use "#ifdef weak_alias" around weak_alias, to be like other
4013         glibc code.
4014         The following changes to getcwd.c have effect only when used in
4015         gnulib; they have no effect inside glibc proper.
4016         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4017         as alloca isn't used.
4018         (alloca, __alloca): Likewise.
4019         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4020         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4021         unconditionally, as gnulib assumes C89 or better.
4022         Do not include <sys/param.h>.
4023         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4024         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4025         better.
4026         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4027         Include <dirent.h> in a way that is compatible with modern Autoconf.
4028         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4029         New macros, if not already defined.
4030         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4031         Use "_LIBC", not "defined _LIBC", for consistency.
4032         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4033         a mempcpy module.
4034         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4035         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4036         * xgetcwd.c: David MacKenzie's old code was removed, so give
4037         credit only to Jim Meyering and adjust the copyright dates.
4038         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4039         <stdlib.h>, <unistd.h>, "pathmax.h".
4040         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4041         (INITIAL_BUFFER_SIZE): Remove.
4042         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4043
4044 2004-11-23  Jim Meyering  <jim@meyering.net>
4045
4046         * getopt_.h: Remove trailing blanks.
4047
4048 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4049
4050         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4051         (futimens): New function, which uses futimes if available.
4052         (futimens, utimens): Support timespec==NULL, with same semantics
4053         as utime and utimens.
4054         * utimens.h (futimens): New decl.
4055
4056 2004-11-23  Jim Meyering  <jim@meyering.net>
4057
4058         * __fpending.c: Add comment.
4059
4060 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4061
4062         * getopt_.h: Re-addition of __getopt_argv_const caused
4063         redefinition warnings. To avoid them, include the defines
4064         in `#if !defined __need_getopt ... #endif'. The only place
4065         where __getopt_argv_const is used is in definitions
4066         of getopt_long and getopt_long_only below, which are as well
4067         protected by `#ifndef __need_getopt'.
4068         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4069         __need_getopt after including <stdio.h> and <unistd.h> These
4070         headers might have defined it.
4071
4072 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4073
4074         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4075         New macros.
4076         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4077         optopt): Use them instead of invoking ## directly; otherwise, the
4078         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4079
4080 2004-11-19  Bruno Haible  <bruno@clisp.org>
4081
4082         * strtok_r.c: Move comments from here...
4083         * strtok_r.h: ... to here.
4084
4085 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4086
4087         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4088         might fail.  Problem reported by Yoann Vandoorselaere.
4089         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4090         that mishandle size_t overflow.
4091
4092 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4093
4094         * canon-host.c: Include "strdup.h".
4095         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4096         Use strdup instead of malloc/strcpy to duplicate strings.
4097
4098         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4099         (human_space_before_unit): New constant.
4100         * human.c (human_readable): Support it.
4101
4102         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4103         (xgetcwd): Set errno correctly when failing.
4104         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4105         the failure is actually due to a PATH_MAX problem.
4106
4107         Further getopt changes to make it more likely that glibc will
4108         buy the changes back.
4109         * getopt.c (POSIXLY_CORRECT): New constant.
4110         (getopt): Use it, so to preserve glibc semantic
4111         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4112         when compiling for libc.
4113         * getopt_.h (__getopt_argv_const): Bring it back.
4114         (getopt_long, getopt_long_only): Use it.
4115
4116         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4117         New arg POSIXLY_CORRECT.  All callers changed.
4118         (getopt): Argv is now char * const *, as per standard.
4119         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4120         not char *__getopt_argv_const *.
4121         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4122         _getopt_long_only_r): Likewise.
4123         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4124         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4125         _getopt_long_r, _getopt_long_only_r): Likewise.
4126         * getopt_.h (__getopt_argv_const): Remove.
4127         (getopt): Argv is now char * const *, as per standard.
4128
4129         * getdate.y (tORDINAL): New token.
4130         (day, relunit): Allow it for relative times.
4131         (relative_time_table): Use tORDINAL for ordinals.
4132
4133 2004-11-15  Jim Meyering  <jim@meyering.net>
4134
4135         * closeout.c: Include "__fpending.h" once again.
4136         Include <stdbool.h>.
4137         (close_stdout): Don't fail just because stdout was closed initially,
4138         since some programs don't write to stdout in the normal course of
4139         operation (other than --version and --help), and we don't want this
4140         function to make e.g. `touch file >&-' fail.
4141         But do fail if it was closed and someone has tried to write to it.
4142         E.g., `printf foo >&-' must fail.
4143
4144 2004-11-11  Simon Josefsson  <jas@extundo.com>
4145
4146         * strtok_r.h, strtok_r.c: New file.
4147
4148 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4149
4150         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4151         we can stop lying to compilers about the constness of argv when we
4152         are compiled outside glibc.
4153         (getopt, getopt_long, getopt_long_only): Use it.
4154         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4155         getopt): Likewise.
4156         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4157         _getopt_long_only_r): Likewise.
4158         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4159         _getopt_long_only_r): Likewise.
4160
4161         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4162         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4163         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4164         the other external symbols.
4165         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4166         declaration, since the above renaming now works around collisions.
4167
4168 2004-11-11  Jim Meyering  <jim@meyering.net>
4169
4170         * linebreak.c: Remove trailing blanks.
4171         * alloca_.h: Likewise.
4172         * acosl.c: Likewise.
4173         * euidaccess.c: Likewise.
4174         * allocsa.h: Likewise.
4175
4176 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4177
4178         * mktime.c (SHR): New macro, which is a portable
4179         substitute for >> that should work even on Crays.
4180         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4181         Problem reported by Mark D. Baushke in
4182         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4183         * getdate.y (SHR): Likewise.
4184         (tm_diff): Use it.
4185         * strftime.c (SHR): Likewise.
4186         (tm_diff): Use it.
4187         * quotearg.c (struct quoting_options): Use unsigned int for
4188         quote_these_too, so that right shifts are well defined.  All uses
4189         changed.
4190
4191 2004-11-10  Simon Josefsson  <jas@extundo.com>
4192
4193         * getaddrinfo.h, getaddrinfo.c: New files.
4194
4195 2004-11-10  Jim Meyering  <jim@meyering.net>
4196
4197         Ensure that no close failure goes unreported.
4198         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4199         return early when it seems there's nothing to flush.
4200         Don't include __fpending.h.
4201
4202 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4203
4204         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4205
4206 2004-11-05  Bruno Haible  <bruno@clisp.org>
4207
4208         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4209         Reported by Mark D. Baushke <mdb@cvshome.org>.
4210
4211 2004-11-04  Bruno Haible  <bruno@clisp.org>
4212
4213         2004-09-11  Bruno Haible  <bruno@clisp.org>
4214                 * allocsa.valgrind: New file.
4215         2004-02-06  Bruno Haible  <bruno@clisp.org>
4216                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4217                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4218                 Reported by Christopher Seip <chris.seip@hp.com>.
4219
4220 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4221
4222         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4223         with errno == ERANGE if the buffer is too small.
4224         Problem reported by Mark D. Baushke.
4225
4226 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4227
4228         * xreadlink.c (MAXSIZE): New macro.
4229         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4230         size does not exceed MAXSIZE.  Avoid cast.
4231         As suggested by Mark D. Baushke in
4232         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4233         if readlink fails with buffer size just under MAXSIZE, try again
4234         with MAXSIZE.
4235
4236 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4237         and  Paul Eggert  <eggert@cs.ucla.edu>
4238
4239         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4240         (get_date): Overparenthesize to avoid GCC warning.
4241
4242 2004-11-02  Bruno Haible  <bruno@clisp.org>
4243
4244         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4245         function returns void.
4246
4247 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4248
4249         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4250         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4251         already declared.
4252
4253 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4254
4255         * getdate.y: Add support for TZ="foo" within a date string.
4256         Fix some bugs near time_t boundaries.  Reject dates with
4257         out-of-range components, e.g., "Sept 31".
4258         Include <stdlib.h>, "setenv.h", "xalloc.h".
4259         (ISDIGIT_LOCALE): Remove; unused.
4260         Note that the TZ and time functions used here are not reentrant.
4261         (mktime_ok, get_tz): New functions.
4262         (TZBUFSIZE): New constant.
4263         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4264         This requires that we sometimes generate our own TZ="XXX..." setting.
4265
4266 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4267
4268         * mktime.c (not_equal_tm): Remove redundant check.
4269
4270 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4271
4272         * getdate.y: Use Bison 1.875 features, and some minor
4273         code cleanups.  This change does not affect semantics.
4274         Don't include <stdlib.h>; no longer needed.
4275         Don't include unlocked-io.h; only the "#if TEST" code uses
4276         stdio, and performance isn't crucial there.
4277         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4278         Bison 1.875 features as described below.
4279         All uses of "PC." replaced by "pc->".
4280         (YYSTYPE): Add a forward declaration.
4281         (yylex, yyerror): Use full prototypes in forward decls.
4282         Use "%pure-parser" rather than obsolescent "%pure_parser".
4283         Use %parse-param and %lex-param instead of obsolescent
4284         YYPARSE_PARAM and YYLEX_PARAM.
4285         (meridian_table, month_and_day_table, time_units_table,
4286         relative_time_table, time_zone_table, military_table,
4287         lookup_zone, lookup_word, get_date):
4288         Use NULL instead of 0 where appropriate.
4289         (to_hour): Avoid abort (), to avoid a dependency on
4290         stdlib.h.
4291         (yyerror, yylex): Now accepts parser_control * arg.
4292         (main) [TEST]: Use '\0' rather than 0 for char.
4293
4294 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4295
4296         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4297         It's now the caller's responsibility to handle the case where
4298         !HAVE_GETPAGESIZE && !defined getpagesize.
4299
4300         * mktime.c (leapyear): Arg is long int, not int.
4301
4302 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4303
4304         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4305
4306 2004-10-12  Simon Josefsson  <jas@extundo.com>
4307
4308         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4309         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4310         to real functions.
4311
4312 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4313
4314         * vsnprintf.h: New file.
4315         * vsnprintf.c: New file.
4316
4317 2004-10-07  Bruno Haible  <bruno@clisp.org>
4318
4319         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4320         into the provided buffer.
4321
4322 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4323
4324         * diacrit.c, diacrit.h: Add GPL notice.
4325
4326         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4327         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4328         * logl.c (logl): Keep the code as similar to glibc as possible.
4329         This avoids a potential constant-folding bug.
4330
4331 2004-10-05  Bruno Haible  <bruno@clisp.org>
4332
4333         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4334
4335 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4336
4337         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4338         * xmalloc.c (xmemdup): Likewise.
4339         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4340         XFREE): Remove these long-obsolescent macros.
4341         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4342         * xstrdup.c: Remove.
4343
4344         * regex.c (re_comp): Cast gettext return value to char *,
4345         Problem reported by Martin Neitzel via Mark D. Baushke.
4346
4347 2004-10-04  Simon Josefsson  <jas@extundo.com>
4348
4349         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4350         '#ifdef USE_UNLOCKED_IO'.
4351
4352 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4353
4354         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4355         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4356         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4357         regex.c, sha1.c, version-etc.c, yesno.c:
4358         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4359         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4360         the includer's responsibility.
4361
4362         Sync from coreutils.
4363
4364         * modechange.c (mode_compile): Don't decrement a pointer that
4365         points to the start of a string, as the C Standard says the
4366         resulting behavior is undefined.
4367
4368         * backupfile.h (enum backuptype): Rename none -> no_backups,
4369         simple -> simple_backups, numbered_existing ->
4370         numbered_existing_backups, numbered -> numbered_backups
4371         to avoid shadowing problems.  All uses changed.
4372         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4373         * backupfile.c (check_extension, numbered_backup):
4374         Rename locals to avoid shadowing 'basename'.
4375         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4376         once.
4377
4378         * .cppi-disable: Add getopt_.h, getopt_int.h.
4379         * .cvsignore: Add getopt.h.
4380
4381 2004-10-04  Simon Josefsson  <jas@extundo.com>
4382
4383         * memmem.h: New file.
4384         * memmem.c: New file, taken from glibc.
4385
4386 2004-10-02  Jim Meyering  <jim@meyering.net>
4387
4388         * dirfd.h, getpagesize.h: Add copyright notice.
4389
4390 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4391
4392         * snprintf.c: Remove comments as to why each header is needed.
4393
4394 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4395
4396         * strsep.h: New file.
4397         * strsep.c: New file.
4398
4399 2004-10-01  Simon Josefsson  <jas@extundo.com>
4400
4401         * snprintf.c (snprintf): Handle size==0.
4402
4403 2004-10-01  Simon Josefsson  <jas@extundo.com>
4404             Bruno Haible  <bruno@clisp.org>
4405
4406         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4407         (snprintf): Declare 'args'.
4408
4409 2004-09-30  Simon Josefsson  <jas@extundo.com>
4410
4411         * snprintf.h, snprintf.c: New files.
4412
4413 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4414
4415         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4416         (hol_entry_help): Never translate an empty string.
4417         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4418         * argp.h (OPTION_NO_TRANS): New option.
4419
4420 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
4421
4422         * xvasprintf.c: Include xalloc.h.
4423         (xvasprintf): Use xalloc_die, not xmalloc_die.
4424
4425 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
4426
4427         * dummy.c: Change copyright notice to FSF, and license to GPL.
4428
4429 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
4430
4431         * argp-pvh.c (argp_program_version_hook): Provide initial value.
4432         Problem reported by Bruno Haible in:
4433         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4434
4435 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
4436
4437         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4438         in case some system header has #define'd it.  Problem reported by
4439         Soeren D. Schulze in
4440         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4441
4442 2004-09-08  Bruno Haible  <bruno@clisp.org>
4443
4444         * stdint_.h: New file, taken from GNU clisp.
4445
4446 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
4447
4448         * xvasprintf.h: New file.
4449         * xvasprintf.c: New file.
4450         * xasprintf.c: New file.
4451
4452 2004-09-08  Bruno Haible  <bruno@clisp.org>
4453
4454         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4455         is > INT_MAX.
4456         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4457
4458 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4459
4460         Import from coreutils.
4461         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4462         strings on unbounded length.  alloca's performance benefits aren't
4463         that important here.
4464         (V_STRDUP): Remove.
4465         (parse_with_separator): New function, with most of the internals
4466         of the old parse_user_spec.  Allow user to omit both user and group,
4467         for compatibility with FreeBSD.
4468         Clone only the user name, not the entire spec.
4469         Do not set *uid, *gid unless entirely successful.
4470         Avoid memory leak in some failing cases.
4471         Fix regression for USER.GROUP reported by Dmitry V. Levin in
4472         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4473         (parse_user_spec): Rewrite to use parse_with_separator.
4474
4475 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4476
4477         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4478         its complicated substitute.
4479         * argp-help.c: Include <errno.h>, for program_invocation_short_name
4480         and program_invocation_name.
4481         (__argp_basename) [!_LIBC]: Remove; the only use was
4482         replaced by its body.
4483         (__argp_short_program_name): Change condition from
4484         !defined __argp_short_program_name to
4485         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4486         to match argp-namefrob.h.
4487         (__argp_failure): Don't assume strerror_r returns char *.
4488         * argp-parse.c (N_): Define unconditionally.
4489         (argp_default_options): Fill out initializers with 0 to avoid
4490         gcc warnings.
4491
4492 2004-08-12  Simon Josefsson  <jas@extundo.com>
4493
4494         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4495         * getopt_.h: Renamed from getopt.h.
4496
4497 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4498
4499         Merge from coreutils.
4500
4501         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4502         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
4503         for Reliant Unix 5.43.
4504
4505         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4506         (union fooround): Use uintmax_t, not long int.
4507         The rest is a merge from libc:
4508         [defined _LIBC]: Include <shlib-compat.h>.
4509         (_obstack) [defined _LIBC]: Remove after 2.3.4.
4510
4511         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4512
4513         * strverscmp.c: Convert to UTF-8.
4514
4515 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4516
4517         * obstack.h (obstack_empty_p):
4518         Don't assume that chunk->contents is suitably aligned.
4519         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4520         Likewise. Problem reported by Benno in
4521         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4522
4523         * chown.c (rpl_chown): Work even if the file is writeable but not
4524         readable.  This could be improved further but it'd take some work.
4525
4526 2004-08-08  Simon Josefsson  <jas@extundo.com>
4527
4528         * xgethostname.c: Don't include error.h (not used).
4529
4530         * getpass.h: Add.
4531         * getpass.c: Include getpass.h first.
4532
4533 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4534
4535         * xalloc-die.c: New files.
4536         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4537         All uses removed.
4538         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4539         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4540         (_, N_, xalloc_die): Move to xalloc-die.c.
4541         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4542         so that we needn't mess with xalloc_msg_memory_exhausted.
4543
4544         * sha1.h: Renamed from sha.h.
4545         (SHA1_H): Renamed from _SHA_H.
4546         (sha1_ctx): Renamed from sha_ctx.
4547         (sha1_init_ctx): Renamed from sha_init_ctx.
4548         (sha1_process_block): Renamed from sha_process_block.
4549         (sha1_process_bytes): Renamed from sha_process_bytes.
4550         (sha1_finish_ctx): Renamed from sha_finish_ctx.
4551         (sha1_read_ctx): Renamed from sha_read_ctx.
4552         (sha1_stream): Renamed from sha_stream.
4553         (sha1_buffer): Renamed from sha_buffer.
4554         * sha1.c: Likewise; renamed from sha.c.
4555         Do not include <sys/types.h>.
4556         Include <stddef.h> rather than <stdlib.h>.
4557
4558 2004-08-08  Bruno Haible  <bruno@clisp.org>
4559
4560         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4561         FILESYSTEM_PREFIX_LEN.
4562         * progreloc.c: Likewise.
4563         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4564
4565 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4566
4567         Merge from tar.
4568         * argp-help.c (make_hol, hol_append): Don't assume that
4569         SIZE_MAX is a valid preprocessor constant.
4570         (__argp_basename): Change from "#ifndef _LIBC"
4571         to "#ifndef __argp_short_program_name", so that
4572         we don't compile these functions for tar.
4573
4574         More merges from coreutils.
4575         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4576         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4577         yesno.h: New files.
4578         * addext.c: Remove; no longer needed.
4579         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4580         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4581         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4582         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4583         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
4584         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
4585         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
4586         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
4587         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
4588         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
4589         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
4590         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
4591         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
4592         Import changes from coreutils.
4593
4594 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
4595
4596         Merge from coreutils.
4597
4598         * .gdb-history: Remove; this doesn't belong here.
4599
4600         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
4601         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
4602         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
4603
4604         * dirname.h: Include <stdbool.h>.
4605         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
4606         for consistency with POSIX terminology.  All uses changed.
4607         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
4608         (strip_trailing_slashes): Use bool for booleans.
4609         * stripslash.c (strip_trailing_slashes): Likewise.
4610
4611         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
4612         sometimes returns a positive errno value even when it succeeds.
4613         (print_errno_message) [!LIBC]: Fall back on strerror if
4614         __strerror_r fails.
4615
4616         * path-concat.c (mempcpy): Don't define if a system header defines it.
4617         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4618         (longest_relative_suffix): New function.
4619         (path_concat): Use it.  Assume first argument is not NULL.
4620         Port to DOS.  Omit redundant separators.
4621         Report an error instead of returning NULL.
4622         Use mempcpy instead of memcpy.
4623         (xpath_concat): Remove: not declared or used.
4624
4625         * same.h: Include <stdbool.h>
4626         (same_name): Return bool, not int.
4627         * same.c (same_name): Likewise.
4628         (errno): Don't declare; we assume C89 or better now.
4629
4630         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
4631         if not already defined.
4632
4633         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
4634         * dup-safer.c (errno): Likewise.
4635
4636 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
4637
4638         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
4639         working.
4640
4641 2004-08-03  Simon Josefsson  <jas@extundo.com>
4642
4643         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
4644         * progname.h: Don't include stdbool.h.
4645
4646 2004-08-02  Simon Josefsson  <jas@extundo.com>
4647
4648         * getsubopt.h: New file, with comments from Bruno Haible.
4649         * getsubopt.c: New file, from glibc, but slightly modified based on
4650         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
4651
4652 2004-08-01  Simon Josefsson  <jas@extundo.com>
4653
4654         * xgetdomainname.c: Include stdlib.h, for free().
4655
4656 2004-07-16  Simon Josefsson  <jas@extundo.com>
4657
4658         * dummy.c: New file.
4659
4660 2004-07-16  Bruno Haible  <bruno@clisp.org>
4661
4662         * backupfile.h: Add extern "C" for C++.
4663         * closeout.h: Likewise.
4664         * copy-file.h: Likewise.
4665         * findprog.h: Likewise.
4666         * full-write.h: Likewise.
4667         * pathname.h: Likewise.
4668         * progname.h: Likewise.
4669         * stpcpy.h: Likewise.
4670         * stpncpy.h: Likewise.
4671         * strcase.h: Likewise.
4672         * strstr.h: Likewise.
4673         * xalloc.h: Likewise.
4674
4675         * mbswidth.h: Add extern "C" for C++.
4676         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
4677
4678 2004-07-09  Simon Josefsson  <jas@extundo.com>
4679
4680         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
4681         failed without this.)
4682
4683 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4684
4685         * fchown-stub.c: New file.
4686
4687 2004-06-24  Jim Meyering  <jim@meyering.net>
4688
4689         * obstack.h (obstack_base): Cast to (void *), per documentation.
4690
4691 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4692
4693         * argz.c, argz_.h: New files, which are autoupdated from libtool.
4694
4695 2004-06-01  Jim Meyering  <jim@meyering.net>
4696
4697         * calloc.c: New file.
4698
4699 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
4700
4701         * getdate.y (yylex): Allow space between sign and number.
4702         Problem reported by Dan Jacobson.
4703
4704 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
4705         and  Jim Meyering  <jim@meyering.net>
4706
4707         Merge from coreutils CVS.
4708
4709         * stat-macros.h: New file, with contents from file-type.h
4710         and coreutils' system.h.
4711         * file-type.c: Include "stat-macros.h".
4712         * file-type.h (file_type): Move all macro definitions to new file,
4713         stat-macros.h.
4714
4715         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
4716         Wrap old code with this conditional.
4717         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
4718         function that does not dereference symlinks.
4719         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
4720
4721         * xreadlink.c: Include xreadlink.h first, to catch .h file
4722         dependency problems.
4723         (xreadlink): Accept new arg SIZE, for efficiency.
4724         All decls and uses changed.
4725         * xreadlink.h: Include <stddef.h>, for size_t.
4726
4727         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
4728         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
4729
4730         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
4731
4732 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
4733
4734         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
4735         macros to be defined.
4736         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
4737         the allocator returns NULL because the requested size is zero.
4738
4739 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4740
4741         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
4742         var.  Add comment explaining why libc still defines it.  This
4743         merges the following patch from glibc:
4744         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
4745
4746 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
4747
4748         * obstack.c (_obstack): Remove unused variable.  It hasn't been
4749         present in glibc since revision 1.1 of this file.
4750         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
4751         obstack_alignment_mask, obstack_alloc, obstack_base,
4752         obstack_blank, obstack_blank_fast, obstack_chunk_size,
4753         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
4754         obstack_grow0, obstack_init, obstack_int_grow,
4755         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
4756         obstack_next_free, obstack_object_size, obstack_ptr_grow,
4757         obstack_ptr_grow_fast, obstack_room): Remove declarations of
4758         nonexistent functions.
4759
4760 2004-05-17  Derek R. Price  <derek@ximbiot.com>
4761             Paul Eggert  <eggert@cs.ucla.edu>
4762
4763         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
4764
4765 2004-05-14  Bruno Haible  <bruno@clisp.org>
4766
4767         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
4768         that consists of a '.' followed by an empty digit string.
4769         Patch by Tor Lillqvist <tml@iki.fi>.
4770
4771 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
4772
4773         Port obstack to the AS/400, where pointers are 16 bytes wide and
4774         you cannot cast an integer to a valid pointer.  This patch is
4775         currently waiting to be integrated into glibc; see
4776         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
4777
4778         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
4779         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
4780         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
4781         (struct obstack): temp member is now a union of a pointer and
4782         an integer, instead of an integer.  All integer uses changed.
4783         This does not affect the physical layout of struct obstack,
4784         except on hosts (like the AS/400) where the size or alignment of
4785         void * is greater than that of ptrdiff_t.
4786         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
4787         __STDC__)]: Store temporary in pointer member of union, not
4788         integer member.
4789         * obstack.c: Include <stddef.h>, for offsetof.
4790         (struct fooalign): Remove; it doesn't need a name.
4791         (union fooround): Change double to long double, and add void *.
4792         (DEFAULT_ALIGNMENT): Use offsetof to compute.
4793         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
4794         not a macro.  Hence the values are always int; so remove all
4795         casts-to-int in uses.
4796
4797 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
4798             Derek Price  <derek@ximbiot.com>
4799
4800         * alloca.c: Include <alloca.h>, to get our interface.
4801         * alloca_.h: Use __alloca on AIX, so that we don't have to
4802         include <alloca.h> first.  Use C89 prototype for alloca; this
4803         requires including <stddef.h> for size_t.  Use extern "C" if C++.
4804         Use #elif for simplicity, since we can assume C89 now.
4805         Don't try to source the system alloca.h since it will not be found
4806         and to prevent recursively including its replacement.
4807         * fnmatch.c: Include <alloca.h> instead of opencoding.
4808         * regex.c: Likewise.
4809
4810 2004-05-16  Derek Price  <derek@ximbiot.com>
4811             Paul Eggert  <eggert@cs.ucla.edu>
4812
4813         getline cleanup.  This changes the getndelim2 API: both order of
4814         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
4815         no delimiter).
4816
4817         * getline.c: Don't include stddef.h or stdio.h, since our
4818         interface does that.
4819         (getline): Always use getdelim, so that we don't have two
4820         copies of this code.
4821         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
4822         if available.
4823         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
4824         (GETNDELIM2_MAXIMUM): New macro.
4825         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
4826         instead of the old practice of delim2==0.  All callers changed.
4827         Return -1 on overflow, instead of returning junk.
4828         Do not set *linesize unless allocation succeeds.
4829         * getndelim2.h: Do not include stddef.h; no longer needed, now
4830         that we include sys/types.h.
4831         * getnline.h: Likewise.
4832         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
4833         (getndelim2): Reorder arguments.
4834         * getnline.c (getnline, getndelim):
4835         Don't discard the NMAX argument.
4836         (getnline): Invoke getndelim, to avoid code duplication.
4837         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
4838         of (size_t) -1 by callers of the getnline family.
4839
4840 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4841
4842         * nanosleep.c (suspended): Change its type from int to
4843         sig_atomic_t volatile.
4844         (first_call): Make it private to rpl_nanosleep, and have it
4845         be zero initially as that's a bit faster.
4846         (my_usleep): Round up fractional times instead of truncating them,
4847         as this is the usual meaning for 'sleep'.
4848
4849         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
4850         doesn't work.
4851         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
4852         (ENOSYS): Define if not defined.
4853         (settime): Fall back on stime if it exists and settimeofday fails.
4854         But don't bother with fallbacks if a method fails with errno == EPERM.
4855
4856 2004-05-11  Jim Meyering  <jim@meyering.net>
4857
4858         Prior to this change, the save_cwd caller required read access to the
4859         current directory on most systems (ones with the fchdir function).
4860
4861         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
4862         fails, try write-only, and finally, resort to using xgetcwd.
4863
4864 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
4865
4866         * obstack.c, obstack.h: Import changes from libc.
4867
4868 2004-04-28  Bruno Haible  <bruno@clisp.org>
4869
4870         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
4871         implicitly appends .exe to executables.
4872         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
4873         accepts Windows pathnames.
4874         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4875         Cygwin like Windows, since it now accepts Windows pathnames.
4876         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4877         Cygwin like Windows, since it now accepts Windows pathnames.
4878         Reported by Derek Robert Price <derek@ximbiot.com>.
4879
4880 2004-04-20  Jim Meyering  <jim@meyering.net>
4881
4882         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4883
4884 2004-04-20  Jim Meyering  <jim@meyering.net>
4885             Bruno Haible  <bruno@clisp.org>
4886
4887         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
4888         memory when realloc fails.
4889
4890 2004-04-18  Jim Meyering  <jim@meyering.net>
4891
4892         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4893         don't leak memory and do call END_UTMP_ENT.
4894
4895 2004-04-11  Paul Eggert  <eggert@twinsun.com>
4896
4897         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
4898         (CHAR_BIT): Remove, since we assume C89.
4899         Include <stdint.h> if available, as per current Autoconf CVS advice.
4900
4901 2004-03-30  Paul Eggert  <eggert@twinsun.com>
4902
4903         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
4904         not bool, to be more consistent with Unix conventions.
4905         Suggested by Bruno Haible.
4906
4907         Merge from coreutils.
4908
4909         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
4910         New files.
4911
4912         * getdate.h: Include stdbool.h, and timespec.h instead of
4913         the usual <time.h> dance.
4914         (get_date): Change signature to support fractional time stamps.
4915         All callers changed.
4916         * getdate.y: Include "getdate.h" first, as we can now
4917         assume C89 and don't need to worry about 'const'.
4918         Similarly, include "unlocked-io.h" near start, not in middle.
4919         Include <limits.h>.
4920         (textint.value): Use long int rather than int.
4921         (textint.digits): Use size_t rather than int.
4922         (BILLION, LOG10_BILLION): New constants.
4923         (parser_control): New member rel_ns.  Members day_ordinal,
4924         time_zone, month, day, hour, minutes, rel_year, rel_month,
4925         rel_day, rel_hour, rel_minutes, rel_seconds
4926         are now long int, not int.  Member seconds is now struct timespec,
4927         not int.  New member timespec_seen.  Members dates_seen, days_seen,
4928         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4929         not int.
4930         (%union.intval): Now long int, not int.
4931         New member timespec.
4932         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4933         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4934         (spec): Now is a timespec or an item list.
4935         (timespec, items): New nonterminals.
4936         (time, rel, relunit, number, get_date):
4937         Add support for fractional seconds.
4938         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4939         (gmtime, localtime, mktime): Remove decls; not needed with C89.
4940         (to_hour): First arg is now long int, not int.
4941         (to_year): Returns long int, not int.
4942         Don't treat year -70 like 70.
4943         (tm_diff): Returns long int, not int.
4944         (lookup_word): Use bool instead of int when appropriate.
4945         (yylex): Use size_t for count, not int.
4946         Detect overflow when parsing large integer constants.
4947         Add support for fractions.
4948         (get_date): Make pointers 'const' if possible.
4949         Use more-portable code to detect integer overflow.
4950         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
4951         Don't use ctime; it's not reliable if the year has >4 digits.
4952
4953         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
4954         This is for compatibility with BSD.
4955
4956         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4957         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4958         From coreutils' system.h.
4959
4960         * userspec.c: Don't include "posixver.h".
4961         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4962         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4963         compatible extension.  Simplify code by removing a boolean int
4964         that was always nonzero if a string was nonnull.
4965
4966 2004-03-30  Jim Meyering  <jim@meyering.net>
4967
4968         Merge from coreutils.
4969
4970         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4971
4972         * readtokens.c (readtoken): Don't leak 64 bytes when reading
4973         an empty input stream.
4974
4975         * readtokens.c: Include <stdbool.h>.
4976         (readtoken): Use `size_t' rather than int/long.
4977         All callers adjusted.
4978         Use `bool' rather than `int' where appropriate.
4979         Use memset rather than an explicit loop.
4980         Use x2nrealloc rather than xrealloc.
4981         Allow the use of `\0' as a delimiter.
4982         (readtokens): Likewise.
4983         * readtokens.h (readtoken, readtokens): Update prototypes.
4984
4985 2004-03-30  Bruno Haible  <bruno@clisp.org>
4986
4987         * getloadavg.c (getloadavg): Don't assume setlocale returns
4988         nonnull.
4989
4990 2004-03-29  Paul Eggert  <eggert@twinsun.com>
4991
4992         Merge changes to getloadavg.c from coreutils and Emacs.
4993
4994         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
4995         Define to an expression, not to the empty string.
4996         Include cloexec.h and xalloc.h.
4997         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
4998         Use set_cloexec_flag rather than rolling our own.
4999         * cloexec.c, cloexec.h: New files.
5000
5001 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5002
5003         * getopt.h: Sync with libc CVS.
5004
5005 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5006             Bruno Haible  <bruno@clisp.org>
5007
5008         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5009         not on all platforms that have <wchar.h>.
5010         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5011
5012 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5013
5014         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5015         Sync with libc CVS.
5016         * getopt_int.h: New file, also synced from libc.
5017
5018 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5019
5020         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5021         '#if' expressions.  Unlike the code it replaces, it does not
5022         depend on (defined _SC_PAGESIZE).  However, it does depend on
5023         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5024         first reported by Jason Andrade in
5025         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5026
5027 2004-01-18  Simon Josefsson  <jas@extundo.com>
5028
5029         * strdup.h: New file.
5030         * strdup.c: Include it.
5031         * path-concat.c: Include strdup.h. Drop strdup declaration.
5032         * userspec.c: Include strdup.h. Drop strdup declaration.
5033
5034 2004-02-06  Karl Berry  <karl@gnu.org>
5035
5036         * config.charset: update from gettext 0.14.1.
5037
5038 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5039
5040         Add comments and code, prompted by suggestions from Bruno Haible
5041         for sh-quote.
5042         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5043         describing the enum quoting_style values.
5044         * quotearg.c (quotearg_alloc): New function.
5045         (quotearg_buffer_restyled): Treat lone { and } as special.
5046         Treat = as special.  Work around bug with older shells
5047         that "see" a '\' that is really the 2nd byte of a multibyte char.
5048         Quote empty string with shell_quoting_style.
5049
5050 2004-02-03  Bruno Haible  <bruno@clisp.org>
5051
5052         * pipe.h: New file, from GNU gettext.
5053         * pipe.c: New file, from GNU gettext.
5054
5055 2004-01-27  Bruno Haible  <bruno@clisp.org>
5056
5057         * execute.h: New file, from GNU gettext.
5058         * execute.c: New file, from GNU gettext.
5059         * w32spawn.h: New file, from GNU gettext.
5060
5061 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5062
5063         Exit-status fix from coreutils.
5064
5065         Use exit_failure consistently in place of EXIT_FAILURE,
5066         so that program exit statuses are consistent on failure.
5067
5068         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5069         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5070         * argmatch.h: Comment fix to match the above.
5071         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5072         Now a macro referring to exit_failure, instead of a separate
5073         variable.  Include "exitfail.h" to get it.
5074         * xstrtol.h: Include "exitfail.h".
5075         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5076
5077         * long-options.c (parse_long_options): Use prototype
5078         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5079         for clarity.
5080
5081 2004-01-21  Jim Meyering  <jim@meyering.net>
5082
5083         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5084         so as not to conflict with a different-sized __mktime_internal
5085         function in GNU libc.
5086         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5087         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5088
5089 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5090
5091         Merge from diffutils.
5092
5093         * file-type.c (file_type): Add typed memory objects.
5094         * file-type.h (S_TYPEISTMO): New macro.
5095
5096         * c-stack.h (c_stack_action): Remove argv argument.
5097         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5098         (die): Don't calculate message unless segv_action returns.
5099         (get_stack_location, min_address_from_argv, max_address_from_argv,
5100         volatile stack_base, volatile_stack_size): Remove.
5101         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5102         that every segmentation violation is a stack overflow.  (Ouch!)
5103         See Debian bug 136249 (still outstanding) for more info about why
5104         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5105
5106 2003-11-30  Bruno Haible  <bruno@clisp.org>
5107
5108         Safer stack allocation.
5109         * setenv.c: Include allocsa.h.
5110         (alloca): Remove fallback definition.
5111         (freea): Remove macro.
5112         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5113         instead of freea.
5114
5115 2003-10-17  Bruno Haible  <bruno@clisp.org>
5116
5117         * binary-io.h: Avoid warnings on Cygwin.
5118
5119 2003-12-28  Bruno Haible  <bruno@clisp.org>
5120
5121         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5122         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5123
5124 2003-11-28  Bruno Haible  <bruno@clisp.org>
5125
5126         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5127
5128 2003-11-27  Bruno Haible  <bruno@clisp.org>
5129
5130         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5131
5132 2003-11-17  Bruno Haible  <bruno@clisp.org>
5133
5134         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5135
5136 2003-11-24  Bruno Haible  <bruno@clisp.org>
5137
5138         * xallocsa.h: New file, from GNU gettext.
5139         * xallocsa.c: New file, from GNU gettext.
5140
5141 2003-11-24  Bruno Haible  <bruno@clisp.org>
5142
5143         * allocsa.h: New file, from GNU gettext.
5144         * allocsa.c: New file, from GNU gettext.
5145
5146 2003-11-24  Bruno Haible  <bruno@clisp.org>
5147
5148         * eealloc.h: New file.
5149
5150 2004-01-15  Jim Meyering  <jim@meyering.net>
5151
5152         Merge from coreutils.
5153
5154         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5155         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5156         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5157
5158         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5159         optional configure-time default.
5160
5161         * version-etc.c (version_etc_copyright): Update copyright date.
5162
5163         * xreadlink.c (xreadlink): Correct outdated comment.
5164
5165 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5166
5167         Merge from coreutils.
5168
5169         * posixver.c: Include posixver.h.
5170
5171         * same.c: Include <stdbool.h>, <limits.h>.
5172         (_POSIX_NAME_MAX): Define if not defined.
5173         (MIN): New macro.
5174         (same_name): If file names are silently truncated, report
5175         that the file names are the same if they are the same after
5176         the silent truncation.
5177
5178         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5179         conversion function.
5180         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5181         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5182         longer needed.
5183
5184 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5185
5186         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5187         with like-named macro in fnmatch.c.
5188         (EXT): Use an internal constant instead.
5189
5190         Merge fnmatch patches from glibc.
5191         * fnmatch.c (mbsinit): Remove define.
5192         Add libc_hidden_ver (__fnmatch, fnmatch).
5193         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5194         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5195
5196 2003-12-14  Karl Berry  <karl@gnu.org>
5197
5198         * config.charset: update from gettext-runtime.
5199
5200 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5201
5202         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5203         Bug reported by Alfred M. Szmidt.
5204
5205 2003-11-29  Karl Berry  <karl@gnu.org>
5206
5207         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5208
5209 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5210             Bruno Haible  <bruno@clisp.org>
5211
5212         * printf-parse.h: Don't include sys/types.h.
5213         (ARG_NONE): New macro.
5214         (char_directive): Change type of *arg_index fields to size_t.
5215         * printf-parse.c: Don't include sys/types.h.
5216         (SSIZE_MAX): Remove macro.
5217         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5218         Remove unnecessary overflow check.
5219         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5220         fields.
5221
5222 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5223
5224         * alloca.c: Remove dependency on xalloc module.
5225         (xalloc_die): Remove.
5226         (memory_full) [!defined emacs]: New macro.
5227         [!defined emacs]: Don't include xalloc.h.
5228         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5229         address arithmetic overflows.  Change datatypes a bit to avoid
5230         unnecessary casts.
5231
5232 2003-11-22  Jim Meyering  <jim@meyering.net>
5233
5234         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5235
5236 2003-11-17  Bruno Haible  <bruno@clisp.org>
5237
5238         * vasnprintf.c (alloca): Remove fallback definition.
5239         (freea): Remove definition.
5240         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5241         Reported by Paul Eggert.
5242
5243 2003-11-17  Jim Meyering  <jim@meyering.net>
5244
5245         On systems without utime and without a utimes function capable of
5246         dealing with a NULL struct utimbuf* argument, this utime replacement
5247         could -- in unusual circumstances -- leak a file descriptor.
5248         * utime.c: Include <unistd.h> and <errno.h>.
5249         (utime_null): Be sure to close `fd' and to preserve errno.
5250         Reported by Geoff Collyer via Arnold Robbins.
5251
5252 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5253             Bruno Haible  <bruno@clisp.org>
5254
5255         Protect against address arithmetic overflow.
5256         * printf-args.h: Include stddef.h.
5257         (arguments): Change type of field 'count' to size_t.
5258         * printf-args.c (printf_fetchargs): Use size_t instead of
5259         'unsigned int' where appropriate.
5260         * printf-parse.h: Include sys/types.h.
5261         (char_directive): Change type of *arg_index fields to ssize_t.
5262         (char_directives): Change type of fields 'count', max_*_length to
5263         size_t.
5264         * printf-parse.c: Include sys/types.h and xsize.h.
5265         (SSIZE_MAX): Define fallback value.
5266         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5267         instead of 'int' where appropriate. Check a_allocated, d_allocated
5268         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5269         * vasnprintf.c: Include xsize.h.
5270         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5271         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5272         overflow. Avoid wraparound when converting a width or precision from
5273         decimal to binary.
5274
5275 2003-11-16  Bruno Haible  <bruno@clisp.org>
5276
5277         Update from GNU gettext.
5278         * printf-parse.c: Generalize to it can be compiled for wide strings.
5279         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5280         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5281         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5282         SNPRINTF): New macros.
5283         Don't include <alloca.h> if the file is used inside libintl.
5284         (local_wcslen): New function, for Solaris 2.5.1.
5285         (VASNPRINTF): Use it instead of wcslen.
5286
5287 2003-11-16  Bruno Haible  <bruno@clisp.org>
5288
5289         * xsize.h (xmax): New function.
5290         (xsum, xsum3, xsum4): Declare as "pure" functions.
5291
5292 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5293
5294         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5295         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5296         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5297         heuristic is just as accurate as far as we know, and it removes a
5298         dependency on size_max.m4 and ptrdiff_max.m4.
5299
5300 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5301
5302         * xstrtol.c (__xstrtol): Remove "break" immediately after
5303         "return", to pacify some unknown compiler.  Problem reported
5304         by Joerg Schilling.
5305
5306 2003-11-11  Bruno Haible  <bruno@clisp.org>
5307
5308         * xsize.h (SIZE_MAX): Remove fallback definition.
5309         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5310         defined.
5311
5312 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5313
5314         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5315         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5316         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5317         From Bruno Haible.
5318         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5319         not (size_t) -1, since it's defined here.
5320
5321 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5322
5323         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5324         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5325         Reject sizes of exactly SIZE_MAX bytes.
5326         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5327         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5328
5329 2003-11-05  Bruno Haible  <bruno@clisp.org>
5330
5331         * xsize.h: Include limits.h, to avoid a possible collision with
5332         SIZE_MAX defined in <limits.h> on Solaris.
5333
5334 2003-11-04  Bruno Haible  <bruno@clisp.org>
5335
5336         * xsize.h: New file.
5337         * linebreak.c: Include xsize.h.
5338         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5339         argument for overflow.
5340         Suggested by Paul Eggert.
5341
5342 2003-10-31  Bruno Haible  <bruno@clisp.org>
5343
5344         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5345         to avoid (extremely rare) race condition.
5346         Suggested by Paul Eggert.
5347
5348 2003-11-03  Jim Meyering  <jim@meyering.net>
5349
5350         * userspec.c: Include "userspec.h".
5351         * userspec.h: New file.
5352
5353 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5354
5355         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5356         * mountlist.c (SIZE_MAX): Define if not defined already.
5357         (read_filesystem_list): Set and use me_type_malloced.
5358         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5359         whatever the type happens to be), for brevity and consistency.
5360         Check for size calculation overflow on Alphas running OSF/1.
5361
5362 2003-10-31  Jim Meyering  <jim@meyering.net>
5363
5364         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5365
5366         * linebuffer.c: Include <string.h> for declaration of memset.
5367
5368 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5369             Bruno Haible  <bruno@clisp.org>
5370
5371         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5372         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5373
5374 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5375
5376         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5377         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5378         no longer needed.
5379         * quotearg.c (quotearg_n_options): Use it.
5380         * group-member.c: Include <stdbool.h>.
5381         (free_group_info): Arg is now const *; don't free arg.
5382         (get_group_info): Now returns bool and accepts struct group_info *,
5383         rather than returning a malloc'ed struct group_info *.
5384         All uses changed.  Check for overflow in internal size calculation.
5385
5386         * getusershell.c (readname): Simplify the code by using x2nrealloc
5387         rather than xmalloc/xrealloc.
5388         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5389         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5390         conformance bug: the old code used a pointer after freeing the
5391         storage that it addressed.
5392         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5393         rather than doing it by hand.
5394         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5395         the buffer preserved.  Use free and xmalloc instead.
5396         * quotearg.c (quotearg_n_options): Likewise.
5397         Use a simpler test for size overflow.  Don't use xalloc_oversized
5398         because unsigned int might be wider than size_t (!); this suggests
5399         that we should switch from unsigned int to size_t for slot numbers.
5400
5401 2003-10-27  Bruno Haible  <bruno@clisp.org>
5402
5403         * stdbool_.h: Better support for BeOS.
5404
5405 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5406
5407         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5408         to allocate the returned structure.  Do not allocate a subarray,
5409         as x2nrealloc will do that.
5410         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5411         instead of xnrealloc.
5412         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5413
5414 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5415
5416         * xalloc.h (xalloc_oversized): New static inline function, for
5417         callers that want to do their own size-overflow checking.  Include
5418         <stdbool.h>, since xalloc_oversized returns bool.
5419         * xalloc.c (array_size_overflow): Remove.  All callers changed
5420         to use xalloc_oversized.
5421
5422         Add two functions x2realloc, x2nrealloc, for programs that grow
5423         arrays dynamically by doubling their sizes.
5424         * xalloc.h (x2realloc, x2nrealloc): New decls.
5425         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5426         New functions.
5427
5428         Port to C99 semantics for 'inline' of external functions.
5429         Bug reported by Bruno Haible.
5430         * xmalloc.c (xnmalloc_inline): New static inline function,
5431         with the old contents of xnmalloc.
5432         (xnmalloc, xmalloc): Use it.
5433         (xnrealloc_inline): New static inline function,
5434         with the old contents of xnrealloc.
5435         (xnrealloc, xrealloc): Use it.
5436
5437         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5438
5439 2003-10-25  Paul Eggert  <eggert@twinsun.com>
5440
5441         Fix several address-calculation bugs in the hash modules,
5442         plus some minor code cleanup.
5443
5444         * hash.h: Include <stdbool.h>, for bool.
5445         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5446         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5447         hash_get_n_entries, hash_get_max_bucket_length,
5448         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5449         hash_rehash): Use size_t rather than unsigned.
5450         * hash.c (struct hash_table, hash_get_n_buckets,
5451         hash_get_n_buckets_used, hash_get_n_entries,
5452         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5453         hash_get_entries, hash_do_for_each, hash_string, is_prime,
5454         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5455         Likewise.
5456         (SIZE_MAX): Define if not defined.
5457         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5458         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5459         hash_print):
5460         Use const * when possible.
5461         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5462         (check_tuning): Fix bug: if tuning parameters were very close to
5463         0 or 1, rounding errors could have caused subscript violations.
5464         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5465         (hash_initialize): Add 'fail:' label
5466         to free table and return NULL, and use it to simplify code.
5467         Use calloc rather than clearing the storage ourself.
5468         (hash_initialize, hash_rehash): Check for arithmetic overflow in
5469         buffer size calculations.
5470         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5471         Include <stddef.h>, for size_t.
5472         * hash-pjw.c (hash_pjw): Likewise.
5473         Switch to method described by Bruno Haible.
5474         Include <limits.h>, for CHAR_BIT.
5475         (SIZE_BITS): New macro.
5476
5477 2003-10-21  Paul Eggert  <eggert@twinsun.com>
5478
5479         * getndelim2.c (getndelim2): When size calculation overflows,
5480         ceiling the allocation at NMAX bytes rather than silently
5481         discarding input bytes before NMAX is reached.  This makes
5482         a difference only if NMAX exceeds SIZE_MAX / 2.
5483
5484         * obstack.c: Merge from glibc.
5485         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5486         Add libc_hidden_def (_obstack_newchunk).
5487         (_obstack_free) [! defined _LIBC]: Remove.
5488         [defined _LIBC]: Make a strong alias from obstack_free, rather than
5489         a clone of the function body.
5490         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5491         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5492
5493         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5494         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5495         arg to memcpy.
5496
5497         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5498         (obstack_ptr_grow_fast, obstack_int_grow_fast):
5499         Don't use lvalue casts, as GCC plans to remove support for them
5500         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
5501         was also present in the non-GCC version, indicating that this
5502         code had always been buggy and had never been widely used.
5503         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5504         Use the fast variant of each macro, rather than copying the
5505         definiens of the fast variant; that way, we'll be more likely to
5506         catch future bugs in the fast variants.
5507
5508 2003-10-20  Bruno Haible  <bruno@clisp.org>
5509
5510         * wait-process.h: New file, from GNU gettext.
5511         * wait-process.c: New file, from GNU gettext.
5512
5513 2003-10-19  Jim Meyering  <jim@meyering.net>
5514
5515         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5516
5517 2003-10-16  Paul Eggert  <eggert@twinsun.com>
5518
5519         * getgroups.c: Include <errno.h>, <stdlib.h>.
5520         (getgroups): First arg is int, not size_t.
5521         Don't let 'free' mangle errno.
5522
5523 2003-10-16  Jim Meyering  <jim@meyering.net>
5524
5525         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5526
5527 2003-10-15  Paul Eggert  <eggert@twinsun.com>
5528
5529         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5530         (SIZE_MAX): Remove.
5531         (new_exclude, add_exclude_file): Initial size no longer needs to
5532         be a power of 2.
5533         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5534         our own address arithmetic overflow checking.
5535
5536         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5537         (fnmatch): Do not alloca more than 2000 wide characters;
5538         instead, use malloc for large buffers.
5539         Check for address arithmetic overflow, and return -1
5540         with errno set to ENOMEM in that case.
5541         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5542         (NEW_PATTERN): Do not alloca more than 8000 bytes;
5543         instead, return -1.  Check for address arithmetic overflow.
5544
5545 2003-10-14  Paul Eggert  <eggert@twinsun.com>
5546
5547         Handle invalid suffixes and overflow independently, so that
5548         callers can treat them independently as needed.  Fix some bugs in
5549         suffix handling, e.g., "100k@" was not diagnosed as an invalid
5550         suffix for a human-readable blocksize.  The major caller-visible
5551         change is the addition of a new
5552         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5553         that both overflow and suffix chars were found.
5554
5555         * human.c (humblock): Don't check separately for invalid suffix
5556         char; that is xstrtoumax's job (now that its bug is fixed).
5557         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5558         INTMAX_MAX]: New macros.
5559         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5560         TYPE_MAXIMUM): New macros.
5561         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5562         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5563         if overflow occurs, as it's what __strtol does and it's more useful
5564         in practice.
5565         (__xstrtol): If __strtol reports some error other than ERANGE,
5566         reflect it to the caller as LONGINT_INVALID.  If it reports
5567         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5568         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5569         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5570         value.
5571         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
5572         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5573         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5574         [defined UINTMAX_MAX]: New macros.
5575
5576 2003-10-14  Bruno Haible  <bruno@clisp.org>
5577
5578         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5579         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5580         Also use volatile where needed.
5581
5582 2003-10-12  Paul Eggert  <eggert@twinsun.com>
5583
5584         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
5585         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
5586         and define in terms of the other primitives.
5587         * xmalloc.c: Include stdbool.h; do not include exit.h.
5588         (SIZE_MAX): Define if not already defined.
5589         (array_size_overflow): New function.
5590         (xalloc_die): Abort instead of exiting if 'error' returns.
5591         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
5592         (xmalloc, xrealloc): Use them.
5593         (xcalloc): Check for address arithmetic overflow.
5594         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
5595         a bit faster than strcpy.
5596
5597 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5598
5599         Merge getpass from libc, plus a few fixes.
5600
5601         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
5602         Include <stdbool.h>.
5603         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
5604         __fsetlocking to empty.
5605         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
5606         do include <bits/libc-lock.h>.
5607         Do not include <fcntl.h>; not needed.
5608         [_LIBC]: Include <wchar.h>.
5609         (NOTCANCEL_MODE): New macro.
5610         (flockfile, funlockfile) [_LIBC]: New macros.
5611         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
5612         [!_LIBC]: New macros.
5613         (call_fclose): New function.
5614         (getpass): Use it.  Save tty stream separately; this simplifies the
5615         code and makes it more reliable if stdin happens to equal stdout.
5616         Invoke __fsetlocking on tty.
5617         Handle thread cancellation if needed.
5618         Namespace cleanup (use __tcgetattr, __getline).
5619         Use bool for Booleans.
5620         [USE_IN_LIBIO]: Handle wide streams.
5621         [!_LIBC]: Unconditionally do the fseek, since we don't know what
5622         stream might go where.
5623
5624         * unlocked-io.h: Include <stdio.h>, so that the caller
5625         doesn't have to include <stdio.h> before us.
5626         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
5627         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
5628         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
5629         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
5630         if not declared, so that we can use getpass.c code from libc without
5631         rewriting it.
5632         (flockfile, ftrylockfile, funlockfile): New macros.
5633
5634 2003-10-06  Bruno Haible  <bruno@clisp.org>
5635
5636         * version-etc-2.h: Remove file.
5637         * version-etc-2.c: Remove file.
5638
5639 2003-09-25  Jim Meyering  <jim@meyering.net>
5640             Bruno Haible  <bruno@clisp.org>
5641
5642         This lets translators provide better translations for the
5643         "Written by ..." part of --version output.
5644         * version-etc.h: Include stdarg.h.
5645         (version_etc_copyright): Declare as readonly.
5646         (version_etc): Make this function variadic with a NULL-terminated list
5647         of author name strings.
5648         (version_etc_va): New declaration.
5649         * version-etc.c: Include stdarg.h, stdlib.h.
5650         (version_etc_copyright): Declare as readonly.
5651         (version_etc_va): New function. Provide a different translatable string
5652         for each possible number of authors < 10. Abbreviate when there are 10
5653         authors or more.
5654         (version_etc): Make this function variadic. Call version_etc_va.
5655         Suggestion from Gary V. Vaughan.
5656
5657         * long-options.h (parse_long_options): Change prototype: the authors
5658         string is moved to the end and becomes variadic.
5659         * long-options.c: Include stdarg.h.
5660         (parse_long_options): Make this function variadic, too.
5661         Call version_etc_va, not version_etc.
5662
5663 2003-10-06  Bruno Haible  <bruno@clisp.org>
5664
5665         * fatal-signal.h: New file, from GNU gettext.
5666         * fatal-signal.c: New file, from GNU gettext.
5667
5668 2003-10-04  Karl Berry  <karl@gnu.org>
5669
5670         * argp*: update from libc.
5671
5672 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
5673
5674         * getpass.c (getpass): Use a no-op fseek when switching from input to
5675         output mode on the same stream.
5676
5677 2003-09-29  Paul Eggert  <eggert@twinsun.com>
5678
5679         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
5680         Fix arg typo in previous patch.
5681
5682 2003-09-28  Jim Meyering  <jim@meyering.net>
5683
5684         * error.c: Correct cpp indentation.
5685
5686 2003-09-27  Paul Eggert  <eggert@twinsun.com>
5687
5688         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
5689         Omit the special code that used __typeof__, since we worry that
5690         it could be more trouble than it's worth.  See:
5691         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
5692         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
5693
5694         * free.c: New file.
5695
5696 2003-09-26  Jim Meyering  <jim@meyering.net>
5697
5698         * error.c (error_tail): Move some declarations
5699         into inner scope where the local variables are used.
5700
5701 2003-09-26  Bruno Haible  <bruno@clisp.org>
5702
5703         * stpncpy.h (gnu_stpncpy): New declaration.
5704         (stpncpy): Define as alias for gnu_stpncpy.
5705         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
5706
5707 2003-09-26  Paul Eggert  <eggert@twinsun.com>
5708
5709         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
5710         (error_tail): Do not loop, reallocating temporary buffer, since
5711         the output cannot contain more wide characters than the input
5712         contains bytes, the size must be big enough already.  This avoids
5713         one potential size overflow calculation.  Check for size overflow
5714         when calculating temporary buffer size.  Free temporary buffer
5715         when done, if it was allocated with malloc; this plugs a memory
5716         leak.  Remove casts from void * to pointers, that are no longer
5717         needed now that we're assuming C89 or better.
5718
5719         Merge error changes from glibc.
5720
5721         * error.c, error.h: Update copyright notice header to match glibc.
5722         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
5723         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
5724         Disable cancellation while printing error.
5725         * error.h: Prepend __ to parameter names.
5726
5727 2003-09-25  Karl Berry  <karl@gnu.org>
5728
5729         * argp-fmtstream.c, argp-help.c: update from libc.
5730
5731 2003-09-25  Bruno Haible  <bruno@clisp.org>
5732
5733         * version-etc-2.h: New file, from version-etc.h with modifications.
5734         * version-etc-2.c: New file, from version-etc.c with modifications.
5735
5736 2003-09-25  Simon Josefsson  <jas@extundo.com>
5737
5738         * xgetdomainname.h: New file.
5739         * xgetdomainname.c: New file.
5740
5741 2003-09-25  Simon Josefsson  <jas@extundo.com>
5742             Bruno Haible  <bruno@clisp.org>
5743
5744         * getdomainname.h: New file.
5745         * getdomainname.c: New file.
5746
5747 2003-09-24  Paul Eggert  <eggert@twinsun.com>
5748
5749         * linebuffer.c (freebuffer): Don't free the argument, just
5750         the buffer associated with the argument.  Bug reported by
5751         Simon Josefsson.
5752
5753 2003-09-19  Karl Berry  <karl@gnu.org>
5754
5755         * argp.h: update from libc.
5756
5757 2003-09-16  Paul Eggert  <eggert@twinsun.com>
5758
5759         * linebuffer.c (readlinebuffer): Return NULL immediately upon
5760         input error, instead of returning NULL the next time we are called
5761         (and therefore losing track of errno).
5762
5763 2003-09-15  Paul Eggert  <eggert@twinsun.com>
5764
5765         * getndelim2.c (getndelim2): Don't trash errno when a read
5766         fails, so that the caller gets the proper errno.
5767
5768         * readutmp.c (read_utmp): Likewise.
5769         Check for fstat error.  Close stream and free storage
5770         when failing.
5771
5772 2003-09-14  Bruno Haible  <bruno@clisp.org>
5773
5774         * fwriteerror.h: New file.
5775         * fwriteerror.c: New file.
5776
5777 2003-09-14  Jim Meyering  <jim@meyering.net>
5778
5779         * getloadavg.c: Correct cpp indentation.
5780         * strdup.c: Likewise.
5781         * vasnprintf.c: Likewise.
5782
5783 2003-09-12  Paul Eggert  <eggert@twinsun.com>
5784
5785         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
5786         * obstack.c [!defined _LIBC]: Likewise.
5787         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
5788         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
5789         * exitfail.c: Don't include stdlib.h; no longer needed.
5790
5791         More changes to assume C89 or better.
5792
5793         * error.c (error_tail): Assume vprintf.
5794
5795         * argmatch.c (getenv): Remove decl.
5796         * progreloc.c (get_full_program_name): Define via prototype.
5797         * setenv.c (clearenv): Likewise.
5798         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
5799         needed.
5800         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
5801         (malloc, memcpy): Remove decls.
5802         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
5803         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
5804         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
5805         (memcpy): Remove macro.
5806         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
5807         (__P): Remove.  All uses removed.
5808         (PTR): Remove.  All uses changed to void *.
5809         (CHAR_BIT, NULL): Remove.
5810         (spaces, zeros, memset_space, memset_zero)
5811         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
5812         Remove.
5813         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
5814         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
5815         Define with prototype.
5816         Remove now-unnecessary prototype decl.
5817         (extra_args_spec): Assume ANSI C.  All uses changed.
5818         (extra_args_spec_iso): Remove.
5819         (my_strftime, emacs_strftimeu): Define via prototype.
5820         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
5821         unconditionally.
5822         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
5823         * strtoimax.c: Include <stdlib.h> unconditionally.
5824         (strtoul, strtol): Remove decls.
5825         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
5826         LONG_MAX): Remove.
5827         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
5828         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
5829         (LOCALE_PARAM_PROTO): New macro.
5830         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
5831         (INTERNAL (strtol), strtol): Define with a prototype.
5832         (PARAMS): Remove.  All uses removed.
5833         * tempname.c: Include <string.h> unconditionally.
5834         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
5835         * xgethostname.c (main): Define with a prototype.
5836         * xmalloc.c: Include "xalloc.h" first, to check interface.
5837         Include <stdlib.h> unconditionally.
5838         (calloc, malloc, realloc, free): Remove decls.
5839         * xstrtod.c: Include "xstrtod.h" first, to check interface.
5840         Include <stdlib.h> unconditionally.  Sort include file names.
5841         (strtod): Remove.
5842         (xstrtod): Define with a prototype.
5843         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
5844         (strtol, strtoul): Remove decls.
5845
5846 2003-09-11  Paul Eggert  <eggert@twinsun.com>
5847
5848         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
5849         Include <stdlib.h>, <string.h> unconditionally.
5850         Remove now-unnecessary cast to char *.
5851         * strnlen.c: Include <string.h> unconditionally.
5852         * yesno.c (yesno): Define with a prototype.
5853
5854 2003-09-10  Bruno Haible  <bruno@clisp.org>
5855
5856         * strcspn.c: Include <string.h> unconditionally.
5857         * strpbrk.c: Include <string.h> unconditionally.
5858         * strstr.c: Include <string.h> unconditionally.
5859         * unicodeio.c: Include <string.h> unconditionally.
5860         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
5861         * unsetenv.c: Likewise.
5862         * xreadlink.c: Include <stdlib.h> unconditionally.
5863         * yesno.c: Include <stdlib.h> unconditionally.
5864         (rpmatch): Add prototype.
5865
5866 2003-09-10  Jim Meyering  <jim@meyering.net>
5867
5868         * error.c: Correct indentation of cpp directives.
5869
5870 2003-09-09  Paul Eggert  <eggert@twinsun.com>
5871
5872         More K&R removal.
5873
5874         * acosl.c (main): Use a prototype.
5875         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
5876         tanl.c: Likewise.
5877
5878         * getloadavg.c (getloadavg, main): Define via prototypes.
5879
5880         * getopt.h (struct option.name): Assume C89, and use 'const'.
5881         (getopt, etopt_long, getopt_long_only, _getopt_internal)
5882         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
5883         with a prototype.
5884         * getopt.c (const): Remove macro.
5885         Include <string.h> unconditionally.
5886         (my_index): Remove; all uses changed to strchr.
5887         (strlen): Remove decl.
5888         (exchange): Remove forward decl; no longer needed.
5889         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
5890         Define with prototype.
5891         * getopt1.c (const): Remove macro.
5892         (getopt_long, getopt_long_only, main): Define with prototype.
5893
5894         * getugroups.c: Include <string.h> unconditionally.
5895
5896         * getusershell.c: Include <stdlib.h> unconditionally.
5897         (getusershell, setusershell, endusershell, readname, main):
5898         Define with prototypes.
5899
5900         * group-member.c: Include group-member.h first.
5901         Include <stdlib.h> unconditionally.
5902
5903         * hard-locale.c: Include hard-locale.h first.
5904         Include <stdlib.h>, <string.h> unconditionally.
5905
5906         * hash.c (free, malloc): Remove decls.
5907         Include <stdlib.h> unconditionally.
5908
5909         * human.c: Include <stdlib.h>, <string.h> unconditionally.
5910         (getenv): Do not declare.
5911
5912         * idcache.c: Include <string.h> unconditionally.
5913
5914         * long-options.c: Include long-options.h first, to test interface.
5915         Include <stdlib.h> unconditionally.
5916
5917         * makepath.c: Include makepath.h first, to test interface.
5918         Include <stdlib.h> and <string.h> unconditionally.
5919
5920         * linebuffer.c: Include <stdlib.h>.
5921         (free): Remove decl.
5922
5923         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
5924         rpl_malloc returns void *, not char *.
5925         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
5926
5927         * md5.h: Include <limits.h> unconditionally.
5928         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
5929         (__P): Remove; all uses removed.
5930         * md5.c: Include "md5.h" first.
5931         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
5932         md5_buffer, md5_process_bytes, md5_process_block):
5933         Define with prototypes.
5934         * sha.h (__P): Remove all uses.  (It wasn't defined??)
5935         * sha.c: Include "sha.h" first.
5936         Include <stdlib.h>, <string.h> unconditionally.
5937
5938         * memchr.c (__ptr_t): Remove; all uses changed to void *.
5939         * memcmp.c (__ptr_t): Likewise.
5940         * memrchr.c (__ptr_t): Likewise.
5941         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
5942         Include <string.h> unconditionally.
5943         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
5944         * memchr.c: Include <stdlib.h> unconditionally.
5945         * memchr.c (LONG_MAX): Remove.
5946         * memrchr.c (LONG_MAX): Likewise.
5947         * memchr.c (__memchr): Define via a prototype.
5948         * memrchr.c (__memrchr): Likewise.
5949         * memcmp.c (__P): Remove, and remove all uses.
5950         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
5951         Remove forward decls; no longer needed.
5952         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
5953         Use types required by C89 in prototype.
5954
5955         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
5956         * savedir.c: Likewise.
5957         * mkdir.c (free): Remove decl.
5958         * rmdir.c (rmdir): Define with a prototype.
5959         * savedir.c: Include savedir.h first, to test interface.
5960
5961         * mktime.c (STDC_HEADERS): Remove.
5962         Include <stdlib.h>, <string.h> unconditionally.
5963
5964         * modechange.c: Include <stdlib.h> unconditionally.
5965         (malloc): Remove decl.
5966
5967         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
5968         (free): Remove decl.
5969
5970         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
5971         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
5972         (This type really should be intptr_t, but that's a C99ism.)
5973         (_obstack_memcpy): Remove: all uses changed to memcpy.
5974         Include <string.h> unconditionally.
5975         (struct obstack): Assume __STDC__ for types of members
5976         chunkfun, freefun, extra_arg.
5977         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
5978         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
5979         obstack_begin, obstack_specify_allocation,
5980         obstack_specify_allocation_with_arg, obstack_chunkfun,
5981         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
5982         Remove unprototyped decls and the macros that use them.
5983         * obstack.c (POINTER): Remove.  All uses changed to void *.
5984         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
5985         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
5986         (defined __STDC__ && __STDC__)]:
5987         Remove nonprototyped code.
5988         Include <stdlib.h> unconditionally.
5989         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
5990         _obstack_allocated_p, _obstack_free, obstack_free,
5991         _obstack_memory_used, print_and_abort):
5992         Define using prototypes.
5993         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
5994         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
5995         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
5996         obstack_next_free, obstack_object_size, obstack_room) [0]:
5997         Remove unused, unprototyped code.
5998
5999         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6000
6001         * physmem.c (physmem_total, physmem_available, main): Define
6002         with prototypes.
6003
6004         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6005         (main): Define with a prototype.
6006
6007         * posixver.c (getenv): Remove decl.
6008
6009         * putenv.c (malloc): Returns void *, not char *.
6010         Include <string.h> unconditionally.
6011         (strchr, memcpy, NULL): Do not define.
6012
6013         * readtokens.c: Include readtokens.h first, to test interface.
6014         Include <stdlib.h>, <string.h> unconditionally.
6015         (init_tokenbuffer): Define with a prototype.
6016
6017         * regex.c (PARAMS): Remove.  All uses removed.
6018         All uses of _RE_ARGS removed, too.
6019         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6020         unconditionally.
6021         (bzero): Assume memset exists.
6022         (memcmp, memcpy, NULL): Remove.
6023         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6024         char, or assignments to local vars of type signed char.
6025         (init_syntax_once, PREFIX(extract_number_and_incr),
6026         PREFIX(print_partial_compiled_pattern),
6027         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6028         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6029         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6030         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6031         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6032         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6033         wcs_compile_range, byte_compile_range, truncate_wchar,
6034         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6035         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6036         count_mbs_length, wcs_re_match_2_internal,
6037         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6038         PREFIX(alt_match_null_string_p),
6039         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6040         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6041         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6042         now-unnecessary declaration, if any.
6043         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6044         regcomp, regexec):
6045         Remove now-unnecessary casts among pointer types.
6046         * regex.h (_RE_ARGS): Remove.  All uses removed.
6047
6048         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6049         (free): Remove decl.
6050
6051         * rpmatch.c: Include <stdlib.h> unconditionally.
6052
6053         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6054         (free): Remove decl.
6055
6056         * save-cwd.c: Include <stdlib.h> unconditionally.
6057         * xgetcwd.c: Likewise.
6058
6059         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6060         (free): Remove decl.
6061
6062         * strchrnul.c (strchrnul): Define with a prototype.
6063         Fix bug: c_in was not converted to char before searching.
6064
6065         The following changes are not K&R related:
6066
6067         * group-member.h: Include <sys/types.h>, so that this file is
6068         self-contained.
6069         * makepath.h: Likewise.
6070
6071         * getusershell.c (readname, default_index, line_size, readname):
6072         Use size_t, not int, for sizes.
6073         (readname): If the size overflows, report an error instead of
6074         looping forever.
6075
6076 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6077
6078         * getndelim2.c: Assume stdlib.h per the C89 spec.
6079
6080 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6081
6082         Assume C89 or better; remove K&R cruft.
6083         A few of these changes were first proposed by Derek Robert Price
6084         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6085
6086         * addext.c: Include <string.h> unconditionally.
6087         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6088         Don't declare getenv or malloc.
6089
6090         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6091         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6092         (NULL): Remove.
6093         (find_stack_direction, alloca): Use prototypes.
6094
6095         * atexit.c (atexit): Define using a prototype.
6096
6097         * basename.c, dirname.c, stripslash.c:
6098         Include <string.h> unconditionally.
6099
6100         * bcopy.c: Include <stddef.h>.
6101         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6102
6103         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6104
6105         * error.h (error, error_at_line, error_print_progname)
6106         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6107         * error.c: Include error.h first, to check interface.
6108         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6109         (VA_START): Remove; all uses changeed to va_start.
6110         (exit, strerror): Remove decls.
6111         (error_print_progname): Prototype uncondionally.
6112         Don't include <errno.h>; no longer needed.
6113         (private_strerror): Remove.
6114         (error_tail): Always define.
6115         (error, error_at_line): Assume C89 or better; always use prototypes.
6116         * fatal.c: Include "fatal.h" first, to test interface.
6117         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6118         (VA_START): Remove; all uses changed to va_start.
6119         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6120         this case.
6121         (exit): Remove decl.
6122         (fatal): Prototype unconditionally.  Assume va_start works.
6123         Abort at end, to pacify gcc.
6124
6125         * euidaccess.c (main): Define with a prototype.
6126
6127         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6128
6129         * exitfail.c: Include <stdlib.h> unconditionally.
6130
6131         * fnmatch_.h (__P): Remove.  All uses changed to assume
6132         prototypes.
6133         * fnmatch.c: Include fnmatch.h first, to test interface.
6134         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6135         (getenv): Remove decl.
6136         (fnmatch): Define using a prototype.
6137         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6138         (FCT): Define using a prototype.
6139
6140         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6141
6142         * gethostname.c: Include <stddef.h>.
6143         (gethostname): Define with prototype.  Length is size_t, not int.
6144
6145 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6146
6147         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6148         getversion.c should have been removed then, but was accidentally
6149         preserved.
6150
6151         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6152         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6153
6154 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6155
6156         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6157         copy_tm_result.  Bug reported by Simon Josefsson in
6158         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6159
6160 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6161
6162         * time_r.c, time_r.h: New files.
6163
6164         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6165         __localtime_r.
6166         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6167         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6168
6169         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6170         __gmtime_r.
6171         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6172         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6173         Include <time_r.h>.
6174
6175         * timegm.c: Switch to glibc implementation, with the following changes:
6176         [defined HAVE_CONFIG_H]: Include <config.h>.
6177         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6178         (__mktime_internal) [!defined _LIBC]: New decl.
6179         (__gmtime_r) [!defined _LIBC]: New macro and function.
6180         (timegm): Use a prototype, since gnulib assumes C89.
6181         Do not bother declaring tmp to be const, as it's not really usefu.
6182         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6183         (timegm): Declare only if HAVE_DECL_TIMEGM.
6184
6185 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6186
6187         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6188         Bug reported by Lute Kamstra in
6189         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6190
6191         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6192         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6193         course with correspondingly smaller numbers for tomorrow and
6194         yesterday.  From Tadayoshi Funaba.  Originally installed into
6195         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6196         coreutils merge?).
6197
6198 2003-08-31  Simon Josefsson  <jas@extundo.com>
6199
6200         * timegm.h: New file.
6201         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6202
6203 2003-08-31  Karl Berry  <karl@gnu.org>
6204
6205         * argp.h: update from libc.
6206
6207 2003-08-28  Bruno Haible  <bruno@clisp.org>
6208
6209         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6210         warning on QNX, which defines O_BINARY to 000000.
6211
6212 2003-08-24  Bruno Haible  <bruno@clisp.org>
6213
6214         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6215         MSVC7 <stdio.h> is included later.
6216
6217 2003-08-20  Bruno Haible  <bruno@clisp.org>
6218
6219         * progname.h: New file, from GNU gettext.
6220         * progname.c: New file, from GNU gettext.
6221         * progreloc.c: New file, from GNU gettext.
6222
6223 2003-08-19  Bruno Haible  <bruno@clisp.org>
6224
6225         * xstrdup.c: Assume <string.h> exists.
6226
6227 2003-08-18  Jim Meyering  <jim@meyering.net>
6228
6229         * setenv.h: Indent nested cpp directive.
6230         * vasnprintf.c: Remove trailing blanks.
6231
6232 2003-08-17  Simon Josefsson  <jas@extundo.com>
6233             Bruno Haible  <bruno@clisp.org>
6234
6235         * xstrndup.h: New file.
6236         * xstrndup.c: New file.
6237
6238 2003-08-17  Bruno Haible  <bruno@clisp.org>
6239
6240         * strndup.h: New file.
6241
6242 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6243
6244         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6245         space, undoing this 2003-08-12 change:
6246         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6247
6248 2003-08-16  Jim Meyering  <jim@meyering.net>
6249
6250         Merge from coreutils.
6251         * xstrtoimax.c: #else #if -> #elif.
6252         * xstrtoumax.c: Likewise.
6253
6254 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6255
6256         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6257         rather than tab, after '#' in shell-script copyright notices.
6258         Suggested by Bruno Haible.
6259
6260 2003-08-15  Jim Meyering  <jim@meyering.net>
6261         and Paul Eggert  <eggert@twinsun.com>
6262
6263         Merge from coreutils.
6264         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6265         member but strut utmpx does not.  Needed for AIX 4.3.3.
6266         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6267
6268 2003-08-15  Jim Meyering  <jim@meyering.net>
6269
6270         Merge from coreutils.
6271         * xgethostname.c: Include <stdlib.h>.
6272         (xghostname): Don't exit for anything other than memory-related
6273         failure; just return NULL.
6274         * userspec.c: Include "posixver.h".
6275         (parse_user_spec): Accept `.' as a separator only
6276         in pre-POSIX-200112 mode.
6277         * strtoimax.c: Use #elif rather than #else #if.
6278         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6279         Remove function, now that we can rely on a working tzset function.
6280         [!_LIBC]: Ensure that the required autoconf test has been run.
6281         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6282         Use underlying_strftime for %r.
6283         * sha.c: Merge in some clean-up and optimization changes from glibc.
6284         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6285         Ensure that it is a multiple of 64.
6286         Rearrange loop exit tests so as to avoid performing an
6287         additional fread after encountering an error or EOF.
6288         * realloc.c: Update copyright date.
6289
6290 2003-08-14  Jim Meyering  <jim@meyering.net>
6291
6292         Merge from coreutils.
6293         * obstack.h: Whitespace changes.
6294         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6295         and xcalloc return values.
6296         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6297         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6298         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6299         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6300         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6301         error from mntctl.
6302         Use mntctl's return value to drive the entry-processing loop, since
6303         we can't rely on the value of the vmt_length member in the last
6304         entry.  On some systems doing so could result in exhausting
6305         virtual memory.  Based in part on a patch from Mike Jetzer.
6306
6307 2003-08-14  Jim Meyering  <jim@meyering.net>
6308         and Paul Eggert  <eggert@twinsun.com>
6309
6310         Merges from coreutils, plus other fixes.
6311         * physmem.c: Merge in portability changes from gcc/libiberty
6312         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6313         for credits and details.  Thanks to Kaveh Ghazi for helping
6314         to keep these files in sync.
6315         (ARRAY_SIZE): Define it.
6316         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6317         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6318         (memcasecmp): Don't assume size_t fits in unsigned int.
6319         Remove casts and duplicate code.
6320         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6321         (memcpy): Remove definition.
6322         Merge in some clean-up and optimization changes from glibc.
6323         [BLOCKSIZE]: Move definition to top of file.
6324         Ensure that it is a multiple of 64.
6325         Rearrange loop exit tests so as to avoid performing an
6326         additional fread after encountering an error or EOF.
6327         * md5.h (md5_uintptr): Define.
6328         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6329         return to the initial working directory.  Preserve errno
6330         for caller.
6331         * idcache.c: Include "xalloc.h".
6332         (xmalloc, xrealloc): Remove decls.
6333         (getuser): Remove casts no longer required in C89.
6334         * human.c: Include stdio.h, for sprintf.
6335         * group-member.c: Include "xalloc.h".
6336         (xmalloc, xrealloc): Remove decls.
6337         (get_group_info): Remove casts no longer required in C89.
6338         * getusershell.c (readname): Remove casts no longer required in C89.
6339         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6340         * getline.c: Whitespace fix, from coreutils.
6341
6342 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6343
6344         * exclude.c: Include <ctype.h>
6345         (IN_CTYPE_DOMAIN): New macro.
6346         (is_space): New fn.
6347         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6348         and empty lines.
6349
6350         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6351         Undo previous (whitespace-only) change.
6352
6353 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6354
6355         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6356         Normalize leading white space and remove trailing white space.
6357         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6358         notice, as per ../config/srclist-update.
6359
6360         Merge from coreutils.
6361         * euidaccess.h: New file.
6362         * euidaccess.c: Include it.
6363         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6364         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6365         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6366
6367 2003-08-11  Bruno Haible  <bruno@clisp.org>
6368
6369         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6370         (vasnprintf): Use it instead of wcslen.
6371
6372 2003-08-11  Bruno Haible  <bruno@clisp.org>
6373
6374         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6375         value to ensure that _Bool promotes to int. Use #define for _Bool when
6376         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6377
6378 2003-08-10  Karl Berry  <karl@gnu.org>
6379
6380         * regex.h: update from libc (whitespace fix).
6381
6382 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6383
6384         Merge some files from coreutils.  These changes were
6385         originally made by Jim Meyering.
6386         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6387         many older Unixes require this.
6388         * alloca.c (alloca): Remove cast to argument of free;
6389         no longer needed in C89.
6390         * alloca_.h, regex.h: Fix white space to match
6391         what GNU indent does.
6392
6393 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6394
6395         * bumpalloc.h: Remove.
6396
6397 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6398
6399         * getloadavg.c: Change copyright notice and spacing to conform to
6400         GNU coding style.
6401
6402         Merge from coreutils.
6403         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6404         From glibc.
6405         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6406         from Karl Berry, implemented by Jim Meyering.
6407         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6408         from Dmitry V. Levin.
6409         Remove anachronistic cast of xrealloc.
6410         * fnmatch_.h (__const): Remove.  Use 'const'.
6411         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6412         type. Otherwise, it wouldn't compile with at least /bin/cc on
6413         ymp-cray-unicos9.0.2.X.
6414         Combine two mostly-identical uses of alloca into one.
6415         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6416
6417 2003-08-04  Dave Love <d.love@dl.ac.uk>
6418
6419         [From Emacs.]
6420
6421         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
6422         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
6423         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6424         obsolete NLIST_NAME_UNION.
6425         [__GNU__]: Undef BSD and FSCALE.
6426         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6427
6428 2003-08-03  Paul Eggert  <eggert@twinsun.com>
6429
6430         * stdbool_.h (_Bool): Make it signed char, instead of
6431         an enum type, so that it's guaranteed to promote to int.  See:
6432         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6433
6434 2003-07-31  Paul Eggert  <eggert@twinsun.com>
6435
6436         * strerror.c: Include config.h, limits.h.  Declare sprintf.
6437         (strerror): Don't assume that a printable int fits in 14 bytes.
6438
6439 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
6440             Bruno Haible  <bruno@clisp.org>
6441
6442         * getline.h (getline, getdelim): Change return type to ssize_t.
6443         * getline.c (getline, getdelim): Likewise.
6444         Remove _GNU_SOURCE define; now it's defined in config.h through
6445         m4/getline.m4.
6446
6447 2003-07-22  Paul Eggert  <eggert@twinsun.com>
6448
6449         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6450         over-parenthesization in macros.
6451
6452         Sync with coreutils.
6453
6454         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6455         required by C99.
6456
6457         Use `exit_failure' for xalloc and xmemcoll instead of their own
6458         private exit-failure variables.
6459         * xalloc.h (xalloc_exit_failure): Remove.
6460         * xmalloc.c: Likewise.  Include exitfail.h.
6461         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6462         * xmemcoll.h (xmemcoll_exit_failure): Remove.
6463         * xmemcoll.c: Likewise.  Include exitfail.h.
6464         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6465
6466 2003-07-18  Paul Eggert  <eggert@twinsun.com>
6467
6468         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6469         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
6470         to test that it can stand by itself.  Include "exitfail.h".
6471         Clients should set exit_failure instead.
6472         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
6473
6474 2003-07-18  Andreas Schwab  <schwab@suse.de>
6475
6476         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6477
6478 2003-07-18  Bruno Haible  <bruno@clisp.org>
6479
6480         * getndelim2.h: New file.
6481         * getndelim2.c: Make into a module of its own. Include config.h,
6482         getndelim2.h.
6483         (getndelim2): Make non-static. Change return type to ssize_t.
6484         * getline.h: Change argument names.
6485         * getline.c: Include getndelim2.h instead of getndelim2.c.
6486         * getnline.c: Include getndelim2.h.
6487
6488 2003-07-17  Bruno Haible  <bruno@clisp.org>
6489
6490         * Makefile.am: Remove file.
6491         * Makefile.in: Remove file.
6492
6493 2003-07-17  Bruno Haible  <bruno@clisp.org>
6494
6495         * getnline.h: New file.
6496         * getnline.c: New file.
6497         * getndelim2.c: New file, extracted from getline.c.
6498         (getndelim2): Renamed from getdelim2, with added nmax argument.
6499         * getline.c: Include getndelim2.c.
6500         (getdelim2): Moved out to getndelim2.c.
6501         (getline, getdelim): Update.
6502
6503 2003-07-15    <karl@gnu.org>
6504
6505         * vasnprintf.c: update from gettext.
6506
6507 2003-07-15  Jim Meyering  <jim@meyering.net>
6508
6509         * makepath.c (make_path): Enclose diagnostic in _(...).
6510
6511 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6512
6513         * asnprintf.c, asprintf.c, config.charset, gettext.h,
6514         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6515         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6516         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6517         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
6518         updated automatically by ../config/srclist-update.  This changes
6519         their license from LPGL to GPL.
6520
6521 2003-07-14  Jim Meyering  <jim@meyering.net>
6522
6523         Don't emit diagnostics.  Let callers do that.
6524         * save-cwd.c: Don't include "error.h".
6525         (save_cwd): Don't call error.  Ensure that errno is valid
6526         when returning nonzero.
6527
6528         * save-cwd.h (restore_cwd): Update prototype.
6529         * save-cwd.c (restore_cwd): Remove two parameters.
6530         Simplify.  Don't call error upon failure.  Let callers do that.
6531         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6532         when auditing is enabled.  But don't bother updating the #if.
6533
6534 2003-07-14  Simon Josefsson  <jas@extundo.com>
6535
6536         * mempcpy.h: New file.
6537         * mempcpy.c: New file.
6538
6539 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6540
6541         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6542         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6543         unicodeio.c, unicodeio.h, unlocked-io.h:
6544         Switch from LGPL to GPL.
6545
6546 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
6547
6548         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6549         it breaks C++ compilation.
6550         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6551
6552 2003-07-10  Jim Meyering  <jim@meyering.net>
6553
6554         * vasnprintf.c: Remove trailing blanks.
6555         Make cpp indentation consistent.
6556
6557 2003-07-09  Paul Eggert  <eggert@twinsun.com>
6558
6559         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6560         posixver.c, strftime.c, strnlen.c, strverscmp.c:
6561         Switch from LGPL to GPL.
6562
6563 2003-07-07  Paul Eggert  <eggert@twinsun.com>
6564
6565         * mktime.c: Fix some boundary cases and remove need for floating point.
6566
6567         Issue a compile-time diagnostic if time_t is floating point, or if
6568         two's complement arithmetic is not in effect, or if arithmetic
6569         right shift does not propagate the sign.  These assumptions were
6570         all in the original code but they weren't checked.
6571
6572         (TIME_T_MIDPOINT, verify): New macros.
6573         (__isleap): Remove; it has integer overflow problems.
6574         (leapyear): New function, without those problems.
6575         (ydhms_tm_diff): Remove; splitting into two parts.
6576         (ydhms_diff): New function, containing the arithmetic part of
6577         the old ydhms_tm_diff function.  Issue a compile-time
6578         diagnostic if we are not using C99 integer division.
6579         Avoid casts when possible.
6580         (guess_time_tm): New function, containing the checking part of
6581         the old ydhms_tm_diff function.  Return the new value, rather than
6582         the difference between it and the old.  Accept a new argument T
6583         so that *T specifies the old value.  Check for overflow in the result.
6584
6585         (__mktime_internal): Use a time_t offset, not a long int offset.
6586         This undoes the 2003-06-04 change, which is no longer needed now
6587         that we have better overflow checking.
6588         (localtime_offset): Likewise.
6589
6590         (__mktime_internal): Avoid harmful overflow on hosts where time_t
6591         and long are 64-bit but int is only 32-bit.
6592         (ydhms_diff): Use long int to store year1 and yday1.
6593         Issue a compile-time diagnostic if long int is not wide enough.
6594
6595         (__mktime_internal): Use long int to store adjusted year and yday.
6596         Use plain C rather than preprocessor commands, if that doesn't
6597         affect efficiency.
6598         Check for overflow (and try to repair) after each probe
6599         rather than checking only at the very end.  This avoids some bugs
6600         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
6601         does not equal GMT offset at maximum time).
6602         Use integer to check for overflow rather than floating point; this
6603         is more portable to non-IEEE hosts, and is a tad faster.
6604         When we detect that we are oscillating between two values,
6605         don't check whether tm_isdst has the requested value, since
6606         we already know the answer.  When tm_isdst has the wrong value,
6607         use a different heuristic to find the right one, based on the
6608         extreme values actually observed in practice in tz2003a,
6609         rather than the (overly optimistic) "previous 3 calendar quarters".
6610
6611         (not_equal_tm, print_tm, check_result): Use "const T" rather than
6612         "T const" to accommodate glibc style.
6613         (check_result): Use less-confusing report format.  "long" -> "long int.
6614         (main): Likewise.
6615         Don't loop if the iteration overflows time_t.
6616         Allow a negative step in the iteration.
6617
6618 2003-07-01  Paul Eggert  <eggert@twinsun.com>
6619
6620         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
6621         having it depend on HAVE_SYS_TYPES_H.
6622
6623 2003-06-25  Bruno Haible  <bruno@clisp.org>
6624
6625         * readlink.c: New file.
6626
6627 2003-06-20  Bruno Haible  <bruno@clisp.org>
6628
6629         Assume C89, so PARAMS isn't needed.
6630         * unicodeio.h (PARAMS): Remove.
6631         * unicodeio.c: Don't use PARAMS.
6632
6633 2003-06-18  Jim Meyering  <jim@meyering.net>
6634
6635         Merge changes from coreutils.
6636         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
6637         Remove explicit declarations of xmalloc and realloc.
6638         Include xalloc.h.
6639         (read_utmp): Remove anachronistic cast of xmalloc.
6640
6641 2003-06-17  Paul Eggert  <eggert@twinsun.com>
6642
6643         Assume C89, so PARAMS isn't needed.
6644         * backupfile.h (PARAMS): Remove.  All uses removed.
6645         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
6646         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
6647         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
6648         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
6649         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
6650         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
6651         xstrtol.h: Likewise.
6652         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
6653         same.h, strverscmp.h: Do not include config.h; no longer needed.
6654         Anyway, config.h should always be included before any other file.
6655
6656 2003-06-11  Simon Josefsson  <jas@extundo.com>
6657
6658         * sysexit_.h: New file.
6659
6660 2003-05-20  Derek Price  <derek@ximbiot.com>
6661
6662         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
6663
6664 2003-06-10  Simon Josefsson  <jas@extundo.com>
6665
6666         * strchrnul.h: New file.
6667         * strchrnul.c: New file.
6668
6669 2003-06-10  Simon Josefsson <jas@extundo.com>
6670
6671         * argp.h: New file, from glibc.
6672         * argp-ba.c: New file, from glibc.
6673         * argp-eexst.c: New file, from glibc.
6674         * argp-fmtstream.c: New file, from glibc.
6675         * argp-fmtstream.h: New file, from glibc.
6676         * argp-fs-xinl.c: New file, from glibc.
6677         * argp-help.c: New file, from glibc.
6678         * argp-namefrob.h: New file, from glibc.
6679         * argp-parse.c: New file, from glibc.
6680         * argp-pv.c: New file, from glibc.
6681         * argp-pvh.c: New file, from glibc.
6682         * argp-xinl.c: New file, from glibc.
6683
6684 2003-06-07  Jim Meyering  <jim@meyering.net>
6685
6686         * readtokens.h: Put `Free Software Foundation, Inc.'
6687         in place of my name in the copyright comment.
6688         Remove definition and uses of __P.
6689
6690         From coreutils.
6691         * stat.c: Don't declare xmalloc explicitly.
6692         Instead, include "xalloc.h".
6693         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
6694         xrealloc, and xcalloc return values.
6695         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
6696         Improve comment.
6697         * xgetcwd.h: Remove definition/uses of PARAMS.
6698
6699 2003-06-06  Jim Meyering  <jim@meyering.net>
6700
6701         * stdbool_.h: Renamed from stdbool.h.in.
6702
6703 2003-06-06  Jim Meyering  <jim@meyering.net>
6704
6705         Merge from coreutils.
6706         * same.c: (same_name): Declare *_basename locals to be `const'.
6707         Consolidate declarations and initializations of *_base* locals.
6708
6709         Merge from coreutils.
6710         This avoids a core dump on systems without GNU putenv,
6711         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
6712         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
6713         (unsetenv): New static function, from GNU libc.
6714         (rpl_putenv): Use it.
6715
6716         * modechange.c: Remove trailing blanks.
6717
6718         Merge from coreutils.
6719         * fsusage.c: Remove declaration of statfs.
6720         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
6721
6722         * posixtm.c: Include <stdbool.h> unconditionally.
6723
6724 2003-06-05  Paul Eggert  <eggert@twinsun.com>
6725
6726         * mktime.c (__mktime_internal): When resolving a tm_isdst
6727         mismatch, look in future quarters as well as past.  This fixes a
6728         bug when processing fall-backwards gaps immediately after a long
6729         period of daylight-saving time.
6730
6731         * mktime.c: Assume freestanding C89 or better.
6732         (HAVE_LIMITS_H): Remove.  Assume it's 1.
6733         (__P): Remove; not used.
6734         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
6735         (mktime, not_equal_tm, print_tm, check_result,
6736         main): Use prototypes.  Use const * where appropriate.
6737         (main): Fix typo in testing code that uncovered by above changes.
6738         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
6739
6740 2003-06-04  Paul Eggert  <eggert@twinsun.com>
6741
6742         * mktime.c: Fix Debian bug 177940
6743         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
6744         (localtime_offset): Now long int, not time_t, because we want it
6745         to be guaranteed to be signed.  All uses changed.
6746         (__mktime_internal): If overflow would occur when adding offset,
6747         don't add it.
6748
6749         Merge 'human' changes from coreutils.  Rewrite to support
6750         locale-specific notations like thousands separators.
6751         * human.c: Simplify authorship notice.
6752         Include human.h immediately after config.h.
6753         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
6754         <limits.h>: Do not include, since human.h does.
6755         (SIZE_MAX, UINTMAX_MAX): New macros.
6756         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
6757         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
6758         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
6759         (power_letter): Renamed from suffixes.
6760         (generate_suffix_backwards): Remove.
6761         (adjust_value): Now takes int style (because of human.h changes)
6762         and long double value (for greater precision on some platforms).
6763         (group_number): New function.
6764         (human_readable): Use it.  Use integer options, not enum.
6765         Put the options before the sizes in the arg list.
6766         Support all the new options.
6767         The old human_readable function has been removed;
6768         use inttostr.h instead.
6769         (human_readable, default_block_size, humblock):
6770         Use uintmax_t, not int, for block sizes.
6771         (human_readable_inexact, block_size_types): Remove.
6772         (block_size_opts): New constant.
6773         (human_options): Renamed from human_block_size, with new signature
6774         that allows block sizes up to UINTMAX_MAX.  All callers changed.
6775         * human.h: Add copyright and authorship notice.
6776         Include <limits.h> and <stdbool.h> unconditionally.
6777         (PARAMS): Remove.  All uses removed.
6778         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
6779         (enum human_inexact_style): Remove tag; now a nameless enum.
6780         (human_floor, human_ceiling, human_round_to_even): Now have
6781         values 2, 0, 1 rather than -1, 1, 0.
6782         (human_group_digits, human_suppress_point_zero, human_autoscale,
6783         human_base_1024, human_SI, human_B): New constants.
6784         (human_readable_inexact, human_block_size): Remove.
6785         (human_readable): Size args are now uintmax_t, not int.
6786         (human_options): New decl.
6787
6788         * exclude.c: (new_exclude, add_exclude): Remove casts that are
6789         unnecessary now that we assume C89 or better.  This change
6790         imported from coreutils.
6791
6792         * mktime.c (__mktime_internal): Do not reject negative timestamps
6793         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
6794         in the 2003-05-30 sync from glibc.
6795
6796         .h files should stand alone, but we shouldn't include <sys/types.h>
6797         if we can get away with just <stddef.h>.
6798
6799         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
6800         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
6801         rather than <sys/types.h>, as we merely need size_t.
6802         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
6803         to get size_t.
6804         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
6805         Include <stdio.h>, to get FILE.
6806         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
6807         memcasecmp.h has included <stddef.h> and all we need is size_t.
6808         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
6809         our interface, instead of including <sys/types.h>
6810
6811 2003-06-02  Paul Eggert  <eggert@twinsun.com>
6812
6813         [from coreutils]
6814         Fix some minor time-related bugs with POSIX time arguments.
6815         Some valid time stamps were being rejected (notably -1, and
6816         time stamps before 1900 on 64-bit hosts).  And some invalid
6817         time stamps were being accepted, e.g. September 31.
6818
6819         * posixtm.h (posixtime): Return bool instead of time_t, so
6820         that we can return (time_t) -1 successfully.
6821         * posixtm.c: Likewise.
6822         [HAVE_STDBOOL_H]: Include <stdbool.h>.
6823         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
6824         (t): Remove static var.
6825         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
6826         of static var.  All uses changed.
6827         (year): Do not reject years before 1900; they can occur with
6828         64-bit time_t.
6829         (posix_time_parse): Do not check for out-of-range components;
6830         that is now the caller's responsibility, since our checks were
6831         only approximations.
6832         (posixtime): Use mktime to check for out-of-range components,
6833         since it knows them exactly.
6834         If mktime returns (time_t) -1, check whether an error actually occurred
6835         by invoking localtime on -1.
6836         (main) [TEST_POSIXTIME]: Check for input data errors, and report
6837         posixtime failures better.
6838         Improve the test data (in comments only).
6839
6840 2003-05-30    <karl@gnu.org>
6841
6842         * mktime.c: update from libc.
6843
6844 2003-05-30  Bruno Haible  <bruno@clisp.org>
6845
6846         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
6847         * localcharset.h: Likewise.
6848         * localcharset.c: Likewise.
6849
6850 2003-05-28  Paul Eggert  <eggert@twinsun.com>
6851
6852         Assume the headers required for C89 freestanding compilers.
6853         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
6854         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
6855         without checking for HAVE_LIMITS_H.
6856         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
6857         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
6858         to do that.
6859         * fatal.c: Include <stdarg.h> without checking for __STDC__.
6860         * exclude.c: Include <stdbool.h> unconditionally.
6861         * tempname.c: Include <stddef.h> unconditionally.
6862         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
6863         * modechange.c, rpmatch.c (NULL): Don't define, since
6864         <stddef.h> does that.
6865         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
6866         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
6867         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
6868         * xstrtol.c: Likewise.
6869         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
6870         * savedir.c: Include <stddef.h> instead of defining NULL.
6871
6872         * addext.c (addext): Use assignment rather than cast, to avoid
6873         warnings on some platforms.
6874
6875         * mktime.c (__mktime_internal): Do not reject negative timestamps
6876         arbitrarily.
6877
6878 2003-05-10  Bruno Haible  <bruno@clisp.org>
6879
6880         * linebreak.c (iconv_string_length): Don't return -1 just because the
6881         string is longer than 4 KB.
6882
6883 2003-05-12  Jim Meyering  <jim@meyering.net>
6884
6885         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
6886         the space-padded-by-default conversion specifiers, %e, %k, %l.
6887
6888 2003-05-03  Bruno Haible  <bruno@clisp.org>
6889
6890         Upgrade to Unicode-4.0.
6891         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
6892         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
6893         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
6894         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
6895         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
6896         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
6897         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
6898         Change width of U+E0100..U+E01EF from 1 to 0.
6899
6900 2003-04-25  Bruno Haible  <bruno@clisp.org>
6901
6902         * copy-file.c: Include <stddef.h>, for size_t.
6903
6904 2003-04-25  Jim Meyering  <jim@meyering.net>
6905
6906         * copy-file.c (copy_file_preserving): Declare buf_size to be
6907         of type size_t, not int.
6908
6909 2003-04-11  Jim Meyering  <jim@meyering.net>
6910
6911         Merge changes from Coreutils.
6912
6913         2003-03-22  Jim Meyering  <jim@meyering.net>
6914
6915         * strftime.c (widen): Cast alloca return value to proper type.
6916
6917         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
6918
6919         From GNU libc.
6920         * strftime.c (my_strftime): Handle very large width
6921         specifications for numeric values correctly.  Improve checks for
6922         overflow.
6923
6924         2003-01-19  Jim Meyering  <jim@meyering.net>
6925
6926         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
6927         (nl_get_alt_digit) [! defined my_strftime]: Define.
6928         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
6929         _nl_get_alt_digit and _nl_get_walt_digit.
6930
6931         * strftime.c (my_strftime): Merge in locale-related changes from libc.
6932         These changes have no effect outside of _LIBC.
6933
6934 2003-04-10  Bruno Haible  <bruno@clisp.org>
6935
6936         * findprog.h: New file, from GNU gettext.
6937         * findprog.c: New file, from GNU gettext.
6938
6939 2003-04-05  Jim Meyering  <jim@meyering.net>
6940
6941         Merge changes from Coreutils.
6942
6943         * exclude.h (PARAMS): Remove definition and uses.
6944         * exclude.c: Remove uses of `PARAMS'.
6945
6946         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
6947         Add test-cases for DOS filenames. Declare program_name.
6948         (main): Set up program_name.  Patch by Rich Dawe.
6949
6950         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6951         error from mntctl.
6952         Use mntctl's return value to drive the entry-processing loop, since
6953         we can't rely on the value of the vmt_length member in the last
6954         entry.  On some systems doing so could result in exhausting
6955         virtual memory.  Based in part on a patch from Mike Jetzer.
6956
6957 2003-04-04  Bruno Haible  <bruno@clisp.org>
6958
6959         * linebreak.h: New file, from GNU gettext.
6960         * linebreak.c: New file, from GNU gettext with slight modifications.
6961         * lbrkprop.h: New file, from GNU gettext.
6962
6963 2003-04-03  Bruno Haible  <bruno@clisp.org>
6964
6965         * utf8-ucs4.h: New file, from GNU gettext.
6966         * utf16-ucs4.h: New file, from GNU gettext.
6967         * ucs4-utf8.h: New file, from GNU gettext.
6968         * ucs4-utf16.h: New file, from GNU gettext.
6969
6970 2003-04-02  Bruno Haible  <bruno@clisp.org>
6971
6972         * binary-io.h: New file, from GNU gettext.
6973
6974 2003-04-01  Bruno Haible  <bruno@clisp.org>
6975
6976         * pathname.h: New file, from GNU gettext.
6977         * concatpath.c: New file, from GNU gettext.
6978
6979 2003-03-30  Bruno Haible  <bruno@clisp.org>
6980
6981         * copy-file.c (copy_file_preserving): Don't set owner if the function
6982         chown() doesn't exist.
6983
6984 2003-03-28  Bruno Haible  <bruno@clisp.org>
6985
6986         * copy-file.h: New file, from GNU gettext.
6987         * copy-file.c: New file, from GNU gettext.
6988
6989 2003-03-18  Jim Meyering  <jim@meyering.net>
6990
6991         * quote.c (quote_n): Fix typo in comment.
6992
6993 2003-03-14  Jim Meyering  <jim@meyering.net>
6994
6995         Merge changes from Coreutils.
6996         * obstack.h (obstack_object_size): Declare temporary, __o,
6997         to be const, in order to avoid warnings.
6998         (obstack_room): Likewise.
6999         (obstack_empty_p): Likewise.
7000
7001 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7002
7003         Merge changes from Bison.
7004         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7005         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7006         when compiling Bison 1.875's `bitset bset = obstack_alloc
7007         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7008         * hash.c: Include <stdbool.h> unconditionally.
7009
7010 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7011
7012         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7013         Reported by Bruce Becker; see:
7014         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7015
7016 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7017             Bruno Haible  <bruno@clisp.org>
7018
7019         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7020         Reported by John Hughes, see
7021         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7022
7023 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7024
7025         * poll_.h: New file.
7026         * poll.c: New file.
7027
7028 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7029
7030         * mathl.h: New file.
7031         * acosl.c: New file.
7032         * asinl.c: New file.
7033         * atanl.c: New file.
7034         * ceill.c: New file.
7035         * cosl.c: New file.
7036         * expl.c: New file.
7037         * floorl.c: New file.
7038         * frexpl.c: New file.
7039         * ldexpl.c: New file.
7040         * logl.c: New file.
7041         * sincosl.c: New file.
7042         * sinl.c: New file.
7043         * sqrtl.c: New file.
7044         * tanl.c: New file.
7045         * trigl.c: New file.
7046         * trigl.h: New file.
7047
7048 2003-02-17  Bruno Haible  <bruno@clisp.org>
7049
7050         * mkdtemp.h: New file, from GNU gettext.
7051         * mkdtemp.c: New file, from GNU gettext.
7052
7053 2003-01-31  Bruno Haible  <bruno@clisp.org>
7054
7055         * rename.c: #undef rename before defining rpl_rename.
7056         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7057
7058 2003-01-30  Bruno Haible  <bruno@clisp.org>
7059
7060         * printf-args.h: New file, from GNU gettext.
7061         * printf-args.c: New file, from GNU gettext.
7062         * printf-parse.h: New file, from GNU gettext.
7063         * printf-parse.c: New file, from GNU gettext.
7064         * vasnprintf.h: New file, from GNU gettext.
7065         * vasnprintf.c: New file, from GNU gettext.
7066         * asnprintf.c: New file, from GNU gettext.
7067         * vasprintf.h: New file, from GNU gettext with modifications.
7068         * vasprintf.c: New file, from GNU gettext.
7069         * asprintf.c: New file, from GNU gettext.
7070
7071 2003-01-29  Bruno Haible  <bruno@clisp.org>
7072
7073         * stpncpy.h: New file, from GNU gettext with modifications.
7074         * stpncpy.c: New file, from GNU gettext with modifications.
7075
7076 2003-01-28  Bruno Haible  <bruno@clisp.org>
7077
7078         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7079         Paul Eggert.
7080         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7081         Paul Eggert.
7082
7083 2003-01-27  Bruno Haible  <bruno@clisp.org>
7084
7085         * xsetenv.h: New file, from GNU gettext.
7086         * xsetenv.c: New file, from GNU gettext.
7087
7088 2003-01-23  Bruno Haible  <bruno@clisp.org>
7089
7090         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7091
7092 2003-01-22  Bruno Haible  <bruno@clisp.org>
7093
7094         * exit.h: New file, from GNU gettext.
7095
7096 2003-01-11  Bruno Haible  <bruno@clisp.org>
7097
7098         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7099         * strcase.h (strcasecmp, strncasecmp): Likewise.
7100
7101 2003-01-14  Jim Meyering  <jim@meyering.net>
7102
7103         * same.c (same_name): Tweak a comment.
7104
7105 2003-01-11  Bruno Haible  <bruno@clisp.org>
7106
7107         * same.c (same_name): Reorder tests so as to avoid calling stat()
7108         when a string comparison is sufficient.
7109
7110 2003-01-11  Bruno Haible  <bruno@clisp.org>
7111
7112         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7113         'unsigned int'.
7114
7115 2003-01-11  Bruno Haible  <bruno@clisp.org>
7116
7117         * hash-pjw.c: Add comment about low quality of this function.
7118
7119 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7120
7121         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7122         to avoid collisions with libcurses and libreadline.
7123
7124         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7125         * getstr.h, getstr.c: Remove.
7126         * getline.c: Include "getline.h", to check interface.
7127         Move body of old getstr.c here: this defines MIN_CHUNK and
7128         declares getdelim2, which is renamed from getstr.
7129         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7130
7131         * linebuffer.c (readlinebuffer): Renamed from readline.
7132         All uses changed.
7133         * linebuffer.h: Likewise.
7134         (readline): Remove backward-compatibility macro.
7135
7136 2003-01-12  Jim Meyering  <jim@meyering.net>
7137
7138         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7139
7140 2003-01-10  Bruno Haible  <bruno@clisp.org>
7141
7142         * alloca_.h: New file.
7143         * getdate.y: Unconditionally include alloca.h.
7144         * makepath.c: Likewise.
7145         * setenv.c: Likewise.
7146         * userspec.c: Likewise.
7147
7148 2003-01-09  Bruno Haible  <bruno@clisp.org>
7149
7150         * stdbool.h.in: New file.
7151
7152 2003-01-08  Bruno Haible  <bruno@clisp.org>
7153
7154         * safe-read.c: Include specification header first, to ensure its
7155         selfcontainedness.
7156         * full-write.c: Likewise.
7157
7158 2003-01-08  Jim Meyering  <jim@meyering.net>
7159
7160         * full-write.c: Undefine and define-away `const' after inclusion
7161         of errno.h, not before.  Suggestion from Bruno Haible.
7162
7163 2003-01-07  Jim Meyering  <jim@meyering.net>
7164
7165         * full-write.c: Rework so that it may serve to define full_read, too.
7166         * full-read.c: Simply #define FULL_READ and include full-write.c.
7167
7168 2003-01-06  Jim Meyering  <jim@meyering.net>
7169
7170         * version-etc.c: Update year in translatable copyright string.
7171
7172 2002-12-25  Bruno Haible  <bruno@clisp.org>
7173
7174         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7175         * xstrtol.h: Likewise.
7176         * xstrtoimax.c: Likewise.
7177         * xstrtoumax.c: Likewise.
7178         * human.h: Likewise.
7179
7180         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7181         on systems that have <inttypes.h> but not <stdint.h>.
7182
7183 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7184
7185         * memcoll.c (memcoll): Fall back on a simple algorithm using
7186         memcmp if strcoll doesn't work.
7187
7188 2002-12-23  Bruno Haible  <bruno@clisp.org>
7189
7190         * localcharset.h: New file.
7191         * localcharset.c: Include it.
7192         * unicodeio.c: Likewise.
7193
7194 2002-12-22  Bruno Haible  <bruno@clisp.org>
7195
7196         * utime.c (utime_null): No need to call ftruncate if the file was
7197         nonempty.
7198
7199 2002-12-23  Bruno Haible  <bruno@clisp.org>
7200
7201         * memcoll.c (STRCOLL): New macro.
7202         (memcoll): Use it.
7203
7204 2002-12-22  Bruno Haible  <bruno@clisp.org>
7205
7206         * getstr.h (getstr): Define, to avoid clash with libcurses.
7207         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7208
7209 2002-12-22  Bruno Haible  <bruno@clisp.org>
7210
7211         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7212
7213 2002-12-23  Bruno Haible  <bruno@clisp.org>
7214
7215         * getline.h: Include <stddef.h>, for size_t.
7216
7217         * unicodeio.h: Include <stddef.h>, for size_t.
7218         * unicodeio.c: Don't include <stddef.h>.
7219
7220 2002-12-17  Bruno Haible  <bruno@clisp.org>
7221
7222         * canon-host.c (strdup): Remove unused declaration.
7223
7224         * fsusage.c: Include full_read.h.
7225         (get_fs_usage): Use full_read instead of safe_read.
7226
7227         * utime.c (utime_null): Use SAFE_READ_ERROR.
7228
7229 2002-12-11  Bruno Haible  <bruno@clisp.org>
7230
7231         * setenv.h: Rewritten to cope with systems that have setenv() but not
7232         unsetenv().
7233         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7234         modifications:
7235
7236         2002-12-11  Bruno Haible  <bruno@clisp.org>
7237
7238                 * setenv.c (alloca): Fall back to malloc.
7239                 (freea): New macro.
7240                 (setenv): Use freea() to free memory allocated with alloca().
7241
7242         2002-11-13  Bruno Haible  <bruno@clisp.org>
7243
7244                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7245                 function declarations.
7246                 * unsetenv.c (unsetenv): Likewise.
7247
7248         2002-03-04  Bruno Haible  <bruno@clisp.org>
7249
7250                 Portability to AIX 4.3.3.
7251                 * unsetenv.c: New file, extracted from setenv.c.
7252                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7253
7254         2001-12-20  Bruno Haible  <bruno@clisp.org>
7255
7256                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7257                 use malloc instead. For SunOS 4.
7258
7259         2001-12-11  Bruno Haible  <bruno@clisp.org>
7260
7261                 * setenv.c: Declare alloca.
7262                 (compar_fn_t): New typedef.
7263                 (KNOWN_VALUE, STORE_VALUE): Use it.
7264
7265         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7266         setenv.h.
7267
7268 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7269
7270         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7271         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7272         Choose values that are less likely to collide with system fnmatch
7273         options.
7274         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7275         defined (e.g., a pure POSIX system).
7276         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7277         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7278
7279 2002-12-06  Jim Meyering  <jim@meyering.net>
7280
7281         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7282
7283         Merge in changes from libc's misc/error.c, in preparation
7284         for the merge of gnulib's changes back into libc.
7285
7286         * error.c (_): Define only if not already defined.
7287         Move definition to follow all #include directives.
7288         Include unlocked-io.h only if !_LIBC.
7289         [_LIBC]: Include <libio/libioP.h>.
7290         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7291         (fflush): Tweak definition to use INTUSE.
7292         (putc): Define.
7293
7294 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7295
7296         * alloca.c [defined emacs]: Include "lisp.h".
7297         (xalloc_die) [defined emacs]: New macro.
7298         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7299         [! defined emacs]: Include <xalloc.h>.
7300         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7301         (pointer): Typedef to POINTER_TYPE *.
7302         (malloc): Remove decl; we now always use xmalloc.
7303         (alloca): Use old-style definition, since Emacs needs this.
7304         Check for arithmetic overflow when computing combined size.
7305
7306 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7307
7308         Do not generate unlocked-io.h automatically, since it's easier to
7309         maintain it by hand.
7310
7311         * unlocked-io.h: New file, from GNU diffutils,
7312         but with proper copyright notice and attribution.
7313         * gen-uio: Remove.
7314         * Makefile.am: Add copyright notice.
7315         (libfetish_a_SOURCES): Add unlocked-io.h.
7316         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7317         (DISTCLEANFILES, io_functions): Remove macros.
7318         (EXTRA_DIST): Remove gen_uio.
7319         (unlocked-io.h): Remove rule.
7320
7321 2002-12-04  Jim Meyering  <jim@meyering.net>
7322
7323         Reflect the fact that stat.c and lstat.c are no longer generated.
7324         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7325         (DISTCLEANFILES): Likewise.
7326         (EXTRA_DIST): Likewise.
7327         (all_local): Don't depend on stat.c or lstat.c.
7328         (stat.c, lstat.c): Remove rules.
7329         (EXTRA_DIST): Remove xstat.in.
7330
7331         * xstat.in: Remove file.  Contents moved into stat.c.
7332         * stat.c: New file.  Contents mostly from xstat.in.
7333         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7334         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7335
7336         * safe-read.c: Rework so that it may serve to define safe_write, too.
7337         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7338
7339 2002-12-03  Jim Meyering  <jim@meyering.net>
7340
7341         * safe-read.c, safe-write.c: Change variable names and comments, but
7342         not semantics, to minimize the differences between these two files.
7343         (safe_read): Change comment to mention SAFE_READ_ERROR.
7344
7345         * safe-read.c (IS_EINTR): Define.
7346         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7347
7348 2002-12-02  Bruno Haible  <bruno@clisp.org>
7349
7350         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7351         Define, taken from safe-read.c.
7352         (INT_MAX): Provide fallback.
7353         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7354         * safe-write.h (SAFE_WRITE_ERROR): Define.
7355
7356         * safe-read.c (EINTR): Remove definition.
7357         (safe_read): Don't use EINTR if it is absent.
7358
7359 2002-12-02  Jim Meyering  <jim@meyering.net>
7360
7361         * safe-read.c (EINTR): Define.
7362         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7363         (INT_MAX): Provide fallback.
7364         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7365
7366         * safe-read.h (SAFE_READ_ERROR): Define.
7367
7368 2002-12-01  Jim Meyering  <jim@meyering.net>
7369
7370         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7371         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7372
7373 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7374
7375         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7376         hash_rehash): Replace `if (limit <= value) abort ();' with
7377         `if (! (value < limit)) abort ();', for readability.
7378
7379 2002-11-26    <karl@gnu.org>
7380
7381         * strdup.c: copy from libc again, with jim's ok.
7382         * .cppi-disable: re-add strdup.c
7383
7384 2002-11-25    <karl@gnu.org>
7385
7386         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7387         instead of "strtol.c".
7388
7389 2002-11-25  Jim Meyering  <jim@meyering.net>
7390
7391         * mktime.c: Sync from libc, now that it has the latest fix.
7392
7393 2002-11-24    <karl@gnu.org>
7394
7395         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7396         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7397
7398 2002-11-24  Jim Meyering  <jim@meyering.net>
7399
7400         Update from coreutils:
7401
7402         * mktime.c: Merge in changes from libc.
7403
7404         Avoid a link-time failure on some Linux systems.
7405         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7406         (__mon_yday): Declare with the STATIC attribute.
7407         (__mktime_internal): Likewise.
7408         Based on a report from Greg Schafer.
7409
7410 2002-11-23  Jim Meyering  <jim@meyering.net>
7411
7412         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7413         Use `unsigned', not `int', as type of index.
7414
7415         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7416
7417         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7418
7419 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7420
7421         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7422         hint that one should use `if (! x) abort ();' rather than `assert
7423         (x);', and anyway it's one less thing to worry about configuring.
7424         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7425         hash_rehash, hash_insert): Use abort rather than assert.
7426
7427 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7428
7429         * quotearg.h: Allow multiple inclusion by surrounding with
7430         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
7431         so that we can be included first.
7432         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
7433         * quotearg.c: Include quotearg.h immediately after config.h.
7434         No need to include stddef.h or sys/types.h any more.
7435         Surround local include files with "", not "<>".
7436         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7437         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7438         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7439         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7440         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7441         (ISPRINT): Remove; no longer needed now that we assume C89.
7442
7443         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7444         Preserve errno.
7445
7446         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7447         quotearg_char): Use SIZE_MAX rather than
7448         (size_t) -1 when we are talking about "infinity".
7449
7450         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7451
7452 2002-11-22  Bruno Haible  <bruno@clisp.org>
7453
7454         * safe-read.h: Assume C89. Add comments.
7455         (safe_read): Change return type to size_t.
7456         * safe-read.c (safe_read): Change return type to size_t. Handle byte
7457         counts > SSIZE_MAX correctly.
7458         * safe-write.h: New file.
7459         * safe-write.c: New file.
7460         * full-read.h: New file.
7461         * full-read.c: New file.
7462         * full-write.h: Assume C89. Add comments.
7463         * full-write.c: Include safe-write.h.
7464         (full_write): Rewritten to use safe_write.
7465         Suggested by Jim Meyering and Paul Eggert.
7466
7467 2002-11-21  Bruno Haible  <bruno@clisp.org>
7468
7469         Remove case insensitive option matching.
7470         * argmatch.h (argcasematch): Remove declaration.
7471         (ARGCASEMATCH): Remove macro.
7472         (__xargmatch_internal): Remove case_sensitive argument.
7473         (XARGMATCH): Update.
7474         (XARGCASEMATCH): Remove macro.
7475         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7476         case_sensitive argument.
7477         (argcasematch): Remove function.
7478         (__xargmatch_internal): Remove case_sensitive argument.
7479         (main): Use XARGMATCH instead of XARGCASEMATCH.
7480
7481         * xmalloc.c: Change compile-time error message. Add comment about
7482         required autoconf version.
7483
7484 2002-11-21  Jim Meyering  <jim@meyering.net>
7485
7486         * strdup.c (strdup): Tweak comment and initial #if/#include.
7487
7488         Merge in changes from the coreutils.
7489
7490         2002-09-25  Paul Eggert  <eggert@twinsun.com>
7491         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7492         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7493         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7494         int.  Work more efficiently if X is the same width as uintmax_t.
7495         Do not compare X to -1, to avoid bogus compiler warning.
7496         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7497         Don't assume that f_frsize and f_bsize are the same type.
7498
7499         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7500         on FreeBSD.
7501
7502         * makepath.c (make_path): Restore umask *before* creating the final
7503         component.
7504         (make_path): Minor reformatting.
7505
7506         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7507         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7508
7509         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7510         ones.  At least on GNU/Linux systems, `auto' means something else.
7511         From Michael Stone.
7512
7513 2002-11-20  Paul Eggert  <eggert@twinsun.com>
7514
7515         Merge argmatch cleanups from Bison.  Assume C89.
7516
7517         * argmatch.c: Include config.h here, not in argmatch.h.
7518         Include stdlib.h, for EXIT_FAILURE.
7519         Always include <string.h>, since we assume C89.
7520         (EXIT_FAILURE): Remove pre-C89 bug workaround.
7521         * argmatch.h: Do not include <config.h> or <sys/types.h>.
7522         Include <stddef.h> instead, since it's all we need for size_t.
7523         (PARAMS): Remove.  All uses removed.
7524         (ARRAY_CARDINALITY): Do not bother to #undef.
7525         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7526         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7527         Remove unnecessary parentheses.
7528         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7529         Insert necessary parentheses.
7530         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7531         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7532
7533 2002-11-19  Bruno Haible  <bruno@clisp.org>
7534
7535         * mbswidth.c: Include mbswidth.h right at the beginning.
7536         * mbswidth.h: Include <stddef.h>, for size_t.
7537
7538         * mbswidth.h (PARAMS): Remove macro.
7539         (mbswidth, mbsnwidth): Use ANSI C function declarations.
7540         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7541
7542         * gcd.h (PARAMS): Remove macro.
7543         (gcd): Use ANSI C function declarations.
7544         * gcd.c (gcd): Likewise.
7545
7546 2002-11-15  Bruno Haible  <bruno@clisp.org>
7547
7548         * strcspn.c: Include <stddef.h>.
7549         (strcspn): Use ANSI C function declaration. Change return type to
7550         size_t. Use NULL.
7551         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7552         (strpbrk): Use NULL.
7553         * strpbrk.h (PARAMS): Remove macro.
7554         (strpbrk): Use ANSI C function declaration.
7555         * strstr.c: Don't include <sys/types.h>.
7556         * strstr.h (PARAMS): Remove macro.
7557         (strstr): Use ANSI C function declarations.
7558
7559 2002-11-06  Bruno Haible  <bruno@clisp.org>
7560
7561         * gcd.h (gcd): Change argument type to 'unsigned long'.
7562         * gcd.c (gcd): Likewise.
7563
7564 2002-11-05  Bruno Haible  <bruno@clisp.org>
7565
7566         * gcd.h: New file, from gettext-0.11.5.
7567         * gcd.c: New file, from gettext-0.11.5.
7568
7569 2002-11-05  Bruno Haible  <bruno@clisp.org>
7570
7571         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7572         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7573         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7574         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7575
7576         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7577         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7578
7579         * closeout.c: Include gettext.h instead of <libintl.h>.
7580         * human.c: Include gettext.h instead of <libintl.h>.
7581         * quotearg.c: Include gettext.h instead of <libintl.h>.
7582         * rpmatch.c: Include gettext.h instead of <libintl.h>.
7583         * unicodeio.c: Include gettext.h instead of <libintl.h>.
7584         * userspec.c: Include gettext.h instead of <libintl.h>.
7585         * version-etc.c: Include gettext.h instead of <libintl.h>.
7586         * xmalloc.c: Include gettext.h instead of <libintl.h>.
7587         (textdomain): Remove definition.
7588         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
7589
7590         * long-options.c: Remove include of <libintl.h> and definition of _.
7591         * same.c: Remove include of <libintl.h> and definition of _.
7592
7593 2002-11-04  Bruno Haible  <bruno@clisp.org>
7594
7595         * stpcpy.h: New file, from GNU gettext-0.11.5.
7596         * strcase.h: New file, from GNU gettext-0.11.5.
7597         * strpbrk.h: New file, from GNU gettext-0.11.5.
7598         * strstr.h: New file, from GNU gettext-0.11.5.
7599         * xgetcwd.h: New file, from GNU gettext-0.11.5.
7600
7601 2002-05-09  Bruno Haible  <bruno@clisp.org>
7602
7603         * config.charset: Update for newest glibc. Add canonical names
7604         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
7605
7606 2002-05-09  Bruno Haible  <bruno@clisp.org>
7607
7608         * localcharset.c (get_charset_aliases): Add more Windows specific
7609         aliases.
7610
7611 2002-05-08  Owen Taylor  <otaylor@redhat.com>
7612
7613         * config.charset: A few additions for Solaris.
7614
7615 2001-12-05  Bruno Haible  <bruno@clisp.org>
7616
7617         * localcharset.c (locale_charset): Don't return an empty string.
7618
7619 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
7620
7621         * config.charset: msdos in uk_UA uses CP1125.
7622
7623 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
7624
7625         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
7626         * localcharset.c (locale_charset): Declare as extern "C".
7627
7628 2002-02-15  Bruno Haible  <bruno@clisp.org>
7629
7630         * config.charset [msdosdjgpp]: For Russian, use CP866.
7631
7632 2002-02-11  Bruno Haible  <bruno@clisp.org>
7633
7634         * config.charset: Add support for NetBSD.
7635
7636 2002-09-25    <karl@gnu.org>
7637
7638         * strdup.c: copy from libc/string (via ../config/srclist*).
7639         * getopt*: copy from libc/posix.
7640         * gettext.h: copy from gettext.
7641         * .cppi-disable: add strdup.c, gettext.h.
7642
7643 2002-07-01  Jim Meyering  <meyering@lucent.com>
7644
7645         * c-stack.c: Include sys/time.h.
7646         From Volker Borchert.
7647
7648 2002-06-11  Paul Eggert  <eggert@twinsun.com>
7649
7650         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
7651         New macro.  Use it uniformly instead of
7652         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
7653         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7654         reported by Vin Shelton.
7655
7656 2002-06-22  Jim Meyering  <meyering@lucent.com>
7657
7658         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
7659         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
7660
7661 2002-06-22  Paul Eggert  <eggert@twinsun.com>
7662
7663         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
7664         Do not assume SA_SIGINFO behavior.
7665         Bug reported by Jim Meyering on NetBSD 1.5.2.
7666
7667 2002-06-22  Jim Meyering  <meyering@lucent.com>
7668
7669         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
7670
7671         * exitfail.c, exitfail.h: Likewise.
7672         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
7673
7674         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
7675         of fnmatch.h.
7676         (EXTRA_DIST): Add fnmatch_loop.c.
7677         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
7678
7679         * fnmatch_loop.c: New file, from diffutils-2.8.2.
7680         * fnmatch.c: Update from diffutils-2.8.2.
7681         * fnmatch_.h: New file.  From diffutils-2.8.2.
7682         * fnmatch.h: Remove file.
7683
7684 2002-06-18  Paul Eggert  <eggert@twinsun.com>
7685
7686         * file-type.h: Report an error if neither S_ISREG nor
7687         S_IFREG is defined, instead of using a test specific to glibc
7688         2.2.  This should be safe, since POSIX requires S_ISREG and
7689         Unix Version 7 had S_IFREG.  We don't need to check for
7690         <sys/types.h> since we don't use any symbols that it defines.
7691
7692 2002-06-15  Jim Meyering  <meyering@lucent.com>
7693
7694         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
7695         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
7696         have been included before this file.
7697
7698 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
7699
7700         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
7701         so that each temporary file name is unique and valid in the first
7702         8 characters, for operation under DOS.
7703
7704 2002-06-15  Jim Meyering  <meyering@lucent.com>
7705
7706         Work even with DJGPP 2.03, which lacks support for symlinks.
7707         From Richard Dawe.
7708         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
7709         is defined.
7710         * lchown.c (S_ISLNK): Likewise.
7711
7712 2002-06-14  Jim Meyering  <meyering@lucent.com>
7713
7714         * file-type.h: Use the version from diffutils-2.8.2.
7715         * file-type.c: Likewise.
7716
7717 2002-05-27  Jim Meyering  <meyering@lucent.com>
7718
7719         Fix a problem seen only on nonconforming systems whereby ls.c's
7720         use of localtime, and then of gettimeofday would cause trouble:
7721         the localtime call used to initialize rpl_gettimeofday's save
7722         mechanism would clobber ls's current local time information so
7723         that in any long listing the first file would always be listed
7724         with date 1970-01-01.  Analysis by Volker Borchert.
7725
7726         * gettimeofday.c (localtime): Undefine.
7727         (rpl_localtime): New function.
7728
7729 2002-05-22  Jim Meyering  <meyering@lucent.com>
7730
7731         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
7732         * file-type.h: New file.
7733         * file-type.c (file_type): New file/function.  Extracted from diffutils.
7734
7735 2002-04-29  Paul Eggert  <eggert@twinsun.com>
7736
7737         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
7738
7739 2002-04-28  Paul Eggert  <eggert@twinsun.com>
7740
7741         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
7742         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
7743         of 127, since 64 is the largest conceivable number for ancient
7744         nonstandard hosts.
7745         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
7746
7747 2002-04-28  Jim Meyering  <meyering@lucent.com>
7748
7749         * sig2str.c (WTERMSIG): Remove definition (unused).
7750
7751 2002-04-28  Paul Eggert  <eggert@twinsun.com>
7752
7753         * sig2str.h, sig2str.c: New files.
7754         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
7755
7756 2002-04-24  Jim Meyering  <meyering@lucent.com>
7757
7758         * gettext.h: New file, from Gettext.
7759         * Makefile.am (INCLUDES): Remove -I../intl.
7760         (libfetish_a_SOURCES): Add gettext.h.
7761
7762 2002-04-16  Jim Meyering  <meyering@lucent.com>
7763
7764         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
7765         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
7766         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
7767
7768 2002-04-12  Jim Meyering  <meyering@lucent.com>
7769
7770         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
7771
7772 2002-03-10  Jim Meyering  <meyering@lucent.com>
7773
7774         * makepath.c (make_path): Remove a comma from a diagnostic.
7775         Suggestion from Santiago Vila.
7776
7777 2002-03-08  Jim Meyering  <meyering@lucent.com>
7778
7779         * rename.c: Mention that this wrapper is needed also on
7780         mips-dec-ultrix4.4 systems.
7781
7782 2002-03-02  Jim Meyering  <meyering@lucent.com>
7783
7784         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
7785         not HAVE_CLOCK_SETTIME.
7786
7787 2002-02-27  Paul Eggert  <eggert@twinsun.com>
7788
7789         * nanosleep.h: Rename to....
7790         * timespec.h: New name for nanosleep.h.  All uses changed.
7791
7792         * gettime.c: New file.
7793         * settime.c: New file.
7794         * stime.c: Remove.
7795
7796         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
7797         timespec.h.  Remove nanosleep.h.
7798
7799 2002-02-25  Paul Eggert  <eggert@twinsun.com>
7800
7801         * acl.c, acl.h: New files.
7802         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
7803
7804 2002-02-24  Jim Meyering  <meyering@lucent.com>
7805
7806         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
7807         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
7808         cause trouble.  Reported by Nelson Beebe.
7809
7810 2002-02-23  Paul Eggert  <eggert@twinsun.com>
7811
7812         * path-concat.c (xpath_concat): Reorder code to pacify
7813         compilers that don't know that xalloc_die never returns.
7814
7815 2002-02-20  Jim Meyering  <meyering@lucent.com>
7816
7817         * getdate.c: Regenerate using bison-1.33.
7818
7819 2002-02-15  Paul Eggert  <eggert@twinsun.com>
7820
7821         * posixver.c, posixver.h: New files.
7822         * Makefile.am (libfetish_a_SOURCES): Add them.
7823
7824 2002-02-02  Paul Eggert  <eggert@twinsun.com>
7825             Bruno Haible  <bruno@clisp.org>
7826
7827         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
7828         (fwrite_success_callback): New declaration.
7829         * unicodeio.c (unicode_to_mb): New function, extracted from
7830         print_unicode_char. Call failure callback instead of error.
7831         (fwrite_success_callback): New function.
7832         (exit_failure_callback): New function.
7833         (fallback_failure_callback): New function.
7834         (print_unicode_char): Call unicode_to_mb.
7835
7836 2002-01-26  Jim Meyering  <meyering@lucent.com>
7837
7838         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
7839
7840 2002-01-22  Jim Meyering  <meyering@lucent.com>
7841
7842         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
7843         Otherwise, some versions of automake would omit the rule that makes
7844         Makefile from Makefile.in.
7845
7846 2001-01-21  Paul Eggert  <eggert@twinsun.com>
7847
7848         * xmemcoll.h, xmemcoll.c: New files.
7849         * Makefile.am (libfetish_a_SOURCES): Add them.
7850         * memcoll.c: Include errno.h, and declare errno if not defined.
7851         (memcoll): Set errno to zero if there is no error.
7852
7853         * quotearg.c (quotearg_buffer_restyled):
7854         Fix bug with quoting buffers containing NUL when backslashing escapes.
7855         This bug was exposed by the other changes in this patch.
7856         (quotearg_n_options): New arg ARGSIZE.
7857         All callers changed.
7858         (quoting_options_from_style): New function.
7859         (quotearg_n_style): Use it.
7860         (quotearg_n_style_mem): New function.
7861
7862         * quotearg.h (quotearg_n_style_mem): New function.
7863
7864 2002-01-16  Jim Meyering  <meyering@lucent.com>
7865
7866         * getdate.y: Add three semicolons, each just before a closing brace.
7867         Bison (as of version 1.31) no longer papers over that mistake.
7868
7869 2002-02-14  Paul Eggert  <eggert@twinsun.com>
7870
7871         * backupfile.c (ISDIGIT): Comment fix.
7872         * getdate.y (ISDIGIT): Likewise.
7873         * posixtm.c (ISDIGIT, year): Likewise.
7874         * strverscmp.c (ISDIGIT): Likewise.
7875         * userspec.c (ISDIGIT): Likewise.
7876
7877 2002-01-05  Jim Meyering  <meyering@lucent.com>
7878
7879         * version-etc.c (version_etc_copyright): Update copyright year.
7880
7881 2001-01-19  Paul Eggert  <eggert@twinsun.com>
7882
7883         * closeout.c (close_stdout_status): If ferror (stdout), do
7884         not silently exit merely because the output buffer happens to
7885         have nothing pending.
7886
7887 2001-12-18  Paul Eggert  <eggert@twinsun.com>
7888
7889         See the big note in ../ChangeLog.
7890         * human.c (suffixes): Prefer K to k for 1024.
7891         (generate_suffix_backwards): New function.
7892         (human_readable_inexact): Use it.
7893         * xstrtol.c (__xstrtol): If there is no number but there
7894         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
7895         Accept 'K' as well as 'k'.
7896
7897 2001-12-15  Jim Meyering  <meyering@lucent.com>
7898
7899         * regex.h (__restrict_arr): Update from libc.
7900
7901         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
7902         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
7903         (STREQ): Define.
7904
7905 2001-12-10  Jim Meyering  <meyering@lucent.com>
7906
7907         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
7908         Instead, include "xalloc.h".
7909         (initbuffer): Don't cast xmalloc return value to char*.
7910         (readline): Reword comment.
7911         Don't cast xrealloc return value to char*
7912         Return NULL, not 0.
7913
7914 2001-12-09  Jim Meyering  <meyering@lucent.com>
7915
7916         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
7917         `signed and unsigned type in conditional expression'.
7918         * posixtm.c (posix_time_parse): Likewise.
7919
7920         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
7921
7922         * readtokens.c (readtoken): Declare an index to be of type unsigned
7923         to avoid a pedantic warning.
7924
7925         * getstr.c: Don't include assert.h.
7926         (getstr): Remove warning-evoking assertions.
7927         Return -1 if offset parameter is out of bounds.
7928         Change the type of a local from int to size_t.
7929
7930         * strftime.c (my_strftime_localtime_r): Include this function
7931         definition in the `#if ! HAVE_TM_GMTOFF' block.
7932
7933         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
7934         Include xalloc.h instead.
7935
7936 2001-12-02  Jim Meyering  <meyering@lucent.com>
7937
7938         * tempname.c: Don't declare getenv, thus reverting the change of
7939         2001-11-18.  It's no longer necessary, now that stdlib.h is always
7940         included.
7941
7942         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
7943         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
7944
7945 2001-11-30  Akim Demaille  <akim@epita.fr>
7946
7947         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
7948         before being defined.
7949
7950 2001-11-27  Paul Eggert  <eggert@twinsun.com>
7951
7952         * quotearg.h (quotearg_n, quotearg_n_style):
7953         First arg is int, not unsigned.
7954         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7955         (SIZE_MAX, UINT_MAX): New macros.
7956         (quotearg_n_options): Abort if N is negative.
7957         Avoid overflow check on hosts where size_t is 64 bits and int
7958         is 32 bits, as overflow is impossible there.
7959         Fix off-by-one typo that caused unnecessary reallocation.
7960
7961 2001-11-27  Jim Meyering  <meyering@lucent.com>
7962
7963         * tempname.c: Merge with version from libc.
7964         * regex.c: Likewise.
7965
7966         * tempname.c: Include stdlib.h unconditionally.  On some old systems
7967         for which STDC_HEADERS is 0, it was not included, resulting in a
7968         warning about an integer-to-pointer conversion problem with getenv.
7969         Reported by Volker Borchert.
7970
7971 2001-11-26  Jim Meyering  <meyering@lucent.com>
7972
7973         * gtod.h: Remove file.
7974         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
7975         * gettimeofday.c: Don't include gtod.h.
7976         (GTOD_init): Remove function.
7977         (rpl_gettimeofday): Do its job here instead, rather than aborting.
7978         Suggestion from Volker Borchert.
7979
7980 2001-11-23  Jim Meyering  <meyering@lucent.com>
7981
7982         * hash.h (struct hash_table): Don't define here.  Merely declare it.
7983         * hash.c (struct hash_table): Define it here instead.
7984
7985 2001-11-22  Jim Meyering  <meyering@lucent.com>
7986
7987         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
7988
7989 2001-11-18  Paul Eggert  <eggert@twinsun.com>
7990
7991         * tempname.c (TMP_MAX): Remove; no longer needed.
7992         (TEMPORARIES): New macro.
7993         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
7994         removes an artificial limitation (e.g. HP-UX 10.20, where
7995         TMP_MAX is 17576).
7996
7997 2001-11-18  Jim Meyering  <meyering@lucent.com>
7998
7999         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8000         on SunOS 4.
8001
8002         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8003         files will be created before anything else.
8004
8005 2001-11-17  Jim Meyering  <meyering@lucent.com>
8006
8007         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8008         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8009         rather than group writable.  Patch by Juan F. Codagnone.
8010
8011         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8012         Instead, include "xalloc.h".
8013
8014         * mountlist.c: Include unlocked-io.h after all system headers.
8015         Remove explicit declarations of xmalloc, xrealloc,
8016         and xstrdup.  Instead, include "xalloc.h".
8017
8018         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8019         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8020         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8021
8022         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8023         Reported by Padraig Brady.
8024
8025         * mkstemp.c: #undef mkstemp.
8026         Include config.h.
8027         (rpl_mkstemp): Rename from mkstemp.
8028         Protoize.
8029
8030 2001-11-16  Jim Meyering  <meyering@lucent.com>
8031
8032         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8033         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8034         determine the amount of total physical memory, use pstat_getstatic.
8035         HPUX-11 doesn't define _SC_PHYS_PAGES.
8036         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8037         If sysconf couldn't be used to determine the amount of available
8038         physical memory, use both pstat_getstatic and pstat_getdynamic.
8039         Based on a patch from Bob Proulx.
8040
8041 2001-11-05  Jim Meyering  <meyering@lucent.com>
8042
8043         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8044
8045 2001-11-03  Jim Meyering  <meyering@lucent.com>
8046
8047         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8048         in argmatch_to_argument call.
8049
8050         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8051         argument.
8052
8053         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8054         e.g., a fault due to an attempt to free a NULL pointer.
8055
8056 2001-11-01  Jim Meyering  <meyering@lucent.com>
8057
8058         * dirfd.c, dirfd.h: New files.
8059         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8060
8061         * hash.c (hash_print) [TESTING]: Clean up.
8062
8063 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8064
8065         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8066         to avoid a warning if -Wall.
8067
8068 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8069
8070         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8071
8072 2001-10-21  Jim Meyering  <meyering@lucent.com>
8073
8074         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8075         this code would end up calling gettext even in packages built
8076         with --disable-nls.
8077         * getopt.c (_): Likewise.
8078         * regex.c (_): Likewise.
8079
8080 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8081
8082         * error.c (strerror_r): Do not declare unless !_LIBC.
8083         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8084         Use strerror_r that is only a macro, even if it is not a function.
8085         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8086         (private_strerror): Use prototypes, not old-style function definition.
8087         (print_errno_message): New function.
8088         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8089         char*-flavored one.
8090         (error_tail, error, error_at_line): Use it.
8091
8092 2001-10-11  Jim Meyering  <meyering@lucent.com>
8093
8094         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8095         and quote_n (1, ... to avoid clobbering a buffer.
8096
8097 2001-10-05  Jim Meyering  <meyering@lucent.com>
8098
8099         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8100         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8101         * hash-pjw.h: New file.
8102
8103 2001-09-30  Jim Meyering  <meyering@lucent.com>
8104
8105         * mountlist.c [MOUNTED_GETFSSTAT]:
8106         Include <sys/ucred.h>, for Apple Darwin.
8107         Include sys/mount.h and sys/fs_types.h only if available.
8108         (FS_TYPE): Define.
8109         (read_filesystem_list): Use FS_TYPE.
8110
8111 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8112
8113         * exclude.c (excluded_filename): 0 -> false, since it's
8114         a boolean context.
8115
8116 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8117
8118         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8119         #defines strtoimax.  Also treat the other strto* functions
8120         like strtoimax.
8121
8122         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8123         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8124         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8125
8126 2001-09-26  Jim Meyering  <meyering@lucent.com>
8127
8128         Most macros in unlocked-io.h had the wrong number of arguments.
8129         * gen-uio: New script.
8130         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8131         * unlocked-io.hin: Remove file.
8132         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8133         rather than trying to embed it here.
8134         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8135         Reported by Padraig Brady.
8136
8137 2001-09-25  Volker Borchert  <bt@teknon.de>
8138
8139         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8140
8141 2001-09-23  Jim Meyering  <meyering@lucent.com>
8142
8143         * mountlist.c: Remove useless parentheses in #if directives.
8144         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8145         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8146
8147 2001-09-22  Jim Meyering  <meyering@lucent.com>
8148
8149         * localcharset.c: Update from latest gettext.
8150         * config.charset: Likewise.
8151
8152 2001-09-20  Jim Meyering  <meyering@lucent.com>
8153
8154         * xstrtol.c (strtoimax): Guard declaration with
8155         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8156         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8157         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8158         (strtoumax): Likewise, for completeness (it wasn't necessary).
8159
8160 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8161
8162         * strtoimax.c (HAVE_LONG_LONG):
8163         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8164         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8165         to work around bug in IBM C compiler.
8166
8167 2001-09-16  Jim Meyering  <meyering@lucent.com>
8168
8169         * mkdir.c: New file.
8170
8171 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8172
8173         * xgetcwd.c: Revert some of the previous change; intead,
8174         fix the HAVE_GETCWD_NULL code to behave more like the
8175         !HAVE_GETCWD_NULL code used to.
8176
8177         Include "xalloc.h".
8178         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8179         invoke xalloc_die.
8180
8181 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8182
8183         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8184         Use ssize_t, not int, to store result of readlink.
8185         Check for ssize_t overflow as well as size_t overflow,
8186         as POSIX says the result of readlink is implementation-defined
8187         when ssize_t overflows.
8188         Remove unnecessary cast to char*.
8189         Use free+malloc instead of realloc, as the storage doesn't need
8190         to be preserved and it's clearer and can be more efficient that way.
8191         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8192         * xreadlink.h (xreadlink): Update prototype.
8193
8194 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8195
8196         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8197         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8198         spotted by Jim Meyering.
8199
8200 2001-09-03  Jim Meyering  <meyering@lucent.com>
8201
8202         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8203
8204 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8205
8206         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8207         like the HAVE_GETCWD_NULL code.
8208         Include pathmax.h if not HAVE_GETCWD.
8209         Do not include xalloc.h.
8210         (INITIAL_BUFFER_SIZE): New symbol.
8211         Do not use xmalloc / xrealloc, since the caller is responsible for
8212         handling errors.  Preserve errno around `free' during failure.
8213         Do not overrun buffer when using getwd.
8214
8215 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8216
8217         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8218         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8219
8220 2001-09-02  Jim Meyering  <meyering@lucent.com>
8221
8222         * error.c: Update from GNU libc.
8223
8224 2001-09-01  Jim Meyering  <meyering@lucent.com>
8225
8226         * xreadlink.c: New file.
8227         * xreadlink.h: New file.
8228         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8229
8230         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8231         doesn't conflict with sparc Solaris 7's definition in
8232         /usr/include/sys/int_types.h.
8233
8234         * exclude.c: Use `""', not `<>' to #include non-system header files.
8235         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8236         and strncasecmp as r-values.  Unixware didn't have declarations.
8237
8238 2001-08-31  Jim Meyering  <meyering@lucent.com>
8239
8240         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8241         Use an initial, malloc'd, buffer of length 128 rather than
8242         a statically allocated one of length 1024.
8243
8244 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8245
8246         * xgetcwd.c: Don't include pathmax.h.
8247         Include stdlib.h and unistd.h if available.
8248         Include xalloc.h.
8249         (xmalloc, xstrdup, free): Remove decls.
8250         (xgetcwd): Don't assume sizes fit in unsigned.
8251         Check for overflow when computing sizes.
8252         Simplify reallocation code.
8253
8254 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8255
8256         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8257
8258         * strtoimax.c: Renamed from strtoxmax.c, removing the
8259         old strtoimax.c.
8260
8261         Also, make the following further changes to make this file's
8262         configuration more similar to that of strtol.c:
8263         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8264         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8265         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8266         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8267         changed to signed values.
8268
8269         And make the following changes as well:
8270         Fix copyright notice, as 1999 was missing.
8271         (verify): New macro.
8272         (strtoimax): Check sizes at compile-time, not run-time.
8273         Prefer strtol to strtoll if both work.
8274         (main): Remove; it was not that useful and was a pain to maintain.
8275
8276         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8277
8278 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8279
8280         * savedir.c (savedir): Remove size parameter, as POSIX says that
8281         a directory's st_size can have an arbitrary value, so the old
8282         usage could waste an arbitrary amount of memory.  All uses
8283         changed.
8284         * savedir.h: Update prototype.
8285
8286 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8287
8288         * xstrtol.c (strtoimax): New decl.
8289
8290 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8291
8292         * xstrtol.h: Add copyright notice.
8293         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8294         LONGINT_INVALID_SUFFIX_CHAR.
8295
8296 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8297
8298         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8299         tm to be declared.
8300
8301 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8302
8303         * hash.c: Remove '2001' from copyright notice.
8304
8305 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8306
8307         * full-write.h: New file.
8308         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8309         * full-write.c: Correct credits, as cccp.c no longer
8310         exists and anyway it was so heavily changed from the old cccp
8311         code as to be unrecognizable.  Include full-write.h.
8312         (full_write) Return size_t, with short writes meaning failure.
8313         All callers changed.  This fixes a bug with large buffers
8314         on 64-bit hosts.
8315         * utime.c: Include full-write.h.
8316
8317 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8318
8319         Merge 'exclude' changes from tar 1.13.22.
8320         This fixes one or two unlikely storage allocation overflow bugs,
8321         but doesn't change user-visible behavior otherwise.
8322
8323 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8324
8325         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8326         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8327         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8328         Include if available.
8329         (<xalloc.h>): Include
8330         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8331         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8332         collide with FNM macros.
8333         (struct patopts): New struct.
8334         (struct exclude): Use it, as exclude patterns now come with options.
8335         (new_exclude): Support above changes.
8336         (new_exclude, add_exclude_file):
8337         Initial size must now be a power of two to simplify overflow checking.
8338         (free_exclude, fnmatch_no_wildcards): New function.
8339         (excluded_filename): No longer requires options arg, as the options
8340         are determined by add_exclude.  Now returns bool, not int.
8341         (excluded_filename, add_exclude):
8342         Add support for the fancy new exclusion options.
8343         (add_exclude, add_exclude_file): Now takes int options arg.
8344         Check for arithmetic overflow when computing sizes.
8345         (add_exclude_file): xrealloc might modify errno, so don't
8346         realloc until after errno might be used.
8347
8348         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8349         New macros.
8350         (free_exclude): New decl.
8351         (add_exclude, add_exclude_file): Now takes int options arg.
8352         (excluded_filename): No longer requires options arg, as the options
8353         are determined by add_exclude.  Now returns bool, not int.
8354
8355 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8356
8357         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8358
8359 2001-08-27  Jim Meyering  <meyering@lucent.com>
8360
8361         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8362
8363         * version-etc.c (N_): Remove definition.
8364         Revert most of last change.
8365         Instead, simply don't mark the `Copyright...' string for translation.
8366         Based on advice from Paul Eggert.
8367
8368         * strtoxmax.c: Tweak comment.
8369
8370 2001-08-26  Jim Meyering  <meyering@lucent.com>
8371
8372         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8373         of copyright with `%s' so translators don't get an untranslated
8374         message in 2002.
8375         (COPYRIGHT_YEAR): Define.
8376         (version_etc): Use fprintf rather than fputs.
8377         Suggestion from Ulrich Drepper.
8378
8379         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8380
8381         * strtoll.c: New file, from GNU libc.
8382         * xstrtoimax.c: New file.
8383
8384         * xstrtol.h: Add xstrtoimax.
8385         * strtoumax.c: New file.  Simply include "strtoumax.c".
8386         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8387
8388         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8389         * strtoxmax.c: ... then renamed to this.
8390
8391 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8392
8393         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8394         Port to Solaris 8, where 'sed' requires a space after the 'r'
8395         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8396         Redirect output to $tmp just once.
8397
8398 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8399
8400         * addext.c (<errno.h>): Include.
8401         (errno): Declare if not defined.
8402         (addext): Work correctly when pathconf returns -1 and leaves
8403         errno alone because there is no limit.  Also, work even if
8404         pathconf returns a value greater than SIZE_MAX.
8405
8406 2001-08-12  Jim Meyering  <meyering@lucent.com>
8407
8408         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8409         Simply `return getcwd (NULL, 0);'.
8410         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8411         Use 1300 as initial value for length, not PATH_MAX.
8412
8413         * pathmax.h: Clean up cpp syntax.
8414
8415 2001-08-12  Jim Meyering  <meyering@lucent.com>
8416
8417         * gettimeofday.c: New file.
8418         * gtod.h: New file.
8419         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8420
8421 2001-08-04  Jim Meyering  <meyering@lucent.com>
8422
8423         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8424         to get in sync with glibc.
8425
8426 2001-08-03  Paul Eggert  <eggert@twinsun.com>
8427
8428         The following changes are from gettext 0.10.39 as maintained by
8429         Bruno Haible.
8430
8431         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8432         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8433         with inverted sense.  All uses changed.
8434
8435         * mbswidth.c: Don't include <limits.h>.
8436         Include <stdlib.h> and <string.h> unconditionally.
8437         (iswcntrl, mbsinit, ISCNTRL): New macros.
8438         (mbsnwidth): Use K&R style function declarations.
8439         Don't bother checking for MB_LEN_MAX == 1, since the compiler
8440         can optimize it when MB_CUR_MAX == 1.
8441         The width of control characters is zero, not 1.
8442
8443 2001-07-15  Jim Meyering  <meyering@lucent.com>
8444
8445         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8446         (BUILT_SOURCES): Add unlocked-io.h.
8447         (io_functions): Define.
8448         (unlocked-io.h): New rule.
8449         (DISTCLEANFILES): Add unlocked-io.h.
8450         (all-local): Depend on unlocked-io.h, to ensure it is created.
8451
8452         * unlocked-io.hin: New file
8453
8454         * regex.c: Update from glibc.
8455
8456 2001-07-05  Jim Meyering  <meyering@lucent.com>
8457
8458         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8459         recommendation.
8460         (libfetish_a_SOURCES): Put all .h files here instead.
8461         Remove a thus-exposed (better checks in automake) duplicate and
8462         two unnecessary .h files.
8463
8464 2001-06-11  Jim Meyering  <meyering@lucent.com>
8465
8466         * regex.c: Update from GNU libc.
8467
8468 2001-05-27  Jim Meyering  <meyering@lucent.com>
8469
8470         * readutmp.h (UT_TYPE): Define.
8471
8472 2001-05-24  Jim Meyering  <meyering@lucent.com>
8473
8474         * argmatch.c: Include "quote.h".
8475         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
8476         quote function.  Reported by Göran Uddeborg.
8477
8478 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
8479
8480         * dirname.c (dir_name): Compute append_dot using path, not newpath
8481         which is not yet declared.
8482
8483 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8484
8485         * Makefile.am (libfetish_a_SOURCES):
8486         Add strftime.c, since we now compile it on all hosts.
8487
8488         * strftime.c (my_strftime):
8489         Define to nstrftime if emacs, but only if my_strftime is not defined.
8490         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8491         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8492         Add one more extra argument: a nanoseconds value.
8493         All uses changed.
8494         (ns): New macro.
8495         (my_strftime function): Add %N format.
8496         (emacs_strftimeu): Renamed from emacs_strftime,
8497         with extra ut argument.
8498
8499 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8500
8501         dirname code cleanup.  base_name now behaves more compatibly
8502         with POSIX basename when given file names that have trailing
8503         slashes, and similarly for dir_name.  Add new primitives
8504         base_len and dir_len.  Put the directory-name-related decls
8505         into dirname.h.
8506
8507         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8508         * backupfile.c (base_name): Likewise.
8509         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8510         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8511         * makepath.c (strip_trailing_slashes): Likewise.
8512         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8513         Likewise.
8514         * rename.c (strip_trailing_slashes): Likewise.
8515         * same.c (base_name): Likewise.
8516         * stripslash.c (ISSLASH): Likewise.
8517
8518         * addext.c: Include <dirname.h> after size_t is defined.
8519         * backupfile.c: Likewise.
8520
8521         * addext.c (addext): Use base_len to trim redundant
8522         trailing slashes instead of doing it ourselves.
8523         But do not trim the last slash if it is not redundant.
8524
8525         * backupfile.c (find_backup_file_name,
8526         max_backup_version): Use base_len instead of rolling it ourselves.
8527         Handle the case of "" and (on DOS) "C:" correctly.
8528
8529         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8530         Include <string.h>, <dirname.h>.
8531         (base_name): Allow file names ending in slashes, other than names
8532         that are all slashes.  In this case, return the basename followed
8533         by the slashes.  This is more general, and can be used in places
8534         where the original base_name purposely had an assertion failure.
8535         (base_len): New function.
8536
8537         * dirname.c: Include <string.h> instead of <stdlib.h>.
8538         Do not include <assert.h>; no longer needed.
8539         Include xalloc.h.
8540         (memrchr): Remove decl.
8541         (dir_name_r): Remove.
8542         (dir_len): Renamed from dirlen.  All callers changed.
8543         Rewrite in terms of base_name, for simplicity and consistency.
8544         (dir_name): Never return NULL.  All callers changed.
8545         Do not include <stdlib.h> in test program; no longer needed.
8546         return 0; is fine for test program.
8547
8548         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8549         New macros.
8550         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8551
8552         * path-concat.c (path_concat): Use base_len to compute
8553         base length, not strlen; this means we cannot rely on memcpy
8554         to null-terminate.
8555
8556         * same.c (STREQ): Remove.
8557         (same_name): Handle the case where the basename ends in trailing '/'.
8558
8559         * stripslash.c (strip_trailing_slashes): Return nonzero if
8560         a slash was stripped.  Do not strip the last slash after a
8561         file system prefix.
8562
8563 2001-04-08  Jim Meyering  <meyering@lucent.com>
8564
8565         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8566         recomputed; that's necessary when the offset spans a DST transition.
8567         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
8568
8569 2001-04-02  Jim Meyering  <meyering@lucent.com>
8570
8571         * regex.h, regex.c: Update from GNU libc.
8572
8573 2001-03-19  Paul Eggert  <eggert@twinsun.com>
8574
8575         * version-etc.c (version_etc_copyright): Update to 2001.
8576
8577 2001-03-16  Paul Eggert  <eggert@twinsun.com>
8578
8579         * tempname.c (uint64_t): Define to uintmax_t if
8580         not defined, and if UINT64_MAX is not defined.
8581         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8582         Reported by John David Anglin.
8583
8584 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
8585
8586         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
8587         alias if codeset is empty.
8588         * config.charset (BeOS): Use wildcard syntax.
8589
8590 2001-03-13  Jim Meyering  <meyering@lucent.com>
8591
8592         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
8593         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
8594         From Bruno Haible.
8595
8596 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8597
8598         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
8599         Don't return NULL.
8600         * unicodeio.c (print_unicode_char): Simplify accordingly.
8601
8602 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8603
8604         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
8605         support for DOS/DJGPP.
8606
8607 2001-02-28  Paul Eggert  <eggert@twinsun.com>
8608
8609         * Makefile.am (libfetish_a_SOURCES):
8610         Add dup-safer.c, fopen-safer.c.
8611         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
8612
8613         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
8614
8615 2001-02-25  Paul Eggert  <eggert@twinsun.com>
8616
8617         The mkstemp replacement is taken from glibc 2.2.2, with some
8618         portability fixes for use outside glibc, as follows:
8619
8620         * tempname.c (struct_stat64): New macro.
8621         (direxists, __gen_tempname): Use it.
8622         This avoids a portability problem with Solaris 8.
8623
8624         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
8625         (<stddef.h>, <stdint.h>, <string.h>):
8626         Include only if STDC_HEADERS || _LIBC.
8627         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
8628         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
8629         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
8630         (__set_errno): Define this macro if <errno.h> doesn't.
8631         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
8632         Define these macros if <stdio.h> doesn't.
8633         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
8634         Define these macros if <sys/stat.h>
8635         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
8636         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
8637         __xstat64): Define if not _LIBC.
8638         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
8639         (__gen_tempname): Invoke gettimeofday only if
8640         HAVE_GETTIMEOFDAY || _LIBC;
8641         otherwise, fall back on plain "time".
8642         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
8643
8644         * mkstemp.c (__GT_FILE): Define to zero if not defined.
8645
8646         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
8647
8648 2001-02-17  Jim Meyering  <meyering@lucent.com>
8649
8650         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
8651         around included file name.
8652
8653         * strnlen.c (__strnlen): Merge in a change from GNU libc.
8654
8655         * strftime.c: Update from GNU libc (the only changes were to comments).
8656
8657 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
8658
8659         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
8660
8661 2001-02-17  Paul Eggert  <eggert@twinsun.com>
8662
8663         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
8664         Remove workaround macros for hosts that have mbrtowc but not
8665         mbstate_t, as we now insist on proper declarations for both
8666         before using mbrtowc.
8667
8668 2001-02-17  Jim Meyering  <meyering@lucent.com>
8669
8670         * regex.c: Update from libc.
8671
8672 2001-02-16  Paul Eggert  <eggert@twinsun.com>
8673
8674         * alloca.c (malloc): Undef before defining, since stdlib.h
8675         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
8676         Reported by Mark Hounschell via Paul Eggert.
8677
8678 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
8679
8680         * config.charset: Update for FreeBSD 4.2.
8681
8682 2001-01-26  Jim Meyering  <meyering@lucent.com>
8683
8684         * quotearg.c: Include stddef.h.
8685         * quote.c: Include stddef.h.
8686         Reported by Axel Kittenberger.
8687
8688         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
8689         line in double quotes so that it evokes a better diagnostic.
8690         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
8691         Reported by Axel Kittenberger.
8692
8693 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
8694
8695         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
8696         to avoid a warning.  Add back 'const' to inptr.
8697
8698 2001-01-16  Jim Meyering  <meyering@lucent.com>
8699
8700         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
8701         From Bruno Haible.
8702
8703 2001-01-14  Jim Meyering  <meyering@lucent.com>
8704
8705         * rename.c: New file.  From Volker Borchert.
8706         Include stdlib.h, string.h or strings.h, and xalloc.h.
8707         Use strip_trailing_slashes rather than open-coding it.
8708
8709 2001-01-03  Paul Eggert  <eggert@twinsun.com>
8710
8711         * strftime.c: Sync with glibc time/strftime.c 1.81.
8712
8713 2001-01-03  Jim Meyering  <meyering@lucent.com>
8714
8715         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
8716         local `inptr' to avoid warning with some system declarations of iconv.
8717
8718 2000-12-29  Paul Eggert  <eggert@twinsun.com>
8719
8720         * modechange.c: Do not assume that mode_t uses the
8721         traditional octal encoding.  E.g. "chmod 1 FOO" should set
8722         the other-execute bit of FOO even if S_IXOTH != 1.
8723
8724         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
8725         WOTH, XOTH, ALLM): New macros.
8726         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
8727          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
8728         Use them.
8729         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
8730         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
8731         (mode_compile):
8732         No need to use uintmax_t; unsigned long is long enough.
8733         Don't bother to get suffix since we don't use it.
8734
8735 2000-12-24  Jim Meyering  <meyering@lucent.com>
8736
8737         * hash.c (is_prime): Return explicit boolean values.
8738         (hash_get_first): Return NULL to appease Irix5.6's 89.
8739         Reported by Nelson Beebe.
8740
8741 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
8742
8743         * localcharset.c (locale_charset): Add support for Win32.
8744
8745 2000-12-18  Paul Eggert  <eggert@twinsun.com>
8746
8747         * physmem.h, physmem.c: New files.
8748
8749         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
8750         (noinst_HEADERS): Add physmem.h.
8751
8752         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
8753         't' for compatibility with Solaris 8 sort.
8754
8755 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
8756
8757         * config.charset: Add support for BeOS.
8758
8759 2000-12-16  Jim Meyering  <meyering@lucent.com>
8760
8761         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
8762         SHELLS_FILE to a file name that's useful on djgpp systems.
8763         Include stdlib.h.
8764         (ADDITIONAL_DEFAULT_SHELLS): Define.
8765         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
8766         Based mostly on a patch from Prashant TR.
8767
8768 2000-12-16  Jim Meyering  <meyering@lucent.com>
8769
8770         This bug had a serious impact on chown: `chown N:M FILE' (for integer
8771         N and M) would have treated it like `chown N:N FILE'.
8772
8773         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
8774
8775 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
8776
8777         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
8778         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
8779         to the list of canonical encodings. Rename EUC-CN to GB2312.
8780
8781 2000-12-08  Andreas Schwab  <schwab@suse.de>
8782
8783         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
8784         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
8785
8786 2000-12-07  Jim Meyering  <meyering@lucent.com>
8787
8788         * stripslash.c (ISSLASH): Define.
8789         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
8790         From Prashant TR.
8791
8792         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
8793         (dir_name_r): Declare this function as static.
8794         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
8795         manifest itself on a name containing a mix of slashes and
8796         backslashes.
8797         Make this function work with names starting with a DOS-style
8798         drive letter and colon prefix.
8799         (dir_name): Append `.' if necessary.
8800         Based mostly on patches from Prashant TR and Eli Zaretskii.
8801
8802         * dirname.h (dir_name_r): Remove prototype.
8803
8804 2000-12-05  Jim Meyering  <meyering@lucent.com>
8805
8806         * dirname.c (dir_name_r): Add `const' in a few local declarations.
8807
8808 2000-12-04  Jim Meyering  <meyering@lucent.com>
8809
8810         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
8811         Also include memory.h, stdlib.h, unistd.h if appropriate.
8812         Reported by Andreas Jaeger (conflicting declaration of malloc).
8813
8814 2000-12-02  Jim Meyering  <meyering@lucent.com>
8815
8816         * closeout.h: Make idempotent, to avoid some obscure warnings.
8817
8818 2000-12-01  Paul Eggert  <eggert@twinsun.com>
8819
8820         * memrchr.c: Include <config.h> before any system include file.
8821
8822 2000-11-29  Paul Eggert  <eggert@twinsun.com>
8823
8824         * dirname.c (dir_name_r): Fix typo: int -> size_t.
8825
8826 2000-11-26  Jim Meyering  <meyering@lucent.com>
8827
8828         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
8829
8830 2000-11-22  Paul Eggert  <eggert@twinsun.com>
8831
8832         * strftime.c (my_strftime): Do not invoke mbrlen with a
8833         size of (size_t) -1; it's not portable.
8834
8835 2000-11-17  Akim Demaille  <akim@epita.fr>
8836
8837         * obstack.h: Formatting changes.
8838         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
8839         prevent type checking.
8840         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
8841         cast the value to (void *): assigning a `foo *' to a `void *'
8842         variable is valid.
8843         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
8844
8845 2000-11-17  Jim Meyering  <meyering@lucent.com>
8846
8847         * strstr.c: Update from GNU libc.
8848
8849 2000-11-16  Jim Meyering  <meyering@lucent.com>
8850
8851         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
8852
8853 2000-11-11  Jim Meyering  <meyering@lucent.com>
8854
8855         * error.c: Add a couple #includes, merging from GNU libc version.
8856
8857 2000-11-10  Jim Meyering  <meyering@lucent.com>
8858
8859         * obstack.h: Update from GNU libc.
8860         * obstack.c: Likewise.
8861
8862 2000-11-06  Paul Eggert  <eggert@twinsun.com>
8863
8864         * getusershell.c (setusershell): Use rewind rather than
8865         fseek/fseeko, to avoid configuration hassles with fseeko.
8866         Don't bother opening SHELLS_FILE if shellstream is NULL;
8867         it's not necessary.
8868
8869 2000-11-05  Jim Meyering  <meyering@lucent.com>
8870
8871         * makepath.h (make_dir): Declare.
8872         * makepath.c (make_dir): Remove `static' attribute.
8873         Tweak a comment.
8874
8875 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
8876
8877         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
8878         last one in a bucket, advance to the next bucket.
8879
8880 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
8881
8882         * fnmatch.c: Do not comment out all the code if we are using
8883         the GNU C library, because in some cases we are replacing buggy
8884         code in the GNU C library itself.
8885
8886 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8887
8888         * error.h, getline.h, modechange.h:
8889         Remove "2000" from Copyright line, as the file hasn't been
8890         changed this year other than in the copyright notice.
8891
8892         * xalloc.h: Add "2000" to Copyright line, as this file
8893         was changed this year.
8894
8895 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8896
8897         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
8898         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8899         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8900
8901 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
8902
8903         * regex.h (__restrict_arr): Move definition out of #ifndef block.
8904         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
8905         doesn't define __restrict_arr.
8906
8907 2000-10-29  Jim Meyering  <meyering@lucent.com>
8908
8909         * xstat.in: Fix grammar in comment.
8910
8911 2000-10-28  Jim Meyering  <meyering@lucent.com>
8912
8913         * memchr.c: Update from libc.
8914         Adjust for portability:
8915         [HAVE_STDLIB_H]: Include stdlib.h.
8916         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
8917         Undef __memchr, too.
8918         [!weak_alias]: Define __memchr to memchr.
8919
8920         * regex.c: Update from libc.
8921         * regex.h: Likewise.
8922         * getopt1.c: Likewise.
8923         * memcmp.c: Likewise.
8924
8925         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
8926         Avoid using fseek, when possible -- it's broken by design.
8927         Patch by Ulrich Drepper.
8928
8929 2000-10-26  Jim Meyering  <meyering@lucent.com>
8930
8931         * strftime.c: Update from libc.
8932
8933 2000-10-25  Jim Meyering  <meyering@lucent.com>
8934
8935         * obstack.c: Update from libc.
8936
8937 2000-10-23  Jim Meyering  <meyering@lucent.com>
8938
8939         * hard-locale.c (hard_locale): Revert last change -- it was simply
8940         wrong.  That set_locale call must not have any side effects.
8941         From Paul Eggert.
8942
8943 2000-10-22  Jim Meyering  <meyering@lucent.com>
8944
8945         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
8946         [CYCLIC]: Remove now-unused definition.
8947
8948         * save-cwd.c (O_DIRECTORY): Define, if needed.
8949         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
8950         Suggestion from Ulrich Drepper.
8951
8952 2000-10-21  Jim Meyering  <meyering@lucent.com>
8953
8954         * dirname.c (dir_name_r): New function, factored out of dir_name.
8955         (dir_name): Use dir_name_r.
8956         * dirname.h (dir_name_r): Declare it.
8957
8958 2000-10-21  Jim Meyering  <meyering@lucent.com>
8959
8960         * dirname.c (memrchr): Declare if necessary.
8961         (dir_name): Remove the restriction that there be no
8962         trailing slashes.  Now, this code skips past them, effectively
8963         ignoring them.
8964         [TEST_DIRNAME] (main): New unit tests.
8965
8966         * memrchr.c: New file from GNU libc.
8967         Undef __memrchr, too.
8968         [!weak_alias]: Define __memrchr to memrchr.
8969         Guard weak_alias use with `#ifdef weak_alias'.
8970
8971 2000-10-17  Jim Meyering  <meyering@lucent.com>
8972
8973         * quote.h (PARAMS): Define and use.
8974         Reported by Akim Demaille.
8975
8976         * getopt.c: Update from libc.
8977
8978 2000-10-16  Jim Meyering  <meyering@lucent.com>
8979
8980         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
8981         From Jan Fedak.
8982
8983 2000-09-25  Jim Meyering  <meyering@lucent.com>
8984
8985         * md5.h (rol): Define (from GnuPG).
8986
8987         * sha.c: Give credit (GnuPG) where due.
8988         (M): Use rol rather than open-coding it.
8989         Add a FIXME comment.
8990
8991 2000-09-21  Jim Meyering  <meyering@lucent.com>
8992
8993         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
8994         Reported by Michael Stone.
8995
8996 2000-09-20  Jim Meyering  <meyering@lucent.com>
8997
8998         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
8999         (noinst_HEADERS): Add sha.h.
9000         Based on code from Scott G. Miller and from GnuPG.
9001
9002 2000-09-15  Jim Meyering  <meyering@lucent.com>
9003
9004         * regex.c: Update from libc.
9005
9006 2000-09-10  Jim Meyering  <meyering@lucent.com>
9007
9008         * getopt.c (_getopt_internal): Update from glibc.
9009
9010 2000-09-09  Jim Meyering  <meyering@lucent.com>
9011
9012         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9013         think it should be used as a general replacement for isascii.
9014         * fnmatch.c: Likewise.
9015         * mbswidth.c: Likewise
9016         * regex.c: Likewise.
9017
9018         Don't use atoi.
9019         * userspec.c: Include sys/param.h and limits.h.
9020         Include xstrtol.h.
9021         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9022         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9023         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9024         UID, GID.  Check range.
9025
9026 2000-09-06  Jim Meyering  <meyering@lucent.com>
9027
9028         * getopt.c (_getopt_internal): Update from glibc.
9029
9030 2000-08-30  Jim Meyering  <meyering@lucent.com>
9031
9032         * strftime.c: Merge in changes from GNU libc.
9033
9034 2000-08-26  Jim Meyering  <meyering@lucent.com>
9035
9036         * closeout.c: Include "__fpending.h".
9037         (close_stdout_status): Return right away if there's nothing to flush.
9038
9039         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9040         * __fpending.c: New file.
9041         * __fpending.h: New file.
9042
9043 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9044
9045         Standardize on "memory exhausted" instead of "Memory exhausted"
9046         or "virtual memory exhausted".
9047         * obstack.c (print_and_abort): Use "memory exhausted", not
9048         "virtual memory exhausted".
9049         * same.c (same_name): Invoke xalloc_die instead of printing
9050         our own message.
9051         * userspec.c (parse_user_spec): Likewise.
9052         * bumpalloc.h: comment fix
9053         * same.c, userspec.c: Include xalloc.h.
9054
9055         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9056         not char *const and pointing to a constant array.
9057         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9058         (xrealloc): Comment fix.
9059
9060         * userspec.c (parse_user_spec):
9061         Don't translate a message until just before returning,
9062         to avoid unnecessary translation.
9063
9064 2000-08-07  Jim Meyering  <meyering@lucent.com>
9065
9066         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9067         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9068         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9069         getgroups.c, gethostname.c, getopt.h, group-member.c,
9070         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9071         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9072         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9073         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9074         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9075         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9076         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9077         yesno.c: Back out Copyright date changes for each file with no change
9078         this year.  This eases coordination with other programs using the same
9079         source code modules.  From Paul Eggert.
9080
9081 2000-08-03  Greg McGary  <greg@mcgary.org>
9082
9083         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9084         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9085         (EXTEND_BUFFER): Use them.
9086
9087 2000-08-01  Jim Meyering  <meyering@lucent.com>
9088
9089         * dirname.c (ISSLASH): Define.
9090         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9091         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9092         both `\' and `/' may be use as path separators.
9093         Based on a patch from Prashant TR.
9094
9095 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9096
9097         * quotearg.c (quotearg_n_options): Don't make the initial
9098         slot vector a constant, since it might get modified.
9099
9100 2000-07-31  Jim Meyering  <meyering@lucent.com>
9101
9102         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9103         * obstack.c (print_and_abort): Likewise.
9104
9105 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9106
9107         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9108         buffer, so that the caller can always quote one small
9109         component of a "memory exhausted" message in slot 0.
9110         From a suggestion by Jim Meyering.
9111
9112 2000-07-30  Jim Meyering  <meyering@lucent.com>
9113
9114         * makepath.c (make_path): Quote the other instance, too.
9115
9116         * quotearg.c (N_STATIC_SLOTVECS): Define.
9117         (STATIC_BUF_SIZE): Define.
9118         (quotearg_n_options): Use only statically allocated storage when
9119         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9120         than STATIC_BUF_SIZE.
9121
9122 2000-07-29  Jim Meyering  <meyering@lucent.com>
9123
9124         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9125         * dirname.c (dir_name): Likewise.
9126
9127         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9128
9129         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9130         (dir_name): Assert that there are no trailing slashes.
9131
9132 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9133
9134         * mbswidth.h (mbswidth): Add a flags argument.
9135         (mbswidth): New declaration.
9136         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9137         * mbswidth.c (mbswidth): Add a flags argument.
9138         (mbsnwidth): New function.
9139
9140 2000-07-24  Jim Meyering  <meyering@lucent.com>
9141
9142         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9143
9144 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9145
9146         * mbswidth.c (_XOPEN_SOURCE):
9147         Don't define; this causes problems on Solaris 7.
9148         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9149
9150 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9151
9152         * quotearg.c:
9153         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9154         so that mbstate_t is always defined.
9155
9156         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9157         be 1 in at least one GCC installation, and this configuration
9158         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9159         performance on hosts that have mbrtowc but have only unibyte
9160         locales, but I assume these hosts are rare.
9161
9162 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9163
9164         * quotearg.c: Streamline by invoking multibyte code only if needed.
9165         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9166         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9167         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9168         invoke multibyte primitives.
9169
9170 2000-07-23  Jim Meyering  <meyering@lucent.com>
9171
9172         * basename.c (base_name): Add an assertion.
9173
9174 2000-07-15  Bruno Haible  <clisp.cons.org>
9175
9176         * quotearg.c: When the system forces us to redefine mbstate_t,
9177         shadow its mbsinit function.
9178
9179 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9180
9181         * mbswidth.h: New file.
9182         * mbswidth.c: New file.
9183         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9184         (noinst_HEADERS): Add mbswidth.h.
9185
9186 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9187
9188         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9189         and IRIX 6.
9190
9191 2000-07-15  Jim Meyering  <meyering@lucent.com>
9192
9193         * makepath.c: Include quote.h.
9194         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9195         corresponding argument in a `quote (...)' call.
9196         Give better diagnostics.
9197
9198         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9199         (noinst_HEADERS): Add quote.h.
9200
9201         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9202         from tar's src/misc.c.
9203         * quote.h: New file.  Prototypes for same.
9204
9205 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9206
9207         From a suggestion by Bruno Haible.
9208         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9209         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9210         to decide whether to define the BeOS workaround macro;
9211         this adjusts to the change to AC_MBSTATE_T.
9212
9213 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9214
9215         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9216
9217         * quotearg.c (quoting_style_args, quoting_style_vals,
9218         quotearg_buffer_restyled): Add support for
9219         clocale_quoting_style.  Undo previous change to
9220         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9221         and "{RIGHT QUOTATION MARK}" msgids.
9222
9223 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9224
9225         The old behavior of quoting `like this' doesn't look good with
9226         newer, ISO-style fonts.  See:
9227         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9228
9229         Instead, quote "like this" by default.  Let the translator
9230         tailor the locale-specific quoting behavior by providing
9231         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9232
9233         * quotearg.c (N_): New macro.
9234         (gettext_default): New function.
9235         (quotearg_buffer_restyled): Use
9236         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9237         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9238
9239 2000-07-09  Jim Meyering  <meyering@lucent.com>
9240
9241         * Most files: Update copyright dates to include 2000.
9242
9243 2000-07-08  Jim Meyering  <meyering@lucent.com>
9244
9245         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9246         if not defined.
9247         (xgethostname): Remove now-unnecessary #ifdef.
9248         Move declaration of `err' into loop where it's used.
9249
9250 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9251
9252         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9253         by allocating a larger buffer. Test the gethostname return value for
9254         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9255         returns an error and ENAMETOOLONG isn't defined.
9256
9257 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9258         and Bruno Haible  <haible@clisp.cons.org>
9259
9260         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9261
9262 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9263
9264         * quotearg.c (struct quoting_options): Simplify quote_these_too
9265         dimension.
9266
9267 2000-07-03  Jim Meyering  <meyering@lucent.com>
9268
9269         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9270         Reported by Bruno Haible.
9271
9272 2000-07-04  Jim Meyering  <meyering@lucent.com>
9273
9274         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9275         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9276         lacks mbrtowc.
9277
9278 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9279         and Bruno Haible  <haible@clisp.cons.org>
9280
9281         * quotearg.c (mbrtowc):
9282         Assign to *pwc, and return 1 only if result is nonzero.
9283         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9284
9285 2000-07-03  Jim Meyering  <meyering@lucent.com>
9286
9287         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9288         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9289         From Bob Proulx.
9290
9291 2000-07-02  Jim Meyering  <meyering@lucent.com>
9292
9293         * quotearg.c (mbstate_t): Don't define here.
9294
9295 2000-07-02  Jim Meyering  <meyering@lucent.com>
9296
9297         * nanosleep.c (SIGCONT): Define if not already defined.
9298
9299 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9300
9301         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9302         per change in ../m4/ls-mntd-fs.m4.
9303         (read_filesystem_list): Ignore symbolic links.
9304
9305 2000-06-29  Jim Meyering  <meyering@lucent.com>
9306
9307         * same.c: Include <string.h> or <strings.h>, as appropriate,
9308         for declaration of strcmp.
9309
9310         * long-options.c: Include <stdlib.h>, for declaration of exit.
9311
9312         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9313         Avoid warning by casting result to `char *' to remove `const'.
9314
9315 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9316
9317         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9318
9319 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9320
9321         savedir now sets errno on failure and invokes xmalloc to get memory.
9322         Fix a couple of other minor bugs while we're at it.
9323
9324         * savedir.c (<unistd.h>): Do not include; there's no need.
9325         (NAMLEN): Remove macro.
9326         (malloc, realloc): Remove decls.
9327         (stpcpy): Likewise.
9328         ("xalloc.h"): Include.
9329         (NAME_SIZE_DEFAULT): New macro.
9330         (savedir): Use xmalloc / xrealloc to allocate memory.
9331         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9332         Skip "" directory entries.
9333         Use strlen to calculate directory entry length, since the old method
9334         is rarely used these days and isn't worth supporting.
9335         Don't use a pointer after freeing it.
9336         Check for integer overflow when calculating allocation size.
9337         Use memcpy to copy entries, instead of stpcpy.
9338         Set errno properly when returning NULL.
9339         Check for readdir error.
9340
9341 2000-06-26  Jim Meyering  <meyering@lucent.com>
9342
9343         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9344
9345 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9346
9347         * getusershell.c (xmalloc, xrealloc): Remove functions.
9348         Include xalloc.h.
9349         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9350
9351 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9352
9353         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9354
9355 2000-06-24  Jim Meyering  <meyering@lucent.com>
9356
9357         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9358
9359 2000-06-21  Jim Meyering  <meyering@lucent.com>
9360
9361         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9362
9363 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9364
9365         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9366         (mbrtowc, mbstate_t): Define substitutes if
9367         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9368         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9369         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9370
9371 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9372
9373         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9374         than 1024, return a memory chunk of least possible size, instead
9375         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9376         Use free/xmalloc instead of xrealloc to avoid copying for very long
9377         paths.
9378
9379 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9380
9381         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9382         address, not strdup.  Include <stdlib.h> and don't declare free().
9383
9384 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9385
9386         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9387         the empty string.
9388
9389 2000-06-21  Jim Meyering  <meyering@lucent.com>
9390
9391         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9392         (noinst_HEADERS): Add getstr.h.
9393
9394         * getline.c (getstr): Move into a separate file.
9395         * getstr.c (getstr): New file, extracted from getline.c, with
9396         the following changes: new parameter, delim2; both delim[12]
9397         parameters have type `int', not `char'.  The latter would lose
9398         with 8-bit delimiters.
9399         * getstr.h: New file.
9400
9401 2000-06-19  Jim Meyering  <meyering@lucent.com>
9402
9403         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9404
9405 2000-06-18  Jim Meyering  <meyering@lucent.com>
9406
9407         * mkdir.c: Remove file, due mainly to copyright incompatibility.
9408         Besides, these days every porting target provides a mkdir function.
9409
9410         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9411         (this snippet comes from src/system.h).
9412
9413 2000-06-15  Paul Eggert  <eggert@twinsun.com>
9414
9415         * human.c (adjust_value): New function.
9416         (human_readable_inexact): Apply rounding style even when
9417         printing approximate values.
9418
9419 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9420
9421         * human.c (human_readable_inexact): Allow an input block
9422         size that is not a multiple of the output block size, and vice versa.
9423         Reported by Piergiorgio Sartor.
9424
9425 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9426
9427         * getdate.y (get_date): Apply relative times after time
9428         zone indicator, not before.  Reported by Todd A. Jacobs.
9429
9430 2000-06-13  Jim Meyering  <meyering@lucent.com>
9431
9432         * Makefile.am (all-local): Depend on lstat.c and stat.c.
9433
9434         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9435
9436 2000-06-12  Paul Eggert  <eggert@twinsun.com>
9437
9438         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9439
9440 2000-06-04  Paul Eggert  <eggert@twinsun.com>
9441
9442         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9443
9444 2000-06-04  Jim Meyering  <meyering@lucent.com>
9445
9446         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9447         SunOS 4.1.4 for which gid_t is an unsigned type.
9448
9449 2000-06-03  Jim Meyering  <meyering@lucent.com>
9450
9451         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9452
9453 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
9454
9455         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9456         newer, don't install charset.alias.
9457         * config.charset: Change the Linux/glibc rules so they become empty
9458         on glibc-2.1 or newer.
9459
9460 2000-06-02  Jim Meyering  <meyering@lucent.com>
9461
9462         * mountlist.c: Back out last change.  Instead, do this...
9463         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9464         member using the same `ignore'-testing code.
9465         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9466         fs_type strings.
9467         From Mark D. Roth.
9468
9469 2000-05-29  Jim Meyering  <meyering@lucent.com>
9470
9471         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9472         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
9473
9474 2000-05-22  Jim Meyering  <meyering@lucent.com>
9475
9476         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9477
9478 2000-05-18  Jim Meyering  <meyering@lucent.com>
9479
9480         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9481         back, too, since it may have been modified by allocate_entry.
9482         (hash_delete): Rewrite to use neither the assignment operator
9483         nor the comma operator in an if-expression.
9484
9485 2000-05-15  Paul Eggert  <eggert@twinsun.com>
9486
9487         * closeout.c:
9488         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9489         Remove; no longer needed.
9490         "quotearg.h": Add include.
9491         (file_name): Do not bother to explicitly initialize to NULL; it's less
9492         efficient on some hosts.
9493         (close_stdout_status): Remove test as to whether stdout was already
9494         closed; it breaks for the case "echo x | sort >&-".
9495         Quote file name colons.
9496         Do not assume that _("write error") lacks format strings.
9497
9498 2000-05-15  Jim Meyering  <meyering@lucent.com>
9499
9500         * version-etc.c (version_etc_copyright): Update the copyright string
9501         used in all --version output.
9502
9503 2000-05-14  Jim Meyering  <meyering@lucent.com>
9504
9505         * closeout.c (close_stdout_set_file_name): New function.
9506         (close_stdout_status): Use new file-scoped global.
9507         Return right away if fstat says the stdout file descriptor is invalid.
9508         * closeout.h (close_stdout_set_file_name): Declare.
9509
9510 2000-05-10  Jim Meyering  <meyering@lucent.com>
9511
9512         * closeout.c [default_exit_status]: New file-scoped variable.
9513         (close_stdout_set_status): New function.
9514         * closeout.h (close_stdout_set_status): Declare.
9515
9516 2000-05-08  Jim Meyering  <meyering@lucent.com>
9517
9518         * long-options.c: Don't include closeout.h.
9519         (parse_long_options): Don't call close_stdout for --version.
9520
9521 2000-05-06  Jim Meyering  <meyering@lucent.com>
9522
9523         * strnlen.c: Undefine __strnlen and strnlen.
9524         [!weak_alias]: Define __strnlen to strnlen.
9525
9526         * atexit.c: New file, from libiberty.
9527
9528 2000-05-06  Jim Meyering  <meyering@lucent.com>
9529
9530         * closeout.c (close_stdout_status): Also check for errors on the
9531         stderr stream.
9532
9533 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
9534
9535         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9536         instead of xmalloc, xrealloc, path_concat.
9537         (locale_charset): Treat empty environment variables as absent.
9538         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9539
9540 2000-05-04  Jim Meyering  <meyering@lucent.com>
9541
9542         * getopt.c: Update from glibc.
9543         * obstack.c: Likewise.
9544         * obstack.h: Likewise.
9545         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
9546
9547         * regex.h: Likewise.
9548         * strndup.c: Likewise.
9549         * strnlen.c: New file, from glibc.
9550
9551 2000-05-01  Jim Meyering  <meyering@lucent.com>
9552
9553         * full-write.c (full_write): Remove `FIXME' part of comment.
9554
9555 2000-04-29  Jim Meyering  <meyering@lucent.com>
9556
9557         * path-concat.c: Declare strdup only if it's not defined.
9558         * canon-host.c: Likewise.
9559
9560 2000-04-28  Jim Meyering  <meyering@lucent.com>
9561
9562         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9563         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
9564         included first, then limits.h is included by locale.h by libintl.h.
9565         From John David Anglin.
9566
9567 2000-04-25  Jim Meyering  <meyering@lucent.com>
9568
9569         * makepath.c (S_IRWXUGO): Define.
9570         (make_path): Always perform explicit chmod if MODE specifies any
9571         of the `special' permission bits.  Prompted by a bug report against
9572         install from Mate Wierdl and Joost van Baal.
9573
9574 2000-04-18  Jim Meyering  <meyering@lucent.com>
9575
9576         * README: New file.
9577
9578         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9579         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
9580
9581 2000-04-17  Jim Meyering  <meyering@lucent.com>
9582
9583         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
9584         the definition of it to rpl_strftime also defined-away the system's
9585         declaration.
9586
9587 2000-04-15  Jim Meyering  <meyering@lucent.com>
9588
9589         Use `C' to denote so-called `contiguous' files, the same way
9590         that tar does.
9591         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
9592         (ftypelet): Use S_ISCTG.
9593         From Michael Deutschmann.
9594
9595 2000-04-14  Jim Meyering  <meyering@lucent.com>
9596
9597         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
9598
9599 2000-04-08  Jim Meyering  <meyering@lucent.com>
9600
9601         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
9602         names don't conflict.  Reported by Eli Zaretskii.
9603
9604 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
9605
9606         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
9607         bug.  Deal with the different error behavior of Irix iconv.
9608
9609 2000-04-07  Jim Meyering  <meyering@lucent.com>
9610
9611         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
9612         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
9613
9614 2000-04-05  Jim Meyering  <meyering@lucent.com>
9615
9616         Portability tweaks required for ultrix4.3.
9617         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
9618         * readutmp.c: Include sys/types.h before sys/stat.h.
9619         * canon-host.c: Declare strdup.
9620         * path-concat.c: Likewise.
9621         From John David Anglin.
9622
9623 2000-04-04  Jim Meyering  <meyering@lucent.com>
9624
9625         Be more DOS 8.3-friendly.
9626         * ref-add.sin: Renamed from ref-add.sed.in.
9627         * ref-del.sin: Renamed from ref-del.sed.in.
9628         * Makefile.am: Reflect renaming.
9629         Reported by Eli Zaretskii.
9630
9631         Use a temporary file name that won't clash with `charset.alias'
9632         in the DOS 8.3 name space.
9633         * Makefile.am (charset_tmp): Define.
9634         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
9635         (uninstall-local): Likewise.
9636         Reported by Eli Zaretskii.
9637
9638 2000-03-29  Paul Eggert  <eggert@twinsun.com>
9639
9640         * time/strftime.c (my_strftime): Make sure we call the system
9641         strftime, not ourselves, when invoking the underlying strftime.
9642
9643 2000-03-24  Jim Meyering  <meyering@lucent.com>
9644
9645         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
9646         (charset_alias): Define.
9647         (install-exec-local): Factor out common code.
9648         (uninstall-local): Split lines longer than 80.
9649         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
9650         (SUFFIXES): Define.
9651         (.sed.in.sed): New rule.  Don't redirect directly to $@.
9652         (CLEANFILES): Add ref-add.sed and ref-del.sed.
9653
9654 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
9655
9656         * config.charset: Output a line containing "Packages using this file".
9657         * ref-add.sed.in, ref-del.sed.in: New files.
9658         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
9659         ref-del.sed): New rules.
9660
9661 2000-03-17  Jim Meyering  <meyering@lucent.com>
9662
9663         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
9664         Otherwise, include <strings.h>
9665
9666 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
9667
9668         * unicodeio.c (utf8_wctomb): New function.
9669         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
9670         format instead of in UCS-4 with platform dependent endianness.
9671
9672 2000-03-07  Paul Eggert  <eggert@twinsun.com>
9673
9674         * savedir.c (savedir): Work even if directory size is
9675         negative; this can happen with some screwy NFS configurations.
9676
9677 2000-03-06  Jim Meyering  <meyering@lucent.com>
9678
9679         * localcharset.c (get_charset_aliases): Don't try to free file_name
9680         if it's NULL (because we ran out of memory).  From Bruno Haible.
9681
9682 2000-03-05  Jim Meyering  <meyering@lucent.com>
9683
9684         * localcharset.c ("path-concat.h"): Include.
9685         (get_charset_aliases): Use path_concat instead of ANSI string
9686         concatenation.
9687
9688         * unicodeio.h (PARAMS): Define.
9689         Use it to guard prototype.
9690
9691 2000-03-04  Jim Meyering  <meyering@lucent.com>
9692
9693         * Makefile.am (install-exec-local): Create $(libdir) before installing
9694         into it.
9695         (uninstall-local): Uncomment this rule so `make distcheck' works
9696         once again.
9697
9698         * unicodeio.c (<errno.h>): Include it.
9699         (errno): Declare if not defined.
9700
9701         * localcharset.c: Add Bruno's comment justifying use of volatile.
9702
9703         * config.charset: New version, incorporating remarks from a linux
9704         i18n mailing list.  From Bruno Haible.
9705
9706 2000-03-02  Jim Meyering  <meyering@lucent.com>
9707
9708         * Makefile.am (EXTRA_DIST): Add config.charset.
9709
9710 2000-03-01  Jim Meyering  <meyering@lucent.com>
9711
9712         * localcharset.c: Guard some #includes with `#if HAVE_...'.
9713         * unicodeio.c: Likewise.
9714
9715 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
9716
9717         * config.charset: New file.
9718         * localcharset.c: New file.
9719         * unicodeio.h, unicodeio.c: New files.
9720         * Makefile.am (DEFS): Add -DLIBDIR=...
9721         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
9722         (noinst_HEADERS): Add unicodeio.h.
9723         (all-local, install-exec-local, charset.alias): New targets.
9724
9725 2000-02-28  Paul Eggert  <eggert@twinsun.com>
9726
9727         * quotearg.c (ALERT_CHAR): New macro.
9728         (quotearg_buffer_restyled): Use it.
9729
9730 2000-02-27  Jim Meyering  <meyering@lucent.com>
9731
9732         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
9733         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
9734
9735         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
9736         not `#if STDC_HEADERS'.
9737         Declare malloc if needed.
9738
9739         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
9740         now that autoconf always defines the HAVE_DECL_ symbols.
9741         * human.c: Likewise.
9742         * same.c: Likewise.
9743         * strtoumax.c: Likewise.
9744
9745         * backupfile.c: Arrange for cpp to fail if the configure-time
9746         declaration check was not run.
9747         * hash.c: Likewise.
9748         * human.c: Likewise.
9749         * same.c: Likewise.
9750         * strtoumax.c: Likewise.
9751
9752         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
9753         then first look up the entire `.'-containing string as a login name.
9754
9755 2000-02-18  Paul Eggert  <eggert@twinsun.com>
9756
9757         * getdate.y: Handle two-digit years with leading zeros correctly.
9758         (textint): New typedef.
9759         (parser_control): Member year changed from int to textint.
9760         All uses changed.
9761         (YYSTYPE): Removed; replaced by %union with int and textint members.
9762         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
9763         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
9764         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
9765         (tSNUMBER, tUNUMBER): Now of type <textintval>.
9766         (date, number, to_year): Use width of number in digits, not its value,
9767         to determine whether it's a 2-digit year, or a 2-digit time.
9768         (yylex): Store number of digits of numeric tokens.
9769         Reported by John Kendall.
9770
9771         (parser_control): Changed from struct parser_control to typedef (for
9772         consistency).  All uses changed.
9773
9774         (tID): Removed; not used.
9775         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
9776
9777 2000-02-14  Paul Eggert  <eggert@twinsun.com>
9778
9779         * getpagesize.h (getpagesize): Port to VMS for Alpha;
9780         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
9781
9782 2000-02-12  Jim Meyering  <meyering@lucent.com>
9783
9784         * userspec.c (ISDIGIT): Define it.
9785         (isdigit): Remove definition.
9786         (is_number): Use ISDIGIT, not isdigit.
9787         <libintl.h>: Include.
9788         (_ and N_): Define.
9789         (parse_user_spec): Mark translatable strings.
9790
9791 2000-02-10  Jim Meyering  <meyering@lucent.com>
9792
9793         With these changes, nanosleep.[ch] are finally enough like the other
9794         lib/* replacement files to compile on a few more losing systems.
9795
9796         * nanosleep.h: Don't include config.h.
9797         Remove prototype from declaration of nanosleep.
9798         (PARAMS): Remove now-unneeded definition.
9799         * nanosleep.c: #undef nanosleep.
9800         (rpl_nanosleep): Rename from nanosleep.
9801
9802 2000-02-03  Jim Meyering  <meyering@lucent.com>
9803
9804         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
9805         rather than with `#if HAVE_UTMPNAME'.
9806
9807 2000-02-01  Jim Meyering  <meyering@lucent.com>
9808
9809         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
9810
9811 2000-01-31  Jim Meyering  <meyering@lucent.com>
9812
9813         * nanosleep.h (nanosleep): Guard declaration with
9814         `#if ! HAVE_DECL_NANOSLEEP'.
9815         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
9816         the declaration in that vendor's sys/timers.h.
9817         Reported by Christian Krackowizer.
9818
9819         * quotearg.c (ISASCII): Add #undef and move definition to follow
9820         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
9821         (ISPRINT): Likewise.
9822         Reported by Tom Tromey.
9823
9824 2000-01-30  Jim Meyering  <meyering@lucent.com>
9825
9826         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
9827         uses of ->ut_name.  The latter doesn't work with new Linux header files
9828         where only utmpx.ut_user is declared.
9829
9830         * readutmp.h (UT_USER): Define.
9831
9832 2000-01-23  Jim Meyering  <meyering@lucent.com>
9833
9834         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
9835         obstack.c.
9836
9837 2000-01-22  Jim Meyering  <meyering@lucent.com>
9838
9839         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
9840         [! HAVE_DECL_STRTOULL]: Declare strtoull.
9841         Required for some AIX systems.  Reported by Christian Krackowizer.
9842         [TESTING] (main): New function.
9843
9844         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
9845         * dirname.c (dir_name): Support for DOS-style file names with drive
9846         letters.
9847
9848         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
9849
9850         * strverscmp.c (ISDIGIT): Define.
9851         (strverscmp): Use ISDIGIT, not isdigit.
9852
9853 2000-01-17  Paul Eggert  <eggert@twinsun.com>
9854
9855         * nanosleep.c (nanosleep):
9856         Don't use SA_INTERRUPT to decide whether to call sigaction, as
9857         POSIX.1 doesn't require SA_INTERRUPT and some systems
9858         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
9859         it's been part of POSIX.1 since day 1 (in 1988).
9860
9861 2000-01-17  Jim Meyering  <meyering@lucent.com>
9862
9863         * interlock: Remove unused file.  Reported by François Pinard.
9864
9865 2000-01-16  Paul Eggert  <eggert@twinsun.com>
9866
9867         * quotearg.c (quotearg_buffer_restyled): Do not quote
9868         alert, backslash, formfeed, and vertical tab unnecessarily in
9869         shell quoting style.
9870
9871
9872 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
9873 Free Software Foundation, Inc.
9874 Copying and distribution of this file, with or without modification,
9875 are permitted provided the copyright notice and this notice are preserved.