* nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
[gnulib.git] / lib / ChangeLog
1 2006-09-12  Jim Meyering  <jim@meyering.net>
2
3         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
4         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
5         Reported by Nelson H. F. Beebe.
6
7 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
8
9         * argp-help.c (argp_doc): Make sure NULL is not passed to
10         dgettext.
11
12 2006-09-10  Bruno Haible  <bruno@clisp.org>
13
14         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
15
16 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
17
18         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
19         program_invocation_name and program_invocation_short_name are
20         initialized.
21         * argp-namefrob.h: Move declarations of program_invocation_name
22         and program_invocation_short_name to argp.h, so they are visible
23         to user programs.
24         * argp.h: Likewise
25
26 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
27
28         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
29         convention.  Text proposed by Bruno Haible.
30         (struct argp_option): Document the use of N_() wrappers.
31
32         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
33         and translate the two parts separately, instead of feeding
34         the whole string to gettext.  This allows to exclude
35         '\v' from the strings visible to the translator by writing doc
36         strings as N_("..") "\v" N_("..").
37
38 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
39
40         * mktime.c (guess_time_tm): Fix bug where mktime
41         returned the maximum time_t value rather than (time_t) -1.
42         Problem originally reported by William Bardwell
43         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
44
45         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
46         Moved to here ...
47         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
48         ... from here.
49
50 2006-09-06  Bruno Haible  <bruno@clisp.org>
51
52         * striconv.h: New file.
53         * striconv.c: New file, merging iconvme.c with GNU gettext's
54         iconvstring.c.
55         * xstriconv.h: New file.
56         * xstriconv.c: New file.
57
58 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
59
60         * argz_.h: Sync from Libtool.
61
62         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
63                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
64
65         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
66
67 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
68
69         * trim.h: New file.
70         * trim.c: New file.
71
72 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
73
74         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
75         Problem reported by Ralf Wildenhues in
76         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
77
78         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
79         HAVE_STRUCT_STATFS_F_FSTYPENAME.
80
81 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
82
83         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
84         or stdbool.h, because they might not exist while configuring.
85
86         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
87         Don't include unistd.h or limits.h; not needed, since chdir-long.h
88         does that for us.
89         (O_DIRECTORY): Remove.
90
91 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
92
93         Work around a bug in both the Linux and SunOS 64-bit kernels:
94         nanosleep mishandles sleeps for longer than 2**31 seconds.
95         Problem reported by Frank v Waveren in
96         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
97         * nanosleep.c (BILLION): New constant.
98         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
99         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
100
101 2006-08-30  Jim Meyering  <jim@meyering.net>
102
103         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
104         the parameter.
105
106 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
107
108         * isapipe.c, isapipe.h: New files.
109
110 2006-08-29  Eric Blake  <ebb9@byu.net>
111
112         * error.c (error_at_line, print_errno_message): Match libc, after
113         resolution of upstream bug 3044.
114
115 2006-08-29  Bruno Haible  <bruno@clisp.org>
116
117         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
118
119 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
120
121         Sync from Libtool:
122
123         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
124
125         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
126         sharing with gnulib.  Report by Eric Blake.
127
128 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
129
130         * fcntl_.h: New file.
131         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
132         the fcntl module.
133         * dirchownmod.c: Likewise.
134         * fts.c: Likewise.
135
136         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
137         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
138         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
139         just before including <inttypes.h>, to avoid circular inclusion.
140
141 2006-08-28  Bruno Haible  <bruno@clisp.org>
142
143         * inttypes_.h (SCNX*): Remove definitions.
144         Reported by Eric Blake.
145
146 2006-08-26  Bruno Haible  <bruno@clisp.org>
147
148         * vasnprintf.c (EOVERFLOW): Remove definition.
149         (VASNPRINTF): Return a string of length > INT_MAX without failing.
150         * vasprintf.c: Include errno.h, limits.h.
151         (EOVERFLOW): New fallback definition.
152         (vasprintf): Test here whether the string length is > INT_MAX.
153         * vsnprintf.c: Include errno.h, limits.h.
154         (EOVERFLOW): New fallback definition.
155         (vsnprintf): Fix bug when generated string was too long for the buffer.
156         Test here whether the string length is > INT_MAX.
157
158 2006-08-26  Bruno Haible  <bruno@clisp.org>
159             Simon Josefsson  <jas@extundo.com>
160
161         BeOS portability.
162         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
163
164 2006-08-28  Bruno Haible  <bruno@clisp.org>
165
166         * c-strstr.h: New file, from GNU gettext.
167         * c-strstr.c: New file, from GNU gettext.
168
169 2006-08-26  Bruno Haible  <bruno@clisp.org>
170
171         * inttypes_.h: New file.
172         * inttypes.h: Remove file.
173         * stdint_.h: Include <inttypes.h> through its absolute filename.
174
175         * imaxabs.c: New file.
176
177         * imaxdiv.c: New file.
178
179 2006-08-22  Bruno Haible  <bruno@clisp.org>
180
181         * readutmp.h: Skip most definitions if neither <utmp.h> nor
182         <utmpx.h> exists.
183
184 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
185
186         BeOS portability.
187         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
188         Problem reported by Bruno Haible.
189
190 2006-08-21  Bruno Haible  <bruno@clisp.org>
191
192         BeOS portability.
193         * mbchar.h: Include <wctype.h> only if it exists.
194
195 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
196
197         * cycle-check.h: Include <stdint.h> unconditionally, since we
198         now assume the stdint module.  Do not include inttypes.h.
199         * fsusage.h: Likewise.
200         * getndelim2.c: Likewise.
201         * human.h: Likewise.
202         * inttostr.h: Likewise.
203         * obstack.c: Likewise.
204         * regex_internal.h: Likewise.
205         * tempname.c: Likewise.
206         * utimecmp.c: Likewise.
207         * xstrtol.h: Likewise.
208
209         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
210
211         * strtoimax.c: Adjust to macro name changes in Autoconf,
212         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
213         * xtime.h: Likewise.
214
215 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
216
217         * fchmodat.c: New file, from coreutils.  This was inadvertently
218         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
219
220 2006-08-18  Bruno Haible  <bruno@clisp.org>
221
222         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
223         (ME_DUMMY): Treat "kernfs" as a dummy.
224         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
225
226 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
227
228         Update from coreutils.
229
230         * __fpending.h: Add copyright notice.
231         * fprintftime.h: Likewise.
232         * savedir.c: Use (C) in copyright notice.
233         * savedir.h: Likewise.
234
235         2006-08-15  Jim Meyering  <jim@meyering.net>
236
237         * at-func.c: New file, with the logic of all emulated at-functions.
238         * openat-priv.h: Include <errno.h> and define ENOSYS,
239         in support of the EXPECTED_ERRNO macro.
240         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
241         Instead, define the appropriate symbols and include "at-func.c".
242         * mkdirat.c (mkdirat): Likewise.
243         * fchmodat.c (fchmodat): Likewise.
244         (ENOSYS): Remove definition.
245         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
246         Don't include "unistd--.h" -- it wasn't ever used.
247
248         2006-01-17  Jim Meyering  <jim@meyering.net>
249
250         Rewrite fts.c not to change the current working directory,
251         by using openat, fstatat, fdopendir, etc..
252
253         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
254         (HAVE_OPENAT_SUPPORT): Define.
255         [_LIBC] (fchdir): Don't undef or define; no longer used.
256         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
257         Now, this `function' always succeeds, and consumes its file descriptor
258         parameter -- so callers must not close such FDs.  Update callers.
259         (diropen_fd, opendirat, cwd_advance_fd): New functions.
260         (diropen): Add parameter, SP.  Adjust all callers.
261         Implement using diropen_fd, rather than open.
262         (fts_open): Initialize new member, fts_cwd_fd.
263         Remove fts_rft-setting code.
264         (fts_close): Close fts_cwd_fd, if necessary.
265         (__opendir2): Define in terms of opendir or opendirat,
266         depending on whether the FST_NOCHDIR flag is set.
267         (fts_build): Since fts_safe_changedir consumes its FD, and since
268         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
269         and close the dup'd file descriptor upon failure.
270         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
271         (fts_safe_changedir): Tweak semantics to reflect that this function
272         now calls cwd_advance_fd and hence consumes its FD argument.
273         * fts_.h [struct FTS] (fts_cwd_fd): New member.
274         [struct FTS] (fts_rft): Remove now-unused member.
275         [struct FTS] (fts_cycle.state): Improve comment.
276
277         * openat.c (openat_needs_fchdir): New function.
278         * openat.h (openat_needs_fchdir): Declare it.
279
280 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
281
282         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
283         Problem and fix reported by Pádraig Brady in
284         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
285
286 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
287
288         * memcoll.c (memcoll): Optimize for the common case where the
289         arguments are bytewise equal.
290
291 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
292
293         Change copyright notice from LGPL 2 to GPL 2, since that's the
294         standard form used in the gnulib repository.
295         * lock.c: LGPL -> GPL.
296         * lock.h: Likewise.
297         * strnlen1.c: Likewise.
298         * strnlen1.h: Likewise.
299         * tls.c: Likewise.
300         * tls.h: Likewise.
301         * tmpdir.c: Likewise.
302
303         * TODO: Remove; this belongs only in coreutils.
304
305 2006-08-14  Eric Blake  <ebb9@byu.net>
306
307         Import the following change from libc:
308
309         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
310
311         Upstream bug 2997.
312         * misc/error.c: Add space between program name and message if file
313         name is missing.
314
315 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
316
317         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
318         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
319
320         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
321         in wchar_t.  Problem reported by Eric Blake.
322
323         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
324         LEN is smaller than SIZE.  Suggested by Bruno Haible.
325         Also, help the compiler to keep LEN in a register.
326
327 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
328
329         * .cppi-disable: Add snprintf.h, socket_.h.
330         * snprintf.c: Include <errno.h> and <limits.h>.
331         (EOVERFLOW): Define if the system does not.
332         Do not include "minmax.h"; it wasn't used.
333         (snprintf): Don't assume size_t promotes to an unsigned type.
334         Fix bug when generated string was too long for the buffer: the
335         buffer's contents are supposed to be the initial prefix of the
336         output.  Don't assume vasnprintf returns EOVERFLOW if the size
337         exceeds INT_MAX; do the check ourselves.
338
339         Import the following changes from libc:
340
341         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
342
343         * posix/regex_internal.c (re_string_skip_chars): If no character has
344         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
345         to the byte which couldn't be converted.
346         (re_string_reconstruct): Don't clear valid_raw_len before calling
347         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
348         tip_context using re_string_context_at.
349
350         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
351
352         * posix/regex.h: g++ still cannot handled [restrict].
353
354         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
355
356         * posix/regex.h: Remove special handling for VMS.
357
358 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
359
360         Sync from coreutils.
361
362         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
363
364         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
365         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
366
367 2006-08-08  Eric Blake  <ebb9@byu.net>
368
369         * verror.c (verror_at_line): Work around glibc bug 2997, so that
370         verror_at_line output complies with GNU Coding Standards even when
371         file is NULL.
372
373 2006-08-08  Eric Blake  <ebb9@byu.net>
374
375         * verror.h, verror.c: New files.
376
377 2006-08-07  Bruno Haible  <bruno@clisp.org>
378
379         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
380         versions of AIX.
381         Reported by Ralf Wildenhues.
382
383 2006-08-06  Eric Blake  <ebb9@byu.net>
384
385         * error.h: Fold in some upstream changes from glibc.
386         * error.c: Likewise.
387
388 2006-07-29  Bruno Haible  <bruno@clisp.org>
389
390         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
391
392 2006-07-29  Bruno Haible  <bruno@clisp.org>
393
394         * setenv.c: Undo unintended modification done on 2006-02-27.
395
396 2006-07-28  Eric Blake  <ebb9@byu.net>
397
398         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
399         macro expansion.
400
401 2006-07-28  Simon Josefsson  <jas@extundo.com>
402
403         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
404         #include's.
405
406 2006-07-28  Simon Josefsson  <jas@extundo.com>
407
408         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
409         #include's.
410
411 2006-07-28  Bruno Haible <bruno@clisp.org>
412
413         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
414
415 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
416
417         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
418         arpa/inet.h.
419
420 2006-07-28  Bruno Haible  <bruno@clisp.org>
421
422         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
423         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
424         fallbacks.
425         Avoids link error on FreeBSD 4.x.
426         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
427
428         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
429         encoding.
430         * mbswidth.c (iswcntrl): Likewise.
431
432 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
433
434         * modechange.c (mode_compile): Numeric modes now affect setuid and
435         setgid on directories only if they set these bits.
436         * modechange.h: Remove obsolete comment about masks.
437
438 2006-07-27  Bruno Haible  <bruno@clisp.org>
439
440         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
441         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
442         defined.
443
444 2006-07-26  Eric Blake  <ebb9@byu.net>
445
446         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
447         like mingw that lack mkstemp.
448         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
449         avoid compilation warning on mingw.
450
451 2006-07-25  Bruno Haible  <bruno@clisp.org>
452
453         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
454         <stdarg.h> or config.h.
455
456 2006-07-24  Bruno Haible  <bruno@clisp.org>
457
458         * clean-temp.h: New file, from GNU gettext.
459         * clean-temp.c: New file, from GNU gettext.
460
461 2006-07-24  Bruno Haible  <bruno@clisp.org>
462
463         * tmpdir.h: New file, from GNU gettext.
464         * tmpdir.c: New file, from GNU gettext.
465
466 2006-07-23  Bruno Haible  <bruno@clisp.org>
467
468         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
469         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
470         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
471         gl_linked_remove_at): Use it.
472
473 2006-07-23  Eric Blake  <ebb9@byu.net>
474
475         * tmpfile-safer.c: New file.
476         * stdio-safer.h (fopen_safer): Add prototype.
477         * stdio--.h (tmpfile): Make safer.
478
479 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
480
481         * close-stream.c, close-stream.h: New files.
482
483 2006-07-22  Bruno Haible  <bruno@clisp.org>
484
485         Merge from GNU gettext 0.15.
486
487         2005-07-05  Bruno Haible  <bruno@clisp.org>
488
489                 * printf-args.c (printf_fetchargs): Work around broken
490                 definition of wint_t on mingw.
491
492         2005-02-12  Bruno Haible  <bruno@clisp.org>
493
494                 * xallocsa.h: Add extern "C" for C++.
495
496         2006-05-17  Bruno Haible  <bruno@clisp.org>
497
498                 Cygwin portability.
499                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
500
501         2006-04-30  Bruno Haible  <bruno@clisp.org>
502
503                 * progreloc.c: Include <mach-o/dyld.h> if available.
504                 (find_executable): Use _NSGetExecutablePath when possible.
505
506         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
507
508                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
509                 function.
510
511         2005-12-29  Bruno Haible  <bruno@clisp.org>
512
513                 * progreloc.c (set_program_name_and_installdir): Fix
514                 compilation error.
515
516         2005-12-04  Bruno Haible  <bruno@clisp.org>
517
518                 Cygwin portability.
519                 * progreloc.c: Include <windows.h> also on Cygwin.
520                 (find_executable): Add support for Cygwin.
521                 (set_program_name_and_installdir): Handle also platforms with
522                 nonempty EXEEXT.
523
524         2006-07-11  Bruno Haible  <bruno@clisp.org>
525
526                 * javacomp.c: Fix a comment.
527                 Reported by Jim Meyering.
528
529         2006-04-30  Bruno Haible  <bruno@clisp.org>
530
531                 * javacomp.h (compile_java_class): Add source_version,
532                 target_version arguments.
533                 * javacomp.c: Rewritten to choose only a compiler that
534                 respects the specified source_version and target_version.
535
536         2006-06-27  Bruno Haible  <bruno@clisp.org>
537
538                 Assume correct S_ISDIR macro.
539                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
540
541         2006-07-22  Bruno Haible  <bruno@clisp.org>
542
543                 * javaversion.h: New file, from GNU gettext.
544                 * javaversion.c: New file, from GNU gettext.
545                 * javaversion.java: New file, from GNU gettext.
546                 * javaversion.class: New file, from GNU gettext.
547
548         2006-05-17  Bruno Haible  <bruno@clisp.org>
549
550                 Cygwin portability.
551                 * javaexec.c (execute_java_class): Test for jview program
552                 also on Cygwin.
553
554         2006-04-09  Bruno Haible  <bruno@clisp.org>
555
556                 * fatal-signal.c: Don't include string.h.
557                 (at_fatal_signal): Use a copying loop instead of memcpy.
558
559         2005-12-04  Bruno Haible  <bruno@clisp.org>
560
561                 * csharpexec.c: Add support for 'clix' launcher (untested).
562                 (execute_csharp_using_sscli): New function.
563                 (execute_csharp_program): Call it.
564
565         2006-06-21  Bruno Haible  <bruno@clisp.org>
566
567                 Avoid warnings from recent versions of mcs.
568                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
569                 -o, -L, -r any more. Use options documented since mcs-1.0
570                 instead. Similarly for -g.
571
572         2005-07-09  Bruno Haible  <bruno@clisp.org>
573
574                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
575                 add a .dll suffix.
576                 Reported by Mark Junker <mjscod@gmx.de>.
577
578         2006-06-17  Bruno Haible  <bruno@clisp.org>
579
580                 * config.charset: Update for NetBSD 3.0.
581
582         2006-05-17  Bruno Haible  <bruno@clisp.org>
583
584                 Cygwin portability.
585                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
586
587         2006-05-16  Bruno Haible  <bruno@clisp.org>
588
589                 * localcharset.c [CYGWIN]: Include <windows.h>.
590                 (get_charset_aliases): For Cygwin, return the same CPxxx
591                 aliases list as under WIN32.
592                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
593                 the environment variables. Fall back to GetACP().
594
595         2006-04-05  Bruno Haible  <bruno@clisp.org>
596
597                 * config.charset: Update Juan Manuel Guerrero's address.
598
599         2005-02-12  Bruno Haible  <bruno@clisp.org>
600
601                 * allocsa.h: Add extern "C" for C++.
602
603         2005-02-10  Bruno Haible  <bruno@clisp.org>
604
605                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
606                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
607
608         2006-07-22  Bruno Haible  <bruno@clisp.org>
609
610                 * gettext.h: Update to GNU gettext-0.15.
611
612 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
613         and Simon Josefsson <jas@extundo.com>
614
615         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
616
617         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
618
619 2006-07-21  Eric Blake  <ebb9@byu.net>
620
621         * stdlib-safer.h: New file from coreutils, required by
622         stdlib--.h.
623
624 2006-07-19  Derek R. Price  <derek@ximbiot.com>
625
626         * getaddrinfo.h: Don't define unimplemented AI_* flags.
627         Reindent and repaginate.
628
629 2006-07-17  Bruno Haible  <bruno@clisp.org>
630
631         * gl_list.h: New file.
632         * gl_list.c: New file.
633         * gl_array_list.h: New file.
634         * gl_array_list.c: New file.
635         * gl_carray_list.h: New file.
636         * gl_carray_list.c: New file.
637         * gl_linked_list.h: New file.
638         * gl_linked_list.c: New file.
639         * gl_anylinked_list1.h: New file.
640         * gl_anylinked_list2.h: New file.
641         * gl_avltree_list.h: New file.
642         * gl_avltree_list.c: New file.
643         * gl_anyavltree_list1.h: New file.
644         * gl_anyavltree_list2.h: New file.
645         * gl_rbtree_list.h: New file.
646         * gl_rbtree_list.c: New file.
647         * gl_anyrbtree_list1.h: New file.
648         * gl_anyrbtree_list2.h: New file.
649         * gl_anytree_list1.h: New file.
650         * gl_anytree_list2.h: New file.
651         * gl_linkedhash_list.h: New file.
652         * gl_linkedhash_list.c: New file.
653         * gl_anyhash_list1.h: New file.
654         * gl_anyhash_list2.h: New file.
655         * gl_avltreehash_list.h: New file.
656         * gl_avltreehash_list.c: New file.
657         * gl_rbtreehash_list.h: New file.
658         * gl_rbtreehash_list.c: New file.
659         * gl_anytreehash_list1.h: New file.
660         * gl_anytreehash_list2.h: New file.
661
662         * gl_oset.h: New file.
663         * gl_oset.c: New file.
664         * gl_array_oset.h: New file.
665         * gl_array_oset.c: New file.
666         * gl_avltree_oset.h: New file.
667         * gl_avltree_oset.c: New file.
668         * gl_rbtree_oset.h: New file.
669         * gl_rbtree_oset.c: New file.
670         * gl_anytree_oset.h: New file.
671
672 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
673
674         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
675         New files.
676         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
677         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
678         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
679         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
680         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
681         callers changed.  Revamp internals significantly, by not
682         attempting to create directories that are temporarily more
683         permissive than the final results.  Do not attempt to use
684         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
685         This removes some race conditions, fixes some bugs, and simplifies
686         things.  Use new dirchownmod function to do owner and mode changes.
687         * mkdir-p.h: Likewise.
688         * modechange.c (octal_to_mode): New function.
689         (struct mode_change): New member mentioned.
690         (make_node_op_equals): New arg mentioned.  All callers changed.
691         (mode_compile): Keep track of which mode bits the user has explicitly
692         mentioned.
693         (mode_adjust): New arg DIR, so that we implement the X op correctly.
694         New arg PMODE_BITS, to keep track of which mode bits the user
695         mentioned; it treats S_ISUID and S_ISGID speciall.
696         All callers changed.
697         * modechange.h: Likewise.
698
699 2006-07-11  Derek R. Price  <derek@ximbiot.com>
700
701         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
702
703 2006-07-10  Derek R. Price  <derek@ximbiot.com>
704
705         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
706         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
707         macros into the GNU _D_EXACT_NAMLEN.
708         * savedir.c:  Likewise.
709         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
710
711 2006-07-09  Jim Meyering  <jim@meyering.net>
712
713         * argp-pv.c: Remove a doubled word in a comment.
714         * check-version.c (check_version): Likewise.
715         * javacomp.c (compile_java_class): Likewise.
716
717 2006-07-08  Jim Meyering  <jim@meyering.net>
718
719         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
720
721 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
722
723         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
724         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
725         brackets.  Other minor changes to suppress some compiler
726         warnings.
727
728 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
729
730         * getloadavg.c: Use __VMS, not VMS.
731         * getopt.c: Likewise.
732         * getpagesize.h: Likewise.
733         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
734         probably does not work.
735
736 2006-07-06  Derek R. Price  <derek@ximbiot.com>
737         and Paul Eggert  <eggert@cs.ucla.edu>
738
739         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
740         Don't worry about this obsolete case any more.
741         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
742         directories.
743         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
744         worry about this obsolete case any more.
745         * fts.c: Likewise.
746         * getcwd.c: Likewise.
747         * glob.h: Likewise.
748         * savedir.c: Likewise.
749
750 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
751
752         * .cppi-disable: Add wcwidth.
753         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
754         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
755         (ISGRAPH): Remove.  All uses changed to isgraph.
756         (FOLD) [!defined _LIBC]: Remove special case.
757         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
758         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
759         HAVE_ISBLANK.
760         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
761
762 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
763
764         * strtod.c (strtod): cast the argument of tolower to unsigned char.
765
766 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
767
768         * memcasecmp.c: Include <limits.h>.
769         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
770         * strtod.c (strtod): Don't assume isspace works on negative chars.
771         Don't assume isdigit succeeds only on '0' through '9'.
772
773 2006-07-05  Derek R. Price  <derek@ximbiot.com>
774
775         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
776         All uses of is_space replaced by isspace.
777         * exit.h: Don't talk about STDC_HEADERS.
778         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
779         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
780         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
781         replaced by isprint etc.
782         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
783         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
784         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
785         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
786         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
787         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
788
789 2006-07-05  Eric Blake  <ebb9@byu.net>
790
791         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
792         missing from netdb.h.
793         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
794
795 2006-06-27  Bruno Haible  <bruno@clisp.org>
796
797         Assume ANSI C header files and <ctype.h> functions.
798         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
799         (mbsnwidth): Use isprint, iscntrl instead.
800
801 2006-07-03  Jim Meyering  <jim@meyering.net>
802
803         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
804         macro is used before the first cycle_check call.
805
806 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
807
808         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
809         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
810         reported by Mark D. Baushke, one in
811         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
812
813         Merge from coreutils.
814
815         * .cppi-disable: Add stdint_.h.
816         * .cvsignore: Add stdint.h.
817
818         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
819
820         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
821         both double and long double versions.
822         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
823         * xstrtold.c: New file.
824         * xstrtod.h (xstrtold): New decl.
825
826         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
827
828         * filemode.c (setst): Remove.
829         (strmode): Rewrite to avoid setst.  This makes the code shorter,
830         (arguably) clearer, and the generated code is a bit smaller on my
831         Debian GNU/Linux stable x86 host.
832
833         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
834
835         * filemode.c: Include "filemode.h" first, to test the interface.
836         Assume that filemode.h includes sys/types.h and sys/stat.h.
837         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
838         (ftypelet): Reorder to put common cases first, for efficiency.
839         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
840         to do 'M'.
841         (strmode): Renamed from mode_string, and now stores 12 bytes instead
842         of 10, for compatibility with FreeBSD.  All callers changed.
843         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
844         that can't be deduced solely from st_mode.  First arg is now a const
845         pointer.
846         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
847         (strmode): Renamed from mode_string.
848         (filemodestring): New decl.
849         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
850         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
851         (S_ISPORT, S_ISWHT): New macros, if not already defined.
852
853         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
854
855         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
856         fsusage.h now does that.  Include fsusage.h first, to test interface.
857         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
858         at most one method (the old code could have generated decls that
859         didn't conform to C89, not that this was ever exercised).
860         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
861
862         2006-03-19  Jim Meyering  <jim@meyering.net>
863
864         Work even in a chroot where d_ino values for entries in "/"
865         don't match the stat.st_ino values for the same names.
866         * getcwd.c (__getcwd): When no d_ino value matches the target inode
867         number, iterate through all entries again, using lstat instead.
868         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
869         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
870
871         * getcwd.c (__getcwd): Clarify a comment.
872         Use memcpy in place of a call to strcpy.
873
874         2006-03-12  Jim Meyering  <jim@meyering.net>
875
876         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
877         that of the current directory (which we're about to chdir ".." out of),
878         then save the dev-ino of the parent, instead.
879
880         * same-inode.h (SAME_INODE): New file/macro.
881         * chdir-safer.c (SAME_INODE): Remove definition.
882         Include "same-inode.h", instead.
883         * same.c: Likewise.
884         * cycle-check.h: Include "same-inode.h".
885         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
886         * cycle-check.c (SAME_INODE): Remove definition.
887         * root-dev-ino.h: Include "same-inode.h".
888
889         2006-03-11  Eric Blake  <ebb9@byu.net>
890
891         * same.c (same_name): s/base_name/last_component/
892         * backupfile.c (check_extension, numbered_backup): Likewise.
893         * filenamecat.c (file_name_concat): Likewise.
894
895         2006-03-11  Eric Blake  <ebb9@byu.net>,
896                     Paul Eggert  <eggert@cs.ucla.edu>
897
898         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
899         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
900         drive prefix.
901         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
902         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
903         (last_component): New method.
904         * dirname.c (dir_len): Determine when drive letters need a
905         subsequent slash.  Preserve // when it is special.
906         (dir_name): Don't append dot when drive letter is absolute.
907         [TEST_DIRNAME]: Move into a full-blown gnulib test.
908         * basename.c (base_name): New semantics - malloc the result.
909         Preserve // when it is special.  Preserve relative files that look
910         like drive letters.
911         (base_len): Preserve // when it is special.
912         (last_component): New method, similar to old base_name semantics.
913         * stripslash.c (strip_trailing_slashes): Use last_component, not
914         base_name.  Strip redundant slashes from ///.
915
916 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
917
918         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
919         both are 64 bits, since this seems to be the tradition, and this
920         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
921         we ever run into a host that prefers long long to long in this
922         case, we'll need another configure-time test.  Problem reported by
923         Jim Meyering.
924
925 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
926
927         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
928         possible collision with system files.
929         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
930         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
931         WCHAR_MIN and WCHAR_MAX in this case.
932         (<stddef.h>): Do not include; no longer needed.
933         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
934         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
935         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
936         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
937         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
938         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
939         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
940         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
941         !defined(__c99))]: Include in this case too, since it's harmless
942         now.
943         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
944         dangerous to do so.
945         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
946         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
947         (_STDINT_MIN, _STDINT_MAX): New macros.
948         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
949         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
950         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
951         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
952         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
953         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
954         macros, not typedefs; this simplifies things quite a bit.
955         Use long int for all types narrower than int64_t.
956         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
957         Define in terms of long long int or int64_t or long int,
958         not int64_t or int32_t.  This saves some compile-time testing.
959         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
960         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
961         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
962         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
963         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
964         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
965         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
966         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
967         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
968         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
969         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
970         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
971         undef any previous version and define our own version, for
972         simplicity and consistency with the new macros for types.
973         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
974         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
975         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
976         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
977         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
978         @WINT_T_SUFFIX@ to keep things simple here.
979         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
980         Simplify by assuming typical 8/16/32/64 host, since we're
981         already doing that elsewhere anyway.
982         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
983         and assume long long int is 64 bits if available.  This
984         speeds up 'configure'.
985
986 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
987
988         * getaddrinfo.c: fixed typo
989
990 2006-06-29  Eric Blake  <ebb9@byu.net>
991
992         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
993         unused static function.
994
995 2006-06-29  Eric Blake  <ebb9@byu.net>
996
997         * stat_.h: New file.
998
999 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1000
1001         * strftime.c: Assume strftime() exists.
1002
1003 2006-06-28  Bruno Haible  <bruno@clisp.org>
1004
1005         * getaddrinfo.h: Fix POSIX URL.
1006         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1007         (use_win32_p): Make static.
1008         (getaddrinfo): Reject service name if it is empty or does not consist
1009         solely of decimal digits, or if its value is > 65535.
1010         (getnameinfo): Remove useless casts.
1011
1012 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1013
1014         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1015         Autoconf 2.60 says this stuff was obsolete.
1016
1017 2006-05-12  Bruno Haible  <bruno@clisp.org>
1018
1019         * mkdtemp.c [MINGW]: Include <io.h>.
1020         (mkdir): Define using _mkdir.
1021
1022 2006-06-28  Bruno Haible  <bruno@clisp.org>
1023
1024         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1025         declaration for wcwidth.
1026         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1027
1028 2006-06-28  Eric Blake  <ebb9@byu.net>
1029
1030         * xvasprintf.h: Fix comments.
1031
1032 2006-06-28  Eric Blake  <ebb9@byu.net>
1033
1034         * mbchar.h (wcwidth): Include wcwidth.h.
1035         * mbswidth.c (wcwidth): Move from here...
1036         * wcwidth.h: ...to this new file.
1037
1038 2006-06-28  Simon Josefsson  <jas@extundo.com>
1039
1040         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1041         functions there.  It will succeed on Windows XP, but on Windows
1042         2000 and (presumably) earlier, it will fail, and use the internal
1043         re-implementation.
1044         (use_win32_p): New function.
1045         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1046         Support AI_NUMERICSERV to disable getservbyname.
1047         (getnameinfo): New function, only supports
1048         NI_NUMERICHOST|NI_NUMERICSERV for now.
1049
1050         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1051         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1052         getnameinfo.
1053
1054 2006-06-27  Bruno Haible  <bruno@clisp.org>
1055
1056         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1057
1058 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1059
1060         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1061         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1062         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1063
1064 2006-06-26  Bruno Haible  <bruno@clisp.org>
1065
1066         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1067         WCHAR_MAX.
1068         Reported by Mark D. Baushke and Larry Jones.
1069
1070 2006-06-26  Bruno Haible  <bruno@clisp.org>
1071
1072         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1073         in pre-C99 mode.
1074         Suggested by Mark D. Baushke and Larry Jones.
1075
1076 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1077
1078         * stdint_.h: Treat BSD/OS like OpenBSD.
1079
1080 2006-06-23  Bruno Haible  <bruno@clisp.org>
1081
1082         * stdint_.h: Treat IRIX like OpenBSD.
1083
1084 2006-06-23  Bruno Haible  <bruno@clisp.org>
1085
1086         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1087         ISO C 99 Technical Corrigendum 1.
1088
1089 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1090
1091         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1092         Some compiler complained about some of them.  Problem reported by
1093         Larry Jones in
1094         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1095
1096 2006-06-21  Simon Josefsson  <jas@extundo.com>
1097
1098         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1099         variable.
1100
1101         * socket_.h: Don't define WINVER.
1102
1103         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1104         slightly modified to work in gnulib.
1105
1106 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1107
1108         * read-file.c (fread_file): Start with buffer allocation of
1109         0 bytes rather than 1 byte; this simplifies the code.
1110         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1111         code to free buffer and save/restore errno.
1112         (internal_read_file): Remove unused local.
1113
1114 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1115
1116         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1117         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1118         Problem reported by Denis Excoffier in
1119         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1120
1121 2006-06-19  Simon Josefsson  <jas@extundo.com>
1122
1123         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1124
1125 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1126
1127         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1128
1129 2006-06-17  Bruno Haible  <bruno@clisp.org>
1130
1131         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1132
1133 2006-06-17  Bruno Haible  <bruno@clisp.org>
1134
1135         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1136         problem on Solaris 2.5.1.
1137
1138 2006-06-16  Eric Blake  <ebb9@byu.net>
1139
1140         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1141         * unicodeio.c [!defined errno]: Likewise.
1142         * strtol.c [!defined errno]: Likewise.
1143         * strtod.c [!defined errno]: Likewise.
1144
1145 2006-06-15  Bruno Haible  <bruno@clisp.org>
1146
1147         * stdint_.h: Rewritten to be fully auto-configured.
1148         Fixes bug on HP-UX/IA64.
1149
1150 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1151
1152         * getdate.y (__attribute__): Don't define if already defined.
1153         Problem reported by Larry Jones.
1154         * utimens.c (__attribute__): Likewise.
1155
1156 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1157
1158         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1159         reported by Andreas Schwab.
1160
1161 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1162             Bruno Haible  <bruno@clisp.org>
1163
1164         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1165
1166 2006-05-26  Martin Lambers  <marlam@marlam.de>
1167
1168         * getpass.c: Updates the test for the native W32 API, and adds
1169         missing includes, thus fixing compilation warnings.
1170
1171 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1172
1173         * tempname.c (small_open, large_open): New macros.
1174         (__open, __open64) [!_LIBC]: Remove.
1175         (__gen_tempname): Use small_open and large_open instead of __open
1176         and __open64.  This fixes a portability bug on HP-UX 11.11i
1177         reported by Simon Wing-Tang in
1178         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1179
1180 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1181
1182         * exclude.c (exclude_fnmatch): New function.
1183         (excluded_file_name): Call exclude_fnmatch.
1184         * exclude.h (excluded_file_name): New prototype
1185
1186 2006-05-24  Bruno Haible  <bruno@clisp.org>
1187
1188         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1189         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1190         Reported by Thorsten Maerz <torte@netztorte.de> via
1191         Aaron Stone <aaron@serendipity.cx>.
1192
1193 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1194
1195         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1196         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1197         (my_usleep): Don't mishandle maximum value.
1198
1199 2006-05-19  Jim Meyering  <jim@meyering.net>
1200
1201         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1202
1203 2006-05-17  Bruno Haible  <bruno@clisp.org>
1204
1205         Cygwin portability.
1206         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1207
1208 2006-05-17  Bruno Haible  <bruno@clisp.org>
1209
1210         * stdint_.h: Fix recognition of Cygwin.
1211
1212 2006-05-11  Jim Meyering  <jim@meyering.net>
1213
1214         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1215
1216 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1217
1218         * crc.c (crc32_update): Remove unnecessary L suffix.
1219         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1220         unwanted sign propagation, e.g., on hosts with 64-bit int.
1221         There still are some problems with reeelly weird theoretical hosts
1222         (e.g., 33-bit int) but it's not worth worrying about now.
1223         * sha1.c (rol): Likewise.
1224         (K1, K2, K3, K4): Remove unnecessary L suffix.
1225
1226 2006-05-10  Bruno Haible  <bruno@clisp.org>
1227
1228         * des.c: Cast to avoid warnings.
1229
1230 2006-05-10  Simon Josefsson  <jas@extundo.com>
1231
1232         * md4.c: Typo fix, update copyright years.
1233         (K1, K2): Don't use L because it turn computations into 64-bit on
1234         64-bit platforms.
1235
1236 2006-05-09  Bruno Haible  <bruno@clisp.org>
1237
1238         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1239         (EOVERFLOW): Define fallback value.
1240         (xstrcat): New function.
1241         (xvasprintf): Recognize the special case of a string concatenation.
1242
1243 2006-05-01  Bruno Haible  <bruno@clisp.org>
1244
1245         * stdint_.h: Shorter URL.
1246         * inttypes.h: Likewise.
1247
1248 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1249
1250         * verify.h: Document the internals better.  Most of this change
1251         was written by Bruno Haible.
1252
1253 2006-04-29  Bruno Haible  <bruno@clisp.org>
1254
1255         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1256         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1257
1258 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1259
1260         * getdate.y (get_date): When adding relative date, start with the
1261         initial time, not with the result of the first mktime call.
1262
1263 2006-04-23  Bruno Haible  <bruno@clisp.org>
1264
1265         * copy-file.c: Include <unistd.h> unconditionally.
1266         * execute.c: Likewise.
1267         * fatal-signal.c: Likewise.
1268         * findprog.c: Likewise.
1269         * mkdtemp.c: Likewise.
1270         * pipe.h: Likewise.
1271         * pipe.c: Likewise.
1272         * wait-process.h: Likewise.
1273
1274 2006-04-23  Bruno Haible  <bruno@clisp.org>
1275
1276         * fwriteerror.c (fwriteerror): Call fclose also when an error
1277         condition was already detected.
1278         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1279
1280 2006-04-19  Derek Price  <derek@ximbiot.com>
1281             Eric Blake  <ebb9@byu.net>
1282
1283         * inttypes.h: Correct grammar in comment.
1284
1285 2006-04-18  Derek Price  <derek@ximbiot.com>
1286             Paul Eggert  <eggert@cs.ucla.edu>
1287
1288         * inttypes.h: New file.
1289         * strtoimax.c: Assume <inttypes.h>.
1290
1291 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1292
1293         * utimens.c (futimens): glibc futimesat messes up if /proc
1294         isn't mounted.  Problem reported by Kir Kolyshkin.
1295
1296 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1297
1298         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1299         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1300         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1301
1302 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1303
1304         Merge regex changes from libc, removing some of our
1305         POSIX-conformance changes that were rejected and redoing them in a
1306         less-intrusive way.
1307
1308         * regcomp.c (re_compile_internal, init_dfa):
1309         Length arg is now size_t, not Idx.  All uses changed.
1310         (peek_token): Forward decl now says internal_function.
1311         (__re_error_msgid, __re_error_msgid_idx):
1312         Now static rather than extern with attribute_hidden.
1313         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1314         For some reason libc prefers K&R style defns for external functions.
1315         (regerror) [!defined _LIBC]: Likewise.
1316         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1317         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1318         (build_range_exp, build_collating_symbol):
1319         Use K&R-style defn.
1320         (re_compile_fastmap): Use '\0' to memset, not 0.
1321         (utf8_sb_map): Make the calculations more obvious.
1322         (init_dfa, parse_bracket_exp, build_charclass_op):
1323         Call calloc and cast result, as glibc does.
1324         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1325         (build_range_exp, build_collating_symbol):
1326         Now internal functions.
1327
1328         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1329
1330         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1331         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1332         Don't depend on VMS; depend on __VMS instead, for POSIX
1333         namespace cleanness.
1334         (regoff_t): Define to ssize_t, not long int.
1335
1336         Remove the REG_ macros named below.  Instead, make the old names
1337         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1338         __USE_GNU_REGEX.
1339         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1340         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1341         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1342         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1343         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1344         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1345         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1346         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1347         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1348         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1349         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1350         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1351         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1352         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1353         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1354         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1355         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1356         (REG_NREGS):
1357         Remove.  All uses replaced by the old RE_* names.
1358         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1359         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1360         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1361         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1362         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1363         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1364         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1365         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1366         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1367         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1368         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1369         Don't bother having these macros be independent of each others'
1370         values, since they no longer exist in the POSIX name space.
1371
1372         Rename the following member names back to their old names,
1373         unless !__USE_GNU_REGEX.  All uses changed back.
1374         (buffer): Renamed from re_buffer.
1375         (allocated): Renamed from re_allocated.
1376         (used): Renamed from re_used.
1377         (syntax): Renamed from re_syntax.
1378         (fastmap): Renamed from re_fastmap.
1379         (translate): Renamed from re_translate.
1380         (can_be_null): Renamed from re_can_be_null.
1381         (regs_allocated): Renamed from re_regs_allocated.
1382         (fastmap_accurate): Renamed from re_fastmap_accurate.
1383         (no_sub): Renamed from re_no_sub.
1384         (not_bol): Renamed from re_not_bol.
1385         (not_eol): Renamed from re_not_eol.
1386         (newline_anchor): Renamed from re_newline_anchor.
1387         (num_regs): Renamed from rm_num_regs.
1388         (start): Renamed from rm_start.
1389         (end): Renamed from rm_end.
1390
1391         (free_state): Move up a bit.
1392
1393         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1394         #define to be empty.
1395         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1396         when that is what is intended.
1397         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1398         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1399         (MAX): New macro.
1400         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1401         All uses changed back to re_malloc, etc.  It's now the caller's
1402         responsibility to check for overflow; all callers changed.
1403         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1404         (re_x2nrealloc): Remove.
1405         (free_state): Remove decl.
1406
1407         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1408         (re_set_registers, re_exec):
1409         Use K&R-style defn.
1410
1411         2006-01-31  Roland McGrath  <roland@redhat.com>
1412
1413         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1414         Reported by Mike Frysinger <vapier@gentoo.org>.
1415
1416         2006-01-15  Andreas Jaeger  <aj@suse.de>
1417
1418         [BZ #1950]
1419         * regex_internal.c (re_string_reconstruct): Adjust for
1420         build_wcs_upper_buffer change.
1421         (build_wcs_upper_buffer): Change return type.
1422
1423         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1424
1425         * regex_internal.h: Include <stdint.h> if available.
1426
1427         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1428
1429         * regex_internal.h (SIZE_MAX): Provide a default definition.
1430
1431         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1432
1433         * regcomp.c: Adjust for changed secondary hash function.
1434
1435         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1436
1437         * regex.h: Pretty printing.
1438         Clean up namespace a bit.
1439
1440         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1441
1442         * regexec.c (update_cur_sifted_state, check_arrival,
1443         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1444
1445         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1446                     Ulrich Drepper  <drepper@redhat.com>
1447
1448         [BZ #1302]
1449         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1450         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1451
1452         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1453
1454         [BZ #281]
1455         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1456         * regcomp.c: Remove unnecessary uses of
1457         unsigned RE_TRANSLATE_TYPE.
1458         * regex_internal.h: Likewise.
1459         * regex_internal.c: Likewise.
1460         * regexec.c: Likewise.
1461         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1462
1463         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1464
1465         * regexec.c (find_recover_state): Remove unnecessary
1466         initialization.
1467         (transit_state_bkref): Make DFA a const pointer.
1468         (get_subexp): Likewise.
1469         (check_arrival): Likewise.
1470         (update_cur_sifted_state): Likewise.
1471         (re_search_internal): Likewise.
1472         (prune_impossible_nodes): Likewise.
1473         (acquire_init_state_context): Likewise.
1474         (proceed_next_node): Likewise.
1475         (set_regs): Likewise.
1476         (free_fail_stack_return): Likewise.
1477         (check_arrival_expand_ecl): Mark DFA parameter as const.
1478         (check_arrival_expand_ecl_sub): Likewise.
1479         (check_subexp_limits): Likewise.
1480         (sub_epsilon_src_nodes):  Likewise.
1481         (add_epsilon_src_nodes):  Likewise.
1482         (merge_state_array): Likewise.
1483         (update_regs): Likewise.
1484         (build_trtable): Likewise.
1485         (sift_states_backward): Mark MCTX parameter as const.
1486         (build_sifted_states): Likewise.
1487         (update_cur_sifted_state): Likewise.
1488         (sift_states_mkref): Likewise.
1489         (check_arrival_expand_ecl): Mark eclosure as const.
1490         (check_dst_limits_calc_pos_1): Likewise.
1491         * regex_internal.h (re_match_context_t): Make dfa a const
1492         pointer.
1493
1494         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1495
1496         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1497         (transit_state_sb): Likewise.
1498         (transit_state_mb): Likewise.
1499         (sift_states_iter_mb): Likewise.
1500         (check_arrival_add_next_nodes): Likewise.
1501         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1502         [_LIBC] (re_search_2_stub): Use mempcpy.
1503
1504         * regex_internal.c (re_string_reconstruct): Avoid calling
1505         mbrtowc for very simple UTF-8 case.
1506
1507         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1508         a pointer-to-const.
1509         (re_acquire_state_context): Likewise.
1510         * regex_internal.h: Adjust prototypes.
1511
1512         * regex.c: Prevent using C++ compilers.
1513
1514         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1515         (re_acquire_state_context): Likewise.
1516
1517 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1518             Bruno Haible  <bruno@clisp.org>
1519
1520         * stdint_.h: On OpenBSD, don't redefine types already included in
1521         <sys/types.h> and <inttypes.h>.
1522
1523 2006-03-24  Eric Blake  <ebb9@byu.net>
1524
1525         * time_r.c (copy_string_result): Remove, as it is no longer used.
1526
1527 2006-03-24  Simon Josefsson  <jas@extundo.com>
1528
1529         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1530         including some doc fixes.
1531         (base64_encode_alloc): Fix +1 bug on allocation failures.
1532
1533 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1534
1535         * base64.c (base64_encode): Do not read past end of array with
1536         unsanitized input on systems with CHAR_BIT > 8.
1537
1538 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1539
1540         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1541         Typedef to long int, not to off_, as POSIX will likely change
1542         in that direction.
1543
1544 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1545
1546         * argp-help.c (validate_uparams): Fix typo
1547         * argp-parse.c (argp_default_options): Consistently begin help
1548         messages with a lowercase letter.
1549
1550 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1551
1552         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1553         overrun buffers and shouldn't be used (much as gets shouldn't be
1554         used).
1555         * time_r.c (asctime_r, ctime_r): Likewise.
1556
1557 2006-03-08  Simon Josefsson  <jas@extundo.com>
1558
1559         * gc-gnulib.c (randomize): Don't open files called 'no', they
1560         signal that configure disabled the device.
1561
1562 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1563
1564         * c-stack.c: Include unistd.h unconditionally, since we now assume
1565         the unistd module.
1566         * getlogin_r.c: Likewise.
1567         * getlogin_r.h: Likewise.
1568         * glob.c: Likewise.
1569         * pagealign_alloc.c: Likewise.
1570         * unistd_.h: Remove; no longer needed.
1571
1572 2006-03-07  Simon Josefsson  <jas@extundo.com>
1573
1574         * unistd_.h: New file.
1575
1576 2006-03-07  Simon Josefsson  <jas@extundo.com>
1577
1578         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1579
1580 2006-03-01  Simon Josefsson  <jas@extundo.com>
1581
1582         * readline.c: Fix typo, tiny patch from Stepan Kasal
1583         <kasal@ucw.cz>.
1584
1585 2006-02-28  Simon Josefsson  <jas@extundo.com>
1586
1587         * getopt.c: Protect #include of unistd.h, for MSVS.
1588
1589 2006-02-27  Simon Josefsson  <jas@extundo.com>
1590
1591         * base64.h: Indent #define's.  From Jim Meyering
1592         <jim@meyering.net>.
1593
1594 2006-02-27  Jim Meyering  <jim@meyering.net>
1595
1596         Revert the change of 2006-02-24, so these files can continue
1597         to be sync'd from gettext.
1598         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1599         of `config.h'.
1600
1601 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1602
1603         * glob.c: Say "invalid" rather than "illegal" in comments.
1604
1605 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1606
1607         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1608
1609 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1610
1611         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1612         AT_FDCWD exceeds INT_MAX.
1613         * openat.h (AT_FDCWD): Likewise.
1614
1615 2006-02-14  Jim Meyering  <jim@meyering.net>
1616
1617         Sync from coreutils.
1618
1619         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1620         failure on deficient systems, and simplify gnulib lgpl dependencies.
1621         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1622         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1623
1624         * xalloc-die.c: Remove unused definition of N_.
1625
1626 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1627
1628         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1629
1630 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1631
1632         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1633         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1634
1635 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1636
1637         * argp-namefrob.h: Restore changes accidentally lost during the
1638         "autoupdate" on 2005-12-12.
1639
1640 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1641
1642         * fnmatch.c (L_): Renamed from L, to work around a bug in
1643         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1644         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1645         All uses changed.
1646
1647 2006-01-26  Simon Josefsson  <jas@extundo.com>
1648
1649         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1650         prototype is visible on mingw32.
1651
1652         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1653         for mingw32.
1654
1655         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1656         mingw32).
1657
1658 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1659
1660         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1661         attempt to open for write; this always fails, at least on POSIX
1662         hosts.  This reinstates the 2006-01-09 change, which was
1663         inadvertently removed.
1664
1665 2006-01-26  Bruno Haible  <bruno@clisp.org>
1666             Paul Eggert  <eggert@cs.ucla.edu>
1667
1668         * stdbool_.h (_Bool)
1669         [(! (defined __cplusplus || defined __BEOS__)
1670           && !defined __GNUC__
1671           && !(defined __HP_cc || defined __xlc__
1672                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1673                || defined __sgi))]:
1674         #define to signed char in these cases too; this simplifies
1675         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1676         etc., separately) and makes it more conservative.
1677
1678 2006-01-21  Jim Meyering  <jim@meyering.net>
1679
1680         Sync from the stable (b5) branch of coreutils:
1681
1682         * fts.c (fts_children): Don't let close() clobber errno from
1683         failed fchdir().
1684
1685         * fts.c (fts_stat): When following a symlink-to-directory,
1686         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1687         a dangling symlink.  That can also happen at least for ELOOP.
1688         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1689         FYI, this bug predates the inclusion of fts.c in coreutils.
1690
1691         * fts.c (fts_open): Put new maxarglen declaration and uses
1692         in their own block, so pre-c99 compilers don't object.
1693
1694         Avoid the double-free (first in fts_read, second in fts_close) that
1695         would occur when an `active' directory is made inaccessible (e.g.,
1696         via chmod a-x) during a traversal.
1697         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1698         before returning.  Reproduce this failure by
1699         mkdir -p a/b; cd a; chmod a-x . b
1700         Reported by Stavros Passas.
1701
1702 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1703
1704         * argp-namefrob.h: Bugfix. Remove stray #
1705
1706 2006-01-25  Bruno Haible  <bruno@clisp.org>
1707
1708         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1709         warnings.
1710         Reported by Paul Eggert.
1711
1712 2006-01-25  Jim Meyering  <jim@meyering.net>
1713
1714         * fileblocks.c: Remove more useless parentheses.
1715         * readutmp.h: Likewise.
1716
1717 2006-01-24  Bruno Haible  <bruno@clisp.org>
1718
1719         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1720         has it.
1721         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1722         2005-11-26.
1723
1724         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1725         to avoid problems with the built-in _Bool type.
1726         Reported by Paul Eggert on 2005-11-26.
1727
1728 2006-01-24  Jim Meyering  <jim@meyering.net>
1729
1730         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1731
1732 2006-01-24  Simon Josefsson  <jas@extundo.com>
1733
1734         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1735         Bruno.
1736
1737 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1738
1739         Work around porting bugs reported by Dieter in
1740         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1741         * getopt.c (_NOPROTO): Remove; no longer needed.
1742         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1743         Include "getopt.h" first, to check interface.
1744         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1745         !HAVE_DECL_GETENV.
1746         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1747         (__strndup): Revert to K&R-style function dfns, the glibc style.
1748         * strnlen.c: Don't claim it's taken from glibc; it's not.
1749         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1750         Include strnlen.h first, to get prototype properly.
1751         (strnlen): Renamed from __strnlen.
1752         Remove weak alias.
1753
1754 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1755
1756         These changes imported from libc.
1757         * getopt.c: Use __fxprintf instead of inline stream orientation
1758         test and two separate function calls.
1759         * strndup.c (__strndup): Add libc_hidden_def.
1760
1761 2006-01-22  Bruno Haible  <bruno@clisp.org>
1762
1763         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1764         temporary buffer for sprintf, take into account the precision also
1765         for 'd', 'i', 'u', 'o', 'x', 'X'.
1766
1767 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1768
1769         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1770         to pacify gcc -Wswitch-default.
1771
1772 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1773
1774         * argp-help.c (usage_long_opt): Do not print DOC options.
1775         (__argp_base_name): Removed
1776         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1777         typo.
1778         (__argp_base_name): Provide macro definition or extern declaration
1779         depending on the configuration
1780
1781 2006-01-20  Simon Josefsson  <jas@extundo.com>
1782
1783         * inet_ntop.h: Unconditionally include sys/socket.h.
1784
1785 2006-01-19  Simon Josefsson  <jas@extundo.com>
1786
1787         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1788
1789 2006-01-12  Simon Josefsson  <jas@extundo.com>
1790
1791         * base64.c: Fix warning, reported by Bruno Haible
1792         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1793
1794 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1795
1796         Sync from coreutils.
1797         * md5.c: Fix commentary typos.
1798         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1799         * md5.h (__attribute__): Remove; unused.
1800         * sha1.c: Fix commentary to match md5 better.
1801         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1802         so that we don't need to worry about alignment.  All uses changed.
1803         This merges the 2005-10-28 md5 change into sha1.
1804
1805 2006-01-11  Jim Meyering  <jim@meyering.net>
1806
1807         Sync from coreutils.
1808         * md5.c (OP): Fix spacing.
1809
1810 2006-01-11  Simon Josefsson  <jas@extundo.com>
1811
1812         * stdint_.h (SIZE_MAX): Add missing (.
1813
1814 2006-01-10  Bruno Haible  <bruno@clisp.org>
1815
1816         * argp.h (__const): Remove macro. Use const instead.
1817         * argp-fmtstream.h (__const): Likewise.
1818         * glob_.h (__const): Remove macro.
1819         * glob-libc.h: Use const instead of __const.
1820
1821 2006-01-10  Jim Meyering  <jim@meyering.net>
1822
1823         Avoid the double-free (first in fts_read, second in fts_close) that
1824         would occur when an `active' directory is made inaccessible (e.g.,
1825         via chmod a-x) during a traversal.
1826         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1827         before returning.  Reproduce this failure by
1828         mkdir -p a/b; cd a; chmod a-x . b
1829         Reported by Stavros Passas.
1830
1831         Sync from coreutils.
1832         * sha1.c: Tweak grammar in a comment.
1833
1834 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1835
1836         * regex_internal.h (BITSET_WORD_BITS):
1837         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1838         preprocessor mishandles large unsigned values as if they were signed.
1839         Problem reported by Claudio Fontana in
1840         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1841
1842 2006-01-10  Simon Josefsson  <jas@extundo.com>
1843
1844         * socket_.h: New file.
1845
1846 2006-01-10  Bruno Haible  <bruno@clisp.org>
1847
1848         * localcharset.c: Update from GNU gettext.
1849
1850 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1851
1852         Sync from coreutils.
1853         * chdir-long.c (cdb_free): Don't bother trying to open directory
1854         for write access: POSIX says that must fail.
1855         * fts.c (diropen): Likewise.
1856         * save-cwd.c (save_cwd): Likewise.
1857         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1858         well, for minor improvements on hosts that lack O_DIRECTORY.
1859         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1860         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1861         Fall back on chown if open failed with EACCES.
1862
1863         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1864         Report an error at compile-time if only a 1-second nominal clock
1865         resolution is found.
1866
1867         * lchmod.h: New file.
1868         * mkdir-p.c: Include lchmod.h, lchown.h.
1869         (make_dir_parents): Use lchown rather than chown, and
1870         lchmod rather than chmod.
1871
1872         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1873         too.  Problem with "none" reported by Bob Proulx.  Problem with
1874         "proc" reported by n0dalus.
1875
1876         * mountlist.c: Include <limits.h>.
1877         (dev_from_mount_options)
1878         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1879         New function.  It no longer assumes "dev=" has the System V meaning
1880         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1881         (read_file_system_list)
1882         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1883         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1884         dev= in that case.
1885
1886         * posixtm.h (PDS_PRE_2000): New macro.
1887         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1888         All usages changed.  Reject dates outside the range 1969-1999 if
1889         PDS_PRE_2000 is used.
1890
1891 2006-01-09  Jim Meyering  <jim@meyering.net>
1892
1893         Sync from coreutils.
1894
1895         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1896
1897         * chdir-safer.h, chdir-safer.c: New files.
1898
1899         * modechange.c (mode_compile): Reject an invalid mode string
1900         that starts with an octal digit.  From Andreas Gruenbacher.
1901
1902         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1903         and dup to open_safer and dup_safer, respectively.
1904         (openat_permissive): Fix typo in comment.
1905
1906         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1907         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1908         (_): Remove; no longer needed.
1909         (openat): Renamed from rpl_openat; no need for rpl_openat
1910         since openat.h renames openat for us.
1911         Replace most of the body with a call to openat_permissive,
1912         to avoid duplicate code.
1913         Port to (probably hypothetical) environments were mode_t is
1914         wider than int.
1915         (openat_permissive): Require mode arg, so that we can check
1916         types better.  Put it just after flags.  Change cwd failure
1917         indicator from pointer-to-bool to pointer-to-errno-value.
1918         All callers changed.
1919         Invoke openat_save_fail and/or openat_restore_fail if
1920         cwd_errno is null, so that openat can call us.
1921         (openat_permissive, fdopendir, fstatat, unlinkat):
1922         Simplify errno handling to avoid some duplicate code,
1923         as it's OK to set errno on success.
1924         * openat.h: Revamp code so that function macros depend on
1925         __OPENAT_PREFIX only, not also on AT_FDCWD.
1926         (openat_ro): Remove.  Caller changed to use openat_permissive.
1927         (openat_permissive): Now a macro, if not a function.
1928         (openat_restore_fail, openat_save_fail): Now always functions,
1929         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1930
1931         * openat-priv.h: New file, defining macros used by mkdirat.c
1932         and openat.c.
1933         * mkdirat.c: Include openat-priv.h.
1934         Remove definitions of macros defined therein.
1935         * openat.c: Likewise.
1936
1937         * mkdirat.c (mkdirat): New file and function.
1938         * openat.h (mkdirat): Declare.
1939
1940         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1941
1942         * openat.h (openat_permissive): Declare.
1943         (openat_ro): Define.
1944
1945         * openat.c (EXPECTED_ERRNO): New macro.
1946         (openat_permissive): New function -- used in remove.c rewrite.
1947         (all functions): Set errno just before returning, only if there
1948         was an actual failure.
1949         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1950
1951         Emulate openat-family functions using Linux's procfs, if possible.
1952         Idea and some code based on Ulrich Drepper's glibc changes.
1953
1954         * openat.c: (BUILD_PROC_NAME): New macro.
1955         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1956         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1957         before falling back on save_cwd and restore_cwd.
1958         (fdopendir, fstatat, unlinkat): Likewise.
1959
1960         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1961         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1962
1963         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1964         as second argument to va_arg.  Otherwise, some versions of gcc
1965         warn that `if this code is reached, the program will abort'.
1966
1967 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1968
1969         Sync from coreutils.
1970
1971         Add POSIX ACL support
1972         * acl.h (copy_acl, set_acl): Add declarations.
1973         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1974         systems other than Linux.
1975         (chmod_or_fchmod): New function: use fchmod when possible,
1976         and chmod otherwise.
1977         (file_has_acl): Add a POSIX ACL implementation, with a
1978         Linux-specific subcase.
1979         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1980         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1981         acls are unsupported.
1982         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1983         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1984         are unsupported.
1985
1986 2006-01-09  Bruno Haible  <bruno@clisp.org>
1987
1988         * sysexit_.h (EX_OK): New macro.
1989         Suggested by Martin Lambers <marlam@marlam.de>.
1990
1991 2006-01-09  Bruno Haible  <bruno@clisp.org>
1992
1993         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1994         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1995         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1996         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1997
1998 2006-01-09  Bruno Haible  <bruno@clisp.org>
1999
2000         * stdint_.h (SIZE_MAX): Write the value without involving negative
2001         numbers.
2002
2003 2005-10-16  Bruno Haible  <bruno@clisp.org>
2004
2005         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2006         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2007
2008 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2009
2010         * strftime.c (tzname): Don't declare if it is already #defined.
2011         Problem reported for Mingw by Mark Junker.
2012
2013 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2014
2015         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2016         long int, not int, for nanosecond counts, so that people who are
2017         used to POSIX struct timespec won't be surprised.  Reported by Jim
2018         Meyering.
2019
2020 2005-12-16  Jim Meyering  <jim@meyering.net>
2021
2022         * fprintftime.c, fprintftime.h: New files.
2023
2024 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2025
2026         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2027         * argp-help.c (fill_in_uparams): Check if the constructed
2028         struct uparams is valid. Fall back to the default values if it is
2029         not.
2030
2031 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2032
2033         * argp-help.c (__argp_base_name): New function
2034         (__argp_short_program_name): Rewrite using __argp_base_name
2035         * argp-namefrob.h: Define program_invocation_name and
2036         program_invocation_short_name if requested
2037         (__argp_base_name): Add prototype
2038         * argp-parse.c (argp_def): Use gettext wrappers
2039         (argp_default_parser): Use __argp_base_name
2040         * argp-pin.c: New file. Defines program_invocation_name and
2041         program_invocation_short_name on systems that lack them.
2042
2043 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2044
2045         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2046         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2047         porting problem reported by Georg Schwarz in
2048         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2049
2050 2005-07-09  Bruno Haible  <bruno@clisp.org>
2051
2052         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2053         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2054         Reported by Mark Junker <mjscod@gmx.de>.
2055
2056 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2057
2058         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2059         (uintmax_t) [defined uintmax_t]: Do not declare.
2060         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2061         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2062         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2063         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2064         sake of portability to weird hosts that C allows (though we don't
2065         know of any practical examples).
2066
2067         * savedir.h (fdsavedir): New decl.
2068         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2069         contains most of the former guts of savedir.
2070         (savedir): Use savedirstream.
2071         Include "openat.h".
2072
2073 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2074
2075         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2076         coreutils no longer futzes with rounding modes.
2077
2078 2005-11-14  Jim Meyering  <jim@meyering.net>
2079
2080         * mkstemp-safer.c: Include <config.h>, required for possible
2081         replacement of mkstemp.
2082
2083 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2084
2085         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2086         business.
2087         (gethrxtime) [! (HAVE_NANOUPTIME
2088         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2089         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2090         our own approximation.
2091
2092 2005-11-10  Simon Josefsson  <jas@extundo.com>
2093
2094         * readline.c: Remove EOL.
2095
2096 2005-11-08  Eric Blake  <ebb9@byu.net>
2097
2098         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2099
2100 2005-11-08  Eric Blake  <ebb9@byu.net>
2101
2102         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2103
2104 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2105
2106         Fix porting problem reported by Theodoros V. Kalamatianos.
2107         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2108         Don't assume that futimes failing means we must fail.
2109
2110 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2111
2112         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2113         leave errno alone.  Problem reported by Dmitry V. Levin.
2114
2115 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2116
2117         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2118         errno alone.  Problem reported by Frederic Jolliton.
2119
2120 2005-10-28  Simon Josefsson  <jas@extundo.com>
2121
2122         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2123         "restrict" keywords, as per POSIX.  Protect the function
2124         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2125         Don't use K&R prototypes.  Check the sprintf return values.
2126         Re-define EAFNOSUPPORT if not present.  Indent.
2127
2128         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2129         suggested by Bruno Haible <bruno@clisp.org>.
2130
2131         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2132
2133         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2134
2135         * gc-libgcrypt.c: Add MD2 (which is not available through
2136         libgcrypt).
2137
2138         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2139
2140         * md2.h, md2.c: New files.
2141
2142 2005-10-24  Simon Josefsson  <jas@extundo.com>
2143
2144         * md4.h: Shrink buffer size, now that we changed the type.
2145
2146 2005-10-22  Simon Josefsson  <jas@extundo.com>
2147
2148         * arcfour.h, arcfour.c: Use fixed size indices in the
2149         arcfour_context struct (simplify test vector testing in GNU
2150         Shishi).
2151
2152 2005-10-22  Simon Josefsson  <jas@extundo.com>
2153
2154         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2155         suggested by Bruno Haible <bruno@clisp.org>.
2156
2157 2005-10-22  Simon Josefsson  <jas@extundo.com>
2158
2159         * crc.h: Include stddef.h, for size_t.
2160
2161 2005-10-21  Simon Josefsson  <jas@extundo.com>
2162
2163         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2164         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2165
2166 2005-10-21  Simon Josefsson  <jas@extundo.com>
2167
2168         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2169         block.
2170
2171 2005-10-21  Simon Josefsson  <jas@extundo.com>
2172
2173         * gc-gnulib.c: Support ARCTWO in CBC mode.
2174
2175 2005-10-21  Simon Josefsson  <jas@extundo.com>
2176
2177         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2178         <bruno@clisp.org>.
2179
2180         * hmac-sha1.c (hmac_sha1): Likewise.
2181
2182         * crc.c (crc32_update): Actually use crc parameter, suggested by
2183         Bruno Haible <bruno@clisp.org>.
2184
2185         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2186         <bruno@clisp.org>.
2187
2188 2005-10-21  Simon Josefsson  <jas@extundo.com>
2189
2190         * des.h, des.c: New files.
2191
2192         * gc-gnulib.c: Support DES.c
2193
2194 2005-10-21  Simon Josefsson  <jas@extundo.com>
2195
2196         * arctwo.h, arctwo.c: New files.
2197
2198         * gc-gnulib.c: Support ARCTWO.
2199
2200 2005-10-21  Simon Josefsson  <jas@extundo.com>
2201
2202         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2203
2204 2005-10-19  Simon Josefsson  <jas@extundo.com>
2205
2206         * gc-gnulib.c: Support ARCFOUR.
2207
2208 2005-10-19  Simon Josefsson  <jas@extundo.com>
2209
2210         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2211         support.
2212
2213         * gc.h: Add ECB enum type.
2214
2215         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2216
2217 2005-10-19  Simon Josefsson  <jas@extundo.com>
2218
2219         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2220
2221 2005-10-18  Simon Josefsson  <jas@extundo.com>
2222
2223         * md4.h, md4.c: New files, based on md5.?.
2224
2225 2005-10-17  Simon Josefsson  <jas@extundo.com>
2226
2227         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2228
2229         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2230
2231 2005-10-17  Simon Josefsson  <jas@extundo.com>
2232
2233         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2234
2235 2005-10-17  Simon Josefsson  <jas@extundo.com>
2236
2237         * gc.h, gc-libgcrypt.c: Add ciphers.
2238
2239 2005-10-17  Simon Josefsson  <jas@extundo.com>
2240
2241         * sha1.c: Use uint32_t instead of md5_uint32.t
2242
2243         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2244         md5.h.
2245
2246         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2247
2248         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2249
2250 2005-10-15  Simon Josefsson  <jas@extundo.com>
2251
2252         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2253
2254         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2255
2256 2005-10-14  Simon Josefsson  <jas@extundo.com>
2257
2258         * arcfour.h, arcfour.c: New files.
2259
2260 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2261
2262         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2263         include <wchar.h>; no longer needed.
2264
2265 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2266         and  Ulrich Drepper  <drepper@redhat.com>
2267
2268         Import from libc.
2269         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2270         instead of inline stream orientation test and two separate
2271         function calls.  Pay no attention to USE_IN_LIBIO.
2272
2273 2005-10-14  Roland McGrath  <roland@redhat.com>
2274
2275         Import from libc.  [BZ #1331]
2276         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2277         macro argument.
2278         Reported by Matej Vela <vela@debian.org>.
2279
2280 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2281
2282         * mkdir-p.c (make_dir_parents): Don't report an error if an
2283         intermediate directory is in a read-only file system.  Problem
2284         reported by Eric Blake.
2285
2286 2005-10-13  Simon Josefsson  <jas@extundo.com>
2287
2288         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2289         Move memory allocation outside of loop.
2290
2291 2005-10-12  Simon Josefsson  <jas@extundo.com>
2292
2293         * gc-pbkdf2-sha1.c: New file.
2294
2295         * gc.h: Add gc_pbkdf2_sha1 prototype.
2296
2297 2005-10-12  Simon Josefsson  <jas@extundo.com>
2298
2299         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2300         suggested by Bruno Haible <bruno@clisp.org>.
2301
2302 2005-10-12  Simon Josefsson  <jas@extundo.com>
2303
2304         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2305
2306         * gc-gnulib.c (gc_hmac_sha1): New function.
2307
2308 2005-10-12  Simon Josefsson  <jas@extundo.com>
2309
2310         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2311
2312 2005-10-12  Simon Josefsson  <jas@extundo.com>
2313
2314         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2315         GC_USE_HMAC_MD5, respectively.
2316
2317         * gc-libgcrypt.c (gc_md5): Fix assert call.
2318         (gc_md5): Fix typo.
2319
2320         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2321
2322         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2323
2324         * gc-gnulib.c (gc_hash_buffer): Ditto.
2325
2326 2005-10-11  Bruno Haible  <bruno@clisp.org>
2327
2328         * c-strcasestr.h: New file, from GNU gettext.
2329         * c-strcasestr.c: New file, from GNU gettext.
2330
2331 2005-10-11  Bruno Haible  <bruno@clisp.org>
2332
2333         * c-strcase.h: New file, from GNU gettext.
2334         * c-strcasecmp.c: New file, from GNU gettext.
2335         * c-strncasecmp.c: New file, from GNU gettext.
2336
2337 2005-10-11  Simon Josefsson  <jas@extundo.com>
2338
2339         * crc.h, crc.c: New files.
2340
2341         * gc.h (gc_hash_buffer): Add doc.
2342
2343 2005-10-08  Simon Josefsson  <jas@extundo.com>
2344
2345         * gc.h: Add gc_hash and gc_hash_buffer.
2346
2347         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2348
2349         * gc-libgcrypt.c (gc_hash_buffer): Add.
2350
2351 2005-10-11  Bruno Haible  <bruno@clisp.org>
2352
2353         * strcasecmp.c: Include limits.h.
2354         (strcasecmp): Avoid integer overflow on exotic platforms.
2355         * strncasecmp.c: Include limits.h.
2356         (strncasecmp): Avoid integer overflow on exotic platforms.
2357         Reported by Paul Eggert.
2358
2359 2005-10-06  Simon Josefsson  <jas@extundo.com>
2360
2361         * hmac-md5.c: New file.
2362
2363         * hmac.h: New file.
2364
2365 2005-10-06  Simon Josefsson  <jas@extundo.com>
2366
2367         * memxor.c (memxor): Avoid casts and warnings.
2368
2369 2005-10-05  Derek Price  <derek@ximbiot.com>
2370
2371         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2372
2373 2005-10-05  Simon Josefsson  <jas@extundo.com>
2374
2375         * memxor.c (memxor): Fix compiler error.
2376
2377         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2378         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2379
2380         * memxor.h, memxor.c: New files.
2381
2382         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2383         we assume all systems have it, suggested by Jim Meyering
2384         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2385         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2386         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2387         same reasons.
2388
2389 2005-10-04  Bruno Haible  <bruno@clisp.org>
2390
2391         * verify.h (verify_true): Provide alternative definition for C++.
2392
2393 2005-10-04  Simon Josefsson  <jas@extundo.com>
2394
2395         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2396         D. Baushke" <mdb@gnu.org>.
2397
2398 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2399
2400         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2401         (SSIZE_MAX): New macro, if not already defined.
2402         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2403         than 2 GiB.
2404
2405 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2406
2407         * exclude.c: Include verify.h.
2408         (verify): Remove.  All callers changed to use verify.h's version.
2409         * strtoimax.c: Likewise.
2410         * utimecmp.c: Likewis.e
2411
2412         Sync from coreutils.
2413         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2414         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2415         * .cvsignore: Add fts.h, search.h, t-fpending.
2416         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2417         bother returning ENOSYS if settimeofday or stime fails; just let
2418         them return whatever errno they want to return.
2419         * utimens.c: Include unistd.h, for dup2.
2420         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2421         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2422
2423 2005-10-02  Jim Meyering  <jim@meyering.net>
2424
2425         Sync from coreutils.
2426         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2427         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2428         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2429         Remove AT_FDCWD test.
2430         Do not consume the fd unless successful.
2431         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2432         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2433         block, so that we don't even try to compile it if settimeofday is
2434         available.  This works around a compilation failure on OSF1 V5.1,
2435         due to stime requiring a `long int*' while tv_sec is `int'.
2436
2437 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2438
2439         * getdelim.c (getdelim): Remove unused variables.
2440
2441 2005-10-01  Simon Josefsson  <jas@extundo.com>
2442
2443         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2444         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2445         AI_* and EAI_* definitions.  Protect function declarations.
2446
2447 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2448
2449         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2450         so that the code works even with ancient cpp.  Portability problem
2451         with GCC 2.7.2.1 reported by Thomas M.Ott.
2452
2453 2005-09-27  Jim Meyering  <jim@meyering.net>
2454
2455         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2456
2457         * intprops.h (signed_type_or_expr__): Define.
2458         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2459         for unsigned types.
2460
2461 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2462
2463         * verify.h (verify_expr): Remove, replacing with:
2464         (verify_true): New macro that returns true instead of void.
2465         (verify_type__): Remove.
2466         (verify): Use verify_true rather than verify_type__.
2467
2468 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2469
2470         * utimens.c (ENOSYS): Define if not already defined.
2471         (futimens): Support having a null PATH if the file descriptor
2472         is nonnegative.
2473
2474         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2475         Remove.
2476         (__attribute): Define to empty unless GCC 3.1 or later.
2477         This works around a core dump on OpenBSD 3.4, which has GCC
2478         2.95.3, which dumps core when given __attribute__(()).  It also
2479         simplifies other tests, since we really don't want to bother with
2480         worrying about which ancient version of GCC supported what.
2481         Original problem reported by Yoann Vandoorselaere, with part of
2482         the fix suggested by Derek Price.
2483
2484 2005-09-24  Jim Meyering  <jim@meyering.net>
2485
2486         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2487         so we can once again use a positive bitfield width of 1 -- now we
2488         don't have to explain why we were using a bitfield width of 2.
2489
2490 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2491
2492         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2493         Problem reported by Eric Blake.
2494         (getaddrinfo): Initialize se so that it's not garbage.
2495         Redo internal storage allocation so that it doesn't make unportable
2496         assumptions about alignment.
2497         Fix a memory leak.
2498
2499         * utimens.c (futimens): Use futimesat if available.
2500         Prefer it to futimes since it doesn't have the futimes bug.
2501
2502         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2503         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2504         Instead, declare a function that returns a pointer to an array,
2505         and use verify_type__ to declare the size of the array.
2506         Problem and germ of a solution reported by Bruno Haible.
2507         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2508         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2509
2510 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2511
2512         Sync from coreutils.
2513
2514         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2515         stat-time.h.
2516         * argmatch.h: Include verify.h
2517         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2518         (ARGMATCH_ASSERT): Remove; unused.
2519         * canonicalize.c: Assume STDC_HEADERS.
2520         * exclude.c: Include "strcase.h".
2521         * regex_internal.h [!defined _LIBC]: Likewise.
2522         * getusershell.c: Include stdio--.h rather than stdio.h
2523         and stdio-safer.h.
2524         (getusershell): Call fopen, not fopen_safer.
2525         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2526         Do not include unistd-safer.h.
2527         (save_cwd): Don't call fd_safer; no longer needed
2528         now that we include fcntl--.h.
2529
2530         * getdate.y (relative_time): New type.
2531         (RELATIVE_TIME_0): New constant.
2532         (parser_control): Use relative_time instead of doing it ourselves.
2533         (%union): Add new relative_time rel member.
2534         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2535         Now typeless.
2536         (relunit, relunit_snumber): Now of type rel.
2537         (zone, rel, relunit, get_date): Adjust to above changes.
2538
2539         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2540         Do not include unistd-safer.h.
2541         (getloadavg): Don't call fd_safer; no longer needed
2542         now that we include fcntl--.h.
2543
2544         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2545         (make_dir_parents): Treat ENOSYS like EEXIST.
2546
2547         Improve quality of diagnostics on restore_cwd failure.
2548         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2549         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2550         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2551         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2552         each time through the loop.  Do not diagnose restore_cwd failure;
2553         that is the caller's job (and perhaps the caller does not care).
2554
2555         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2556         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2557         If the file already exists but is not a directory, don't bother
2558         to try to make its parents.
2559         Close potential file descriptor leak if we can't chdir("/") (!).
2560         Don't always return true if chdir($PWD) fails; return true only
2561         if the requested action was done successfully (except for the
2562         chdir($PWD)).
2563         Don't log final directory unless we actually made it.
2564         Refactor to avoid duplicate code to fix up permissions.
2565         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2566
2567         * strftime.c (my_strftime): Rewrite the previous change slightly,
2568         to make it a bit faster and (I hope) clearer.
2569         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2570         Fix bug in formats like %2N.
2571
2572         * verify.h: New file.
2573
2574 2005-09-22  Jim Meyering  <jim@meyering.net>
2575
2576         Sync from coreutils.
2577
2578         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2579
2580         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2581         the .tm_year member, since otherwise gcc-4.0 would now warn about
2582         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2583
2584         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2585         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2586
2587         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2588         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2589         when run in a time zone for which daylight savings time is in effect
2590         for the starting date.
2591
2592         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2593         stop us from restricting permissions of just-created absolute-named
2594         directories.
2595         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2596         to restore initial working directory.
2597         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2598         to tell caller if/when we change the working directory and are
2599         unable to return to the initial one.
2600         * mkdir-p.h (make_dir_parents): Update prototype.
2601         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2602         `return false'.  This fixes a bug introduced on 2004-07-30.
2603
2604         * openat.c (fdopendir): Be sure to close the supplied
2605         file descriptor before returning.  This makes our replacement
2606         implementation a little closer to Solaris's, where fdopendir
2607         ties the file descriptor to the returned DIR* pointer.
2608         * openat.c (unlinkat): New function.
2609         * openat.h (unlinkat): Add prototype.
2610         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2611         (openat_restore_fail): Rename from openat_restore_die.
2612         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2613
2614         Provide an alternative to exiting immediately upon save_cwd or
2615         restore_cwd failure.  Now, an application can arrange e.g.,
2616         to perform a longjump in that case.
2617         * openat.c: Include dirname.h.
2618         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2619         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2620         and openat_restore_die rather than calling error directly.
2621         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2622
2623         * openat-die.c (openat_save_die, openat_restore_die): New file.
2624         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2625
2626         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2627         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2628                             int utc, int nanoseconds);
2629         Background:
2630         date should not have to allocate a megabyte of virtual memory to
2631         handle a format argument like +%1048575T.  When implemented with
2632         strftime, it must allocate such a buffer, use strftime to fill it
2633         in, print it, then free it.
2634         With fprintftime, it simply prints everything and exits.
2635         With no need for memory allocation, that's one fewer way to fail.
2636         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2637         optional field width, not before, so we accept %9:z, not %:9z.
2638         (my_strftime): Be sure to use L_('x') for literals.
2639
2640         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2641         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2642         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2643         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2644         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2645         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2646         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2647         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2648         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2649
2650         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2651         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2652         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2653         and don't include <sys/file.h>).
2654
2655 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2656
2657         Sync from coreutils.
2658
2659         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2660         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2661         [!LDAV_DONE]: Avoid unused variable warning.
2662
2663 2005-09-21  Bruno Haible  <bruno@clisp.org>
2664
2665         * unicodeio.h (unicode_to_mb): New declaration.
2666
2667 2005-09-20  Derek Price  <derek@ximbiot.com>
2668
2669         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2670
2671 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2672
2673         Use a consistent style for including <config.h>.
2674         * __fpending.c, acl.c, argmatch.c,
2675         argp-help.c, argp-parse.c,
2676         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2677         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2678         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2679         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2680         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2681         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2682         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2683         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2684         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2685         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2686         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2687         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2688         modechange.c, mountlist.c, open-safer.c, physmem.c,
2689         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2690         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2691         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2692         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2693         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2694         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2695         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2696         userspec.c, utimecmp.c, version-etc-fsf.c,
2697         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2698         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2699         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2700         Standardize inclusion of config.h.
2701         * __fpending.h, dirfd.h, getdate.h, human.h,
2702         inttostr.h:  Removed inclusion of config.h from header files.
2703         * inttostr.c:  Adjusted in-tree users.
2704         * timespec.h: Remove superfluous warning to include config.h.
2705         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2706         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2707         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2708         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2709
2710 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2711
2712         * stat-time.h: New file.
2713         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2714         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2715         in a different way.
2716         (timespec_cmp): New function.
2717         * utimecmp.c: Include stat-time.h.
2718         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2719         members exist, not on the obsolescent ST_MTIM_NSEC.
2720         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2721
2722 2005-09-15  Derek Price  <derek@ximbiot.com>
2723             Paul Eggert  <eggert@cs.ucla.edu>
2724
2725         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2726         changes, consolidating in...
2727         * regex_internal.h: ...this file.
2728
2729 2005-09-15  Derek Price  <derek@ximbiot.com>
2730
2731         * regex_internal.h: Blank `pure' for GNUC < 3.
2732         * regex_internal.c: Ditto, using this...
2733         (__GNUC_PREREQ): ...new macro.
2734         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2735         (__GNUC_PREREQ): ...this new macro.
2736
2737         * strstr.h: Include string.h. Define strstr as a macro here.
2738
2739 2005-09-13  Derek Price  <derek@ximbiot.com>
2740
2741         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2742         failure.
2743         Reported by Jim Meyering  <jim@meyering.net>.
2744
2745 2005-09-13  Jim Meyering  <jim@meyering.net>
2746
2747         * canon-host.c: Filter through gnu indent and reword comments slightly.
2748         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2749
2750 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2751
2752         * lib/base64.c: Typo.
2753         (base64_encode): Put b64str in initialized data section.
2754
2755 2005-09-12  Derek Price  <derek@ximbiot.com>
2756
2757         Return usable errors from canon-host.
2758         * canon-host.h: New file.
2759         * canon-host.c (canon_host): Wrap...
2760         (canon_host_r): ...this new function, which now relies exclusively on
2761         getaddrinfo.
2762         (ch_strerror): New function.
2763         (last_cherror): New global.
2764         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2765         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2766         void *.
2767         (freeaddrinfo): Free ai->ai_canonname when set.
2768
2769 2005-09-12  Derek Price  <derek@ximbiot.com>
2770             Paul Eggert  <eggert@cs.ucla.edu>
2771
2772         * glob-libc.h: Renamed from glob_.h.  The new version is
2773         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2774         protecting things that should be done only in gnulib contexts.
2775         * glob_.h: New file, containing only the glob things needed for
2776         gnulib.
2777         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2778         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2779         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2780         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2781         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2782         and to respect the namespace rules better.
2783
2784 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2785
2786         Merge glibc and coreutils changes into gnulib, plus a few
2787         extra fixes.
2788         * md5.c: Use #error rather than a string.
2789         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2790         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2791         (__attribute__): Define to empty for non recent-GCC.
2792         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2793         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2794         Renamed from their non-__ counterparts, with new macros replacing
2795         them if not _LIBC.  Add __THROW attribute.
2796         (rol): Remove.
2797         (struct md5_ctx): Align buffer if using GCC.
2798         * sha1.h (struct sha1_ctx): Likewise.
2799         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2800         The old name was backwards.
2801         (NOTSWAP): Remove; not used.
2802         (rol): New macro, moved here from md5.h.
2803         (sha1_process_block): Remove a FIXME that doesn't make sense.
2804
2805 2005-09-12  Derek Price  <derek@ximbiot.com>
2806
2807         * gai_strerror.c: Include config.h when available.  Include
2808         getaddrinfo.h before other headers to test interface.
2809         Reported by Larry Jones <lawrence.jones@ugs.com>.
2810
2811 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2812
2813         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2814         definitions, since that's the preferred style in glibc.
2815         Fix a minor spacing issue, and update copyright notice to match glibc's.
2816
2817 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2818
2819         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2820
2821 2005-09-06  Simon Josefsson  <jas@extundo.com>
2822
2823         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2824         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2825
2826 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2827
2828         Change bitset word type from unsigned int to unsigned long int,
2829         as this has better performance on typical 64-bit hosts.
2830         Port bitset code to hosts with unusual word sizes.
2831         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2832         (build_collating_symbol):
2833         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2834         argument is a bitset.  This is merely a style issue, but it makes
2835         it clearer that an entire array is expected.
2836         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2837         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2838         Port to the case where bitset_word is not the same as unsigned int.
2839         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2840         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2841         Likewise.
2842         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2843         (build_trtable, group_nodes_into_DFAstates):
2844         Likewise.
2845         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2846         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2847         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2848         * regexec.c (group_nodes_into_DFAstates): Likewise.
2849         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2850         * regcomp.c (optimize_subexps, lower_subexp):
2851         Work even if bitset_word has holes in its bitwise representation.
2852         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2853         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2854         Likewise.
2855         * regex_internal.c (re_string_reconstruct):
2856         Don't assume UCHAR_MAX == 255.
2857         * regex_internal.h (bitset_set_all): Likewise.
2858         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2859         All uses changed.
2860         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2861         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2862         All uses changed.
2863         (BITSET_WORD_MAX): New macro.
2864         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2865         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2866         (bitset_empty, bitset_copy):
2867         Prefer sizeof (bitset) to multiplying it out ourselves.
2868         (bitset_not_merge): Remove; unused.
2869         (bitset_contain): Return bool, not unsigned int with one bit on.
2870         All callers changed.
2871         * regexec.c (build_trtable): Don't assume bitset has no stricter
2872         alignment than re_node_set; do this by defining a new internal
2873         type struct dests_alloc and using it to allocate memory.
2874
2875 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2876
2877         Check for arithmetic overflow when calculating sizes, to prevent
2878         some buffer-overflow issues.  These patches are conservative, in the
2879         sense that when I couldn't determine whether an overflow was possible,
2880         I inserted a run-time check.
2881         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2882         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2883         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2884         (re_xnrealloc, re_x2nrealloc): New inline functions.
2885         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2886         (build_equiv_class, build_charclass): Check for arithmetic overflow
2887         in size expression calculations.
2888         * lib/regex_internal.c (re_string_realloc_buffers):
2889         (build_wcs_upper_buffer, re_node_set_add_intersect):
2890         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2891         (re_dfa_add_node, register_state): Likewise.
2892         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2893         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2894         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2895         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2896
2897 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2898
2899         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2900         to avoid a collision with bits/local_lim.h in glibc.
2901         All uses changed.  Problem reported by Dmitry V. Levin in
2902         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2903
2904         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2905         bugs in int versus size_t comparisons.
2906         (re_string_context_at): Fix bug where the code assumed that
2907         Idx is signed.
2908
2909         Use bool where appropriate.
2910         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2911         All callers changed.
2912         (calc_eclosure_iter): Likewise, for ROOT arg.
2913         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2914         (build_charclass_op): Likewise, for NON_MATCH arg.
2915         * regex_internal.c (re_string_allocate, re_string_construct):
2916         (re_string_construct_common): Likewise, for ICASE arg.
2917         * regexec.c (re_search_2_stub, re_search_stub):
2918         Likewise, for RET_LEN arg.
2919         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2920         (set_regs): Likewise, for FL_BACKTRACK arg.
2921         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2922         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2923         (calc_eclosure_iter, parse_bracket_exp):
2924         Use bool for internal variables that are booleans.
2925         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2926         (set_regs, build_sifted_states, sift_states_bkref):
2927         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2928         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2929         (find_collation_sequence_value):
2930         Likewise.
2931         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2932         (re_node_set_compare):
2933         Return bool, not int. All callers changed.
2934         * regexec.c (check_halt_node_context, check_dst_limits):
2935         (build_trtable, check_node_accept): Likewise.
2936         * regex_internal.h: Include stdbool.h.
2937
2938         Fix bugs uncovered when converting to bool.
2939         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2940         failure instead of charging ahead blindly.
2941         * regex_internal.c (register_state): Likewise.
2942         * regexec.c (re_search_2_stub): Use simpler method than boolean
2943         for freeing internal storage.
2944         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2945         bitset pieces used as boolean, to avoid undefined behavior
2946         on hosts that do int overflow checking.
2947
2948 2005-08-31  Derek Price  <derek@ximbiot.com>
2949
2950         * getdelim.c (getdelim): Return EOF on EOF.
2951         Reported by Larry Jones <lawrence.jones@ugs.com>.
2952
2953 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2954
2955         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2956         lengths fit in regoff_t; this isn't true if regoff_t is the same
2957         width as size_t.
2958         * regex.c (re_search_internal): 5th arg is LAST_START
2959         (= START + RANGE) instead of RANGE.  This avoids overflow
2960         problems when regoff_t is the same width as size_t.
2961         All callers changed.
2962         (re_search_2_stub): Check for overflow when adding the
2963         sizes of the two strings.
2964         (re_search_stub): Check for overflow when adding START
2965         to RANGE; if it occurs, substitute the extreme value.
2966
2967 2005-08-31  Jim Meyering  <jim@meyering.net>
2968
2969         * regcomp.c (search_duplicated_node): Make first pointer arg
2970         a pointer-to-const.
2971         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2972         (register_state): Likewise.
2973         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2974         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2975         (group_nodes_into_DFAstates): Likewise.
2976
2977 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2978
2979         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2980         old glibc regex code mishandles strings longer than 2**31 bytes.
2981         This patch fixes this when the regex code is used in gnulib
2982         (i.e., outside glibc).
2983
2984         This patch should not affect the use of the regex code inside
2985         glibc.  No doubt this problem also needs to be handled for glibc
2986         as well, but the result will be an incompatible change to the
2987         glibc ABI, and the old ABI will have to be supported too.  That
2988         can be the the subject for another patch.
2989
2990         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2991         governing whether the rest of this patch is active.  By default,
2992         the macro is disabled and the patch has no effect.
2993         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2994         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2995         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2996         (re_match_2, re_set_registers): Use the new types.
2997         * regex_internal.h (Idx, re_hashval_t): New types.
2998         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2999         New macros.
3000         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3001         (re_string_context_at, bin_tree_t, re_dfastate_t):
3002         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3003         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3004         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3005         (re_string_char_size_at, re_string_wchar_at):
3006         (re_string_elem_size_at):
3007         Use the new types and macros to port to 64-bit hosts.
3008         Use unsigned types for internal values, so that the code
3009         mostly works even for arrays larger than SSIZE_MAX.
3010         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3011         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3012         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3013         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3014         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3015         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3016         (calc_inveclosure, parse_dup_op, build_range_exp):
3017         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3018         (fetch_number, create_token_tree, mark_opt_subexp):
3019         Likewise.
3020         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3021         (create_cd_newstate, re_string_allocate, re_string_construct):
3022         (re_string_realloc_buffers, build_wcs_upper_buffer):
3023         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3024         (re_string_reconstruct, re_string_peek_byte_case):
3025         (re_string_fetch_byte_case, re_string_context_at):
3026         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3027         (re_node_set_init_copy, re_node_set_add_intersect):
3028         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3029         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3030         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3031         (re_acquire_state, re_acquire_state_context, register_state):
3032         Likewise.
3033         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3034         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3035         (re_search_internal, re_search_2_stub, re_search_stub)
3036         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3037         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3038         (update_cur_sifted_state, check_dst_limits):
3039         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3040         (check_subexp_limits, sift_states_bkref, merge_state_array):
3041         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3042         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3043         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3044         (expand_bkref_cache, check_node_accept_bytes):
3045         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3046         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3047         (acquire_init_state_context, check_halt_node_context):
3048         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3049         (sift_states_backward, clean_state_log_if_needed):
3050         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3051         (find_recover_state, transit_state_sb, transit_state_mb):
3052         (transit_state_bkref, build_trtable, match_ctx_clean):
3053         Likewise.
3054         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3055         to work around an assumption that REG_MISSING is negative.
3056
3057         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3058         (seek_collating_symbol_entry) [defined _LIBC]:
3059         (lookup_collation_sequence_value) [defined _LIBC]:
3060         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3061         Use prototypes rather than old-style function definitions.
3062         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3063         (transit_state_sb) [0]:
3064         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3065
3066         * regexec.c (re_search_internal): Simplify update of rm_so and
3067         rm_eo.
3068
3069         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3070         (optimize_subexps, lower_subexp):
3071         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3072         since the signed shift might overflow.  Use 1u<<31 instead.
3073         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3074         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3075         Likewise.
3076
3077         * regcomp.c (optimize_subexps, lower_subexp):
3078         Use CHAR_BIT rather than 8, for clarity.
3079         * regexec.c (check_dst_limits_calc_pos_1):
3080         (check_subexp_matching_top): Likewise.
3081         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3082         have to worry about portability issues when shifting it left.
3083         Remove no-longer-needed test for table_size > 0.
3084         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3085         in a word, as the resulting behavior is undefined.
3086         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3087         in one case, a <= should have been an <, and in another case the
3088         whole test was missing.
3089         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3090         the standard name CHAR_BIT.
3091         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3092         this is not true on one's complement and signed-magnitude hosts.
3093
3094         * regex_internal.h (re_sub_match_top_t): Remove unused member
3095         next_last_offset.
3096         (struct re_dfa_t): Remove unused member states_alloc.
3097         * regcomp.c (init_dfa): Don't initialize unused members.
3098
3099 2005-08-31  Bruno Haible  <bruno@clisp.org>
3100
3101         * strstr.c: Include <stddef.h>, for NULL.
3102         * strcasestr.c: Likewise.
3103         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3104
3105 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3106
3107         * iconvme.h: Add prototype for iconv_alloc.
3108
3109 2005-08-29  Simon Josefsson  <jas@extundo.com>
3110
3111         * iconvme.c: Fix errno.
3112
3113 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3114
3115         * iconvme.c: Split iconv_string into iconv_alloc.
3116
3117 2005-08-27  Jim Meyering  <jim@meyering.net>
3118
3119         * fopen-safer.c: Merge minor changes from coreutils.
3120         * dup-safer.c: Likewise.
3121         * fd-safer.c: Likewise.
3122
3123         Merge from coreutils.
3124         * stdio--.h: New file.
3125         * stdlib--.h: New file.
3126         * mkstemp-safer.c: New file.
3127
3128         GNU tar needs these.
3129         * pipe-safer.c: New file.
3130         * creat-safer.c: New file.
3131         * fcntl--.h (creat): Define to creat_safer.
3132         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3133         * unistd--.h (pipe): Define to pipe_safer.
3134         * unistd-safer.h: Declare pipe_safer.
3135
3136 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3137
3138         * regex_internal.h: Remove all references to
3139         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3140         or better.
3141         (bitset_not, bitset_merge, bitset_not_merge):
3142         (bitset_mask, re_string_allocate, re_string_construct):
3143         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3144         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3145         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3146         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3147         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3148         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3149         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3150         (re_acquire_state_context):
3151         Remove unnecessary forward decls.
3152         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3153         Put __attribute at function definition,
3154         now that the function decl has been removed.
3155         * lib/regex_internal.c (re_string_peek_byte_case):
3156         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3157         Likewise.
3158
3159 2005-08-26  Simon Josefsson  <jas@extundo.com>
3160
3161         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3162         Haible <bruno@clisp.org>.
3163
3164 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3165
3166         * regexec.c (set_regs): Don't alloca with an unbounded size.
3167
3168         alloca modernization/simplification for regex.
3169         * regex.c: Remove portability cruft for alloca.  This no longer
3170         needs to be at the start of the file, and can be moved into
3171         regex_internal.h and simplified.
3172         * regex_internal.h: Include <alloca.h>.
3173         (__libc_use_alloca) [!defined _LIBC]: New macro.
3174         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3175         now works outside glibc.
3176
3177 2005-08-24  Simon Josefsson  <jas@extundo.com>
3178
3179         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3180         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3181         GLIBC specific code.
3182
3183 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3184
3185         Make regex safe for g++.  This fixes one real bug (an "err"
3186         that should have been "*err").  g++ problem reported by
3187         Sam Steingold.
3188         * regex_internal.h (re_calloc): New macro, consistent with
3189         re_malloc etc.  All callers of calloc changed to use re_calloc.
3190         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3191         not int.  All callers changed.
3192         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3193         just use an array of size MB_LEN_MAX.
3194         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3195         (find_recover_state): Change "err" to "*err"; this fixes what
3196         appears to be a real bug.
3197         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3198         versus int.
3199
3200 2005-08-25  Jim Meyering  <jim@meyering.net>
3201
3202         * open-safer.c: Include <config.h>.
3203         Otherwise, we'd lose LARGEFILE support in any file using
3204         e.g. "fcntl--.h"
3205
3206 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3207
3208         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3209         * regex.h (regerror): Likewise.
3210
3211         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3212         requires this.  (The code never needed it.)
3213
3214         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3215         All uses of recently-renamed identifiers changed to use the new,
3216         POSIX-compliant names.  The code will build and run just fine
3217         without these changes, but it's better to eat our own dog food
3218         and use the standard-conforming names.
3219
3220         * regex.h: Fix a multitude of POSIX name space violations.
3221         These changes have an effect only for programs that define
3222         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3223         do not change anything for programs compiled in the normal way.
3224         Also, there is no effect on the ABI.
3225
3226         (_REGEX_SOURCE): New macro.
3227         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3228         defined and _GNU_SOURCE is not; this fixes a name space violation.
3229
3230         Rename the following macros to obey POSIX requirements.
3231         The old names are still visible as macros if _REGEX_SOURCE is defined.
3232         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3233         RE_BACKSLASH_ESCAPE_IN_LISTS.
3234         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3235         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3236         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3237         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3238         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3239         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3240         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3241         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3242         (REG_INTERVALS): renamed from RE_INTERVALS.
3243         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3244         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3245         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3246         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3247         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3248         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3249         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3250         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3251         RE_UNMATCHED_RIGHT_PAREN_ORD.
3252         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3253         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3254         (REG_DEBUG): renamed from RE_DEBUG.
3255         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3256         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3257         unusual, since we can't clash with the POSIX REG_ICASE.
3258         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3259         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3260         (REG_NO_SUB): renamed from RE_NO_SUB.
3261         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3262         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3263         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3264         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3265         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3266         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3267         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3268         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3269         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3270         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3271         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3272         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3273         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3274         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3275         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3276         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3277         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3278         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3279         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3280         (REG_FIXED): Renamed from REGS_FIXED.
3281         (REG_NREGS): Renamed from RE_NREGS.
3282
3283         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3284         of other REG_* macros, since POSIX says the user is allowed to
3285         #undef these macros selectively.
3286
3287         (reg_errcode_t): Update comment stating what other tables need
3288         to be consistent.
3289
3290         Rename the following enum values to obey POSIX requirements.
3291         The old names are still visible as macros.
3292         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3293         is not defined, since GNU is supposed to be a superset of POSIX as
3294         much as possible, and since we want reg_errcode_t to be a signed
3295         type for implementation consistency.
3296         (_REG_NOERROR): Renamed from REG_NOERROR.
3297         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3298         (_REG_BADPAT): Renamed from REG_BADPAT.
3299         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3300         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3301         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3302         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3303         (_REG_EBRACK): Renamed from REG_EBRACK.
3304         (_REG_EPAREN): Renamed from REG_EPAREN.
3305         (_REG_EBRACE): Renamed from REG_EBRACE.
3306         (_REG_BADBR): Renamed from REG_BADBR.
3307         (_REG_ERANGE): Renamed from REG_ERANGE.
3308         (_REG_ESPACE): Renamed from REG_ESPACE.
3309         (_REG_BADRPT): Renamed from REG_BADRPT.
3310         (_REG_EEND): Renamed from REG_EEND.
3311         (_REG_ESIZE): Renamed from REG_ESIZE.
3312         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3313         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3314         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3315         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3316         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3317
3318         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3319         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3320         changed.  But support the old name if the new one is not defined
3321         and if _REGEX_SOURCE.
3322
3323         Change the following member names in struct re_pattern_buffer.
3324         The old names are still supported if !_REGEX_SOURCE.
3325         The new names are always supported, regardless of _REGEX_SOURCE.
3326         (re_buffer): Renamed from buffer.
3327         (re_allocated): Renamed from allocated.
3328         (re_used): Renamed from used.
3329         (re_syntax): Renamed from syntax.
3330         (re_fastmap): Renamed from fastmap.
3331         (re_translate): Renamed from translate.
3332         (re_can_be_null): Renamed from can_be_null.
3333         (re_regs_allocated): Renamed from regs_allocated.
3334         (re_fastmap_accurate): Renamed from fastmap_accurate.
3335         (re_no_sub): Renamed from no_sub.
3336         (re_not_bol): Renamed from not_bol.
3337         (re_not_eol): Renamed from not_eol.
3338         (re_newline_anchor): Renamed from newline_anchor.
3339
3340         Change the following member names in struct re_registers.
3341         The old names are still supported if !_REGEX_SOURCE.
3342         The new names are always supported, regardless of _REGEX_SOURCE.
3343         (rm_num_regs): Renamed from num_regs.
3344         (rm_start): Renamed from start.
3345         (rm_end): Renamed from end.
3346
3347         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3348         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3349         Prepend __ to parameter names.
3350
3351         Undo yesterday's changes.
3352
3353 2005-08-24  Jim Meyering  <jim@meyering.net>
3354
3355         Sync from coreutils.
3356         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3357
3358 2005-08-21  Bruno Haible  <bruno@clisp.org>
3359
3360         * lock.h: Add multiple inclusion guard.
3361         * tls.h: Add multiple inclusion guard.
3362
3363 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3364
3365         * regex.h (REG_NOSYS)
3366         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3367         Define, since POSIX requires it as of 2001.
3368         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3369         New private symbol, used to keep the enum signed in all cases.
3370         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3371         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3372
3373         * regex_internal.c (re_string_skip_chars, register_state):
3374         (calc_state_hash):
3375         Remove forward decls; no longer needed now that we use prototypes.
3376         * regexec.c (acquire_init_state_context, check_halt_node_context):
3377         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3378         (clean_state_log_if_needed): Likewise.
3379
3380 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3381
3382         Fix problems reported by Sam Steingold in
3383         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3384         * regexec.c (sift_states_bkref): Fix portability bug: the code
3385         assumed that reg_errcode_t is a signed type, which is not
3386         necessarily true if _XOPEN_SOURCE is not defined.
3387         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3388         some compilers warn about it otherwise.
3389
3390 2005-08-20  Jim Meyering  <jim@meyering.net>
3391
3392         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3393         of unused local, dfa.
3394
3395 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3396
3397         * regcomp.c (create_initial_state): Remove duplicate decl.
3398         (init_word_char, create_initial_state, duplicate_node_closure):
3399         (fetch_token, peek_token_bracket, build_range_exp):
3400         (build_collating_symbol): Remove forward decls; no longer needed
3401         now that we use prototypes.
3402
3403         * regcomp.c:
3404         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3405         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3406         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3407         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3408         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3409         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3410         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3411         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3412         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3413         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3414         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3415         (build_charclass, build_charclass_op, fetch_number, create_tree):
3416         (create_token_tree, mark_opt_subexp, duplicate_tree):
3417         Use prototypes rather than old-style definitions.
3418
3419         * regex_internal.c:
3420         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3421         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3422         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3423         (re_string_reconstruct, re_string_peek_byte_case):
3424         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3425         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3426         (re_node_set_init_copy, re_node_set_add_intersect):
3427         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3428         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3429         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3430         (re_acquire_state, re_acquire_state_context, register_state):
3431         (create_ci_newstate, create_cd_newstate, free_state):
3432         Likewise.
3433         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3434         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3435         (re_search_internal, prune_impossible_nodes):
3436         (acquire_init_state_context, check_matching, static):
3437         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3438         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3439         (update_regs, sift_states_backward, build_sifted_states):
3440         (clean_state_log_if_needed, merge_state_array):
3441         (update_cur_sifted_state, add_epsilon_src_nodes):
3442         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3443         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3444         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3445         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3446         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3447         (check_arrival, check_arrival_add_next_nodes):
3448         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3449         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3450         (check_node_accept_bytes, check_node_accept, extend_buffers):
3451         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3452         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3453         (sift_ctx_init):
3454         Likewise.
3455
3456         * regex_internal.h:
3457         (re_string_allocate, re_string_construct, re_string_reconstruct):
3458         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3459         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3460         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3461         (re_string_context_at, re_string_peek_byte_case):
3462         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3463         is defined, since we now use prototypes always.
3464
3465         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3466         C89 or better.  All uses removed.
3467
3468 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3469
3470         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3471         [defined lint]: Suppress bogus uninitialized-variable warnings.
3472
3473         * regcomp.c (duplicate_node): Return new index, not an error code,
3474         and let the caller return REG_ESPACE if out of space.  This
3475         removes an uninitialied-variable warning with GCC 4.0.1, and also
3476         avoids taking the address of a local variable.  All callers
3477         changed.
3478
3479 2005-08-19  Jim Meyering  <jim@meyering.net>
3480
3481         * regexec.c (proceed_next_node): Redo local variables to
3482         avoid GCC shadowing warnings.
3483
3484 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3485
3486         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3487         (re_node_set_insert_last, re_dfa_add_node):
3488         Rename local variables to avoid GCC shadowing warnings.
3489
3490 2005-08-18  Bruno Haible  <bruno@clisp.org>
3491
3492         * strstr.c (strstr): Fix return value in multibyte case.
3493         * strcasestr.c (strcasestr): Likewise.
3494
3495 2005-08-17  Jim Meyering  <jim@meyering.net>
3496
3497         Make the %s format (seconds since the epoch) work for a negative
3498         number and when used with a zero-padded field width, e.g. %015s.
3499
3500         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3501         label so that it precedes the code to set `digits'.  Otherwise,
3502         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3503         print `00-22'.  Now, it prints `-0022', as it should.
3504
3505 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3506
3507         * regex.h: Remove useless space-before-tab.  From coreutils.
3508
3509 2005-08-17  Bruno Haible  <bruno@clisp.org>
3510
3511         * strcasestr.h: New file.
3512         * strcasestr.c: New file.
3513
3514 2005-08-17  Bruno Haible  <bruno@clisp.org>
3515
3516         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3517         * strstr.c: Completely rewritten, with multibyte locale support.
3518
3519 2005-08-17  Bruno Haible  <bruno@clisp.org>
3520
3521         * strcasecmp.c: Use mbuiter.h.
3522
3523 2005-08-17  Bruno Haible  <bruno@clisp.org>
3524
3525         * mbuiter.h: New file.
3526
3527 2005-08-16  Bruno Haible  <bruno@clisp.org>
3528
3529         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3530         (mbi_init): Update.
3531         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3532         NUL byte, not after it.
3533
3534 2005-08-16  Bruno Haible  <bruno@clisp.org>
3535
3536         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3537         the valid ones. Makes the comparison operations transitive:
3538         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3539         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3540
3541 2005-08-16  Bruno Haible  <bruno@clisp.org>
3542
3543         * strcase.h (strcasecmp): Add note in comments.
3544         * strncasecmp.c: Use code from strcasecmp.c.
3545         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3546         (strcasecmp): Work correctly in multibyte locales.
3547
3548 2005-08-16  Bruno Haible  <bruno@clisp.org>
3549
3550         * strnlen1.h: New file.
3551         * strnlen1.c: New file.
3552
3553 2005-08-16  Bruno Haible  <bruno@clisp.org>
3554
3555         * mbfile.h: New file.
3556
3557 2005-08-16  Bruno Haible  <bruno@clisp.org>
3558
3559         * mbiter.h: New file.
3560
3561 2005-08-16  Bruno Haible  <bruno@clisp.org>
3562
3563         * mbchar.h: New file.
3564         * mbchar.c: New file.
3565
3566 2005-08-16  Bruno Haible  <bruno@clisp.org>
3567
3568         * tls.h: New file, from GNU gettext.
3569         * tls.c: New file, from GNU gettext.
3570
3571 2005-08-15  Bruno Haible  <bruno@clisp.org>
3572
3573         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3574         is defined.
3575
3576 2005-08-14  Jim Meyering  <jim@meyering.net>
3577
3578         Sync from coreutils.
3579
3580         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3581         Use the hash-table-based cycle-detection code not just when
3582         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3583         Reported by James Youngman in
3584         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3585         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3586         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3587         This lets us compile with -DFTS_DEBUG, once again.
3588         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3589         * fts.c (fd_safer): Remove decl.
3590         Include fcntl--.h rather than unistd-safer.h
3591         (fts_safe_changedir): Don't call fd_safer; no longer needed
3592         now that we include fcntl--.h.
3593
3594 2005-08-11  Simon Josefsson  <jas@extundo.com>
3595
3596         * readline.h, readline.c: New file.
3597
3598 2005-08-11  Bruno Haible  <bruno@clisp.org>
3599
3600         * strnlen.h (strnlen): Change parameter name to match comment.
3601
3602 2005-08-10  Simon Josefsson  <jas@extundo.com>
3603
3604         * strndup.c: Use strnlen.h.
3605
3606         * strnlen.h: New file.
3607
3608 2005-08-02  Simon Josefsson  <jas@extundo.com>
3609
3610         * getline.h, getline.c: Rewrite.
3611
3612         * getdelim.h, getdelim.c: New files, ported from glibc.
3613
3614 2005-07-31  Bruno Haible  <bruno@clisp.org>
3615
3616         * lock.h (gl_lock_initializer): New macro.
3617         (gl_lock_define_initialized): Use it.
3618         (gl_rwlock_initializer): New macro.
3619         (gl_rwlock_define_initialized): Use it.
3620         (gl_recursive_lock_initializer): New macro.
3621         (gl_recursive_lock_define_initialized): Use it.
3622
3623 2005-07-26  Bruno Haible  <bruno@clisp.org>
3624
3625         * lock.h: Update from GNU gettext.
3626         * lock.c: Update from GNU gettext.
3627
3628 2005-07-18  Bruno Haible  <bruno@clisp.org>
3629
3630         * lock.h (gl_once_t): New type.
3631         (gl_once_define, gl_once): New macros.
3632         * lock.c (fresh_once): New variable.
3633         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3634         functions.
3635
3636 2005-07-18  Simon Josefsson  <jas@extundo.com>
3637
3638         * check-version.c (check_version): Accept identical versions too.
3639
3640 2005-07-18  Bruno Haible  <bruno@clisp.org>
3641
3642         * lock.h: New file, from GNU gettext.
3643         * lock.c: New file, from GNU gettext.
3644
3645 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3646
3647         * quotearg.c: Add translator comment suggested by Bruno Haible,
3648         with a minor change.
3649
3650 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3651
3652         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3653         copyright symbol and the year.
3654         * version-etc.c (COPYRIGHT_YEAR): New constant.
3655         (version_etc_va): Use parameterized copyright notice.
3656         Reword to conform to the current GNU coding standards.
3657
3658 2005-07-11  Simon Josefsson  <jas@extundo.com>
3659
3660         * size_max.h: New file.
3661
3662 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3663
3664         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3665         block of defines.
3666
3667 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3668        and  Paul Eggert  <eggert@cs.ucla.edu>
3669
3670         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3671         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3672
3673 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3674
3675         * regex.c, regex.h: Sync from libc.
3676         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3677         New files, synced from libc, except that regex_internal.h
3678         currently has a small porting fix.
3679
3680 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3681
3682         Remove the dependency of the strftime module on the tzset module.
3683         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3684         Copy the input structure, to work around some of the bug with
3685         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3686         Solaris releases, you should also use the tzset module, but we won't
3687         require it as a dependency any more since we don't want LGPLed code
3688         to depend on GPLed code.
3689
3690 2005-07-02  Jim Meyering  <jim@meyering.net>
3691
3692         * backupfile.c (backup_args): Change a `0' to NULL.
3693
3694 2005-07-01  Jim Meyering  <jim@meyering.net>
3695
3696         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3697         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3698         * save-cwd.c, tempname.c:
3699         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3700         and don't include <sys/file.h>).
3701
3702 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3703
3704         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3705         declares only 'struct timespec;' (!).
3706
3707 2005-06-29  Jim Meyering  <jim@meyering.net>
3708
3709         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3710         type name.  Use the variable name instead.
3711         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3712
3713 2005-06-28  Simon Josefsson  <jas@extundo.com>
3714
3715         * check-version.h, check-version.c: New files.
3716
3717 2005-06-28  Simon Josefsson  <jas@extundo.com>
3718
3719         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3720         collision with global variable.  Better indentation.  Don't
3721         increment buffer pointer beyond buffer end.  Based on comments
3722         from Paul Eggert <eggert@cs.ucla.edu>.
3723
3724         * base64.h: Indent.
3725
3726 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3727
3728         * canon-host.c (canon-host): Append trailing "," to 0 in
3729         initializer of struct addrinfo, as an indication that we don't
3730         care how many members the structure has.
3731
3732 2005-06-24  Derek Price  <derek@ximbiot.com>
3733         and Bruno Haible  <bruno@clisp.org>
3734
3735         Remove stat module & update lstat.
3736         * stat.c: Remove this file...
3737         (slash_aware_lstat): ...moving this content and its support...
3738         * lstat.c (rpl_lstat): ...into here.
3739         * lstat.h: New file.
3740
3741 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3742
3743         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3744         (ranged_convert): Don't save conversion in a temporary struct.
3745         This causes a warning with GCC 4.0.0, and anyway in the typical
3746         case it's not worth the extra 100 bytes or so of code.
3747         (ranged_convert, __mktime_internal): When calling a function via a
3748         pointer P, use P () rather than (*P) (), as we now assume C89 or
3749         better.
3750
3751 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3752
3753         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3754         "who -r" failed to give output.  Problem reported by Tim Waugh.
3755
3756         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3757         (xcalloc): Use it to avoid needless tests.
3758         Problem reported by Jim Meyering.
3759
3760 2005-06-16  Jim Meyering  <jim@meyering.net>
3761
3762         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3763         when either N or S is zero.
3764
3765 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3766
3767         * argp.h (__option_is_short): Check upper limit of
3768         __key. Isprint() requires its argument to have the value
3769         of an unsigned char or EOF.
3770
3771 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3772
3773         * fnmatch.c (fnmatch): If there is an encoding error in a
3774         multibyte string or pattern, fall back on unibyte matching.
3775         Problem reported by James Youngman.
3776
3777 2005-06-08  Bruno Haible  <bruno@clisp.org>
3778
3779         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3780         warning on mingw.
3781
3782 2005-06-08  Bruno Haible  <bruno@clisp.org>
3783
3784         * csharpcomp.h: New file, from GNU gettext.
3785         * csharpcomp.c: New file, from GNU gettext.
3786         * csharpcomp.sh.in: New file, from GNU gettext.
3787
3788 2005-06-07  Derek Price  <derek@ximbiot.com>
3789
3790         Sync from CVS.
3791         * glob_.h: Indent nested #ifdef.
3792
3793 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3794
3795         Sync from coreutils.
3796         Use "file name" when talking about file names, instead of "filename"
3797         or "path", as per the GNU coding standards.
3798         * mkdir-p.c: Renamed from makepath.c.
3799         (make_dir_parents): Renamed from make_path.  All callers changed.
3800         * mkdir-p.h: Likewise.  All includers changed.
3801         * filenamecat.c: Renamed from path-concat.c.
3802         (file_name_concat): Renamed from path_concat.  All callers changed.
3803         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3804         * filenamecat.h: Likewise.  All includers changed.
3805         * acl.c: Don't use "path" or "filename" to mean "file name"
3806         in comments or local variable names.
3807         * basename.c: Likewise.
3808         * canonicalize.c, canonicalize.h: Likewise.
3809         * dirname.c, dirname.h: Likewise.
3810         * euidaccess.c: Likewise.
3811         * exclude.c: Likewise
3812         * fnmatch_.h, fnmatch_loop.c: Likewise.
3813         * fsusage.c, fsuage.h: Likewise.
3814         * fts.c, fts_.h: Likewise.
3815         * getcwd.c: Likewise.
3816         * getloadavg.c: Likewise.
3817         * mkstemp.c: Likewise.
3818         * mountlist.c, mountlist.h: Likewise.
3819         * openat.c, openat.h: Likewise.
3820         * readlink-stub.c: Likewise.
3821         * readutmp.c, readutmp.h: Likewise.
3822         * rename.c: Likewise.
3823         * rmdir.c: Likewise.
3824         * same.c: Likewise.
3825         * savedir.c: Likewise.
3826         * stripslash.c: Likewise.
3827         * tempname.c: Likewise.
3828         * xreadlink.c: Likewise.
3829         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3830         All uses changed.
3831         * exclude.h: Likewise.
3832
3833         * euidaccess.c (getuid, getgid, getuid, getegid)
3834         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3835         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3836         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3837         * pathmax.h: Include <limits.h> unconditionally, since other
3838         files have been getting away with it for years (MORE/BSD 4.3
3839         is extinct now).
3840         * userspec.c (getpwnam, getgrnam, getgrgid)
3841         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3842
3843         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3844         Define to 256, not 255, as per modern POSIX.
3845
3846 2005-06-01  Bruno Haible  <bruno@clisp.org>
3847
3848         * csharpexec.h: New file, from GNU gettext.
3849         * csharpexec.c: New file, from GNU gettext.
3850         * csharpexec.sh.in: New file, from GNU gettext.
3851
3852 2005-05-31  Derek Price  <derek@ximbiot.com>
3853             Paul Eggert  <eggert@cs.ucla.edu>
3854
3855         Sync from cvs.
3856         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3857
3858 2005-05-29  Derek Price  <derek@ximbiot.com>
3859             Paul Eggert  <eggert@cs.ucla.edu>
3860
3861         * glob_.h, glob.c: New files.
3862
3863 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3864
3865         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3866
3867         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3868         the configuration hassle isn't worth it.
3869         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3870         (LONGEST_MODIFIER, PRIuMAX): Remove.
3871
3872 2005-05-27  Bruno Haible  <bruno@clisp.org>
3873
3874         * getlogin_r.h: Remove second include of <stddef.h>.
3875
3876 2005-05-25  Bruno Haible  <bruno@clisp.org>
3877             Derek Price  <derek@ximbiot.com>
3878
3879         * getlogin_r.h: Simplify API documentation.
3880
3881 2005-05-25  Derek Price  <derek@ximbiot.com>
3882             Paul Eggert  <eggert@cs.ucla.edu>
3883
3884         * getlogin_r.c, getlogin_r.h: New files.
3885
3886 2005-05-22  Bruno Haible  <bruno@clisp.org>
3887
3888         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3889         Also include <sys/param.h> if it defines MIN, MAX.
3890         Based on a patch by Derek Price <derek@ximbiot.com>.
3891
3892 2005-05-22  Bruno Haible  <bruno@clisp.org>
3893
3894         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3895         (INT64_MIN): Fix definition.
3896         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3897
3898         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3899         NEED_SIGNED_INT_TYPES.
3900
3901         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3902         HAVE_SYSTEM_INTTYPES.
3903
3904 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3905
3906         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3907         so that unistd-safer.h (GPL'ed code) need not be included.
3908
3909 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3910
3911         New fts module.
3912         * fts.c: Don't include "cycle-check.h" or "hash.h".
3913         (setup_dir, free_dir): New functions.
3914         (enter_dir, leave_dir): Define trivial
3915         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3916         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3917         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3918         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3919         Move to fts-cycle.c.
3920         (fts_open): Use setup_dir.
3921         (fts_close): Use free_dir.
3922         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3923         This adds a label and some gotos, but the alternatives were messier.
3924         Check for memory allocation failure when entering a dir.
3925         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3926         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3927         (FTS): New member fts_cycle, that is a union that contains the
3928         old active_dir_ht and cycle_state.  All uses changed to mention
3929         fts_cycle.ht and fts_cycle.state.
3930         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3931         fts.c, with the following changes:
3932         (setup_dir, free_dir): New functions.
3933         (enter_dir): Now returns bool.  Return true if successful, false
3934         if memory exhausted.  All callers changed.
3935         Do not bother partly cleaning up on
3936         memory allocation failure; that is free_dir's job.
3937         However, free ad if hash_insert fails, to avoid memory leak.
3938         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3939         fts->fts_options to see which union member to use.
3940
3941 2005-05-20  Jim Meyering  <jim@meyering.net>
3942
3943         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3944         Now a macro, to pacify GCC.
3945
3946 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3947
3948         * chown.c (rpl_chown): Return -1 on failure.
3949
3950 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3951
3952         * canonicalize.c: Include canonicalize.h first, to test interface.
3953         Include <stddef.h> unconditionally, since we assume C89 now.
3954         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3955         * fts.c: Include fts_.h first, to check interface.
3956         Do not include intprops.h; no longer needed.
3957         Include cycle-check.h and hash.h, since fts_.h no longer does.
3958         Remove unnecessary casts of closedir to void.
3959         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3960         decide whether to decrement nlinks.
3961         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3962         (FTS): Use struct hash_table * instead of Hash_table, so that
3963         we no longer need to include hash.h here.
3964
3965 2005-05-17  Jim Meyering  <jim@meyering.net>
3966
3967         * fts.c, fts_.h: New files, from coreutils.
3968
3969 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3970
3971         Sync from coreutils.
3972         * unlinkdir.c, unlinkdir.h: New files.
3973         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3974         regex.h, unlocked-io.h, xtime.h:
3975         White space changes only.
3976         * makepath.c (make_path): Port to hosts where leading "//" is special.
3977         * yesno.c: Include getline.h, not ctype.h.
3978         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3979         Use getline to remove arbitrary restriction on response length.
3980
3981 2005-05-13  Bruno Haible  <bruno@clisp.org>
3982
3983         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3984         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3985         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3986         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3987         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3988         Add support for 64-bit integers in the MSVC compiler.
3989
3990 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3991
3992         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3993         Change the initial comment to refer to GPL, not LGPL.
3994         gnulib-tool will change it to LGPL as needed.
3995
3996         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3997         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3998         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3999         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4000         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4001         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4002         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4003         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4004         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4005         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4006         concatpath.c, config.charset, copy-file.c, copy-file.h,
4007         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4008         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4009         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4010         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4011         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4012         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4013         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4014         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4015         full-read.c, full-read.h, full-write.c, full-write.h,
4016         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4017         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4018         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4019         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4020         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4021         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4022         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4023         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4024         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4025         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4026         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4027         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4028         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4029         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4030         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4031         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4032         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4033         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4034         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4035         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4036         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4037         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4038         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4039         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4040         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4041         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4042         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4043         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4044         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4045         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4046         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4047         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4048         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4049         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4050         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4051         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4052         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4053         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4054         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4055         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4056         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4057         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4058         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4059         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4060         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4061         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4062         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4063         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4064         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4065         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4066         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4067         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4068         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4069         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4070         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4071         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4072         Update FSF postal mail address.
4073
4074 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4075
4076         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4077         specified in ai_socktype. Fix invalid ai_protocol
4078         check. ai_protocol is usually set to 0 or depending on
4079         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4080         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4081         ai_socktype / ai_protocol in the returned addrinfo structure.
4082
4083 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4084             Bruno Haible  <bruno@clisp.org>
4085
4086         * inet_ntop.h: New file.
4087         * inet_ntop.c: New file, from glibc with modifications.
4088
4089 2005-05-08  Jim Meyering  <jim@meyering.net>
4090
4091         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4092
4093 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4094
4095         Merge from coreutils.  Among other things,
4096         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4097         * fd-safer.c: New file.
4098         * fcntl-safer.h, open-safer.c: Remove.
4099         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4100         * dup-safer.c: Include unistd-safer.h first.
4101         Don't include errno.h.
4102         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4103         * file-type.h: Don't assume invoker included sys/stat.h first.
4104         * file-type.c: Rely on file-type.h change.
4105         * getloadavg.c: Include unistd-safer.h.
4106         (getloadavg): Use safer open.
4107         * getusershell.c: Include "stdio-safer.h".
4108         (getusershell): Use safer fopen.
4109         * long-options.c (long_options): Use NULL rather than 0.
4110         * modechange.h (mode_free): Remove; all callers changed to invoke
4111         'free'.
4112         * modechange.c: Likewise.
4113         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4114         (MODE_DONE): New constant.
4115         (struct mode_change): Remove 'next' member.
4116         (make_node_op_equals): New function; like the old one of the
4117         same name, except it allocates an array.
4118         (mode_compile, mode_create_from_ref): Use it.
4119         (mode_compile): Allocate result as an array, not a linked list.
4120         Parse octal string ourself, so that we catch mistakes like "+0".
4121         (mode_adjust): Arg is an array, not a linked list.
4122         * modechange.c: Include stat-macros.h, xalloc.h.
4123         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4124         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4125         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4126         Remove.  This is now stat-macros.h's job.
4127         (talloc): Remove.  All callers replaced by xalloc, so that
4128         our invokers don't have to worry about reporting memory failures.
4129         (make_node_op_equals): Remove.
4130         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4131         New constants.
4132         (struct mode_change): Moved here from modechange.h.
4133         (mode_append_entry): Remove.
4134         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4135         apps to have incorrect behavior.  Use simpler algorithm for head
4136         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4137         Detect more invalid usages rather than having somewhat-random behavior.
4138         Don't insert an "a=" action, as that leads to incorrect behavior.
4139         (mode_compile, mode_create_from_ref): Return NULL on error instead
4140         of an enum, since now there's only one way to have an error.  All
4141         callers changed.
4142         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4143         at the correct time.  Simplify calculation of "+u" and its ilk.
4144         Don't mishandle "+X".
4145         (mode_free): Remove "register" and localize decls.
4146         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4147         (struct mode_change): Move to modechange.c; callers don't
4148         need to see this stuff.
4149         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4150         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4151         (mode_change, mode_adjust): Reflect the new signatures noted above.
4152         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4153         that might redefine system include files.
4154         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4155         (my_usleep): Use NULL rather than (void *) 0.
4156         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4157         Use siginterrupt to specify that system calls should be interrupted.
4158         (rpl_nanosleep): Move initialization of suspended closer to call of
4159         my_usleep.
4160         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4161         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4162         (desirable_utmp_entry): New function.
4163         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4164         using x2nrealloc, to simplify logic.
4165         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4166         size calculation.  Do not assume utmp file is a regular file.
4167         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4168         (READ_UTMP_CHECK_PIDS): New constant.
4169         * save-cwd.c: Include unistd-safer.h.
4170         (save_cwd): Use fd_safer.
4171         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4172         [!_LIBC] Include "stat-macros.h" instead.
4173         * unistd-safer.h (fd_safer): New decl.
4174
4175 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4176
4177         * byteswap_.h: New file.
4178
4179 2005-04-25  Albert Chin  <china@thewrittenword.com>
4180
4181         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4182         Toolkit C bug.
4183
4184 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4185
4186         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4187         that "UTC +1 second" continues to work.  Problem reported
4188         by Dmitry V. Levin.
4189         (relunit_snumber): New rule.
4190         (relunit): Use it.
4191
4192 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4193
4194         * getdate.y (universal_time_zone_table): New constant.
4195         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4196         universal_time_zone_table.
4197         (lookup_zone): Prefer universal_time_zone_table to
4198         local_time_zone_table, so that "GMT" time stamps are allowed in
4199         London during the summer.  Problem reported by Ian Abbott.
4200
4201 2005-04-12  Jim Meyering  <jim@meyering.net>
4202
4203         * human.c (humblock): Set *options even when returning due to
4204         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4205         warning from gcc-4.
4206
4207 2005-04-09  Jim Meyering  <jim@meyering.net>
4208
4209         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4210         -Wuninitialized: initialize tm0.tm_year.
4211
4212 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4213
4214         * getdate.y (parser_control): rels_seen is now a boolean, not a
4215         count, since there's no maximum.  All uses changed.
4216         Add member dsts_seen.
4217         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4218         not being INT_MAX.
4219         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4220         Use pc_rels_seen to decide whther a date is absolute.
4221
4222         * getdate.y (number): Don't overwrite year.
4223         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4224         check.
4225
4226 2005-04-02  Simon Josefsson  <jas@extundo.com>
4227
4228         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4229         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4230
4231 2005-03-27  Jim Meyering  <jim@meyering.net>
4232
4233         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4234
4235 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4236
4237         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4238         "one's complement" -> "ones' complement" in comment, as per Knuth.
4239         "value of type" -> "type or expression" in comment.
4240         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4241
4242 2005-03-26  Jim Meyering  <jim@meyering.net>
4243
4244         Comment nits.
4245         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4246         Correct typos: s/or/of/.
4247
4248 2005-03-23  Jim Meyering  <jim@meyering.net>
4249
4250         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4251
4252 2005-03-21  Jim Meyering  <jim@meyering.net>
4253
4254         Changes imported from coreutils.
4255
4256         * cycle-check.c: Don't include xalloc.h.
4257
4258         * path-concat.c: Don't include assert.h.
4259         (path_concat): Remove assertion that would have triggered
4260         for ABASE starting with more than one slash.
4261         Reported by Andreas Schwab.
4262
4263         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4264         properly when ABASE is an absolute file name.
4265         Correct the description of this function.
4266         Include <assert.h>.
4267         Add an assertion and a test driver.
4268         This fixes a bug introduced on 2004-07-02.
4269         Andreas Schwab reported the resulting failure of cp --parents:
4270         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4271
4272 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4273
4274         * strftime.c (my_strftime): If the underlying strftime returns 0
4275         (which shouldn't happen), generate nothing instead of returning 0
4276         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4277
4278 2005-03-16  Bruno Haible  <bruno@clisp.org>
4279
4280         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4281
4282 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4283
4284         * strftime.c (my_strftime): Prepend space to format so that we can
4285         reliably distinguish strftime failure from empty output on POSIX
4286         hosts.
4287
4288 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4289
4290         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4291         (iconv_string): Don't guess a size-zero buffer, as that might cause
4292         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4293         result would be 'too large', where 'too large' is (heuristically)
4294         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4295         overflow concerns.  This will prevent some unwanted malloc failures
4296         when the inputs are very large.
4297
4298 2005-03-15  Bruno Haible  <bruno@clisp.org>
4299
4300         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4301         'negate'.
4302
4303         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4304         variable.
4305
4306         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4307
4308 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4309
4310         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4311         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4312         intprops.h.
4313         * strtol.c: Likewise.
4314
4315 2005-03-14  Simon Josefsson  <jas@extundo.com>
4316
4317         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4318         <fx@gnu.org>.
4319
4320 2005-03-14  Jim Meyering  <jim@meyering.net>
4321
4322         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4323         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4324         to be nonzero so that we (and caller) can detect the difference
4325         between a valid zero-length expansion and an error return, even
4326         when the underlying strftime fails before writing anything into
4327         that location.
4328
4329 2005-03-10  Jim Meyering  <jim@meyering.net>
4330
4331         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4332         so that this module works on systems without fchdir.
4333
4334 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4335
4336         Factor int-properties macros into a single file, except for
4337         glibc-related files.
4338         * intprops.h: New file.
4339         * getloadavg.c: Include it instead of limits.h.
4340         (INT_STRLEN_BOUND): Remove.
4341         * human.c: Include intprops.h.
4342         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4343         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4344         * inttostr.h: Include intprops.h instead of limits.h.
4345         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4346         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4347         for consistency with intprops.h.
4348         (time_t_is_integer, twos_complement_arithmetic): Use them.
4349         * sig2str.h: Include <signal.h>, intprops.h.
4350         (INT_STRLEN_BOUND): Remove.
4351         * strftime.c (TYPE_SIGNED): Remove.
4352         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4353         * strtol.c: Adjust comments to match intprops.h.
4354         * userspec.c: Include intprops.h.
4355         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4356         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4357         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4358         instead of rolling our own expressions.
4359         * xstrtol.c: Include xstrtol.h first, to test interface.
4360
4361         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4362         instead of int.
4363         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4364         the right thing even if adding 1900 would overflow.  Similarly
4365         for tm_mon + 1 and tm_yday + 1.
4366         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4367         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4368         (DO_SIGNED_NUMBER): New macro.
4369         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4370
4371 2005-03-07  Bruno Haible  <bruno@clisp.org>
4372
4373         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4374
4375 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4376             Bruno Haible  <bruno@clisp.org>
4377
4378         * pagealign_alloc.h: New file.
4379         * pagealign_alloc.c: New file.
4380
4381 2005-01-28  Bruno Haible  <bruno@clisp.org>
4382
4383         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4384         stpncpy.c uses it.
4385
4386 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4387
4388         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4389         The workaround isn't strictly needed for POSIX conformance, and
4390         it's too much of a pain to configure and maintain.  We'll ask
4391         people to fix their kernels instead.
4392         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4393         (NANOSLEEP_BUG_WORKAROUND): Remove.
4394         (xnanosleep): Remove the workaround.
4395
4396 2005-02-12  Bruno Haible  <bruno@clisp.org>
4397
4398         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4399
4400 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4401
4402         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4403         * timespec.h (gettime): Return void, since it always
4404         succeeds now.  All uses changed.
4405         * gettime.c (gettime) Likewise.
4406         [HAVE_NANOTIME]: Prefer nanotime.
4407         Assume gettimeofday succeeds, as POSIX requires.
4408         Assime time () succeeds, since other code already does.
4409         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4410         (timespec_subtract): Remove.
4411         (NANOSLEEP_BUG_WORKAROUND): New constant.
4412         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4413         things considerably.  Use it only on GNU/Linux hosts, since the
4414         workaround shouldn't be needed elsewhere.
4415
4416 2005-02-24  Bruno Haible  <bruno@clisp.org>
4417
4418         * gettext.h: Update from GNU gettext 0.14.2.
4419
4420 2005-02-24  Bruno Haible  <bruno@clisp.org>
4421
4422         * localcharset.c: Update from GNU gettext 0.14.2.
4423         * config.charset: Update from GNU gettext 0.14.2.
4424
4425 2005-02-22  Simon Josefsson  <jas@extundo.com>
4426
4427         * iconvme.h, iconvme.c: New files, from libc.
4428
4429 2005-02-20  Neil Conway  <neilc@samurai.com>
4430
4431         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4432         returned by OSX/Darwin if the specified buffer is not large
4433         enough for the hostname.
4434
4435 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4436
4437         * memrchr.h: New file.
4438         * chdir-long.c: Include it.
4439         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4440         Don't bother including stddef.h.
4441
4442 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4443
4444         * argp-help.c (__argp_help): Create a fake struct argp_state and
4445         pass it to _help, otherwise the latter coredumps trying to
4446         dereference state.root_argp.
4447
4448 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4449
4450         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4451         inclusion.
4452         Include <sys/types.h>, for dev_t.
4453         (ME_DUMMY, ME_REMOTE): Move from here....
4454         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4455         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4456         Dmitry V. Levin.
4457         Include mountlist.h first, to test the interface.
4458
4459 2005-01-29  Bruno Haible  <bruno@clisp.org>
4460
4461         * progname.c (program_name): Initialize.
4462         Needed when linking statically on MacOS X.
4463
4464 2005-01-28  Bruno Haible  <bruno@clisp.org>
4465
4466         * javacomp.sh.in: New file, from GNU gettext.
4467         * javacomp.h: New file, from GNU gettext.
4468         * javacomp.c: New file, from GNU gettext.
4469
4470 2005-01-26  Bruno Haible  <bruno@clisp.org>
4471
4472         * javaexec.sh.in: New file, from GNU gettext.
4473         * javaexec.h: New file, from GNU gettext.
4474         * javaexec.c: New file, from GNU gettext.
4475
4476 2005-01-26  Simon Josefsson  <jas@extundo.com>
4477
4478         * gai_strerror.c: Use GPL in header.
4479
4480 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4481
4482         * argp-help.c (hol_entry_help): Avoid using non-constant
4483         initializers for struct pentry_state.
4484         (__argp_error): Check return value of __asprintf
4485         (__argp_failure): Translate error message
4486
4487         * argp-parse.c: Removed braces around the expansion of N_()
4488
4489 2005-01-21  Jim Meyering  <jim@meyering.net>
4490
4491         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4492         same value as for Solaris 9.
4493
4494         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4495         component length.  This included changing the parameter to be
4496         of type `char *' rather than `char const *'.
4497         * chdir-long.h (chdir_long): Update prototype.
4498
4499         * openat.c (fdopendir, fstatat): New functions.
4500         * openat.h: Include headers required for use of DIR and struct stat.
4501         [AT_SYMLINK_NOFOLLOW]: Define.
4502         (fdopendir, fstatat): Add prototypes.
4503
4504 2005-01-21  Bruno Haible  <bruno@clisp.org>
4505
4506         * classpath.h: New file, from GNU gettext.
4507         * classpath.c: New file, from GNU gettext.
4508
4509 2005-01-20  Simon Josefsson  <jas@extundo.com>
4510
4511         * version-etc-fsf.c: New file, with version_etc_copyright.
4512         * version-etc.c: Remove version_etc_copyright.
4513         * version-etc.h (version_etc_copyright): Use [] instead of * in
4514         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4515
4516 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4517
4518         * save-cwd.c (save_cwd): Remove code to support the case
4519         where fchdir is missing or flaky.
4520
4521 2005-01-20  Simon Josefsson  <jas@extundo.com>
4522
4523         * base64.h (isbase64): Add.
4524
4525         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4526         using a unsigned prototype, don't inline.
4527         (base64_decode): Use it.
4528
4529 2005-01-19  Bruno Haible  <bruno@clisp.org>
4530
4531         * sh-quote.h: New file, from GNU gettext.
4532         * sh-quote.c: New file, from GNU gettext.
4533
4534 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4535
4536         Merge changes from coreutils, as described below in several
4537         changelogs dated today.
4538
4539         * save-cwd.c: Include "save-cwd.h" before other include files.
4540         (O_DIRECTORY): Remove; not needed here, since "." must be
4541         a directory.  All uses removed.
4542         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4543         universal on Suns, and we also need to test for IRIX.
4544         Revamp code to use 'if' rather than '#if'.
4545         Avoid unnecessary comparison of cwd->desc to 0.
4546
4547         * utimens.c (futimens): Robustify the previous patch, by checking
4548         for known valid error numbers rather than observed invalid ones.
4549
4550 2005-01-18  Jim Meyering  <jim@meyering.net>
4551
4552         * version-etc.c (version_etc_copyright): Update copyright date.
4553
4554         * utimens.c (futimens): Account for the fact that futimes
4555         can also fail with errno == ENOSYS or errno == ENOENT.
4556         Patch from Dmitry V. Levin.
4557
4558         Change the name of the robust chdir function from chdir to chdir_long.
4559         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4560         (restore_cwd): Use chdir_long, not chdir.
4561         * chdir-long.c: Renamed from chdir.c.
4562         * chdir-long.h: Renamed from chdir.h.
4563         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4564         Hurd.
4565
4566 2005-01-18  Bob Proulx  <bob@proulx.com>
4567
4568         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4569         offsetof() macro construct to avoid compile failure with native HP-UX
4570         11.0 ANSI C compiler.
4571
4572 2005-01-06  Bruno Haible  <bruno@clisp.org>
4573
4574         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4575         because stpncpy.m4 takes care of it.
4576
4577 2004-01-24  Bruno Haible  <bruno@clisp.org>
4578
4579         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4580
4581 2003-10-09  Bruno Haible  <bruno@clisp.org>
4582
4583         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4584
4585 2005-01-06  Bruno Haible  <bruno@clisp.org>
4586
4587         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4588         * fwriteerror.c: Include <stdbool.h>.
4589         (fwriteerror): At the end, close the file stream. Record whether
4590         stdout was already closed.
4591
4592 2004-05-27  Bruno Haible  <bruno@clisp.org>
4593
4594         * execute.c (environ): Declare if needed.
4595         * pipe.c (environ): Likewise.
4596         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4597
4598 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4599
4600         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4601         definitions to be after all include files, to avoid collisions.
4602         Problem reported by Bob Proulx.
4603
4604 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4605
4606         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4607         not needed.  This removes a dependency on the gettext module.
4608         [defined _LIBC]: Do not include <libintl.h>; not needed.
4609
4610 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4611
4612         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4613         HAVE_DECL_STRTOLD.
4614
4615 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4616
4617         * argp-parse.c: Include <stddef.h>.
4618         (alignof, alignto): New macros.
4619         (parser_init): Don't assume that void * is aligned sufficiently
4620         for struct option.
4621
4622         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4623         need to extend the stack.
4624         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4625         large.
4626
4627 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4628
4629         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4630
4631 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4632
4633         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4634         Remove now-obsolete comment about AIX.
4635         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4636         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4637         (YYMAXDEPTH): New macro.
4638
4639 2004-12-18  Bruno Haible  <bruno@clisp.org>
4640
4641         * fatal-signal.c (fatal_signals): Make non-const.
4642         (init_fatal_signals): New function.
4643         (uninstall_handlers, install_handlers): Ignore signals that were set to
4644         SIG_IGN.
4645         (at_fatal_signal): Call init_fatal_signals.
4646         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4647         SIG_IGN.
4648         Reported by Paul Eggert.
4649
4650 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4651
4652         * getdate.y (textint): New member "negative".
4653         (time_zone_hhmm): New function.
4654         Expect 14 shift-reduce conflicts, not 13.
4655         (o_colon_minutes): New rule.
4656         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4657         (yylex): Set the "negative" member of signed numbers.
4658
4659 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4660
4661         Changes imported from coreutils.
4662         * hard-locale.c: Assume <locale.h> exists.
4663         Include "strdup.h".
4664         (GLIBC_VERSION): New macro.
4665         (hard_locale): Assume setlocale exists.
4666         Rewrite to avoid #ifdef.
4667         Use strdup rather than malloc + strcpy.
4668         * human.c: Assume <locale.h> exists.
4669         (human_readable): Assume localeconv exists.
4670
4671 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4672
4673         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4674         convert T2, not T.  (Imported from libc.)
4675
4676 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4677
4678         * getcwd.c (is_ENAMETOOLONG): New macro.
4679         (__getcwd.c): Don't restore errno; glibc doesn't.
4680         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4681         first, falling back to our code only if its results look suspicious.
4682         Ensure that the resulting buffer is only as large as necessary.
4683
4684         * readutmp.c: Include readutmp.h first.
4685         Include <errno.h>, since readutmp.h no longer does that.
4686         * readutmp.h: Don't include <errno.h>,
4687         <sys/param.h>, <time.h>; not needed to establish interface.
4688         (errno): Remove decl.
4689         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4690         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4691         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4692
4693 2004-11-28  Simon Josefsson  <jas@extundo.com>
4694
4695         * base64.h, base64.c: New file.
4696
4697 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4698
4699         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4700
4701 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4702
4703         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4704         HP's ANSI C compiler.
4705         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4706         Declaring int functions causes warnings on some modern systems and
4707         shouldn't be needed to compile on ancient ones.
4708         * same.c (MIN) [defined MIN]: Don't define, since it's already
4709         defined.
4710
4711         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4712         with the following changes.
4713         (__set_errno): Parenthesize properly.
4714         Include <stdbool.h>.
4715         (MIN, MAX, MATCHING_INO): New macros.
4716         (__getcwd): Define with prototype, not K&R form.
4717         Use heuristics to allocate default buffer on stack if possible.
4718         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4719         behavior, and to avoid the PATH_MAX limit when computing
4720         ../../../../...
4721         Use MATCHING_INO to compare inode number to file.
4722         Check for arithmetic overflow in size calculations.
4723         Fix bug in reallocation of dot array that caused getcwd to fail
4724         on directories nested deeper than 75.
4725         Be more careful about saving errno on error.
4726         Do not use realloc; use only free+malloc, as this is a bit
4727         more flexible and avoids a needless copy operation.
4728         Do not inspect st_dev and st_ino for symbolic links; POSIX
4729         doesn't specify the latter.
4730         Check for closedir errors.
4731         Avoid needless casts.
4732         Use "#ifdef weak_alias" around weak_alias, to be like other
4733         glibc code.
4734         The following changes to getcwd.c have effect only when used in
4735         gnulib; they have no effect inside glibc proper.
4736         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4737         as alloca isn't used.
4738         (alloca, __alloca): Likewise.
4739         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4740         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4741         unconditionally, as gnulib assumes C89 or better.
4742         Do not include <sys/param.h>.
4743         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4744         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4745         better.
4746         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4747         Include <dirent.h> in a way that is compatible with modern Autoconf.
4748         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4749         New macros, if not already defined.
4750         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4751         Use "_LIBC", not "defined _LIBC", for consistency.
4752         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4753         a mempcpy module.
4754         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4755         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4756         * xgetcwd.c: David MacKenzie's old code was removed, so give
4757         credit only to Jim Meyering and adjust the copyright dates.
4758         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4759         <stdlib.h>, <unistd.h>, "pathmax.h".
4760         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4761         (INITIAL_BUFFER_SIZE): Remove.
4762         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4763
4764 2004-11-23  Jim Meyering  <jim@meyering.net>
4765
4766         * getopt_.h: Remove trailing blanks.
4767
4768 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4769
4770         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4771         (futimens): New function, which uses futimes if available.
4772         (futimens, utimens): Support timespec==NULL, with same semantics
4773         as utime and utimens.
4774         * utimens.h (futimens): New decl.
4775
4776 2004-11-23  Jim Meyering  <jim@meyering.net>
4777
4778         * __fpending.c: Add comment.
4779
4780 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4781
4782         * getopt_.h: Re-addition of __getopt_argv_const caused
4783         redefinition warnings. To avoid them, include the defines
4784         in `#if !defined __need_getopt ... #endif'. The only place
4785         where __getopt_argv_const is used is in definitions
4786         of getopt_long and getopt_long_only below, which are as well
4787         protected by `#ifndef __need_getopt'.
4788         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4789         __need_getopt after including <stdio.h> and <unistd.h> These
4790         headers might have defined it.
4791
4792 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4793
4794         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4795         New macros.
4796         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4797         optopt): Use them instead of invoking ## directly; otherwise, the
4798         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4799
4800 2004-11-19  Bruno Haible  <bruno@clisp.org>
4801
4802         * strtok_r.c: Move comments from here...
4803         * strtok_r.h: ... to here.
4804
4805 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4806
4807         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4808         might fail.  Problem reported by Yoann Vandoorselaere.
4809         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4810         that mishandle size_t overflow.
4811
4812 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4813
4814         * canon-host.c: Include "strdup.h".
4815         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4816         Use strdup instead of malloc/strcpy to duplicate strings.
4817
4818         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4819         (human_space_before_unit): New constant.
4820         * human.c (human_readable): Support it.
4821
4822         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4823         (xgetcwd): Set errno correctly when failing.
4824         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4825         the failure is actually due to a PATH_MAX problem.
4826
4827         Further getopt changes to make it more likely that glibc will
4828         buy the changes back.
4829         * getopt.c (POSIXLY_CORRECT): New constant.
4830         (getopt): Use it, so to preserve glibc semantic
4831         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4832         when compiling for libc.
4833         * getopt_.h (__getopt_argv_const): Bring it back.
4834         (getopt_long, getopt_long_only): Use it.
4835
4836         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4837         New arg POSIXLY_CORRECT.  All callers changed.
4838         (getopt): Argv is now char * const *, as per standard.
4839         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4840         not char *__getopt_argv_const *.
4841         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4842         _getopt_long_only_r): Likewise.
4843         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4844         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4845         _getopt_long_r, _getopt_long_only_r): Likewise.
4846         * getopt_.h (__getopt_argv_const): Remove.
4847         (getopt): Argv is now char * const *, as per standard.
4848
4849         * getdate.y (tORDINAL): New token.
4850         (day, relunit): Allow it for relative times.
4851         (relative_time_table): Use tORDINAL for ordinals.
4852
4853 2004-11-15  Jim Meyering  <jim@meyering.net>
4854
4855         * closeout.c: Include "__fpending.h" once again.
4856         Include <stdbool.h>.
4857         (close_stdout): Don't fail just because stdout was closed initially,
4858         since some programs don't write to stdout in the normal course of
4859         operation (other than --version and --help), and we don't want this
4860         function to make e.g. `touch file >&-' fail.
4861         But do fail if it was closed and someone has tried to write to it.
4862         E.g., `printf foo >&-' must fail.
4863
4864 2004-11-11  Simon Josefsson  <jas@extundo.com>
4865
4866         * strtok_r.h, strtok_r.c: New file.
4867
4868 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4869
4870         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4871         we can stop lying to compilers about the constness of argv when we
4872         are compiled outside glibc.
4873         (getopt, getopt_long, getopt_long_only): Use it.
4874         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4875         getopt): Likewise.
4876         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4877         _getopt_long_only_r): Likewise.
4878         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4879         _getopt_long_only_r): Likewise.
4880
4881         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4882         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4883         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4884         the other external symbols.
4885         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4886         declaration, since the above renaming now works around collisions.
4887
4888 2004-11-11  Jim Meyering  <jim@meyering.net>
4889
4890         * linebreak.c: Remove trailing blanks.
4891         * alloca_.h: Likewise.
4892         * acosl.c: Likewise.
4893         * euidaccess.c: Likewise.
4894         * allocsa.h: Likewise.
4895
4896 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4897
4898         * mktime.c (SHR): New macro, which is a portable
4899         substitute for >> that should work even on Crays.
4900         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4901         Problem reported by Mark D. Baushke in
4902         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4903         * getdate.y (SHR): Likewise.
4904         (tm_diff): Use it.
4905         * strftime.c (SHR): Likewise.
4906         (tm_diff): Use it.
4907         * quotearg.c (struct quoting_options): Use unsigned int for
4908         quote_these_too, so that right shifts are well defined.  All uses
4909         changed.
4910
4911 2004-11-10  Simon Josefsson  <jas@extundo.com>
4912
4913         * getaddrinfo.h, getaddrinfo.c: New files.
4914
4915 2004-11-10  Jim Meyering  <jim@meyering.net>
4916
4917         Ensure that no close failure goes unreported.
4918         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4919         return early when it seems there's nothing to flush.
4920         Don't include __fpending.h.
4921
4922 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4923
4924         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4925
4926 2004-11-05  Bruno Haible  <bruno@clisp.org>
4927
4928         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4929         Reported by Mark D. Baushke <mdb@cvshome.org>.
4930
4931 2004-11-04  Bruno Haible  <bruno@clisp.org>
4932
4933         2004-09-11  Bruno Haible  <bruno@clisp.org>
4934                 * allocsa.valgrind: New file.
4935         2004-02-06  Bruno Haible  <bruno@clisp.org>
4936                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4937                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4938                 Reported by Christopher Seip <chris.seip@hp.com>.
4939
4940 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4941
4942         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4943         with errno == ERANGE if the buffer is too small.
4944         Problem reported by Mark D. Baushke.
4945
4946 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4947
4948         * xreadlink.c (MAXSIZE): New macro.
4949         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4950         size does not exceed MAXSIZE.  Avoid cast.
4951         As suggested by Mark D. Baushke in
4952         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4953         if readlink fails with buffer size just under MAXSIZE, try again
4954         with MAXSIZE.
4955
4956 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4957         and  Paul Eggert  <eggert@cs.ucla.edu>
4958
4959         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4960         (get_date): Overparenthesize to avoid GCC warning.
4961
4962 2004-11-02  Bruno Haible  <bruno@clisp.org>
4963
4964         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4965         function returns void.
4966
4967 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4968
4969         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4970         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4971         already declared.
4972
4973 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4974
4975         * getdate.y: Add support for TZ="foo" within a date string.
4976         Fix some bugs near time_t boundaries.  Reject dates with
4977         out-of-range components, e.g., "Sept 31".
4978         Include <stdlib.h>, "setenv.h", "xalloc.h".
4979         (ISDIGIT_LOCALE): Remove; unused.
4980         Note that the TZ and time functions used here are not reentrant.
4981         (mktime_ok, get_tz): New functions.
4982         (TZBUFSIZE): New constant.
4983         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4984         This requires that we sometimes generate our own TZ="XXX..." setting.
4985
4986 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4987
4988         * mktime.c (not_equal_tm): Remove redundant check.
4989
4990 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4991
4992         * getdate.y: Use Bison 1.875 features, and some minor
4993         code cleanups.  This change does not affect semantics.
4994         Don't include <stdlib.h>; no longer needed.
4995         Don't include unlocked-io.h; only the "#if TEST" code uses
4996         stdio, and performance isn't crucial there.
4997         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4998         Bison 1.875 features as described below.
4999         All uses of "PC." replaced by "pc->".
5000         (YYSTYPE): Add a forward declaration.
5001         (yylex, yyerror): Use full prototypes in forward decls.
5002         Use "%pure-parser" rather than obsolescent "%pure_parser".
5003         Use %parse-param and %lex-param instead of obsolescent
5004         YYPARSE_PARAM and YYLEX_PARAM.
5005         (meridian_table, month_and_day_table, time_units_table,
5006         relative_time_table, time_zone_table, military_table,
5007         lookup_zone, lookup_word, get_date):
5008         Use NULL instead of 0 where appropriate.
5009         (to_hour): Avoid abort (), to avoid a dependency on
5010         stdlib.h.
5011         (yyerror, yylex): Now accepts parser_control * arg.
5012         (main) [TEST]: Use '\0' rather than 0 for char.
5013
5014 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5015
5016         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5017         It's now the caller's responsibility to handle the case where
5018         !HAVE_GETPAGESIZE && !defined getpagesize.
5019
5020         * mktime.c (leapyear): Arg is long int, not int.
5021
5022 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5023
5024         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5025
5026 2004-10-12  Simon Josefsson  <jas@extundo.com>
5027
5028         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5029         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5030         to real functions.
5031
5032 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5033
5034         * vsnprintf.h: New file.
5035         * vsnprintf.c: New file.
5036
5037 2004-10-07  Bruno Haible  <bruno@clisp.org>
5038
5039         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5040         into the provided buffer.
5041
5042 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5043
5044         * diacrit.c, diacrit.h: Add GPL notice.
5045
5046         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5047         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5048         * logl.c (logl): Keep the code as similar to glibc as possible.
5049         This avoids a potential constant-folding bug.
5050
5051 2004-10-05  Bruno Haible  <bruno@clisp.org>
5052
5053         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5054
5055 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5056
5057         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5058         * xmalloc.c (xmemdup): Likewise.
5059         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5060         XFREE): Remove these long-obsolescent macros.
5061         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5062         * xstrdup.c: Remove.
5063
5064         * regex.c (re_comp): Cast gettext return value to char *,
5065         Problem reported by Martin Neitzel via Mark D. Baushke.
5066
5067 2004-10-04  Simon Josefsson  <jas@extundo.com>
5068
5069         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5070         '#ifdef USE_UNLOCKED_IO'.
5071
5072 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5073
5074         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5075         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5076         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5077         regex.c, sha1.c, version-etc.c, yesno.c:
5078         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5079         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5080         the includer's responsibility.
5081
5082         Sync from coreutils.
5083
5084         * modechange.c (mode_compile): Don't decrement a pointer that
5085         points to the start of a string, as the C Standard says the
5086         resulting behavior is undefined.
5087
5088         * backupfile.h (enum backuptype): Rename none -> no_backups,
5089         simple -> simple_backups, numbered_existing ->
5090         numbered_existing_backups, numbered -> numbered_backups
5091         to avoid shadowing problems.  All uses changed.
5092         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5093         * backupfile.c (check_extension, numbered_backup):
5094         Rename locals to avoid shadowing 'basename'.
5095         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5096         once.
5097
5098         * .cppi-disable: Add getopt_.h, getopt_int.h.
5099         * .cvsignore: Add getopt.h.
5100
5101 2004-10-04  Simon Josefsson  <jas@extundo.com>
5102
5103         * memmem.h: New file.
5104         * memmem.c: New file, taken from glibc.
5105
5106 2004-10-02  Jim Meyering  <jim@meyering.net>
5107
5108         * dirfd.h, getpagesize.h: Add copyright notice.
5109
5110 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5111
5112         * snprintf.c: Remove comments as to why each header is needed.
5113
5114 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5115
5116         * strsep.h: New file.
5117         * strsep.c: New file.
5118
5119 2004-10-01  Simon Josefsson  <jas@extundo.com>
5120
5121         * snprintf.c (snprintf): Handle size==0.
5122
5123 2004-10-01  Simon Josefsson  <jas@extundo.com>
5124             Bruno Haible  <bruno@clisp.org>
5125
5126         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5127         (snprintf): Declare 'args'.
5128
5129 2004-09-30  Simon Josefsson  <jas@extundo.com>
5130
5131         * snprintf.h, snprintf.c: New files.
5132
5133 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5134
5135         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5136         (hol_entry_help): Never translate an empty string.
5137         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5138         * argp.h (OPTION_NO_TRANS): New option.
5139
5140 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5141
5142         * xvasprintf.c: Include xalloc.h.
5143         (xvasprintf): Use xalloc_die, not xmalloc_die.
5144
5145 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5146
5147         * dummy.c: Change copyright notice to FSF, and license to GPL.
5148
5149 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5150
5151         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5152         Problem reported by Bruno Haible in:
5153         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5154
5155 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5158         in case some system header has #define'd it.  Problem reported by
5159         Soeren D. Schulze in
5160         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5161
5162 2004-09-08  Bruno Haible  <bruno@clisp.org>
5163
5164         * stdint_.h: New file, taken from GNU clisp.
5165
5166 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5167
5168         * xvasprintf.h: New file.
5169         * xvasprintf.c: New file.
5170         * xasprintf.c: New file.
5171
5172 2004-09-08  Bruno Haible  <bruno@clisp.org>
5173
5174         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5175         is > INT_MAX.
5176         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5177
5178 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5179
5180         Import from coreutils.
5181         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5182         strings on unbounded length.  alloca's performance benefits aren't
5183         that important here.
5184         (V_STRDUP): Remove.
5185         (parse_with_separator): New function, with most of the internals
5186         of the old parse_user_spec.  Allow user to omit both user and group,
5187         for compatibility with FreeBSD.
5188         Clone only the user name, not the entire spec.
5189         Do not set *uid, *gid unless entirely successful.
5190         Avoid memory leak in some failing cases.
5191         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5192         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5193         (parse_user_spec): Rewrite to use parse_with_separator.
5194
5195 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5196
5197         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5198         its complicated substitute.
5199         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5200         and program_invocation_name.
5201         (__argp_basename) [!_LIBC]: Remove; the only use was
5202         replaced by its body.
5203         (__argp_short_program_name): Change condition from
5204         !defined __argp_short_program_name to
5205         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5206         to match argp-namefrob.h.
5207         (__argp_failure): Don't assume strerror_r returns char *.
5208         * argp-parse.c (N_): Define unconditionally.
5209         (argp_default_options): Fill out initializers with 0 to avoid
5210         gcc warnings.
5211
5212 2004-08-12  Simon Josefsson  <jas@extundo.com>
5213
5214         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5215         * getopt_.h: Renamed from getopt.h.
5216
5217 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5218
5219         Merge from coreutils.
5220
5221         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5222         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5223         for Reliant Unix 5.43.
5224
5225         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5226         (union fooround): Use uintmax_t, not long int.
5227         The rest is a merge from libc:
5228         [defined _LIBC]: Include <shlib-compat.h>.
5229         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5230
5231         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5232
5233         * strverscmp.c: Convert to UTF-8.
5234
5235 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5236
5237         * obstack.h (obstack_empty_p):
5238         Don't assume that chunk->contents is suitably aligned.
5239         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5240         Likewise. Problem reported by Benno in
5241         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5242
5243         * chown.c (rpl_chown): Work even if the file is writeable but not
5244         readable.  This could be improved further but it'd take some work.
5245
5246 2004-08-08  Simon Josefsson  <jas@extundo.com>
5247
5248         * xgethostname.c: Don't include error.h (not used).
5249
5250         * getpass.h: Add.
5251         * getpass.c: Include getpass.h first.
5252
5253 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5254
5255         * xalloc-die.c: New files.
5256         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5257         All uses removed.
5258         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5259         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5260         (_, N_, xalloc_die): Move to xalloc-die.c.
5261         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5262         so that we needn't mess with xalloc_msg_memory_exhausted.
5263
5264         * sha1.h: Renamed from sha.h.
5265         (SHA1_H): Renamed from _SHA_H.
5266         (sha1_ctx): Renamed from sha_ctx.
5267         (sha1_init_ctx): Renamed from sha_init_ctx.
5268         (sha1_process_block): Renamed from sha_process_block.
5269         (sha1_process_bytes): Renamed from sha_process_bytes.
5270         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5271         (sha1_read_ctx): Renamed from sha_read_ctx.
5272         (sha1_stream): Renamed from sha_stream.
5273         (sha1_buffer): Renamed from sha_buffer.
5274         * sha1.c: Likewise; renamed from sha.c.
5275         Do not include <sys/types.h>.
5276         Include <stddef.h> rather than <stdlib.h>.
5277
5278 2004-08-08  Bruno Haible  <bruno@clisp.org>
5279
5280         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5281         FILESYSTEM_PREFIX_LEN.
5282         * progreloc.c: Likewise.
5283         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5284
5285 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5286
5287         Merge from tar.
5288         * argp-help.c (make_hol, hol_append): Don't assume that
5289         SIZE_MAX is a valid preprocessor constant.
5290         (__argp_basename): Change from "#ifndef _LIBC"
5291         to "#ifndef __argp_short_program_name", so that
5292         we don't compile these functions for tar.
5293
5294         More merges from coreutils.
5295         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5296         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5297         yesno.h: New files.
5298         * addext.c: Remove; no longer needed.
5299         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5300         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5301         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5302         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5303         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5304         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5305         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5306         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5307         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5308         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5309         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5310         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5311         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5312         Import changes from coreutils.
5313
5314 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5315
5316         Merge from coreutils.
5317
5318         * .gdb-history: Remove; this doesn't belong here.
5319
5320         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5321         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5322         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5323
5324         * dirname.h: Include <stdbool.h>.
5325         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5326         for consistency with POSIX terminology.  All uses changed.
5327         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5328         (strip_trailing_slashes): Use bool for booleans.
5329         * stripslash.c (strip_trailing_slashes): Likewise.
5330
5331         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5332         sometimes returns a positive errno value even when it succeeds.
5333         (print_errno_message) [!LIBC]: Fall back on strerror if
5334         __strerror_r fails.
5335
5336         * path-concat.c (mempcpy): Don't define if a system header defines it.
5337         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5338         (longest_relative_suffix): New function.
5339         (path_concat): Use it.  Assume first argument is not NULL.
5340         Port to DOS.  Omit redundant separators.
5341         Report an error instead of returning NULL.
5342         Use mempcpy instead of memcpy.
5343         (xpath_concat): Remove: not declared or used.
5344
5345         * same.h: Include <stdbool.h>
5346         (same_name): Return bool, not int.
5347         * same.c (same_name): Likewise.
5348         (errno): Don't declare; we assume C89 or better now.
5349
5350         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5351         if not already defined.
5352
5353         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5354         * dup-safer.c (errno): Likewise.
5355
5356 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5357
5358         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5359         working.
5360
5361 2004-08-03  Simon Josefsson  <jas@extundo.com>
5362
5363         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5364         * progname.h: Don't include stdbool.h.
5365
5366 2004-08-02  Simon Josefsson  <jas@extundo.com>
5367
5368         * getsubopt.h: New file, with comments from Bruno Haible.
5369         * getsubopt.c: New file, from glibc, but slightly modified based on
5370         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5371
5372 2004-08-01  Simon Josefsson  <jas@extundo.com>
5373
5374         * xgetdomainname.c: Include stdlib.h, for free().
5375
5376 2004-07-16  Simon Josefsson  <jas@extundo.com>
5377
5378         * dummy.c: New file.
5379
5380 2004-07-16  Bruno Haible  <bruno@clisp.org>
5381
5382         * backupfile.h: Add extern "C" for C++.
5383         * closeout.h: Likewise.
5384         * copy-file.h: Likewise.
5385         * findprog.h: Likewise.
5386         * full-write.h: Likewise.
5387         * pathname.h: Likewise.
5388         * progname.h: Likewise.
5389         * stpcpy.h: Likewise.
5390         * stpncpy.h: Likewise.
5391         * strcase.h: Likewise.
5392         * strstr.h: Likewise.
5393         * xalloc.h: Likewise.
5394
5395         * mbswidth.h: Add extern "C" for C++.
5396         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5397
5398 2004-07-09  Simon Josefsson  <jas@extundo.com>
5399
5400         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5401         failed without this.)
5402
5403 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5404
5405         * fchown-stub.c: New file.
5406
5407 2004-06-24  Jim Meyering  <jim@meyering.net>
5408
5409         * obstack.h (obstack_base): Cast to (void *), per documentation.
5410
5411 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5412
5413         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5414
5415 2004-06-01  Jim Meyering  <jim@meyering.net>
5416
5417         * calloc.c: New file.
5418
5419 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5420
5421         * getdate.y (yylex): Allow space between sign and number.
5422         Problem reported by Dan Jacobson.
5423
5424 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5425         and  Jim Meyering  <jim@meyering.net>
5426
5427         Merge from coreutils CVS.
5428
5429         * stat-macros.h: New file, with contents from file-type.h
5430         and coreutils' system.h.
5431         * file-type.c: Include "stat-macros.h".
5432         * file-type.h (file_type): Move all macro definitions to new file,
5433         stat-macros.h.
5434
5435         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5436         Wrap old code with this conditional.
5437         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5438         function that does not dereference symlinks.
5439         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5440
5441         * xreadlink.c: Include xreadlink.h first, to catch .h file
5442         dependency problems.
5443         (xreadlink): Accept new arg SIZE, for efficiency.
5444         All decls and uses changed.
5445         * xreadlink.h: Include <stddef.h>, for size_t.
5446
5447         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5448         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5449
5450         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5451
5452 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5453
5454         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5455         macros to be defined.
5456         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5457         the allocator returns NULL because the requested size is zero.
5458
5459 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5460
5461         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5462         var.  Add comment explaining why libc still defines it.  This
5463         merges the following patch from glibc:
5464         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5465
5466 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5467
5468         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5469         present in glibc since revision 1.1 of this file.
5470         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5471         obstack_alignment_mask, obstack_alloc, obstack_base,
5472         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5473         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5474         obstack_grow0, obstack_init, obstack_int_grow,
5475         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5476         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5477         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5478         nonexistent functions.
5479
5480 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5481             Paul Eggert  <eggert@cs.ucla.edu>
5482
5483         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5484
5485 2004-05-14  Bruno Haible  <bruno@clisp.org>
5486
5487         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5488         that consists of a '.' followed by an empty digit string.
5489         Patch by Tor Lillqvist <tml@iki.fi>.
5490
5491 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5492
5493         Port obstack to the AS/400, where pointers are 16 bytes wide and
5494         you cannot cast an integer to a valid pointer.  This patch is
5495         currently waiting to be integrated into glibc; see
5496         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5497
5498         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5499         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5500         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5501         (struct obstack): temp member is now a union of a pointer and
5502         an integer, instead of an integer.  All integer uses changed.
5503         This does not affect the physical layout of struct obstack,
5504         except on hosts (like the AS/400) where the size or alignment of
5505         void * is greater than that of ptrdiff_t.
5506         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5507         __STDC__)]: Store temporary in pointer member of union, not
5508         integer member.
5509         * obstack.c: Include <stddef.h>, for offsetof.
5510         (struct fooalign): Remove; it doesn't need a name.
5511         (union fooround): Change double to long double, and add void *.
5512         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5513         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5514         not a macro.  Hence the values are always int; so remove all
5515         casts-to-int in uses.
5516
5517 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5518             Derek Price  <derek@ximbiot.com>
5519
5520         * alloca.c: Include <alloca.h>, to get our interface.
5521         * alloca_.h: Use __alloca on AIX, so that we don't have to
5522         include <alloca.h> first.  Use C89 prototype for alloca; this
5523         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5524         Use #elif for simplicity, since we can assume C89 now.
5525         Don't try to source the system alloca.h since it will not be found
5526         and to prevent recursively including its replacement.
5527         * fnmatch.c: Include <alloca.h> instead of opencoding.
5528         * regex.c: Likewise.
5529
5530 2004-05-16  Derek Price  <derek@ximbiot.com>
5531             Paul Eggert  <eggert@cs.ucla.edu>
5532
5533         getline cleanup.  This changes the getndelim2 API: both order of
5534         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5535         no delimiter).
5536
5537         * getline.c: Don't include stddef.h or stdio.h, since our
5538         interface does that.
5539         (getline): Always use getdelim, so that we don't have two
5540         copies of this code.
5541         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5542         if available.
5543         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5544         (GETNDELIM2_MAXIMUM): New macro.
5545         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5546         instead of the old practice of delim2==0.  All callers changed.
5547         Return -1 on overflow, instead of returning junk.
5548         Do not set *linesize unless allocation succeeds.
5549         * getndelim2.h: Do not include stddef.h; no longer needed, now
5550         that we include sys/types.h.
5551         * getnline.h: Likewise.
5552         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5553         (getndelim2): Reorder arguments.
5554         * getnline.c (getnline, getndelim):
5555         Don't discard the NMAX argument.
5556         (getnline): Invoke getndelim, to avoid code duplication.
5557         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5558         of (size_t) -1 by callers of the getnline family.
5559
5560 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5561
5562         * nanosleep.c (suspended): Change its type from int to
5563         sig_atomic_t volatile.
5564         (first_call): Make it private to rpl_nanosleep, and have it
5565         be zero initially as that's a bit faster.
5566         (my_usleep): Round up fractional times instead of truncating them,
5567         as this is the usual meaning for 'sleep'.
5568
5569         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5570         doesn't work.
5571         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5572         (ENOSYS): Define if not defined.
5573         (settime): Fall back on stime if it exists and settimeofday fails.
5574         But don't bother with fallbacks if a method fails with errno == EPERM.
5575
5576 2004-05-11  Jim Meyering  <jim@meyering.net>
5577
5578         Prior to this change, the save_cwd caller required read access to the
5579         current directory on most systems (ones with the fchdir function).
5580
5581         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5582         fails, try write-only, and finally, resort to using xgetcwd.
5583
5584 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5585
5586         * obstack.c, obstack.h: Import changes from libc.
5587
5588 2004-04-28  Bruno Haible  <bruno@clisp.org>
5589
5590         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5591         implicitly appends .exe to executables.
5592         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5593         accepts Windows pathnames.
5594         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5595         Cygwin like Windows, since it now accepts Windows pathnames.
5596         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5597         Cygwin like Windows, since it now accepts Windows pathnames.
5598         Reported by Derek Robert Price <derek@ximbiot.com>.
5599
5600 2004-04-20  Jim Meyering  <jim@meyering.net>
5601
5602         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5603
5604 2004-04-20  Jim Meyering  <jim@meyering.net>
5605             Bruno Haible  <bruno@clisp.org>
5606
5607         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5608         memory when realloc fails.
5609
5610 2004-04-18  Jim Meyering  <jim@meyering.net>
5611
5612         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5613         don't leak memory and do call END_UTMP_ENT.
5614
5615 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5616
5617         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5618         (CHAR_BIT): Remove, since we assume C89.
5619         Include <stdint.h> if available, as per current Autoconf CVS advice.
5620
5621 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5622
5623         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5624         not bool, to be more consistent with Unix conventions.
5625         Suggested by Bruno Haible.
5626
5627         Merge from coreutils.
5628
5629         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5630         New files.
5631
5632         * getdate.h: Include stdbool.h, and timespec.h instead of
5633         the usual <time.h> dance.
5634         (get_date): Change signature to support fractional time stamps.
5635         All callers changed.
5636         * getdate.y: Include "getdate.h" first, as we can now
5637         assume C89 and don't need to worry about 'const'.
5638         Similarly, include "unlocked-io.h" near start, not in middle.
5639         Include <limits.h>.
5640         (textint.value): Use long int rather than int.
5641         (textint.digits): Use size_t rather than int.
5642         (BILLION, LOG10_BILLION): New constants.
5643         (parser_control): New member rel_ns.  Members day_ordinal,
5644         time_zone, month, day, hour, minutes, rel_year, rel_month,
5645         rel_day, rel_hour, rel_minutes, rel_seconds
5646         are now long int, not int.  Member seconds is now struct timespec,
5647         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5648         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5649         not int.
5650         (%union.intval): Now long int, not int.
5651         New member timespec.
5652         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5653         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5654         (spec): Now is a timespec or an item list.
5655         (timespec, items): New nonterminals.
5656         (time, rel, relunit, number, get_date):
5657         Add support for fractional seconds.
5658         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5659         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5660         (to_hour): First arg is now long int, not int.
5661         (to_year): Returns long int, not int.
5662         Don't treat year -70 like 70.
5663         (tm_diff): Returns long int, not int.
5664         (lookup_word): Use bool instead of int when appropriate.
5665         (yylex): Use size_t for count, not int.
5666         Detect overflow when parsing large integer constants.
5667         Add support for fractions.
5668         (get_date): Make pointers 'const' if possible.
5669         Use more-portable code to detect integer overflow.
5670         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5671         Don't use ctime; it's not reliable if the year has >4 digits.
5672
5673         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5674         This is for compatibility with BSD.
5675
5676         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5677         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5678         From coreutils' system.h.
5679
5680         * userspec.c: Don't include "posixver.h".
5681         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5682         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5683         compatible extension.  Simplify code by removing a boolean int
5684         that was always nonzero if a string was nonnull.
5685
5686 2004-03-30  Jim Meyering  <jim@meyering.net>
5687
5688         Merge from coreutils.
5689
5690         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5691
5692         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5693         an empty input stream.
5694
5695         * readtokens.c: Include <stdbool.h>.
5696         (readtoken): Use `size_t' rather than int/long.
5697         All callers adjusted.
5698         Use `bool' rather than `int' where appropriate.
5699         Use memset rather than an explicit loop.
5700         Use x2nrealloc rather than xrealloc.
5701         Allow the use of `\0' as a delimiter.
5702         (readtokens): Likewise.
5703         * readtokens.h (readtoken, readtokens): Update prototypes.
5704
5705 2004-03-30  Bruno Haible  <bruno@clisp.org>
5706
5707         * getloadavg.c (getloadavg): Don't assume setlocale returns
5708         nonnull.
5709
5710 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5711
5712         Merge changes to getloadavg.c from coreutils and Emacs.
5713
5714         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5715         Define to an expression, not to the empty string.
5716         Include cloexec.h and xalloc.h.
5717         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5718         Use set_cloexec_flag rather than rolling our own.
5719         * cloexec.c, cloexec.h: New files.
5720
5721 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5722
5723         * getopt.h: Sync with libc CVS.
5724
5725 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5726             Bruno Haible  <bruno@clisp.org>
5727
5728         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5729         not on all platforms that have <wchar.h>.
5730         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5731
5732 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5733
5734         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5735         Sync with libc CVS.
5736         * getopt_int.h: New file, also synced from libc.
5737
5738 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5739
5740         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5741         '#if' expressions.  Unlike the code it replaces, it does not
5742         depend on (defined _SC_PAGESIZE).  However, it does depend on
5743         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5744         first reported by Jason Andrade in
5745         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5746
5747 2004-01-18  Simon Josefsson  <jas@extundo.com>
5748
5749         * strdup.h: New file.
5750         * strdup.c: Include it.
5751         * path-concat.c: Include strdup.h. Drop strdup declaration.
5752         * userspec.c: Include strdup.h. Drop strdup declaration.
5753
5754 2004-02-06  Karl Berry  <karl@gnu.org>
5755
5756         * config.charset: update from gettext 0.14.1.
5757
5758 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5759
5760         Add comments and code, prompted by suggestions from Bruno Haible
5761         for sh-quote.
5762         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5763         describing the enum quoting_style values.
5764         * quotearg.c (quotearg_alloc): New function.
5765         (quotearg_buffer_restyled): Treat lone { and } as special.
5766         Treat = as special.  Work around bug with older shells
5767         that "see" a '\' that is really the 2nd byte of a multibyte char.
5768         Quote empty string with shell_quoting_style.
5769
5770 2004-02-03  Bruno Haible  <bruno@clisp.org>
5771
5772         * pipe.h: New file, from GNU gettext.
5773         * pipe.c: New file, from GNU gettext.
5774
5775 2004-01-27  Bruno Haible  <bruno@clisp.org>
5776
5777         * execute.h: New file, from GNU gettext.
5778         * execute.c: New file, from GNU gettext.
5779         * w32spawn.h: New file, from GNU gettext.
5780
5781 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5782
5783         Exit-status fix from coreutils.
5784
5785         Use exit_failure consistently in place of EXIT_FAILURE,
5786         so that program exit statuses are consistent on failure.
5787
5788         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5789         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5790         * argmatch.h: Comment fix to match the above.
5791         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5792         Now a macro referring to exit_failure, instead of a separate
5793         variable.  Include "exitfail.h" to get it.
5794         * xstrtol.h: Include "exitfail.h".
5795         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5796
5797         * long-options.c (parse_long_options): Use prototype
5798         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5799         for clarity.
5800
5801 2004-01-21  Jim Meyering  <jim@meyering.net>
5802
5803         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5804         so as not to conflict with a different-sized __mktime_internal
5805         function in GNU libc.
5806         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5807         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5808
5809 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5810
5811         Merge from diffutils.
5812
5813         * file-type.c (file_type): Add typed memory objects.
5814         * file-type.h (S_TYPEISTMO): New macro.
5815
5816         * c-stack.h (c_stack_action): Remove argv argument.
5817         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5818         (die): Don't calculate message unless segv_action returns.
5819         (get_stack_location, min_address_from_argv, max_address_from_argv,
5820         volatile stack_base, volatile_stack_size): Remove.
5821         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5822         that every segmentation violation is a stack overflow.  (Ouch!)
5823         See Debian bug 136249 (still outstanding) for more info about why
5824         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5825
5826 2003-11-30  Bruno Haible  <bruno@clisp.org>
5827
5828         Safer stack allocation.
5829         * setenv.c: Include allocsa.h.
5830         (alloca): Remove fallback definition.
5831         (freea): Remove macro.
5832         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5833         instead of freea.
5834
5835 2003-10-17  Bruno Haible  <bruno@clisp.org>
5836
5837         * binary-io.h: Avoid warnings on Cygwin.
5838
5839 2003-12-28  Bruno Haible  <bruno@clisp.org>
5840
5841         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5842         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5843
5844 2003-11-28  Bruno Haible  <bruno@clisp.org>
5845
5846         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5847
5848 2003-11-27  Bruno Haible  <bruno@clisp.org>
5849
5850         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5851
5852 2003-11-17  Bruno Haible  <bruno@clisp.org>
5853
5854         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5855
5856 2003-11-24  Bruno Haible  <bruno@clisp.org>
5857
5858         * xallocsa.h: New file, from GNU gettext.
5859         * xallocsa.c: New file, from GNU gettext.
5860
5861 2003-11-24  Bruno Haible  <bruno@clisp.org>
5862
5863         * allocsa.h: New file, from GNU gettext.
5864         * allocsa.c: New file, from GNU gettext.
5865
5866 2003-11-24  Bruno Haible  <bruno@clisp.org>
5867
5868         * eealloc.h: New file.
5869
5870 2004-01-15  Jim Meyering  <jim@meyering.net>
5871
5872         Merge from coreutils.
5873
5874         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5875         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5876         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5877
5878         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5879         optional configure-time default.
5880
5881         * version-etc.c (version_etc_copyright): Update copyright date.
5882
5883         * xreadlink.c (xreadlink): Correct outdated comment.
5884
5885 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5886
5887         Merge from coreutils.
5888
5889         * posixver.c: Include posixver.h.
5890
5891         * same.c: Include <stdbool.h>, <limits.h>.
5892         (_POSIX_NAME_MAX): Define if not defined.
5893         (MIN): New macro.
5894         (same_name): If file names are silently truncated, report
5895         that the file names are the same if they are the same after
5896         the silent truncation.
5897
5898         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5899         conversion function.
5900         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5901         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5902         longer needed.
5903
5904 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5905
5906         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5907         with like-named macro in fnmatch.c.
5908         (EXT): Use an internal constant instead.
5909
5910         Merge fnmatch patches from glibc.
5911         * fnmatch.c (mbsinit): Remove define.
5912         Add libc_hidden_ver (__fnmatch, fnmatch).
5913         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5914         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5915
5916 2003-12-14  Karl Berry  <karl@gnu.org>
5917
5918         * config.charset: update from gettext-runtime.
5919
5920 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5921
5922         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5923         Bug reported by Alfred M. Szmidt.
5924
5925 2003-11-29  Karl Berry  <karl@gnu.org>
5926
5927         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5928
5929 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5930             Bruno Haible  <bruno@clisp.org>
5931
5932         * printf-parse.h: Don't include sys/types.h.
5933         (ARG_NONE): New macro.
5934         (char_directive): Change type of *arg_index fields to size_t.
5935         * printf-parse.c: Don't include sys/types.h.
5936         (SSIZE_MAX): Remove macro.
5937         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5938         Remove unnecessary overflow check.
5939         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5940         fields.
5941
5942 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5943
5944         * alloca.c: Remove dependency on xalloc module.
5945         (xalloc_die): Remove.
5946         (memory_full) [!defined emacs]: New macro.
5947         [!defined emacs]: Don't include xalloc.h.
5948         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5949         address arithmetic overflows.  Change datatypes a bit to avoid
5950         unnecessary casts.
5951
5952 2003-11-22  Jim Meyering  <jim@meyering.net>
5953
5954         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5955
5956 2003-11-17  Bruno Haible  <bruno@clisp.org>
5957
5958         * vasnprintf.c (alloca): Remove fallback definition.
5959         (freea): Remove definition.
5960         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5961         Reported by Paul Eggert.
5962
5963 2003-11-17  Jim Meyering  <jim@meyering.net>
5964
5965         On systems without utime and without a utimes function capable of
5966         dealing with a NULL struct utimbuf* argument, this utime replacement
5967         could -- in unusual circumstances -- leak a file descriptor.
5968         * utime.c: Include <unistd.h> and <errno.h>.
5969         (utime_null): Be sure to close `fd' and to preserve errno.
5970         Reported by Geoff Collyer via Arnold Robbins.
5971
5972 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5973             Bruno Haible  <bruno@clisp.org>
5974
5975         Protect against address arithmetic overflow.
5976         * printf-args.h: Include stddef.h.
5977         (arguments): Change type of field 'count' to size_t.
5978         * printf-args.c (printf_fetchargs): Use size_t instead of
5979         'unsigned int' where appropriate.
5980         * printf-parse.h: Include sys/types.h.
5981         (char_directive): Change type of *arg_index fields to ssize_t.
5982         (char_directives): Change type of fields 'count', max_*_length to
5983         size_t.
5984         * printf-parse.c: Include sys/types.h and xsize.h.
5985         (SSIZE_MAX): Define fallback value.
5986         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5987         instead of 'int' where appropriate. Check a_allocated, d_allocated
5988         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5989         * vasnprintf.c: Include xsize.h.
5990         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5991         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5992         overflow. Avoid wraparound when converting a width or precision from
5993         decimal to binary.
5994
5995 2003-11-16  Bruno Haible  <bruno@clisp.org>
5996
5997         Update from GNU gettext.
5998         * printf-parse.c: Generalize to it can be compiled for wide strings.
5999         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6000         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6001         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6002         SNPRINTF): New macros.
6003         Don't include <alloca.h> if the file is used inside libintl.
6004         (local_wcslen): New function, for Solaris 2.5.1.
6005         (VASNPRINTF): Use it instead of wcslen.
6006
6007 2003-11-16  Bruno Haible  <bruno@clisp.org>
6008
6009         * xsize.h (xmax): New function.
6010         (xsum, xsum3, xsum4): Declare as "pure" functions.
6011
6012 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6013
6014         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6015         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6016         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6017         heuristic is just as accurate as far as we know, and it removes a
6018         dependency on size_max.m4 and ptrdiff_max.m4.
6019
6020 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6021
6022         * xstrtol.c (__xstrtol): Remove "break" immediately after
6023         "return", to pacify some unknown compiler.  Problem reported
6024         by Joerg Schilling.
6025
6026 2003-11-11  Bruno Haible  <bruno@clisp.org>
6027
6028         * xsize.h (SIZE_MAX): Remove fallback definition.
6029         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6030         defined.
6031
6032 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6033
6034         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6035         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6036         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6037         From Bruno Haible.
6038         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6039         not (size_t) -1, since it's defined here.
6040
6041 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6042
6043         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6044         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6045         Reject sizes of exactly SIZE_MAX bytes.
6046         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6047         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6048
6049 2003-11-05  Bruno Haible  <bruno@clisp.org>
6050
6051         * xsize.h: Include limits.h, to avoid a possible collision with
6052         SIZE_MAX defined in <limits.h> on Solaris.
6053
6054 2003-11-04  Bruno Haible  <bruno@clisp.org>
6055
6056         * xsize.h: New file.
6057         * linebreak.c: Include xsize.h.
6058         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6059         argument for overflow.
6060         Suggested by Paul Eggert.
6061
6062 2003-10-31  Bruno Haible  <bruno@clisp.org>
6063
6064         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6065         to avoid (extremely rare) race condition.
6066         Suggested by Paul Eggert.
6067
6068 2003-11-03  Jim Meyering  <jim@meyering.net>
6069
6070         * userspec.c: Include "userspec.h".
6071         * userspec.h: New file.
6072
6073 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6074
6075         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6076         * mountlist.c (SIZE_MAX): Define if not defined already.
6077         (read_filesystem_list): Set and use me_type_malloced.
6078         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6079         whatever the type happens to be), for brevity and consistency.
6080         Check for size calculation overflow on Alphas running OSF/1.
6081
6082 2003-10-31  Jim Meyering  <jim@meyering.net>
6083
6084         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6085
6086         * linebuffer.c: Include <string.h> for declaration of memset.
6087
6088 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6089             Bruno Haible  <bruno@clisp.org>
6090
6091         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6092         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6093
6094 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6095
6096         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6097         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6098         no longer needed.
6099         * quotearg.c (quotearg_n_options): Use it.
6100         * group-member.c: Include <stdbool.h>.
6101         (free_group_info): Arg is now const *; don't free arg.
6102         (get_group_info): Now returns bool and accepts struct group_info *,
6103         rather than returning a malloc'ed struct group_info *.
6104         All uses changed.  Check for overflow in internal size calculation.
6105
6106         * getusershell.c (readname): Simplify the code by using x2nrealloc
6107         rather than xmalloc/xrealloc.
6108         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6109         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6110         conformance bug: the old code used a pointer after freeing the
6111         storage that it addressed.
6112         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6113         rather than doing it by hand.
6114         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6115         the buffer preserved.  Use free and xmalloc instead.
6116         * quotearg.c (quotearg_n_options): Likewise.
6117         Use a simpler test for size overflow.  Don't use xalloc_oversized
6118         because unsigned int might be wider than size_t (!); this suggests
6119         that we should switch from unsigned int to size_t for slot numbers.
6120
6121 2003-10-27  Bruno Haible  <bruno@clisp.org>
6122
6123         * stdbool_.h: Better support for BeOS.
6124
6125 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6126
6127         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6128         to allocate the returned structure.  Do not allocate a subarray,
6129         as x2nrealloc will do that.
6130         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6131         instead of xnrealloc.
6132         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6133
6134 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6135
6136         * xalloc.h (xalloc_oversized): New static inline function, for
6137         callers that want to do their own size-overflow checking.  Include
6138         <stdbool.h>, since xalloc_oversized returns bool.
6139         * xalloc.c (array_size_overflow): Remove.  All callers changed
6140         to use xalloc_oversized.
6141
6142         Add two functions x2realloc, x2nrealloc, for programs that grow
6143         arrays dynamically by doubling their sizes.
6144         * xalloc.h (x2realloc, x2nrealloc): New decls.
6145         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6146         New functions.
6147
6148         Port to C99 semantics for 'inline' of external functions.
6149         Bug reported by Bruno Haible.
6150         * xmalloc.c (xnmalloc_inline): New static inline function,
6151         with the old contents of xnmalloc.
6152         (xnmalloc, xmalloc): Use it.
6153         (xnrealloc_inline): New static inline function,
6154         with the old contents of xnrealloc.
6155         (xnrealloc, xrealloc): Use it.
6156
6157         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6158
6159 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6160
6161         Fix several address-calculation bugs in the hash modules,
6162         plus some minor code cleanup.
6163
6164         * hash.h: Include <stdbool.h>, for bool.
6165         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6166         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6167         hash_get_n_entries, hash_get_max_bucket_length,
6168         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6169         hash_rehash): Use size_t rather than unsigned.
6170         * hash.c (struct hash_table, hash_get_n_buckets,
6171         hash_get_n_buckets_used, hash_get_n_entries,
6172         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6173         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6174         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6175         Likewise.
6176         (SIZE_MAX): Define if not defined.
6177         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6178         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6179         hash_print):
6180         Use const * when possible.
6181         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6182         (check_tuning): Fix bug: if tuning parameters were very close to
6183         0 or 1, rounding errors could have caused subscript violations.
6184         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6185         (hash_initialize): Add 'fail:' label
6186         to free table and return NULL, and use it to simplify code.
6187         Use calloc rather than clearing the storage ourself.
6188         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6189         buffer size calculations.
6190         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6191         Include <stddef.h>, for size_t.
6192         * hash-pjw.c (hash_pjw): Likewise.
6193         Switch to method described by Bruno Haible.
6194         Include <limits.h>, for CHAR_BIT.
6195         (SIZE_BITS): New macro.
6196
6197 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6198
6199         * getndelim2.c (getndelim2): When size calculation overflows,
6200         ceiling the allocation at NMAX bytes rather than silently
6201         discarding input bytes before NMAX is reached.  This makes
6202         a difference only if NMAX exceeds SIZE_MAX / 2.
6203
6204         * obstack.c: Merge from glibc.
6205         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6206         Add libc_hidden_def (_obstack_newchunk).
6207         (_obstack_free) [! defined _LIBC]: Remove.
6208         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6209         a clone of the function body.
6210         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6211         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6212
6213         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6214         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6215         arg to memcpy.
6216
6217         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6218         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6219         Don't use lvalue casts, as GCC plans to remove support for them
6220         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6221         was also present in the non-GCC version, indicating that this
6222         code had always been buggy and had never been widely used.
6223         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6224         Use the fast variant of each macro, rather than copying the
6225         definiens of the fast variant; that way, we'll be more likely to
6226         catch future bugs in the fast variants.
6227
6228 2003-10-20  Bruno Haible  <bruno@clisp.org>
6229
6230         * wait-process.h: New file, from GNU gettext.
6231         * wait-process.c: New file, from GNU gettext.
6232
6233 2003-10-19  Jim Meyering  <jim@meyering.net>
6234
6235         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6236
6237 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6238
6239         * getgroups.c: Include <errno.h>, <stdlib.h>.
6240         (getgroups): First arg is int, not size_t.
6241         Don't let 'free' mangle errno.
6242
6243 2003-10-16  Jim Meyering  <jim@meyering.net>
6244
6245         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6246
6247 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6248
6249         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6250         (SIZE_MAX): Remove.
6251         (new_exclude, add_exclude_file): Initial size no longer needs to
6252         be a power of 2.
6253         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6254         our own address arithmetic overflow checking.
6255
6256         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6257         (fnmatch): Do not alloca more than 2000 wide characters;
6258         instead, use malloc for large buffers.
6259         Check for address arithmetic overflow, and return -1
6260         with errno set to ENOMEM in that case.
6261         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6262         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6263         instead, return -1.  Check for address arithmetic overflow.
6264
6265 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6266
6267         Handle invalid suffixes and overflow independently, so that
6268         callers can treat them independently as needed.  Fix some bugs in
6269         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6270         suffix for a human-readable blocksize.  The major caller-visible
6271         change is the addition of a new
6272         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6273         that both overflow and suffix chars were found.
6274
6275         * human.c (humblock): Don't check separately for invalid suffix
6276         char; that is xstrtoumax's job (now that its bug is fixed).
6277         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6278         INTMAX_MAX]: New macros.
6279         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6280         TYPE_MAXIMUM): New macros.
6281         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6282         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6283         if overflow occurs, as it's what __strtol does and it's more useful
6284         in practice.
6285         (__xstrtol): If __strtol reports some error other than ERANGE,
6286         reflect it to the caller as LONGINT_INVALID.  If it reports
6287         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6288         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6289         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6290         value.
6291         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6292         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6293         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6294         [defined UINTMAX_MAX]: New macros.
6295
6296 2003-10-14  Bruno Haible  <bruno@clisp.org>
6297
6298         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6299         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6300         Also use volatile where needed.
6301
6302 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6303
6304         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6305         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6306         and define in terms of the other primitives.
6307         * xmalloc.c: Include stdbool.h; do not include exit.h.
6308         (SIZE_MAX): Define if not already defined.
6309         (array_size_overflow): New function.
6310         (xalloc_die): Abort instead of exiting if 'error' returns.
6311         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6312         (xmalloc, xrealloc): Use them.
6313         (xcalloc): Check for address arithmetic overflow.
6314         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6315         a bit faster than strcpy.
6316
6317 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6318
6319         Merge getpass from libc, plus a few fixes.
6320
6321         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6322         Include <stdbool.h>.
6323         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6324         __fsetlocking to empty.
6325         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6326         do include <bits/libc-lock.h>.
6327         Do not include <fcntl.h>; not needed.
6328         [_LIBC]: Include <wchar.h>.
6329         (NOTCANCEL_MODE): New macro.
6330         (flockfile, funlockfile) [_LIBC]: New macros.
6331         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6332         [!_LIBC]: New macros.
6333         (call_fclose): New function.
6334         (getpass): Use it.  Save tty stream separately; this simplifies the
6335         code and makes it more reliable if stdin happens to equal stdout.
6336         Invoke __fsetlocking on tty.
6337         Handle thread cancellation if needed.
6338         Namespace cleanup (use __tcgetattr, __getline).
6339         Use bool for Booleans.
6340         [USE_IN_LIBIO]: Handle wide streams.
6341         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6342         stream might go where.
6343
6344         * unlocked-io.h: Include <stdio.h>, so that the caller
6345         doesn't have to include <stdio.h> before us.
6346         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6347         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6348         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6349         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6350         if not declared, so that we can use getpass.c code from libc without
6351         rewriting it.
6352         (flockfile, ftrylockfile, funlockfile): New macros.
6353
6354 2003-10-06  Bruno Haible  <bruno@clisp.org>
6355
6356         * version-etc-2.h: Remove file.
6357         * version-etc-2.c: Remove file.
6358
6359 2003-09-25  Jim Meyering  <jim@meyering.net>
6360             Bruno Haible  <bruno@clisp.org>
6361
6362         This lets translators provide better translations for the
6363         "Written by ..." part of --version output.
6364         * version-etc.h: Include stdarg.h.
6365         (version_etc_copyright): Declare as readonly.
6366         (version_etc): Make this function variadic with a NULL-terminated list
6367         of author name strings.
6368         (version_etc_va): New declaration.
6369         * version-etc.c: Include stdarg.h, stdlib.h.
6370         (version_etc_copyright): Declare as readonly.
6371         (version_etc_va): New function. Provide a different translatable string
6372         for each possible number of authors < 10. Abbreviate when there are 10
6373         authors or more.
6374         (version_etc): Make this function variadic. Call version_etc_va.
6375         Suggestion from Gary V. Vaughan.
6376
6377         * long-options.h (parse_long_options): Change prototype: the authors
6378         string is moved to the end and becomes variadic.
6379         * long-options.c: Include stdarg.h.
6380         (parse_long_options): Make this function variadic, too.
6381         Call version_etc_va, not version_etc.
6382
6383 2003-10-06  Bruno Haible  <bruno@clisp.org>
6384
6385         * fatal-signal.h: New file, from GNU gettext.
6386         * fatal-signal.c: New file, from GNU gettext.
6387
6388 2003-10-04  Karl Berry  <karl@gnu.org>
6389
6390         * argp*: update from libc.
6391
6392 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6393
6394         * getpass.c (getpass): Use a no-op fseek when switching from input to
6395         output mode on the same stream.
6396
6397 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6398
6399         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6400         Fix arg typo in previous patch.
6401
6402 2003-09-28  Jim Meyering  <jim@meyering.net>
6403
6404         * error.c: Correct cpp indentation.
6405
6406 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6407
6408         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6409         Omit the special code that used __typeof__, since we worry that
6410         it could be more trouble than it's worth.  See:
6411         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6412         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6413
6414         * free.c: New file.
6415
6416 2003-09-26  Jim Meyering  <jim@meyering.net>
6417
6418         * error.c (error_tail): Move some declarations
6419         into inner scope where the local variables are used.
6420
6421 2003-09-26  Bruno Haible  <bruno@clisp.org>
6422
6423         * stpncpy.h (gnu_stpncpy): New declaration.
6424         (stpncpy): Define as alias for gnu_stpncpy.
6425         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6426
6427 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6428
6429         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6430         (error_tail): Do not loop, reallocating temporary buffer, since
6431         the output cannot contain more wide characters than the input
6432         contains bytes, the size must be big enough already.  This avoids
6433         one potential size overflow calculation.  Check for size overflow
6434         when calculating temporary buffer size.  Free temporary buffer
6435         when done, if it was allocated with malloc; this plugs a memory
6436         leak.  Remove casts from void * to pointers, that are no longer
6437         needed now that we're assuming C89 or better.
6438
6439         Merge error changes from glibc.
6440
6441         * error.c, error.h: Update copyright notice header to match glibc.
6442         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6443         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6444         Disable cancellation while printing error.
6445         * error.h: Prepend __ to parameter names.
6446
6447 2003-09-25  Karl Berry  <karl@gnu.org>
6448
6449         * argp-fmtstream.c, argp-help.c: update from libc.
6450
6451 2003-09-25  Bruno Haible  <bruno@clisp.org>
6452
6453         * version-etc-2.h: New file, from version-etc.h with modifications.
6454         * version-etc-2.c: New file, from version-etc.c with modifications.
6455
6456 2003-09-25  Simon Josefsson  <jas@extundo.com>
6457
6458         * xgetdomainname.h: New file.
6459         * xgetdomainname.c: New file.
6460
6461 2003-09-25  Simon Josefsson  <jas@extundo.com>
6462             Bruno Haible  <bruno@clisp.org>
6463
6464         * getdomainname.h: New file.
6465         * getdomainname.c: New file.
6466
6467 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6468
6469         * linebuffer.c (freebuffer): Don't free the argument, just
6470         the buffer associated with the argument.  Bug reported by
6471         Simon Josefsson.
6472
6473 2003-09-19  Karl Berry  <karl@gnu.org>
6474
6475         * argp.h: update from libc.
6476
6477 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6478
6479         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6480         input error, instead of returning NULL the next time we are called
6481         (and therefore losing track of errno).
6482
6483 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6484
6485         * getndelim2.c (getndelim2): Don't trash errno when a read
6486         fails, so that the caller gets the proper errno.
6487
6488         * readutmp.c (read_utmp): Likewise.
6489         Check for fstat error.  Close stream and free storage
6490         when failing.
6491
6492 2003-09-14  Bruno Haible  <bruno@clisp.org>
6493
6494         * fwriteerror.h: New file.
6495         * fwriteerror.c: New file.
6496
6497 2003-09-14  Jim Meyering  <jim@meyering.net>
6498
6499         * getloadavg.c: Correct cpp indentation.
6500         * strdup.c: Likewise.
6501         * vasnprintf.c: Likewise.
6502
6503 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6504
6505         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6506         * obstack.c [!defined _LIBC]: Likewise.
6507         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6508         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6509         * exitfail.c: Don't include stdlib.h; no longer needed.
6510
6511         More changes to assume C89 or better.
6512
6513         * error.c (error_tail): Assume vprintf.
6514
6515         * argmatch.c (getenv): Remove decl.
6516         * progreloc.c (get_full_program_name): Define via prototype.
6517         * setenv.c (clearenv): Likewise.
6518         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6519         needed.
6520         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6521         (malloc, memcpy): Remove decls.
6522         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6523         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6524         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6525         (memcpy): Remove macro.
6526         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6527         (__P): Remove.  All uses removed.
6528         (PTR): Remove.  All uses changed to void *.
6529         (CHAR_BIT, NULL): Remove.
6530         (spaces, zeros, memset_space, memset_zero)
6531         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6532         Remove.
6533         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6534         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6535         Define with prototype.
6536         Remove now-unnecessary prototype decl.
6537         (extra_args_spec): Assume ANSI C.  All uses changed.
6538         (extra_args_spec_iso): Remove.
6539         (my_strftime, emacs_strftimeu): Define via prototype.
6540         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6541         unconditionally.
6542         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6543         * strtoimax.c: Include <stdlib.h> unconditionally.
6544         (strtoul, strtol): Remove decls.
6545         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6546         LONG_MAX): Remove.
6547         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6548         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6549         (LOCALE_PARAM_PROTO): New macro.
6550         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6551         (INTERNAL (strtol), strtol): Define with a prototype.
6552         (PARAMS): Remove.  All uses removed.
6553         * tempname.c: Include <string.h> unconditionally.
6554         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6555         * xgethostname.c (main): Define with a prototype.
6556         * xmalloc.c: Include "xalloc.h" first, to check interface.
6557         Include <stdlib.h> unconditionally.
6558         (calloc, malloc, realloc, free): Remove decls.
6559         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6560         Include <stdlib.h> unconditionally.  Sort include file names.
6561         (strtod): Remove.
6562         (xstrtod): Define with a prototype.
6563         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6564         (strtol, strtoul): Remove decls.
6565
6566 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6567
6568         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6569         Include <stdlib.h>, <string.h> unconditionally.
6570         Remove now-unnecessary cast to char *.
6571         * strnlen.c: Include <string.h> unconditionally.
6572         * yesno.c (yesno): Define with a prototype.
6573
6574 2003-09-10  Bruno Haible  <bruno@clisp.org>
6575
6576         * strcspn.c: Include <string.h> unconditionally.
6577         * strpbrk.c: Include <string.h> unconditionally.
6578         * strstr.c: Include <string.h> unconditionally.
6579         * unicodeio.c: Include <string.h> unconditionally.
6580         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6581         * unsetenv.c: Likewise.
6582         * xreadlink.c: Include <stdlib.h> unconditionally.
6583         * yesno.c: Include <stdlib.h> unconditionally.
6584         (rpmatch): Add prototype.
6585
6586 2003-09-10  Jim Meyering  <jim@meyering.net>
6587
6588         * error.c: Correct indentation of cpp directives.
6589
6590 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6591
6592         More K&R removal.
6593
6594         * acosl.c (main): Use a prototype.
6595         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6596         tanl.c: Likewise.
6597
6598         * getloadavg.c (getloadavg, main): Define via prototypes.
6599
6600         * getopt.h (struct option.name): Assume C89, and use 'const'.
6601         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6602         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6603         with a prototype.
6604         * getopt.c (const): Remove macro.
6605         Include <string.h> unconditionally.
6606         (my_index): Remove; all uses changed to strchr.
6607         (strlen): Remove decl.
6608         (exchange): Remove forward decl; no longer needed.
6609         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6610         Define with prototype.
6611         * getopt1.c (const): Remove macro.
6612         (getopt_long, getopt_long_only, main): Define with prototype.
6613
6614         * getugroups.c: Include <string.h> unconditionally.
6615
6616         * getusershell.c: Include <stdlib.h> unconditionally.
6617         (getusershell, setusershell, endusershell, readname, main):
6618         Define with prototypes.
6619
6620         * group-member.c: Include group-member.h first.
6621         Include <stdlib.h> unconditionally.
6622
6623         * hard-locale.c: Include hard-locale.h first.
6624         Include <stdlib.h>, <string.h> unconditionally.
6625
6626         * hash.c (free, malloc): Remove decls.
6627         Include <stdlib.h> unconditionally.
6628
6629         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6630         (getenv): Do not declare.
6631
6632         * idcache.c: Include <string.h> unconditionally.
6633
6634         * long-options.c: Include long-options.h first, to test interface.
6635         Include <stdlib.h> unconditionally.
6636
6637         * makepath.c: Include makepath.h first, to test interface.
6638         Include <stdlib.h> and <string.h> unconditionally.
6639
6640         * linebuffer.c: Include <stdlib.h>.
6641         (free): Remove decl.
6642
6643         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6644         rpl_malloc returns void *, not char *.
6645         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6646
6647         * md5.h: Include <limits.h> unconditionally.
6648         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6649         (__P): Remove; all uses removed.
6650         * md5.c: Include "md5.h" first.
6651         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6652         md5_buffer, md5_process_bytes, md5_process_block):
6653         Define with prototypes.
6654         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6655         * sha.c: Include "sha.h" first.
6656         Include <stdlib.h>, <string.h> unconditionally.
6657
6658         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6659         * memcmp.c (__ptr_t): Likewise.
6660         * memrchr.c (__ptr_t): Likewise.
6661         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6662         Include <string.h> unconditionally.
6663         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6664         * memchr.c: Include <stdlib.h> unconditionally.
6665         * memchr.c (LONG_MAX): Remove.
6666         * memrchr.c (LONG_MAX): Likewise.
6667         * memchr.c (__memchr): Define via a prototype.
6668         * memrchr.c (__memrchr): Likewise.
6669         * memcmp.c (__P): Remove, and remove all uses.
6670         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6671         Remove forward decls; no longer needed.
6672         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6673         Use types required by C89 in prototype.
6674
6675         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6676         * savedir.c: Likewise.
6677         * mkdir.c (free): Remove decl.
6678         * rmdir.c (rmdir): Define with a prototype.
6679         * savedir.c: Include savedir.h first, to test interface.
6680
6681         * mktime.c (STDC_HEADERS): Remove.
6682         Include <stdlib.h>, <string.h> unconditionally.
6683
6684         * modechange.c: Include <stdlib.h> unconditionally.
6685         (malloc): Remove decl.
6686
6687         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6688         (free): Remove decl.
6689
6690         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6691         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6692         (This type really should be intptr_t, but that's a C99ism.)
6693         (_obstack_memcpy): Remove: all uses changed to memcpy.
6694         Include <string.h> unconditionally.
6695         (struct obstack): Assume __STDC__ for types of members
6696         chunkfun, freefun, extra_arg.
6697         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6698         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6699         obstack_begin, obstack_specify_allocation,
6700         obstack_specify_allocation_with_arg, obstack_chunkfun,
6701         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6702         Remove unprototyped decls and the macros that use them.
6703         * obstack.c (POINTER): Remove.  All uses changed to void *.
6704         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6705         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6706         (defined __STDC__ && __STDC__)]:
6707         Remove nonprototyped code.
6708         Include <stdlib.h> unconditionally.
6709         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6710         _obstack_allocated_p, _obstack_free, obstack_free,
6711         _obstack_memory_used, print_and_abort):
6712         Define using prototypes.
6713         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6714         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6715         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6716         obstack_next_free, obstack_object_size, obstack_room) [0]:
6717         Remove unused, unprototyped code.
6718
6719         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6720
6721         * physmem.c (physmem_total, physmem_available, main): Define
6722         with prototypes.
6723
6724         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6725         (main): Define with a prototype.
6726
6727         * posixver.c (getenv): Remove decl.
6728
6729         * putenv.c (malloc): Returns void *, not char *.
6730         Include <string.h> unconditionally.
6731         (strchr, memcpy, NULL): Do not define.
6732
6733         * readtokens.c: Include readtokens.h first, to test interface.
6734         Include <stdlib.h>, <string.h> unconditionally.
6735         (init_tokenbuffer): Define with a prototype.
6736
6737         * regex.c (PARAMS): Remove.  All uses removed.
6738         All uses of _RE_ARGS removed, too.
6739         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6740         unconditionally.
6741         (bzero): Assume memset exists.
6742         (memcmp, memcpy, NULL): Remove.
6743         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6744         char, or assignments to local vars of type signed char.
6745         (init_syntax_once, PREFIX(extract_number_and_incr),
6746         PREFIX(print_partial_compiled_pattern),
6747         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6748         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6749         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6750         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6751         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6752         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6753         wcs_compile_range, byte_compile_range, truncate_wchar,
6754         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6755         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6756         count_mbs_length, wcs_re_match_2_internal,
6757         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6758         PREFIX(alt_match_null_string_p),
6759         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6760         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6761         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6762         now-unnecessary declaration, if any.
6763         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6764         regcomp, regexec):
6765         Remove now-unnecessary casts among pointer types.
6766         * regex.h (_RE_ARGS): Remove.  All uses removed.
6767
6768         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6769         (free): Remove decl.
6770
6771         * rpmatch.c: Include <stdlib.h> unconditionally.
6772
6773         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6774         (free): Remove decl.
6775
6776         * save-cwd.c: Include <stdlib.h> unconditionally.
6777         * xgetcwd.c: Likewise.
6778
6779         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6780         (free): Remove decl.
6781
6782         * strchrnul.c (strchrnul): Define with a prototype.
6783         Fix bug: c_in was not converted to char before searching.
6784
6785         The following changes are not K&R related:
6786
6787         * group-member.h: Include <sys/types.h>, so that this file is
6788         self-contained.
6789         * makepath.h: Likewise.
6790
6791         * getusershell.c (readname, default_index, line_size, readname):
6792         Use size_t, not int, for sizes.
6793         (readname): If the size overflows, report an error instead of
6794         looping forever.
6795
6796 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6797
6798         * getndelim2.c: Assume stdlib.h per the C89 spec.
6799
6800 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6801
6802         Assume C89 or better; remove K&R cruft.
6803         A few of these changes were first proposed by Derek Robert Price
6804         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6805
6806         * addext.c: Include <string.h> unconditionally.
6807         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6808         Don't declare getenv or malloc.
6809
6810         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6811         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6812         (NULL): Remove.
6813         (find_stack_direction, alloca): Use prototypes.
6814
6815         * atexit.c (atexit): Define using a prototype.
6816
6817         * basename.c, dirname.c, stripslash.c:
6818         Include <string.h> unconditionally.
6819
6820         * bcopy.c: Include <stddef.h>.
6821         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6822
6823         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6824
6825         * error.h (error, error_at_line, error_print_progname)
6826         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6827         * error.c: Include error.h first, to check interface.
6828         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6829         (VA_START): Remove; all uses changeed to va_start.
6830         (exit, strerror): Remove decls.
6831         (error_print_progname): Prototype uncondionally.
6832         Don't include <errno.h>; no longer needed.
6833         (private_strerror): Remove.
6834         (error_tail): Always define.
6835         (error, error_at_line): Assume C89 or better; always use prototypes.
6836         * fatal.c: Include "fatal.h" first, to test interface.
6837         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6838         (VA_START): Remove; all uses changed to va_start.
6839         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6840         this case.
6841         (exit): Remove decl.
6842         (fatal): Prototype unconditionally.  Assume va_start works.
6843         Abort at end, to pacify gcc.
6844
6845         * euidaccess.c (main): Define with a prototype.
6846
6847         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6848
6849         * exitfail.c: Include <stdlib.h> unconditionally.
6850
6851         * fnmatch_.h (__P): Remove.  All uses changed to assume
6852         prototypes.
6853         * fnmatch.c: Include fnmatch.h first, to test interface.
6854         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6855         (getenv): Remove decl.
6856         (fnmatch): Define using a prototype.
6857         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6858         (FCT): Define using a prototype.
6859
6860         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6861
6862         * gethostname.c: Include <stddef.h>.
6863         (gethostname): Define with prototype.  Length is size_t, not int.
6864
6865 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6866
6867         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6868         getversion.c should have been removed then, but was accidentally
6869         preserved.
6870
6871         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6872         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6873
6874 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6875
6876         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6877         copy_tm_result.  Bug reported by Simon Josefsson in
6878         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6879
6880 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6881
6882         * time_r.c, time_r.h: New files.
6883
6884         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6885         __localtime_r.
6886         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6887         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6888
6889         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6890         __gmtime_r.
6891         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6892         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6893         Include <time_r.h>.
6894
6895         * timegm.c: Switch to glibc implementation, with the following changes:
6896         [defined HAVE_CONFIG_H]: Include <config.h>.
6897         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6898         (__mktime_internal) [!defined _LIBC]: New decl.
6899         (__gmtime_r) [!defined _LIBC]: New macro and function.
6900         (timegm): Use a prototype, since gnulib assumes C89.
6901         Do not bother declaring tmp to be const, as it's not really usefu.
6902         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6903         (timegm): Declare only if HAVE_DECL_TIMEGM.
6904
6905 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6906
6907         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6908         Bug reported by Lute Kamstra in
6909         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6910
6911         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6912         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6913         course with correspondingly smaller numbers for tomorrow and
6914         yesterday.  From Tadayoshi Funaba.  Originally installed into
6915         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6916         coreutils merge?).
6917
6918 2003-08-31  Simon Josefsson  <jas@extundo.com>
6919
6920         * timegm.h: New file.
6921         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6922
6923 2003-08-31  Karl Berry  <karl@gnu.org>
6924
6925         * argp.h: update from libc.
6926
6927 2003-08-28  Bruno Haible  <bruno@clisp.org>
6928
6929         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6930         warning on QNX, which defines O_BINARY to 000000.
6931
6932 2003-08-24  Bruno Haible  <bruno@clisp.org>
6933
6934         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6935         MSVC7 <stdio.h> is included later.
6936
6937 2003-08-20  Bruno Haible  <bruno@clisp.org>
6938
6939         * progname.h: New file, from GNU gettext.
6940         * progname.c: New file, from GNU gettext.
6941         * progreloc.c: New file, from GNU gettext.
6942
6943 2003-08-19  Bruno Haible  <bruno@clisp.org>
6944
6945         * xstrdup.c: Assume <string.h> exists.
6946
6947 2003-08-18  Jim Meyering  <jim@meyering.net>
6948
6949         * setenv.h: Indent nested cpp directive.
6950         * vasnprintf.c: Remove trailing blanks.
6951
6952 2003-08-17  Simon Josefsson  <jas@extundo.com>
6953             Bruno Haible  <bruno@clisp.org>
6954
6955         * xstrndup.h: New file.
6956         * xstrndup.c: New file.
6957
6958 2003-08-17  Bruno Haible  <bruno@clisp.org>
6959
6960         * strndup.h: New file.
6961
6962 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6963
6964         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6965         space, undoing this 2003-08-12 change:
6966         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6967
6968 2003-08-16  Jim Meyering  <jim@meyering.net>
6969
6970         Merge from coreutils.
6971         * xstrtoimax.c: #else #if -> #elif.
6972         * xstrtoumax.c: Likewise.
6973
6974 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6975
6976         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6977         rather than tab, after '#' in shell-script copyright notices.
6978         Suggested by Bruno Haible.
6979
6980 2003-08-15  Jim Meyering  <jim@meyering.net>
6981         and Paul Eggert  <eggert@twinsun.com>
6982
6983         Merge from coreutils.
6984         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6985         member but strut utmpx does not.  Needed for AIX 4.3.3.
6986         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6987
6988 2003-08-15  Jim Meyering  <jim@meyering.net>
6989
6990         Merge from coreutils.
6991         * xgethostname.c: Include <stdlib.h>.
6992         (xghostname): Don't exit for anything other than memory-related
6993         failure; just return NULL.
6994         * userspec.c: Include "posixver.h".
6995         (parse_user_spec): Accept `.' as a separator only
6996         in pre-POSIX-200112 mode.
6997         * strtoimax.c: Use #elif rather than #else #if.
6998         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6999         Remove function, now that we can rely on a working tzset function.
7000         [!_LIBC]: Ensure that the required autoconf test has been run.
7001         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7002         Use underlying_strftime for %r.
7003         * sha.c: Merge in some clean-up and optimization changes from glibc.
7004         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7005         Ensure that it is a multiple of 64.
7006         Rearrange loop exit tests so as to avoid performing an
7007         additional fread after encountering an error or EOF.
7008         * realloc.c: Update copyright date.
7009
7010 2003-08-14  Jim Meyering  <jim@meyering.net>
7011
7012         Merge from coreutils.
7013         * obstack.h: Whitespace changes.
7014         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7015         and xcalloc return values.
7016         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7017         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7018         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7019         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7020         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7021         error from mntctl.
7022         Use mntctl's return value to drive the entry-processing loop, since
7023         we can't rely on the value of the vmt_length member in the last
7024         entry.  On some systems doing so could result in exhausting
7025         virtual memory.  Based in part on a patch from Mike Jetzer.
7026
7027 2003-08-14  Jim Meyering  <jim@meyering.net>
7028         and Paul Eggert  <eggert@twinsun.com>
7029
7030         Merges from coreutils, plus other fixes.
7031         * physmem.c: Merge in portability changes from gcc/libiberty
7032         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7033         for credits and details.  Thanks to Kaveh Ghazi for helping
7034         to keep these files in sync.
7035         (ARRAY_SIZE): Define it.
7036         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7037         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7038         (memcasecmp): Don't assume size_t fits in unsigned int.
7039         Remove casts and duplicate code.
7040         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7041         (memcpy): Remove definition.
7042         Merge in some clean-up and optimization changes from glibc.
7043         [BLOCKSIZE]: Move definition to top of file.
7044         Ensure that it is a multiple of 64.
7045         Rearrange loop exit tests so as to avoid performing an
7046         additional fread after encountering an error or EOF.
7047         * md5.h (md5_uintptr): Define.
7048         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7049         return to the initial working directory.  Preserve errno
7050         for caller.
7051         * idcache.c: Include "xalloc.h".
7052         (xmalloc, xrealloc): Remove decls.
7053         (getuser): Remove casts no longer required in C89.
7054         * human.c: Include stdio.h, for sprintf.
7055         * group-member.c: Include "xalloc.h".
7056         (xmalloc, xrealloc): Remove decls.
7057         (get_group_info): Remove casts no longer required in C89.
7058         * getusershell.c (readname): Remove casts no longer required in C89.
7059         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7060         * getline.c: Whitespace fix, from coreutils.
7061
7062 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7063
7064         * exclude.c: Include <ctype.h>
7065         (IN_CTYPE_DOMAIN): New macro.
7066         (is_space): New fn.
7067         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7068         and empty lines.
7069
7070         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7071         Undo previous (whitespace-only) change.
7072
7073 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7074
7075         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7076         Normalize leading white space and remove trailing white space.
7077         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7078         notice, as per ../config/srclist-update.
7079
7080         Merge from coreutils.
7081         * euidaccess.h: New file.
7082         * euidaccess.c: Include it.
7083         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7084         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7085         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7086
7087 2003-08-11  Bruno Haible  <bruno@clisp.org>
7088
7089         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7090         (vasnprintf): Use it instead of wcslen.
7091
7092 2003-08-11  Bruno Haible  <bruno@clisp.org>
7093
7094         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7095         value to ensure that _Bool promotes to int. Use #define for _Bool when
7096         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7097
7098 2003-08-10  Karl Berry  <karl@gnu.org>
7099
7100         * regex.h: update from libc (whitespace fix).
7101
7102 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7103
7104         Merge some files from coreutils.  These changes were
7105         originally made by Jim Meyering.
7106         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7107         many older Unixes require this.
7108         * alloca.c (alloca): Remove cast to argument of free;
7109         no longer needed in C89.
7110         * alloca_.h, regex.h: Fix white space to match
7111         what GNU indent does.
7112
7113 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7114
7115         * bumpalloc.h: Remove.
7116
7117 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7118
7119         * getloadavg.c: Change copyright notice and spacing to conform to
7120         GNU coding style.
7121
7122         Merge from coreutils.
7123         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7124         From glibc.
7125         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7126         from Karl Berry, implemented by Jim Meyering.
7127         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7128         from Dmitry V. Levin.
7129         Remove anachronistic cast of xrealloc.
7130         * fnmatch_.h (__const): Remove.  Use 'const'.
7131         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7132         type. Otherwise, it wouldn't compile with at least /bin/cc on
7133         ymp-cray-unicos9.0.2.X.
7134         Combine two mostly-identical uses of alloca into one.
7135         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7136
7137 2003-08-04  Dave Love <d.love@dl.ac.uk>
7138
7139         [From Emacs.]
7140
7141         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7142         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7143         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7144         obsolete NLIST_NAME_UNION.
7145         [__GNU__]: Undef BSD and FSCALE.
7146         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7147
7148 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7149
7150         * stdbool_.h (_Bool): Make it signed char, instead of
7151         an enum type, so that it's guaranteed to promote to int.  See:
7152         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7153
7154 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7155
7156         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7157         (strerror): Don't assume that a printable int fits in 14 bytes.
7158
7159 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7160             Bruno Haible  <bruno@clisp.org>
7161
7162         * getline.h (getline, getdelim): Change return type to ssize_t.
7163         * getline.c (getline, getdelim): Likewise.
7164         Remove _GNU_SOURCE define; now it's defined in config.h through
7165         m4/getline.m4.
7166
7167 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7168
7169         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7170         over-parenthesization in macros.
7171
7172         Sync with coreutils.
7173
7174         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7175         required by C99.
7176
7177         Use `exit_failure' for xalloc and xmemcoll instead of their own
7178         private exit-failure variables.
7179         * xalloc.h (xalloc_exit_failure): Remove.
7180         * xmalloc.c: Likewise.  Include exitfail.h.
7181         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7182         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7183         * xmemcoll.c: Likewise.  Include exitfail.h.
7184         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7185
7186 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7187
7188         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7189         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7190         to test that it can stand by itself.  Include "exitfail.h".
7191         Clients should set exit_failure instead.
7192         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7193
7194 2003-07-18  Andreas Schwab  <schwab@suse.de>
7195
7196         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7197
7198 2003-07-18  Bruno Haible  <bruno@clisp.org>
7199
7200         * getndelim2.h: New file.
7201         * getndelim2.c: Make into a module of its own. Include config.h,
7202         getndelim2.h.
7203         (getndelim2): Make non-static. Change return type to ssize_t.
7204         * getline.h: Change argument names.
7205         * getline.c: Include getndelim2.h instead of getndelim2.c.
7206         * getnline.c: Include getndelim2.h.
7207
7208 2003-07-17  Bruno Haible  <bruno@clisp.org>
7209
7210         * Makefile.am: Remove file.
7211         * Makefile.in: Remove file.
7212
7213 2003-07-17  Bruno Haible  <bruno@clisp.org>
7214
7215         * getnline.h: New file.
7216         * getnline.c: New file.
7217         * getndelim2.c: New file, extracted from getline.c.
7218         (getndelim2): Renamed from getdelim2, with added nmax argument.
7219         * getline.c: Include getndelim2.c.
7220         (getdelim2): Moved out to getndelim2.c.
7221         (getline, getdelim): Update.
7222
7223 2003-07-15    <karl@gnu.org>
7224
7225         * vasnprintf.c: update from gettext.
7226
7227 2003-07-15  Jim Meyering  <jim@meyering.net>
7228
7229         * makepath.c (make_path): Enclose diagnostic in _(...).
7230
7231 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7232
7233         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7234         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7235         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7236         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7237         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7238         updated automatically by ../config/srclist-update.  This changes
7239         their license from LPGL to GPL.
7240
7241 2003-07-14  Jim Meyering  <jim@meyering.net>
7242
7243         Don't emit diagnostics.  Let callers do that.
7244         * save-cwd.c: Don't include "error.h".
7245         (save_cwd): Don't call error.  Ensure that errno is valid
7246         when returning nonzero.
7247
7248         * save-cwd.h (restore_cwd): Update prototype.
7249         * save-cwd.c (restore_cwd): Remove two parameters.
7250         Simplify.  Don't call error upon failure.  Let callers do that.
7251         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7252         when auditing is enabled.  But don't bother updating the #if.
7253
7254 2003-07-14  Simon Josefsson  <jas@extundo.com>
7255
7256         * mempcpy.h: New file.
7257         * mempcpy.c: New file.
7258
7259 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7260
7261         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7262         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7263         unicodeio.c, unicodeio.h, unlocked-io.h:
7264         Switch from LGPL to GPL.
7265
7266 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7267
7268         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7269         it breaks C++ compilation.
7270         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7271
7272 2003-07-10  Jim Meyering  <jim@meyering.net>
7273
7274         * vasnprintf.c: Remove trailing blanks.
7275         Make cpp indentation consistent.
7276
7277 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7278
7279         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7280         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7281         Switch from LGPL to GPL.
7282
7283 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7284
7285         * mktime.c: Fix some boundary cases and remove need for floating point.
7286
7287         Issue a compile-time diagnostic if time_t is floating point, or if
7288         two's complement arithmetic is not in effect, or if arithmetic
7289         right shift does not propagate the sign.  These assumptions were
7290         all in the original code but they weren't checked.
7291
7292         (TIME_T_MIDPOINT, verify): New macros.
7293         (__isleap): Remove; it has integer overflow problems.
7294         (leapyear): New function, without those problems.
7295         (ydhms_tm_diff): Remove; splitting into two parts.
7296         (ydhms_diff): New function, containing the arithmetic part of
7297         the old ydhms_tm_diff function.  Issue a compile-time
7298         diagnostic if we are not using C99 integer division.
7299         Avoid casts when possible.
7300         (guess_time_tm): New function, containing the checking part of
7301         the old ydhms_tm_diff function.  Return the new value, rather than
7302         the difference between it and the old.  Accept a new argument T
7303         so that *T specifies the old value.  Check for overflow in the result.
7304
7305         (__mktime_internal): Use a time_t offset, not a long int offset.
7306         This undoes the 2003-06-04 change, which is no longer needed now
7307         that we have better overflow checking.
7308         (localtime_offset): Likewise.
7309
7310         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7311         and long are 64-bit but int is only 32-bit.
7312         (ydhms_diff): Use long int to store year1 and yday1.
7313         Issue a compile-time diagnostic if long int is not wide enough.
7314
7315         (__mktime_internal): Use long int to store adjusted year and yday.
7316         Use plain C rather than preprocessor commands, if that doesn't
7317         affect efficiency.
7318         Check for overflow (and try to repair) after each probe
7319         rather than checking only at the very end.  This avoids some bugs
7320         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7321         does not equal GMT offset at maximum time).
7322         Use integer to check for overflow rather than floating point; this
7323         is more portable to non-IEEE hosts, and is a tad faster.
7324         When we detect that we are oscillating between two values,
7325         don't check whether tm_isdst has the requested value, since
7326         we already know the answer.  When tm_isdst has the wrong value,
7327         use a different heuristic to find the right one, based on the
7328         extreme values actually observed in practice in tz2003a,
7329         rather than the (overly optimistic) "previous 3 calendar quarters".
7330
7331         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7332         "T const" to accommodate glibc style.
7333         (check_result): Use less-confusing report format.  "long" -> "long int.
7334         (main): Likewise.
7335         Don't loop if the iteration overflows time_t.
7336         Allow a negative step in the iteration.
7337
7338 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7339
7340         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7341         having it depend on HAVE_SYS_TYPES_H.
7342
7343 2003-06-25  Bruno Haible  <bruno@clisp.org>
7344
7345         * readlink.c: New file.
7346
7347 2003-06-20  Bruno Haible  <bruno@clisp.org>
7348
7349         Assume C89, so PARAMS isn't needed.
7350         * unicodeio.h (PARAMS): Remove.
7351         * unicodeio.c: Don't use PARAMS.
7352
7353 2003-06-18  Jim Meyering  <jim@meyering.net>
7354
7355         Merge changes from coreutils.
7356         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7357         Remove explicit declarations of xmalloc and realloc.
7358         Include xalloc.h.
7359         (read_utmp): Remove anachronistic cast of xmalloc.
7360
7361 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7362
7363         Assume C89, so PARAMS isn't needed.
7364         * backupfile.h (PARAMS): Remove.  All uses removed.
7365         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7366         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7367         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7368         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7369         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7370         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7371         xstrtol.h: Likewise.
7372         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7373         same.h, strverscmp.h: Do not include config.h; no longer needed.
7374         Anyway, config.h should always be included before any other file.
7375
7376 2003-06-11  Simon Josefsson  <jas@extundo.com>
7377
7378         * sysexit_.h: New file.
7379
7380 2003-05-20  Derek Price  <derek@ximbiot.com>
7381
7382         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7383
7384 2003-06-10  Simon Josefsson  <jas@extundo.com>
7385
7386         * strchrnul.h: New file.
7387         * strchrnul.c: New file.
7388
7389 2003-06-10  Simon Josefsson <jas@extundo.com>
7390
7391         * argp.h: New file, from glibc.
7392         * argp-ba.c: New file, from glibc.
7393         * argp-eexst.c: New file, from glibc.
7394         * argp-fmtstream.c: New file, from glibc.
7395         * argp-fmtstream.h: New file, from glibc.
7396         * argp-fs-xinl.c: New file, from glibc.
7397         * argp-help.c: New file, from glibc.
7398         * argp-namefrob.h: New file, from glibc.
7399         * argp-parse.c: New file, from glibc.
7400         * argp-pv.c: New file, from glibc.
7401         * argp-pvh.c: New file, from glibc.
7402         * argp-xinl.c: New file, from glibc.
7403
7404 2003-06-07  Jim Meyering  <jim@meyering.net>
7405
7406         * readtokens.h: Put `Free Software Foundation, Inc.'
7407         in place of my name in the copyright comment.
7408         Remove definition and uses of __P.
7409
7410         From coreutils.
7411         * stat.c: Don't declare xmalloc explicitly.
7412         Instead, include "xalloc.h".
7413         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7414         xrealloc, and xcalloc return values.
7415         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7416         Improve comment.
7417         * xgetcwd.h: Remove definition/uses of PARAMS.
7418
7419 2003-06-06  Jim Meyering  <jim@meyering.net>
7420
7421         * stdbool_.h: Renamed from stdbool.h.in.
7422
7423 2003-06-06  Jim Meyering  <jim@meyering.net>
7424
7425         Merge from coreutils.
7426         * same.c: (same_name): Declare *_basename locals to be `const'.
7427         Consolidate declarations and initializations of *_base* locals.
7428
7429         Merge from coreutils.
7430         This avoids a core dump on systems without GNU putenv,
7431         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7432         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7433         (unsetenv): New static function, from GNU libc.
7434         (rpl_putenv): Use it.
7435
7436         * modechange.c: Remove trailing blanks.
7437
7438         Merge from coreutils.
7439         * fsusage.c: Remove declaration of statfs.
7440         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7441
7442         * posixtm.c: Include <stdbool.h> unconditionally.
7443
7444 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7445
7446         * mktime.c (__mktime_internal): When resolving a tm_isdst
7447         mismatch, look in future quarters as well as past.  This fixes a
7448         bug when processing fall-backwards gaps immediately after a long
7449         period of daylight-saving time.
7450
7451         * mktime.c: Assume freestanding C89 or better.
7452         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7453         (__P): Remove; not used.
7454         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7455         (mktime, not_equal_tm, print_tm, check_result,
7456         main): Use prototypes.  Use const * where appropriate.
7457         (main): Fix typo in testing code that uncovered by above changes.
7458         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7459
7460 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7461
7462         * mktime.c: Fix Debian bug 177940
7463         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7464         (localtime_offset): Now long int, not time_t, because we want it
7465         to be guaranteed to be signed.  All uses changed.
7466         (__mktime_internal): If overflow would occur when adding offset,
7467         don't add it.
7468
7469         Merge 'human' changes from coreutils.  Rewrite to support
7470         locale-specific notations like thousands separators.
7471         * human.c: Simplify authorship notice.
7472         Include human.h immediately after config.h.
7473         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7474         <limits.h>: Do not include, since human.h does.
7475         (SIZE_MAX, UINTMAX_MAX): New macros.
7476         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7477         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7478         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7479         (power_letter): Renamed from suffixes.
7480         (generate_suffix_backwards): Remove.
7481         (adjust_value): Now takes int style (because of human.h changes)
7482         and long double value (for greater precision on some platforms).
7483         (group_number): New function.
7484         (human_readable): Use it.  Use integer options, not enum.
7485         Put the options before the sizes in the arg list.
7486         Support all the new options.
7487         The old human_readable function has been removed;
7488         use inttostr.h instead.
7489         (human_readable, default_block_size, humblock):
7490         Use uintmax_t, not int, for block sizes.
7491         (human_readable_inexact, block_size_types): Remove.
7492         (block_size_opts): New constant.
7493         (human_options): Renamed from human_block_size, with new signature
7494         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7495         * human.h: Add copyright and authorship notice.
7496         Include <limits.h> and <stdbool.h> unconditionally.
7497         (PARAMS): Remove.  All uses removed.
7498         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7499         (enum human_inexact_style): Remove tag; now a nameless enum.
7500         (human_floor, human_ceiling, human_round_to_even): Now have
7501         values 2, 0, 1 rather than -1, 1, 0.
7502         (human_group_digits, human_suppress_point_zero, human_autoscale,
7503         human_base_1024, human_SI, human_B): New constants.
7504         (human_readable_inexact, human_block_size): Remove.
7505         (human_readable): Size args are now uintmax_t, not int.
7506         (human_options): New decl.
7507
7508         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7509         unnecessary now that we assume C89 or better.  This change
7510         imported from coreutils.
7511
7512         * mktime.c (__mktime_internal): Do not reject negative timestamps
7513         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7514         in the 2003-05-30 sync from glibc.
7515
7516         .h files should stand alone, but we shouldn't include <sys/types.h>
7517         if we can get away with just <stddef.h>.
7518
7519         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7520         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7521         rather than <sys/types.h>, as we merely need size_t.
7522         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7523         to get size_t.
7524         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7525         Include <stdio.h>, to get FILE.
7526         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7527         memcasecmp.h has included <stddef.h> and all we need is size_t.
7528         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7529         our interface, instead of including <sys/types.h>
7530
7531 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7532
7533         [from coreutils]
7534         Fix some minor time-related bugs with POSIX time arguments.
7535         Some valid time stamps were being rejected (notably -1, and
7536         time stamps before 1900 on 64-bit hosts).  And some invalid
7537         time stamps were being accepted, e.g. September 31.
7538
7539         * posixtm.h (posixtime): Return bool instead of time_t, so
7540         that we can return (time_t) -1 successfully.
7541         * posixtm.c: Likewise.
7542         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7543         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7544         (t): Remove static var.
7545         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7546         of static var.  All uses changed.
7547         (year): Do not reject years before 1900; they can occur with
7548         64-bit time_t.
7549         (posix_time_parse): Do not check for out-of-range components;
7550         that is now the caller's responsibility, since our checks were
7551         only approximations.
7552         (posixtime): Use mktime to check for out-of-range components,
7553         since it knows them exactly.
7554         If mktime returns (time_t) -1, check whether an error actually occurred
7555         by invoking localtime on -1.
7556         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7557         posixtime failures better.
7558         Improve the test data (in comments only).
7559
7560 2003-05-30    <karl@gnu.org>
7561
7562         * mktime.c: update from libc.
7563
7564 2003-05-30  Bruno Haible  <bruno@clisp.org>
7565
7566         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7567         * localcharset.h: Likewise.
7568         * localcharset.c: Likewise.
7569
7570 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7571
7572         Assume the headers required for C89 freestanding compilers.
7573         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7574         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7575         without checking for HAVE_LIMITS_H.
7576         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7577         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7578         to do that.
7579         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7580         * exclude.c: Include <stdbool.h> unconditionally.
7581         * tempname.c: Include <stddef.h> unconditionally.
7582         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7583         * modechange.c, rpmatch.c (NULL): Don't define, since
7584         <stddef.h> does that.
7585         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7586         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7587         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7588         * xstrtol.c: Likewise.
7589         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7590         * savedir.c: Include <stddef.h> instead of defining NULL.
7591
7592         * addext.c (addext): Use assignment rather than cast, to avoid
7593         warnings on some platforms.
7594
7595         * mktime.c (__mktime_internal): Do not reject negative timestamps
7596         arbitrarily.
7597
7598 2003-05-10  Bruno Haible  <bruno@clisp.org>
7599
7600         * linebreak.c (iconv_string_length): Don't return -1 just because the
7601         string is longer than 4 KB.
7602
7603 2003-05-12  Jim Meyering  <jim@meyering.net>
7604
7605         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7606         the space-padded-by-default conversion specifiers, %e, %k, %l.
7607
7608 2003-05-03  Bruno Haible  <bruno@clisp.org>
7609
7610         Upgrade to Unicode-4.0.
7611         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7612         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7613         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7614         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7615         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7616         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7617         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7618         Change width of U+E0100..U+E01EF from 1 to 0.
7619
7620 2003-04-25  Bruno Haible  <bruno@clisp.org>
7621
7622         * copy-file.c: Include <stddef.h>, for size_t.
7623
7624 2003-04-25  Jim Meyering  <jim@meyering.net>
7625
7626         * copy-file.c (copy_file_preserving): Declare buf_size to be
7627         of type size_t, not int.
7628
7629 2003-04-11  Jim Meyering  <jim@meyering.net>
7630
7631         Merge changes from Coreutils.
7632
7633         2003-03-22  Jim Meyering  <jim@meyering.net>
7634
7635         * strftime.c (widen): Cast alloca return value to proper type.
7636
7637         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7638
7639         From GNU libc.
7640         * strftime.c (my_strftime): Handle very large width
7641         specifications for numeric values correctly.  Improve checks for
7642         overflow.
7643
7644         2003-01-19  Jim Meyering  <jim@meyering.net>
7645
7646         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7647         (nl_get_alt_digit) [! defined my_strftime]: Define.
7648         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7649         _nl_get_alt_digit and _nl_get_walt_digit.
7650
7651         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7652         These changes have no effect outside of _LIBC.
7653
7654 2003-04-10  Bruno Haible  <bruno@clisp.org>
7655
7656         * findprog.h: New file, from GNU gettext.
7657         * findprog.c: New file, from GNU gettext.
7658
7659 2003-04-05  Jim Meyering  <jim@meyering.net>
7660
7661         Merge changes from Coreutils.
7662
7663         * exclude.h (PARAMS): Remove definition and uses.
7664         * exclude.c: Remove uses of `PARAMS'.
7665
7666         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7667         Add test-cases for DOS filenames. Declare program_name.
7668         (main): Set up program_name.  Patch by Rich Dawe.
7669
7670         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7671         error from mntctl.
7672         Use mntctl's return value to drive the entry-processing loop, since
7673         we can't rely on the value of the vmt_length member in the last
7674         entry.  On some systems doing so could result in exhausting
7675         virtual memory.  Based in part on a patch from Mike Jetzer.
7676
7677 2003-04-04  Bruno Haible  <bruno@clisp.org>
7678
7679         * linebreak.h: New file, from GNU gettext.
7680         * linebreak.c: New file, from GNU gettext with slight modifications.
7681         * lbrkprop.h: New file, from GNU gettext.
7682
7683 2003-04-03  Bruno Haible  <bruno@clisp.org>
7684
7685         * utf8-ucs4.h: New file, from GNU gettext.
7686         * utf16-ucs4.h: New file, from GNU gettext.
7687         * ucs4-utf8.h: New file, from GNU gettext.
7688         * ucs4-utf16.h: New file, from GNU gettext.
7689
7690 2003-04-02  Bruno Haible  <bruno@clisp.org>
7691
7692         * binary-io.h: New file, from GNU gettext.
7693
7694 2003-04-01  Bruno Haible  <bruno@clisp.org>
7695
7696         * pathname.h: New file, from GNU gettext.
7697         * concatpath.c: New file, from GNU gettext.
7698
7699 2003-03-30  Bruno Haible  <bruno@clisp.org>
7700
7701         * copy-file.c (copy_file_preserving): Don't set owner if the function
7702         chown() doesn't exist.
7703
7704 2003-03-28  Bruno Haible  <bruno@clisp.org>
7705
7706         * copy-file.h: New file, from GNU gettext.
7707         * copy-file.c: New file, from GNU gettext.
7708
7709 2003-03-18  Jim Meyering  <jim@meyering.net>
7710
7711         * quote.c (quote_n): Fix typo in comment.
7712
7713 2003-03-14  Jim Meyering  <jim@meyering.net>
7714
7715         Merge changes from Coreutils.
7716         * obstack.h (obstack_object_size): Declare temporary, __o,
7717         to be const, in order to avoid warnings.
7718         (obstack_room): Likewise.
7719         (obstack_empty_p): Likewise.
7720
7721 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7722
7723         Merge changes from Bison.
7724         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7725         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7726         when compiling Bison 1.875's `bitset bset = obstack_alloc
7727         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7728         * hash.c: Include <stdbool.h> unconditionally.
7729
7730 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7731
7732         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7733         Reported by Bruce Becker; see:
7734         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7735
7736 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7737             Bruno Haible  <bruno@clisp.org>
7738
7739         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7740         Reported by John Hughes, see
7741         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7742
7743 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7744
7745         * poll_.h: New file.
7746         * poll.c: New file.
7747
7748 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7749
7750         * mathl.h: New file.
7751         * acosl.c: New file.
7752         * asinl.c: New file.
7753         * atanl.c: New file.
7754         * ceill.c: New file.
7755         * cosl.c: New file.
7756         * expl.c: New file.
7757         * floorl.c: New file.
7758         * frexpl.c: New file.
7759         * ldexpl.c: New file.
7760         * logl.c: New file.
7761         * sincosl.c: New file.
7762         * sinl.c: New file.
7763         * sqrtl.c: New file.
7764         * tanl.c: New file.
7765         * trigl.c: New file.
7766         * trigl.h: New file.
7767
7768 2003-02-17  Bruno Haible  <bruno@clisp.org>
7769
7770         * mkdtemp.h: New file, from GNU gettext.
7771         * mkdtemp.c: New file, from GNU gettext.
7772
7773 2003-01-31  Bruno Haible  <bruno@clisp.org>
7774
7775         * rename.c: #undef rename before defining rpl_rename.
7776         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7777
7778 2003-01-30  Bruno Haible  <bruno@clisp.org>
7779
7780         * printf-args.h: New file, from GNU gettext.
7781         * printf-args.c: New file, from GNU gettext.
7782         * printf-parse.h: New file, from GNU gettext.
7783         * printf-parse.c: New file, from GNU gettext.
7784         * vasnprintf.h: New file, from GNU gettext.
7785         * vasnprintf.c: New file, from GNU gettext.
7786         * asnprintf.c: New file, from GNU gettext.
7787         * vasprintf.h: New file, from GNU gettext with modifications.
7788         * vasprintf.c: New file, from GNU gettext.
7789         * asprintf.c: New file, from GNU gettext.
7790
7791 2003-01-29  Bruno Haible  <bruno@clisp.org>
7792
7793         * stpncpy.h: New file, from GNU gettext with modifications.
7794         * stpncpy.c: New file, from GNU gettext with modifications.
7795
7796 2003-01-28  Bruno Haible  <bruno@clisp.org>
7797
7798         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7799         Paul Eggert.
7800         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7801         Paul Eggert.
7802
7803 2003-01-27  Bruno Haible  <bruno@clisp.org>
7804
7805         * xsetenv.h: New file, from GNU gettext.
7806         * xsetenv.c: New file, from GNU gettext.
7807
7808 2003-01-23  Bruno Haible  <bruno@clisp.org>
7809
7810         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7811
7812 2003-01-22  Bruno Haible  <bruno@clisp.org>
7813
7814         * exit.h: New file, from GNU gettext.
7815
7816 2003-01-11  Bruno Haible  <bruno@clisp.org>
7817
7818         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7819         * strcase.h (strcasecmp, strncasecmp): Likewise.
7820
7821 2003-01-14  Jim Meyering  <jim@meyering.net>
7822
7823         * same.c (same_name): Tweak a comment.
7824
7825 2003-01-11  Bruno Haible  <bruno@clisp.org>
7826
7827         * same.c (same_name): Reorder tests so as to avoid calling stat()
7828         when a string comparison is sufficient.
7829
7830 2003-01-11  Bruno Haible  <bruno@clisp.org>
7831
7832         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7833         'unsigned int'.
7834
7835 2003-01-11  Bruno Haible  <bruno@clisp.org>
7836
7837         * hash-pjw.c: Add comment about low quality of this function.
7838
7839 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7840
7841         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7842         to avoid collisions with libcurses and libreadline.
7843
7844         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7845         * getstr.h, getstr.c: Remove.
7846         * getline.c: Include "getline.h", to check interface.
7847         Move body of old getstr.c here: this defines MIN_CHUNK and
7848         declares getdelim2, which is renamed from getstr.
7849         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7850
7851         * linebuffer.c (readlinebuffer): Renamed from readline.
7852         All uses changed.
7853         * linebuffer.h: Likewise.
7854         (readline): Remove backward-compatibility macro.
7855
7856 2003-01-12  Jim Meyering  <jim@meyering.net>
7857
7858         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7859
7860 2003-01-10  Bruno Haible  <bruno@clisp.org>
7861
7862         * alloca_.h: New file.
7863         * getdate.y: Unconditionally include alloca.h.
7864         * makepath.c: Likewise.
7865         * setenv.c: Likewise.
7866         * userspec.c: Likewise.
7867
7868 2003-01-09  Bruno Haible  <bruno@clisp.org>
7869
7870         * stdbool.h.in: New file.
7871
7872 2003-01-08  Bruno Haible  <bruno@clisp.org>
7873
7874         * safe-read.c: Include specification header first, to ensure its
7875         selfcontainedness.
7876         * full-write.c: Likewise.
7877
7878 2003-01-08  Jim Meyering  <jim@meyering.net>
7879
7880         * full-write.c: Undefine and define-away `const' after inclusion
7881         of errno.h, not before.  Suggestion from Bruno Haible.
7882
7883 2003-01-07  Jim Meyering  <jim@meyering.net>
7884
7885         * full-write.c: Rework so that it may serve to define full_read, too.
7886         * full-read.c: Simply #define FULL_READ and include full-write.c.
7887
7888 2003-01-06  Jim Meyering  <jim@meyering.net>
7889
7890         * version-etc.c: Update year in translatable copyright string.
7891
7892 2002-12-25  Bruno Haible  <bruno@clisp.org>
7893
7894         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7895         * xstrtol.h: Likewise.
7896         * xstrtoimax.c: Likewise.
7897         * xstrtoumax.c: Likewise.
7898         * human.h: Likewise.
7899
7900         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7901         on systems that have <inttypes.h> but not <stdint.h>.
7902
7903 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7904
7905         * memcoll.c (memcoll): Fall back on a simple algorithm using
7906         memcmp if strcoll doesn't work.
7907
7908 2002-12-23  Bruno Haible  <bruno@clisp.org>
7909
7910         * localcharset.h: New file.
7911         * localcharset.c: Include it.
7912         * unicodeio.c: Likewise.
7913
7914 2002-12-22  Bruno Haible  <bruno@clisp.org>
7915
7916         * utime.c (utime_null): No need to call ftruncate if the file was
7917         nonempty.
7918
7919 2002-12-23  Bruno Haible  <bruno@clisp.org>
7920
7921         * memcoll.c (STRCOLL): New macro.
7922         (memcoll): Use it.
7923
7924 2002-12-22  Bruno Haible  <bruno@clisp.org>
7925
7926         * getstr.h (getstr): Define, to avoid clash with libcurses.
7927         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7928
7929 2002-12-22  Bruno Haible  <bruno@clisp.org>
7930
7931         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7932
7933 2002-12-23  Bruno Haible  <bruno@clisp.org>
7934
7935         * getline.h: Include <stddef.h>, for size_t.
7936
7937         * unicodeio.h: Include <stddef.h>, for size_t.
7938         * unicodeio.c: Don't include <stddef.h>.
7939
7940 2002-12-17  Bruno Haible  <bruno@clisp.org>
7941
7942         * canon-host.c (strdup): Remove unused declaration.
7943
7944         * fsusage.c: Include full_read.h.
7945         (get_fs_usage): Use full_read instead of safe_read.
7946
7947         * utime.c (utime_null): Use SAFE_READ_ERROR.
7948
7949 2002-12-11  Bruno Haible  <bruno@clisp.org>
7950
7951         * setenv.h: Rewritten to cope with systems that have setenv() but not
7952         unsetenv().
7953         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7954         modifications:
7955
7956         2002-12-11  Bruno Haible  <bruno@clisp.org>
7957
7958                 * setenv.c (alloca): Fall back to malloc.
7959                 (freea): New macro.
7960                 (setenv): Use freea() to free memory allocated with alloca().
7961
7962         2002-11-13  Bruno Haible  <bruno@clisp.org>
7963
7964                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7965                 function declarations.
7966                 * unsetenv.c (unsetenv): Likewise.
7967
7968         2002-03-04  Bruno Haible  <bruno@clisp.org>
7969
7970                 Portability to AIX 4.3.3.
7971                 * unsetenv.c: New file, extracted from setenv.c.
7972                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7973
7974         2001-12-20  Bruno Haible  <bruno@clisp.org>
7975
7976                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7977                 use malloc instead. For SunOS 4.
7978
7979         2001-12-11  Bruno Haible  <bruno@clisp.org>
7980
7981                 * setenv.c: Declare alloca.
7982                 (compar_fn_t): New typedef.
7983                 (KNOWN_VALUE, STORE_VALUE): Use it.
7984
7985         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7986         setenv.h.
7987
7988 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7989
7990         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7991         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7992         Choose values that are less likely to collide with system fnmatch
7993         options.
7994         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7995         defined (e.g., a pure POSIX system).
7996         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7997         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7998
7999 2002-12-06  Jim Meyering  <jim@meyering.net>
8000
8001         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8002
8003         Merge in changes from libc's misc/error.c, in preparation
8004         for the merge of gnulib's changes back into libc.
8005
8006         * error.c (_): Define only if not already defined.
8007         Move definition to follow all #include directives.
8008         Include unlocked-io.h only if !_LIBC.
8009         [_LIBC]: Include <libio/libioP.h>.
8010         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8011         (fflush): Tweak definition to use INTUSE.
8012         (putc): Define.
8013
8014 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8015
8016         * alloca.c [defined emacs]: Include "lisp.h".
8017         (xalloc_die) [defined emacs]: New macro.
8018         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8019         [! defined emacs]: Include <xalloc.h>.
8020         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8021         (pointer): Typedef to POINTER_TYPE *.
8022         (malloc): Remove decl; we now always use xmalloc.
8023         (alloca): Use old-style definition, since Emacs needs this.
8024         Check for arithmetic overflow when computing combined size.
8025
8026 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8027
8028         Do not generate unlocked-io.h automatically, since it's easier to
8029         maintain it by hand.
8030
8031         * unlocked-io.h: New file, from GNU diffutils,
8032         but with proper copyright notice and attribution.
8033         * gen-uio: Remove.
8034         * Makefile.am: Add copyright notice.
8035         (libfetish_a_SOURCES): Add unlocked-io.h.
8036         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8037         (DISTCLEANFILES, io_functions): Remove macros.
8038         (EXTRA_DIST): Remove gen_uio.
8039         (unlocked-io.h): Remove rule.
8040
8041 2002-12-04  Jim Meyering  <jim@meyering.net>
8042
8043         Reflect the fact that stat.c and lstat.c are no longer generated.
8044         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8045         (DISTCLEANFILES): Likewise.
8046         (EXTRA_DIST): Likewise.
8047         (all_local): Don't depend on stat.c or lstat.c.
8048         (stat.c, lstat.c): Remove rules.
8049         (EXTRA_DIST): Remove xstat.in.
8050
8051         * xstat.in: Remove file.  Contents moved into stat.c.
8052         * stat.c: New file.  Contents mostly from xstat.in.
8053         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8054         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8055
8056         * safe-read.c: Rework so that it may serve to define safe_write, too.
8057         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8058
8059 2002-12-03  Jim Meyering  <jim@meyering.net>
8060
8061         * safe-read.c, safe-write.c: Change variable names and comments, but
8062         not semantics, to minimize the differences between these two files.
8063         (safe_read): Change comment to mention SAFE_READ_ERROR.
8064
8065         * safe-read.c (IS_EINTR): Define.
8066         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8067
8068 2002-12-02  Bruno Haible  <bruno@clisp.org>
8069
8070         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8071         Define, taken from safe-read.c.
8072         (INT_MAX): Provide fallback.
8073         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8074         * safe-write.h (SAFE_WRITE_ERROR): Define.
8075
8076         * safe-read.c (EINTR): Remove definition.
8077         (safe_read): Don't use EINTR if it is absent.
8078
8079 2002-12-02  Jim Meyering  <jim@meyering.net>
8080
8081         * safe-read.c (EINTR): Define.
8082         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8083         (INT_MAX): Provide fallback.
8084         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8085
8086         * safe-read.h (SAFE_READ_ERROR): Define.
8087
8088 2002-12-01  Jim Meyering  <jim@meyering.net>
8089
8090         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8091         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8092
8093 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8094
8095         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8096         hash_rehash): Replace `if (limit <= value) abort ();' with
8097         `if (! (value < limit)) abort ();', for readability.
8098
8099 2002-11-26    <karl@gnu.org>
8100
8101         * strdup.c: copy from libc again, with jim's ok.
8102         * .cppi-disable: re-add strdup.c
8103
8104 2002-11-25    <karl@gnu.org>
8105
8106         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8107         instead of "strtol.c".
8108
8109 2002-11-25  Jim Meyering  <jim@meyering.net>
8110
8111         * mktime.c: Sync from libc, now that it has the latest fix.
8112
8113 2002-11-24    <karl@gnu.org>
8114
8115         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8116         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8117
8118 2002-11-24  Jim Meyering  <jim@meyering.net>
8119
8120         Update from coreutils:
8121
8122         * mktime.c: Merge in changes from libc.
8123
8124         Avoid a link-time failure on some Linux systems.
8125         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8126         (__mon_yday): Declare with the STATIC attribute.
8127         (__mktime_internal): Likewise.
8128         Based on a report from Greg Schafer.
8129
8130 2002-11-23  Jim Meyering  <jim@meyering.net>
8131
8132         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8133         Use `unsigned', not `int', as type of index.
8134
8135         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8136
8137         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8138
8139 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8140
8141         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8142         hint that one should use `if (! x) abort ();' rather than `assert
8143         (x);', and anyway it's one less thing to worry about configuring.
8144         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8145         hash_rehash, hash_insert): Use abort rather than assert.
8146
8147 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8148
8149         * quotearg.h: Allow multiple inclusion by surrounding with
8150         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8151         so that we can be included first.
8152         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8153         * quotearg.c: Include quotearg.h immediately after config.h.
8154         No need to include stddef.h or sys/types.h any more.
8155         Surround local include files with "", not "<>".
8156         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8157         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8158         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8159         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8160         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8161         (ISPRINT): Remove; no longer needed now that we assume C89.
8162
8163         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8164         Preserve errno.
8165
8166         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8167         quotearg_char): Use SIZE_MAX rather than
8168         (size_t) -1 when we are talking about "infinity".
8169
8170         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8171
8172 2002-11-22  Bruno Haible  <bruno@clisp.org>
8173
8174         * safe-read.h: Assume C89. Add comments.
8175         (safe_read): Change return type to size_t.
8176         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8177         counts > SSIZE_MAX correctly.
8178         * safe-write.h: New file.
8179         * safe-write.c: New file.
8180         * full-read.h: New file.
8181         * full-read.c: New file.
8182         * full-write.h: Assume C89. Add comments.
8183         * full-write.c: Include safe-write.h.
8184         (full_write): Rewritten to use safe_write.
8185         Suggested by Jim Meyering and Paul Eggert.
8186
8187 2002-11-21  Bruno Haible  <bruno@clisp.org>
8188
8189         Remove case insensitive option matching.
8190         * argmatch.h (argcasematch): Remove declaration.
8191         (ARGCASEMATCH): Remove macro.
8192         (__xargmatch_internal): Remove case_sensitive argument.
8193         (XARGMATCH): Update.
8194         (XARGCASEMATCH): Remove macro.
8195         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8196         case_sensitive argument.
8197         (argcasematch): Remove function.
8198         (__xargmatch_internal): Remove case_sensitive argument.
8199         (main): Use XARGMATCH instead of XARGCASEMATCH.
8200
8201         * xmalloc.c: Change compile-time error message. Add comment about
8202         required autoconf version.
8203
8204 2002-11-21  Jim Meyering  <jim@meyering.net>
8205
8206         * strdup.c (strdup): Tweak comment and initial #if/#include.
8207
8208         Merge in changes from the coreutils.
8209
8210         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8211         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8212         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8213         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8214         int.  Work more efficiently if X is the same width as uintmax_t.
8215         Do not compare X to -1, to avoid bogus compiler warning.
8216         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8217         Don't assume that f_frsize and f_bsize are the same type.
8218
8219         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8220         on FreeBSD.
8221
8222         * makepath.c (make_path): Restore umask *before* creating the final
8223         component.
8224         (make_path): Minor reformatting.
8225
8226         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8227         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8228
8229         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8230         ones.  At least on GNU/Linux systems, `auto' means something else.
8231         From Michael Stone.
8232
8233 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8234
8235         Merge argmatch cleanups from Bison.  Assume C89.
8236
8237         * argmatch.c: Include config.h here, not in argmatch.h.
8238         Include stdlib.h, for EXIT_FAILURE.
8239         Always include <string.h>, since we assume C89.
8240         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8241         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8242         Include <stddef.h> instead, since it's all we need for size_t.
8243         (PARAMS): Remove.  All uses removed.
8244         (ARRAY_CARDINALITY): Do not bother to #undef.
8245         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8246         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8247         Remove unnecessary parentheses.
8248         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8249         Insert necessary parentheses.
8250         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8251         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8252
8253 2002-11-19  Bruno Haible  <bruno@clisp.org>
8254
8255         * mbswidth.c: Include mbswidth.h right at the beginning.
8256         * mbswidth.h: Include <stddef.h>, for size_t.
8257
8258         * mbswidth.h (PARAMS): Remove macro.
8259         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8260         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8261
8262         * gcd.h (PARAMS): Remove macro.
8263         (gcd): Use ANSI C function declarations.
8264         * gcd.c (gcd): Likewise.
8265
8266 2002-11-15  Bruno Haible  <bruno@clisp.org>
8267
8268         * strcspn.c: Include <stddef.h>.
8269         (strcspn): Use ANSI C function declaration. Change return type to
8270         size_t. Use NULL.
8271         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8272         (strpbrk): Use NULL.
8273         * strpbrk.h (PARAMS): Remove macro.
8274         (strpbrk): Use ANSI C function declaration.
8275         * strstr.c: Don't include <sys/types.h>.
8276         * strstr.h (PARAMS): Remove macro.
8277         (strstr): Use ANSI C function declarations.
8278
8279 2002-11-06  Bruno Haible  <bruno@clisp.org>
8280
8281         * gcd.h (gcd): Change argument type to 'unsigned long'.
8282         * gcd.c (gcd): Likewise.
8283
8284 2002-11-05  Bruno Haible  <bruno@clisp.org>
8285
8286         * gcd.h: New file, from gettext-0.11.5.
8287         * gcd.c: New file, from gettext-0.11.5.
8288
8289 2002-11-05  Bruno Haible  <bruno@clisp.org>
8290
8291         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8292         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8293         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8294         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8295
8296         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8297         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8298
8299         * closeout.c: Include gettext.h instead of <libintl.h>.
8300         * human.c: Include gettext.h instead of <libintl.h>.
8301         * quotearg.c: Include gettext.h instead of <libintl.h>.
8302         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8303         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8304         * userspec.c: Include gettext.h instead of <libintl.h>.
8305         * version-etc.c: Include gettext.h instead of <libintl.h>.
8306         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8307         (textdomain): Remove definition.
8308         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8309
8310         * long-options.c: Remove include of <libintl.h> and definition of _.
8311         * same.c: Remove include of <libintl.h> and definition of _.
8312
8313 2002-11-04  Bruno Haible  <bruno@clisp.org>
8314
8315         * stpcpy.h: New file, from GNU gettext-0.11.5.
8316         * strcase.h: New file, from GNU gettext-0.11.5.
8317         * strpbrk.h: New file, from GNU gettext-0.11.5.
8318         * strstr.h: New file, from GNU gettext-0.11.5.
8319         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8320
8321 2002-05-09  Bruno Haible  <bruno@clisp.org>
8322
8323         * config.charset: Update for newest glibc. Add canonical names
8324         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8325
8326 2002-05-09  Bruno Haible  <bruno@clisp.org>
8327
8328         * localcharset.c (get_charset_aliases): Add more Windows specific
8329         aliases.
8330
8331 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8332
8333         * config.charset: A few additions for Solaris.
8334
8335 2001-12-05  Bruno Haible  <bruno@clisp.org>
8336
8337         * localcharset.c (locale_charset): Don't return an empty string.
8338
8339 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8340
8341         * config.charset: msdos in uk_UA uses CP1125.
8342
8343 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8344
8345         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8346         * localcharset.c (locale_charset): Declare as extern "C".
8347
8348 2002-02-15  Bruno Haible  <bruno@clisp.org>
8349
8350         * config.charset [msdosdjgpp]: For Russian, use CP866.
8351
8352 2002-02-11  Bruno Haible  <bruno@clisp.org>
8353
8354         * config.charset: Add support for NetBSD.
8355
8356 2002-09-25    <karl@gnu.org>
8357
8358         * strdup.c: copy from libc/string (via ../config/srclist*).
8359         * getopt*: copy from libc/posix.
8360         * gettext.h: copy from gettext.
8361         * .cppi-disable: add strdup.c, gettext.h.
8362
8363 2002-07-01  Jim Meyering  <meyering@lucent.com>
8364
8365         * c-stack.c: Include sys/time.h.
8366         From Volker Borchert.
8367
8368 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8369
8370         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8371         New macro.  Use it uniformly instead of
8372         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8373         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8374         reported by Vin Shelton.
8375
8376 2002-06-22  Jim Meyering  <meyering@lucent.com>
8377
8378         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8379         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8380
8381 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8382
8383         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8384         Do not assume SA_SIGINFO behavior.
8385         Bug reported by Jim Meyering on NetBSD 1.5.2.
8386
8387 2002-06-22  Jim Meyering  <meyering@lucent.com>
8388
8389         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8390
8391         * exitfail.c, exitfail.h: Likewise.
8392         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8393
8394         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8395         of fnmatch.h.
8396         (EXTRA_DIST): Add fnmatch_loop.c.
8397         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8398
8399         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8400         * fnmatch.c: Update from diffutils-2.8.2.
8401         * fnmatch_.h: New file.  From diffutils-2.8.2.
8402         * fnmatch.h: Remove file.
8403
8404 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8405
8406         * file-type.h: Report an error if neither S_ISREG nor
8407         S_IFREG is defined, instead of using a test specific to glibc
8408         2.2.  This should be safe, since POSIX requires S_ISREG and
8409         Unix Version 7 had S_IFREG.  We don't need to check for
8410         <sys/types.h> since we don't use any symbols that it defines.
8411
8412 2002-06-15  Jim Meyering  <meyering@lucent.com>
8413
8414         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8415         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8416         have been included before this file.
8417
8418 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8419
8420         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8421         so that each temporary file name is unique and valid in the first
8422         8 characters, for operation under DOS.
8423
8424 2002-06-15  Jim Meyering  <meyering@lucent.com>
8425
8426         Work even with DJGPP 2.03, which lacks support for symlinks.
8427         From Richard Dawe.
8428         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8429         is defined.
8430         * lchown.c (S_ISLNK): Likewise.
8431
8432 2002-06-14  Jim Meyering  <meyering@lucent.com>
8433
8434         * file-type.h: Use the version from diffutils-2.8.2.
8435         * file-type.c: Likewise.
8436
8437 2002-05-27  Jim Meyering  <meyering@lucent.com>
8438
8439         Fix a problem seen only on nonconforming systems whereby ls.c's
8440         use of localtime, and then of gettimeofday would cause trouble:
8441         the localtime call used to initialize rpl_gettimeofday's save
8442         mechanism would clobber ls's current local time information so
8443         that in any long listing the first file would always be listed
8444         with date 1970-01-01.  Analysis by Volker Borchert.
8445
8446         * gettimeofday.c (localtime): Undefine.
8447         (rpl_localtime): New function.
8448
8449 2002-05-22  Jim Meyering  <meyering@lucent.com>
8450
8451         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8452         * file-type.h: New file.
8453         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8454
8455 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8456
8457         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8458
8459 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8460
8461         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8462         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8463         of 127, since 64 is the largest conceivable number for ancient
8464         nonstandard hosts.
8465         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8466
8467 2002-04-28  Jim Meyering  <meyering@lucent.com>
8468
8469         * sig2str.c (WTERMSIG): Remove definition (unused).
8470
8471 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8472
8473         * sig2str.h, sig2str.c: New files.
8474         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8475
8476 2002-04-24  Jim Meyering  <meyering@lucent.com>
8477
8478         * gettext.h: New file, from Gettext.
8479         * Makefile.am (INCLUDES): Remove -I../intl.
8480         (libfetish_a_SOURCES): Add gettext.h.
8481
8482 2002-04-16  Jim Meyering  <meyering@lucent.com>
8483
8484         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8485         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8486         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8487
8488 2002-04-12  Jim Meyering  <meyering@lucent.com>
8489
8490         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8491
8492 2002-03-10  Jim Meyering  <meyering@lucent.com>
8493
8494         * makepath.c (make_path): Remove a comma from a diagnostic.
8495         Suggestion from Santiago Vila.
8496
8497 2002-03-08  Jim Meyering  <meyering@lucent.com>
8498
8499         * rename.c: Mention that this wrapper is needed also on
8500         mips-dec-ultrix4.4 systems.
8501
8502 2002-03-02  Jim Meyering  <meyering@lucent.com>
8503
8504         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8505         not HAVE_CLOCK_SETTIME.
8506
8507 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8508
8509         * nanosleep.h: Rename to....
8510         * timespec.h: New name for nanosleep.h.  All uses changed.
8511
8512         * gettime.c: New file.
8513         * settime.c: New file.
8514         * stime.c: Remove.
8515
8516         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8517         timespec.h.  Remove nanosleep.h.
8518
8519 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8520
8521         * acl.c, acl.h: New files.
8522         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8523
8524 2002-02-24  Jim Meyering  <meyering@lucent.com>
8525
8526         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8527         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8528         cause trouble.  Reported by Nelson Beebe.
8529
8530 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8531
8532         * path-concat.c (xpath_concat): Reorder code to pacify
8533         compilers that don't know that xalloc_die never returns.
8534
8535 2002-02-20  Jim Meyering  <meyering@lucent.com>
8536
8537         * getdate.c: Regenerate using bison-1.33.
8538
8539 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8540
8541         * posixver.c, posixver.h: New files.
8542         * Makefile.am (libfetish_a_SOURCES): Add them.
8543
8544 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8545             Bruno Haible  <bruno@clisp.org>
8546
8547         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8548         (fwrite_success_callback): New declaration.
8549         * unicodeio.c (unicode_to_mb): New function, extracted from
8550         print_unicode_char. Call failure callback instead of error.
8551         (fwrite_success_callback): New function.
8552         (exit_failure_callback): New function.
8553         (fallback_failure_callback): New function.
8554         (print_unicode_char): Call unicode_to_mb.
8555
8556 2002-01-26  Jim Meyering  <meyering@lucent.com>
8557
8558         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8559
8560 2002-01-22  Jim Meyering  <meyering@lucent.com>
8561
8562         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8563         Otherwise, some versions of automake would omit the rule that makes
8564         Makefile from Makefile.in.
8565
8566 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8567
8568         * xmemcoll.h, xmemcoll.c: New files.
8569         * Makefile.am (libfetish_a_SOURCES): Add them.
8570         * memcoll.c: Include errno.h, and declare errno if not defined.
8571         (memcoll): Set errno to zero if there is no error.
8572
8573         * quotearg.c (quotearg_buffer_restyled):
8574         Fix bug with quoting buffers containing NUL when backslashing escapes.
8575         This bug was exposed by the other changes in this patch.
8576         (quotearg_n_options): New arg ARGSIZE.
8577         All callers changed.
8578         (quoting_options_from_style): New function.
8579         (quotearg_n_style): Use it.
8580         (quotearg_n_style_mem): New function.
8581
8582         * quotearg.h (quotearg_n_style_mem): New function.
8583
8584 2002-01-16  Jim Meyering  <meyering@lucent.com>
8585
8586         * getdate.y: Add three semicolons, each just before a closing brace.
8587         Bison (as of version 1.31) no longer papers over that mistake.
8588
8589 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8590
8591         * backupfile.c (ISDIGIT): Comment fix.
8592         * getdate.y (ISDIGIT): Likewise.
8593         * posixtm.c (ISDIGIT, year): Likewise.
8594         * strverscmp.c (ISDIGIT): Likewise.
8595         * userspec.c (ISDIGIT): Likewise.
8596
8597 2002-01-05  Jim Meyering  <meyering@lucent.com>
8598
8599         * version-etc.c (version_etc_copyright): Update copyright year.
8600
8601 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8602
8603         * closeout.c (close_stdout_status): If ferror (stdout), do
8604         not silently exit merely because the output buffer happens to
8605         have nothing pending.
8606
8607 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8608
8609         See the big note in ../ChangeLog.
8610         * human.c (suffixes): Prefer K to k for 1024.
8611         (generate_suffix_backwards): New function.
8612         (human_readable_inexact): Use it.
8613         * xstrtol.c (__xstrtol): If there is no number but there
8614         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8615         Accept 'K' as well as 'k'.
8616
8617 2001-12-15  Jim Meyering  <meyering@lucent.com>
8618
8619         * regex.h (__restrict_arr): Update from libc.
8620
8621         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8622         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8623         (STREQ): Define.
8624
8625 2001-12-10  Jim Meyering  <meyering@lucent.com>
8626
8627         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8628         Instead, include "xalloc.h".
8629         (initbuffer): Don't cast xmalloc return value to char*.
8630         (readline): Reword comment.
8631         Don't cast xrealloc return value to char*
8632         Return NULL, not 0.
8633
8634 2001-12-09  Jim Meyering  <meyering@lucent.com>
8635
8636         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8637         `signed and unsigned type in conditional expression'.
8638         * posixtm.c (posix_time_parse): Likewise.
8639
8640         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8641
8642         * readtokens.c (readtoken): Declare an index to be of type unsigned
8643         to avoid a pedantic warning.
8644
8645         * getstr.c: Don't include assert.h.
8646         (getstr): Remove warning-evoking assertions.
8647         Return -1 if offset parameter is out of bounds.
8648         Change the type of a local from int to size_t.
8649
8650         * strftime.c (my_strftime_localtime_r): Include this function
8651         definition in the `#if ! HAVE_TM_GMTOFF' block.
8652
8653         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8654         Include xalloc.h instead.
8655
8656 2001-12-02  Jim Meyering  <meyering@lucent.com>
8657
8658         * tempname.c: Don't declare getenv, thus reverting the change of
8659         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8660         included.
8661
8662         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8663         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8664
8665 2001-11-30  Akim Demaille  <akim@epita.fr>
8666
8667         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8668         before being defined.
8669
8670 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8671
8672         * quotearg.h (quotearg_n, quotearg_n_style):
8673         First arg is int, not unsigned.
8674         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8675         (SIZE_MAX, UINT_MAX): New macros.
8676         (quotearg_n_options): Abort if N is negative.
8677         Avoid overflow check on hosts where size_t is 64 bits and int
8678         is 32 bits, as overflow is impossible there.
8679         Fix off-by-one typo that caused unnecessary reallocation.
8680
8681 2001-11-27  Jim Meyering  <meyering@lucent.com>
8682
8683         * tempname.c: Merge with version from libc.
8684         * regex.c: Likewise.
8685
8686         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8687         for which STDC_HEADERS is 0, it was not included, resulting in a
8688         warning about an integer-to-pointer conversion problem with getenv.
8689         Reported by Volker Borchert.
8690
8691 2001-11-26  Jim Meyering  <meyering@lucent.com>
8692
8693         * gtod.h: Remove file.
8694         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8695         * gettimeofday.c: Don't include gtod.h.
8696         (GTOD_init): Remove function.
8697         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8698         Suggestion from Volker Borchert.
8699
8700 2001-11-23  Jim Meyering  <meyering@lucent.com>
8701
8702         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8703         * hash.c (struct hash_table): Define it here instead.
8704
8705 2001-11-22  Jim Meyering  <meyering@lucent.com>
8706
8707         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8708
8709 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8710
8711         * tempname.c (TMP_MAX): Remove; no longer needed.
8712         (TEMPORARIES): New macro.
8713         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8714         removes an artificial limitation (e.g. HP-UX 10.20, where
8715         TMP_MAX is 17576).
8716
8717 2001-11-18  Jim Meyering  <meyering@lucent.com>
8718
8719         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8720         on SunOS 4.
8721
8722         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8723         files will be created before anything else.
8724
8725 2001-11-17  Jim Meyering  <meyering@lucent.com>
8726
8727         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8728         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8729         rather than group writable.  Patch by Juan F. Codagnone.
8730
8731         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8732         Instead, include "xalloc.h".
8733
8734         * mountlist.c: Include unlocked-io.h after all system headers.
8735         Remove explicit declarations of xmalloc, xrealloc,
8736         and xstrdup.  Instead, include "xalloc.h".
8737
8738         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8739         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8740         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8741
8742         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8743         Reported by Padraig Brady.
8744
8745         * mkstemp.c: #undef mkstemp.
8746         Include config.h.
8747         (rpl_mkstemp): Rename from mkstemp.
8748         Protoize.
8749
8750 2001-11-16  Jim Meyering  <meyering@lucent.com>
8751
8752         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8753         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8754         determine the amount of total physical memory, use pstat_getstatic.
8755         HPUX-11 doesn't define _SC_PHYS_PAGES.
8756         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8757         If sysconf couldn't be used to determine the amount of available
8758         physical memory, use both pstat_getstatic and pstat_getdynamic.
8759         Based on a patch from Bob Proulx.
8760
8761 2001-11-05  Jim Meyering  <meyering@lucent.com>
8762
8763         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8764
8765 2001-11-03  Jim Meyering  <meyering@lucent.com>
8766
8767         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8768         in argmatch_to_argument call.
8769
8770         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8771         argument.
8772
8773         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8774         e.g., a fault due to an attempt to free a NULL pointer.
8775
8776 2001-11-01  Jim Meyering  <meyering@lucent.com>
8777
8778         * dirfd.c, dirfd.h: New files.
8779         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8780
8781         * hash.c (hash_print) [TESTING]: Clean up.
8782
8783 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8784
8785         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8786         to avoid a warning if -Wall.
8787
8788 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8789
8790         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8791
8792 2001-10-21  Jim Meyering  <meyering@lucent.com>
8793
8794         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8795         this code would end up calling gettext even in packages built
8796         with --disable-nls.
8797         * getopt.c (_): Likewise.
8798         * regex.c (_): Likewise.
8799
8800 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8801
8802         * error.c (strerror_r): Do not declare unless !_LIBC.
8803         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8804         Use strerror_r that is only a macro, even if it is not a function.
8805         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8806         (private_strerror): Use prototypes, not old-style function definition.
8807         (print_errno_message): New function.
8808         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8809         char*-flavored one.
8810         (error_tail, error, error_at_line): Use it.
8811
8812 2001-10-11  Jim Meyering  <meyering@lucent.com>
8813
8814         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8815         and quote_n (1, ... to avoid clobbering a buffer.
8816
8817 2001-10-05  Jim Meyering  <meyering@lucent.com>
8818
8819         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8820         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8821         * hash-pjw.h: New file.
8822
8823 2001-09-30  Jim Meyering  <meyering@lucent.com>
8824
8825         * mountlist.c [MOUNTED_GETFSSTAT]:
8826         Include <sys/ucred.h>, for Apple Darwin.
8827         Include sys/mount.h and sys/fs_types.h only if available.
8828         (FS_TYPE): Define.
8829         (read_filesystem_list): Use FS_TYPE.
8830
8831 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8832
8833         * exclude.c (excluded_filename): 0 -> false, since it's
8834         a boolean context.
8835
8836 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8837
8838         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8839         #defines strtoimax.  Also treat the other strto* functions
8840         like strtoimax.
8841
8842         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8843         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8844         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8845
8846 2001-09-26  Jim Meyering  <meyering@lucent.com>
8847
8848         Most macros in unlocked-io.h had the wrong number of arguments.
8849         * gen-uio: New script.
8850         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8851         * unlocked-io.hin: Remove file.
8852         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8853         rather than trying to embed it here.
8854         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8855         Reported by Padraig Brady.
8856
8857 2001-09-25  Volker Borchert  <bt@teknon.de>
8858
8859         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8860
8861 2001-09-23  Jim Meyering  <meyering@lucent.com>
8862
8863         * mountlist.c: Remove useless parentheses in #if directives.
8864         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8865         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8866
8867 2001-09-22  Jim Meyering  <meyering@lucent.com>
8868
8869         * localcharset.c: Update from latest gettext.
8870         * config.charset: Likewise.
8871
8872 2001-09-20  Jim Meyering  <meyering@lucent.com>
8873
8874         * xstrtol.c (strtoimax): Guard declaration with
8875         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8876         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8877         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8878         (strtoumax): Likewise, for completeness (it wasn't necessary).
8879
8880 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8881
8882         * strtoimax.c (HAVE_LONG_LONG):
8883         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8884         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8885         to work around bug in IBM C compiler.
8886
8887 2001-09-16  Jim Meyering  <meyering@lucent.com>
8888
8889         * mkdir.c: New file.
8890
8891 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8892
8893         * xgetcwd.c: Revert some of the previous change; intead,
8894         fix the HAVE_GETCWD_NULL code to behave more like the
8895         !HAVE_GETCWD_NULL code used to.
8896
8897         Include "xalloc.h".
8898         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8899         invoke xalloc_die.
8900
8901 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8902
8903         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8904         Use ssize_t, not int, to store result of readlink.
8905         Check for ssize_t overflow as well as size_t overflow,
8906         as POSIX says the result of readlink is implementation-defined
8907         when ssize_t overflows.
8908         Remove unnecessary cast to char*.
8909         Use free+malloc instead of realloc, as the storage doesn't need
8910         to be preserved and it's clearer and can be more efficient that way.
8911         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8912         * xreadlink.h (xreadlink): Update prototype.
8913
8914 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8915
8916         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8917         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8918         spotted by Jim Meyering.
8919
8920 2001-09-03  Jim Meyering  <meyering@lucent.com>
8921
8922         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8923
8924 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8925
8926         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8927         like the HAVE_GETCWD_NULL code.
8928         Include pathmax.h if not HAVE_GETCWD.
8929         Do not include xalloc.h.
8930         (INITIAL_BUFFER_SIZE): New symbol.
8931         Do not use xmalloc / xrealloc, since the caller is responsible for
8932         handling errors.  Preserve errno around `free' during failure.
8933         Do not overrun buffer when using getwd.
8934
8935 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8936
8937         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8938         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8939
8940 2001-09-02  Jim Meyering  <meyering@lucent.com>
8941
8942         * error.c: Update from GNU libc.
8943
8944 2001-09-01  Jim Meyering  <meyering@lucent.com>
8945
8946         * xreadlink.c: New file.
8947         * xreadlink.h: New file.
8948         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8949
8950         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8951         doesn't conflict with sparc Solaris 7's definition in
8952         /usr/include/sys/int_types.h.
8953
8954         * exclude.c: Use `""', not `<>' to #include non-system header files.
8955         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8956         and strncasecmp as r-values.  Unixware didn't have declarations.
8957
8958 2001-08-31  Jim Meyering  <meyering@lucent.com>
8959
8960         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8961         Use an initial, malloc'd, buffer of length 128 rather than
8962         a statically allocated one of length 1024.
8963
8964 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8965
8966         * xgetcwd.c: Don't include pathmax.h.
8967         Include stdlib.h and unistd.h if available.
8968         Include xalloc.h.
8969         (xmalloc, xstrdup, free): Remove decls.
8970         (xgetcwd): Don't assume sizes fit in unsigned.
8971         Check for overflow when computing sizes.
8972         Simplify reallocation code.
8973
8974 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8975
8976         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8977
8978         * strtoimax.c: Renamed from strtoxmax.c, removing the
8979         old strtoimax.c.
8980
8981         Also, make the following further changes to make this file's
8982         configuration more similar to that of strtol.c:
8983         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8984         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8985         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8986         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8987         changed to signed values.
8988
8989         And make the following changes as well:
8990         Fix copyright notice, as 1999 was missing.
8991         (verify): New macro.
8992         (strtoimax): Check sizes at compile-time, not run-time.
8993         Prefer strtol to strtoll if both work.
8994         (main): Remove; it was not that useful and was a pain to maintain.
8995
8996         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8997
8998 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8999
9000         * savedir.c (savedir): Remove size parameter, as POSIX says that
9001         a directory's st_size can have an arbitrary value, so the old
9002         usage could waste an arbitrary amount of memory.  All uses
9003         changed.
9004         * savedir.h: Update prototype.
9005
9006 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9007
9008         * xstrtol.c (strtoimax): New decl.
9009
9010 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9011
9012         * xstrtol.h: Add copyright notice.
9013         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9014         LONGINT_INVALID_SUFFIX_CHAR.
9015
9016 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9017
9018         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9019         tm to be declared.
9020
9021 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9022
9023         * hash.c: Remove '2001' from copyright notice.
9024
9025 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9026
9027         * full-write.h: New file.
9028         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9029         * full-write.c: Correct credits, as cccp.c no longer
9030         exists and anyway it was so heavily changed from the old cccp
9031         code as to be unrecognizable.  Include full-write.h.
9032         (full_write) Return size_t, with short writes meaning failure.
9033         All callers changed.  This fixes a bug with large buffers
9034         on 64-bit hosts.
9035         * utime.c: Include full-write.h.
9036
9037 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9038
9039         Merge 'exclude' changes from tar 1.13.22.
9040         This fixes one or two unlikely storage allocation overflow bugs,
9041         but doesn't change user-visible behavior otherwise.
9042
9043 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9044
9045         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9046         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9047         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9048         Include if available.
9049         (<xalloc.h>): Include
9050         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9051         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9052         collide with FNM macros.
9053         (struct patopts): New struct.
9054         (struct exclude): Use it, as exclude patterns now come with options.
9055         (new_exclude): Support above changes.
9056         (new_exclude, add_exclude_file):
9057         Initial size must now be a power of two to simplify overflow checking.
9058         (free_exclude, fnmatch_no_wildcards): New function.
9059         (excluded_filename): No longer requires options arg, as the options
9060         are determined by add_exclude.  Now returns bool, not int.
9061         (excluded_filename, add_exclude):
9062         Add support for the fancy new exclusion options.
9063         (add_exclude, add_exclude_file): Now takes int options arg.
9064         Check for arithmetic overflow when computing sizes.
9065         (add_exclude_file): xrealloc might modify errno, so don't
9066         realloc until after errno might be used.
9067
9068         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9069         New macros.
9070         (free_exclude): New decl.
9071         (add_exclude, add_exclude_file): Now takes int options arg.
9072         (excluded_filename): No longer requires options arg, as the options
9073         are determined by add_exclude.  Now returns bool, not int.
9074
9075 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9076
9077         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9078
9079 2001-08-27  Jim Meyering  <meyering@lucent.com>
9080
9081         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9082
9083         * version-etc.c (N_): Remove definition.
9084         Revert most of last change.
9085         Instead, simply don't mark the `Copyright...' string for translation.
9086         Based on advice from Paul Eggert.
9087
9088         * strtoxmax.c: Tweak comment.
9089
9090 2001-08-26  Jim Meyering  <meyering@lucent.com>
9091
9092         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9093         of copyright with `%s' so translators don't get an untranslated
9094         message in 2002.
9095         (COPYRIGHT_YEAR): Define.
9096         (version_etc): Use fprintf rather than fputs.
9097         Suggestion from Ulrich Drepper.
9098
9099         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9100
9101         * strtoll.c: New file, from GNU libc.
9102         * xstrtoimax.c: New file.
9103
9104         * xstrtol.h: Add xstrtoimax.
9105         * strtoumax.c: New file.  Simply include "strtoumax.c".
9106         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9107
9108         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9109         * strtoxmax.c: ... then renamed to this.
9110
9111 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9112
9113         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9114         Port to Solaris 8, where 'sed' requires a space after the 'r'
9115         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9116         Redirect output to $tmp just once.
9117
9118 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9119
9120         * addext.c (<errno.h>): Include.
9121         (errno): Declare if not defined.
9122         (addext): Work correctly when pathconf returns -1 and leaves
9123         errno alone because there is no limit.  Also, work even if
9124         pathconf returns a value greater than SIZE_MAX.
9125
9126 2001-08-12  Jim Meyering  <meyering@lucent.com>
9127
9128         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9129         Simply `return getcwd (NULL, 0);'.
9130         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9131         Use 1300 as initial value for length, not PATH_MAX.
9132
9133         * pathmax.h: Clean up cpp syntax.
9134
9135 2001-08-12  Jim Meyering  <meyering@lucent.com>
9136
9137         * gettimeofday.c: New file.
9138         * gtod.h: New file.
9139         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9140
9141 2001-08-04  Jim Meyering  <meyering@lucent.com>
9142
9143         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9144         to get in sync with glibc.
9145
9146 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9147
9148         The following changes are from gettext 0.10.39 as maintained by
9149         Bruno Haible.
9150
9151         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9152         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9153         with inverted sense.  All uses changed.
9154
9155         * mbswidth.c: Don't include <limits.h>.
9156         Include <stdlib.h> and <string.h> unconditionally.
9157         (iswcntrl, mbsinit, ISCNTRL): New macros.
9158         (mbsnwidth): Use K&R style function declarations.
9159         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9160         can optimize it when MB_CUR_MAX == 1.
9161         The width of control characters is zero, not 1.
9162
9163 2001-07-15  Jim Meyering  <meyering@lucent.com>
9164
9165         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9166         (BUILT_SOURCES): Add unlocked-io.h.
9167         (io_functions): Define.
9168         (unlocked-io.h): New rule.
9169         (DISTCLEANFILES): Add unlocked-io.h.
9170         (all-local): Depend on unlocked-io.h, to ensure it is created.
9171
9172         * unlocked-io.hin: New file
9173
9174         * regex.c: Update from glibc.
9175
9176 2001-07-05  Jim Meyering  <meyering@lucent.com>
9177
9178         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9179         recommendation.
9180         (libfetish_a_SOURCES): Put all .h files here instead.
9181         Remove a thus-exposed (better checks in automake) duplicate and
9182         two unnecessary .h files.
9183
9184 2001-06-11  Jim Meyering  <meyering@lucent.com>
9185
9186         * regex.c: Update from GNU libc.
9187
9188 2001-05-27  Jim Meyering  <meyering@lucent.com>
9189
9190         * readutmp.h (UT_TYPE): Define.
9191
9192 2001-05-24  Jim Meyering  <meyering@lucent.com>
9193
9194         * argmatch.c: Include "quote.h".
9195         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9196         quote function.  Reported by Göran Uddeborg.
9197
9198 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9199
9200         * dirname.c (dir_name): Compute append_dot using path, not newpath
9201         which is not yet declared.
9202
9203 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9204
9205         * Makefile.am (libfetish_a_SOURCES):
9206         Add strftime.c, since we now compile it on all hosts.
9207
9208         * strftime.c (my_strftime):
9209         Define to nstrftime if emacs, but only if my_strftime is not defined.
9210         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9211         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9212         Add one more extra argument: a nanoseconds value.
9213         All uses changed.
9214         (ns): New macro.
9215         (my_strftime function): Add %N format.
9216         (emacs_strftimeu): Renamed from emacs_strftime,
9217         with extra ut argument.
9218
9219 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9220
9221         dirname code cleanup.  base_name now behaves more compatibly
9222         with POSIX basename when given file names that have trailing
9223         slashes, and similarly for dir_name.  Add new primitives
9224         base_len and dir_len.  Put the directory-name-related decls
9225         into dirname.h.
9226
9227         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9228         * backupfile.c (base_name): Likewise.
9229         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9230         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9231         * makepath.c (strip_trailing_slashes): Likewise.
9232         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9233         Likewise.
9234         * rename.c (strip_trailing_slashes): Likewise.
9235         * same.c (base_name): Likewise.
9236         * stripslash.c (ISSLASH): Likewise.
9237
9238         * addext.c: Include <dirname.h> after size_t is defined.
9239         * backupfile.c: Likewise.
9240
9241         * addext.c (addext): Use base_len to trim redundant
9242         trailing slashes instead of doing it ourselves.
9243         But do not trim the last slash if it is not redundant.
9244
9245         * backupfile.c (find_backup_file_name,
9246         max_backup_version): Use base_len instead of rolling it ourselves.
9247         Handle the case of "" and (on DOS) "C:" correctly.
9248
9249         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9250         Include <string.h>, <dirname.h>.
9251         (base_name): Allow file names ending in slashes, other than names
9252         that are all slashes.  In this case, return the basename followed
9253         by the slashes.  This is more general, and can be used in places
9254         where the original base_name purposely had an assertion failure.
9255         (base_len): New function.
9256
9257         * dirname.c: Include <string.h> instead of <stdlib.h>.
9258         Do not include <assert.h>; no longer needed.
9259         Include xalloc.h.
9260         (memrchr): Remove decl.
9261         (dir_name_r): Remove.
9262         (dir_len): Renamed from dirlen.  All callers changed.
9263         Rewrite in terms of base_name, for simplicity and consistency.
9264         (dir_name): Never return NULL.  All callers changed.
9265         Do not include <stdlib.h> in test program; no longer needed.
9266         return 0; is fine for test program.
9267
9268         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9269         New macros.
9270         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9271
9272         * path-concat.c (path_concat): Use base_len to compute
9273         base length, not strlen; this means we cannot rely on memcpy
9274         to null-terminate.
9275
9276         * same.c (STREQ): Remove.
9277         (same_name): Handle the case where the basename ends in trailing '/'.
9278
9279         * stripslash.c (strip_trailing_slashes): Return nonzero if
9280         a slash was stripped.  Do not strip the last slash after a
9281         file system prefix.
9282
9283 2001-04-08  Jim Meyering  <meyering@lucent.com>
9284
9285         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9286         recomputed; that's necessary when the offset spans a DST transition.
9287         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9288
9289 2001-04-02  Jim Meyering  <meyering@lucent.com>
9290
9291         * regex.h, regex.c: Update from GNU libc.
9292
9293 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9294
9295         * version-etc.c (version_etc_copyright): Update to 2001.
9296
9297 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9298
9299         * tempname.c (uint64_t): Define to uintmax_t if
9300         not defined, and if UINT64_MAX is not defined.
9301         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9302         Reported by John David Anglin.
9303
9304 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9305
9306         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9307         alias if codeset is empty.
9308         * config.charset (BeOS): Use wildcard syntax.
9309
9310 2001-03-13  Jim Meyering  <meyering@lucent.com>
9311
9312         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9313         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9314         From Bruno Haible.
9315
9316 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9317
9318         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9319         Don't return NULL.
9320         * unicodeio.c (print_unicode_char): Simplify accordingly.
9321
9322 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9323
9324         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9325         support for DOS/DJGPP.
9326
9327 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9328
9329         * Makefile.am (libfetish_a_SOURCES):
9330         Add dup-safer.c, fopen-safer.c.
9331         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9332
9333         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9334
9335 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9336
9337         The mkstemp replacement is taken from glibc 2.2.2, with some
9338         portability fixes for use outside glibc, as follows:
9339
9340         * tempname.c (struct_stat64): New macro.
9341         (direxists, __gen_tempname): Use it.
9342         This avoids a portability problem with Solaris 8.
9343
9344         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9345         (<stddef.h>, <stdint.h>, <string.h>):
9346         Include only if STDC_HEADERS || _LIBC.
9347         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9348         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9349         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9350         (__set_errno): Define this macro if <errno.h> doesn't.
9351         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9352         Define these macros if <stdio.h> doesn't.
9353         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9354         Define these macros if <sys/stat.h>
9355         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9356         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9357         __xstat64): Define if not _LIBC.
9358         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9359         (__gen_tempname): Invoke gettimeofday only if
9360         HAVE_GETTIMEOFDAY || _LIBC;
9361         otherwise, fall back on plain "time".
9362         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9363
9364         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9365
9366         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9367
9368 2001-02-17  Jim Meyering  <meyering@lucent.com>
9369
9370         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9371         around included file name.
9372
9373         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9374
9375         * strftime.c: Update from GNU libc (the only changes were to comments).
9376
9377 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9378
9379         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9380
9381 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9382
9383         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9384         Remove workaround macros for hosts that have mbrtowc but not
9385         mbstate_t, as we now insist on proper declarations for both
9386         before using mbrtowc.
9387
9388 2001-02-17  Jim Meyering  <meyering@lucent.com>
9389
9390         * regex.c: Update from libc.
9391
9392 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9393
9394         * alloca.c (malloc): Undef before defining, since stdlib.h
9395         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9396         Reported by Mark Hounschell via Paul Eggert.
9397
9398 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9399
9400         * config.charset: Update for FreeBSD 4.2.
9401
9402 2001-01-26  Jim Meyering  <meyering@lucent.com>
9403
9404         * quotearg.c: Include stddef.h.
9405         * quote.c: Include stddef.h.
9406         Reported by Axel Kittenberger.
9407
9408         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9409         line in double quotes so that it evokes a better diagnostic.
9410         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9411         Reported by Axel Kittenberger.
9412
9413 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9414
9415         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9416         to avoid a warning.  Add back 'const' to inptr.
9417
9418 2001-01-16  Jim Meyering  <meyering@lucent.com>
9419
9420         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9421         From Bruno Haible.
9422
9423 2001-01-14  Jim Meyering  <meyering@lucent.com>
9424
9425         * rename.c: New file.  From Volker Borchert.
9426         Include stdlib.h, string.h or strings.h, and xalloc.h.
9427         Use strip_trailing_slashes rather than open-coding it.
9428
9429 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9430
9431         * strftime.c: Sync with glibc time/strftime.c 1.81.
9432
9433 2001-01-03  Jim Meyering  <meyering@lucent.com>
9434
9435         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9436         local `inptr' to avoid warning with some system declarations of iconv.
9437
9438 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9439
9440         * modechange.c: Do not assume that mode_t uses the
9441         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9442         the other-execute bit of FOO even if S_IXOTH != 1.
9443
9444         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9445         WOTH, XOTH, ALLM): New macros.
9446         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9447          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9448         Use them.
9449         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9450         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9451         (mode_compile):
9452         No need to use uintmax_t; unsigned long is long enough.
9453         Don't bother to get suffix since we don't use it.
9454
9455 2000-12-24  Jim Meyering  <meyering@lucent.com>
9456
9457         * hash.c (is_prime): Return explicit boolean values.
9458         (hash_get_first): Return NULL to appease Irix5.6's 89.
9459         Reported by Nelson Beebe.
9460
9461 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9462
9463         * localcharset.c (locale_charset): Add support for Win32.
9464
9465 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9466
9467         * physmem.h, physmem.c: New files.
9468
9469         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9470         (noinst_HEADERS): Add physmem.h.
9471
9472         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9473         't' for compatibility with Solaris 8 sort.
9474
9475 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9476
9477         * config.charset: Add support for BeOS.
9478
9479 2000-12-16  Jim Meyering  <meyering@lucent.com>
9480
9481         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9482         SHELLS_FILE to a file name that's useful on djgpp systems.
9483         Include stdlib.h.
9484         (ADDITIONAL_DEFAULT_SHELLS): Define.
9485         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9486         Based mostly on a patch from Prashant TR.
9487
9488 2000-12-16  Jim Meyering  <meyering@lucent.com>
9489
9490         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9491         N and M) would have treated it like `chown N:N FILE'.
9492
9493         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9494
9495 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9496
9497         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9498         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9499         to the list of canonical encodings. Rename EUC-CN to GB2312.
9500
9501 2000-12-08  Andreas Schwab  <schwab@suse.de>
9502
9503         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9504         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9505
9506 2000-12-07  Jim Meyering  <meyering@lucent.com>
9507
9508         * stripslash.c (ISSLASH): Define.
9509         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9510         From Prashant TR.
9511
9512         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9513         (dir_name_r): Declare this function as static.
9514         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9515         manifest itself on a name containing a mix of slashes and
9516         backslashes.
9517         Make this function work with names starting with a DOS-style
9518         drive letter and colon prefix.
9519         (dir_name): Append `.' if necessary.
9520         Based mostly on patches from Prashant TR and Eli Zaretskii.
9521
9522         * dirname.h (dir_name_r): Remove prototype.
9523
9524 2000-12-05  Jim Meyering  <meyering@lucent.com>
9525
9526         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9527
9528 2000-12-04  Jim Meyering  <meyering@lucent.com>
9529
9530         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9531         Also include memory.h, stdlib.h, unistd.h if appropriate.
9532         Reported by Andreas Jaeger (conflicting declaration of malloc).
9533
9534 2000-12-02  Jim Meyering  <meyering@lucent.com>
9535
9536         * closeout.h: Make idempotent, to avoid some obscure warnings.
9537
9538 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9539
9540         * memrchr.c: Include <config.h> before any system include file.
9541
9542 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9543
9544         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9545
9546 2000-11-26  Jim Meyering  <meyering@lucent.com>
9547
9548         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9549
9550 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9551
9552         * strftime.c (my_strftime): Do not invoke mbrlen with a
9553         size of (size_t) -1; it's not portable.
9554
9555 2000-11-17  Akim Demaille  <akim@epita.fr>
9556
9557         * obstack.h: Formatting changes.
9558         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9559         prevent type checking.
9560         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9561         cast the value to (void *): assigning a `foo *' to a `void *'
9562         variable is valid.
9563         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9564
9565 2000-11-17  Jim Meyering  <meyering@lucent.com>
9566
9567         * strstr.c: Update from GNU libc.
9568
9569 2000-11-16  Jim Meyering  <meyering@lucent.com>
9570
9571         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9572
9573 2000-11-11  Jim Meyering  <meyering@lucent.com>
9574
9575         * error.c: Add a couple #includes, merging from GNU libc version.
9576
9577 2000-11-10  Jim Meyering  <meyering@lucent.com>
9578
9579         * obstack.h: Update from GNU libc.
9580         * obstack.c: Likewise.
9581
9582 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9583
9584         * getusershell.c (setusershell): Use rewind rather than
9585         fseek/fseeko, to avoid configuration hassles with fseeko.
9586         Don't bother opening SHELLS_FILE if shellstream is NULL;
9587         it's not necessary.
9588
9589 2000-11-05  Jim Meyering  <meyering@lucent.com>
9590
9591         * makepath.h (make_dir): Declare.
9592         * makepath.c (make_dir): Remove `static' attribute.
9593         Tweak a comment.
9594
9595 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9596
9597         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9598         last one in a bucket, advance to the next bucket.
9599
9600 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9601
9602         * fnmatch.c: Do not comment out all the code if we are using
9603         the GNU C library, because in some cases we are replacing buggy
9604         code in the GNU C library itself.
9605
9606 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9607
9608         * error.h, getline.h, modechange.h:
9609         Remove "2000" from Copyright line, as the file hasn't been
9610         changed this year other than in the copyright notice.
9611
9612         * xalloc.h: Add "2000" to Copyright line, as this file
9613         was changed this year.
9614
9615 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9616
9617         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9618         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9619         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9620
9621 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9622
9623         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9624         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9625         doesn't define __restrict_arr.
9626
9627 2000-10-29  Jim Meyering  <meyering@lucent.com>
9628
9629         * xstat.in: Fix grammar in comment.
9630
9631 2000-10-28  Jim Meyering  <meyering@lucent.com>
9632
9633         * memchr.c: Update from libc.
9634         Adjust for portability:
9635         [HAVE_STDLIB_H]: Include stdlib.h.
9636         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9637         Undef __memchr, too.
9638         [!weak_alias]: Define __memchr to memchr.
9639
9640         * regex.c: Update from libc.
9641         * regex.h: Likewise.
9642         * getopt1.c: Likewise.
9643         * memcmp.c: Likewise.
9644
9645         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9646         Avoid using fseek, when possible -- it's broken by design.
9647         Patch by Ulrich Drepper.
9648
9649 2000-10-26  Jim Meyering  <meyering@lucent.com>
9650
9651         * strftime.c: Update from libc.
9652
9653 2000-10-25  Jim Meyering  <meyering@lucent.com>
9654
9655         * obstack.c: Update from libc.
9656
9657 2000-10-23  Jim Meyering  <meyering@lucent.com>
9658
9659         * hard-locale.c (hard_locale): Revert last change -- it was simply
9660         wrong.  That set_locale call must not have any side effects.
9661         From Paul Eggert.
9662
9663 2000-10-22  Jim Meyering  <meyering@lucent.com>
9664
9665         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9666         [CYCLIC]: Remove now-unused definition.
9667
9668         * save-cwd.c (O_DIRECTORY): Define, if needed.
9669         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9670         Suggestion from Ulrich Drepper.
9671
9672 2000-10-21  Jim Meyering  <meyering@lucent.com>
9673
9674         * dirname.c (dir_name_r): New function, factored out of dir_name.
9675         (dir_name): Use dir_name_r.
9676         * dirname.h (dir_name_r): Declare it.
9677
9678 2000-10-21  Jim Meyering  <meyering@lucent.com>
9679
9680         * dirname.c (memrchr): Declare if necessary.
9681         (dir_name): Remove the restriction that there be no
9682         trailing slashes.  Now, this code skips past them, effectively
9683         ignoring them.
9684         [TEST_DIRNAME] (main): New unit tests.
9685
9686         * memrchr.c: New file from GNU libc.
9687         Undef __memrchr, too.
9688         [!weak_alias]: Define __memrchr to memrchr.
9689         Guard weak_alias use with `#ifdef weak_alias'.
9690
9691 2000-10-17  Jim Meyering  <meyering@lucent.com>
9692
9693         * quote.h (PARAMS): Define and use.
9694         Reported by Akim Demaille.
9695
9696         * getopt.c: Update from libc.
9697
9698 2000-10-16  Jim Meyering  <meyering@lucent.com>
9699
9700         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9701         From Jan Fedak.
9702
9703 2000-09-25  Jim Meyering  <meyering@lucent.com>
9704
9705         * md5.h (rol): Define (from GnuPG).
9706
9707         * sha.c: Give credit (GnuPG) where due.
9708         (M): Use rol rather than open-coding it.
9709         Add a FIXME comment.
9710
9711 2000-09-21  Jim Meyering  <meyering@lucent.com>
9712
9713         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9714         Reported by Michael Stone.
9715
9716 2000-09-20  Jim Meyering  <meyering@lucent.com>
9717
9718         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9719         (noinst_HEADERS): Add sha.h.
9720         Based on code from Scott G. Miller and from GnuPG.
9721
9722 2000-09-15  Jim Meyering  <meyering@lucent.com>
9723
9724         * regex.c: Update from libc.
9725
9726 2000-09-10  Jim Meyering  <meyering@lucent.com>
9727
9728         * getopt.c (_getopt_internal): Update from glibc.
9729
9730 2000-09-09  Jim Meyering  <meyering@lucent.com>
9731
9732         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9733         think it should be used as a general replacement for isascii.
9734         * fnmatch.c: Likewise.
9735         * mbswidth.c: Likewise
9736         * regex.c: Likewise.
9737
9738         Don't use atoi.
9739         * userspec.c: Include sys/param.h and limits.h.
9740         Include xstrtol.h.
9741         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9742         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9743         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9744         UID, GID.  Check range.
9745
9746 2000-09-06  Jim Meyering  <meyering@lucent.com>
9747
9748         * getopt.c (_getopt_internal): Update from glibc.
9749
9750 2000-08-30  Jim Meyering  <meyering@lucent.com>
9751
9752         * strftime.c: Merge in changes from GNU libc.
9753
9754 2000-08-26  Jim Meyering  <meyering@lucent.com>
9755
9756         * closeout.c: Include "__fpending.h".
9757         (close_stdout_status): Return right away if there's nothing to flush.
9758
9759         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9760         * __fpending.c: New file.
9761         * __fpending.h: New file.
9762
9763 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9764
9765         Standardize on "memory exhausted" instead of "Memory exhausted"
9766         or "virtual memory exhausted".
9767         * obstack.c (print_and_abort): Use "memory exhausted", not
9768         "virtual memory exhausted".
9769         * same.c (same_name): Invoke xalloc_die instead of printing
9770         our own message.
9771         * userspec.c (parse_user_spec): Likewise.
9772         * bumpalloc.h: comment fix
9773         * same.c, userspec.c: Include xalloc.h.
9774
9775         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9776         not char *const and pointing to a constant array.
9777         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9778         (xrealloc): Comment fix.
9779
9780         * userspec.c (parse_user_spec):
9781         Don't translate a message until just before returning,
9782         to avoid unnecessary translation.
9783
9784 2000-08-07  Jim Meyering  <meyering@lucent.com>
9785
9786         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9787         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9788         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9789         getgroups.c, gethostname.c, getopt.h, group-member.c,
9790         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9791         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9792         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9793         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9794         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9795         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9796         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9797         yesno.c: Back out Copyright date changes for each file with no change
9798         this year.  This eases coordination with other programs using the same
9799         source code modules.  From Paul Eggert.
9800
9801 2000-08-03  Greg McGary  <greg@mcgary.org>
9802
9803         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9804         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9805         (EXTEND_BUFFER): Use them.
9806
9807 2000-08-01  Jim Meyering  <meyering@lucent.com>
9808
9809         * dirname.c (ISSLASH): Define.
9810         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9811         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9812         both `\' and `/' may be use as path separators.
9813         Based on a patch from Prashant TR.
9814
9815 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9816
9817         * quotearg.c (quotearg_n_options): Don't make the initial
9818         slot vector a constant, since it might get modified.
9819
9820 2000-07-31  Jim Meyering  <meyering@lucent.com>
9821
9822         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9823         * obstack.c (print_and_abort): Likewise.
9824
9825 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9826
9827         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9828         buffer, so that the caller can always quote one small
9829         component of a "memory exhausted" message in slot 0.
9830         From a suggestion by Jim Meyering.
9831
9832 2000-07-30  Jim Meyering  <meyering@lucent.com>
9833
9834         * makepath.c (make_path): Quote the other instance, too.
9835
9836         * quotearg.c (N_STATIC_SLOTVECS): Define.
9837         (STATIC_BUF_SIZE): Define.
9838         (quotearg_n_options): Use only statically allocated storage when
9839         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9840         than STATIC_BUF_SIZE.
9841
9842 2000-07-29  Jim Meyering  <meyering@lucent.com>
9843
9844         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9845         * dirname.c (dir_name): Likewise.
9846
9847         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9848
9849         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9850         (dir_name): Assert that there are no trailing slashes.
9851
9852 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9853
9854         * mbswidth.h (mbswidth): Add a flags argument.
9855         (mbswidth): New declaration.
9856         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9857         * mbswidth.c (mbswidth): Add a flags argument.
9858         (mbsnwidth): New function.
9859
9860 2000-07-24  Jim Meyering  <meyering@lucent.com>
9861
9862         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9863
9864 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9865
9866         * mbswidth.c (_XOPEN_SOURCE):
9867         Don't define; this causes problems on Solaris 7.
9868         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9869
9870 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9871
9872         * quotearg.c:
9873         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9874         so that mbstate_t is always defined.
9875
9876         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9877         be 1 in at least one GCC installation, and this configuration
9878         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9879         performance on hosts that have mbrtowc but have only unibyte
9880         locales, but I assume these hosts are rare.
9881
9882 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9883
9884         * quotearg.c: Streamline by invoking multibyte code only if needed.
9885         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9886         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9887         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9888         invoke multibyte primitives.
9889
9890 2000-07-23  Jim Meyering  <meyering@lucent.com>
9891
9892         * basename.c (base_name): Add an assertion.
9893
9894 2000-07-15  Bruno Haible  <clisp.cons.org>
9895
9896         * quotearg.c: When the system forces us to redefine mbstate_t,
9897         shadow its mbsinit function.
9898
9899 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9900
9901         * mbswidth.h: New file.
9902         * mbswidth.c: New file.
9903         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9904         (noinst_HEADERS): Add mbswidth.h.
9905
9906 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9907
9908         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9909         and IRIX 6.
9910
9911 2000-07-15  Jim Meyering  <meyering@lucent.com>
9912
9913         * makepath.c: Include quote.h.
9914         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9915         corresponding argument in a `quote (...)' call.
9916         Give better diagnostics.
9917
9918         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9919         (noinst_HEADERS): Add quote.h.
9920
9921         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9922         from tar's src/misc.c.
9923         * quote.h: New file.  Prototypes for same.
9924
9925 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9926
9927         From a suggestion by Bruno Haible.
9928         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9929         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9930         to decide whether to define the BeOS workaround macro;
9931         this adjusts to the change to AC_MBSTATE_T.
9932
9933 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9934
9935         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9936
9937         * quotearg.c (quoting_style_args, quoting_style_vals,
9938         quotearg_buffer_restyled): Add support for
9939         clocale_quoting_style.  Undo previous change to
9940         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9941         and "{RIGHT QUOTATION MARK}" msgids.
9942
9943 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9944
9945         The old behavior of quoting `like this' doesn't look good with
9946         newer, ISO-style fonts.  See:
9947         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9948
9949         Instead, quote "like this" by default.  Let the translator
9950         tailor the locale-specific quoting behavior by providing
9951         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9952
9953         * quotearg.c (N_): New macro.
9954         (gettext_default): New function.
9955         (quotearg_buffer_restyled): Use
9956         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9957         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9958
9959 2000-07-09  Jim Meyering  <meyering@lucent.com>
9960
9961         * Most files: Update copyright dates to include 2000.
9962
9963 2000-07-08  Jim Meyering  <meyering@lucent.com>
9964
9965         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9966         if not defined.
9967         (xgethostname): Remove now-unnecessary #ifdef.
9968         Move declaration of `err' into loop where it's used.
9969
9970 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9971
9972         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9973         by allocating a larger buffer. Test the gethostname return value for
9974         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9975         returns an error and ENAMETOOLONG isn't defined.
9976
9977 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9978         and Bruno Haible  <haible@clisp.cons.org>
9979
9980         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9981
9982 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9983
9984         * quotearg.c (struct quoting_options): Simplify quote_these_too
9985         dimension.
9986
9987 2000-07-03  Jim Meyering  <meyering@lucent.com>
9988
9989         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9990         Reported by Bruno Haible.
9991
9992 2000-07-04  Jim Meyering  <meyering@lucent.com>
9993
9994         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9995         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9996         lacks mbrtowc.
9997
9998 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9999         and Bruno Haible  <haible@clisp.cons.org>
10000
10001         * quotearg.c (mbrtowc):
10002         Assign to *pwc, and return 1 only if result is nonzero.
10003         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10004
10005 2000-07-03  Jim Meyering  <meyering@lucent.com>
10006
10007         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10008         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10009         From Bob Proulx.
10010
10011 2000-07-02  Jim Meyering  <meyering@lucent.com>
10012
10013         * quotearg.c (mbstate_t): Don't define here.
10014
10015 2000-07-02  Jim Meyering  <meyering@lucent.com>
10016
10017         * nanosleep.c (SIGCONT): Define if not already defined.
10018
10019 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10020
10021         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10022         per change in ../m4/ls-mntd-fs.m4.
10023         (read_filesystem_list): Ignore symbolic links.
10024
10025 2000-06-29  Jim Meyering  <meyering@lucent.com>
10026
10027         * same.c: Include <string.h> or <strings.h>, as appropriate,
10028         for declaration of strcmp.
10029
10030         * long-options.c: Include <stdlib.h>, for declaration of exit.
10031
10032         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10033         Avoid warning by casting result to `char *' to remove `const'.
10034
10035 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10036
10037         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10038
10039 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10040
10041         savedir now sets errno on failure and invokes xmalloc to get memory.
10042         Fix a couple of other minor bugs while we're at it.
10043
10044         * savedir.c (<unistd.h>): Do not include; there's no need.
10045         (NAMLEN): Remove macro.
10046         (malloc, realloc): Remove decls.
10047         (stpcpy): Likewise.
10048         ("xalloc.h"): Include.
10049         (NAME_SIZE_DEFAULT): New macro.
10050         (savedir): Use xmalloc / xrealloc to allocate memory.
10051         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10052         Skip "" directory entries.
10053         Use strlen to calculate directory entry length, since the old method
10054         is rarely used these days and isn't worth supporting.
10055         Don't use a pointer after freeing it.
10056         Check for integer overflow when calculating allocation size.
10057         Use memcpy to copy entries, instead of stpcpy.
10058         Set errno properly when returning NULL.
10059         Check for readdir error.
10060
10061 2000-06-26  Jim Meyering  <meyering@lucent.com>
10062
10063         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10064
10065 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10066
10067         * getusershell.c (xmalloc, xrealloc): Remove functions.
10068         Include xalloc.h.
10069         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10070
10071 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10072
10073         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10074
10075 2000-06-24  Jim Meyering  <meyering@lucent.com>
10076
10077         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10078
10079 2000-06-21  Jim Meyering  <meyering@lucent.com>
10080
10081         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10082
10083 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10084
10085         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10086         (mbrtowc, mbstate_t): Define substitutes if
10087         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10088         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10089         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10090
10091 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10092
10093         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10094         than 1024, return a memory chunk of least possible size, instead
10095         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10096         Use free/xmalloc instead of xrealloc to avoid copying for very long
10097         paths.
10098
10099 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10100
10101         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10102         address, not strdup.  Include <stdlib.h> and don't declare free().
10103
10104 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10105
10106         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10107         the empty string.
10108
10109 2000-06-21  Jim Meyering  <meyering@lucent.com>
10110
10111         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10112         (noinst_HEADERS): Add getstr.h.
10113
10114         * getline.c (getstr): Move into a separate file.
10115         * getstr.c (getstr): New file, extracted from getline.c, with
10116         the following changes: new parameter, delim2; both delim[12]
10117         parameters have type `int', not `char'.  The latter would lose
10118         with 8-bit delimiters.
10119         * getstr.h: New file.
10120
10121 2000-06-19  Jim Meyering  <meyering@lucent.com>
10122
10123         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10124
10125 2000-06-18  Jim Meyering  <meyering@lucent.com>
10126
10127         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10128         Besides, these days every porting target provides a mkdir function.
10129
10130         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10131         (this snippet comes from src/system.h).
10132
10133 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10134
10135         * human.c (adjust_value): New function.
10136         (human_readable_inexact): Apply rounding style even when
10137         printing approximate values.
10138
10139 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10140
10141         * human.c (human_readable_inexact): Allow an input block
10142         size that is not a multiple of the output block size, and vice versa.
10143         Reported by Piergiorgio Sartor.
10144
10145 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10146
10147         * getdate.y (get_date): Apply relative times after time
10148         zone indicator, not before.  Reported by Todd A. Jacobs.
10149
10150 2000-06-13  Jim Meyering  <meyering@lucent.com>
10151
10152         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10153
10154         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10155
10156 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10157
10158         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10159
10160 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10161
10162         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10163
10164 2000-06-04  Jim Meyering  <meyering@lucent.com>
10165
10166         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10167         SunOS 4.1.4 for which gid_t is an unsigned type.
10168
10169 2000-06-03  Jim Meyering  <meyering@lucent.com>
10170
10171         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10172
10173 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10174
10175         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10176         newer, don't install charset.alias.
10177         * config.charset: Change the Linux/glibc rules so they become empty
10178         on glibc-2.1 or newer.
10179
10180 2000-06-02  Jim Meyering  <meyering@lucent.com>
10181
10182         * mountlist.c: Back out last change.  Instead, do this...
10183         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10184         member using the same `ignore'-testing code.
10185         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10186         fs_type strings.
10187         From Mark D. Roth.
10188
10189 2000-05-29  Jim Meyering  <meyering@lucent.com>
10190
10191         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10192         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10193
10194 2000-05-22  Jim Meyering  <meyering@lucent.com>
10195
10196         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10197
10198 2000-05-18  Jim Meyering  <meyering@lucent.com>
10199
10200         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10201         back, too, since it may have been modified by allocate_entry.
10202         (hash_delete): Rewrite to use neither the assignment operator
10203         nor the comma operator in an if-expression.
10204
10205 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10206
10207         * closeout.c:
10208         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10209         Remove; no longer needed.
10210         "quotearg.h": Add include.
10211         (file_name): Do not bother to explicitly initialize to NULL; it's less
10212         efficient on some hosts.
10213         (close_stdout_status): Remove test as to whether stdout was already
10214         closed; it breaks for the case "echo x | sort >&-".
10215         Quote file name colons.
10216         Do not assume that _("write error") lacks format strings.
10217
10218 2000-05-15  Jim Meyering  <meyering@lucent.com>
10219
10220         * version-etc.c (version_etc_copyright): Update the copyright string
10221         used in all --version output.
10222
10223 2000-05-14  Jim Meyering  <meyering@lucent.com>
10224
10225         * closeout.c (close_stdout_set_file_name): New function.
10226         (close_stdout_status): Use new file-scoped global.
10227         Return right away if fstat says the stdout file descriptor is invalid.
10228         * closeout.h (close_stdout_set_file_name): Declare.
10229
10230 2000-05-10  Jim Meyering  <meyering@lucent.com>
10231
10232         * closeout.c [default_exit_status]: New file-scoped variable.
10233         (close_stdout_set_status): New function.
10234         * closeout.h (close_stdout_set_status): Declare.
10235
10236 2000-05-08  Jim Meyering  <meyering@lucent.com>
10237
10238         * long-options.c: Don't include closeout.h.
10239         (parse_long_options): Don't call close_stdout for --version.
10240
10241 2000-05-06  Jim Meyering  <meyering@lucent.com>
10242
10243         * strnlen.c: Undefine __strnlen and strnlen.
10244         [!weak_alias]: Define __strnlen to strnlen.
10245
10246         * atexit.c: New file, from libiberty.
10247
10248 2000-05-06  Jim Meyering  <meyering@lucent.com>
10249
10250         * closeout.c (close_stdout_status): Also check for errors on the
10251         stderr stream.
10252
10253 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10254
10255         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10256         instead of xmalloc, xrealloc, path_concat.
10257         (locale_charset): Treat empty environment variables as absent.
10258         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10259
10260 2000-05-04  Jim Meyering  <meyering@lucent.com>
10261
10262         * getopt.c: Update from glibc.
10263         * obstack.c: Likewise.
10264         * obstack.h: Likewise.
10265         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10266
10267         * regex.h: Likewise.
10268         * strndup.c: Likewise.
10269         * strnlen.c: New file, from glibc.
10270
10271 2000-05-01  Jim Meyering  <meyering@lucent.com>
10272
10273         * full-write.c (full_write): Remove `FIXME' part of comment.
10274
10275 2000-04-29  Jim Meyering  <meyering@lucent.com>
10276
10277         * path-concat.c: Declare strdup only if it's not defined.
10278         * canon-host.c: Likewise.
10279
10280 2000-04-28  Jim Meyering  <meyering@lucent.com>
10281
10282         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10283         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10284         included first, then limits.h is included by locale.h by libintl.h.
10285         From John David Anglin.
10286
10287 2000-04-25  Jim Meyering  <meyering@lucent.com>
10288
10289         * makepath.c (S_IRWXUGO): Define.
10290         (make_path): Always perform explicit chmod if MODE specifies any
10291         of the `special' permission bits.  Prompted by a bug report against
10292         install from Mate Wierdl and Joost van Baal.
10293
10294 2000-04-18  Jim Meyering  <meyering@lucent.com>
10295
10296         * README: New file.
10297
10298         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10299         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10300
10301 2000-04-17  Jim Meyering  <meyering@lucent.com>
10302
10303         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10304         the definition of it to rpl_strftime also defined-away the system's
10305         declaration.
10306
10307 2000-04-15  Jim Meyering  <meyering@lucent.com>
10308
10309         Use `C' to denote so-called `contiguous' files, the same way
10310         that tar does.
10311         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10312         (ftypelet): Use S_ISCTG.
10313         From Michael Deutschmann.
10314
10315 2000-04-14  Jim Meyering  <meyering@lucent.com>
10316
10317         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10318
10319 2000-04-08  Jim Meyering  <meyering@lucent.com>
10320
10321         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10322         names don't conflict.  Reported by Eli Zaretskii.
10323
10324 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10325
10326         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10327         bug.  Deal with the different error behavior of Irix iconv.
10328
10329 2000-04-07  Jim Meyering  <meyering@lucent.com>
10330
10331         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10332         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10333
10334 2000-04-05  Jim Meyering  <meyering@lucent.com>
10335
10336         Portability tweaks required for ultrix4.3.
10337         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10338         * readutmp.c: Include sys/types.h before sys/stat.h.
10339         * canon-host.c: Declare strdup.
10340         * path-concat.c: Likewise.
10341         From John David Anglin.
10342
10343 2000-04-04  Jim Meyering  <meyering@lucent.com>
10344
10345         Be more DOS 8.3-friendly.
10346         * ref-add.sin: Renamed from ref-add.sed.in.
10347         * ref-del.sin: Renamed from ref-del.sed.in.
10348         * Makefile.am: Reflect renaming.
10349         Reported by Eli Zaretskii.
10350
10351         Use a temporary file name that won't clash with `charset.alias'
10352         in the DOS 8.3 name space.
10353         * Makefile.am (charset_tmp): Define.
10354         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10355         (uninstall-local): Likewise.
10356         Reported by Eli Zaretskii.
10357
10358 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10359
10360         * time/strftime.c (my_strftime): Make sure we call the system
10361         strftime, not ourselves, when invoking the underlying strftime.
10362
10363 2000-03-24  Jim Meyering  <meyering@lucent.com>
10364
10365         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10366         (charset_alias): Define.
10367         (install-exec-local): Factor out common code.
10368         (uninstall-local): Split lines longer than 80.
10369         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10370         (SUFFIXES): Define.
10371         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10372         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10373
10374 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10375
10376         * config.charset: Output a line containing "Packages using this file".
10377         * ref-add.sed.in, ref-del.sed.in: New files.
10378         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10379         ref-del.sed): New rules.
10380
10381 2000-03-17  Jim Meyering  <meyering@lucent.com>
10382
10383         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10384         Otherwise, include <strings.h>
10385
10386 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10387
10388         * unicodeio.c (utf8_wctomb): New function.
10389         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10390         format instead of in UCS-4 with platform dependent endianness.
10391
10392 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10393
10394         * savedir.c (savedir): Work even if directory size is
10395         negative; this can happen with some screwy NFS configurations.
10396
10397 2000-03-06  Jim Meyering  <meyering@lucent.com>
10398
10399         * localcharset.c (get_charset_aliases): Don't try to free file_name
10400         if it's NULL (because we ran out of memory).  From Bruno Haible.
10401
10402 2000-03-05  Jim Meyering  <meyering@lucent.com>
10403
10404         * localcharset.c ("path-concat.h"): Include.
10405         (get_charset_aliases): Use path_concat instead of ANSI string
10406         concatenation.
10407
10408         * unicodeio.h (PARAMS): Define.
10409         Use it to guard prototype.
10410
10411 2000-03-04  Jim Meyering  <meyering@lucent.com>
10412
10413         * Makefile.am (install-exec-local): Create $(libdir) before installing
10414         into it.
10415         (uninstall-local): Uncomment this rule so `make distcheck' works
10416         once again.
10417
10418         * unicodeio.c (<errno.h>): Include it.
10419         (errno): Declare if not defined.
10420
10421         * localcharset.c: Add Bruno's comment justifying use of volatile.
10422
10423         * config.charset: New version, incorporating remarks from a linux
10424         i18n mailing list.  From Bruno Haible.
10425
10426 2000-03-02  Jim Meyering  <meyering@lucent.com>
10427
10428         * Makefile.am (EXTRA_DIST): Add config.charset.
10429
10430 2000-03-01  Jim Meyering  <meyering@lucent.com>
10431
10432         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10433         * unicodeio.c: Likewise.
10434
10435 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10436
10437         * config.charset: New file.
10438         * localcharset.c: New file.
10439         * unicodeio.h, unicodeio.c: New files.
10440         * Makefile.am (DEFS): Add -DLIBDIR=...
10441         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10442         (noinst_HEADERS): Add unicodeio.h.
10443         (all-local, install-exec-local, charset.alias): New targets.
10444
10445 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10446
10447         * quotearg.c (ALERT_CHAR): New macro.
10448         (quotearg_buffer_restyled): Use it.
10449
10450 2000-02-27  Jim Meyering  <meyering@lucent.com>
10451
10452         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10453         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10454
10455         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10456         not `#if STDC_HEADERS'.
10457         Declare malloc if needed.
10458
10459         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10460         now that autoconf always defines the HAVE_DECL_ symbols.
10461         * human.c: Likewise.
10462         * same.c: Likewise.
10463         * strtoumax.c: Likewise.
10464
10465         * backupfile.c: Arrange for cpp to fail if the configure-time
10466         declaration check was not run.
10467         * hash.c: Likewise.
10468         * human.c: Likewise.
10469         * same.c: Likewise.
10470         * strtoumax.c: Likewise.
10471
10472         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10473         then first look up the entire `.'-containing string as a login name.
10474
10475 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10476
10477         * getdate.y: Handle two-digit years with leading zeros correctly.
10478         (textint): New typedef.
10479         (parser_control): Member year changed from int to textint.
10480         All uses changed.
10481         (YYSTYPE): Removed; replaced by %union with int and textint members.
10482         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10483         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10484         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10485         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10486         (date, number, to_year): Use width of number in digits, not its value,
10487         to determine whether it's a 2-digit year, or a 2-digit time.
10488         (yylex): Store number of digits of numeric tokens.
10489         Reported by John Kendall.
10490
10491         (parser_control): Changed from struct parser_control to typedef (for
10492         consistency).  All uses changed.
10493
10494         (tID): Removed; not used.
10495         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10496
10497 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10498
10499         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10500         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10501
10502 2000-02-12  Jim Meyering  <meyering@lucent.com>
10503
10504         * userspec.c (ISDIGIT): Define it.
10505         (isdigit): Remove definition.
10506         (is_number): Use ISDIGIT, not isdigit.
10507         <libintl.h>: Include.
10508         (_ and N_): Define.
10509         (parse_user_spec): Mark translatable strings.
10510
10511 2000-02-10  Jim Meyering  <meyering@lucent.com>
10512
10513         With these changes, nanosleep.[ch] are finally enough like the other
10514         lib/* replacement files to compile on a few more losing systems.
10515
10516         * nanosleep.h: Don't include config.h.
10517         Remove prototype from declaration of nanosleep.
10518         (PARAMS): Remove now-unneeded definition.
10519         * nanosleep.c: #undef nanosleep.
10520         (rpl_nanosleep): Rename from nanosleep.
10521
10522 2000-02-03  Jim Meyering  <meyering@lucent.com>
10523
10524         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10525         rather than with `#if HAVE_UTMPNAME'.
10526
10527 2000-02-01  Jim Meyering  <meyering@lucent.com>
10528
10529         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10530
10531 2000-01-31  Jim Meyering  <meyering@lucent.com>
10532
10533         * nanosleep.h (nanosleep): Guard declaration with
10534         `#if ! HAVE_DECL_NANOSLEEP'.
10535         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10536         the declaration in that vendor's sys/timers.h.
10537         Reported by Christian Krackowizer.
10538
10539         * quotearg.c (ISASCII): Add #undef and move definition to follow
10540         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10541         (ISPRINT): Likewise.
10542         Reported by Tom Tromey.
10543
10544 2000-01-30  Jim Meyering  <meyering@lucent.com>
10545
10546         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10547         uses of ->ut_name.  The latter doesn't work with new Linux header files
10548         where only utmpx.ut_user is declared.
10549
10550         * readutmp.h (UT_USER): Define.
10551
10552 2000-01-23  Jim Meyering  <meyering@lucent.com>
10553
10554         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10555         obstack.c.
10556
10557 2000-01-22  Jim Meyering  <meyering@lucent.com>
10558
10559         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10560         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10561         Required for some AIX systems.  Reported by Christian Krackowizer.
10562         [TESTING] (main): New function.
10563
10564         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10565         * dirname.c (dir_name): Support for DOS-style file names with drive
10566         letters.
10567
10568         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10569
10570         * strverscmp.c (ISDIGIT): Define.
10571         (strverscmp): Use ISDIGIT, not isdigit.
10572
10573 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10574
10575         * nanosleep.c (nanosleep):
10576         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10577         POSIX.1 doesn't require SA_INTERRUPT and some systems
10578         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10579         it's been part of POSIX.1 since day 1 (in 1988).
10580
10581 2000-01-17  Jim Meyering  <meyering@lucent.com>
10582
10583         * interlock: Remove unused file.  Reported by François Pinard.
10584
10585 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10586
10587         * quotearg.c (quotearg_buffer_restyled): Do not quote
10588         alert, backslash, formfeed, and vertical tab unnecessarily in
10589         shell quoting style.
10590
10591
10592 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10593 Free Software Foundation, Inc.
10594 Copying and distribution of this file, with or without modification,
10595 are permitted provided the copyright notice and this notice are preserved.