* getopt.c: Fix typo in last commit.
[gnulib.git] / lib / ChangeLog
1 2006-09-13  Eric Blake  <ebb9@byu.net>
2
3         * getopt.c: Fix typo in last commit.
4
5 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
6
7         * _fpending.c: Include <config.h> unconditionally, since we no
8         longer worry about uses that don't define HAVE_CONFIG_H.
9         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
10         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
11         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
12         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
13         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
14         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
15         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
16         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
17         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
18         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
19         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
20         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
21         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
22         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
23         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
24         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
25         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
26         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
27         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
28         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
29         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
30         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
31         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
32         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
33         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
34         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
35         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
36         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
37         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
38         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
39         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
40         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
41         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
42         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
43         Likewise.
44
45 2006-09-12  Jim Meyering  <jim@meyering.net>
46
47         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
48         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
49         Reported by Nelson H. F. Beebe.
50
51 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
52
53         * argp-help.c (argp_doc): Make sure NULL is not passed to
54         dgettext.
55
56 2006-09-10  Bruno Haible  <bruno@clisp.org>
57
58         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
59
60 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
61
62         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
63         program_invocation_name and program_invocation_short_name are
64         initialized.
65         * argp-namefrob.h: Move declarations of program_invocation_name
66         and program_invocation_short_name to argp.h, so they are visible
67         to user programs.
68         * argp.h: Likewise
69
70 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
71
72         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
73         convention.  Text proposed by Bruno Haible.
74         (struct argp_option): Document the use of N_() wrappers.
75
76         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
77         and translate the two parts separately, instead of feeding
78         the whole string to gettext.  This allows to exclude
79         '\v' from the strings visible to the translator by writing doc
80         strings as N_("..") "\v" N_("..").
81
82 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
83
84         * mktime.c (guess_time_tm): Fix bug where mktime
85         returned the maximum time_t value rather than (time_t) -1.
86         Problem originally reported by William Bardwell
87         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
88
89         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
90         Moved to here ...
91         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
92         ... from here.
93
94 2006-09-06  Bruno Haible  <bruno@clisp.org>
95
96         * striconv.h: New file.
97         * striconv.c: New file, merging iconvme.c with GNU gettext's
98         iconvstring.c.
99         * xstriconv.h: New file.
100         * xstriconv.c: New file.
101
102 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
103
104         * argz_.h: Sync from Libtool.
105
106         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
107                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
108
109         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
110
111 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
112
113         * trim.h: New file.
114         * trim.c: New file.
115
116 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
117
118         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
119         Problem reported by Ralf Wildenhues in
120         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
121
122         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
123         HAVE_STRUCT_STATFS_F_FSTYPENAME.
124
125 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
126
127         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
128         or stdbool.h, because they might not exist while configuring.
129
130         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
131         Don't include unistd.h or limits.h; not needed, since chdir-long.h
132         does that for us.
133         (O_DIRECTORY): Remove.
134
135 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
136
137         Work around a bug in both the Linux and SunOS 64-bit kernels:
138         nanosleep mishandles sleeps for longer than 2**31 seconds.
139         Problem reported by Frank v Waveren in
140         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
141         * nanosleep.c (BILLION): New constant.
142         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
143         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
144
145 2006-08-30  Jim Meyering  <jim@meyering.net>
146
147         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
148         the parameter.
149
150 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
151
152         * isapipe.c, isapipe.h: New files.
153
154 2006-08-29  Eric Blake  <ebb9@byu.net>
155
156         * error.c (error_at_line, print_errno_message): Match libc, after
157         resolution of upstream bug 3044.
158
159 2006-08-29  Bruno Haible  <bruno@clisp.org>
160
161         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
162
163 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
164
165         Sync from Libtool:
166
167         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
168
169         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
170         sharing with gnulib.  Report by Eric Blake.
171
172 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
173
174         * fcntl_.h: New file.
175         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
176         the fcntl module.
177         * dirchownmod.c: Likewise.
178         * fts.c: Likewise.
179
180         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
181         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
182         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
183         just before including <inttypes.h>, to avoid circular inclusion.
184
185 2006-08-28  Bruno Haible  <bruno@clisp.org>
186
187         * inttypes_.h (SCNX*): Remove definitions.
188         Reported by Eric Blake.
189
190 2006-08-26  Bruno Haible  <bruno@clisp.org>
191
192         * vasnprintf.c (EOVERFLOW): Remove definition.
193         (VASNPRINTF): Return a string of length > INT_MAX without failing.
194         * vasprintf.c: Include errno.h, limits.h.
195         (EOVERFLOW): New fallback definition.
196         (vasprintf): Test here whether the string length is > INT_MAX.
197         * vsnprintf.c: Include errno.h, limits.h.
198         (EOVERFLOW): New fallback definition.
199         (vsnprintf): Fix bug when generated string was too long for the buffer.
200         Test here whether the string length is > INT_MAX.
201
202 2006-08-26  Bruno Haible  <bruno@clisp.org>
203             Simon Josefsson  <jas@extundo.com>
204
205         BeOS portability.
206         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
207
208 2006-08-28  Bruno Haible  <bruno@clisp.org>
209
210         * c-strstr.h: New file, from GNU gettext.
211         * c-strstr.c: New file, from GNU gettext.
212
213 2006-08-26  Bruno Haible  <bruno@clisp.org>
214
215         * inttypes_.h: New file.
216         * inttypes.h: Remove file.
217         * stdint_.h: Include <inttypes.h> through its absolute filename.
218
219         * imaxabs.c: New file.
220
221         * imaxdiv.c: New file.
222
223 2006-08-22  Bruno Haible  <bruno@clisp.org>
224
225         * readutmp.h: Skip most definitions if neither <utmp.h> nor
226         <utmpx.h> exists.
227
228 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
229
230         BeOS portability.
231         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
232         Problem reported by Bruno Haible.
233
234 2006-08-21  Bruno Haible  <bruno@clisp.org>
235
236         BeOS portability.
237         * mbchar.h: Include <wctype.h> only if it exists.
238
239 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
240
241         * cycle-check.h: Include <stdint.h> unconditionally, since we
242         now assume the stdint module.  Do not include inttypes.h.
243         * fsusage.h: Likewise.
244         * getndelim2.c: Likewise.
245         * human.h: Likewise.
246         * inttostr.h: Likewise.
247         * obstack.c: Likewise.
248         * regex_internal.h: Likewise.
249         * tempname.c: Likewise.
250         * utimecmp.c: Likewise.
251         * xstrtol.h: Likewise.
252
253         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
254
255         * strtoimax.c: Adjust to macro name changes in Autoconf,
256         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
257         * xtime.h: Likewise.
258
259 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
260
261         * fchmodat.c: New file, from coreutils.  This was inadvertently
262         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
263
264 2006-08-18  Bruno Haible  <bruno@clisp.org>
265
266         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
267         (ME_DUMMY): Treat "kernfs" as a dummy.
268         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
269
270 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
271
272         Update from coreutils.
273
274         * __fpending.h: Add copyright notice.
275         * fprintftime.h: Likewise.
276         * savedir.c: Use (C) in copyright notice.
277         * savedir.h: Likewise.
278
279         2006-08-15  Jim Meyering  <jim@meyering.net>
280
281         * at-func.c: New file, with the logic of all emulated at-functions.
282         * openat-priv.h: Include <errno.h> and define ENOSYS,
283         in support of the EXPECTED_ERRNO macro.
284         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
285         Instead, define the appropriate symbols and include "at-func.c".
286         * mkdirat.c (mkdirat): Likewise.
287         * fchmodat.c (fchmodat): Likewise.
288         (ENOSYS): Remove definition.
289         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
290         Don't include "unistd--.h" -- it wasn't ever used.
291
292         2006-01-17  Jim Meyering  <jim@meyering.net>
293
294         Rewrite fts.c not to change the current working directory,
295         by using openat, fstatat, fdopendir, etc..
296
297         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
298         (HAVE_OPENAT_SUPPORT): Define.
299         [_LIBC] (fchdir): Don't undef or define; no longer used.
300         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
301         Now, this `function' always succeeds, and consumes its file descriptor
302         parameter -- so callers must not close such FDs.  Update callers.
303         (diropen_fd, opendirat, cwd_advance_fd): New functions.
304         (diropen): Add parameter, SP.  Adjust all callers.
305         Implement using diropen_fd, rather than open.
306         (fts_open): Initialize new member, fts_cwd_fd.
307         Remove fts_rft-setting code.
308         (fts_close): Close fts_cwd_fd, if necessary.
309         (__opendir2): Define in terms of opendir or opendirat,
310         depending on whether the FST_NOCHDIR flag is set.
311         (fts_build): Since fts_safe_changedir consumes its FD, and since
312         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
313         and close the dup'd file descriptor upon failure.
314         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
315         (fts_safe_changedir): Tweak semantics to reflect that this function
316         now calls cwd_advance_fd and hence consumes its FD argument.
317         * fts_.h [struct FTS] (fts_cwd_fd): New member.
318         [struct FTS] (fts_rft): Remove now-unused member.
319         [struct FTS] (fts_cycle.state): Improve comment.
320
321         * openat.c (openat_needs_fchdir): New function.
322         * openat.h (openat_needs_fchdir): Declare it.
323
324 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
325
326         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
327         Problem and fix reported by Pádraig Brady in
328         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
329
330 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
331
332         * memcoll.c (memcoll): Optimize for the common case where the
333         arguments are bytewise equal.
334
335 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
336
337         Change copyright notice from LGPL 2 to GPL 2, since that's the
338         standard form used in the gnulib repository.
339         * lock.c: LGPL -> GPL.
340         * lock.h: Likewise.
341         * strnlen1.c: Likewise.
342         * strnlen1.h: Likewise.
343         * tls.c: Likewise.
344         * tls.h: Likewise.
345         * tmpdir.c: Likewise.
346
347         * TODO: Remove; this belongs only in coreutils.
348
349 2006-08-14  Eric Blake  <ebb9@byu.net>
350
351         Import the following change from libc:
352
353         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
354
355         Upstream bug 2997.
356         * misc/error.c: Add space between program name and message if file
357         name is missing.
358
359 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
360
361         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
362         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
363
364         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
365         in wchar_t.  Problem reported by Eric Blake.
366
367         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
368         LEN is smaller than SIZE.  Suggested by Bruno Haible.
369         Also, help the compiler to keep LEN in a register.
370
371 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
372
373         * .cppi-disable: Add snprintf.h, socket_.h.
374         * snprintf.c: Include <errno.h> and <limits.h>.
375         (EOVERFLOW): Define if the system does not.
376         Do not include "minmax.h"; it wasn't used.
377         (snprintf): Don't assume size_t promotes to an unsigned type.
378         Fix bug when generated string was too long for the buffer: the
379         buffer's contents are supposed to be the initial prefix of the
380         output.  Don't assume vasnprintf returns EOVERFLOW if the size
381         exceeds INT_MAX; do the check ourselves.
382
383         Import the following changes from libc:
384
385         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
386
387         * posix/regex_internal.c (re_string_skip_chars): If no character has
388         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
389         to the byte which couldn't be converted.
390         (re_string_reconstruct): Don't clear valid_raw_len before calling
391         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
392         tip_context using re_string_context_at.
393
394         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
395
396         * posix/regex.h: g++ still cannot handled [restrict].
397
398         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
399
400         * posix/regex.h: Remove special handling for VMS.
401
402 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
403
404         Sync from coreutils.
405
406         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
407
408         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
409         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
410
411 2006-08-08  Eric Blake  <ebb9@byu.net>
412
413         * verror.c (verror_at_line): Work around glibc bug 2997, so that
414         verror_at_line output complies with GNU Coding Standards even when
415         file is NULL.
416
417 2006-08-08  Eric Blake  <ebb9@byu.net>
418
419         * verror.h, verror.c: New files.
420
421 2006-08-07  Bruno Haible  <bruno@clisp.org>
422
423         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
424         versions of AIX.
425         Reported by Ralf Wildenhues.
426
427 2006-08-06  Eric Blake  <ebb9@byu.net>
428
429         * error.h: Fold in some upstream changes from glibc.
430         * error.c: Likewise.
431
432 2006-07-29  Bruno Haible  <bruno@clisp.org>
433
434         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
435
436 2006-07-29  Bruno Haible  <bruno@clisp.org>
437
438         * setenv.c: Undo unintended modification done on 2006-02-27.
439
440 2006-07-28  Eric Blake  <ebb9@byu.net>
441
442         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
443         macro expansion.
444
445 2006-07-28  Simon Josefsson  <jas@extundo.com>
446
447         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
448         #include's.
449
450 2006-07-28  Simon Josefsson  <jas@extundo.com>
451
452         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
453         #include's.
454
455 2006-07-28  Bruno Haible <bruno@clisp.org>
456
457         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
458
459 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
460
461         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
462         arpa/inet.h.
463
464 2006-07-28  Bruno Haible  <bruno@clisp.org>
465
466         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
467         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
468         fallbacks.
469         Avoids link error on FreeBSD 4.x.
470         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
471
472         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
473         encoding.
474         * mbswidth.c (iswcntrl): Likewise.
475
476 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
477
478         * modechange.c (mode_compile): Numeric modes now affect setuid and
479         setgid on directories only if they set these bits.
480         * modechange.h: Remove obsolete comment about masks.
481
482 2006-07-27  Bruno Haible  <bruno@clisp.org>
483
484         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
485         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
486         defined.
487
488 2006-07-26  Eric Blake  <ebb9@byu.net>
489
490         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
491         like mingw that lack mkstemp.
492         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
493         avoid compilation warning on mingw.
494
495 2006-07-25  Bruno Haible  <bruno@clisp.org>
496
497         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
498         <stdarg.h> or config.h.
499
500 2006-07-24  Bruno Haible  <bruno@clisp.org>
501
502         * clean-temp.h: New file, from GNU gettext.
503         * clean-temp.c: New file, from GNU gettext.
504
505 2006-07-24  Bruno Haible  <bruno@clisp.org>
506
507         * tmpdir.h: New file, from GNU gettext.
508         * tmpdir.c: New file, from GNU gettext.
509
510 2006-07-23  Bruno Haible  <bruno@clisp.org>
511
512         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
513         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
514         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
515         gl_linked_remove_at): Use it.
516
517 2006-07-23  Eric Blake  <ebb9@byu.net>
518
519         * tmpfile-safer.c: New file.
520         * stdio-safer.h (fopen_safer): Add prototype.
521         * stdio--.h (tmpfile): Make safer.
522
523 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
524
525         * close-stream.c, close-stream.h: New files.
526
527 2006-07-22  Bruno Haible  <bruno@clisp.org>
528
529         Merge from GNU gettext 0.15.
530
531         2005-07-05  Bruno Haible  <bruno@clisp.org>
532
533                 * printf-args.c (printf_fetchargs): Work around broken
534                 definition of wint_t on mingw.
535
536         2005-02-12  Bruno Haible  <bruno@clisp.org>
537
538                 * xallocsa.h: Add extern "C" for C++.
539
540         2006-05-17  Bruno Haible  <bruno@clisp.org>
541
542                 Cygwin portability.
543                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
544
545         2006-04-30  Bruno Haible  <bruno@clisp.org>
546
547                 * progreloc.c: Include <mach-o/dyld.h> if available.
548                 (find_executable): Use _NSGetExecutablePath when possible.
549
550         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
551
552                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
553                 function.
554
555         2005-12-29  Bruno Haible  <bruno@clisp.org>
556
557                 * progreloc.c (set_program_name_and_installdir): Fix
558                 compilation error.
559
560         2005-12-04  Bruno Haible  <bruno@clisp.org>
561
562                 Cygwin portability.
563                 * progreloc.c: Include <windows.h> also on Cygwin.
564                 (find_executable): Add support for Cygwin.
565                 (set_program_name_and_installdir): Handle also platforms with
566                 nonempty EXEEXT.
567
568         2006-07-11  Bruno Haible  <bruno@clisp.org>
569
570                 * javacomp.c: Fix a comment.
571                 Reported by Jim Meyering.
572
573         2006-04-30  Bruno Haible  <bruno@clisp.org>
574
575                 * javacomp.h (compile_java_class): Add source_version,
576                 target_version arguments.
577                 * javacomp.c: Rewritten to choose only a compiler that
578                 respects the specified source_version and target_version.
579
580         2006-06-27  Bruno Haible  <bruno@clisp.org>
581
582                 Assume correct S_ISDIR macro.
583                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
584
585         2006-07-22  Bruno Haible  <bruno@clisp.org>
586
587                 * javaversion.h: New file, from GNU gettext.
588                 * javaversion.c: New file, from GNU gettext.
589                 * javaversion.java: New file, from GNU gettext.
590                 * javaversion.class: New file, from GNU gettext.
591
592         2006-05-17  Bruno Haible  <bruno@clisp.org>
593
594                 Cygwin portability.
595                 * javaexec.c (execute_java_class): Test for jview program
596                 also on Cygwin.
597
598         2006-04-09  Bruno Haible  <bruno@clisp.org>
599
600                 * fatal-signal.c: Don't include string.h.
601                 (at_fatal_signal): Use a copying loop instead of memcpy.
602
603         2005-12-04  Bruno Haible  <bruno@clisp.org>
604
605                 * csharpexec.c: Add support for 'clix' launcher (untested).
606                 (execute_csharp_using_sscli): New function.
607                 (execute_csharp_program): Call it.
608
609         2006-06-21  Bruno Haible  <bruno@clisp.org>
610
611                 Avoid warnings from recent versions of mcs.
612                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
613                 -o, -L, -r any more. Use options documented since mcs-1.0
614                 instead. Similarly for -g.
615
616         2005-07-09  Bruno Haible  <bruno@clisp.org>
617
618                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
619                 add a .dll suffix.
620                 Reported by Mark Junker <mjscod@gmx.de>.
621
622         2006-06-17  Bruno Haible  <bruno@clisp.org>
623
624                 * config.charset: Update for NetBSD 3.0.
625
626         2006-05-17  Bruno Haible  <bruno@clisp.org>
627
628                 Cygwin portability.
629                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
630
631         2006-05-16  Bruno Haible  <bruno@clisp.org>
632
633                 * localcharset.c [CYGWIN]: Include <windows.h>.
634                 (get_charset_aliases): For Cygwin, return the same CPxxx
635                 aliases list as under WIN32.
636                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
637                 the environment variables. Fall back to GetACP().
638
639         2006-04-05  Bruno Haible  <bruno@clisp.org>
640
641                 * config.charset: Update Juan Manuel Guerrero's address.
642
643         2005-02-12  Bruno Haible  <bruno@clisp.org>
644
645                 * allocsa.h: Add extern "C" for C++.
646
647         2005-02-10  Bruno Haible  <bruno@clisp.org>
648
649                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
650                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
651
652         2006-07-22  Bruno Haible  <bruno@clisp.org>
653
654                 * gettext.h: Update to GNU gettext-0.15.
655
656 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
657         and Simon Josefsson <jas@extundo.com>
658
659         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
660
661         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
662
663 2006-07-21  Eric Blake  <ebb9@byu.net>
664
665         * stdlib-safer.h: New file from coreutils, required by
666         stdlib--.h.
667
668 2006-07-19  Derek R. Price  <derek@ximbiot.com>
669
670         * getaddrinfo.h: Don't define unimplemented AI_* flags.
671         Reindent and repaginate.
672
673 2006-07-17  Bruno Haible  <bruno@clisp.org>
674
675         * gl_list.h: New file.
676         * gl_list.c: New file.
677         * gl_array_list.h: New file.
678         * gl_array_list.c: New file.
679         * gl_carray_list.h: New file.
680         * gl_carray_list.c: New file.
681         * gl_linked_list.h: New file.
682         * gl_linked_list.c: New file.
683         * gl_anylinked_list1.h: New file.
684         * gl_anylinked_list2.h: New file.
685         * gl_avltree_list.h: New file.
686         * gl_avltree_list.c: New file.
687         * gl_anyavltree_list1.h: New file.
688         * gl_anyavltree_list2.h: New file.
689         * gl_rbtree_list.h: New file.
690         * gl_rbtree_list.c: New file.
691         * gl_anyrbtree_list1.h: New file.
692         * gl_anyrbtree_list2.h: New file.
693         * gl_anytree_list1.h: New file.
694         * gl_anytree_list2.h: New file.
695         * gl_linkedhash_list.h: New file.
696         * gl_linkedhash_list.c: New file.
697         * gl_anyhash_list1.h: New file.
698         * gl_anyhash_list2.h: New file.
699         * gl_avltreehash_list.h: New file.
700         * gl_avltreehash_list.c: New file.
701         * gl_rbtreehash_list.h: New file.
702         * gl_rbtreehash_list.c: New file.
703         * gl_anytreehash_list1.h: New file.
704         * gl_anytreehash_list2.h: New file.
705
706         * gl_oset.h: New file.
707         * gl_oset.c: New file.
708         * gl_array_oset.h: New file.
709         * gl_array_oset.c: New file.
710         * gl_avltree_oset.h: New file.
711         * gl_avltree_oset.c: New file.
712         * gl_rbtree_oset.h: New file.
713         * gl_rbtree_oset.c: New file.
714         * gl_anytree_oset.h: New file.
715
716 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
717
718         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
719         New files.
720         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
721         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
722         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
723         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
724         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
725         callers changed.  Revamp internals significantly, by not
726         attempting to create directories that are temporarily more
727         permissive than the final results.  Do not attempt to use
728         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
729         This removes some race conditions, fixes some bugs, and simplifies
730         things.  Use new dirchownmod function to do owner and mode changes.
731         * mkdir-p.h: Likewise.
732         * modechange.c (octal_to_mode): New function.
733         (struct mode_change): New member mentioned.
734         (make_node_op_equals): New arg mentioned.  All callers changed.
735         (mode_compile): Keep track of which mode bits the user has explicitly
736         mentioned.
737         (mode_adjust): New arg DIR, so that we implement the X op correctly.
738         New arg PMODE_BITS, to keep track of which mode bits the user
739         mentioned; it treats S_ISUID and S_ISGID speciall.
740         All callers changed.
741         * modechange.h: Likewise.
742
743 2006-07-11  Derek R. Price  <derek@ximbiot.com>
744
745         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
746
747 2006-07-10  Derek R. Price  <derek@ximbiot.com>
748
749         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
750         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
751         macros into the GNU _D_EXACT_NAMLEN.
752         * savedir.c:  Likewise.
753         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
754
755 2006-07-09  Jim Meyering  <jim@meyering.net>
756
757         * argp-pv.c: Remove a doubled word in a comment.
758         * check-version.c (check_version): Likewise.
759         * javacomp.c (compile_java_class): Likewise.
760
761 2006-07-08  Jim Meyering  <jim@meyering.net>
762
763         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
764
765 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
766
767         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
768         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
769         brackets.  Other minor changes to suppress some compiler
770         warnings.
771
772 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
773
774         * getloadavg.c: Use __VMS, not VMS.
775         * getopt.c: Likewise.
776         * getpagesize.h: Likewise.
777         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
778         probably does not work.
779
780 2006-07-06  Derek R. Price  <derek@ximbiot.com>
781         and Paul Eggert  <eggert@cs.ucla.edu>
782
783         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
784         Don't worry about this obsolete case any more.
785         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
786         directories.
787         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
788         worry about this obsolete case any more.
789         * fts.c: Likewise.
790         * getcwd.c: Likewise.
791         * glob.h: Likewise.
792         * savedir.c: Likewise.
793
794 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
795
796         * .cppi-disable: Add wcwidth.
797         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
798         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
799         (ISGRAPH): Remove.  All uses changed to isgraph.
800         (FOLD) [!defined _LIBC]: Remove special case.
801         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
802         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
803         HAVE_ISBLANK.
804         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
805
806 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
807
808         * strtod.c (strtod): cast the argument of tolower to unsigned char.
809
810 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
811
812         * memcasecmp.c: Include <limits.h>.
813         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
814         * strtod.c (strtod): Don't assume isspace works on negative chars.
815         Don't assume isdigit succeeds only on '0' through '9'.
816
817 2006-07-05  Derek R. Price  <derek@ximbiot.com>
818
819         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
820         All uses of is_space replaced by isspace.
821         * exit.h: Don't talk about STDC_HEADERS.
822         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
823         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
824         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
825         replaced by isprint etc.
826         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
827         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
828         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
829         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
830         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
831         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
832
833 2006-07-05  Eric Blake  <ebb9@byu.net>
834
835         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
836         missing from netdb.h.
837         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
838
839 2006-06-27  Bruno Haible  <bruno@clisp.org>
840
841         Assume ANSI C header files and <ctype.h> functions.
842         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
843         (mbsnwidth): Use isprint, iscntrl instead.
844
845 2006-07-03  Jim Meyering  <jim@meyering.net>
846
847         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
848         macro is used before the first cycle_check call.
849
850 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
851
852         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
853         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
854         reported by Mark D. Baushke, one in
855         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
856
857         Merge from coreutils.
858
859         * .cppi-disable: Add stdint_.h.
860         * .cvsignore: Add stdint.h.
861
862         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
863
864         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
865         both double and long double versions.
866         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
867         * xstrtold.c: New file.
868         * xstrtod.h (xstrtold): New decl.
869
870         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
871
872         * filemode.c (setst): Remove.
873         (strmode): Rewrite to avoid setst.  This makes the code shorter,
874         (arguably) clearer, and the generated code is a bit smaller on my
875         Debian GNU/Linux stable x86 host.
876
877         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
878
879         * filemode.c: Include "filemode.h" first, to test the interface.
880         Assume that filemode.h includes sys/types.h and sys/stat.h.
881         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
882         (ftypelet): Reorder to put common cases first, for efficiency.
883         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
884         to do 'M'.
885         (strmode): Renamed from mode_string, and now stores 12 bytes instead
886         of 10, for compatibility with FreeBSD.  All callers changed.
887         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
888         that can't be deduced solely from st_mode.  First arg is now a const
889         pointer.
890         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
891         (strmode): Renamed from mode_string.
892         (filemodestring): New decl.
893         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
894         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
895         (S_ISPORT, S_ISWHT): New macros, if not already defined.
896
897         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
898
899         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
900         fsusage.h now does that.  Include fsusage.h first, to test interface.
901         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
902         at most one method (the old code could have generated decls that
903         didn't conform to C89, not that this was ever exercised).
904         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
905
906         2006-03-19  Jim Meyering  <jim@meyering.net>
907
908         Work even in a chroot where d_ino values for entries in "/"
909         don't match the stat.st_ino values for the same names.
910         * getcwd.c (__getcwd): When no d_ino value matches the target inode
911         number, iterate through all entries again, using lstat instead.
912         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
913         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
914
915         * getcwd.c (__getcwd): Clarify a comment.
916         Use memcpy in place of a call to strcpy.
917
918         2006-03-12  Jim Meyering  <jim@meyering.net>
919
920         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
921         that of the current directory (which we're about to chdir ".." out of),
922         then save the dev-ino of the parent, instead.
923
924         * same-inode.h (SAME_INODE): New file/macro.
925         * chdir-safer.c (SAME_INODE): Remove definition.
926         Include "same-inode.h", instead.
927         * same.c: Likewise.
928         * cycle-check.h: Include "same-inode.h".
929         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
930         * cycle-check.c (SAME_INODE): Remove definition.
931         * root-dev-ino.h: Include "same-inode.h".
932
933         2006-03-11  Eric Blake  <ebb9@byu.net>
934
935         * same.c (same_name): s/base_name/last_component/
936         * backupfile.c (check_extension, numbered_backup): Likewise.
937         * filenamecat.c (file_name_concat): Likewise.
938
939         2006-03-11  Eric Blake  <ebb9@byu.net>,
940                     Paul Eggert  <eggert@cs.ucla.edu>
941
942         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
943         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
944         drive prefix.
945         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
946         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
947         (last_component): New method.
948         * dirname.c (dir_len): Determine when drive letters need a
949         subsequent slash.  Preserve // when it is special.
950         (dir_name): Don't append dot when drive letter is absolute.
951         [TEST_DIRNAME]: Move into a full-blown gnulib test.
952         * basename.c (base_name): New semantics - malloc the result.
953         Preserve // when it is special.  Preserve relative files that look
954         like drive letters.
955         (base_len): Preserve // when it is special.
956         (last_component): New method, similar to old base_name semantics.
957         * stripslash.c (strip_trailing_slashes): Use last_component, not
958         base_name.  Strip redundant slashes from ///.
959
960 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
961
962         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
963         both are 64 bits, since this seems to be the tradition, and this
964         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
965         we ever run into a host that prefers long long to long in this
966         case, we'll need another configure-time test.  Problem reported by
967         Jim Meyering.
968
969 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
970
971         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
972         possible collision with system files.
973         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
974         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
975         WCHAR_MIN and WCHAR_MAX in this case.
976         (<stddef.h>): Do not include; no longer needed.
977         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
978         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
979         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
980         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
981         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
982         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
983         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
984         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
985         !defined(__c99))]: Include in this case too, since it's harmless
986         now.
987         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
988         dangerous to do so.
989         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
990         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
991         (_STDINT_MIN, _STDINT_MAX): New macros.
992         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
993         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
994         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
995         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
996         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
997         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
998         macros, not typedefs; this simplifies things quite a bit.
999         Use long int for all types narrower than int64_t.
1000         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1001         Define in terms of long long int or int64_t or long int,
1002         not int64_t or int32_t.  This saves some compile-time testing.
1003         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1004         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1005         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1006         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1007         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1008         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1009         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1010         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1011         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1012         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1013         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1014         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1015         undef any previous version and define our own version, for
1016         simplicity and consistency with the new macros for types.
1017         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1018         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1019         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1020         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1021         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1022         @WINT_T_SUFFIX@ to keep things simple here.
1023         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1024         Simplify by assuming typical 8/16/32/64 host, since we're
1025         already doing that elsewhere anyway.
1026         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1027         and assume long long int is 64 bits if available.  This
1028         speeds up 'configure'.
1029
1030 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1031
1032         * getaddrinfo.c: fixed typo
1033
1034 2006-06-29  Eric Blake  <ebb9@byu.net>
1035
1036         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1037         unused static function.
1038
1039 2006-06-29  Eric Blake  <ebb9@byu.net>
1040
1041         * stat_.h: New file.
1042
1043 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1044
1045         * strftime.c: Assume strftime() exists.
1046
1047 2006-06-28  Bruno Haible  <bruno@clisp.org>
1048
1049         * getaddrinfo.h: Fix POSIX URL.
1050         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1051         (use_win32_p): Make static.
1052         (getaddrinfo): Reject service name if it is empty or does not consist
1053         solely of decimal digits, or if its value is > 65535.
1054         (getnameinfo): Remove useless casts.
1055
1056 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1057
1058         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1059         Autoconf 2.60 says this stuff was obsolete.
1060
1061 2006-05-12  Bruno Haible  <bruno@clisp.org>
1062
1063         * mkdtemp.c [MINGW]: Include <io.h>.
1064         (mkdir): Define using _mkdir.
1065
1066 2006-06-28  Bruno Haible  <bruno@clisp.org>
1067
1068         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1069         declaration for wcwidth.
1070         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1071
1072 2006-06-28  Eric Blake  <ebb9@byu.net>
1073
1074         * xvasprintf.h: Fix comments.
1075
1076 2006-06-28  Eric Blake  <ebb9@byu.net>
1077
1078         * mbchar.h (wcwidth): Include wcwidth.h.
1079         * mbswidth.c (wcwidth): Move from here...
1080         * wcwidth.h: ...to this new file.
1081
1082 2006-06-28  Simon Josefsson  <jas@extundo.com>
1083
1084         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1085         functions there.  It will succeed on Windows XP, but on Windows
1086         2000 and (presumably) earlier, it will fail, and use the internal
1087         re-implementation.
1088         (use_win32_p): New function.
1089         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1090         Support AI_NUMERICSERV to disable getservbyname.
1091         (getnameinfo): New function, only supports
1092         NI_NUMERICHOST|NI_NUMERICSERV for now.
1093
1094         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1095         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1096         getnameinfo.
1097
1098 2006-06-27  Bruno Haible  <bruno@clisp.org>
1099
1100         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1101
1102 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1103
1104         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1105         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1106         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1107
1108 2006-06-26  Bruno Haible  <bruno@clisp.org>
1109
1110         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1111         WCHAR_MAX.
1112         Reported by Mark D. Baushke and Larry Jones.
1113
1114 2006-06-26  Bruno Haible  <bruno@clisp.org>
1115
1116         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1117         in pre-C99 mode.
1118         Suggested by Mark D. Baushke and Larry Jones.
1119
1120 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1121
1122         * stdint_.h: Treat BSD/OS like OpenBSD.
1123
1124 2006-06-23  Bruno Haible  <bruno@clisp.org>
1125
1126         * stdint_.h: Treat IRIX like OpenBSD.
1127
1128 2006-06-23  Bruno Haible  <bruno@clisp.org>
1129
1130         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1131         ISO C 99 Technical Corrigendum 1.
1132
1133 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1134
1135         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1136         Some compiler complained about some of them.  Problem reported by
1137         Larry Jones in
1138         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1139
1140 2006-06-21  Simon Josefsson  <jas@extundo.com>
1141
1142         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1143         variable.
1144
1145         * socket_.h: Don't define WINVER.
1146
1147         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1148         slightly modified to work in gnulib.
1149
1150 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1151
1152         * read-file.c (fread_file): Start with buffer allocation of
1153         0 bytes rather than 1 byte; this simplifies the code.
1154         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1155         code to free buffer and save/restore errno.
1156         (internal_read_file): Remove unused local.
1157
1158 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1159
1160         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1161         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1162         Problem reported by Denis Excoffier in
1163         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1164
1165 2006-06-19  Simon Josefsson  <jas@extundo.com>
1166
1167         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1168
1169 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1170
1171         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1172
1173 2006-06-17  Bruno Haible  <bruno@clisp.org>
1174
1175         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1176
1177 2006-06-17  Bruno Haible  <bruno@clisp.org>
1178
1179         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1180         problem on Solaris 2.5.1.
1181
1182 2006-06-16  Eric Blake  <ebb9@byu.net>
1183
1184         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1185         * unicodeio.c [!defined errno]: Likewise.
1186         * strtol.c [!defined errno]: Likewise.
1187         * strtod.c [!defined errno]: Likewise.
1188
1189 2006-06-15  Bruno Haible  <bruno@clisp.org>
1190
1191         * stdint_.h: Rewritten to be fully auto-configured.
1192         Fixes bug on HP-UX/IA64.
1193
1194 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1195
1196         * getdate.y (__attribute__): Don't define if already defined.
1197         Problem reported by Larry Jones.
1198         * utimens.c (__attribute__): Likewise.
1199
1200 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1201
1202         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1203         reported by Andreas Schwab.
1204
1205 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1206             Bruno Haible  <bruno@clisp.org>
1207
1208         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1209
1210 2006-05-26  Martin Lambers  <marlam@marlam.de>
1211
1212         * getpass.c: Updates the test for the native W32 API, and adds
1213         missing includes, thus fixing compilation warnings.
1214
1215 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1216
1217         * tempname.c (small_open, large_open): New macros.
1218         (__open, __open64) [!_LIBC]: Remove.
1219         (__gen_tempname): Use small_open and large_open instead of __open
1220         and __open64.  This fixes a portability bug on HP-UX 11.11i
1221         reported by Simon Wing-Tang in
1222         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1223
1224 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1225
1226         * exclude.c (exclude_fnmatch): New function.
1227         (excluded_file_name): Call exclude_fnmatch.
1228         * exclude.h (excluded_file_name): New prototype
1229
1230 2006-05-24  Bruno Haible  <bruno@clisp.org>
1231
1232         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1233         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1234         Reported by Thorsten Maerz <torte@netztorte.de> via
1235         Aaron Stone <aaron@serendipity.cx>.
1236
1237 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1238
1239         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1240         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1241         (my_usleep): Don't mishandle maximum value.
1242
1243 2006-05-19  Jim Meyering  <jim@meyering.net>
1244
1245         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1246
1247 2006-05-17  Bruno Haible  <bruno@clisp.org>
1248
1249         Cygwin portability.
1250         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1251
1252 2006-05-17  Bruno Haible  <bruno@clisp.org>
1253
1254         * stdint_.h: Fix recognition of Cygwin.
1255
1256 2006-05-11  Jim Meyering  <jim@meyering.net>
1257
1258         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1259
1260 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1261
1262         * crc.c (crc32_update): Remove unnecessary L suffix.
1263         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1264         unwanted sign propagation, e.g., on hosts with 64-bit int.
1265         There still are some problems with reeelly weird theoretical hosts
1266         (e.g., 33-bit int) but it's not worth worrying about now.
1267         * sha1.c (rol): Likewise.
1268         (K1, K2, K3, K4): Remove unnecessary L suffix.
1269
1270 2006-05-10  Bruno Haible  <bruno@clisp.org>
1271
1272         * des.c: Cast to avoid warnings.
1273
1274 2006-05-10  Simon Josefsson  <jas@extundo.com>
1275
1276         * md4.c: Typo fix, update copyright years.
1277         (K1, K2): Don't use L because it turn computations into 64-bit on
1278         64-bit platforms.
1279
1280 2006-05-09  Bruno Haible  <bruno@clisp.org>
1281
1282         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1283         (EOVERFLOW): Define fallback value.
1284         (xstrcat): New function.
1285         (xvasprintf): Recognize the special case of a string concatenation.
1286
1287 2006-05-01  Bruno Haible  <bruno@clisp.org>
1288
1289         * stdint_.h: Shorter URL.
1290         * inttypes.h: Likewise.
1291
1292 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1293
1294         * verify.h: Document the internals better.  Most of this change
1295         was written by Bruno Haible.
1296
1297 2006-04-29  Bruno Haible  <bruno@clisp.org>
1298
1299         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1300         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1301
1302 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1303
1304         * getdate.y (get_date): When adding relative date, start with the
1305         initial time, not with the result of the first mktime call.
1306
1307 2006-04-23  Bruno Haible  <bruno@clisp.org>
1308
1309         * copy-file.c: Include <unistd.h> unconditionally.
1310         * execute.c: Likewise.
1311         * fatal-signal.c: Likewise.
1312         * findprog.c: Likewise.
1313         * mkdtemp.c: Likewise.
1314         * pipe.h: Likewise.
1315         * pipe.c: Likewise.
1316         * wait-process.h: Likewise.
1317
1318 2006-04-23  Bruno Haible  <bruno@clisp.org>
1319
1320         * fwriteerror.c (fwriteerror): Call fclose also when an error
1321         condition was already detected.
1322         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1323
1324 2006-04-19  Derek Price  <derek@ximbiot.com>
1325             Eric Blake  <ebb9@byu.net>
1326
1327         * inttypes.h: Correct grammar in comment.
1328
1329 2006-04-18  Derek Price  <derek@ximbiot.com>
1330             Paul Eggert  <eggert@cs.ucla.edu>
1331
1332         * inttypes.h: New file.
1333         * strtoimax.c: Assume <inttypes.h>.
1334
1335 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1336
1337         * utimens.c (futimens): glibc futimesat messes up if /proc
1338         isn't mounted.  Problem reported by Kir Kolyshkin.
1339
1340 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1341
1342         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1343         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1344         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1345
1346 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1347
1348         Merge regex changes from libc, removing some of our
1349         POSIX-conformance changes that were rejected and redoing them in a
1350         less-intrusive way.
1351
1352         * regcomp.c (re_compile_internal, init_dfa):
1353         Length arg is now size_t, not Idx.  All uses changed.
1354         (peek_token): Forward decl now says internal_function.
1355         (__re_error_msgid, __re_error_msgid_idx):
1356         Now static rather than extern with attribute_hidden.
1357         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1358         For some reason libc prefers K&R style defns for external functions.
1359         (regerror) [!defined _LIBC]: Likewise.
1360         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1361         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1362         (build_range_exp, build_collating_symbol):
1363         Use K&R-style defn.
1364         (re_compile_fastmap): Use '\0' to memset, not 0.
1365         (utf8_sb_map): Make the calculations more obvious.
1366         (init_dfa, parse_bracket_exp, build_charclass_op):
1367         Call calloc and cast result, as glibc does.
1368         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1369         (build_range_exp, build_collating_symbol):
1370         Now internal functions.
1371
1372         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1373
1374         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1375         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1376         Don't depend on VMS; depend on __VMS instead, for POSIX
1377         namespace cleanness.
1378         (regoff_t): Define to ssize_t, not long int.
1379
1380         Remove the REG_ macros named below.  Instead, make the old names
1381         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1382         __USE_GNU_REGEX.
1383         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1384         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1385         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1386         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1387         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1388         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1389         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1390         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1391         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1392         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1393         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1394         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1395         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1396         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1397         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1398         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1399         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1400         (REG_NREGS):
1401         Remove.  All uses replaced by the old RE_* names.
1402         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1403         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1404         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1405         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1406         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1407         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1408         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1409         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1410         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1411         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1412         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1413         Don't bother having these macros be independent of each others'
1414         values, since they no longer exist in the POSIX name space.
1415
1416         Rename the following member names back to their old names,
1417         unless !__USE_GNU_REGEX.  All uses changed back.
1418         (buffer): Renamed from re_buffer.
1419         (allocated): Renamed from re_allocated.
1420         (used): Renamed from re_used.
1421         (syntax): Renamed from re_syntax.
1422         (fastmap): Renamed from re_fastmap.
1423         (translate): Renamed from re_translate.
1424         (can_be_null): Renamed from re_can_be_null.
1425         (regs_allocated): Renamed from re_regs_allocated.
1426         (fastmap_accurate): Renamed from re_fastmap_accurate.
1427         (no_sub): Renamed from re_no_sub.
1428         (not_bol): Renamed from re_not_bol.
1429         (not_eol): Renamed from re_not_eol.
1430         (newline_anchor): Renamed from re_newline_anchor.
1431         (num_regs): Renamed from rm_num_regs.
1432         (start): Renamed from rm_start.
1433         (end): Renamed from rm_end.
1434
1435         (free_state): Move up a bit.
1436
1437         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1438         #define to be empty.
1439         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1440         when that is what is intended.
1441         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1442         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1443         (MAX): New macro.
1444         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1445         All uses changed back to re_malloc, etc.  It's now the caller's
1446         responsibility to check for overflow; all callers changed.
1447         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1448         (re_x2nrealloc): Remove.
1449         (free_state): Remove decl.
1450
1451         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1452         (re_set_registers, re_exec):
1453         Use K&R-style defn.
1454
1455         2006-01-31  Roland McGrath  <roland@redhat.com>
1456
1457         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1458         Reported by Mike Frysinger <vapier@gentoo.org>.
1459
1460         2006-01-15  Andreas Jaeger  <aj@suse.de>
1461
1462         [BZ #1950]
1463         * regex_internal.c (re_string_reconstruct): Adjust for
1464         build_wcs_upper_buffer change.
1465         (build_wcs_upper_buffer): Change return type.
1466
1467         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1468
1469         * regex_internal.h: Include <stdint.h> if available.
1470
1471         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1472
1473         * regex_internal.h (SIZE_MAX): Provide a default definition.
1474
1475         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1476
1477         * regcomp.c: Adjust for changed secondary hash function.
1478
1479         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1480
1481         * regex.h: Pretty printing.
1482         Clean up namespace a bit.
1483
1484         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1485
1486         * regexec.c (update_cur_sifted_state, check_arrival,
1487         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1488
1489         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1490                     Ulrich Drepper  <drepper@redhat.com>
1491
1492         [BZ #1302]
1493         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1494         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1495
1496         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1497
1498         [BZ #281]
1499         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1500         * regcomp.c: Remove unnecessary uses of
1501         unsigned RE_TRANSLATE_TYPE.
1502         * regex_internal.h: Likewise.
1503         * regex_internal.c: Likewise.
1504         * regexec.c: Likewise.
1505         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1506
1507         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1508
1509         * regexec.c (find_recover_state): Remove unnecessary
1510         initialization.
1511         (transit_state_bkref): Make DFA a const pointer.
1512         (get_subexp): Likewise.
1513         (check_arrival): Likewise.
1514         (update_cur_sifted_state): Likewise.
1515         (re_search_internal): Likewise.
1516         (prune_impossible_nodes): Likewise.
1517         (acquire_init_state_context): Likewise.
1518         (proceed_next_node): Likewise.
1519         (set_regs): Likewise.
1520         (free_fail_stack_return): Likewise.
1521         (check_arrival_expand_ecl): Mark DFA parameter as const.
1522         (check_arrival_expand_ecl_sub): Likewise.
1523         (check_subexp_limits): Likewise.
1524         (sub_epsilon_src_nodes):  Likewise.
1525         (add_epsilon_src_nodes):  Likewise.
1526         (merge_state_array): Likewise.
1527         (update_regs): Likewise.
1528         (build_trtable): Likewise.
1529         (sift_states_backward): Mark MCTX parameter as const.
1530         (build_sifted_states): Likewise.
1531         (update_cur_sifted_state): Likewise.
1532         (sift_states_mkref): Likewise.
1533         (check_arrival_expand_ecl): Mark eclosure as const.
1534         (check_dst_limits_calc_pos_1): Likewise.
1535         * regex_internal.h (re_match_context_t): Make dfa a const
1536         pointer.
1537
1538         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1539
1540         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1541         (transit_state_sb): Likewise.
1542         (transit_state_mb): Likewise.
1543         (sift_states_iter_mb): Likewise.
1544         (check_arrival_add_next_nodes): Likewise.
1545         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1546         [_LIBC] (re_search_2_stub): Use mempcpy.
1547
1548         * regex_internal.c (re_string_reconstruct): Avoid calling
1549         mbrtowc for very simple UTF-8 case.
1550
1551         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1552         a pointer-to-const.
1553         (re_acquire_state_context): Likewise.
1554         * regex_internal.h: Adjust prototypes.
1555
1556         * regex.c: Prevent using C++ compilers.
1557
1558         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1559         (re_acquire_state_context): Likewise.
1560
1561 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1562             Bruno Haible  <bruno@clisp.org>
1563
1564         * stdint_.h: On OpenBSD, don't redefine types already included in
1565         <sys/types.h> and <inttypes.h>.
1566
1567 2006-03-24  Eric Blake  <ebb9@byu.net>
1568
1569         * time_r.c (copy_string_result): Remove, as it is no longer used.
1570
1571 2006-03-24  Simon Josefsson  <jas@extundo.com>
1572
1573         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1574         including some doc fixes.
1575         (base64_encode_alloc): Fix +1 bug on allocation failures.
1576
1577 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1578
1579         * base64.c (base64_encode): Do not read past end of array with
1580         unsanitized input on systems with CHAR_BIT > 8.
1581
1582 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1583
1584         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1585         Typedef to long int, not to off_, as POSIX will likely change
1586         in that direction.
1587
1588 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1589
1590         * argp-help.c (validate_uparams): Fix typo
1591         * argp-parse.c (argp_default_options): Consistently begin help
1592         messages with a lowercase letter.
1593
1594 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1595
1596         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1597         overrun buffers and shouldn't be used (much as gets shouldn't be
1598         used).
1599         * time_r.c (asctime_r, ctime_r): Likewise.
1600
1601 2006-03-08  Simon Josefsson  <jas@extundo.com>
1602
1603         * gc-gnulib.c (randomize): Don't open files called 'no', they
1604         signal that configure disabled the device.
1605
1606 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1607
1608         * c-stack.c: Include unistd.h unconditionally, since we now assume
1609         the unistd module.
1610         * getlogin_r.c: Likewise.
1611         * getlogin_r.h: Likewise.
1612         * glob.c: Likewise.
1613         * pagealign_alloc.c: Likewise.
1614         * unistd_.h: Remove; no longer needed.
1615
1616 2006-03-07  Simon Josefsson  <jas@extundo.com>
1617
1618         * unistd_.h: New file.
1619
1620 2006-03-07  Simon Josefsson  <jas@extundo.com>
1621
1622         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1623
1624 2006-03-01  Simon Josefsson  <jas@extundo.com>
1625
1626         * readline.c: Fix typo, tiny patch from Stepan Kasal
1627         <kasal@ucw.cz>.
1628
1629 2006-02-28  Simon Josefsson  <jas@extundo.com>
1630
1631         * getopt.c: Protect #include of unistd.h, for MSVS.
1632
1633 2006-02-27  Simon Josefsson  <jas@extundo.com>
1634
1635         * base64.h: Indent #define's.  From Jim Meyering
1636         <jim@meyering.net>.
1637
1638 2006-02-27  Jim Meyering  <jim@meyering.net>
1639
1640         Revert the change of 2006-02-24, so these files can continue
1641         to be sync'd from gettext.
1642         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1643         of `config.h'.
1644
1645 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1646
1647         * glob.c: Say "invalid" rather than "illegal" in comments.
1648
1649 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1650
1651         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1652
1653 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1654
1655         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1656         AT_FDCWD exceeds INT_MAX.
1657         * openat.h (AT_FDCWD): Likewise.
1658
1659 2006-02-14  Jim Meyering  <jim@meyering.net>
1660
1661         Sync from coreutils.
1662
1663         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1664         failure on deficient systems, and simplify gnulib lgpl dependencies.
1665         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1666         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1667
1668         * xalloc-die.c: Remove unused definition of N_.
1669
1670 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1671
1672         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1673
1674 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1675
1676         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1677         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1678
1679 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1680
1681         * argp-namefrob.h: Restore changes accidentally lost during the
1682         "autoupdate" on 2005-12-12.
1683
1684 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1685
1686         * fnmatch.c (L_): Renamed from L, to work around a bug in
1687         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1688         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1689         All uses changed.
1690
1691 2006-01-26  Simon Josefsson  <jas@extundo.com>
1692
1693         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1694         prototype is visible on mingw32.
1695
1696         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1697         for mingw32.
1698
1699         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1700         mingw32).
1701
1702 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1703
1704         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1705         attempt to open for write; this always fails, at least on POSIX
1706         hosts.  This reinstates the 2006-01-09 change, which was
1707         inadvertently removed.
1708
1709 2006-01-26  Bruno Haible  <bruno@clisp.org>
1710             Paul Eggert  <eggert@cs.ucla.edu>
1711
1712         * stdbool_.h (_Bool)
1713         [(! (defined __cplusplus || defined __BEOS__)
1714           && !defined __GNUC__
1715           && !(defined __HP_cc || defined __xlc__
1716                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1717                || defined __sgi))]:
1718         #define to signed char in these cases too; this simplifies
1719         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1720         etc., separately) and makes it more conservative.
1721
1722 2006-01-21  Jim Meyering  <jim@meyering.net>
1723
1724         Sync from the stable (b5) branch of coreutils:
1725
1726         * fts.c (fts_children): Don't let close() clobber errno from
1727         failed fchdir().
1728
1729         * fts.c (fts_stat): When following a symlink-to-directory,
1730         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1731         a dangling symlink.  That can also happen at least for ELOOP.
1732         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1733         FYI, this bug predates the inclusion of fts.c in coreutils.
1734
1735         * fts.c (fts_open): Put new maxarglen declaration and uses
1736         in their own block, so pre-c99 compilers don't object.
1737
1738         Avoid the double-free (first in fts_read, second in fts_close) that
1739         would occur when an `active' directory is made inaccessible (e.g.,
1740         via chmod a-x) during a traversal.
1741         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1742         before returning.  Reproduce this failure by
1743         mkdir -p a/b; cd a; chmod a-x . b
1744         Reported by Stavros Passas.
1745
1746 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1747
1748         * argp-namefrob.h: Bugfix. Remove stray #
1749
1750 2006-01-25  Bruno Haible  <bruno@clisp.org>
1751
1752         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1753         warnings.
1754         Reported by Paul Eggert.
1755
1756 2006-01-25  Jim Meyering  <jim@meyering.net>
1757
1758         * fileblocks.c: Remove more useless parentheses.
1759         * readutmp.h: Likewise.
1760
1761 2006-01-24  Bruno Haible  <bruno@clisp.org>
1762
1763         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1764         has it.
1765         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1766         2005-11-26.
1767
1768         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1769         to avoid problems with the built-in _Bool type.
1770         Reported by Paul Eggert on 2005-11-26.
1771
1772 2006-01-24  Jim Meyering  <jim@meyering.net>
1773
1774         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1775
1776 2006-01-24  Simon Josefsson  <jas@extundo.com>
1777
1778         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1779         Bruno.
1780
1781 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1782
1783         Work around porting bugs reported by Dieter in
1784         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1785         * getopt.c (_NOPROTO): Remove; no longer needed.
1786         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1787         Include "getopt.h" first, to check interface.
1788         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1789         !HAVE_DECL_GETENV.
1790         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1791         (__strndup): Revert to K&R-style function dfns, the glibc style.
1792         * strnlen.c: Don't claim it's taken from glibc; it's not.
1793         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1794         Include strnlen.h first, to get prototype properly.
1795         (strnlen): Renamed from __strnlen.
1796         Remove weak alias.
1797
1798 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1799
1800         These changes imported from libc.
1801         * getopt.c: Use __fxprintf instead of inline stream orientation
1802         test and two separate function calls.
1803         * strndup.c (__strndup): Add libc_hidden_def.
1804
1805 2006-01-22  Bruno Haible  <bruno@clisp.org>
1806
1807         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1808         temporary buffer for sprintf, take into account the precision also
1809         for 'd', 'i', 'u', 'o', 'x', 'X'.
1810
1811 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1812
1813         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1814         to pacify gcc -Wswitch-default.
1815
1816 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1817
1818         * argp-help.c (usage_long_opt): Do not print DOC options.
1819         (__argp_base_name): Removed
1820         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1821         typo.
1822         (__argp_base_name): Provide macro definition or extern declaration
1823         depending on the configuration
1824
1825 2006-01-20  Simon Josefsson  <jas@extundo.com>
1826
1827         * inet_ntop.h: Unconditionally include sys/socket.h.
1828
1829 2006-01-19  Simon Josefsson  <jas@extundo.com>
1830
1831         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1832
1833 2006-01-12  Simon Josefsson  <jas@extundo.com>
1834
1835         * base64.c: Fix warning, reported by Bruno Haible
1836         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1837
1838 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1839
1840         Sync from coreutils.
1841         * md5.c: Fix commentary typos.
1842         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1843         * md5.h (__attribute__): Remove; unused.
1844         * sha1.c: Fix commentary to match md5 better.
1845         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1846         so that we don't need to worry about alignment.  All uses changed.
1847         This merges the 2005-10-28 md5 change into sha1.
1848
1849 2006-01-11  Jim Meyering  <jim@meyering.net>
1850
1851         Sync from coreutils.
1852         * md5.c (OP): Fix spacing.
1853
1854 2006-01-11  Simon Josefsson  <jas@extundo.com>
1855
1856         * stdint_.h (SIZE_MAX): Add missing (.
1857
1858 2006-01-10  Bruno Haible  <bruno@clisp.org>
1859
1860         * argp.h (__const): Remove macro. Use const instead.
1861         * argp-fmtstream.h (__const): Likewise.
1862         * glob_.h (__const): Remove macro.
1863         * glob-libc.h: Use const instead of __const.
1864
1865 2006-01-10  Jim Meyering  <jim@meyering.net>
1866
1867         Avoid the double-free (first in fts_read, second in fts_close) that
1868         would occur when an `active' directory is made inaccessible (e.g.,
1869         via chmod a-x) during a traversal.
1870         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1871         before returning.  Reproduce this failure by
1872         mkdir -p a/b; cd a; chmod a-x . b
1873         Reported by Stavros Passas.
1874
1875         Sync from coreutils.
1876         * sha1.c: Tweak grammar in a comment.
1877
1878 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1879
1880         * regex_internal.h (BITSET_WORD_BITS):
1881         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1882         preprocessor mishandles large unsigned values as if they were signed.
1883         Problem reported by Claudio Fontana in
1884         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1885
1886 2006-01-10  Simon Josefsson  <jas@extundo.com>
1887
1888         * socket_.h: New file.
1889
1890 2006-01-10  Bruno Haible  <bruno@clisp.org>
1891
1892         * localcharset.c: Update from GNU gettext.
1893
1894 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1895
1896         Sync from coreutils.
1897         * chdir-long.c (cdb_free): Don't bother trying to open directory
1898         for write access: POSIX says that must fail.
1899         * fts.c (diropen): Likewise.
1900         * save-cwd.c (save_cwd): Likewise.
1901         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1902         well, for minor improvements on hosts that lack O_DIRECTORY.
1903         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1904         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1905         Fall back on chown if open failed with EACCES.
1906
1907         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1908         Report an error at compile-time if only a 1-second nominal clock
1909         resolution is found.
1910
1911         * lchmod.h: New file.
1912         * mkdir-p.c: Include lchmod.h, lchown.h.
1913         (make_dir_parents): Use lchown rather than chown, and
1914         lchmod rather than chmod.
1915
1916         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1917         too.  Problem with "none" reported by Bob Proulx.  Problem with
1918         "proc" reported by n0dalus.
1919
1920         * mountlist.c: Include <limits.h>.
1921         (dev_from_mount_options)
1922         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1923         New function.  It no longer assumes "dev=" has the System V meaning
1924         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1925         (read_file_system_list)
1926         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1927         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1928         dev= in that case.
1929
1930         * posixtm.h (PDS_PRE_2000): New macro.
1931         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1932         All usages changed.  Reject dates outside the range 1969-1999 if
1933         PDS_PRE_2000 is used.
1934
1935 2006-01-09  Jim Meyering  <jim@meyering.net>
1936
1937         Sync from coreutils.
1938
1939         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1940
1941         * chdir-safer.h, chdir-safer.c: New files.
1942
1943         * modechange.c (mode_compile): Reject an invalid mode string
1944         that starts with an octal digit.  From Andreas Gruenbacher.
1945
1946         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1947         and dup to open_safer and dup_safer, respectively.
1948         (openat_permissive): Fix typo in comment.
1949
1950         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1951         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1952         (_): Remove; no longer needed.
1953         (openat): Renamed from rpl_openat; no need for rpl_openat
1954         since openat.h renames openat for us.
1955         Replace most of the body with a call to openat_permissive,
1956         to avoid duplicate code.
1957         Port to (probably hypothetical) environments were mode_t is
1958         wider than int.
1959         (openat_permissive): Require mode arg, so that we can check
1960         types better.  Put it just after flags.  Change cwd failure
1961         indicator from pointer-to-bool to pointer-to-errno-value.
1962         All callers changed.
1963         Invoke openat_save_fail and/or openat_restore_fail if
1964         cwd_errno is null, so that openat can call us.
1965         (openat_permissive, fdopendir, fstatat, unlinkat):
1966         Simplify errno handling to avoid some duplicate code,
1967         as it's OK to set errno on success.
1968         * openat.h: Revamp code so that function macros depend on
1969         __OPENAT_PREFIX only, not also on AT_FDCWD.
1970         (openat_ro): Remove.  Caller changed to use openat_permissive.
1971         (openat_permissive): Now a macro, if not a function.
1972         (openat_restore_fail, openat_save_fail): Now always functions,
1973         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1974
1975         * openat-priv.h: New file, defining macros used by mkdirat.c
1976         and openat.c.
1977         * mkdirat.c: Include openat-priv.h.
1978         Remove definitions of macros defined therein.
1979         * openat.c: Likewise.
1980
1981         * mkdirat.c (mkdirat): New file and function.
1982         * openat.h (mkdirat): Declare.
1983
1984         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1985
1986         * openat.h (openat_permissive): Declare.
1987         (openat_ro): Define.
1988
1989         * openat.c (EXPECTED_ERRNO): New macro.
1990         (openat_permissive): New function -- used in remove.c rewrite.
1991         (all functions): Set errno just before returning, only if there
1992         was an actual failure.
1993         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1994
1995         Emulate openat-family functions using Linux's procfs, if possible.
1996         Idea and some code based on Ulrich Drepper's glibc changes.
1997
1998         * openat.c: (BUILD_PROC_NAME): New macro.
1999         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2000         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2001         before falling back on save_cwd and restore_cwd.
2002         (fdopendir, fstatat, unlinkat): Likewise.
2003
2004         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2005         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2006
2007         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2008         as second argument to va_arg.  Otherwise, some versions of gcc
2009         warn that `if this code is reached, the program will abort'.
2010
2011 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2012
2013         Sync from coreutils.
2014
2015         Add POSIX ACL support
2016         * acl.h (copy_acl, set_acl): Add declarations.
2017         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2018         systems other than Linux.
2019         (chmod_or_fchmod): New function: use fchmod when possible,
2020         and chmod otherwise.
2021         (file_has_acl): Add a POSIX ACL implementation, with a
2022         Linux-specific subcase.
2023         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2024         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2025         acls are unsupported.
2026         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2027         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2028         are unsupported.
2029
2030 2006-01-09  Bruno Haible  <bruno@clisp.org>
2031
2032         * sysexit_.h (EX_OK): New macro.
2033         Suggested by Martin Lambers <marlam@marlam.de>.
2034
2035 2006-01-09  Bruno Haible  <bruno@clisp.org>
2036
2037         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2038         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2039         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2040         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2041
2042 2006-01-09  Bruno Haible  <bruno@clisp.org>
2043
2044         * stdint_.h (SIZE_MAX): Write the value without involving negative
2045         numbers.
2046
2047 2005-10-16  Bruno Haible  <bruno@clisp.org>
2048
2049         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2050         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2051
2052 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2053
2054         * strftime.c (tzname): Don't declare if it is already #defined.
2055         Problem reported for Mingw by Mark Junker.
2056
2057 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2058
2059         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2060         long int, not int, for nanosecond counts, so that people who are
2061         used to POSIX struct timespec won't be surprised.  Reported by Jim
2062         Meyering.
2063
2064 2005-12-16  Jim Meyering  <jim@meyering.net>
2065
2066         * fprintftime.c, fprintftime.h: New files.
2067
2068 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2069
2070         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2071         * argp-help.c (fill_in_uparams): Check if the constructed
2072         struct uparams is valid. Fall back to the default values if it is
2073         not.
2074
2075 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2076
2077         * argp-help.c (__argp_base_name): New function
2078         (__argp_short_program_name): Rewrite using __argp_base_name
2079         * argp-namefrob.h: Define program_invocation_name and
2080         program_invocation_short_name if requested
2081         (__argp_base_name): Add prototype
2082         * argp-parse.c (argp_def): Use gettext wrappers
2083         (argp_default_parser): Use __argp_base_name
2084         * argp-pin.c: New file. Defines program_invocation_name and
2085         program_invocation_short_name on systems that lack them.
2086
2087 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2088
2089         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2090         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2091         porting problem reported by Georg Schwarz in
2092         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2093
2094 2005-07-09  Bruno Haible  <bruno@clisp.org>
2095
2096         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2097         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2098         Reported by Mark Junker <mjscod@gmx.de>.
2099
2100 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2101
2102         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2103         (uintmax_t) [defined uintmax_t]: Do not declare.
2104         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2105         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2106         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2107         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2108         sake of portability to weird hosts that C allows (though we don't
2109         know of any practical examples).
2110
2111         * savedir.h (fdsavedir): New decl.
2112         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2113         contains most of the former guts of savedir.
2114         (savedir): Use savedirstream.
2115         Include "openat.h".
2116
2117 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2118
2119         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2120         coreutils no longer futzes with rounding modes.
2121
2122 2005-11-14  Jim Meyering  <jim@meyering.net>
2123
2124         * mkstemp-safer.c: Include <config.h>, required for possible
2125         replacement of mkstemp.
2126
2127 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2128
2129         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2130         business.
2131         (gethrxtime) [! (HAVE_NANOUPTIME
2132         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2133         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2134         our own approximation.
2135
2136 2005-11-10  Simon Josefsson  <jas@extundo.com>
2137
2138         * readline.c: Remove EOL.
2139
2140 2005-11-08  Eric Blake  <ebb9@byu.net>
2141
2142         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2143
2144 2005-11-08  Eric Blake  <ebb9@byu.net>
2145
2146         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2147
2148 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2149
2150         Fix porting problem reported by Theodoros V. Kalamatianos.
2151         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2152         Don't assume that futimes failing means we must fail.
2153
2154 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2155
2156         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2157         leave errno alone.  Problem reported by Dmitry V. Levin.
2158
2159 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2160
2161         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2162         errno alone.  Problem reported by Frederic Jolliton.
2163
2164 2005-10-28  Simon Josefsson  <jas@extundo.com>
2165
2166         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2167         "restrict" keywords, as per POSIX.  Protect the function
2168         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2169         Don't use K&R prototypes.  Check the sprintf return values.
2170         Re-define EAFNOSUPPORT if not present.  Indent.
2171
2172         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2173         suggested by Bruno Haible <bruno@clisp.org>.
2174
2175         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2176
2177         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2178
2179         * gc-libgcrypt.c: Add MD2 (which is not available through
2180         libgcrypt).
2181
2182         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2183
2184         * md2.h, md2.c: New files.
2185
2186 2005-10-24  Simon Josefsson  <jas@extundo.com>
2187
2188         * md4.h: Shrink buffer size, now that we changed the type.
2189
2190 2005-10-22  Simon Josefsson  <jas@extundo.com>
2191
2192         * arcfour.h, arcfour.c: Use fixed size indices in the
2193         arcfour_context struct (simplify test vector testing in GNU
2194         Shishi).
2195
2196 2005-10-22  Simon Josefsson  <jas@extundo.com>
2197
2198         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2199         suggested by Bruno Haible <bruno@clisp.org>.
2200
2201 2005-10-22  Simon Josefsson  <jas@extundo.com>
2202
2203         * crc.h: Include stddef.h, for size_t.
2204
2205 2005-10-21  Simon Josefsson  <jas@extundo.com>
2206
2207         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2208         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2209
2210 2005-10-21  Simon Josefsson  <jas@extundo.com>
2211
2212         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2213         block.
2214
2215 2005-10-21  Simon Josefsson  <jas@extundo.com>
2216
2217         * gc-gnulib.c: Support ARCTWO in CBC mode.
2218
2219 2005-10-21  Simon Josefsson  <jas@extundo.com>
2220
2221         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2222         <bruno@clisp.org>.
2223
2224         * hmac-sha1.c (hmac_sha1): Likewise.
2225
2226         * crc.c (crc32_update): Actually use crc parameter, suggested by
2227         Bruno Haible <bruno@clisp.org>.
2228
2229         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2230         <bruno@clisp.org>.
2231
2232 2005-10-21  Simon Josefsson  <jas@extundo.com>
2233
2234         * des.h, des.c: New files.
2235
2236         * gc-gnulib.c: Support DES.c
2237
2238 2005-10-21  Simon Josefsson  <jas@extundo.com>
2239
2240         * arctwo.h, arctwo.c: New files.
2241
2242         * gc-gnulib.c: Support ARCTWO.
2243
2244 2005-10-21  Simon Josefsson  <jas@extundo.com>
2245
2246         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2247
2248 2005-10-19  Simon Josefsson  <jas@extundo.com>
2249
2250         * gc-gnulib.c: Support ARCFOUR.
2251
2252 2005-10-19  Simon Josefsson  <jas@extundo.com>
2253
2254         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2255         support.
2256
2257         * gc.h: Add ECB enum type.
2258
2259         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2260
2261 2005-10-19  Simon Josefsson  <jas@extundo.com>
2262
2263         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2264
2265 2005-10-18  Simon Josefsson  <jas@extundo.com>
2266
2267         * md4.h, md4.c: New files, based on md5.?.
2268
2269 2005-10-17  Simon Josefsson  <jas@extundo.com>
2270
2271         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2272
2273         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2274
2275 2005-10-17  Simon Josefsson  <jas@extundo.com>
2276
2277         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2278
2279 2005-10-17  Simon Josefsson  <jas@extundo.com>
2280
2281         * gc.h, gc-libgcrypt.c: Add ciphers.
2282
2283 2005-10-17  Simon Josefsson  <jas@extundo.com>
2284
2285         * sha1.c: Use uint32_t instead of md5_uint32.t
2286
2287         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2288         md5.h.
2289
2290         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2291
2292         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2293
2294 2005-10-15  Simon Josefsson  <jas@extundo.com>
2295
2296         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2297
2298         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2299
2300 2005-10-14  Simon Josefsson  <jas@extundo.com>
2301
2302         * arcfour.h, arcfour.c: New files.
2303
2304 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2305
2306         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2307         include <wchar.h>; no longer needed.
2308
2309 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2310         and  Ulrich Drepper  <drepper@redhat.com>
2311
2312         Import from libc.
2313         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2314         instead of inline stream orientation test and two separate
2315         function calls.  Pay no attention to USE_IN_LIBIO.
2316
2317 2005-10-14  Roland McGrath  <roland@redhat.com>
2318
2319         Import from libc.  [BZ #1331]
2320         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2321         macro argument.
2322         Reported by Matej Vela <vela@debian.org>.
2323
2324 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2325
2326         * mkdir-p.c (make_dir_parents): Don't report an error if an
2327         intermediate directory is in a read-only file system.  Problem
2328         reported by Eric Blake.
2329
2330 2005-10-13  Simon Josefsson  <jas@extundo.com>
2331
2332         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2333         Move memory allocation outside of loop.
2334
2335 2005-10-12  Simon Josefsson  <jas@extundo.com>
2336
2337         * gc-pbkdf2-sha1.c: New file.
2338
2339         * gc.h: Add gc_pbkdf2_sha1 prototype.
2340
2341 2005-10-12  Simon Josefsson  <jas@extundo.com>
2342
2343         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2344         suggested by Bruno Haible <bruno@clisp.org>.
2345
2346 2005-10-12  Simon Josefsson  <jas@extundo.com>
2347
2348         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2349
2350         * gc-gnulib.c (gc_hmac_sha1): New function.
2351
2352 2005-10-12  Simon Josefsson  <jas@extundo.com>
2353
2354         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2355
2356 2005-10-12  Simon Josefsson  <jas@extundo.com>
2357
2358         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2359         GC_USE_HMAC_MD5, respectively.
2360
2361         * gc-libgcrypt.c (gc_md5): Fix assert call.
2362         (gc_md5): Fix typo.
2363
2364         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2365
2366         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2367
2368         * gc-gnulib.c (gc_hash_buffer): Ditto.
2369
2370 2005-10-11  Bruno Haible  <bruno@clisp.org>
2371
2372         * c-strcasestr.h: New file, from GNU gettext.
2373         * c-strcasestr.c: New file, from GNU gettext.
2374
2375 2005-10-11  Bruno Haible  <bruno@clisp.org>
2376
2377         * c-strcase.h: New file, from GNU gettext.
2378         * c-strcasecmp.c: New file, from GNU gettext.
2379         * c-strncasecmp.c: New file, from GNU gettext.
2380
2381 2005-10-11  Simon Josefsson  <jas@extundo.com>
2382
2383         * crc.h, crc.c: New files.
2384
2385         * gc.h (gc_hash_buffer): Add doc.
2386
2387 2005-10-08  Simon Josefsson  <jas@extundo.com>
2388
2389         * gc.h: Add gc_hash and gc_hash_buffer.
2390
2391         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2392
2393         * gc-libgcrypt.c (gc_hash_buffer): Add.
2394
2395 2005-10-11  Bruno Haible  <bruno@clisp.org>
2396
2397         * strcasecmp.c: Include limits.h.
2398         (strcasecmp): Avoid integer overflow on exotic platforms.
2399         * strncasecmp.c: Include limits.h.
2400         (strncasecmp): Avoid integer overflow on exotic platforms.
2401         Reported by Paul Eggert.
2402
2403 2005-10-06  Simon Josefsson  <jas@extundo.com>
2404
2405         * hmac-md5.c: New file.
2406
2407         * hmac.h: New file.
2408
2409 2005-10-06  Simon Josefsson  <jas@extundo.com>
2410
2411         * memxor.c (memxor): Avoid casts and warnings.
2412
2413 2005-10-05  Derek Price  <derek@ximbiot.com>
2414
2415         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2416
2417 2005-10-05  Simon Josefsson  <jas@extundo.com>
2418
2419         * memxor.c (memxor): Fix compiler error.
2420
2421         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2422         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2423
2424         * memxor.h, memxor.c: New files.
2425
2426         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2427         we assume all systems have it, suggested by Jim Meyering
2428         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2429         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2430         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2431         same reasons.
2432
2433 2005-10-04  Bruno Haible  <bruno@clisp.org>
2434
2435         * verify.h (verify_true): Provide alternative definition for C++.
2436
2437 2005-10-04  Simon Josefsson  <jas@extundo.com>
2438
2439         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2440         D. Baushke" <mdb@gnu.org>.
2441
2442 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2443
2444         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2445         (SSIZE_MAX): New macro, if not already defined.
2446         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2447         than 2 GiB.
2448
2449 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2450
2451         * exclude.c: Include verify.h.
2452         (verify): Remove.  All callers changed to use verify.h's version.
2453         * strtoimax.c: Likewise.
2454         * utimecmp.c: Likewis.e
2455
2456         Sync from coreutils.
2457         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2458         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2459         * .cvsignore: Add fts.h, search.h, t-fpending.
2460         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2461         bother returning ENOSYS if settimeofday or stime fails; just let
2462         them return whatever errno they want to return.
2463         * utimens.c: Include unistd.h, for dup2.
2464         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2465         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2466
2467 2005-10-02  Jim Meyering  <jim@meyering.net>
2468
2469         Sync from coreutils.
2470         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2471         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2472         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2473         Remove AT_FDCWD test.
2474         Do not consume the fd unless successful.
2475         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2476         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2477         block, so that we don't even try to compile it if settimeofday is
2478         available.  This works around a compilation failure on OSF1 V5.1,
2479         due to stime requiring a `long int*' while tv_sec is `int'.
2480
2481 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2482
2483         * getdelim.c (getdelim): Remove unused variables.
2484
2485 2005-10-01  Simon Josefsson  <jas@extundo.com>
2486
2487         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2488         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2489         AI_* and EAI_* definitions.  Protect function declarations.
2490
2491 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2492
2493         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2494         so that the code works even with ancient cpp.  Portability problem
2495         with GCC 2.7.2.1 reported by Thomas M.Ott.
2496
2497 2005-09-27  Jim Meyering  <jim@meyering.net>
2498
2499         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2500
2501         * intprops.h (signed_type_or_expr__): Define.
2502         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2503         for unsigned types.
2504
2505 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2506
2507         * verify.h (verify_expr): Remove, replacing with:
2508         (verify_true): New macro that returns true instead of void.
2509         (verify_type__): Remove.
2510         (verify): Use verify_true rather than verify_type__.
2511
2512 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2513
2514         * utimens.c (ENOSYS): Define if not already defined.
2515         (futimens): Support having a null PATH if the file descriptor
2516         is nonnegative.
2517
2518         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2519         Remove.
2520         (__attribute): Define to empty unless GCC 3.1 or later.
2521         This works around a core dump on OpenBSD 3.4, which has GCC
2522         2.95.3, which dumps core when given __attribute__(()).  It also
2523         simplifies other tests, since we really don't want to bother with
2524         worrying about which ancient version of GCC supported what.
2525         Original problem reported by Yoann Vandoorselaere, with part of
2526         the fix suggested by Derek Price.
2527
2528 2005-09-24  Jim Meyering  <jim@meyering.net>
2529
2530         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2531         so we can once again use a positive bitfield width of 1 -- now we
2532         don't have to explain why we were using a bitfield width of 2.
2533
2534 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2535
2536         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2537         Problem reported by Eric Blake.
2538         (getaddrinfo): Initialize se so that it's not garbage.
2539         Redo internal storage allocation so that it doesn't make unportable
2540         assumptions about alignment.
2541         Fix a memory leak.
2542
2543         * utimens.c (futimens): Use futimesat if available.
2544         Prefer it to futimes since it doesn't have the futimes bug.
2545
2546         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2547         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2548         Instead, declare a function that returns a pointer to an array,
2549         and use verify_type__ to declare the size of the array.
2550         Problem and germ of a solution reported by Bruno Haible.
2551         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2552         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2553
2554 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2555
2556         Sync from coreutils.
2557
2558         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2559         stat-time.h.
2560         * argmatch.h: Include verify.h
2561         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2562         (ARGMATCH_ASSERT): Remove; unused.
2563         * canonicalize.c: Assume STDC_HEADERS.
2564         * exclude.c: Include "strcase.h".
2565         * regex_internal.h [!defined _LIBC]: Likewise.
2566         * getusershell.c: Include stdio--.h rather than stdio.h
2567         and stdio-safer.h.
2568         (getusershell): Call fopen, not fopen_safer.
2569         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2570         Do not include unistd-safer.h.
2571         (save_cwd): Don't call fd_safer; no longer needed
2572         now that we include fcntl--.h.
2573
2574         * getdate.y (relative_time): New type.
2575         (RELATIVE_TIME_0): New constant.
2576         (parser_control): Use relative_time instead of doing it ourselves.
2577         (%union): Add new relative_time rel member.
2578         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2579         Now typeless.
2580         (relunit, relunit_snumber): Now of type rel.
2581         (zone, rel, relunit, get_date): Adjust to above changes.
2582
2583         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2584         Do not include unistd-safer.h.
2585         (getloadavg): Don't call fd_safer; no longer needed
2586         now that we include fcntl--.h.
2587
2588         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2589         (make_dir_parents): Treat ENOSYS like EEXIST.
2590
2591         Improve quality of diagnostics on restore_cwd failure.
2592         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2593         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2594         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2595         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2596         each time through the loop.  Do not diagnose restore_cwd failure;
2597         that is the caller's job (and perhaps the caller does not care).
2598
2599         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2600         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2601         If the file already exists but is not a directory, don't bother
2602         to try to make its parents.
2603         Close potential file descriptor leak if we can't chdir("/") (!).
2604         Don't always return true if chdir($PWD) fails; return true only
2605         if the requested action was done successfully (except for the
2606         chdir($PWD)).
2607         Don't log final directory unless we actually made it.
2608         Refactor to avoid duplicate code to fix up permissions.
2609         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2610
2611         * strftime.c (my_strftime): Rewrite the previous change slightly,
2612         to make it a bit faster and (I hope) clearer.
2613         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2614         Fix bug in formats like %2N.
2615
2616         * verify.h: New file.
2617
2618 2005-09-22  Jim Meyering  <jim@meyering.net>
2619
2620         Sync from coreutils.
2621
2622         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2623
2624         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2625         the .tm_year member, since otherwise gcc-4.0 would now warn about
2626         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2627
2628         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2629         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2630
2631         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2632         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2633         when run in a time zone for which daylight savings time is in effect
2634         for the starting date.
2635
2636         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2637         stop us from restricting permissions of just-created absolute-named
2638         directories.
2639         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2640         to restore initial working directory.
2641         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2642         to tell caller if/when we change the working directory and are
2643         unable to return to the initial one.
2644         * mkdir-p.h (make_dir_parents): Update prototype.
2645         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2646         `return false'.  This fixes a bug introduced on 2004-07-30.
2647
2648         * openat.c (fdopendir): Be sure to close the supplied
2649         file descriptor before returning.  This makes our replacement
2650         implementation a little closer to Solaris's, where fdopendir
2651         ties the file descriptor to the returned DIR* pointer.
2652         * openat.c (unlinkat): New function.
2653         * openat.h (unlinkat): Add prototype.
2654         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2655         (openat_restore_fail): Rename from openat_restore_die.
2656         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2657
2658         Provide an alternative to exiting immediately upon save_cwd or
2659         restore_cwd failure.  Now, an application can arrange e.g.,
2660         to perform a longjump in that case.
2661         * openat.c: Include dirname.h.
2662         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2663         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2664         and openat_restore_die rather than calling error directly.
2665         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2666
2667         * openat-die.c (openat_save_die, openat_restore_die): New file.
2668         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2669
2670         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2671         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2672                             int utc, int nanoseconds);
2673         Background:
2674         date should not have to allocate a megabyte of virtual memory to
2675         handle a format argument like +%1048575T.  When implemented with
2676         strftime, it must allocate such a buffer, use strftime to fill it
2677         in, print it, then free it.
2678         With fprintftime, it simply prints everything and exits.
2679         With no need for memory allocation, that's one fewer way to fail.
2680         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2681         optional field width, not before, so we accept %9:z, not %:9z.
2682         (my_strftime): Be sure to use L_('x') for literals.
2683
2684         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2685         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2686         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2687         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2688         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2689         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2690         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2691         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2692         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2693
2694         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2695         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2696         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2697         and don't include <sys/file.h>).
2698
2699 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2700
2701         Sync from coreutils.
2702
2703         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2704         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2705         [!LDAV_DONE]: Avoid unused variable warning.
2706
2707 2005-09-21  Bruno Haible  <bruno@clisp.org>
2708
2709         * unicodeio.h (unicode_to_mb): New declaration.
2710
2711 2005-09-20  Derek Price  <derek@ximbiot.com>
2712
2713         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2714
2715 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2716
2717         Use a consistent style for including <config.h>.
2718         * __fpending.c, acl.c, argmatch.c,
2719         argp-help.c, argp-parse.c,
2720         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2721         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2722         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2723         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2724         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2725         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2726         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2727         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2728         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2729         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2730         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2731         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2732         modechange.c, mountlist.c, open-safer.c, physmem.c,
2733         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2734         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2735         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2736         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2737         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2738         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2739         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2740         userspec.c, utimecmp.c, version-etc-fsf.c,
2741         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2742         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2743         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2744         Standardize inclusion of config.h.
2745         * __fpending.h, dirfd.h, getdate.h, human.h,
2746         inttostr.h:  Removed inclusion of config.h from header files.
2747         * inttostr.c:  Adjusted in-tree users.
2748         * timespec.h: Remove superfluous warning to include config.h.
2749         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2750         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2751         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2752         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2753
2754 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2755
2756         * stat-time.h: New file.
2757         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2758         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2759         in a different way.
2760         (timespec_cmp): New function.
2761         * utimecmp.c: Include stat-time.h.
2762         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2763         members exist, not on the obsolescent ST_MTIM_NSEC.
2764         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2765
2766 2005-09-15  Derek Price  <derek@ximbiot.com>
2767             Paul Eggert  <eggert@cs.ucla.edu>
2768
2769         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2770         changes, consolidating in...
2771         * regex_internal.h: ...this file.
2772
2773 2005-09-15  Derek Price  <derek@ximbiot.com>
2774
2775         * regex_internal.h: Blank `pure' for GNUC < 3.
2776         * regex_internal.c: Ditto, using this...
2777         (__GNUC_PREREQ): ...new macro.
2778         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2779         (__GNUC_PREREQ): ...this new macro.
2780
2781         * strstr.h: Include string.h. Define strstr as a macro here.
2782
2783 2005-09-13  Derek Price  <derek@ximbiot.com>
2784
2785         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2786         failure.
2787         Reported by Jim Meyering  <jim@meyering.net>.
2788
2789 2005-09-13  Jim Meyering  <jim@meyering.net>
2790
2791         * canon-host.c: Filter through gnu indent and reword comments slightly.
2792         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2793
2794 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2795
2796         * lib/base64.c: Typo.
2797         (base64_encode): Put b64str in initialized data section.
2798
2799 2005-09-12  Derek Price  <derek@ximbiot.com>
2800
2801         Return usable errors from canon-host.
2802         * canon-host.h: New file.
2803         * canon-host.c (canon_host): Wrap...
2804         (canon_host_r): ...this new function, which now relies exclusively on
2805         getaddrinfo.
2806         (ch_strerror): New function.
2807         (last_cherror): New global.
2808         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2809         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2810         void *.
2811         (freeaddrinfo): Free ai->ai_canonname when set.
2812
2813 2005-09-12  Derek Price  <derek@ximbiot.com>
2814             Paul Eggert  <eggert@cs.ucla.edu>
2815
2816         * glob-libc.h: Renamed from glob_.h.  The new version is
2817         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2818         protecting things that should be done only in gnulib contexts.
2819         * glob_.h: New file, containing only the glob things needed for
2820         gnulib.
2821         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2822         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2823         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2824         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2825         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2826         and to respect the namespace rules better.
2827
2828 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2829
2830         Merge glibc and coreutils changes into gnulib, plus a few
2831         extra fixes.
2832         * md5.c: Use #error rather than a string.
2833         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2834         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2835         (__attribute__): Define to empty for non recent-GCC.
2836         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2837         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2838         Renamed from their non-__ counterparts, with new macros replacing
2839         them if not _LIBC.  Add __THROW attribute.
2840         (rol): Remove.
2841         (struct md5_ctx): Align buffer if using GCC.
2842         * sha1.h (struct sha1_ctx): Likewise.
2843         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2844         The old name was backwards.
2845         (NOTSWAP): Remove; not used.
2846         (rol): New macro, moved here from md5.h.
2847         (sha1_process_block): Remove a FIXME that doesn't make sense.
2848
2849 2005-09-12  Derek Price  <derek@ximbiot.com>
2850
2851         * gai_strerror.c: Include config.h when available.  Include
2852         getaddrinfo.h before other headers to test interface.
2853         Reported by Larry Jones <lawrence.jones@ugs.com>.
2854
2855 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2856
2857         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2858         definitions, since that's the preferred style in glibc.
2859         Fix a minor spacing issue, and update copyright notice to match glibc's.
2860
2861 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2862
2863         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2864
2865 2005-09-06  Simon Josefsson  <jas@extundo.com>
2866
2867         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2868         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2869
2870 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2871
2872         Change bitset word type from unsigned int to unsigned long int,
2873         as this has better performance on typical 64-bit hosts.
2874         Port bitset code to hosts with unusual word sizes.
2875         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2876         (build_collating_symbol):
2877         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2878         argument is a bitset.  This is merely a style issue, but it makes
2879         it clearer that an entire array is expected.
2880         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2881         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2882         Port to the case where bitset_word is not the same as unsigned int.
2883         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2884         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2885         Likewise.
2886         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2887         (build_trtable, group_nodes_into_DFAstates):
2888         Likewise.
2889         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2890         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2891         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2892         * regexec.c (group_nodes_into_DFAstates): Likewise.
2893         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2894         * regcomp.c (optimize_subexps, lower_subexp):
2895         Work even if bitset_word has holes in its bitwise representation.
2896         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2897         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2898         Likewise.
2899         * regex_internal.c (re_string_reconstruct):
2900         Don't assume UCHAR_MAX == 255.
2901         * regex_internal.h (bitset_set_all): Likewise.
2902         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2903         All uses changed.
2904         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2905         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2906         All uses changed.
2907         (BITSET_WORD_MAX): New macro.
2908         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2909         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2910         (bitset_empty, bitset_copy):
2911         Prefer sizeof (bitset) to multiplying it out ourselves.
2912         (bitset_not_merge): Remove; unused.
2913         (bitset_contain): Return bool, not unsigned int with one bit on.
2914         All callers changed.
2915         * regexec.c (build_trtable): Don't assume bitset has no stricter
2916         alignment than re_node_set; do this by defining a new internal
2917         type struct dests_alloc and using it to allocate memory.
2918
2919 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2920
2921         Check for arithmetic overflow when calculating sizes, to prevent
2922         some buffer-overflow issues.  These patches are conservative, in the
2923         sense that when I couldn't determine whether an overflow was possible,
2924         I inserted a run-time check.
2925         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2926         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2927         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2928         (re_xnrealloc, re_x2nrealloc): New inline functions.
2929         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2930         (build_equiv_class, build_charclass): Check for arithmetic overflow
2931         in size expression calculations.
2932         * lib/regex_internal.c (re_string_realloc_buffers):
2933         (build_wcs_upper_buffer, re_node_set_add_intersect):
2934         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2935         (re_dfa_add_node, register_state): Likewise.
2936         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2937         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2938         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2939         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2940
2941 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2942
2943         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2944         to avoid a collision with bits/local_lim.h in glibc.
2945         All uses changed.  Problem reported by Dmitry V. Levin in
2946         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2947
2948         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2949         bugs in int versus size_t comparisons.
2950         (re_string_context_at): Fix bug where the code assumed that
2951         Idx is signed.
2952
2953         Use bool where appropriate.
2954         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2955         All callers changed.
2956         (calc_eclosure_iter): Likewise, for ROOT arg.
2957         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2958         (build_charclass_op): Likewise, for NON_MATCH arg.
2959         * regex_internal.c (re_string_allocate, re_string_construct):
2960         (re_string_construct_common): Likewise, for ICASE arg.
2961         * regexec.c (re_search_2_stub, re_search_stub):
2962         Likewise, for RET_LEN arg.
2963         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2964         (set_regs): Likewise, for FL_BACKTRACK arg.
2965         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2966         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2967         (calc_eclosure_iter, parse_bracket_exp):
2968         Use bool for internal variables that are booleans.
2969         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2970         (set_regs, build_sifted_states, sift_states_bkref):
2971         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2972         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2973         (find_collation_sequence_value):
2974         Likewise.
2975         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2976         (re_node_set_compare):
2977         Return bool, not int. All callers changed.
2978         * regexec.c (check_halt_node_context, check_dst_limits):
2979         (build_trtable, check_node_accept): Likewise.
2980         * regex_internal.h: Include stdbool.h.
2981
2982         Fix bugs uncovered when converting to bool.
2983         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2984         failure instead of charging ahead blindly.
2985         * regex_internal.c (register_state): Likewise.
2986         * regexec.c (re_search_2_stub): Use simpler method than boolean
2987         for freeing internal storage.
2988         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2989         bitset pieces used as boolean, to avoid undefined behavior
2990         on hosts that do int overflow checking.
2991
2992 2005-08-31  Derek Price  <derek@ximbiot.com>
2993
2994         * getdelim.c (getdelim): Return EOF on EOF.
2995         Reported by Larry Jones <lawrence.jones@ugs.com>.
2996
2997 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2998
2999         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3000         lengths fit in regoff_t; this isn't true if regoff_t is the same
3001         width as size_t.
3002         * regex.c (re_search_internal): 5th arg is LAST_START
3003         (= START + RANGE) instead of RANGE.  This avoids overflow
3004         problems when regoff_t is the same width as size_t.
3005         All callers changed.
3006         (re_search_2_stub): Check for overflow when adding the
3007         sizes of the two strings.
3008         (re_search_stub): Check for overflow when adding START
3009         to RANGE; if it occurs, substitute the extreme value.
3010
3011 2005-08-31  Jim Meyering  <jim@meyering.net>
3012
3013         * regcomp.c (search_duplicated_node): Make first pointer arg
3014         a pointer-to-const.
3015         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3016         (register_state): Likewise.
3017         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3018         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3019         (group_nodes_into_DFAstates): Likewise.
3020
3021 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3022
3023         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3024         old glibc regex code mishandles strings longer than 2**31 bytes.
3025         This patch fixes this when the regex code is used in gnulib
3026         (i.e., outside glibc).
3027
3028         This patch should not affect the use of the regex code inside
3029         glibc.  No doubt this problem also needs to be handled for glibc
3030         as well, but the result will be an incompatible change to the
3031         glibc ABI, and the old ABI will have to be supported too.  That
3032         can be the the subject for another patch.
3033
3034         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3035         governing whether the rest of this patch is active.  By default,
3036         the macro is disabled and the patch has no effect.
3037         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3038         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3039         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3040         (re_match_2, re_set_registers): Use the new types.
3041         * regex_internal.h (Idx, re_hashval_t): New types.
3042         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3043         New macros.
3044         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3045         (re_string_context_at, bin_tree_t, re_dfastate_t):
3046         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3047         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3048         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3049         (re_string_char_size_at, re_string_wchar_at):
3050         (re_string_elem_size_at):
3051         Use the new types and macros to port to 64-bit hosts.
3052         Use unsigned types for internal values, so that the code
3053         mostly works even for arrays larger than SSIZE_MAX.
3054         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3055         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3056         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3057         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3058         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3059         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3060         (calc_inveclosure, parse_dup_op, build_range_exp):
3061         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3062         (fetch_number, create_token_tree, mark_opt_subexp):
3063         Likewise.
3064         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3065         (create_cd_newstate, re_string_allocate, re_string_construct):
3066         (re_string_realloc_buffers, build_wcs_upper_buffer):
3067         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3068         (re_string_reconstruct, re_string_peek_byte_case):
3069         (re_string_fetch_byte_case, re_string_context_at):
3070         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3071         (re_node_set_init_copy, re_node_set_add_intersect):
3072         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3073         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3074         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3075         (re_acquire_state, re_acquire_state_context, register_state):
3076         Likewise.
3077         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3078         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3079         (re_search_internal, re_search_2_stub, re_search_stub)
3080         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3081         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3082         (update_cur_sifted_state, check_dst_limits):
3083         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3084         (check_subexp_limits, sift_states_bkref, merge_state_array):
3085         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3086         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3087         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3088         (expand_bkref_cache, check_node_accept_bytes):
3089         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3090         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3091         (acquire_init_state_context, check_halt_node_context):
3092         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3093         (sift_states_backward, clean_state_log_if_needed):
3094         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3095         (find_recover_state, transit_state_sb, transit_state_mb):
3096         (transit_state_bkref, build_trtable, match_ctx_clean):
3097         Likewise.
3098         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3099         to work around an assumption that REG_MISSING is negative.
3100
3101         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3102         (seek_collating_symbol_entry) [defined _LIBC]:
3103         (lookup_collation_sequence_value) [defined _LIBC]:
3104         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3105         Use prototypes rather than old-style function definitions.
3106         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3107         (transit_state_sb) [0]:
3108         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3109
3110         * regexec.c (re_search_internal): Simplify update of rm_so and
3111         rm_eo.
3112
3113         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3114         (optimize_subexps, lower_subexp):
3115         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3116         since the signed shift might overflow.  Use 1u<<31 instead.
3117         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3118         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3119         Likewise.
3120
3121         * regcomp.c (optimize_subexps, lower_subexp):
3122         Use CHAR_BIT rather than 8, for clarity.
3123         * regexec.c (check_dst_limits_calc_pos_1):
3124         (check_subexp_matching_top): Likewise.
3125         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3126         have to worry about portability issues when shifting it left.
3127         Remove no-longer-needed test for table_size > 0.
3128         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3129         in a word, as the resulting behavior is undefined.
3130         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3131         in one case, a <= should have been an <, and in another case the
3132         whole test was missing.
3133         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3134         the standard name CHAR_BIT.
3135         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3136         this is not true on one's complement and signed-magnitude hosts.
3137
3138         * regex_internal.h (re_sub_match_top_t): Remove unused member
3139         next_last_offset.
3140         (struct re_dfa_t): Remove unused member states_alloc.
3141         * regcomp.c (init_dfa): Don't initialize unused members.
3142
3143 2005-08-31  Bruno Haible  <bruno@clisp.org>
3144
3145         * strstr.c: Include <stddef.h>, for NULL.
3146         * strcasestr.c: Likewise.
3147         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3148
3149 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3150
3151         * iconvme.h: Add prototype for iconv_alloc.
3152
3153 2005-08-29  Simon Josefsson  <jas@extundo.com>
3154
3155         * iconvme.c: Fix errno.
3156
3157 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3158
3159         * iconvme.c: Split iconv_string into iconv_alloc.
3160
3161 2005-08-27  Jim Meyering  <jim@meyering.net>
3162
3163         * fopen-safer.c: Merge minor changes from coreutils.
3164         * dup-safer.c: Likewise.
3165         * fd-safer.c: Likewise.
3166
3167         Merge from coreutils.
3168         * stdio--.h: New file.
3169         * stdlib--.h: New file.
3170         * mkstemp-safer.c: New file.
3171
3172         GNU tar needs these.
3173         * pipe-safer.c: New file.
3174         * creat-safer.c: New file.
3175         * fcntl--.h (creat): Define to creat_safer.
3176         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3177         * unistd--.h (pipe): Define to pipe_safer.
3178         * unistd-safer.h: Declare pipe_safer.
3179
3180 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3181
3182         * regex_internal.h: Remove all references to
3183         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3184         or better.
3185         (bitset_not, bitset_merge, bitset_not_merge):
3186         (bitset_mask, re_string_allocate, re_string_construct):
3187         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3188         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3189         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3190         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3191         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3192         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3193         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3194         (re_acquire_state_context):
3195         Remove unnecessary forward decls.
3196         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3197         Put __attribute at function definition,
3198         now that the function decl has been removed.
3199         * lib/regex_internal.c (re_string_peek_byte_case):
3200         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3201         Likewise.
3202
3203 2005-08-26  Simon Josefsson  <jas@extundo.com>
3204
3205         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3206         Haible <bruno@clisp.org>.
3207
3208 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3209
3210         * regexec.c (set_regs): Don't alloca with an unbounded size.
3211
3212         alloca modernization/simplification for regex.
3213         * regex.c: Remove portability cruft for alloca.  This no longer
3214         needs to be at the start of the file, and can be moved into
3215         regex_internal.h and simplified.
3216         * regex_internal.h: Include <alloca.h>.
3217         (__libc_use_alloca) [!defined _LIBC]: New macro.
3218         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3219         now works outside glibc.
3220
3221 2005-08-24  Simon Josefsson  <jas@extundo.com>
3222
3223         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3224         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3225         GLIBC specific code.
3226
3227 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3228
3229         Make regex safe for g++.  This fixes one real bug (an "err"
3230         that should have been "*err").  g++ problem reported by
3231         Sam Steingold.
3232         * regex_internal.h (re_calloc): New macro, consistent with
3233         re_malloc etc.  All callers of calloc changed to use re_calloc.
3234         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3235         not int.  All callers changed.
3236         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3237         just use an array of size MB_LEN_MAX.
3238         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3239         (find_recover_state): Change "err" to "*err"; this fixes what
3240         appears to be a real bug.
3241         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3242         versus int.
3243
3244 2005-08-25  Jim Meyering  <jim@meyering.net>
3245
3246         * open-safer.c: Include <config.h>.
3247         Otherwise, we'd lose LARGEFILE support in any file using
3248         e.g. "fcntl--.h"
3249
3250 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3251
3252         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3253         * regex.h (regerror): Likewise.
3254
3255         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3256         requires this.  (The code never needed it.)
3257
3258         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3259         All uses of recently-renamed identifiers changed to use the new,
3260         POSIX-compliant names.  The code will build and run just fine
3261         without these changes, but it's better to eat our own dog food
3262         and use the standard-conforming names.
3263
3264         * regex.h: Fix a multitude of POSIX name space violations.
3265         These changes have an effect only for programs that define
3266         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3267         do not change anything for programs compiled in the normal way.
3268         Also, there is no effect on the ABI.
3269
3270         (_REGEX_SOURCE): New macro.
3271         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3272         defined and _GNU_SOURCE is not; this fixes a name space violation.
3273
3274         Rename the following macros to obey POSIX requirements.
3275         The old names are still visible as macros if _REGEX_SOURCE is defined.
3276         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3277         RE_BACKSLASH_ESCAPE_IN_LISTS.
3278         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3279         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3280         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3281         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3282         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3283         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3284         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3285         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3286         (REG_INTERVALS): renamed from RE_INTERVALS.
3287         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3288         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3289         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3290         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3291         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3292         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3293         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3294         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3295         RE_UNMATCHED_RIGHT_PAREN_ORD.
3296         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3297         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3298         (REG_DEBUG): renamed from RE_DEBUG.
3299         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3300         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3301         unusual, since we can't clash with the POSIX REG_ICASE.
3302         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3303         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3304         (REG_NO_SUB): renamed from RE_NO_SUB.
3305         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3306         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3307         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3308         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3309         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3310         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3311         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3312         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3313         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3314         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3315         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3316         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3317         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3318         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3319         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3320         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3321         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3322         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3323         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3324         (REG_FIXED): Renamed from REGS_FIXED.
3325         (REG_NREGS): Renamed from RE_NREGS.
3326
3327         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3328         of other REG_* macros, since POSIX says the user is allowed to
3329         #undef these macros selectively.
3330
3331         (reg_errcode_t): Update comment stating what other tables need
3332         to be consistent.
3333
3334         Rename the following enum values to obey POSIX requirements.
3335         The old names are still visible as macros.
3336         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3337         is not defined, since GNU is supposed to be a superset of POSIX as
3338         much as possible, and since we want reg_errcode_t to be a signed
3339         type for implementation consistency.
3340         (_REG_NOERROR): Renamed from REG_NOERROR.
3341         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3342         (_REG_BADPAT): Renamed from REG_BADPAT.
3343         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3344         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3345         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3346         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3347         (_REG_EBRACK): Renamed from REG_EBRACK.
3348         (_REG_EPAREN): Renamed from REG_EPAREN.
3349         (_REG_EBRACE): Renamed from REG_EBRACE.
3350         (_REG_BADBR): Renamed from REG_BADBR.
3351         (_REG_ERANGE): Renamed from REG_ERANGE.
3352         (_REG_ESPACE): Renamed from REG_ESPACE.
3353         (_REG_BADRPT): Renamed from REG_BADRPT.
3354         (_REG_EEND): Renamed from REG_EEND.
3355         (_REG_ESIZE): Renamed from REG_ESIZE.
3356         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3357         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3358         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3359         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3360         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3361
3362         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3363         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3364         changed.  But support the old name if the new one is not defined
3365         and if _REGEX_SOURCE.
3366
3367         Change the following member names in struct re_pattern_buffer.
3368         The old names are still supported if !_REGEX_SOURCE.
3369         The new names are always supported, regardless of _REGEX_SOURCE.
3370         (re_buffer): Renamed from buffer.
3371         (re_allocated): Renamed from allocated.
3372         (re_used): Renamed from used.
3373         (re_syntax): Renamed from syntax.
3374         (re_fastmap): Renamed from fastmap.
3375         (re_translate): Renamed from translate.
3376         (re_can_be_null): Renamed from can_be_null.
3377         (re_regs_allocated): Renamed from regs_allocated.
3378         (re_fastmap_accurate): Renamed from fastmap_accurate.
3379         (re_no_sub): Renamed from no_sub.
3380         (re_not_bol): Renamed from not_bol.
3381         (re_not_eol): Renamed from not_eol.
3382         (re_newline_anchor): Renamed from newline_anchor.
3383
3384         Change the following member names in struct re_registers.
3385         The old names are still supported if !_REGEX_SOURCE.
3386         The new names are always supported, regardless of _REGEX_SOURCE.
3387         (rm_num_regs): Renamed from num_regs.
3388         (rm_start): Renamed from start.
3389         (rm_end): Renamed from end.
3390
3391         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3392         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3393         Prepend __ to parameter names.
3394
3395         Undo yesterday's changes.
3396
3397 2005-08-24  Jim Meyering  <jim@meyering.net>
3398
3399         Sync from coreutils.
3400         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3401
3402 2005-08-21  Bruno Haible  <bruno@clisp.org>
3403
3404         * lock.h: Add multiple inclusion guard.
3405         * tls.h: Add multiple inclusion guard.
3406
3407 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3408
3409         * regex.h (REG_NOSYS)
3410         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3411         Define, since POSIX requires it as of 2001.
3412         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3413         New private symbol, used to keep the enum signed in all cases.
3414         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3415         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3416
3417         * regex_internal.c (re_string_skip_chars, register_state):
3418         (calc_state_hash):
3419         Remove forward decls; no longer needed now that we use prototypes.
3420         * regexec.c (acquire_init_state_context, check_halt_node_context):
3421         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3422         (clean_state_log_if_needed): Likewise.
3423
3424 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3425
3426         Fix problems reported by Sam Steingold in
3427         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3428         * regexec.c (sift_states_bkref): Fix portability bug: the code
3429         assumed that reg_errcode_t is a signed type, which is not
3430         necessarily true if _XOPEN_SOURCE is not defined.
3431         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3432         some compilers warn about it otherwise.
3433
3434 2005-08-20  Jim Meyering  <jim@meyering.net>
3435
3436         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3437         of unused local, dfa.
3438
3439 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3440
3441         * regcomp.c (create_initial_state): Remove duplicate decl.
3442         (init_word_char, create_initial_state, duplicate_node_closure):
3443         (fetch_token, peek_token_bracket, build_range_exp):
3444         (build_collating_symbol): Remove forward decls; no longer needed
3445         now that we use prototypes.
3446
3447         * regcomp.c:
3448         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3449         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3450         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3451         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3452         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3453         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3454         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3455         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3456         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3457         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3458         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3459         (build_charclass, build_charclass_op, fetch_number, create_tree):
3460         (create_token_tree, mark_opt_subexp, duplicate_tree):
3461         Use prototypes rather than old-style definitions.
3462
3463         * regex_internal.c:
3464         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3465         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3466         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3467         (re_string_reconstruct, re_string_peek_byte_case):
3468         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3469         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3470         (re_node_set_init_copy, re_node_set_add_intersect):
3471         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3472         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3473         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3474         (re_acquire_state, re_acquire_state_context, register_state):
3475         (create_ci_newstate, create_cd_newstate, free_state):
3476         Likewise.
3477         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3478         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3479         (re_search_internal, prune_impossible_nodes):
3480         (acquire_init_state_context, check_matching, static):
3481         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3482         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3483         (update_regs, sift_states_backward, build_sifted_states):
3484         (clean_state_log_if_needed, merge_state_array):
3485         (update_cur_sifted_state, add_epsilon_src_nodes):
3486         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3487         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3488         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3489         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3490         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3491         (check_arrival, check_arrival_add_next_nodes):
3492         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3493         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3494         (check_node_accept_bytes, check_node_accept, extend_buffers):
3495         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3496         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3497         (sift_ctx_init):
3498         Likewise.
3499
3500         * regex_internal.h:
3501         (re_string_allocate, re_string_construct, re_string_reconstruct):
3502         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3503         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3504         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3505         (re_string_context_at, re_string_peek_byte_case):
3506         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3507         is defined, since we now use prototypes always.
3508
3509         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3510         C89 or better.  All uses removed.
3511
3512 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3513
3514         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3515         [defined lint]: Suppress bogus uninitialized-variable warnings.
3516
3517         * regcomp.c (duplicate_node): Return new index, not an error code,
3518         and let the caller return REG_ESPACE if out of space.  This
3519         removes an uninitialied-variable warning with GCC 4.0.1, and also
3520         avoids taking the address of a local variable.  All callers
3521         changed.
3522
3523 2005-08-19  Jim Meyering  <jim@meyering.net>
3524
3525         * regexec.c (proceed_next_node): Redo local variables to
3526         avoid GCC shadowing warnings.
3527
3528 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3529
3530         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3531         (re_node_set_insert_last, re_dfa_add_node):
3532         Rename local variables to avoid GCC shadowing warnings.
3533
3534 2005-08-18  Bruno Haible  <bruno@clisp.org>
3535
3536         * strstr.c (strstr): Fix return value in multibyte case.
3537         * strcasestr.c (strcasestr): Likewise.
3538
3539 2005-08-17  Jim Meyering  <jim@meyering.net>
3540
3541         Make the %s format (seconds since the epoch) work for a negative
3542         number and when used with a zero-padded field width, e.g. %015s.
3543
3544         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3545         label so that it precedes the code to set `digits'.  Otherwise,
3546         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3547         print `00-22'.  Now, it prints `-0022', as it should.
3548
3549 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3550
3551         * regex.h: Remove useless space-before-tab.  From coreutils.
3552
3553 2005-08-17  Bruno Haible  <bruno@clisp.org>
3554
3555         * strcasestr.h: New file.
3556         * strcasestr.c: New file.
3557
3558 2005-08-17  Bruno Haible  <bruno@clisp.org>
3559
3560         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3561         * strstr.c: Completely rewritten, with multibyte locale support.
3562
3563 2005-08-17  Bruno Haible  <bruno@clisp.org>
3564
3565         * strcasecmp.c: Use mbuiter.h.
3566
3567 2005-08-17  Bruno Haible  <bruno@clisp.org>
3568
3569         * mbuiter.h: New file.
3570
3571 2005-08-16  Bruno Haible  <bruno@clisp.org>
3572
3573         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3574         (mbi_init): Update.
3575         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3576         NUL byte, not after it.
3577
3578 2005-08-16  Bruno Haible  <bruno@clisp.org>
3579
3580         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3581         the valid ones. Makes the comparison operations transitive:
3582         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3583         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3584
3585 2005-08-16  Bruno Haible  <bruno@clisp.org>
3586
3587         * strcase.h (strcasecmp): Add note in comments.
3588         * strncasecmp.c: Use code from strcasecmp.c.
3589         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3590         (strcasecmp): Work correctly in multibyte locales.
3591
3592 2005-08-16  Bruno Haible  <bruno@clisp.org>
3593
3594         * strnlen1.h: New file.
3595         * strnlen1.c: New file.
3596
3597 2005-08-16  Bruno Haible  <bruno@clisp.org>
3598
3599         * mbfile.h: New file.
3600
3601 2005-08-16  Bruno Haible  <bruno@clisp.org>
3602
3603         * mbiter.h: New file.
3604
3605 2005-08-16  Bruno Haible  <bruno@clisp.org>
3606
3607         * mbchar.h: New file.
3608         * mbchar.c: New file.
3609
3610 2005-08-16  Bruno Haible  <bruno@clisp.org>
3611
3612         * tls.h: New file, from GNU gettext.
3613         * tls.c: New file, from GNU gettext.
3614
3615 2005-08-15  Bruno Haible  <bruno@clisp.org>
3616
3617         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3618         is defined.
3619
3620 2005-08-14  Jim Meyering  <jim@meyering.net>
3621
3622         Sync from coreutils.
3623
3624         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3625         Use the hash-table-based cycle-detection code not just when
3626         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3627         Reported by James Youngman in
3628         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3629         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3630         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3631         This lets us compile with -DFTS_DEBUG, once again.
3632         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3633         * fts.c (fd_safer): Remove decl.
3634         Include fcntl--.h rather than unistd-safer.h
3635         (fts_safe_changedir): Don't call fd_safer; no longer needed
3636         now that we include fcntl--.h.
3637
3638 2005-08-11  Simon Josefsson  <jas@extundo.com>
3639
3640         * readline.h, readline.c: New file.
3641
3642 2005-08-11  Bruno Haible  <bruno@clisp.org>
3643
3644         * strnlen.h (strnlen): Change parameter name to match comment.
3645
3646 2005-08-10  Simon Josefsson  <jas@extundo.com>
3647
3648         * strndup.c: Use strnlen.h.
3649
3650         * strnlen.h: New file.
3651
3652 2005-08-02  Simon Josefsson  <jas@extundo.com>
3653
3654         * getline.h, getline.c: Rewrite.
3655
3656         * getdelim.h, getdelim.c: New files, ported from glibc.
3657
3658 2005-07-31  Bruno Haible  <bruno@clisp.org>
3659
3660         * lock.h (gl_lock_initializer): New macro.
3661         (gl_lock_define_initialized): Use it.
3662         (gl_rwlock_initializer): New macro.
3663         (gl_rwlock_define_initialized): Use it.
3664         (gl_recursive_lock_initializer): New macro.
3665         (gl_recursive_lock_define_initialized): Use it.
3666
3667 2005-07-26  Bruno Haible  <bruno@clisp.org>
3668
3669         * lock.h: Update from GNU gettext.
3670         * lock.c: Update from GNU gettext.
3671
3672 2005-07-18  Bruno Haible  <bruno@clisp.org>
3673
3674         * lock.h (gl_once_t): New type.
3675         (gl_once_define, gl_once): New macros.
3676         * lock.c (fresh_once): New variable.
3677         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3678         functions.
3679
3680 2005-07-18  Simon Josefsson  <jas@extundo.com>
3681
3682         * check-version.c (check_version): Accept identical versions too.
3683
3684 2005-07-18  Bruno Haible  <bruno@clisp.org>
3685
3686         * lock.h: New file, from GNU gettext.
3687         * lock.c: New file, from GNU gettext.
3688
3689 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3690
3691         * quotearg.c: Add translator comment suggested by Bruno Haible,
3692         with a minor change.
3693
3694 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3695
3696         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3697         copyright symbol and the year.
3698         * version-etc.c (COPYRIGHT_YEAR): New constant.
3699         (version_etc_va): Use parameterized copyright notice.
3700         Reword to conform to the current GNU coding standards.
3701
3702 2005-07-11  Simon Josefsson  <jas@extundo.com>
3703
3704         * size_max.h: New file.
3705
3706 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3707
3708         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3709         block of defines.
3710
3711 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3712        and  Paul Eggert  <eggert@cs.ucla.edu>
3713
3714         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3715         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3716
3717 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3718
3719         * regex.c, regex.h: Sync from libc.
3720         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3721         New files, synced from libc, except that regex_internal.h
3722         currently has a small porting fix.
3723
3724 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3725
3726         Remove the dependency of the strftime module on the tzset module.
3727         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3728         Copy the input structure, to work around some of the bug with
3729         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3730         Solaris releases, you should also use the tzset module, but we won't
3731         require it as a dependency any more since we don't want LGPLed code
3732         to depend on GPLed code.
3733
3734 2005-07-02  Jim Meyering  <jim@meyering.net>
3735
3736         * backupfile.c (backup_args): Change a `0' to NULL.
3737
3738 2005-07-01  Jim Meyering  <jim@meyering.net>
3739
3740         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3741         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3742         * save-cwd.c, tempname.c:
3743         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3744         and don't include <sys/file.h>).
3745
3746 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3747
3748         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3749         declares only 'struct timespec;' (!).
3750
3751 2005-06-29  Jim Meyering  <jim@meyering.net>
3752
3753         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3754         type name.  Use the variable name instead.
3755         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3756
3757 2005-06-28  Simon Josefsson  <jas@extundo.com>
3758
3759         * check-version.h, check-version.c: New files.
3760
3761 2005-06-28  Simon Josefsson  <jas@extundo.com>
3762
3763         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3764         collision with global variable.  Better indentation.  Don't
3765         increment buffer pointer beyond buffer end.  Based on comments
3766         from Paul Eggert <eggert@cs.ucla.edu>.
3767
3768         * base64.h: Indent.
3769
3770 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3771
3772         * canon-host.c (canon-host): Append trailing "," to 0 in
3773         initializer of struct addrinfo, as an indication that we don't
3774         care how many members the structure has.
3775
3776 2005-06-24  Derek Price  <derek@ximbiot.com>
3777         and Bruno Haible  <bruno@clisp.org>
3778
3779         Remove stat module & update lstat.
3780         * stat.c: Remove this file...
3781         (slash_aware_lstat): ...moving this content and its support...
3782         * lstat.c (rpl_lstat): ...into here.
3783         * lstat.h: New file.
3784
3785 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3786
3787         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3788         (ranged_convert): Don't save conversion in a temporary struct.
3789         This causes a warning with GCC 4.0.0, and anyway in the typical
3790         case it's not worth the extra 100 bytes or so of code.
3791         (ranged_convert, __mktime_internal): When calling a function via a
3792         pointer P, use P () rather than (*P) (), as we now assume C89 or
3793         better.
3794
3795 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3796
3797         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3798         "who -r" failed to give output.  Problem reported by Tim Waugh.
3799
3800         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3801         (xcalloc): Use it to avoid needless tests.
3802         Problem reported by Jim Meyering.
3803
3804 2005-06-16  Jim Meyering  <jim@meyering.net>
3805
3806         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3807         when either N or S is zero.
3808
3809 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3810
3811         * argp.h (__option_is_short): Check upper limit of
3812         __key. Isprint() requires its argument to have the value
3813         of an unsigned char or EOF.
3814
3815 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3816
3817         * fnmatch.c (fnmatch): If there is an encoding error in a
3818         multibyte string or pattern, fall back on unibyte matching.
3819         Problem reported by James Youngman.
3820
3821 2005-06-08  Bruno Haible  <bruno@clisp.org>
3822
3823         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3824         warning on mingw.
3825
3826 2005-06-08  Bruno Haible  <bruno@clisp.org>
3827
3828         * csharpcomp.h: New file, from GNU gettext.
3829         * csharpcomp.c: New file, from GNU gettext.
3830         * csharpcomp.sh.in: New file, from GNU gettext.
3831
3832 2005-06-07  Derek Price  <derek@ximbiot.com>
3833
3834         Sync from CVS.
3835         * glob_.h: Indent nested #ifdef.
3836
3837 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3838
3839         Sync from coreutils.
3840         Use "file name" when talking about file names, instead of "filename"
3841         or "path", as per the GNU coding standards.
3842         * mkdir-p.c: Renamed from makepath.c.
3843         (make_dir_parents): Renamed from make_path.  All callers changed.
3844         * mkdir-p.h: Likewise.  All includers changed.
3845         * filenamecat.c: Renamed from path-concat.c.
3846         (file_name_concat): Renamed from path_concat.  All callers changed.
3847         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3848         * filenamecat.h: Likewise.  All includers changed.
3849         * acl.c: Don't use "path" or "filename" to mean "file name"
3850         in comments or local variable names.
3851         * basename.c: Likewise.
3852         * canonicalize.c, canonicalize.h: Likewise.
3853         * dirname.c, dirname.h: Likewise.
3854         * euidaccess.c: Likewise.
3855         * exclude.c: Likewise
3856         * fnmatch_.h, fnmatch_loop.c: Likewise.
3857         * fsusage.c, fsuage.h: Likewise.
3858         * fts.c, fts_.h: Likewise.
3859         * getcwd.c: Likewise.
3860         * getloadavg.c: Likewise.
3861         * mkstemp.c: Likewise.
3862         * mountlist.c, mountlist.h: Likewise.
3863         * openat.c, openat.h: Likewise.
3864         * readlink-stub.c: Likewise.
3865         * readutmp.c, readutmp.h: Likewise.
3866         * rename.c: Likewise.
3867         * rmdir.c: Likewise.
3868         * same.c: Likewise.
3869         * savedir.c: Likewise.
3870         * stripslash.c: Likewise.
3871         * tempname.c: Likewise.
3872         * xreadlink.c: Likewise.
3873         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3874         All uses changed.
3875         * exclude.h: Likewise.
3876
3877         * euidaccess.c (getuid, getgid, getuid, getegid)
3878         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3879         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3880         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3881         * pathmax.h: Include <limits.h> unconditionally, since other
3882         files have been getting away with it for years (MORE/BSD 4.3
3883         is extinct now).
3884         * userspec.c (getpwnam, getgrnam, getgrgid)
3885         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3886
3887         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3888         Define to 256, not 255, as per modern POSIX.
3889
3890 2005-06-01  Bruno Haible  <bruno@clisp.org>
3891
3892         * csharpexec.h: New file, from GNU gettext.
3893         * csharpexec.c: New file, from GNU gettext.
3894         * csharpexec.sh.in: New file, from GNU gettext.
3895
3896 2005-05-31  Derek Price  <derek@ximbiot.com>
3897             Paul Eggert  <eggert@cs.ucla.edu>
3898
3899         Sync from cvs.
3900         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3901
3902 2005-05-29  Derek Price  <derek@ximbiot.com>
3903             Paul Eggert  <eggert@cs.ucla.edu>
3904
3905         * glob_.h, glob.c: New files.
3906
3907 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3908
3909         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3910
3911         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3912         the configuration hassle isn't worth it.
3913         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3914         (LONGEST_MODIFIER, PRIuMAX): Remove.
3915
3916 2005-05-27  Bruno Haible  <bruno@clisp.org>
3917
3918         * getlogin_r.h: Remove second include of <stddef.h>.
3919
3920 2005-05-25  Bruno Haible  <bruno@clisp.org>
3921             Derek Price  <derek@ximbiot.com>
3922
3923         * getlogin_r.h: Simplify API documentation.
3924
3925 2005-05-25  Derek Price  <derek@ximbiot.com>
3926             Paul Eggert  <eggert@cs.ucla.edu>
3927
3928         * getlogin_r.c, getlogin_r.h: New files.
3929
3930 2005-05-22  Bruno Haible  <bruno@clisp.org>
3931
3932         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3933         Also include <sys/param.h> if it defines MIN, MAX.
3934         Based on a patch by Derek Price <derek@ximbiot.com>.
3935
3936 2005-05-22  Bruno Haible  <bruno@clisp.org>
3937
3938         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3939         (INT64_MIN): Fix definition.
3940         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3941
3942         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3943         NEED_SIGNED_INT_TYPES.
3944
3945         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3946         HAVE_SYSTEM_INTTYPES.
3947
3948 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3949
3950         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3951         so that unistd-safer.h (GPL'ed code) need not be included.
3952
3953 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3954
3955         New fts module.
3956         * fts.c: Don't include "cycle-check.h" or "hash.h".
3957         (setup_dir, free_dir): New functions.
3958         (enter_dir, leave_dir): Define trivial
3959         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3960         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3961         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3962         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3963         Move to fts-cycle.c.
3964         (fts_open): Use setup_dir.
3965         (fts_close): Use free_dir.
3966         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3967         This adds a label and some gotos, but the alternatives were messier.
3968         Check for memory allocation failure when entering a dir.
3969         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3970         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3971         (FTS): New member fts_cycle, that is a union that contains the
3972         old active_dir_ht and cycle_state.  All uses changed to mention
3973         fts_cycle.ht and fts_cycle.state.
3974         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3975         fts.c, with the following changes:
3976         (setup_dir, free_dir): New functions.
3977         (enter_dir): Now returns bool.  Return true if successful, false
3978         if memory exhausted.  All callers changed.
3979         Do not bother partly cleaning up on
3980         memory allocation failure; that is free_dir's job.
3981         However, free ad if hash_insert fails, to avoid memory leak.
3982         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3983         fts->fts_options to see which union member to use.
3984
3985 2005-05-20  Jim Meyering  <jim@meyering.net>
3986
3987         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3988         Now a macro, to pacify GCC.
3989
3990 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3991
3992         * chown.c (rpl_chown): Return -1 on failure.
3993
3994 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3995
3996         * canonicalize.c: Include canonicalize.h first, to test interface.
3997         Include <stddef.h> unconditionally, since we assume C89 now.
3998         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3999         * fts.c: Include fts_.h first, to check interface.
4000         Do not include intprops.h; no longer needed.
4001         Include cycle-check.h and hash.h, since fts_.h no longer does.
4002         Remove unnecessary casts of closedir to void.
4003         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4004         decide whether to decrement nlinks.
4005         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4006         (FTS): Use struct hash_table * instead of Hash_table, so that
4007         we no longer need to include hash.h here.
4008
4009 2005-05-17  Jim Meyering  <jim@meyering.net>
4010
4011         * fts.c, fts_.h: New files, from coreutils.
4012
4013 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4014
4015         Sync from coreutils.
4016         * unlinkdir.c, unlinkdir.h: New files.
4017         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4018         regex.h, unlocked-io.h, xtime.h:
4019         White space changes only.
4020         * makepath.c (make_path): Port to hosts where leading "//" is special.
4021         * yesno.c: Include getline.h, not ctype.h.
4022         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4023         Use getline to remove arbitrary restriction on response length.
4024
4025 2005-05-13  Bruno Haible  <bruno@clisp.org>
4026
4027         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4028         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4029         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4030         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4031         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4032         Add support for 64-bit integers in the MSVC compiler.
4033
4034 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4035
4036         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4037         Change the initial comment to refer to GPL, not LGPL.
4038         gnulib-tool will change it to LGPL as needed.
4039
4040         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4041         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4042         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4043         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4044         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4045         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4046         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4047         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4048         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4049         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4050         concatpath.c, config.charset, copy-file.c, copy-file.h,
4051         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4052         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4053         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4054         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4055         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4056         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4057         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4058         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4059         full-read.c, full-read.h, full-write.c, full-write.h,
4060         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4061         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4062         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4063         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4064         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4065         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4066         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4067         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4068         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4069         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4070         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4071         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4072         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4073         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4074         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4075         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4076         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4077         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4078         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4079         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4080         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4081         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4082         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4083         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4084         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4085         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4086         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4087         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4088         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4089         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4090         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4091         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4092         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4093         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4094         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4095         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4096         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4097         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4098         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4099         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4100         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4101         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4102         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4103         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4104         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4105         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4106         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4107         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4108         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4109         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4110         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4111         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4112         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4113         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4114         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4115         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4116         Update FSF postal mail address.
4117
4118 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4119
4120         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4121         specified in ai_socktype. Fix invalid ai_protocol
4122         check. ai_protocol is usually set to 0 or depending on
4123         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4124         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4125         ai_socktype / ai_protocol in the returned addrinfo structure.
4126
4127 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4128             Bruno Haible  <bruno@clisp.org>
4129
4130         * inet_ntop.h: New file.
4131         * inet_ntop.c: New file, from glibc with modifications.
4132
4133 2005-05-08  Jim Meyering  <jim@meyering.net>
4134
4135         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4136
4137 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4138
4139         Merge from coreutils.  Among other things,
4140         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4141         * fd-safer.c: New file.
4142         * fcntl-safer.h, open-safer.c: Remove.
4143         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4144         * dup-safer.c: Include unistd-safer.h first.
4145         Don't include errno.h.
4146         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4147         * file-type.h: Don't assume invoker included sys/stat.h first.
4148         * file-type.c: Rely on file-type.h change.
4149         * getloadavg.c: Include unistd-safer.h.
4150         (getloadavg): Use safer open.
4151         * getusershell.c: Include "stdio-safer.h".
4152         (getusershell): Use safer fopen.
4153         * long-options.c (long_options): Use NULL rather than 0.
4154         * modechange.h (mode_free): Remove; all callers changed to invoke
4155         'free'.
4156         * modechange.c: Likewise.
4157         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4158         (MODE_DONE): New constant.
4159         (struct mode_change): Remove 'next' member.
4160         (make_node_op_equals): New function; like the old one of the
4161         same name, except it allocates an array.
4162         (mode_compile, mode_create_from_ref): Use it.
4163         (mode_compile): Allocate result as an array, not a linked list.
4164         Parse octal string ourself, so that we catch mistakes like "+0".
4165         (mode_adjust): Arg is an array, not a linked list.
4166         * modechange.c: Include stat-macros.h, xalloc.h.
4167         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4168         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4169         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4170         Remove.  This is now stat-macros.h's job.
4171         (talloc): Remove.  All callers replaced by xalloc, so that
4172         our invokers don't have to worry about reporting memory failures.
4173         (make_node_op_equals): Remove.
4174         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4175         New constants.
4176         (struct mode_change): Moved here from modechange.h.
4177         (mode_append_entry): Remove.
4178         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4179         apps to have incorrect behavior.  Use simpler algorithm for head
4180         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4181         Detect more invalid usages rather than having somewhat-random behavior.
4182         Don't insert an "a=" action, as that leads to incorrect behavior.
4183         (mode_compile, mode_create_from_ref): Return NULL on error instead
4184         of an enum, since now there's only one way to have an error.  All
4185         callers changed.
4186         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4187         at the correct time.  Simplify calculation of "+u" and its ilk.
4188         Don't mishandle "+X".
4189         (mode_free): Remove "register" and localize decls.
4190         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4191         (struct mode_change): Move to modechange.c; callers don't
4192         need to see this stuff.
4193         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4194         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4195         (mode_change, mode_adjust): Reflect the new signatures noted above.
4196         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4197         that might redefine system include files.
4198         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4199         (my_usleep): Use NULL rather than (void *) 0.
4200         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4201         Use siginterrupt to specify that system calls should be interrupted.
4202         (rpl_nanosleep): Move initialization of suspended closer to call of
4203         my_usleep.
4204         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4205         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4206         (desirable_utmp_entry): New function.
4207         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4208         using x2nrealloc, to simplify logic.
4209         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4210         size calculation.  Do not assume utmp file is a regular file.
4211         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4212         (READ_UTMP_CHECK_PIDS): New constant.
4213         * save-cwd.c: Include unistd-safer.h.
4214         (save_cwd): Use fd_safer.
4215         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4216         [!_LIBC] Include "stat-macros.h" instead.
4217         * unistd-safer.h (fd_safer): New decl.
4218
4219 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4220
4221         * byteswap_.h: New file.
4222
4223 2005-04-25  Albert Chin  <china@thewrittenword.com>
4224
4225         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4226         Toolkit C bug.
4227
4228 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4229
4230         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4231         that "UTC +1 second" continues to work.  Problem reported
4232         by Dmitry V. Levin.
4233         (relunit_snumber): New rule.
4234         (relunit): Use it.
4235
4236 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4237
4238         * getdate.y (universal_time_zone_table): New constant.
4239         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4240         universal_time_zone_table.
4241         (lookup_zone): Prefer universal_time_zone_table to
4242         local_time_zone_table, so that "GMT" time stamps are allowed in
4243         London during the summer.  Problem reported by Ian Abbott.
4244
4245 2005-04-12  Jim Meyering  <jim@meyering.net>
4246
4247         * human.c (humblock): Set *options even when returning due to
4248         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4249         warning from gcc-4.
4250
4251 2005-04-09  Jim Meyering  <jim@meyering.net>
4252
4253         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4254         -Wuninitialized: initialize tm0.tm_year.
4255
4256 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4257
4258         * getdate.y (parser_control): rels_seen is now a boolean, not a
4259         count, since there's no maximum.  All uses changed.
4260         Add member dsts_seen.
4261         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4262         not being INT_MAX.
4263         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4264         Use pc_rels_seen to decide whther a date is absolute.
4265
4266         * getdate.y (number): Don't overwrite year.
4267         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4268         check.
4269
4270 2005-04-02  Simon Josefsson  <jas@extundo.com>
4271
4272         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4273         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4274
4275 2005-03-27  Jim Meyering  <jim@meyering.net>
4276
4277         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4278
4279 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4280
4281         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4282         "one's complement" -> "ones' complement" in comment, as per Knuth.
4283         "value of type" -> "type or expression" in comment.
4284         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4285
4286 2005-03-26  Jim Meyering  <jim@meyering.net>
4287
4288         Comment nits.
4289         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4290         Correct typos: s/or/of/.
4291
4292 2005-03-23  Jim Meyering  <jim@meyering.net>
4293
4294         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4295
4296 2005-03-21  Jim Meyering  <jim@meyering.net>
4297
4298         Changes imported from coreutils.
4299
4300         * cycle-check.c: Don't include xalloc.h.
4301
4302         * path-concat.c: Don't include assert.h.
4303         (path_concat): Remove assertion that would have triggered
4304         for ABASE starting with more than one slash.
4305         Reported by Andreas Schwab.
4306
4307         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4308         properly when ABASE is an absolute file name.
4309         Correct the description of this function.
4310         Include <assert.h>.
4311         Add an assertion and a test driver.
4312         This fixes a bug introduced on 2004-07-02.
4313         Andreas Schwab reported the resulting failure of cp --parents:
4314         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4315
4316 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4317
4318         * strftime.c (my_strftime): If the underlying strftime returns 0
4319         (which shouldn't happen), generate nothing instead of returning 0
4320         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4321
4322 2005-03-16  Bruno Haible  <bruno@clisp.org>
4323
4324         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4325
4326 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4327
4328         * strftime.c (my_strftime): Prepend space to format so that we can
4329         reliably distinguish strftime failure from empty output on POSIX
4330         hosts.
4331
4332 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4333
4334         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4335         (iconv_string): Don't guess a size-zero buffer, as that might cause
4336         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4337         result would be 'too large', where 'too large' is (heuristically)
4338         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4339         overflow concerns.  This will prevent some unwanted malloc failures
4340         when the inputs are very large.
4341
4342 2005-03-15  Bruno Haible  <bruno@clisp.org>
4343
4344         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4345         'negate'.
4346
4347         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4348         variable.
4349
4350         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4351
4352 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4353
4354         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4355         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4356         intprops.h.
4357         * strtol.c: Likewise.
4358
4359 2005-03-14  Simon Josefsson  <jas@extundo.com>
4360
4361         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4362         <fx@gnu.org>.
4363
4364 2005-03-14  Jim Meyering  <jim@meyering.net>
4365
4366         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4367         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4368         to be nonzero so that we (and caller) can detect the difference
4369         between a valid zero-length expansion and an error return, even
4370         when the underlying strftime fails before writing anything into
4371         that location.
4372
4373 2005-03-10  Jim Meyering  <jim@meyering.net>
4374
4375         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4376         so that this module works on systems without fchdir.
4377
4378 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4379
4380         Factor int-properties macros into a single file, except for
4381         glibc-related files.
4382         * intprops.h: New file.
4383         * getloadavg.c: Include it instead of limits.h.
4384         (INT_STRLEN_BOUND): Remove.
4385         * human.c: Include intprops.h.
4386         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4387         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4388         * inttostr.h: Include intprops.h instead of limits.h.
4389         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4390         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4391         for consistency with intprops.h.
4392         (time_t_is_integer, twos_complement_arithmetic): Use them.
4393         * sig2str.h: Include <signal.h>, intprops.h.
4394         (INT_STRLEN_BOUND): Remove.
4395         * strftime.c (TYPE_SIGNED): Remove.
4396         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4397         * strtol.c: Adjust comments to match intprops.h.
4398         * userspec.c: Include intprops.h.
4399         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4400         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4401         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4402         instead of rolling our own expressions.
4403         * xstrtol.c: Include xstrtol.h first, to test interface.
4404
4405         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4406         instead of int.
4407         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4408         the right thing even if adding 1900 would overflow.  Similarly
4409         for tm_mon + 1 and tm_yday + 1.
4410         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4411         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4412         (DO_SIGNED_NUMBER): New macro.
4413         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4414
4415 2005-03-07  Bruno Haible  <bruno@clisp.org>
4416
4417         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4418
4419 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4420             Bruno Haible  <bruno@clisp.org>
4421
4422         * pagealign_alloc.h: New file.
4423         * pagealign_alloc.c: New file.
4424
4425 2005-01-28  Bruno Haible  <bruno@clisp.org>
4426
4427         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4428         stpncpy.c uses it.
4429
4430 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4431
4432         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4433         The workaround isn't strictly needed for POSIX conformance, and
4434         it's too much of a pain to configure and maintain.  We'll ask
4435         people to fix their kernels instead.
4436         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4437         (NANOSLEEP_BUG_WORKAROUND): Remove.
4438         (xnanosleep): Remove the workaround.
4439
4440 2005-02-12  Bruno Haible  <bruno@clisp.org>
4441
4442         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4443
4444 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4445
4446         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4447         * timespec.h (gettime): Return void, since it always
4448         succeeds now.  All uses changed.
4449         * gettime.c (gettime) Likewise.
4450         [HAVE_NANOTIME]: Prefer nanotime.
4451         Assume gettimeofday succeeds, as POSIX requires.
4452         Assime time () succeeds, since other code already does.
4453         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4454         (timespec_subtract): Remove.
4455         (NANOSLEEP_BUG_WORKAROUND): New constant.
4456         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4457         things considerably.  Use it only on GNU/Linux hosts, since the
4458         workaround shouldn't be needed elsewhere.
4459
4460 2005-02-24  Bruno Haible  <bruno@clisp.org>
4461
4462         * gettext.h: Update from GNU gettext 0.14.2.
4463
4464 2005-02-24  Bruno Haible  <bruno@clisp.org>
4465
4466         * localcharset.c: Update from GNU gettext 0.14.2.
4467         * config.charset: Update from GNU gettext 0.14.2.
4468
4469 2005-02-22  Simon Josefsson  <jas@extundo.com>
4470
4471         * iconvme.h, iconvme.c: New files, from libc.
4472
4473 2005-02-20  Neil Conway  <neilc@samurai.com>
4474
4475         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4476         returned by OSX/Darwin if the specified buffer is not large
4477         enough for the hostname.
4478
4479 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4480
4481         * memrchr.h: New file.
4482         * chdir-long.c: Include it.
4483         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4484         Don't bother including stddef.h.
4485
4486 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4487
4488         * argp-help.c (__argp_help): Create a fake struct argp_state and
4489         pass it to _help, otherwise the latter coredumps trying to
4490         dereference state.root_argp.
4491
4492 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4493
4494         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4495         inclusion.
4496         Include <sys/types.h>, for dev_t.
4497         (ME_DUMMY, ME_REMOTE): Move from here....
4498         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4499         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4500         Dmitry V. Levin.
4501         Include mountlist.h first, to test the interface.
4502
4503 2005-01-29  Bruno Haible  <bruno@clisp.org>
4504
4505         * progname.c (program_name): Initialize.
4506         Needed when linking statically on MacOS X.
4507
4508 2005-01-28  Bruno Haible  <bruno@clisp.org>
4509
4510         * javacomp.sh.in: New file, from GNU gettext.
4511         * javacomp.h: New file, from GNU gettext.
4512         * javacomp.c: New file, from GNU gettext.
4513
4514 2005-01-26  Bruno Haible  <bruno@clisp.org>
4515
4516         * javaexec.sh.in: New file, from GNU gettext.
4517         * javaexec.h: New file, from GNU gettext.
4518         * javaexec.c: New file, from GNU gettext.
4519
4520 2005-01-26  Simon Josefsson  <jas@extundo.com>
4521
4522         * gai_strerror.c: Use GPL in header.
4523
4524 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4525
4526         * argp-help.c (hol_entry_help): Avoid using non-constant
4527         initializers for struct pentry_state.
4528         (__argp_error): Check return value of __asprintf
4529         (__argp_failure): Translate error message
4530
4531         * argp-parse.c: Removed braces around the expansion of N_()
4532
4533 2005-01-21  Jim Meyering  <jim@meyering.net>
4534
4535         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4536         same value as for Solaris 9.
4537
4538         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4539         component length.  This included changing the parameter to be
4540         of type `char *' rather than `char const *'.
4541         * chdir-long.h (chdir_long): Update prototype.
4542
4543         * openat.c (fdopendir, fstatat): New functions.
4544         * openat.h: Include headers required for use of DIR and struct stat.
4545         [AT_SYMLINK_NOFOLLOW]: Define.
4546         (fdopendir, fstatat): Add prototypes.
4547
4548 2005-01-21  Bruno Haible  <bruno@clisp.org>
4549
4550         * classpath.h: New file, from GNU gettext.
4551         * classpath.c: New file, from GNU gettext.
4552
4553 2005-01-20  Simon Josefsson  <jas@extundo.com>
4554
4555         * version-etc-fsf.c: New file, with version_etc_copyright.
4556         * version-etc.c: Remove version_etc_copyright.
4557         * version-etc.h (version_etc_copyright): Use [] instead of * in
4558         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4559
4560 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4561
4562         * save-cwd.c (save_cwd): Remove code to support the case
4563         where fchdir is missing or flaky.
4564
4565 2005-01-20  Simon Josefsson  <jas@extundo.com>
4566
4567         * base64.h (isbase64): Add.
4568
4569         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4570         using a unsigned prototype, don't inline.
4571         (base64_decode): Use it.
4572
4573 2005-01-19  Bruno Haible  <bruno@clisp.org>
4574
4575         * sh-quote.h: New file, from GNU gettext.
4576         * sh-quote.c: New file, from GNU gettext.
4577
4578 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4579
4580         Merge changes from coreutils, as described below in several
4581         changelogs dated today.
4582
4583         * save-cwd.c: Include "save-cwd.h" before other include files.
4584         (O_DIRECTORY): Remove; not needed here, since "." must be
4585         a directory.  All uses removed.
4586         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4587         universal on Suns, and we also need to test for IRIX.
4588         Revamp code to use 'if' rather than '#if'.
4589         Avoid unnecessary comparison of cwd->desc to 0.
4590
4591         * utimens.c (futimens): Robustify the previous patch, by checking
4592         for known valid error numbers rather than observed invalid ones.
4593
4594 2005-01-18  Jim Meyering  <jim@meyering.net>
4595
4596         * version-etc.c (version_etc_copyright): Update copyright date.
4597
4598         * utimens.c (futimens): Account for the fact that futimes
4599         can also fail with errno == ENOSYS or errno == ENOENT.
4600         Patch from Dmitry V. Levin.
4601
4602         Change the name of the robust chdir function from chdir to chdir_long.
4603         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4604         (restore_cwd): Use chdir_long, not chdir.
4605         * chdir-long.c: Renamed from chdir.c.
4606         * chdir-long.h: Renamed from chdir.h.
4607         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4608         Hurd.
4609
4610 2005-01-18  Bob Proulx  <bob@proulx.com>
4611
4612         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4613         offsetof() macro construct to avoid compile failure with native HP-UX
4614         11.0 ANSI C compiler.
4615
4616 2005-01-06  Bruno Haible  <bruno@clisp.org>
4617
4618         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4619         because stpncpy.m4 takes care of it.
4620
4621 2004-01-24  Bruno Haible  <bruno@clisp.org>
4622
4623         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4624
4625 2003-10-09  Bruno Haible  <bruno@clisp.org>
4626
4627         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4628
4629 2005-01-06  Bruno Haible  <bruno@clisp.org>
4630
4631         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4632         * fwriteerror.c: Include <stdbool.h>.
4633         (fwriteerror): At the end, close the file stream. Record whether
4634         stdout was already closed.
4635
4636 2004-05-27  Bruno Haible  <bruno@clisp.org>
4637
4638         * execute.c (environ): Declare if needed.
4639         * pipe.c (environ): Likewise.
4640         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4641
4642 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4643
4644         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4645         definitions to be after all include files, to avoid collisions.
4646         Problem reported by Bob Proulx.
4647
4648 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4649
4650         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4651         not needed.  This removes a dependency on the gettext module.
4652         [defined _LIBC]: Do not include <libintl.h>; not needed.
4653
4654 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4655
4656         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4657         HAVE_DECL_STRTOLD.
4658
4659 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4660
4661         * argp-parse.c: Include <stddef.h>.
4662         (alignof, alignto): New macros.
4663         (parser_init): Don't assume that void * is aligned sufficiently
4664         for struct option.
4665
4666         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4667         need to extend the stack.
4668         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4669         large.
4670
4671 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4672
4673         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4674
4675 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4676
4677         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4678         Remove now-obsolete comment about AIX.
4679         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4680         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4681         (YYMAXDEPTH): New macro.
4682
4683 2004-12-18  Bruno Haible  <bruno@clisp.org>
4684
4685         * fatal-signal.c (fatal_signals): Make non-const.
4686         (init_fatal_signals): New function.
4687         (uninstall_handlers, install_handlers): Ignore signals that were set to
4688         SIG_IGN.
4689         (at_fatal_signal): Call init_fatal_signals.
4690         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4691         SIG_IGN.
4692         Reported by Paul Eggert.
4693
4694 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4695
4696         * getdate.y (textint): New member "negative".
4697         (time_zone_hhmm): New function.
4698         Expect 14 shift-reduce conflicts, not 13.
4699         (o_colon_minutes): New rule.
4700         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4701         (yylex): Set the "negative" member of signed numbers.
4702
4703 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4704
4705         Changes imported from coreutils.
4706         * hard-locale.c: Assume <locale.h> exists.
4707         Include "strdup.h".
4708         (GLIBC_VERSION): New macro.
4709         (hard_locale): Assume setlocale exists.
4710         Rewrite to avoid #ifdef.
4711         Use strdup rather than malloc + strcpy.
4712         * human.c: Assume <locale.h> exists.
4713         (human_readable): Assume localeconv exists.
4714
4715 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4716
4717         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4718         convert T2, not T.  (Imported from libc.)
4719
4720 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4721
4722         * getcwd.c (is_ENAMETOOLONG): New macro.
4723         (__getcwd.c): Don't restore errno; glibc doesn't.
4724         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4725         first, falling back to our code only if its results look suspicious.
4726         Ensure that the resulting buffer is only as large as necessary.
4727
4728         * readutmp.c: Include readutmp.h first.
4729         Include <errno.h>, since readutmp.h no longer does that.
4730         * readutmp.h: Don't include <errno.h>,
4731         <sys/param.h>, <time.h>; not needed to establish interface.
4732         (errno): Remove decl.
4733         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4734         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4735         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4736
4737 2004-11-28  Simon Josefsson  <jas@extundo.com>
4738
4739         * base64.h, base64.c: New file.
4740
4741 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4742
4743         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4744
4745 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4746
4747         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4748         HP's ANSI C compiler.
4749         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4750         Declaring int functions causes warnings on some modern systems and
4751         shouldn't be needed to compile on ancient ones.
4752         * same.c (MIN) [defined MIN]: Don't define, since it's already
4753         defined.
4754
4755         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4756         with the following changes.
4757         (__set_errno): Parenthesize properly.
4758         Include <stdbool.h>.
4759         (MIN, MAX, MATCHING_INO): New macros.
4760         (__getcwd): Define with prototype, not K&R form.
4761         Use heuristics to allocate default buffer on stack if possible.
4762         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4763         behavior, and to avoid the PATH_MAX limit when computing
4764         ../../../../...
4765         Use MATCHING_INO to compare inode number to file.
4766         Check for arithmetic overflow in size calculations.
4767         Fix bug in reallocation of dot array that caused getcwd to fail
4768         on directories nested deeper than 75.
4769         Be more careful about saving errno on error.
4770         Do not use realloc; use only free+malloc, as this is a bit
4771         more flexible and avoids a needless copy operation.
4772         Do not inspect st_dev and st_ino for symbolic links; POSIX
4773         doesn't specify the latter.
4774         Check for closedir errors.
4775         Avoid needless casts.
4776         Use "#ifdef weak_alias" around weak_alias, to be like other
4777         glibc code.
4778         The following changes to getcwd.c have effect only when used in
4779         gnulib; they have no effect inside glibc proper.
4780         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4781         as alloca isn't used.
4782         (alloca, __alloca): Likewise.
4783         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4784         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4785         unconditionally, as gnulib assumes C89 or better.
4786         Do not include <sys/param.h>.
4787         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4788         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4789         better.
4790         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4791         Include <dirent.h> in a way that is compatible with modern Autoconf.
4792         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4793         New macros, if not already defined.
4794         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4795         Use "_LIBC", not "defined _LIBC", for consistency.
4796         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4797         a mempcpy module.
4798         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4799         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4800         * xgetcwd.c: David MacKenzie's old code was removed, so give
4801         credit only to Jim Meyering and adjust the copyright dates.
4802         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4803         <stdlib.h>, <unistd.h>, "pathmax.h".
4804         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4805         (INITIAL_BUFFER_SIZE): Remove.
4806         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4807
4808 2004-11-23  Jim Meyering  <jim@meyering.net>
4809
4810         * getopt_.h: Remove trailing blanks.
4811
4812 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4813
4814         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4815         (futimens): New function, which uses futimes if available.
4816         (futimens, utimens): Support timespec==NULL, with same semantics
4817         as utime and utimens.
4818         * utimens.h (futimens): New decl.
4819
4820 2004-11-23  Jim Meyering  <jim@meyering.net>
4821
4822         * __fpending.c: Add comment.
4823
4824 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4825
4826         * getopt_.h: Re-addition of __getopt_argv_const caused
4827         redefinition warnings. To avoid them, include the defines
4828         in `#if !defined __need_getopt ... #endif'. The only place
4829         where __getopt_argv_const is used is in definitions
4830         of getopt_long and getopt_long_only below, which are as well
4831         protected by `#ifndef __need_getopt'.
4832         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4833         __need_getopt after including <stdio.h> and <unistd.h> These
4834         headers might have defined it.
4835
4836 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4837
4838         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4839         New macros.
4840         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4841         optopt): Use them instead of invoking ## directly; otherwise, the
4842         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4843
4844 2004-11-19  Bruno Haible  <bruno@clisp.org>
4845
4846         * strtok_r.c: Move comments from here...
4847         * strtok_r.h: ... to here.
4848
4849 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4850
4851         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4852         might fail.  Problem reported by Yoann Vandoorselaere.
4853         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4854         that mishandle size_t overflow.
4855
4856 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4857
4858         * canon-host.c: Include "strdup.h".
4859         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4860         Use strdup instead of malloc/strcpy to duplicate strings.
4861
4862         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4863         (human_space_before_unit): New constant.
4864         * human.c (human_readable): Support it.
4865
4866         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4867         (xgetcwd): Set errno correctly when failing.
4868         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4869         the failure is actually due to a PATH_MAX problem.
4870
4871         Further getopt changes to make it more likely that glibc will
4872         buy the changes back.
4873         * getopt.c (POSIXLY_CORRECT): New constant.
4874         (getopt): Use it, so to preserve glibc semantic
4875         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4876         when compiling for libc.
4877         * getopt_.h (__getopt_argv_const): Bring it back.
4878         (getopt_long, getopt_long_only): Use it.
4879
4880         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4881         New arg POSIXLY_CORRECT.  All callers changed.
4882         (getopt): Argv is now char * const *, as per standard.
4883         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4884         not char *__getopt_argv_const *.
4885         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4886         _getopt_long_only_r): Likewise.
4887         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4888         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4889         _getopt_long_r, _getopt_long_only_r): Likewise.
4890         * getopt_.h (__getopt_argv_const): Remove.
4891         (getopt): Argv is now char * const *, as per standard.
4892
4893         * getdate.y (tORDINAL): New token.
4894         (day, relunit): Allow it for relative times.
4895         (relative_time_table): Use tORDINAL for ordinals.
4896
4897 2004-11-15  Jim Meyering  <jim@meyering.net>
4898
4899         * closeout.c: Include "__fpending.h" once again.
4900         Include <stdbool.h>.
4901         (close_stdout): Don't fail just because stdout was closed initially,
4902         since some programs don't write to stdout in the normal course of
4903         operation (other than --version and --help), and we don't want this
4904         function to make e.g. `touch file >&-' fail.
4905         But do fail if it was closed and someone has tried to write to it.
4906         E.g., `printf foo >&-' must fail.
4907
4908 2004-11-11  Simon Josefsson  <jas@extundo.com>
4909
4910         * strtok_r.h, strtok_r.c: New file.
4911
4912 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4913
4914         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4915         we can stop lying to compilers about the constness of argv when we
4916         are compiled outside glibc.
4917         (getopt, getopt_long, getopt_long_only): Use it.
4918         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4919         getopt): Likewise.
4920         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4921         _getopt_long_only_r): Likewise.
4922         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4923         _getopt_long_only_r): Likewise.
4924
4925         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4926         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4927         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4928         the other external symbols.
4929         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4930         declaration, since the above renaming now works around collisions.
4931
4932 2004-11-11  Jim Meyering  <jim@meyering.net>
4933
4934         * linebreak.c: Remove trailing blanks.
4935         * alloca_.h: Likewise.
4936         * acosl.c: Likewise.
4937         * euidaccess.c: Likewise.
4938         * allocsa.h: Likewise.
4939
4940 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4941
4942         * mktime.c (SHR): New macro, which is a portable
4943         substitute for >> that should work even on Crays.
4944         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4945         Problem reported by Mark D. Baushke in
4946         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4947         * getdate.y (SHR): Likewise.
4948         (tm_diff): Use it.
4949         * strftime.c (SHR): Likewise.
4950         (tm_diff): Use it.
4951         * quotearg.c (struct quoting_options): Use unsigned int for
4952         quote_these_too, so that right shifts are well defined.  All uses
4953         changed.
4954
4955 2004-11-10  Simon Josefsson  <jas@extundo.com>
4956
4957         * getaddrinfo.h, getaddrinfo.c: New files.
4958
4959 2004-11-10  Jim Meyering  <jim@meyering.net>
4960
4961         Ensure that no close failure goes unreported.
4962         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4963         return early when it seems there's nothing to flush.
4964         Don't include __fpending.h.
4965
4966 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4967
4968         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4969
4970 2004-11-05  Bruno Haible  <bruno@clisp.org>
4971
4972         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4973         Reported by Mark D. Baushke <mdb@cvshome.org>.
4974
4975 2004-11-04  Bruno Haible  <bruno@clisp.org>
4976
4977         2004-09-11  Bruno Haible  <bruno@clisp.org>
4978                 * allocsa.valgrind: New file.
4979         2004-02-06  Bruno Haible  <bruno@clisp.org>
4980                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4981                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4982                 Reported by Christopher Seip <chris.seip@hp.com>.
4983
4984 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4985
4986         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4987         with errno == ERANGE if the buffer is too small.
4988         Problem reported by Mark D. Baushke.
4989
4990 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4991
4992         * xreadlink.c (MAXSIZE): New macro.
4993         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4994         size does not exceed MAXSIZE.  Avoid cast.
4995         As suggested by Mark D. Baushke in
4996         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4997         if readlink fails with buffer size just under MAXSIZE, try again
4998         with MAXSIZE.
4999
5000 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5001         and  Paul Eggert  <eggert@cs.ucla.edu>
5002
5003         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5004         (get_date): Overparenthesize to avoid GCC warning.
5005
5006 2004-11-02  Bruno Haible  <bruno@clisp.org>
5007
5008         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5009         function returns void.
5010
5011 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5012
5013         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5014         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5015         already declared.
5016
5017 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5018
5019         * getdate.y: Add support for TZ="foo" within a date string.
5020         Fix some bugs near time_t boundaries.  Reject dates with
5021         out-of-range components, e.g., "Sept 31".
5022         Include <stdlib.h>, "setenv.h", "xalloc.h".
5023         (ISDIGIT_LOCALE): Remove; unused.
5024         Note that the TZ and time functions used here are not reentrant.
5025         (mktime_ok, get_tz): New functions.
5026         (TZBUFSIZE): New constant.
5027         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5028         This requires that we sometimes generate our own TZ="XXX..." setting.
5029
5030 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5031
5032         * mktime.c (not_equal_tm): Remove redundant check.
5033
5034 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5035
5036         * getdate.y: Use Bison 1.875 features, and some minor
5037         code cleanups.  This change does not affect semantics.
5038         Don't include <stdlib.h>; no longer needed.
5039         Don't include unlocked-io.h; only the "#if TEST" code uses
5040         stdio, and performance isn't crucial there.
5041         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5042         Bison 1.875 features as described below.
5043         All uses of "PC." replaced by "pc->".
5044         (YYSTYPE): Add a forward declaration.
5045         (yylex, yyerror): Use full prototypes in forward decls.
5046         Use "%pure-parser" rather than obsolescent "%pure_parser".
5047         Use %parse-param and %lex-param instead of obsolescent
5048         YYPARSE_PARAM and YYLEX_PARAM.
5049         (meridian_table, month_and_day_table, time_units_table,
5050         relative_time_table, time_zone_table, military_table,
5051         lookup_zone, lookup_word, get_date):
5052         Use NULL instead of 0 where appropriate.
5053         (to_hour): Avoid abort (), to avoid a dependency on
5054         stdlib.h.
5055         (yyerror, yylex): Now accepts parser_control * arg.
5056         (main) [TEST]: Use '\0' rather than 0 for char.
5057
5058 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5059
5060         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5061         It's now the caller's responsibility to handle the case where
5062         !HAVE_GETPAGESIZE && !defined getpagesize.
5063
5064         * mktime.c (leapyear): Arg is long int, not int.
5065
5066 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5067
5068         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5069
5070 2004-10-12  Simon Josefsson  <jas@extundo.com>
5071
5072         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5073         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5074         to real functions.
5075
5076 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5077
5078         * vsnprintf.h: New file.
5079         * vsnprintf.c: New file.
5080
5081 2004-10-07  Bruno Haible  <bruno@clisp.org>
5082
5083         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5084         into the provided buffer.
5085
5086 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5087
5088         * diacrit.c, diacrit.h: Add GPL notice.
5089
5090         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5091         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5092         * logl.c (logl): Keep the code as similar to glibc as possible.
5093         This avoids a potential constant-folding bug.
5094
5095 2004-10-05  Bruno Haible  <bruno@clisp.org>
5096
5097         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5098
5099 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5100
5101         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5102         * xmalloc.c (xmemdup): Likewise.
5103         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5104         XFREE): Remove these long-obsolescent macros.
5105         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5106         * xstrdup.c: Remove.
5107
5108         * regex.c (re_comp): Cast gettext return value to char *,
5109         Problem reported by Martin Neitzel via Mark D. Baushke.
5110
5111 2004-10-04  Simon Josefsson  <jas@extundo.com>
5112
5113         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5114         '#ifdef USE_UNLOCKED_IO'.
5115
5116 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5117
5118         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5119         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5120         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5121         regex.c, sha1.c, version-etc.c, yesno.c:
5122         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5123         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5124         the includer's responsibility.
5125
5126         Sync from coreutils.
5127
5128         * modechange.c (mode_compile): Don't decrement a pointer that
5129         points to the start of a string, as the C Standard says the
5130         resulting behavior is undefined.
5131
5132         * backupfile.h (enum backuptype): Rename none -> no_backups,
5133         simple -> simple_backups, numbered_existing ->
5134         numbered_existing_backups, numbered -> numbered_backups
5135         to avoid shadowing problems.  All uses changed.
5136         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5137         * backupfile.c (check_extension, numbered_backup):
5138         Rename locals to avoid shadowing 'basename'.
5139         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5140         once.
5141
5142         * .cppi-disable: Add getopt_.h, getopt_int.h.
5143         * .cvsignore: Add getopt.h.
5144
5145 2004-10-04  Simon Josefsson  <jas@extundo.com>
5146
5147         * memmem.h: New file.
5148         * memmem.c: New file, taken from glibc.
5149
5150 2004-10-02  Jim Meyering  <jim@meyering.net>
5151
5152         * dirfd.h, getpagesize.h: Add copyright notice.
5153
5154 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5155
5156         * snprintf.c: Remove comments as to why each header is needed.
5157
5158 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5159
5160         * strsep.h: New file.
5161         * strsep.c: New file.
5162
5163 2004-10-01  Simon Josefsson  <jas@extundo.com>
5164
5165         * snprintf.c (snprintf): Handle size==0.
5166
5167 2004-10-01  Simon Josefsson  <jas@extundo.com>
5168             Bruno Haible  <bruno@clisp.org>
5169
5170         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5171         (snprintf): Declare 'args'.
5172
5173 2004-09-30  Simon Josefsson  <jas@extundo.com>
5174
5175         * snprintf.h, snprintf.c: New files.
5176
5177 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5178
5179         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5180         (hol_entry_help): Never translate an empty string.
5181         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5182         * argp.h (OPTION_NO_TRANS): New option.
5183
5184 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5185
5186         * xvasprintf.c: Include xalloc.h.
5187         (xvasprintf): Use xalloc_die, not xmalloc_die.
5188
5189 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5190
5191         * dummy.c: Change copyright notice to FSF, and license to GPL.
5192
5193 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5194
5195         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5196         Problem reported by Bruno Haible in:
5197         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5198
5199 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5200
5201         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5202         in case some system header has #define'd it.  Problem reported by
5203         Soeren D. Schulze in
5204         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5205
5206 2004-09-08  Bruno Haible  <bruno@clisp.org>
5207
5208         * stdint_.h: New file, taken from GNU clisp.
5209
5210 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5211
5212         * xvasprintf.h: New file.
5213         * xvasprintf.c: New file.
5214         * xasprintf.c: New file.
5215
5216 2004-09-08  Bruno Haible  <bruno@clisp.org>
5217
5218         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5219         is > INT_MAX.
5220         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5221
5222 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5223
5224         Import from coreutils.
5225         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5226         strings on unbounded length.  alloca's performance benefits aren't
5227         that important here.
5228         (V_STRDUP): Remove.
5229         (parse_with_separator): New function, with most of the internals
5230         of the old parse_user_spec.  Allow user to omit both user and group,
5231         for compatibility with FreeBSD.
5232         Clone only the user name, not the entire spec.
5233         Do not set *uid, *gid unless entirely successful.
5234         Avoid memory leak in some failing cases.
5235         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5236         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5237         (parse_user_spec): Rewrite to use parse_with_separator.
5238
5239 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5240
5241         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5242         its complicated substitute.
5243         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5244         and program_invocation_name.
5245         (__argp_basename) [!_LIBC]: Remove; the only use was
5246         replaced by its body.
5247         (__argp_short_program_name): Change condition from
5248         !defined __argp_short_program_name to
5249         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5250         to match argp-namefrob.h.
5251         (__argp_failure): Don't assume strerror_r returns char *.
5252         * argp-parse.c (N_): Define unconditionally.
5253         (argp_default_options): Fill out initializers with 0 to avoid
5254         gcc warnings.
5255
5256 2004-08-12  Simon Josefsson  <jas@extundo.com>
5257
5258         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5259         * getopt_.h: Renamed from getopt.h.
5260
5261 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5262
5263         Merge from coreutils.
5264
5265         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5266         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5267         for Reliant Unix 5.43.
5268
5269         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5270         (union fooround): Use uintmax_t, not long int.
5271         The rest is a merge from libc:
5272         [defined _LIBC]: Include <shlib-compat.h>.
5273         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5274
5275         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5276
5277         * strverscmp.c: Convert to UTF-8.
5278
5279 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5280
5281         * obstack.h (obstack_empty_p):
5282         Don't assume that chunk->contents is suitably aligned.
5283         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5284         Likewise. Problem reported by Benno in
5285         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5286
5287         * chown.c (rpl_chown): Work even if the file is writeable but not
5288         readable.  This could be improved further but it'd take some work.
5289
5290 2004-08-08  Simon Josefsson  <jas@extundo.com>
5291
5292         * xgethostname.c: Don't include error.h (not used).
5293
5294         * getpass.h: Add.
5295         * getpass.c: Include getpass.h first.
5296
5297 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5298
5299         * xalloc-die.c: New files.
5300         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5301         All uses removed.
5302         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5303         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5304         (_, N_, xalloc_die): Move to xalloc-die.c.
5305         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5306         so that we needn't mess with xalloc_msg_memory_exhausted.
5307
5308         * sha1.h: Renamed from sha.h.
5309         (SHA1_H): Renamed from _SHA_H.
5310         (sha1_ctx): Renamed from sha_ctx.
5311         (sha1_init_ctx): Renamed from sha_init_ctx.
5312         (sha1_process_block): Renamed from sha_process_block.
5313         (sha1_process_bytes): Renamed from sha_process_bytes.
5314         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5315         (sha1_read_ctx): Renamed from sha_read_ctx.
5316         (sha1_stream): Renamed from sha_stream.
5317         (sha1_buffer): Renamed from sha_buffer.
5318         * sha1.c: Likewise; renamed from sha.c.
5319         Do not include <sys/types.h>.
5320         Include <stddef.h> rather than <stdlib.h>.
5321
5322 2004-08-08  Bruno Haible  <bruno@clisp.org>
5323
5324         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5325         FILESYSTEM_PREFIX_LEN.
5326         * progreloc.c: Likewise.
5327         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5328
5329 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5330
5331         Merge from tar.
5332         * argp-help.c (make_hol, hol_append): Don't assume that
5333         SIZE_MAX is a valid preprocessor constant.
5334         (__argp_basename): Change from "#ifndef _LIBC"
5335         to "#ifndef __argp_short_program_name", so that
5336         we don't compile these functions for tar.
5337
5338         More merges from coreutils.
5339         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5340         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5341         yesno.h: New files.
5342         * addext.c: Remove; no longer needed.
5343         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5344         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5345         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5346         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5347         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5348         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5349         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5350         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5351         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5352         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5353         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5354         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5355         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5356         Import changes from coreutils.
5357
5358 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5359
5360         Merge from coreutils.
5361
5362         * .gdb-history: Remove; this doesn't belong here.
5363
5364         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5365         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5366         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5367
5368         * dirname.h: Include <stdbool.h>.
5369         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5370         for consistency with POSIX terminology.  All uses changed.
5371         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5372         (strip_trailing_slashes): Use bool for booleans.
5373         * stripslash.c (strip_trailing_slashes): Likewise.
5374
5375         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5376         sometimes returns a positive errno value even when it succeeds.
5377         (print_errno_message) [!LIBC]: Fall back on strerror if
5378         __strerror_r fails.
5379
5380         * path-concat.c (mempcpy): Don't define if a system header defines it.
5381         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5382         (longest_relative_suffix): New function.
5383         (path_concat): Use it.  Assume first argument is not NULL.
5384         Port to DOS.  Omit redundant separators.
5385         Report an error instead of returning NULL.
5386         Use mempcpy instead of memcpy.
5387         (xpath_concat): Remove: not declared or used.
5388
5389         * same.h: Include <stdbool.h>
5390         (same_name): Return bool, not int.
5391         * same.c (same_name): Likewise.
5392         (errno): Don't declare; we assume C89 or better now.
5393
5394         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5395         if not already defined.
5396
5397         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5398         * dup-safer.c (errno): Likewise.
5399
5400 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5401
5402         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5403         working.
5404
5405 2004-08-03  Simon Josefsson  <jas@extundo.com>
5406
5407         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5408         * progname.h: Don't include stdbool.h.
5409
5410 2004-08-02  Simon Josefsson  <jas@extundo.com>
5411
5412         * getsubopt.h: New file, with comments from Bruno Haible.
5413         * getsubopt.c: New file, from glibc, but slightly modified based on
5414         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5415
5416 2004-08-01  Simon Josefsson  <jas@extundo.com>
5417
5418         * xgetdomainname.c: Include stdlib.h, for free().
5419
5420 2004-07-16  Simon Josefsson  <jas@extundo.com>
5421
5422         * dummy.c: New file.
5423
5424 2004-07-16  Bruno Haible  <bruno@clisp.org>
5425
5426         * backupfile.h: Add extern "C" for C++.
5427         * closeout.h: Likewise.
5428         * copy-file.h: Likewise.
5429         * findprog.h: Likewise.
5430         * full-write.h: Likewise.
5431         * pathname.h: Likewise.
5432         * progname.h: Likewise.
5433         * stpcpy.h: Likewise.
5434         * stpncpy.h: Likewise.
5435         * strcase.h: Likewise.
5436         * strstr.h: Likewise.
5437         * xalloc.h: Likewise.
5438
5439         * mbswidth.h: Add extern "C" for C++.
5440         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5441
5442 2004-07-09  Simon Josefsson  <jas@extundo.com>
5443
5444         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5445         failed without this.)
5446
5447 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5448
5449         * fchown-stub.c: New file.
5450
5451 2004-06-24  Jim Meyering  <jim@meyering.net>
5452
5453         * obstack.h (obstack_base): Cast to (void *), per documentation.
5454
5455 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5456
5457         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5458
5459 2004-06-01  Jim Meyering  <jim@meyering.net>
5460
5461         * calloc.c: New file.
5462
5463 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5464
5465         * getdate.y (yylex): Allow space between sign and number.
5466         Problem reported by Dan Jacobson.
5467
5468 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5469         and  Jim Meyering  <jim@meyering.net>
5470
5471         Merge from coreutils CVS.
5472
5473         * stat-macros.h: New file, with contents from file-type.h
5474         and coreutils' system.h.
5475         * file-type.c: Include "stat-macros.h".
5476         * file-type.h (file_type): Move all macro definitions to new file,
5477         stat-macros.h.
5478
5479         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5480         Wrap old code with this conditional.
5481         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5482         function that does not dereference symlinks.
5483         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5484
5485         * xreadlink.c: Include xreadlink.h first, to catch .h file
5486         dependency problems.
5487         (xreadlink): Accept new arg SIZE, for efficiency.
5488         All decls and uses changed.
5489         * xreadlink.h: Include <stddef.h>, for size_t.
5490
5491         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5492         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5493
5494         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5495
5496 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5497
5498         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5499         macros to be defined.
5500         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5501         the allocator returns NULL because the requested size is zero.
5502
5503 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5504
5505         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5506         var.  Add comment explaining why libc still defines it.  This
5507         merges the following patch from glibc:
5508         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5509
5510 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5511
5512         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5513         present in glibc since revision 1.1 of this file.
5514         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5515         obstack_alignment_mask, obstack_alloc, obstack_base,
5516         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5517         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5518         obstack_grow0, obstack_init, obstack_int_grow,
5519         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5520         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5521         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5522         nonexistent functions.
5523
5524 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5525             Paul Eggert  <eggert@cs.ucla.edu>
5526
5527         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5528
5529 2004-05-14  Bruno Haible  <bruno@clisp.org>
5530
5531         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5532         that consists of a '.' followed by an empty digit string.
5533         Patch by Tor Lillqvist <tml@iki.fi>.
5534
5535 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5536
5537         Port obstack to the AS/400, where pointers are 16 bytes wide and
5538         you cannot cast an integer to a valid pointer.  This patch is
5539         currently waiting to be integrated into glibc; see
5540         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5541
5542         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5543         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5544         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5545         (struct obstack): temp member is now a union of a pointer and
5546         an integer, instead of an integer.  All integer uses changed.
5547         This does not affect the physical layout of struct obstack,
5548         except on hosts (like the AS/400) where the size or alignment of
5549         void * is greater than that of ptrdiff_t.
5550         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5551         __STDC__)]: Store temporary in pointer member of union, not
5552         integer member.
5553         * obstack.c: Include <stddef.h>, for offsetof.
5554         (struct fooalign): Remove; it doesn't need a name.
5555         (union fooround): Change double to long double, and add void *.
5556         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5557         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5558         not a macro.  Hence the values are always int; so remove all
5559         casts-to-int in uses.
5560
5561 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5562             Derek Price  <derek@ximbiot.com>
5563
5564         * alloca.c: Include <alloca.h>, to get our interface.
5565         * alloca_.h: Use __alloca on AIX, so that we don't have to
5566         include <alloca.h> first.  Use C89 prototype for alloca; this
5567         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5568         Use #elif for simplicity, since we can assume C89 now.
5569         Don't try to source the system alloca.h since it will not be found
5570         and to prevent recursively including its replacement.
5571         * fnmatch.c: Include <alloca.h> instead of opencoding.
5572         * regex.c: Likewise.
5573
5574 2004-05-16  Derek Price  <derek@ximbiot.com>
5575             Paul Eggert  <eggert@cs.ucla.edu>
5576
5577         getline cleanup.  This changes the getndelim2 API: both order of
5578         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5579         no delimiter).
5580
5581         * getline.c: Don't include stddef.h or stdio.h, since our
5582         interface does that.
5583         (getline): Always use getdelim, so that we don't have two
5584         copies of this code.
5585         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5586         if available.
5587         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5588         (GETNDELIM2_MAXIMUM): New macro.
5589         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5590         instead of the old practice of delim2==0.  All callers changed.
5591         Return -1 on overflow, instead of returning junk.
5592         Do not set *linesize unless allocation succeeds.
5593         * getndelim2.h: Do not include stddef.h; no longer needed, now
5594         that we include sys/types.h.
5595         * getnline.h: Likewise.
5596         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5597         (getndelim2): Reorder arguments.
5598         * getnline.c (getnline, getndelim):
5599         Don't discard the NMAX argument.
5600         (getnline): Invoke getndelim, to avoid code duplication.
5601         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5602         of (size_t) -1 by callers of the getnline family.
5603
5604 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5605
5606         * nanosleep.c (suspended): Change its type from int to
5607         sig_atomic_t volatile.
5608         (first_call): Make it private to rpl_nanosleep, and have it
5609         be zero initially as that's a bit faster.
5610         (my_usleep): Round up fractional times instead of truncating them,
5611         as this is the usual meaning for 'sleep'.
5612
5613         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5614         doesn't work.
5615         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5616         (ENOSYS): Define if not defined.
5617         (settime): Fall back on stime if it exists and settimeofday fails.
5618         But don't bother with fallbacks if a method fails with errno == EPERM.
5619
5620 2004-05-11  Jim Meyering  <jim@meyering.net>
5621
5622         Prior to this change, the save_cwd caller required read access to the
5623         current directory on most systems (ones with the fchdir function).
5624
5625         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5626         fails, try write-only, and finally, resort to using xgetcwd.
5627
5628 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5629
5630         * obstack.c, obstack.h: Import changes from libc.
5631
5632 2004-04-28  Bruno Haible  <bruno@clisp.org>
5633
5634         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5635         implicitly appends .exe to executables.
5636         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5637         accepts Windows pathnames.
5638         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5639         Cygwin like Windows, since it now accepts Windows pathnames.
5640         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5641         Cygwin like Windows, since it now accepts Windows pathnames.
5642         Reported by Derek Robert Price <derek@ximbiot.com>.
5643
5644 2004-04-20  Jim Meyering  <jim@meyering.net>
5645
5646         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5647
5648 2004-04-20  Jim Meyering  <jim@meyering.net>
5649             Bruno Haible  <bruno@clisp.org>
5650
5651         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5652         memory when realloc fails.
5653
5654 2004-04-18  Jim Meyering  <jim@meyering.net>
5655
5656         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5657         don't leak memory and do call END_UTMP_ENT.
5658
5659 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5660
5661         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5662         (CHAR_BIT): Remove, since we assume C89.
5663         Include <stdint.h> if available, as per current Autoconf CVS advice.
5664
5665 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5666
5667         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5668         not bool, to be more consistent with Unix conventions.
5669         Suggested by Bruno Haible.
5670
5671         Merge from coreutils.
5672
5673         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5674         New files.
5675
5676         * getdate.h: Include stdbool.h, and timespec.h instead of
5677         the usual <time.h> dance.
5678         (get_date): Change signature to support fractional time stamps.
5679         All callers changed.
5680         * getdate.y: Include "getdate.h" first, as we can now
5681         assume C89 and don't need to worry about 'const'.
5682         Similarly, include "unlocked-io.h" near start, not in middle.
5683         Include <limits.h>.
5684         (textint.value): Use long int rather than int.
5685         (textint.digits): Use size_t rather than int.
5686         (BILLION, LOG10_BILLION): New constants.
5687         (parser_control): New member rel_ns.  Members day_ordinal,
5688         time_zone, month, day, hour, minutes, rel_year, rel_month,
5689         rel_day, rel_hour, rel_minutes, rel_seconds
5690         are now long int, not int.  Member seconds is now struct timespec,
5691         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5692         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5693         not int.
5694         (%union.intval): Now long int, not int.
5695         New member timespec.
5696         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5697         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5698         (spec): Now is a timespec or an item list.
5699         (timespec, items): New nonterminals.
5700         (time, rel, relunit, number, get_date):
5701         Add support for fractional seconds.
5702         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5703         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5704         (to_hour): First arg is now long int, not int.
5705         (to_year): Returns long int, not int.
5706         Don't treat year -70 like 70.
5707         (tm_diff): Returns long int, not int.
5708         (lookup_word): Use bool instead of int when appropriate.
5709         (yylex): Use size_t for count, not int.
5710         Detect overflow when parsing large integer constants.
5711         Add support for fractions.
5712         (get_date): Make pointers 'const' if possible.
5713         Use more-portable code to detect integer overflow.
5714         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5715         Don't use ctime; it's not reliable if the year has >4 digits.
5716
5717         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5718         This is for compatibility with BSD.
5719
5720         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5721         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5722         From coreutils' system.h.
5723
5724         * userspec.c: Don't include "posixver.h".
5725         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5726         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5727         compatible extension.  Simplify code by removing a boolean int
5728         that was always nonzero if a string was nonnull.
5729
5730 2004-03-30  Jim Meyering  <jim@meyering.net>
5731
5732         Merge from coreutils.
5733
5734         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5735
5736         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5737         an empty input stream.
5738
5739         * readtokens.c: Include <stdbool.h>.
5740         (readtoken): Use `size_t' rather than int/long.
5741         All callers adjusted.
5742         Use `bool' rather than `int' where appropriate.
5743         Use memset rather than an explicit loop.
5744         Use x2nrealloc rather than xrealloc.
5745         Allow the use of `\0' as a delimiter.
5746         (readtokens): Likewise.
5747         * readtokens.h (readtoken, readtokens): Update prototypes.
5748
5749 2004-03-30  Bruno Haible  <bruno@clisp.org>
5750
5751         * getloadavg.c (getloadavg): Don't assume setlocale returns
5752         nonnull.
5753
5754 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5755
5756         Merge changes to getloadavg.c from coreutils and Emacs.
5757
5758         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5759         Define to an expression, not to the empty string.
5760         Include cloexec.h and xalloc.h.
5761         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5762         Use set_cloexec_flag rather than rolling our own.
5763         * cloexec.c, cloexec.h: New files.
5764
5765 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5766
5767         * getopt.h: Sync with libc CVS.
5768
5769 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5770             Bruno Haible  <bruno@clisp.org>
5771
5772         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5773         not on all platforms that have <wchar.h>.
5774         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5775
5776 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5777
5778         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5779         Sync with libc CVS.
5780         * getopt_int.h: New file, also synced from libc.
5781
5782 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5783
5784         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5785         '#if' expressions.  Unlike the code it replaces, it does not
5786         depend on (defined _SC_PAGESIZE).  However, it does depend on
5787         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5788         first reported by Jason Andrade in
5789         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5790
5791 2004-01-18  Simon Josefsson  <jas@extundo.com>
5792
5793         * strdup.h: New file.
5794         * strdup.c: Include it.
5795         * path-concat.c: Include strdup.h. Drop strdup declaration.
5796         * userspec.c: Include strdup.h. Drop strdup declaration.
5797
5798 2004-02-06  Karl Berry  <karl@gnu.org>
5799
5800         * config.charset: update from gettext 0.14.1.
5801
5802 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5803
5804         Add comments and code, prompted by suggestions from Bruno Haible
5805         for sh-quote.
5806         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5807         describing the enum quoting_style values.
5808         * quotearg.c (quotearg_alloc): New function.
5809         (quotearg_buffer_restyled): Treat lone { and } as special.
5810         Treat = as special.  Work around bug with older shells
5811         that "see" a '\' that is really the 2nd byte of a multibyte char.
5812         Quote empty string with shell_quoting_style.
5813
5814 2004-02-03  Bruno Haible  <bruno@clisp.org>
5815
5816         * pipe.h: New file, from GNU gettext.
5817         * pipe.c: New file, from GNU gettext.
5818
5819 2004-01-27  Bruno Haible  <bruno@clisp.org>
5820
5821         * execute.h: New file, from GNU gettext.
5822         * execute.c: New file, from GNU gettext.
5823         * w32spawn.h: New file, from GNU gettext.
5824
5825 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5826
5827         Exit-status fix from coreutils.
5828
5829         Use exit_failure consistently in place of EXIT_FAILURE,
5830         so that program exit statuses are consistent on failure.
5831
5832         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5833         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5834         * argmatch.h: Comment fix to match the above.
5835         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5836         Now a macro referring to exit_failure, instead of a separate
5837         variable.  Include "exitfail.h" to get it.
5838         * xstrtol.h: Include "exitfail.h".
5839         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5840
5841         * long-options.c (parse_long_options): Use prototype
5842         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5843         for clarity.
5844
5845 2004-01-21  Jim Meyering  <jim@meyering.net>
5846
5847         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5848         so as not to conflict with a different-sized __mktime_internal
5849         function in GNU libc.
5850         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5851         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5852
5853 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5854
5855         Merge from diffutils.
5856
5857         * file-type.c (file_type): Add typed memory objects.
5858         * file-type.h (S_TYPEISTMO): New macro.
5859
5860         * c-stack.h (c_stack_action): Remove argv argument.
5861         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5862         (die): Don't calculate message unless segv_action returns.
5863         (get_stack_location, min_address_from_argv, max_address_from_argv,
5864         volatile stack_base, volatile_stack_size): Remove.
5865         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5866         that every segmentation violation is a stack overflow.  (Ouch!)
5867         See Debian bug 136249 (still outstanding) for more info about why
5868         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5869
5870 2003-11-30  Bruno Haible  <bruno@clisp.org>
5871
5872         Safer stack allocation.
5873         * setenv.c: Include allocsa.h.
5874         (alloca): Remove fallback definition.
5875         (freea): Remove macro.
5876         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5877         instead of freea.
5878
5879 2003-10-17  Bruno Haible  <bruno@clisp.org>
5880
5881         * binary-io.h: Avoid warnings on Cygwin.
5882
5883 2003-12-28  Bruno Haible  <bruno@clisp.org>
5884
5885         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5886         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5887
5888 2003-11-28  Bruno Haible  <bruno@clisp.org>
5889
5890         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5891
5892 2003-11-27  Bruno Haible  <bruno@clisp.org>
5893
5894         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5895
5896 2003-11-17  Bruno Haible  <bruno@clisp.org>
5897
5898         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5899
5900 2003-11-24  Bruno Haible  <bruno@clisp.org>
5901
5902         * xallocsa.h: New file, from GNU gettext.
5903         * xallocsa.c: New file, from GNU gettext.
5904
5905 2003-11-24  Bruno Haible  <bruno@clisp.org>
5906
5907         * allocsa.h: New file, from GNU gettext.
5908         * allocsa.c: New file, from GNU gettext.
5909
5910 2003-11-24  Bruno Haible  <bruno@clisp.org>
5911
5912         * eealloc.h: New file.
5913
5914 2004-01-15  Jim Meyering  <jim@meyering.net>
5915
5916         Merge from coreutils.
5917
5918         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5919         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5920         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5921
5922         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5923         optional configure-time default.
5924
5925         * version-etc.c (version_etc_copyright): Update copyright date.
5926
5927         * xreadlink.c (xreadlink): Correct outdated comment.
5928
5929 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5930
5931         Merge from coreutils.
5932
5933         * posixver.c: Include posixver.h.
5934
5935         * same.c: Include <stdbool.h>, <limits.h>.
5936         (_POSIX_NAME_MAX): Define if not defined.
5937         (MIN): New macro.
5938         (same_name): If file names are silently truncated, report
5939         that the file names are the same if they are the same after
5940         the silent truncation.
5941
5942         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5943         conversion function.
5944         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5945         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5946         longer needed.
5947
5948 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5949
5950         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5951         with like-named macro in fnmatch.c.
5952         (EXT): Use an internal constant instead.
5953
5954         Merge fnmatch patches from glibc.
5955         * fnmatch.c (mbsinit): Remove define.
5956         Add libc_hidden_ver (__fnmatch, fnmatch).
5957         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5958         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5959
5960 2003-12-14  Karl Berry  <karl@gnu.org>
5961
5962         * config.charset: update from gettext-runtime.
5963
5964 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5965
5966         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5967         Bug reported by Alfred M. Szmidt.
5968
5969 2003-11-29  Karl Berry  <karl@gnu.org>
5970
5971         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5972
5973 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5974             Bruno Haible  <bruno@clisp.org>
5975
5976         * printf-parse.h: Don't include sys/types.h.
5977         (ARG_NONE): New macro.
5978         (char_directive): Change type of *arg_index fields to size_t.
5979         * printf-parse.c: Don't include sys/types.h.
5980         (SSIZE_MAX): Remove macro.
5981         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5982         Remove unnecessary overflow check.
5983         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5984         fields.
5985
5986 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5987
5988         * alloca.c: Remove dependency on xalloc module.
5989         (xalloc_die): Remove.
5990         (memory_full) [!defined emacs]: New macro.
5991         [!defined emacs]: Don't include xalloc.h.
5992         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5993         address arithmetic overflows.  Change datatypes a bit to avoid
5994         unnecessary casts.
5995
5996 2003-11-22  Jim Meyering  <jim@meyering.net>
5997
5998         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5999
6000 2003-11-17  Bruno Haible  <bruno@clisp.org>
6001
6002         * vasnprintf.c (alloca): Remove fallback definition.
6003         (freea): Remove definition.
6004         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6005         Reported by Paul Eggert.
6006
6007 2003-11-17  Jim Meyering  <jim@meyering.net>
6008
6009         On systems without utime and without a utimes function capable of
6010         dealing with a NULL struct utimbuf* argument, this utime replacement
6011         could -- in unusual circumstances -- leak a file descriptor.
6012         * utime.c: Include <unistd.h> and <errno.h>.
6013         (utime_null): Be sure to close `fd' and to preserve errno.
6014         Reported by Geoff Collyer via Arnold Robbins.
6015
6016 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6017             Bruno Haible  <bruno@clisp.org>
6018
6019         Protect against address arithmetic overflow.
6020         * printf-args.h: Include stddef.h.
6021         (arguments): Change type of field 'count' to size_t.
6022         * printf-args.c (printf_fetchargs): Use size_t instead of
6023         'unsigned int' where appropriate.
6024         * printf-parse.h: Include sys/types.h.
6025         (char_directive): Change type of *arg_index fields to ssize_t.
6026         (char_directives): Change type of fields 'count', max_*_length to
6027         size_t.
6028         * printf-parse.c: Include sys/types.h and xsize.h.
6029         (SSIZE_MAX): Define fallback value.
6030         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6031         instead of 'int' where appropriate. Check a_allocated, d_allocated
6032         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6033         * vasnprintf.c: Include xsize.h.
6034         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6035         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6036         overflow. Avoid wraparound when converting a width or precision from
6037         decimal to binary.
6038
6039 2003-11-16  Bruno Haible  <bruno@clisp.org>
6040
6041         Update from GNU gettext.
6042         * printf-parse.c: Generalize to it can be compiled for wide strings.
6043         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6044         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6045         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6046         SNPRINTF): New macros.
6047         Don't include <alloca.h> if the file is used inside libintl.
6048         (local_wcslen): New function, for Solaris 2.5.1.
6049         (VASNPRINTF): Use it instead of wcslen.
6050
6051 2003-11-16  Bruno Haible  <bruno@clisp.org>
6052
6053         * xsize.h (xmax): New function.
6054         (xsum, xsum3, xsum4): Declare as "pure" functions.
6055
6056 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6057
6058         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6059         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6060         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6061         heuristic is just as accurate as far as we know, and it removes a
6062         dependency on size_max.m4 and ptrdiff_max.m4.
6063
6064 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6065
6066         * xstrtol.c (__xstrtol): Remove "break" immediately after
6067         "return", to pacify some unknown compiler.  Problem reported
6068         by Joerg Schilling.
6069
6070 2003-11-11  Bruno Haible  <bruno@clisp.org>
6071
6072         * xsize.h (SIZE_MAX): Remove fallback definition.
6073         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6074         defined.
6075
6076 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6077
6078         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6079         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6080         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6081         From Bruno Haible.
6082         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6083         not (size_t) -1, since it's defined here.
6084
6085 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6086
6087         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6088         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6089         Reject sizes of exactly SIZE_MAX bytes.
6090         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6091         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6092
6093 2003-11-05  Bruno Haible  <bruno@clisp.org>
6094
6095         * xsize.h: Include limits.h, to avoid a possible collision with
6096         SIZE_MAX defined in <limits.h> on Solaris.
6097
6098 2003-11-04  Bruno Haible  <bruno@clisp.org>
6099
6100         * xsize.h: New file.
6101         * linebreak.c: Include xsize.h.
6102         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6103         argument for overflow.
6104         Suggested by Paul Eggert.
6105
6106 2003-10-31  Bruno Haible  <bruno@clisp.org>
6107
6108         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6109         to avoid (extremely rare) race condition.
6110         Suggested by Paul Eggert.
6111
6112 2003-11-03  Jim Meyering  <jim@meyering.net>
6113
6114         * userspec.c: Include "userspec.h".
6115         * userspec.h: New file.
6116
6117 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6118
6119         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6120         * mountlist.c (SIZE_MAX): Define if not defined already.
6121         (read_filesystem_list): Set and use me_type_malloced.
6122         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6123         whatever the type happens to be), for brevity and consistency.
6124         Check for size calculation overflow on Alphas running OSF/1.
6125
6126 2003-10-31  Jim Meyering  <jim@meyering.net>
6127
6128         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6129
6130         * linebuffer.c: Include <string.h> for declaration of memset.
6131
6132 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6133             Bruno Haible  <bruno@clisp.org>
6134
6135         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6136         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6137
6138 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6139
6140         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6141         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6142         no longer needed.
6143         * quotearg.c (quotearg_n_options): Use it.
6144         * group-member.c: Include <stdbool.h>.
6145         (free_group_info): Arg is now const *; don't free arg.
6146         (get_group_info): Now returns bool and accepts struct group_info *,
6147         rather than returning a malloc'ed struct group_info *.
6148         All uses changed.  Check for overflow in internal size calculation.
6149
6150         * getusershell.c (readname): Simplify the code by using x2nrealloc
6151         rather than xmalloc/xrealloc.
6152         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6153         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6154         conformance bug: the old code used a pointer after freeing the
6155         storage that it addressed.
6156         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6157         rather than doing it by hand.
6158         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6159         the buffer preserved.  Use free and xmalloc instead.
6160         * quotearg.c (quotearg_n_options): Likewise.
6161         Use a simpler test for size overflow.  Don't use xalloc_oversized
6162         because unsigned int might be wider than size_t (!); this suggests
6163         that we should switch from unsigned int to size_t for slot numbers.
6164
6165 2003-10-27  Bruno Haible  <bruno@clisp.org>
6166
6167         * stdbool_.h: Better support for BeOS.
6168
6169 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6170
6171         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6172         to allocate the returned structure.  Do not allocate a subarray,
6173         as x2nrealloc will do that.
6174         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6175         instead of xnrealloc.
6176         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6177
6178 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6179
6180         * xalloc.h (xalloc_oversized): New static inline function, for
6181         callers that want to do their own size-overflow checking.  Include
6182         <stdbool.h>, since xalloc_oversized returns bool.
6183         * xalloc.c (array_size_overflow): Remove.  All callers changed
6184         to use xalloc_oversized.
6185
6186         Add two functions x2realloc, x2nrealloc, for programs that grow
6187         arrays dynamically by doubling their sizes.
6188         * xalloc.h (x2realloc, x2nrealloc): New decls.
6189         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6190         New functions.
6191
6192         Port to C99 semantics for 'inline' of external functions.
6193         Bug reported by Bruno Haible.
6194         * xmalloc.c (xnmalloc_inline): New static inline function,
6195         with the old contents of xnmalloc.
6196         (xnmalloc, xmalloc): Use it.
6197         (xnrealloc_inline): New static inline function,
6198         with the old contents of xnrealloc.
6199         (xnrealloc, xrealloc): Use it.
6200
6201         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6202
6203 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6204
6205         Fix several address-calculation bugs in the hash modules,
6206         plus some minor code cleanup.
6207
6208         * hash.h: Include <stdbool.h>, for bool.
6209         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6210         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6211         hash_get_n_entries, hash_get_max_bucket_length,
6212         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6213         hash_rehash): Use size_t rather than unsigned.
6214         * hash.c (struct hash_table, hash_get_n_buckets,
6215         hash_get_n_buckets_used, hash_get_n_entries,
6216         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6217         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6218         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6219         Likewise.
6220         (SIZE_MAX): Define if not defined.
6221         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6222         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6223         hash_print):
6224         Use const * when possible.
6225         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6226         (check_tuning): Fix bug: if tuning parameters were very close to
6227         0 or 1, rounding errors could have caused subscript violations.
6228         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6229         (hash_initialize): Add 'fail:' label
6230         to free table and return NULL, and use it to simplify code.
6231         Use calloc rather than clearing the storage ourself.
6232         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6233         buffer size calculations.
6234         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6235         Include <stddef.h>, for size_t.
6236         * hash-pjw.c (hash_pjw): Likewise.
6237         Switch to method described by Bruno Haible.
6238         Include <limits.h>, for CHAR_BIT.
6239         (SIZE_BITS): New macro.
6240
6241 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6242
6243         * getndelim2.c (getndelim2): When size calculation overflows,
6244         ceiling the allocation at NMAX bytes rather than silently
6245         discarding input bytes before NMAX is reached.  This makes
6246         a difference only if NMAX exceeds SIZE_MAX / 2.
6247
6248         * obstack.c: Merge from glibc.
6249         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6250         Add libc_hidden_def (_obstack_newchunk).
6251         (_obstack_free) [! defined _LIBC]: Remove.
6252         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6253         a clone of the function body.
6254         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6255         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6256
6257         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6258         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6259         arg to memcpy.
6260
6261         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6262         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6263         Don't use lvalue casts, as GCC plans to remove support for them
6264         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6265         was also present in the non-GCC version, indicating that this
6266         code had always been buggy and had never been widely used.
6267         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6268         Use the fast variant of each macro, rather than copying the
6269         definiens of the fast variant; that way, we'll be more likely to
6270         catch future bugs in the fast variants.
6271
6272 2003-10-20  Bruno Haible  <bruno@clisp.org>
6273
6274         * wait-process.h: New file, from GNU gettext.
6275         * wait-process.c: New file, from GNU gettext.
6276
6277 2003-10-19  Jim Meyering  <jim@meyering.net>
6278
6279         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6280
6281 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6282
6283         * getgroups.c: Include <errno.h>, <stdlib.h>.
6284         (getgroups): First arg is int, not size_t.
6285         Don't let 'free' mangle errno.
6286
6287 2003-10-16  Jim Meyering  <jim@meyering.net>
6288
6289         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6290
6291 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6292
6293         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6294         (SIZE_MAX): Remove.
6295         (new_exclude, add_exclude_file): Initial size no longer needs to
6296         be a power of 2.
6297         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6298         our own address arithmetic overflow checking.
6299
6300         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6301         (fnmatch): Do not alloca more than 2000 wide characters;
6302         instead, use malloc for large buffers.
6303         Check for address arithmetic overflow, and return -1
6304         with errno set to ENOMEM in that case.
6305         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6306         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6307         instead, return -1.  Check for address arithmetic overflow.
6308
6309 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6310
6311         Handle invalid suffixes and overflow independently, so that
6312         callers can treat them independently as needed.  Fix some bugs in
6313         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6314         suffix for a human-readable blocksize.  The major caller-visible
6315         change is the addition of a new
6316         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6317         that both overflow and suffix chars were found.
6318
6319         * human.c (humblock): Don't check separately for invalid suffix
6320         char; that is xstrtoumax's job (now that its bug is fixed).
6321         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6322         INTMAX_MAX]: New macros.
6323         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6324         TYPE_MAXIMUM): New macros.
6325         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6326         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6327         if overflow occurs, as it's what __strtol does and it's more useful
6328         in practice.
6329         (__xstrtol): If __strtol reports some error other than ERANGE,
6330         reflect it to the caller as LONGINT_INVALID.  If it reports
6331         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6332         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6333         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6334         value.
6335         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6336         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6337         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6338         [defined UINTMAX_MAX]: New macros.
6339
6340 2003-10-14  Bruno Haible  <bruno@clisp.org>
6341
6342         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6343         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6344         Also use volatile where needed.
6345
6346 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6347
6348         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6349         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6350         and define in terms of the other primitives.
6351         * xmalloc.c: Include stdbool.h; do not include exit.h.
6352         (SIZE_MAX): Define if not already defined.
6353         (array_size_overflow): New function.
6354         (xalloc_die): Abort instead of exiting if 'error' returns.
6355         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6356         (xmalloc, xrealloc): Use them.
6357         (xcalloc): Check for address arithmetic overflow.
6358         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6359         a bit faster than strcpy.
6360
6361 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6362
6363         Merge getpass from libc, plus a few fixes.
6364
6365         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6366         Include <stdbool.h>.
6367         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6368         __fsetlocking to empty.
6369         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6370         do include <bits/libc-lock.h>.
6371         Do not include <fcntl.h>; not needed.
6372         [_LIBC]: Include <wchar.h>.
6373         (NOTCANCEL_MODE): New macro.
6374         (flockfile, funlockfile) [_LIBC]: New macros.
6375         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6376         [!_LIBC]: New macros.
6377         (call_fclose): New function.
6378         (getpass): Use it.  Save tty stream separately; this simplifies the
6379         code and makes it more reliable if stdin happens to equal stdout.
6380         Invoke __fsetlocking on tty.
6381         Handle thread cancellation if needed.
6382         Namespace cleanup (use __tcgetattr, __getline).
6383         Use bool for Booleans.
6384         [USE_IN_LIBIO]: Handle wide streams.
6385         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6386         stream might go where.
6387
6388         * unlocked-io.h: Include <stdio.h>, so that the caller
6389         doesn't have to include <stdio.h> before us.
6390         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6391         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6392         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6393         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6394         if not declared, so that we can use getpass.c code from libc without
6395         rewriting it.
6396         (flockfile, ftrylockfile, funlockfile): New macros.
6397
6398 2003-10-06  Bruno Haible  <bruno@clisp.org>
6399
6400         * version-etc-2.h: Remove file.
6401         * version-etc-2.c: Remove file.
6402
6403 2003-09-25  Jim Meyering  <jim@meyering.net>
6404             Bruno Haible  <bruno@clisp.org>
6405
6406         This lets translators provide better translations for the
6407         "Written by ..." part of --version output.
6408         * version-etc.h: Include stdarg.h.
6409         (version_etc_copyright): Declare as readonly.
6410         (version_etc): Make this function variadic with a NULL-terminated list
6411         of author name strings.
6412         (version_etc_va): New declaration.
6413         * version-etc.c: Include stdarg.h, stdlib.h.
6414         (version_etc_copyright): Declare as readonly.
6415         (version_etc_va): New function. Provide a different translatable string
6416         for each possible number of authors < 10. Abbreviate when there are 10
6417         authors or more.
6418         (version_etc): Make this function variadic. Call version_etc_va.
6419         Suggestion from Gary V. Vaughan.
6420
6421         * long-options.h (parse_long_options): Change prototype: the authors
6422         string is moved to the end and becomes variadic.
6423         * long-options.c: Include stdarg.h.
6424         (parse_long_options): Make this function variadic, too.
6425         Call version_etc_va, not version_etc.
6426
6427 2003-10-06  Bruno Haible  <bruno@clisp.org>
6428
6429         * fatal-signal.h: New file, from GNU gettext.
6430         * fatal-signal.c: New file, from GNU gettext.
6431
6432 2003-10-04  Karl Berry  <karl@gnu.org>
6433
6434         * argp*: update from libc.
6435
6436 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6437
6438         * getpass.c (getpass): Use a no-op fseek when switching from input to
6439         output mode on the same stream.
6440
6441 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6442
6443         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6444         Fix arg typo in previous patch.
6445
6446 2003-09-28  Jim Meyering  <jim@meyering.net>
6447
6448         * error.c: Correct cpp indentation.
6449
6450 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6451
6452         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6453         Omit the special code that used __typeof__, since we worry that
6454         it could be more trouble than it's worth.  See:
6455         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6456         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6457
6458         * free.c: New file.
6459
6460 2003-09-26  Jim Meyering  <jim@meyering.net>
6461
6462         * error.c (error_tail): Move some declarations
6463         into inner scope where the local variables are used.
6464
6465 2003-09-26  Bruno Haible  <bruno@clisp.org>
6466
6467         * stpncpy.h (gnu_stpncpy): New declaration.
6468         (stpncpy): Define as alias for gnu_stpncpy.
6469         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6470
6471 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6472
6473         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6474         (error_tail): Do not loop, reallocating temporary buffer, since
6475         the output cannot contain more wide characters than the input
6476         contains bytes, the size must be big enough already.  This avoids
6477         one potential size overflow calculation.  Check for size overflow
6478         when calculating temporary buffer size.  Free temporary buffer
6479         when done, if it was allocated with malloc; this plugs a memory
6480         leak.  Remove casts from void * to pointers, that are no longer
6481         needed now that we're assuming C89 or better.
6482
6483         Merge error changes from glibc.
6484
6485         * error.c, error.h: Update copyright notice header to match glibc.
6486         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6487         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6488         Disable cancellation while printing error.
6489         * error.h: Prepend __ to parameter names.
6490
6491 2003-09-25  Karl Berry  <karl@gnu.org>
6492
6493         * argp-fmtstream.c, argp-help.c: update from libc.
6494
6495 2003-09-25  Bruno Haible  <bruno@clisp.org>
6496
6497         * version-etc-2.h: New file, from version-etc.h with modifications.
6498         * version-etc-2.c: New file, from version-etc.c with modifications.
6499
6500 2003-09-25  Simon Josefsson  <jas@extundo.com>
6501
6502         * xgetdomainname.h: New file.
6503         * xgetdomainname.c: New file.
6504
6505 2003-09-25  Simon Josefsson  <jas@extundo.com>
6506             Bruno Haible  <bruno@clisp.org>
6507
6508         * getdomainname.h: New file.
6509         * getdomainname.c: New file.
6510
6511 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6512
6513         * linebuffer.c (freebuffer): Don't free the argument, just
6514         the buffer associated with the argument.  Bug reported by
6515         Simon Josefsson.
6516
6517 2003-09-19  Karl Berry  <karl@gnu.org>
6518
6519         * argp.h: update from libc.
6520
6521 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6522
6523         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6524         input error, instead of returning NULL the next time we are called
6525         (and therefore losing track of errno).
6526
6527 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6528
6529         * getndelim2.c (getndelim2): Don't trash errno when a read
6530         fails, so that the caller gets the proper errno.
6531
6532         * readutmp.c (read_utmp): Likewise.
6533         Check for fstat error.  Close stream and free storage
6534         when failing.
6535
6536 2003-09-14  Bruno Haible  <bruno@clisp.org>
6537
6538         * fwriteerror.h: New file.
6539         * fwriteerror.c: New file.
6540
6541 2003-09-14  Jim Meyering  <jim@meyering.net>
6542
6543         * getloadavg.c: Correct cpp indentation.
6544         * strdup.c: Likewise.
6545         * vasnprintf.c: Likewise.
6546
6547 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6548
6549         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6550         * obstack.c [!defined _LIBC]: Likewise.
6551         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6552         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6553         * exitfail.c: Don't include stdlib.h; no longer needed.
6554
6555         More changes to assume C89 or better.
6556
6557         * error.c (error_tail): Assume vprintf.
6558
6559         * argmatch.c (getenv): Remove decl.
6560         * progreloc.c (get_full_program_name): Define via prototype.
6561         * setenv.c (clearenv): Likewise.
6562         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6563         needed.
6564         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6565         (malloc, memcpy): Remove decls.
6566         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6567         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6568         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6569         (memcpy): Remove macro.
6570         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6571         (__P): Remove.  All uses removed.
6572         (PTR): Remove.  All uses changed to void *.
6573         (CHAR_BIT, NULL): Remove.
6574         (spaces, zeros, memset_space, memset_zero)
6575         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6576         Remove.
6577         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6578         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6579         Define with prototype.
6580         Remove now-unnecessary prototype decl.
6581         (extra_args_spec): Assume ANSI C.  All uses changed.
6582         (extra_args_spec_iso): Remove.
6583         (my_strftime, emacs_strftimeu): Define via prototype.
6584         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6585         unconditionally.
6586         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6587         * strtoimax.c: Include <stdlib.h> unconditionally.
6588         (strtoul, strtol): Remove decls.
6589         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6590         LONG_MAX): Remove.
6591         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6592         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6593         (LOCALE_PARAM_PROTO): New macro.
6594         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6595         (INTERNAL (strtol), strtol): Define with a prototype.
6596         (PARAMS): Remove.  All uses removed.
6597         * tempname.c: Include <string.h> unconditionally.
6598         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6599         * xgethostname.c (main): Define with a prototype.
6600         * xmalloc.c: Include "xalloc.h" first, to check interface.
6601         Include <stdlib.h> unconditionally.
6602         (calloc, malloc, realloc, free): Remove decls.
6603         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6604         Include <stdlib.h> unconditionally.  Sort include file names.
6605         (strtod): Remove.
6606         (xstrtod): Define with a prototype.
6607         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6608         (strtol, strtoul): Remove decls.
6609
6610 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6611
6612         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6613         Include <stdlib.h>, <string.h> unconditionally.
6614         Remove now-unnecessary cast to char *.
6615         * strnlen.c: Include <string.h> unconditionally.
6616         * yesno.c (yesno): Define with a prototype.
6617
6618 2003-09-10  Bruno Haible  <bruno@clisp.org>
6619
6620         * strcspn.c: Include <string.h> unconditionally.
6621         * strpbrk.c: Include <string.h> unconditionally.
6622         * strstr.c: Include <string.h> unconditionally.
6623         * unicodeio.c: Include <string.h> unconditionally.
6624         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6625         * unsetenv.c: Likewise.
6626         * xreadlink.c: Include <stdlib.h> unconditionally.
6627         * yesno.c: Include <stdlib.h> unconditionally.
6628         (rpmatch): Add prototype.
6629
6630 2003-09-10  Jim Meyering  <jim@meyering.net>
6631
6632         * error.c: Correct indentation of cpp directives.
6633
6634 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6635
6636         More K&R removal.
6637
6638         * acosl.c (main): Use a prototype.
6639         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6640         tanl.c: Likewise.
6641
6642         * getloadavg.c (getloadavg, main): Define via prototypes.
6643
6644         * getopt.h (struct option.name): Assume C89, and use 'const'.
6645         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6646         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6647         with a prototype.
6648         * getopt.c (const): Remove macro.
6649         Include <string.h> unconditionally.
6650         (my_index): Remove; all uses changed to strchr.
6651         (strlen): Remove decl.
6652         (exchange): Remove forward decl; no longer needed.
6653         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6654         Define with prototype.
6655         * getopt1.c (const): Remove macro.
6656         (getopt_long, getopt_long_only, main): Define with prototype.
6657
6658         * getugroups.c: Include <string.h> unconditionally.
6659
6660         * getusershell.c: Include <stdlib.h> unconditionally.
6661         (getusershell, setusershell, endusershell, readname, main):
6662         Define with prototypes.
6663
6664         * group-member.c: Include group-member.h first.
6665         Include <stdlib.h> unconditionally.
6666
6667         * hard-locale.c: Include hard-locale.h first.
6668         Include <stdlib.h>, <string.h> unconditionally.
6669
6670         * hash.c (free, malloc): Remove decls.
6671         Include <stdlib.h> unconditionally.
6672
6673         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6674         (getenv): Do not declare.
6675
6676         * idcache.c: Include <string.h> unconditionally.
6677
6678         * long-options.c: Include long-options.h first, to test interface.
6679         Include <stdlib.h> unconditionally.
6680
6681         * makepath.c: Include makepath.h first, to test interface.
6682         Include <stdlib.h> and <string.h> unconditionally.
6683
6684         * linebuffer.c: Include <stdlib.h>.
6685         (free): Remove decl.
6686
6687         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6688         rpl_malloc returns void *, not char *.
6689         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6690
6691         * md5.h: Include <limits.h> unconditionally.
6692         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6693         (__P): Remove; all uses removed.
6694         * md5.c: Include "md5.h" first.
6695         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6696         md5_buffer, md5_process_bytes, md5_process_block):
6697         Define with prototypes.
6698         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6699         * sha.c: Include "sha.h" first.
6700         Include <stdlib.h>, <string.h> unconditionally.
6701
6702         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6703         * memcmp.c (__ptr_t): Likewise.
6704         * memrchr.c (__ptr_t): Likewise.
6705         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6706         Include <string.h> unconditionally.
6707         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6708         * memchr.c: Include <stdlib.h> unconditionally.
6709         * memchr.c (LONG_MAX): Remove.
6710         * memrchr.c (LONG_MAX): Likewise.
6711         * memchr.c (__memchr): Define via a prototype.
6712         * memrchr.c (__memrchr): Likewise.
6713         * memcmp.c (__P): Remove, and remove all uses.
6714         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6715         Remove forward decls; no longer needed.
6716         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6717         Use types required by C89 in prototype.
6718
6719         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6720         * savedir.c: Likewise.
6721         * mkdir.c (free): Remove decl.
6722         * rmdir.c (rmdir): Define with a prototype.
6723         * savedir.c: Include savedir.h first, to test interface.
6724
6725         * mktime.c (STDC_HEADERS): Remove.
6726         Include <stdlib.h>, <string.h> unconditionally.
6727
6728         * modechange.c: Include <stdlib.h> unconditionally.
6729         (malloc): Remove decl.
6730
6731         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6732         (free): Remove decl.
6733
6734         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6735         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6736         (This type really should be intptr_t, but that's a C99ism.)
6737         (_obstack_memcpy): Remove: all uses changed to memcpy.
6738         Include <string.h> unconditionally.
6739         (struct obstack): Assume __STDC__ for types of members
6740         chunkfun, freefun, extra_arg.
6741         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6742         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6743         obstack_begin, obstack_specify_allocation,
6744         obstack_specify_allocation_with_arg, obstack_chunkfun,
6745         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6746         Remove unprototyped decls and the macros that use them.
6747         * obstack.c (POINTER): Remove.  All uses changed to void *.
6748         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6749         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6750         (defined __STDC__ && __STDC__)]:
6751         Remove nonprototyped code.
6752         Include <stdlib.h> unconditionally.
6753         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6754         _obstack_allocated_p, _obstack_free, obstack_free,
6755         _obstack_memory_used, print_and_abort):
6756         Define using prototypes.
6757         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6758         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6759         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6760         obstack_next_free, obstack_object_size, obstack_room) [0]:
6761         Remove unused, unprototyped code.
6762
6763         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6764
6765         * physmem.c (physmem_total, physmem_available, main): Define
6766         with prototypes.
6767
6768         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6769         (main): Define with a prototype.
6770
6771         * posixver.c (getenv): Remove decl.
6772
6773         * putenv.c (malloc): Returns void *, not char *.
6774         Include <string.h> unconditionally.
6775         (strchr, memcpy, NULL): Do not define.
6776
6777         * readtokens.c: Include readtokens.h first, to test interface.
6778         Include <stdlib.h>, <string.h> unconditionally.
6779         (init_tokenbuffer): Define with a prototype.
6780
6781         * regex.c (PARAMS): Remove.  All uses removed.
6782         All uses of _RE_ARGS removed, too.
6783         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6784         unconditionally.
6785         (bzero): Assume memset exists.
6786         (memcmp, memcpy, NULL): Remove.
6787         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6788         char, or assignments to local vars of type signed char.
6789         (init_syntax_once, PREFIX(extract_number_and_incr),
6790         PREFIX(print_partial_compiled_pattern),
6791         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6792         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6793         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6794         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6795         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6796         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6797         wcs_compile_range, byte_compile_range, truncate_wchar,
6798         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6799         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6800         count_mbs_length, wcs_re_match_2_internal,
6801         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6802         PREFIX(alt_match_null_string_p),
6803         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6804         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6805         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6806         now-unnecessary declaration, if any.
6807         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6808         regcomp, regexec):
6809         Remove now-unnecessary casts among pointer types.
6810         * regex.h (_RE_ARGS): Remove.  All uses removed.
6811
6812         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6813         (free): Remove decl.
6814
6815         * rpmatch.c: Include <stdlib.h> unconditionally.
6816
6817         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6818         (free): Remove decl.
6819
6820         * save-cwd.c: Include <stdlib.h> unconditionally.
6821         * xgetcwd.c: Likewise.
6822
6823         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6824         (free): Remove decl.
6825
6826         * strchrnul.c (strchrnul): Define with a prototype.
6827         Fix bug: c_in was not converted to char before searching.
6828
6829         The following changes are not K&R related:
6830
6831         * group-member.h: Include <sys/types.h>, so that this file is
6832         self-contained.
6833         * makepath.h: Likewise.
6834
6835         * getusershell.c (readname, default_index, line_size, readname):
6836         Use size_t, not int, for sizes.
6837         (readname): If the size overflows, report an error instead of
6838         looping forever.
6839
6840 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6841
6842         * getndelim2.c: Assume stdlib.h per the C89 spec.
6843
6844 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6845
6846         Assume C89 or better; remove K&R cruft.
6847         A few of these changes were first proposed by Derek Robert Price
6848         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6849
6850         * addext.c: Include <string.h> unconditionally.
6851         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6852         Don't declare getenv or malloc.
6853
6854         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6855         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6856         (NULL): Remove.
6857         (find_stack_direction, alloca): Use prototypes.
6858
6859         * atexit.c (atexit): Define using a prototype.
6860
6861         * basename.c, dirname.c, stripslash.c:
6862         Include <string.h> unconditionally.
6863
6864         * bcopy.c: Include <stddef.h>.
6865         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6866
6867         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6868
6869         * error.h (error, error_at_line, error_print_progname)
6870         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6871         * error.c: Include error.h first, to check interface.
6872         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6873         (VA_START): Remove; all uses changeed to va_start.
6874         (exit, strerror): Remove decls.
6875         (error_print_progname): Prototype uncondionally.
6876         Don't include <errno.h>; no longer needed.
6877         (private_strerror): Remove.
6878         (error_tail): Always define.
6879         (error, error_at_line): Assume C89 or better; always use prototypes.
6880         * fatal.c: Include "fatal.h" first, to test interface.
6881         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6882         (VA_START): Remove; all uses changed to va_start.
6883         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6884         this case.
6885         (exit): Remove decl.
6886         (fatal): Prototype unconditionally.  Assume va_start works.
6887         Abort at end, to pacify gcc.
6888
6889         * euidaccess.c (main): Define with a prototype.
6890
6891         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6892
6893         * exitfail.c: Include <stdlib.h> unconditionally.
6894
6895         * fnmatch_.h (__P): Remove.  All uses changed to assume
6896         prototypes.
6897         * fnmatch.c: Include fnmatch.h first, to test interface.
6898         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6899         (getenv): Remove decl.
6900         (fnmatch): Define using a prototype.
6901         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6902         (FCT): Define using a prototype.
6903
6904         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6905
6906         * gethostname.c: Include <stddef.h>.
6907         (gethostname): Define with prototype.  Length is size_t, not int.
6908
6909 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6910
6911         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6912         getversion.c should have been removed then, but was accidentally
6913         preserved.
6914
6915         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6916         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6917
6918 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6919
6920         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6921         copy_tm_result.  Bug reported by Simon Josefsson in
6922         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6923
6924 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6925
6926         * time_r.c, time_r.h: New files.
6927
6928         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6929         __localtime_r.
6930         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6931         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6932
6933         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6934         __gmtime_r.
6935         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6936         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6937         Include <time_r.h>.
6938
6939         * timegm.c: Switch to glibc implementation, with the following changes:
6940         [defined HAVE_CONFIG_H]: Include <config.h>.
6941         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6942         (__mktime_internal) [!defined _LIBC]: New decl.
6943         (__gmtime_r) [!defined _LIBC]: New macro and function.
6944         (timegm): Use a prototype, since gnulib assumes C89.
6945         Do not bother declaring tmp to be const, as it's not really usefu.
6946         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6947         (timegm): Declare only if HAVE_DECL_TIMEGM.
6948
6949 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6950
6951         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6952         Bug reported by Lute Kamstra in
6953         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6954
6955         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6956         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6957         course with correspondingly smaller numbers for tomorrow and
6958         yesterday.  From Tadayoshi Funaba.  Originally installed into
6959         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6960         coreutils merge?).
6961
6962 2003-08-31  Simon Josefsson  <jas@extundo.com>
6963
6964         * timegm.h: New file.
6965         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6966
6967 2003-08-31  Karl Berry  <karl@gnu.org>
6968
6969         * argp.h: update from libc.
6970
6971 2003-08-28  Bruno Haible  <bruno@clisp.org>
6972
6973         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6974         warning on QNX, which defines O_BINARY to 000000.
6975
6976 2003-08-24  Bruno Haible  <bruno@clisp.org>
6977
6978         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6979         MSVC7 <stdio.h> is included later.
6980
6981 2003-08-20  Bruno Haible  <bruno@clisp.org>
6982
6983         * progname.h: New file, from GNU gettext.
6984         * progname.c: New file, from GNU gettext.
6985         * progreloc.c: New file, from GNU gettext.
6986
6987 2003-08-19  Bruno Haible  <bruno@clisp.org>
6988
6989         * xstrdup.c: Assume <string.h> exists.
6990
6991 2003-08-18  Jim Meyering  <jim@meyering.net>
6992
6993         * setenv.h: Indent nested cpp directive.
6994         * vasnprintf.c: Remove trailing blanks.
6995
6996 2003-08-17  Simon Josefsson  <jas@extundo.com>
6997             Bruno Haible  <bruno@clisp.org>
6998
6999         * xstrndup.h: New file.
7000         * xstrndup.c: New file.
7001
7002 2003-08-17  Bruno Haible  <bruno@clisp.org>
7003
7004         * strndup.h: New file.
7005
7006 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7007
7008         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7009         space, undoing this 2003-08-12 change:
7010         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7011
7012 2003-08-16  Jim Meyering  <jim@meyering.net>
7013
7014         Merge from coreutils.
7015         * xstrtoimax.c: #else #if -> #elif.
7016         * xstrtoumax.c: Likewise.
7017
7018 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7019
7020         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7021         rather than tab, after '#' in shell-script copyright notices.
7022         Suggested by Bruno Haible.
7023
7024 2003-08-15  Jim Meyering  <jim@meyering.net>
7025         and Paul Eggert  <eggert@twinsun.com>
7026
7027         Merge from coreutils.
7028         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7029         member but strut utmpx does not.  Needed for AIX 4.3.3.
7030         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7031
7032 2003-08-15  Jim Meyering  <jim@meyering.net>
7033
7034         Merge from coreutils.
7035         * xgethostname.c: Include <stdlib.h>.
7036         (xghostname): Don't exit for anything other than memory-related
7037         failure; just return NULL.
7038         * userspec.c: Include "posixver.h".
7039         (parse_user_spec): Accept `.' as a separator only
7040         in pre-POSIX-200112 mode.
7041         * strtoimax.c: Use #elif rather than #else #if.
7042         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7043         Remove function, now that we can rely on a working tzset function.
7044         [!_LIBC]: Ensure that the required autoconf test has been run.
7045         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7046         Use underlying_strftime for %r.
7047         * sha.c: Merge in some clean-up and optimization changes from glibc.
7048         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7049         Ensure that it is a multiple of 64.
7050         Rearrange loop exit tests so as to avoid performing an
7051         additional fread after encountering an error or EOF.
7052         * realloc.c: Update copyright date.
7053
7054 2003-08-14  Jim Meyering  <jim@meyering.net>
7055
7056         Merge from coreutils.
7057         * obstack.h: Whitespace changes.
7058         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7059         and xcalloc return values.
7060         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7061         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7062         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7063         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7064         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7065         error from mntctl.
7066         Use mntctl's return value to drive the entry-processing loop, since
7067         we can't rely on the value of the vmt_length member in the last
7068         entry.  On some systems doing so could result in exhausting
7069         virtual memory.  Based in part on a patch from Mike Jetzer.
7070
7071 2003-08-14  Jim Meyering  <jim@meyering.net>
7072         and Paul Eggert  <eggert@twinsun.com>
7073
7074         Merges from coreutils, plus other fixes.
7075         * physmem.c: Merge in portability changes from gcc/libiberty
7076         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7077         for credits and details.  Thanks to Kaveh Ghazi for helping
7078         to keep these files in sync.
7079         (ARRAY_SIZE): Define it.
7080         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7081         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7082         (memcasecmp): Don't assume size_t fits in unsigned int.
7083         Remove casts and duplicate code.
7084         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7085         (memcpy): Remove definition.
7086         Merge in some clean-up and optimization changes from glibc.
7087         [BLOCKSIZE]: Move definition to top of file.
7088         Ensure that it is a multiple of 64.
7089         Rearrange loop exit tests so as to avoid performing an
7090         additional fread after encountering an error or EOF.
7091         * md5.h (md5_uintptr): Define.
7092         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7093         return to the initial working directory.  Preserve errno
7094         for caller.
7095         * idcache.c: Include "xalloc.h".
7096         (xmalloc, xrealloc): Remove decls.
7097         (getuser): Remove casts no longer required in C89.
7098         * human.c: Include stdio.h, for sprintf.
7099         * group-member.c: Include "xalloc.h".
7100         (xmalloc, xrealloc): Remove decls.
7101         (get_group_info): Remove casts no longer required in C89.
7102         * getusershell.c (readname): Remove casts no longer required in C89.
7103         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7104         * getline.c: Whitespace fix, from coreutils.
7105
7106 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7107
7108         * exclude.c: Include <ctype.h>
7109         (IN_CTYPE_DOMAIN): New macro.
7110         (is_space): New fn.
7111         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7112         and empty lines.
7113
7114         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7115         Undo previous (whitespace-only) change.
7116
7117 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7118
7119         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7120         Normalize leading white space and remove trailing white space.
7121         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7122         notice, as per ../config/srclist-update.
7123
7124         Merge from coreutils.
7125         * euidaccess.h: New file.
7126         * euidaccess.c: Include it.
7127         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7128         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7129         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7130
7131 2003-08-11  Bruno Haible  <bruno@clisp.org>
7132
7133         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7134         (vasnprintf): Use it instead of wcslen.
7135
7136 2003-08-11  Bruno Haible  <bruno@clisp.org>
7137
7138         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7139         value to ensure that _Bool promotes to int. Use #define for _Bool when
7140         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7141
7142 2003-08-10  Karl Berry  <karl@gnu.org>
7143
7144         * regex.h: update from libc (whitespace fix).
7145
7146 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7147
7148         Merge some files from coreutils.  These changes were
7149         originally made by Jim Meyering.
7150         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7151         many older Unixes require this.
7152         * alloca.c (alloca): Remove cast to argument of free;
7153         no longer needed in C89.
7154         * alloca_.h, regex.h: Fix white space to match
7155         what GNU indent does.
7156
7157 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7158
7159         * bumpalloc.h: Remove.
7160
7161 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7162
7163         * getloadavg.c: Change copyright notice and spacing to conform to
7164         GNU coding style.
7165
7166         Merge from coreutils.
7167         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7168         From glibc.
7169         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7170         from Karl Berry, implemented by Jim Meyering.
7171         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7172         from Dmitry V. Levin.
7173         Remove anachronistic cast of xrealloc.
7174         * fnmatch_.h (__const): Remove.  Use 'const'.
7175         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7176         type. Otherwise, it wouldn't compile with at least /bin/cc on
7177         ymp-cray-unicos9.0.2.X.
7178         Combine two mostly-identical uses of alloca into one.
7179         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7180
7181 2003-08-04  Dave Love <d.love@dl.ac.uk>
7182
7183         [From Emacs.]
7184
7185         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7186         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7187         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7188         obsolete NLIST_NAME_UNION.
7189         [__GNU__]: Undef BSD and FSCALE.
7190         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7191
7192 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7193
7194         * stdbool_.h (_Bool): Make it signed char, instead of
7195         an enum type, so that it's guaranteed to promote to int.  See:
7196         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7197
7198 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7199
7200         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7201         (strerror): Don't assume that a printable int fits in 14 bytes.
7202
7203 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7204             Bruno Haible  <bruno@clisp.org>
7205
7206         * getline.h (getline, getdelim): Change return type to ssize_t.
7207         * getline.c (getline, getdelim): Likewise.
7208         Remove _GNU_SOURCE define; now it's defined in config.h through
7209         m4/getline.m4.
7210
7211 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7212
7213         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7214         over-parenthesization in macros.
7215
7216         Sync with coreutils.
7217
7218         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7219         required by C99.
7220
7221         Use `exit_failure' for xalloc and xmemcoll instead of their own
7222         private exit-failure variables.
7223         * xalloc.h (xalloc_exit_failure): Remove.
7224         * xmalloc.c: Likewise.  Include exitfail.h.
7225         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7226         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7227         * xmemcoll.c: Likewise.  Include exitfail.h.
7228         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7229
7230 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7231
7232         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7233         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7234         to test that it can stand by itself.  Include "exitfail.h".
7235         Clients should set exit_failure instead.
7236         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7237
7238 2003-07-18  Andreas Schwab  <schwab@suse.de>
7239
7240         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7241
7242 2003-07-18  Bruno Haible  <bruno@clisp.org>
7243
7244         * getndelim2.h: New file.
7245         * getndelim2.c: Make into a module of its own. Include config.h,
7246         getndelim2.h.
7247         (getndelim2): Make non-static. Change return type to ssize_t.
7248         * getline.h: Change argument names.
7249         * getline.c: Include getndelim2.h instead of getndelim2.c.
7250         * getnline.c: Include getndelim2.h.
7251
7252 2003-07-17  Bruno Haible  <bruno@clisp.org>
7253
7254         * Makefile.am: Remove file.
7255         * Makefile.in: Remove file.
7256
7257 2003-07-17  Bruno Haible  <bruno@clisp.org>
7258
7259         * getnline.h: New file.
7260         * getnline.c: New file.
7261         * getndelim2.c: New file, extracted from getline.c.
7262         (getndelim2): Renamed from getdelim2, with added nmax argument.
7263         * getline.c: Include getndelim2.c.
7264         (getdelim2): Moved out to getndelim2.c.
7265         (getline, getdelim): Update.
7266
7267 2003-07-15    <karl@gnu.org>
7268
7269         * vasnprintf.c: update from gettext.
7270
7271 2003-07-15  Jim Meyering  <jim@meyering.net>
7272
7273         * makepath.c (make_path): Enclose diagnostic in _(...).
7274
7275 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7276
7277         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7278         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7279         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7280         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7281         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7282         updated automatically by ../config/srclist-update.  This changes
7283         their license from LPGL to GPL.
7284
7285 2003-07-14  Jim Meyering  <jim@meyering.net>
7286
7287         Don't emit diagnostics.  Let callers do that.
7288         * save-cwd.c: Don't include "error.h".
7289         (save_cwd): Don't call error.  Ensure that errno is valid
7290         when returning nonzero.
7291
7292         * save-cwd.h (restore_cwd): Update prototype.
7293         * save-cwd.c (restore_cwd): Remove two parameters.
7294         Simplify.  Don't call error upon failure.  Let callers do that.
7295         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7296         when auditing is enabled.  But don't bother updating the #if.
7297
7298 2003-07-14  Simon Josefsson  <jas@extundo.com>
7299
7300         * mempcpy.h: New file.
7301         * mempcpy.c: New file.
7302
7303 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7304
7305         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7306         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7307         unicodeio.c, unicodeio.h, unlocked-io.h:
7308         Switch from LGPL to GPL.
7309
7310 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7311
7312         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7313         it breaks C++ compilation.
7314         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7315
7316 2003-07-10  Jim Meyering  <jim@meyering.net>
7317
7318         * vasnprintf.c: Remove trailing blanks.
7319         Make cpp indentation consistent.
7320
7321 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7322
7323         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7324         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7325         Switch from LGPL to GPL.
7326
7327 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7328
7329         * mktime.c: Fix some boundary cases and remove need for floating point.
7330
7331         Issue a compile-time diagnostic if time_t is floating point, or if
7332         two's complement arithmetic is not in effect, or if arithmetic
7333         right shift does not propagate the sign.  These assumptions were
7334         all in the original code but they weren't checked.
7335
7336         (TIME_T_MIDPOINT, verify): New macros.
7337         (__isleap): Remove; it has integer overflow problems.
7338         (leapyear): New function, without those problems.
7339         (ydhms_tm_diff): Remove; splitting into two parts.
7340         (ydhms_diff): New function, containing the arithmetic part of
7341         the old ydhms_tm_diff function.  Issue a compile-time
7342         diagnostic if we are not using C99 integer division.
7343         Avoid casts when possible.
7344         (guess_time_tm): New function, containing the checking part of
7345         the old ydhms_tm_diff function.  Return the new value, rather than
7346         the difference between it and the old.  Accept a new argument T
7347         so that *T specifies the old value.  Check for overflow in the result.
7348
7349         (__mktime_internal): Use a time_t offset, not a long int offset.
7350         This undoes the 2003-06-04 change, which is no longer needed now
7351         that we have better overflow checking.
7352         (localtime_offset): Likewise.
7353
7354         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7355         and long are 64-bit but int is only 32-bit.
7356         (ydhms_diff): Use long int to store year1 and yday1.
7357         Issue a compile-time diagnostic if long int is not wide enough.
7358
7359         (__mktime_internal): Use long int to store adjusted year and yday.
7360         Use plain C rather than preprocessor commands, if that doesn't
7361         affect efficiency.
7362         Check for overflow (and try to repair) after each probe
7363         rather than checking only at the very end.  This avoids some bugs
7364         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7365         does not equal GMT offset at maximum time).
7366         Use integer to check for overflow rather than floating point; this
7367         is more portable to non-IEEE hosts, and is a tad faster.
7368         When we detect that we are oscillating between two values,
7369         don't check whether tm_isdst has the requested value, since
7370         we already know the answer.  When tm_isdst has the wrong value,
7371         use a different heuristic to find the right one, based on the
7372         extreme values actually observed in practice in tz2003a,
7373         rather than the (overly optimistic) "previous 3 calendar quarters".
7374
7375         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7376         "T const" to accommodate glibc style.
7377         (check_result): Use less-confusing report format.  "long" -> "long int.
7378         (main): Likewise.
7379         Don't loop if the iteration overflows time_t.
7380         Allow a negative step in the iteration.
7381
7382 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7383
7384         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7385         having it depend on HAVE_SYS_TYPES_H.
7386
7387 2003-06-25  Bruno Haible  <bruno@clisp.org>
7388
7389         * readlink.c: New file.
7390
7391 2003-06-20  Bruno Haible  <bruno@clisp.org>
7392
7393         Assume C89, so PARAMS isn't needed.
7394         * unicodeio.h (PARAMS): Remove.
7395         * unicodeio.c: Don't use PARAMS.
7396
7397 2003-06-18  Jim Meyering  <jim@meyering.net>
7398
7399         Merge changes from coreutils.
7400         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7401         Remove explicit declarations of xmalloc and realloc.
7402         Include xalloc.h.
7403         (read_utmp): Remove anachronistic cast of xmalloc.
7404
7405 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7406
7407         Assume C89, so PARAMS isn't needed.
7408         * backupfile.h (PARAMS): Remove.  All uses removed.
7409         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7410         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7411         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7412         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7413         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7414         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7415         xstrtol.h: Likewise.
7416         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7417         same.h, strverscmp.h: Do not include config.h; no longer needed.
7418         Anyway, config.h should always be included before any other file.
7419
7420 2003-06-11  Simon Josefsson  <jas@extundo.com>
7421
7422         * sysexit_.h: New file.
7423
7424 2003-05-20  Derek Price  <derek@ximbiot.com>
7425
7426         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7427
7428 2003-06-10  Simon Josefsson  <jas@extundo.com>
7429
7430         * strchrnul.h: New file.
7431         * strchrnul.c: New file.
7432
7433 2003-06-10  Simon Josefsson <jas@extundo.com>
7434
7435         * argp.h: New file, from glibc.
7436         * argp-ba.c: New file, from glibc.
7437         * argp-eexst.c: New file, from glibc.
7438         * argp-fmtstream.c: New file, from glibc.
7439         * argp-fmtstream.h: New file, from glibc.
7440         * argp-fs-xinl.c: New file, from glibc.
7441         * argp-help.c: New file, from glibc.
7442         * argp-namefrob.h: New file, from glibc.
7443         * argp-parse.c: New file, from glibc.
7444         * argp-pv.c: New file, from glibc.
7445         * argp-pvh.c: New file, from glibc.
7446         * argp-xinl.c: New file, from glibc.
7447
7448 2003-06-07  Jim Meyering  <jim@meyering.net>
7449
7450         * readtokens.h: Put `Free Software Foundation, Inc.'
7451         in place of my name in the copyright comment.
7452         Remove definition and uses of __P.
7453
7454         From coreutils.
7455         * stat.c: Don't declare xmalloc explicitly.
7456         Instead, include "xalloc.h".
7457         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7458         xrealloc, and xcalloc return values.
7459         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7460         Improve comment.
7461         * xgetcwd.h: Remove definition/uses of PARAMS.
7462
7463 2003-06-06  Jim Meyering  <jim@meyering.net>
7464
7465         * stdbool_.h: Renamed from stdbool.h.in.
7466
7467 2003-06-06  Jim Meyering  <jim@meyering.net>
7468
7469         Merge from coreutils.
7470         * same.c: (same_name): Declare *_basename locals to be `const'.
7471         Consolidate declarations and initializations of *_base* locals.
7472
7473         Merge from coreutils.
7474         This avoids a core dump on systems without GNU putenv,
7475         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7476         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7477         (unsetenv): New static function, from GNU libc.
7478         (rpl_putenv): Use it.
7479
7480         * modechange.c: Remove trailing blanks.
7481
7482         Merge from coreutils.
7483         * fsusage.c: Remove declaration of statfs.
7484         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7485
7486         * posixtm.c: Include <stdbool.h> unconditionally.
7487
7488 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7489
7490         * mktime.c (__mktime_internal): When resolving a tm_isdst
7491         mismatch, look in future quarters as well as past.  This fixes a
7492         bug when processing fall-backwards gaps immediately after a long
7493         period of daylight-saving time.
7494
7495         * mktime.c: Assume freestanding C89 or better.
7496         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7497         (__P): Remove; not used.
7498         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7499         (mktime, not_equal_tm, print_tm, check_result,
7500         main): Use prototypes.  Use const * where appropriate.
7501         (main): Fix typo in testing code that uncovered by above changes.
7502         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7503
7504 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7505
7506         * mktime.c: Fix Debian bug 177940
7507         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7508         (localtime_offset): Now long int, not time_t, because we want it
7509         to be guaranteed to be signed.  All uses changed.
7510         (__mktime_internal): If overflow would occur when adding offset,
7511         don't add it.
7512
7513         Merge 'human' changes from coreutils.  Rewrite to support
7514         locale-specific notations like thousands separators.
7515         * human.c: Simplify authorship notice.
7516         Include human.h immediately after config.h.
7517         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7518         <limits.h>: Do not include, since human.h does.
7519         (SIZE_MAX, UINTMAX_MAX): New macros.
7520         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7521         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7522         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7523         (power_letter): Renamed from suffixes.
7524         (generate_suffix_backwards): Remove.
7525         (adjust_value): Now takes int style (because of human.h changes)
7526         and long double value (for greater precision on some platforms).
7527         (group_number): New function.
7528         (human_readable): Use it.  Use integer options, not enum.
7529         Put the options before the sizes in the arg list.
7530         Support all the new options.
7531         The old human_readable function has been removed;
7532         use inttostr.h instead.
7533         (human_readable, default_block_size, humblock):
7534         Use uintmax_t, not int, for block sizes.
7535         (human_readable_inexact, block_size_types): Remove.
7536         (block_size_opts): New constant.
7537         (human_options): Renamed from human_block_size, with new signature
7538         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7539         * human.h: Add copyright and authorship notice.
7540         Include <limits.h> and <stdbool.h> unconditionally.
7541         (PARAMS): Remove.  All uses removed.
7542         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7543         (enum human_inexact_style): Remove tag; now a nameless enum.
7544         (human_floor, human_ceiling, human_round_to_even): Now have
7545         values 2, 0, 1 rather than -1, 1, 0.
7546         (human_group_digits, human_suppress_point_zero, human_autoscale,
7547         human_base_1024, human_SI, human_B): New constants.
7548         (human_readable_inexact, human_block_size): Remove.
7549         (human_readable): Size args are now uintmax_t, not int.
7550         (human_options): New decl.
7551
7552         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7553         unnecessary now that we assume C89 or better.  This change
7554         imported from coreutils.
7555
7556         * mktime.c (__mktime_internal): Do not reject negative timestamps
7557         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7558         in the 2003-05-30 sync from glibc.
7559
7560         .h files should stand alone, but we shouldn't include <sys/types.h>
7561         if we can get away with just <stddef.h>.
7562
7563         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7564         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7565         rather than <sys/types.h>, as we merely need size_t.
7566         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7567         to get size_t.
7568         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7569         Include <stdio.h>, to get FILE.
7570         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7571         memcasecmp.h has included <stddef.h> and all we need is size_t.
7572         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7573         our interface, instead of including <sys/types.h>
7574
7575 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7576
7577         [from coreutils]
7578         Fix some minor time-related bugs with POSIX time arguments.
7579         Some valid time stamps were being rejected (notably -1, and
7580         time stamps before 1900 on 64-bit hosts).  And some invalid
7581         time stamps were being accepted, e.g. September 31.
7582
7583         * posixtm.h (posixtime): Return bool instead of time_t, so
7584         that we can return (time_t) -1 successfully.
7585         * posixtm.c: Likewise.
7586         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7587         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7588         (t): Remove static var.
7589         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7590         of static var.  All uses changed.
7591         (year): Do not reject years before 1900; they can occur with
7592         64-bit time_t.
7593         (posix_time_parse): Do not check for out-of-range components;
7594         that is now the caller's responsibility, since our checks were
7595         only approximations.
7596         (posixtime): Use mktime to check for out-of-range components,
7597         since it knows them exactly.
7598         If mktime returns (time_t) -1, check whether an error actually occurred
7599         by invoking localtime on -1.
7600         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7601         posixtime failures better.
7602         Improve the test data (in comments only).
7603
7604 2003-05-30    <karl@gnu.org>
7605
7606         * mktime.c: update from libc.
7607
7608 2003-05-30  Bruno Haible  <bruno@clisp.org>
7609
7610         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7611         * localcharset.h: Likewise.
7612         * localcharset.c: Likewise.
7613
7614 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7615
7616         Assume the headers required for C89 freestanding compilers.
7617         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7618         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7619         without checking for HAVE_LIMITS_H.
7620         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7621         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7622         to do that.
7623         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7624         * exclude.c: Include <stdbool.h> unconditionally.
7625         * tempname.c: Include <stddef.h> unconditionally.
7626         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7627         * modechange.c, rpmatch.c (NULL): Don't define, since
7628         <stddef.h> does that.
7629         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7630         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7631         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7632         * xstrtol.c: Likewise.
7633         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7634         * savedir.c: Include <stddef.h> instead of defining NULL.
7635
7636         * addext.c (addext): Use assignment rather than cast, to avoid
7637         warnings on some platforms.
7638
7639         * mktime.c (__mktime_internal): Do not reject negative timestamps
7640         arbitrarily.
7641
7642 2003-05-10  Bruno Haible  <bruno@clisp.org>
7643
7644         * linebreak.c (iconv_string_length): Don't return -1 just because the
7645         string is longer than 4 KB.
7646
7647 2003-05-12  Jim Meyering  <jim@meyering.net>
7648
7649         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7650         the space-padded-by-default conversion specifiers, %e, %k, %l.
7651
7652 2003-05-03  Bruno Haible  <bruno@clisp.org>
7653
7654         Upgrade to Unicode-4.0.
7655         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7656         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7657         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7658         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7659         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7660         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7661         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7662         Change width of U+E0100..U+E01EF from 1 to 0.
7663
7664 2003-04-25  Bruno Haible  <bruno@clisp.org>
7665
7666         * copy-file.c: Include <stddef.h>, for size_t.
7667
7668 2003-04-25  Jim Meyering  <jim@meyering.net>
7669
7670         * copy-file.c (copy_file_preserving): Declare buf_size to be
7671         of type size_t, not int.
7672
7673 2003-04-11  Jim Meyering  <jim@meyering.net>
7674
7675         Merge changes from Coreutils.
7676
7677         2003-03-22  Jim Meyering  <jim@meyering.net>
7678
7679         * strftime.c (widen): Cast alloca return value to proper type.
7680
7681         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7682
7683         From GNU libc.
7684         * strftime.c (my_strftime): Handle very large width
7685         specifications for numeric values correctly.  Improve checks for
7686         overflow.
7687
7688         2003-01-19  Jim Meyering  <jim@meyering.net>
7689
7690         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7691         (nl_get_alt_digit) [! defined my_strftime]: Define.
7692         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7693         _nl_get_alt_digit and _nl_get_walt_digit.
7694
7695         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7696         These changes have no effect outside of _LIBC.
7697
7698 2003-04-10  Bruno Haible  <bruno@clisp.org>
7699
7700         * findprog.h: New file, from GNU gettext.
7701         * findprog.c: New file, from GNU gettext.
7702
7703 2003-04-05  Jim Meyering  <jim@meyering.net>
7704
7705         Merge changes from Coreutils.
7706
7707         * exclude.h (PARAMS): Remove definition and uses.
7708         * exclude.c: Remove uses of `PARAMS'.
7709
7710         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7711         Add test-cases for DOS filenames. Declare program_name.
7712         (main): Set up program_name.  Patch by Rich Dawe.
7713
7714         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7715         error from mntctl.
7716         Use mntctl's return value to drive the entry-processing loop, since
7717         we can't rely on the value of the vmt_length member in the last
7718         entry.  On some systems doing so could result in exhausting
7719         virtual memory.  Based in part on a patch from Mike Jetzer.
7720
7721 2003-04-04  Bruno Haible  <bruno@clisp.org>
7722
7723         * linebreak.h: New file, from GNU gettext.
7724         * linebreak.c: New file, from GNU gettext with slight modifications.
7725         * lbrkprop.h: New file, from GNU gettext.
7726
7727 2003-04-03  Bruno Haible  <bruno@clisp.org>
7728
7729         * utf8-ucs4.h: New file, from GNU gettext.
7730         * utf16-ucs4.h: New file, from GNU gettext.
7731         * ucs4-utf8.h: New file, from GNU gettext.
7732         * ucs4-utf16.h: New file, from GNU gettext.
7733
7734 2003-04-02  Bruno Haible  <bruno@clisp.org>
7735
7736         * binary-io.h: New file, from GNU gettext.
7737
7738 2003-04-01  Bruno Haible  <bruno@clisp.org>
7739
7740         * pathname.h: New file, from GNU gettext.
7741         * concatpath.c: New file, from GNU gettext.
7742
7743 2003-03-30  Bruno Haible  <bruno@clisp.org>
7744
7745         * copy-file.c (copy_file_preserving): Don't set owner if the function
7746         chown() doesn't exist.
7747
7748 2003-03-28  Bruno Haible  <bruno@clisp.org>
7749
7750         * copy-file.h: New file, from GNU gettext.
7751         * copy-file.c: New file, from GNU gettext.
7752
7753 2003-03-18  Jim Meyering  <jim@meyering.net>
7754
7755         * quote.c (quote_n): Fix typo in comment.
7756
7757 2003-03-14  Jim Meyering  <jim@meyering.net>
7758
7759         Merge changes from Coreutils.
7760         * obstack.h (obstack_object_size): Declare temporary, __o,
7761         to be const, in order to avoid warnings.
7762         (obstack_room): Likewise.
7763         (obstack_empty_p): Likewise.
7764
7765 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7766
7767         Merge changes from Bison.
7768         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7769         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7770         when compiling Bison 1.875's `bitset bset = obstack_alloc
7771         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7772         * hash.c: Include <stdbool.h> unconditionally.
7773
7774 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7775
7776         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7777         Reported by Bruce Becker; see:
7778         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7779
7780 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7781             Bruno Haible  <bruno@clisp.org>
7782
7783         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7784         Reported by John Hughes, see
7785         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7786
7787 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7788
7789         * poll_.h: New file.
7790         * poll.c: New file.
7791
7792 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7793
7794         * mathl.h: New file.
7795         * acosl.c: New file.
7796         * asinl.c: New file.
7797         * atanl.c: New file.
7798         * ceill.c: New file.
7799         * cosl.c: New file.
7800         * expl.c: New file.
7801         * floorl.c: New file.
7802         * frexpl.c: New file.
7803         * ldexpl.c: New file.
7804         * logl.c: New file.
7805         * sincosl.c: New file.
7806         * sinl.c: New file.
7807         * sqrtl.c: New file.
7808         * tanl.c: New file.
7809         * trigl.c: New file.
7810         * trigl.h: New file.
7811
7812 2003-02-17  Bruno Haible  <bruno@clisp.org>
7813
7814         * mkdtemp.h: New file, from GNU gettext.
7815         * mkdtemp.c: New file, from GNU gettext.
7816
7817 2003-01-31  Bruno Haible  <bruno@clisp.org>
7818
7819         * rename.c: #undef rename before defining rpl_rename.
7820         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7821
7822 2003-01-30  Bruno Haible  <bruno@clisp.org>
7823
7824         * printf-args.h: New file, from GNU gettext.
7825         * printf-args.c: New file, from GNU gettext.
7826         * printf-parse.h: New file, from GNU gettext.
7827         * printf-parse.c: New file, from GNU gettext.
7828         * vasnprintf.h: New file, from GNU gettext.
7829         * vasnprintf.c: New file, from GNU gettext.
7830         * asnprintf.c: New file, from GNU gettext.
7831         * vasprintf.h: New file, from GNU gettext with modifications.
7832         * vasprintf.c: New file, from GNU gettext.
7833         * asprintf.c: New file, from GNU gettext.
7834
7835 2003-01-29  Bruno Haible  <bruno@clisp.org>
7836
7837         * stpncpy.h: New file, from GNU gettext with modifications.
7838         * stpncpy.c: New file, from GNU gettext with modifications.
7839
7840 2003-01-28  Bruno Haible  <bruno@clisp.org>
7841
7842         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7843         Paul Eggert.
7844         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7845         Paul Eggert.
7846
7847 2003-01-27  Bruno Haible  <bruno@clisp.org>
7848
7849         * xsetenv.h: New file, from GNU gettext.
7850         * xsetenv.c: New file, from GNU gettext.
7851
7852 2003-01-23  Bruno Haible  <bruno@clisp.org>
7853
7854         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7855
7856 2003-01-22  Bruno Haible  <bruno@clisp.org>
7857
7858         * exit.h: New file, from GNU gettext.
7859
7860 2003-01-11  Bruno Haible  <bruno@clisp.org>
7861
7862         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7863         * strcase.h (strcasecmp, strncasecmp): Likewise.
7864
7865 2003-01-14  Jim Meyering  <jim@meyering.net>
7866
7867         * same.c (same_name): Tweak a comment.
7868
7869 2003-01-11  Bruno Haible  <bruno@clisp.org>
7870
7871         * same.c (same_name): Reorder tests so as to avoid calling stat()
7872         when a string comparison is sufficient.
7873
7874 2003-01-11  Bruno Haible  <bruno@clisp.org>
7875
7876         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7877         'unsigned int'.
7878
7879 2003-01-11  Bruno Haible  <bruno@clisp.org>
7880
7881         * hash-pjw.c: Add comment about low quality of this function.
7882
7883 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7884
7885         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7886         to avoid collisions with libcurses and libreadline.
7887
7888         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7889         * getstr.h, getstr.c: Remove.
7890         * getline.c: Include "getline.h", to check interface.
7891         Move body of old getstr.c here: this defines MIN_CHUNK and
7892         declares getdelim2, which is renamed from getstr.
7893         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7894
7895         * linebuffer.c (readlinebuffer): Renamed from readline.
7896         All uses changed.
7897         * linebuffer.h: Likewise.
7898         (readline): Remove backward-compatibility macro.
7899
7900 2003-01-12  Jim Meyering  <jim@meyering.net>
7901
7902         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7903
7904 2003-01-10  Bruno Haible  <bruno@clisp.org>
7905
7906         * alloca_.h: New file.
7907         * getdate.y: Unconditionally include alloca.h.
7908         * makepath.c: Likewise.
7909         * setenv.c: Likewise.
7910         * userspec.c: Likewise.
7911
7912 2003-01-09  Bruno Haible  <bruno@clisp.org>
7913
7914         * stdbool.h.in: New file.
7915
7916 2003-01-08  Bruno Haible  <bruno@clisp.org>
7917
7918         * safe-read.c: Include specification header first, to ensure its
7919         selfcontainedness.
7920         * full-write.c: Likewise.
7921
7922 2003-01-08  Jim Meyering  <jim@meyering.net>
7923
7924         * full-write.c: Undefine and define-away `const' after inclusion
7925         of errno.h, not before.  Suggestion from Bruno Haible.
7926
7927 2003-01-07  Jim Meyering  <jim@meyering.net>
7928
7929         * full-write.c: Rework so that it may serve to define full_read, too.
7930         * full-read.c: Simply #define FULL_READ and include full-write.c.
7931
7932 2003-01-06  Jim Meyering  <jim@meyering.net>
7933
7934         * version-etc.c: Update year in translatable copyright string.
7935
7936 2002-12-25  Bruno Haible  <bruno@clisp.org>
7937
7938         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7939         * xstrtol.h: Likewise.
7940         * xstrtoimax.c: Likewise.
7941         * xstrtoumax.c: Likewise.
7942         * human.h: Likewise.
7943
7944         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7945         on systems that have <inttypes.h> but not <stdint.h>.
7946
7947 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7948
7949         * memcoll.c (memcoll): Fall back on a simple algorithm using
7950         memcmp if strcoll doesn't work.
7951
7952 2002-12-23  Bruno Haible  <bruno@clisp.org>
7953
7954         * localcharset.h: New file.
7955         * localcharset.c: Include it.
7956         * unicodeio.c: Likewise.
7957
7958 2002-12-22  Bruno Haible  <bruno@clisp.org>
7959
7960         * utime.c (utime_null): No need to call ftruncate if the file was
7961         nonempty.
7962
7963 2002-12-23  Bruno Haible  <bruno@clisp.org>
7964
7965         * memcoll.c (STRCOLL): New macro.
7966         (memcoll): Use it.
7967
7968 2002-12-22  Bruno Haible  <bruno@clisp.org>
7969
7970         * getstr.h (getstr): Define, to avoid clash with libcurses.
7971         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7972
7973 2002-12-22  Bruno Haible  <bruno@clisp.org>
7974
7975         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7976
7977 2002-12-23  Bruno Haible  <bruno@clisp.org>
7978
7979         * getline.h: Include <stddef.h>, for size_t.
7980
7981         * unicodeio.h: Include <stddef.h>, for size_t.
7982         * unicodeio.c: Don't include <stddef.h>.
7983
7984 2002-12-17  Bruno Haible  <bruno@clisp.org>
7985
7986         * canon-host.c (strdup): Remove unused declaration.
7987
7988         * fsusage.c: Include full_read.h.
7989         (get_fs_usage): Use full_read instead of safe_read.
7990
7991         * utime.c (utime_null): Use SAFE_READ_ERROR.
7992
7993 2002-12-11  Bruno Haible  <bruno@clisp.org>
7994
7995         * setenv.h: Rewritten to cope with systems that have setenv() but not
7996         unsetenv().
7997         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7998         modifications:
7999
8000         2002-12-11  Bruno Haible  <bruno@clisp.org>
8001
8002                 * setenv.c (alloca): Fall back to malloc.
8003                 (freea): New macro.
8004                 (setenv): Use freea() to free memory allocated with alloca().
8005
8006         2002-11-13  Bruno Haible  <bruno@clisp.org>
8007
8008                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8009                 function declarations.
8010                 * unsetenv.c (unsetenv): Likewise.
8011
8012         2002-03-04  Bruno Haible  <bruno@clisp.org>
8013
8014                 Portability to AIX 4.3.3.
8015                 * unsetenv.c: New file, extracted from setenv.c.
8016                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8017
8018         2001-12-20  Bruno Haible  <bruno@clisp.org>
8019
8020                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8021                 use malloc instead. For SunOS 4.
8022
8023         2001-12-11  Bruno Haible  <bruno@clisp.org>
8024
8025                 * setenv.c: Declare alloca.
8026                 (compar_fn_t): New typedef.
8027                 (KNOWN_VALUE, STORE_VALUE): Use it.
8028
8029         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8030         setenv.h.
8031
8032 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8033
8034         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8035         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8036         Choose values that are less likely to collide with system fnmatch
8037         options.
8038         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8039         defined (e.g., a pure POSIX system).
8040         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8041         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8042
8043 2002-12-06  Jim Meyering  <jim@meyering.net>
8044
8045         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8046
8047         Merge in changes from libc's misc/error.c, in preparation
8048         for the merge of gnulib's changes back into libc.
8049
8050         * error.c (_): Define only if not already defined.
8051         Move definition to follow all #include directives.
8052         Include unlocked-io.h only if !_LIBC.
8053         [_LIBC]: Include <libio/libioP.h>.
8054         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8055         (fflush): Tweak definition to use INTUSE.
8056         (putc): Define.
8057
8058 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8059
8060         * alloca.c [defined emacs]: Include "lisp.h".
8061         (xalloc_die) [defined emacs]: New macro.
8062         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8063         [! defined emacs]: Include <xalloc.h>.
8064         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8065         (pointer): Typedef to POINTER_TYPE *.
8066         (malloc): Remove decl; we now always use xmalloc.
8067         (alloca): Use old-style definition, since Emacs needs this.
8068         Check for arithmetic overflow when computing combined size.
8069
8070 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8071
8072         Do not generate unlocked-io.h automatically, since it's easier to
8073         maintain it by hand.
8074
8075         * unlocked-io.h: New file, from GNU diffutils,
8076         but with proper copyright notice and attribution.
8077         * gen-uio: Remove.
8078         * Makefile.am: Add copyright notice.
8079         (libfetish_a_SOURCES): Add unlocked-io.h.
8080         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8081         (DISTCLEANFILES, io_functions): Remove macros.
8082         (EXTRA_DIST): Remove gen_uio.
8083         (unlocked-io.h): Remove rule.
8084
8085 2002-12-04  Jim Meyering  <jim@meyering.net>
8086
8087         Reflect the fact that stat.c and lstat.c are no longer generated.
8088         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8089         (DISTCLEANFILES): Likewise.
8090         (EXTRA_DIST): Likewise.
8091         (all_local): Don't depend on stat.c or lstat.c.
8092         (stat.c, lstat.c): Remove rules.
8093         (EXTRA_DIST): Remove xstat.in.
8094
8095         * xstat.in: Remove file.  Contents moved into stat.c.
8096         * stat.c: New file.  Contents mostly from xstat.in.
8097         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8098         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8099
8100         * safe-read.c: Rework so that it may serve to define safe_write, too.
8101         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8102
8103 2002-12-03  Jim Meyering  <jim@meyering.net>
8104
8105         * safe-read.c, safe-write.c: Change variable names and comments, but
8106         not semantics, to minimize the differences between these two files.
8107         (safe_read): Change comment to mention SAFE_READ_ERROR.
8108
8109         * safe-read.c (IS_EINTR): Define.
8110         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8111
8112 2002-12-02  Bruno Haible  <bruno@clisp.org>
8113
8114         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8115         Define, taken from safe-read.c.
8116         (INT_MAX): Provide fallback.
8117         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8118         * safe-write.h (SAFE_WRITE_ERROR): Define.
8119
8120         * safe-read.c (EINTR): Remove definition.
8121         (safe_read): Don't use EINTR if it is absent.
8122
8123 2002-12-02  Jim Meyering  <jim@meyering.net>
8124
8125         * safe-read.c (EINTR): Define.
8126         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8127         (INT_MAX): Provide fallback.
8128         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8129
8130         * safe-read.h (SAFE_READ_ERROR): Define.
8131
8132 2002-12-01  Jim Meyering  <jim@meyering.net>
8133
8134         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8135         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8136
8137 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8138
8139         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8140         hash_rehash): Replace `if (limit <= value) abort ();' with
8141         `if (! (value < limit)) abort ();', for readability.
8142
8143 2002-11-26    <karl@gnu.org>
8144
8145         * strdup.c: copy from libc again, with jim's ok.
8146         * .cppi-disable: re-add strdup.c
8147
8148 2002-11-25    <karl@gnu.org>
8149
8150         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8151         instead of "strtol.c".
8152
8153 2002-11-25  Jim Meyering  <jim@meyering.net>
8154
8155         * mktime.c: Sync from libc, now that it has the latest fix.
8156
8157 2002-11-24    <karl@gnu.org>
8158
8159         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8160         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8161
8162 2002-11-24  Jim Meyering  <jim@meyering.net>
8163
8164         Update from coreutils:
8165
8166         * mktime.c: Merge in changes from libc.
8167
8168         Avoid a link-time failure on some Linux systems.
8169         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8170         (__mon_yday): Declare with the STATIC attribute.
8171         (__mktime_internal): Likewise.
8172         Based on a report from Greg Schafer.
8173
8174 2002-11-23  Jim Meyering  <jim@meyering.net>
8175
8176         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8177         Use `unsigned', not `int', as type of index.
8178
8179         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8180
8181         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8182
8183 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8184
8185         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8186         hint that one should use `if (! x) abort ();' rather than `assert
8187         (x);', and anyway it's one less thing to worry about configuring.
8188         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8189         hash_rehash, hash_insert): Use abort rather than assert.
8190
8191 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8192
8193         * quotearg.h: Allow multiple inclusion by surrounding with
8194         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8195         so that we can be included first.
8196         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8197         * quotearg.c: Include quotearg.h immediately after config.h.
8198         No need to include stddef.h or sys/types.h any more.
8199         Surround local include files with "", not "<>".
8200         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8201         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8202         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8203         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8204         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8205         (ISPRINT): Remove; no longer needed now that we assume C89.
8206
8207         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8208         Preserve errno.
8209
8210         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8211         quotearg_char): Use SIZE_MAX rather than
8212         (size_t) -1 when we are talking about "infinity".
8213
8214         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8215
8216 2002-11-22  Bruno Haible  <bruno@clisp.org>
8217
8218         * safe-read.h: Assume C89. Add comments.
8219         (safe_read): Change return type to size_t.
8220         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8221         counts > SSIZE_MAX correctly.
8222         * safe-write.h: New file.
8223         * safe-write.c: New file.
8224         * full-read.h: New file.
8225         * full-read.c: New file.
8226         * full-write.h: Assume C89. Add comments.
8227         * full-write.c: Include safe-write.h.
8228         (full_write): Rewritten to use safe_write.
8229         Suggested by Jim Meyering and Paul Eggert.
8230
8231 2002-11-21  Bruno Haible  <bruno@clisp.org>
8232
8233         Remove case insensitive option matching.
8234         * argmatch.h (argcasematch): Remove declaration.
8235         (ARGCASEMATCH): Remove macro.
8236         (__xargmatch_internal): Remove case_sensitive argument.
8237         (XARGMATCH): Update.
8238         (XARGCASEMATCH): Remove macro.
8239         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8240         case_sensitive argument.
8241         (argcasematch): Remove function.
8242         (__xargmatch_internal): Remove case_sensitive argument.
8243         (main): Use XARGMATCH instead of XARGCASEMATCH.
8244
8245         * xmalloc.c: Change compile-time error message. Add comment about
8246         required autoconf version.
8247
8248 2002-11-21  Jim Meyering  <jim@meyering.net>
8249
8250         * strdup.c (strdup): Tweak comment and initial #if/#include.
8251
8252         Merge in changes from the coreutils.
8253
8254         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8255         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8256         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8257         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8258         int.  Work more efficiently if X is the same width as uintmax_t.
8259         Do not compare X to -1, to avoid bogus compiler warning.
8260         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8261         Don't assume that f_frsize and f_bsize are the same type.
8262
8263         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8264         on FreeBSD.
8265
8266         * makepath.c (make_path): Restore umask *before* creating the final
8267         component.
8268         (make_path): Minor reformatting.
8269
8270         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8271         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8272
8273         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8274         ones.  At least on GNU/Linux systems, `auto' means something else.
8275         From Michael Stone.
8276
8277 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8278
8279         Merge argmatch cleanups from Bison.  Assume C89.
8280
8281         * argmatch.c: Include config.h here, not in argmatch.h.
8282         Include stdlib.h, for EXIT_FAILURE.
8283         Always include <string.h>, since we assume C89.
8284         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8285         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8286         Include <stddef.h> instead, since it's all we need for size_t.
8287         (PARAMS): Remove.  All uses removed.
8288         (ARRAY_CARDINALITY): Do not bother to #undef.
8289         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8290         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8291         Remove unnecessary parentheses.
8292         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8293         Insert necessary parentheses.
8294         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8295         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8296
8297 2002-11-19  Bruno Haible  <bruno@clisp.org>
8298
8299         * mbswidth.c: Include mbswidth.h right at the beginning.
8300         * mbswidth.h: Include <stddef.h>, for size_t.
8301
8302         * mbswidth.h (PARAMS): Remove macro.
8303         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8304         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8305
8306         * gcd.h (PARAMS): Remove macro.
8307         (gcd): Use ANSI C function declarations.
8308         * gcd.c (gcd): Likewise.
8309
8310 2002-11-15  Bruno Haible  <bruno@clisp.org>
8311
8312         * strcspn.c: Include <stddef.h>.
8313         (strcspn): Use ANSI C function declaration. Change return type to
8314         size_t. Use NULL.
8315         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8316         (strpbrk): Use NULL.
8317         * strpbrk.h (PARAMS): Remove macro.
8318         (strpbrk): Use ANSI C function declaration.
8319         * strstr.c: Don't include <sys/types.h>.
8320         * strstr.h (PARAMS): Remove macro.
8321         (strstr): Use ANSI C function declarations.
8322
8323 2002-11-06  Bruno Haible  <bruno@clisp.org>
8324
8325         * gcd.h (gcd): Change argument type to 'unsigned long'.
8326         * gcd.c (gcd): Likewise.
8327
8328 2002-11-05  Bruno Haible  <bruno@clisp.org>
8329
8330         * gcd.h: New file, from gettext-0.11.5.
8331         * gcd.c: New file, from gettext-0.11.5.
8332
8333 2002-11-05  Bruno Haible  <bruno@clisp.org>
8334
8335         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8336         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8337         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8338         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8339
8340         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8341         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8342
8343         * closeout.c: Include gettext.h instead of <libintl.h>.
8344         * human.c: Include gettext.h instead of <libintl.h>.
8345         * quotearg.c: Include gettext.h instead of <libintl.h>.
8346         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8347         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8348         * userspec.c: Include gettext.h instead of <libintl.h>.
8349         * version-etc.c: Include gettext.h instead of <libintl.h>.
8350         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8351         (textdomain): Remove definition.
8352         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8353
8354         * long-options.c: Remove include of <libintl.h> and definition of _.
8355         * same.c: Remove include of <libintl.h> and definition of _.
8356
8357 2002-11-04  Bruno Haible  <bruno@clisp.org>
8358
8359         * stpcpy.h: New file, from GNU gettext-0.11.5.
8360         * strcase.h: New file, from GNU gettext-0.11.5.
8361         * strpbrk.h: New file, from GNU gettext-0.11.5.
8362         * strstr.h: New file, from GNU gettext-0.11.5.
8363         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8364
8365 2002-05-09  Bruno Haible  <bruno@clisp.org>
8366
8367         * config.charset: Update for newest glibc. Add canonical names
8368         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8369
8370 2002-05-09  Bruno Haible  <bruno@clisp.org>
8371
8372         * localcharset.c (get_charset_aliases): Add more Windows specific
8373         aliases.
8374
8375 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8376
8377         * config.charset: A few additions for Solaris.
8378
8379 2001-12-05  Bruno Haible  <bruno@clisp.org>
8380
8381         * localcharset.c (locale_charset): Don't return an empty string.
8382
8383 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8384
8385         * config.charset: msdos in uk_UA uses CP1125.
8386
8387 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8388
8389         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8390         * localcharset.c (locale_charset): Declare as extern "C".
8391
8392 2002-02-15  Bruno Haible  <bruno@clisp.org>
8393
8394         * config.charset [msdosdjgpp]: For Russian, use CP866.
8395
8396 2002-02-11  Bruno Haible  <bruno@clisp.org>
8397
8398         * config.charset: Add support for NetBSD.
8399
8400 2002-09-25    <karl@gnu.org>
8401
8402         * strdup.c: copy from libc/string (via ../config/srclist*).
8403         * getopt*: copy from libc/posix.
8404         * gettext.h: copy from gettext.
8405         * .cppi-disable: add strdup.c, gettext.h.
8406
8407 2002-07-01  Jim Meyering  <meyering@lucent.com>
8408
8409         * c-stack.c: Include sys/time.h.
8410         From Volker Borchert.
8411
8412 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8413
8414         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8415         New macro.  Use it uniformly instead of
8416         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8417         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8418         reported by Vin Shelton.
8419
8420 2002-06-22  Jim Meyering  <meyering@lucent.com>
8421
8422         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8423         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8424
8425 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8426
8427         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8428         Do not assume SA_SIGINFO behavior.
8429         Bug reported by Jim Meyering on NetBSD 1.5.2.
8430
8431 2002-06-22  Jim Meyering  <meyering@lucent.com>
8432
8433         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8434
8435         * exitfail.c, exitfail.h: Likewise.
8436         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8437
8438         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8439         of fnmatch.h.
8440         (EXTRA_DIST): Add fnmatch_loop.c.
8441         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8442
8443         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8444         * fnmatch.c: Update from diffutils-2.8.2.
8445         * fnmatch_.h: New file.  From diffutils-2.8.2.
8446         * fnmatch.h: Remove file.
8447
8448 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8449
8450         * file-type.h: Report an error if neither S_ISREG nor
8451         S_IFREG is defined, instead of using a test specific to glibc
8452         2.2.  This should be safe, since POSIX requires S_ISREG and
8453         Unix Version 7 had S_IFREG.  We don't need to check for
8454         <sys/types.h> since we don't use any symbols that it defines.
8455
8456 2002-06-15  Jim Meyering  <meyering@lucent.com>
8457
8458         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8459         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8460         have been included before this file.
8461
8462 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8463
8464         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8465         so that each temporary file name is unique and valid in the first
8466         8 characters, for operation under DOS.
8467
8468 2002-06-15  Jim Meyering  <meyering@lucent.com>
8469
8470         Work even with DJGPP 2.03, which lacks support for symlinks.
8471         From Richard Dawe.
8472         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8473         is defined.
8474         * lchown.c (S_ISLNK): Likewise.
8475
8476 2002-06-14  Jim Meyering  <meyering@lucent.com>
8477
8478         * file-type.h: Use the version from diffutils-2.8.2.
8479         * file-type.c: Likewise.
8480
8481 2002-05-27  Jim Meyering  <meyering@lucent.com>
8482
8483         Fix a problem seen only on nonconforming systems whereby ls.c's
8484         use of localtime, and then of gettimeofday would cause trouble:
8485         the localtime call used to initialize rpl_gettimeofday's save
8486         mechanism would clobber ls's current local time information so
8487         that in any long listing the first file would always be listed
8488         with date 1970-01-01.  Analysis by Volker Borchert.
8489
8490         * gettimeofday.c (localtime): Undefine.
8491         (rpl_localtime): New function.
8492
8493 2002-05-22  Jim Meyering  <meyering@lucent.com>
8494
8495         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8496         * file-type.h: New file.
8497         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8498
8499 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8500
8501         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8502
8503 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8504
8505         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8506         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8507         of 127, since 64 is the largest conceivable number for ancient
8508         nonstandard hosts.
8509         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8510
8511 2002-04-28  Jim Meyering  <meyering@lucent.com>
8512
8513         * sig2str.c (WTERMSIG): Remove definition (unused).
8514
8515 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8516
8517         * sig2str.h, sig2str.c: New files.
8518         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8519
8520 2002-04-24  Jim Meyering  <meyering@lucent.com>
8521
8522         * gettext.h: New file, from Gettext.
8523         * Makefile.am (INCLUDES): Remove -I../intl.
8524         (libfetish_a_SOURCES): Add gettext.h.
8525
8526 2002-04-16  Jim Meyering  <meyering@lucent.com>
8527
8528         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8529         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8530         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8531
8532 2002-04-12  Jim Meyering  <meyering@lucent.com>
8533
8534         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8535
8536 2002-03-10  Jim Meyering  <meyering@lucent.com>
8537
8538         * makepath.c (make_path): Remove a comma from a diagnostic.
8539         Suggestion from Santiago Vila.
8540
8541 2002-03-08  Jim Meyering  <meyering@lucent.com>
8542
8543         * rename.c: Mention that this wrapper is needed also on
8544         mips-dec-ultrix4.4 systems.
8545
8546 2002-03-02  Jim Meyering  <meyering@lucent.com>
8547
8548         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8549         not HAVE_CLOCK_SETTIME.
8550
8551 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8552
8553         * nanosleep.h: Rename to....
8554         * timespec.h: New name for nanosleep.h.  All uses changed.
8555
8556         * gettime.c: New file.
8557         * settime.c: New file.
8558         * stime.c: Remove.
8559
8560         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8561         timespec.h.  Remove nanosleep.h.
8562
8563 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8564
8565         * acl.c, acl.h: New files.
8566         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8567
8568 2002-02-24  Jim Meyering  <meyering@lucent.com>
8569
8570         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8571         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8572         cause trouble.  Reported by Nelson Beebe.
8573
8574 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8575
8576         * path-concat.c (xpath_concat): Reorder code to pacify
8577         compilers that don't know that xalloc_die never returns.
8578
8579 2002-02-20  Jim Meyering  <meyering@lucent.com>
8580
8581         * getdate.c: Regenerate using bison-1.33.
8582
8583 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8584
8585         * posixver.c, posixver.h: New files.
8586         * Makefile.am (libfetish_a_SOURCES): Add them.
8587
8588 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8589             Bruno Haible  <bruno@clisp.org>
8590
8591         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8592         (fwrite_success_callback): New declaration.
8593         * unicodeio.c (unicode_to_mb): New function, extracted from
8594         print_unicode_char. Call failure callback instead of error.
8595         (fwrite_success_callback): New function.
8596         (exit_failure_callback): New function.
8597         (fallback_failure_callback): New function.
8598         (print_unicode_char): Call unicode_to_mb.
8599
8600 2002-01-26  Jim Meyering  <meyering@lucent.com>
8601
8602         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8603
8604 2002-01-22  Jim Meyering  <meyering@lucent.com>
8605
8606         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8607         Otherwise, some versions of automake would omit the rule that makes
8608         Makefile from Makefile.in.
8609
8610 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8611
8612         * xmemcoll.h, xmemcoll.c: New files.
8613         * Makefile.am (libfetish_a_SOURCES): Add them.
8614         * memcoll.c: Include errno.h, and declare errno if not defined.
8615         (memcoll): Set errno to zero if there is no error.
8616
8617         * quotearg.c (quotearg_buffer_restyled):
8618         Fix bug with quoting buffers containing NUL when backslashing escapes.
8619         This bug was exposed by the other changes in this patch.
8620         (quotearg_n_options): New arg ARGSIZE.
8621         All callers changed.
8622         (quoting_options_from_style): New function.
8623         (quotearg_n_style): Use it.
8624         (quotearg_n_style_mem): New function.
8625
8626         * quotearg.h (quotearg_n_style_mem): New function.
8627
8628 2002-01-16  Jim Meyering  <meyering@lucent.com>
8629
8630         * getdate.y: Add three semicolons, each just before a closing brace.
8631         Bison (as of version 1.31) no longer papers over that mistake.
8632
8633 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8634
8635         * backupfile.c (ISDIGIT): Comment fix.
8636         * getdate.y (ISDIGIT): Likewise.
8637         * posixtm.c (ISDIGIT, year): Likewise.
8638         * strverscmp.c (ISDIGIT): Likewise.
8639         * userspec.c (ISDIGIT): Likewise.
8640
8641 2002-01-05  Jim Meyering  <meyering@lucent.com>
8642
8643         * version-etc.c (version_etc_copyright): Update copyright year.
8644
8645 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8646
8647         * closeout.c (close_stdout_status): If ferror (stdout), do
8648         not silently exit merely because the output buffer happens to
8649         have nothing pending.
8650
8651 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8652
8653         See the big note in ../ChangeLog.
8654         * human.c (suffixes): Prefer K to k for 1024.
8655         (generate_suffix_backwards): New function.
8656         (human_readable_inexact): Use it.
8657         * xstrtol.c (__xstrtol): If there is no number but there
8658         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8659         Accept 'K' as well as 'k'.
8660
8661 2001-12-15  Jim Meyering  <meyering@lucent.com>
8662
8663         * regex.h (__restrict_arr): Update from libc.
8664
8665         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8666         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8667         (STREQ): Define.
8668
8669 2001-12-10  Jim Meyering  <meyering@lucent.com>
8670
8671         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8672         Instead, include "xalloc.h".
8673         (initbuffer): Don't cast xmalloc return value to char*.
8674         (readline): Reword comment.
8675         Don't cast xrealloc return value to char*
8676         Return NULL, not 0.
8677
8678 2001-12-09  Jim Meyering  <meyering@lucent.com>
8679
8680         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8681         `signed and unsigned type in conditional expression'.
8682         * posixtm.c (posix_time_parse): Likewise.
8683
8684         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8685
8686         * readtokens.c (readtoken): Declare an index to be of type unsigned
8687         to avoid a pedantic warning.
8688
8689         * getstr.c: Don't include assert.h.
8690         (getstr): Remove warning-evoking assertions.
8691         Return -1 if offset parameter is out of bounds.
8692         Change the type of a local from int to size_t.
8693
8694         * strftime.c (my_strftime_localtime_r): Include this function
8695         definition in the `#if ! HAVE_TM_GMTOFF' block.
8696
8697         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8698         Include xalloc.h instead.
8699
8700 2001-12-02  Jim Meyering  <meyering@lucent.com>
8701
8702         * tempname.c: Don't declare getenv, thus reverting the change of
8703         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8704         included.
8705
8706         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8707         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8708
8709 2001-11-30  Akim Demaille  <akim@epita.fr>
8710
8711         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8712         before being defined.
8713
8714 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8715
8716         * quotearg.h (quotearg_n, quotearg_n_style):
8717         First arg is int, not unsigned.
8718         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8719         (SIZE_MAX, UINT_MAX): New macros.
8720         (quotearg_n_options): Abort if N is negative.
8721         Avoid overflow check on hosts where size_t is 64 bits and int
8722         is 32 bits, as overflow is impossible there.
8723         Fix off-by-one typo that caused unnecessary reallocation.
8724
8725 2001-11-27  Jim Meyering  <meyering@lucent.com>
8726
8727         * tempname.c: Merge with version from libc.
8728         * regex.c: Likewise.
8729
8730         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8731         for which STDC_HEADERS is 0, it was not included, resulting in a
8732         warning about an integer-to-pointer conversion problem with getenv.
8733         Reported by Volker Borchert.
8734
8735 2001-11-26  Jim Meyering  <meyering@lucent.com>
8736
8737         * gtod.h: Remove file.
8738         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8739         * gettimeofday.c: Don't include gtod.h.
8740         (GTOD_init): Remove function.
8741         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8742         Suggestion from Volker Borchert.
8743
8744 2001-11-23  Jim Meyering  <meyering@lucent.com>
8745
8746         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8747         * hash.c (struct hash_table): Define it here instead.
8748
8749 2001-11-22  Jim Meyering  <meyering@lucent.com>
8750
8751         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8752
8753 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8754
8755         * tempname.c (TMP_MAX): Remove; no longer needed.
8756         (TEMPORARIES): New macro.
8757         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8758         removes an artificial limitation (e.g. HP-UX 10.20, where
8759         TMP_MAX is 17576).
8760
8761 2001-11-18  Jim Meyering  <meyering@lucent.com>
8762
8763         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8764         on SunOS 4.
8765
8766         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8767         files will be created before anything else.
8768
8769 2001-11-17  Jim Meyering  <meyering@lucent.com>
8770
8771         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8772         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8773         rather than group writable.  Patch by Juan F. Codagnone.
8774
8775         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8776         Instead, include "xalloc.h".
8777
8778         * mountlist.c: Include unlocked-io.h after all system headers.
8779         Remove explicit declarations of xmalloc, xrealloc,
8780         and xstrdup.  Instead, include "xalloc.h".
8781
8782         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8783         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8784         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8785
8786         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8787         Reported by Padraig Brady.
8788
8789         * mkstemp.c: #undef mkstemp.
8790         Include config.h.
8791         (rpl_mkstemp): Rename from mkstemp.
8792         Protoize.
8793
8794 2001-11-16  Jim Meyering  <meyering@lucent.com>
8795
8796         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8797         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8798         determine the amount of total physical memory, use pstat_getstatic.
8799         HPUX-11 doesn't define _SC_PHYS_PAGES.
8800         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8801         If sysconf couldn't be used to determine the amount of available
8802         physical memory, use both pstat_getstatic and pstat_getdynamic.
8803         Based on a patch from Bob Proulx.
8804
8805 2001-11-05  Jim Meyering  <meyering@lucent.com>
8806
8807         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8808
8809 2001-11-03  Jim Meyering  <meyering@lucent.com>
8810
8811         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8812         in argmatch_to_argument call.
8813
8814         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8815         argument.
8816
8817         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8818         e.g., a fault due to an attempt to free a NULL pointer.
8819
8820 2001-11-01  Jim Meyering  <meyering@lucent.com>
8821
8822         * dirfd.c, dirfd.h: New files.
8823         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8824
8825         * hash.c (hash_print) [TESTING]: Clean up.
8826
8827 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8828
8829         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8830         to avoid a warning if -Wall.
8831
8832 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8833
8834         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8835
8836 2001-10-21  Jim Meyering  <meyering@lucent.com>
8837
8838         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8839         this code would end up calling gettext even in packages built
8840         with --disable-nls.
8841         * getopt.c (_): Likewise.
8842         * regex.c (_): Likewise.
8843
8844 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8845
8846         * error.c (strerror_r): Do not declare unless !_LIBC.
8847         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8848         Use strerror_r that is only a macro, even if it is not a function.
8849         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8850         (private_strerror): Use prototypes, not old-style function definition.
8851         (print_errno_message): New function.
8852         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8853         char*-flavored one.
8854         (error_tail, error, error_at_line): Use it.
8855
8856 2001-10-11  Jim Meyering  <meyering@lucent.com>
8857
8858         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8859         and quote_n (1, ... to avoid clobbering a buffer.
8860
8861 2001-10-05  Jim Meyering  <meyering@lucent.com>
8862
8863         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8864         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8865         * hash-pjw.h: New file.
8866
8867 2001-09-30  Jim Meyering  <meyering@lucent.com>
8868
8869         * mountlist.c [MOUNTED_GETFSSTAT]:
8870         Include <sys/ucred.h>, for Apple Darwin.
8871         Include sys/mount.h and sys/fs_types.h only if available.
8872         (FS_TYPE): Define.
8873         (read_filesystem_list): Use FS_TYPE.
8874
8875 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8876
8877         * exclude.c (excluded_filename): 0 -> false, since it's
8878         a boolean context.
8879
8880 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8881
8882         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8883         #defines strtoimax.  Also treat the other strto* functions
8884         like strtoimax.
8885
8886         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8887         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8888         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8889
8890 2001-09-26  Jim Meyering  <meyering@lucent.com>
8891
8892         Most macros in unlocked-io.h had the wrong number of arguments.
8893         * gen-uio: New script.
8894         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8895         * unlocked-io.hin: Remove file.
8896         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8897         rather than trying to embed it here.
8898         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8899         Reported by Padraig Brady.
8900
8901 2001-09-25  Volker Borchert  <bt@teknon.de>
8902
8903         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8904
8905 2001-09-23  Jim Meyering  <meyering@lucent.com>
8906
8907         * mountlist.c: Remove useless parentheses in #if directives.
8908         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8909         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8910
8911 2001-09-22  Jim Meyering  <meyering@lucent.com>
8912
8913         * localcharset.c: Update from latest gettext.
8914         * config.charset: Likewise.
8915
8916 2001-09-20  Jim Meyering  <meyering@lucent.com>
8917
8918         * xstrtol.c (strtoimax): Guard declaration with
8919         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8920         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8921         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8922         (strtoumax): Likewise, for completeness (it wasn't necessary).
8923
8924 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8925
8926         * strtoimax.c (HAVE_LONG_LONG):
8927         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8928         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8929         to work around bug in IBM C compiler.
8930
8931 2001-09-16  Jim Meyering  <meyering@lucent.com>
8932
8933         * mkdir.c: New file.
8934
8935 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8936
8937         * xgetcwd.c: Revert some of the previous change; intead,
8938         fix the HAVE_GETCWD_NULL code to behave more like the
8939         !HAVE_GETCWD_NULL code used to.
8940
8941         Include "xalloc.h".
8942         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8943         invoke xalloc_die.
8944
8945 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8946
8947         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8948         Use ssize_t, not int, to store result of readlink.
8949         Check for ssize_t overflow as well as size_t overflow,
8950         as POSIX says the result of readlink is implementation-defined
8951         when ssize_t overflows.
8952         Remove unnecessary cast to char*.
8953         Use free+malloc instead of realloc, as the storage doesn't need
8954         to be preserved and it's clearer and can be more efficient that way.
8955         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8956         * xreadlink.h (xreadlink): Update prototype.
8957
8958 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8959
8960         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8961         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8962         spotted by Jim Meyering.
8963
8964 2001-09-03  Jim Meyering  <meyering@lucent.com>
8965
8966         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8967
8968 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8969
8970         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8971         like the HAVE_GETCWD_NULL code.
8972         Include pathmax.h if not HAVE_GETCWD.
8973         Do not include xalloc.h.
8974         (INITIAL_BUFFER_SIZE): New symbol.
8975         Do not use xmalloc / xrealloc, since the caller is responsible for
8976         handling errors.  Preserve errno around `free' during failure.
8977         Do not overrun buffer when using getwd.
8978
8979 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8980
8981         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8982         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8983
8984 2001-09-02  Jim Meyering  <meyering@lucent.com>
8985
8986         * error.c: Update from GNU libc.
8987
8988 2001-09-01  Jim Meyering  <meyering@lucent.com>
8989
8990         * xreadlink.c: New file.
8991         * xreadlink.h: New file.
8992         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8993
8994         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8995         doesn't conflict with sparc Solaris 7's definition in
8996         /usr/include/sys/int_types.h.
8997
8998         * exclude.c: Use `""', not `<>' to #include non-system header files.
8999         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9000         and strncasecmp as r-values.  Unixware didn't have declarations.
9001
9002 2001-08-31  Jim Meyering  <meyering@lucent.com>
9003
9004         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9005         Use an initial, malloc'd, buffer of length 128 rather than
9006         a statically allocated one of length 1024.
9007
9008 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9009
9010         * xgetcwd.c: Don't include pathmax.h.
9011         Include stdlib.h and unistd.h if available.
9012         Include xalloc.h.
9013         (xmalloc, xstrdup, free): Remove decls.
9014         (xgetcwd): Don't assume sizes fit in unsigned.
9015         Check for overflow when computing sizes.
9016         Simplify reallocation code.
9017
9018 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9019
9020         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9021
9022         * strtoimax.c: Renamed from strtoxmax.c, removing the
9023         old strtoimax.c.
9024
9025         Also, make the following further changes to make this file's
9026         configuration more similar to that of strtol.c:
9027         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9028         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9029         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9030         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9031         changed to signed values.
9032
9033         And make the following changes as well:
9034         Fix copyright notice, as 1999 was missing.
9035         (verify): New macro.
9036         (strtoimax): Check sizes at compile-time, not run-time.
9037         Prefer strtol to strtoll if both work.
9038         (main): Remove; it was not that useful and was a pain to maintain.
9039
9040         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9041
9042 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9043
9044         * savedir.c (savedir): Remove size parameter, as POSIX says that
9045         a directory's st_size can have an arbitrary value, so the old
9046         usage could waste an arbitrary amount of memory.  All uses
9047         changed.
9048         * savedir.h: Update prototype.
9049
9050 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9051
9052         * xstrtol.c (strtoimax): New decl.
9053
9054 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9055
9056         * xstrtol.h: Add copyright notice.
9057         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9058         LONGINT_INVALID_SUFFIX_CHAR.
9059
9060 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9061
9062         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9063         tm to be declared.
9064
9065 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9066
9067         * hash.c: Remove '2001' from copyright notice.
9068
9069 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9070
9071         * full-write.h: New file.
9072         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9073         * full-write.c: Correct credits, as cccp.c no longer
9074         exists and anyway it was so heavily changed from the old cccp
9075         code as to be unrecognizable.  Include full-write.h.
9076         (full_write) Return size_t, with short writes meaning failure.
9077         All callers changed.  This fixes a bug with large buffers
9078         on 64-bit hosts.
9079         * utime.c: Include full-write.h.
9080
9081 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9082
9083         Merge 'exclude' changes from tar 1.13.22.
9084         This fixes one or two unlikely storage allocation overflow bugs,
9085         but doesn't change user-visible behavior otherwise.
9086
9087 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9088
9089         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9090         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9091         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9092         Include if available.
9093         (<xalloc.h>): Include
9094         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9095         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9096         collide with FNM macros.
9097         (struct patopts): New struct.
9098         (struct exclude): Use it, as exclude patterns now come with options.
9099         (new_exclude): Support above changes.
9100         (new_exclude, add_exclude_file):
9101         Initial size must now be a power of two to simplify overflow checking.
9102         (free_exclude, fnmatch_no_wildcards): New function.
9103         (excluded_filename): No longer requires options arg, as the options
9104         are determined by add_exclude.  Now returns bool, not int.
9105         (excluded_filename, add_exclude):
9106         Add support for the fancy new exclusion options.
9107         (add_exclude, add_exclude_file): Now takes int options arg.
9108         Check for arithmetic overflow when computing sizes.
9109         (add_exclude_file): xrealloc might modify errno, so don't
9110         realloc until after errno might be used.
9111
9112         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9113         New macros.
9114         (free_exclude): New decl.
9115         (add_exclude, add_exclude_file): Now takes int options arg.
9116         (excluded_filename): No longer requires options arg, as the options
9117         are determined by add_exclude.  Now returns bool, not int.
9118
9119 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9120
9121         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9122
9123 2001-08-27  Jim Meyering  <meyering@lucent.com>
9124
9125         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9126
9127         * version-etc.c (N_): Remove definition.
9128         Revert most of last change.
9129         Instead, simply don't mark the `Copyright...' string for translation.
9130         Based on advice from Paul Eggert.
9131
9132         * strtoxmax.c: Tweak comment.
9133
9134 2001-08-26  Jim Meyering  <meyering@lucent.com>
9135
9136         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9137         of copyright with `%s' so translators don't get an untranslated
9138         message in 2002.
9139         (COPYRIGHT_YEAR): Define.
9140         (version_etc): Use fprintf rather than fputs.
9141         Suggestion from Ulrich Drepper.
9142
9143         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9144
9145         * strtoll.c: New file, from GNU libc.
9146         * xstrtoimax.c: New file.
9147
9148         * xstrtol.h: Add xstrtoimax.
9149         * strtoumax.c: New file.  Simply include "strtoumax.c".
9150         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9151
9152         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9153         * strtoxmax.c: ... then renamed to this.
9154
9155 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9156
9157         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9158         Port to Solaris 8, where 'sed' requires a space after the 'r'
9159         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9160         Redirect output to $tmp just once.
9161
9162 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9163
9164         * addext.c (<errno.h>): Include.
9165         (errno): Declare if not defined.
9166         (addext): Work correctly when pathconf returns -1 and leaves
9167         errno alone because there is no limit.  Also, work even if
9168         pathconf returns a value greater than SIZE_MAX.
9169
9170 2001-08-12  Jim Meyering  <meyering@lucent.com>
9171
9172         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9173         Simply `return getcwd (NULL, 0);'.
9174         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9175         Use 1300 as initial value for length, not PATH_MAX.
9176
9177         * pathmax.h: Clean up cpp syntax.
9178
9179 2001-08-12  Jim Meyering  <meyering@lucent.com>
9180
9181         * gettimeofday.c: New file.
9182         * gtod.h: New file.
9183         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9184
9185 2001-08-04  Jim Meyering  <meyering@lucent.com>
9186
9187         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9188         to get in sync with glibc.
9189
9190 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9191
9192         The following changes are from gettext 0.10.39 as maintained by
9193         Bruno Haible.
9194
9195         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9196         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9197         with inverted sense.  All uses changed.
9198
9199         * mbswidth.c: Don't include <limits.h>.
9200         Include <stdlib.h> and <string.h> unconditionally.
9201         (iswcntrl, mbsinit, ISCNTRL): New macros.
9202         (mbsnwidth): Use K&R style function declarations.
9203         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9204         can optimize it when MB_CUR_MAX == 1.
9205         The width of control characters is zero, not 1.
9206
9207 2001-07-15  Jim Meyering  <meyering@lucent.com>
9208
9209         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9210         (BUILT_SOURCES): Add unlocked-io.h.
9211         (io_functions): Define.
9212         (unlocked-io.h): New rule.
9213         (DISTCLEANFILES): Add unlocked-io.h.
9214         (all-local): Depend on unlocked-io.h, to ensure it is created.
9215
9216         * unlocked-io.hin: New file
9217
9218         * regex.c: Update from glibc.
9219
9220 2001-07-05  Jim Meyering  <meyering@lucent.com>
9221
9222         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9223         recommendation.
9224         (libfetish_a_SOURCES): Put all .h files here instead.
9225         Remove a thus-exposed (better checks in automake) duplicate and
9226         two unnecessary .h files.
9227
9228 2001-06-11  Jim Meyering  <meyering@lucent.com>
9229
9230         * regex.c: Update from GNU libc.
9231
9232 2001-05-27  Jim Meyering  <meyering@lucent.com>
9233
9234         * readutmp.h (UT_TYPE): Define.
9235
9236 2001-05-24  Jim Meyering  <meyering@lucent.com>
9237
9238         * argmatch.c: Include "quote.h".
9239         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9240         quote function.  Reported by Göran Uddeborg.
9241
9242 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9243
9244         * dirname.c (dir_name): Compute append_dot using path, not newpath
9245         which is not yet declared.
9246
9247 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9248
9249         * Makefile.am (libfetish_a_SOURCES):
9250         Add strftime.c, since we now compile it on all hosts.
9251
9252         * strftime.c (my_strftime):
9253         Define to nstrftime if emacs, but only if my_strftime is not defined.
9254         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9255         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9256         Add one more extra argument: a nanoseconds value.
9257         All uses changed.
9258         (ns): New macro.
9259         (my_strftime function): Add %N format.
9260         (emacs_strftimeu): Renamed from emacs_strftime,
9261         with extra ut argument.
9262
9263 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9264
9265         dirname code cleanup.  base_name now behaves more compatibly
9266         with POSIX basename when given file names that have trailing
9267         slashes, and similarly for dir_name.  Add new primitives
9268         base_len and dir_len.  Put the directory-name-related decls
9269         into dirname.h.
9270
9271         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9272         * backupfile.c (base_name): Likewise.
9273         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9274         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9275         * makepath.c (strip_trailing_slashes): Likewise.
9276         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9277         Likewise.
9278         * rename.c (strip_trailing_slashes): Likewise.
9279         * same.c (base_name): Likewise.
9280         * stripslash.c (ISSLASH): Likewise.
9281
9282         * addext.c: Include <dirname.h> after size_t is defined.
9283         * backupfile.c: Likewise.
9284
9285         * addext.c (addext): Use base_len to trim redundant
9286         trailing slashes instead of doing it ourselves.
9287         But do not trim the last slash if it is not redundant.
9288
9289         * backupfile.c (find_backup_file_name,
9290         max_backup_version): Use base_len instead of rolling it ourselves.
9291         Handle the case of "" and (on DOS) "C:" correctly.
9292
9293         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9294         Include <string.h>, <dirname.h>.
9295         (base_name): Allow file names ending in slashes, other than names
9296         that are all slashes.  In this case, return the basename followed
9297         by the slashes.  This is more general, and can be used in places
9298         where the original base_name purposely had an assertion failure.
9299         (base_len): New function.
9300
9301         * dirname.c: Include <string.h> instead of <stdlib.h>.
9302         Do not include <assert.h>; no longer needed.
9303         Include xalloc.h.
9304         (memrchr): Remove decl.
9305         (dir_name_r): Remove.
9306         (dir_len): Renamed from dirlen.  All callers changed.
9307         Rewrite in terms of base_name, for simplicity and consistency.
9308         (dir_name): Never return NULL.  All callers changed.
9309         Do not include <stdlib.h> in test program; no longer needed.
9310         return 0; is fine for test program.
9311
9312         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9313         New macros.
9314         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9315
9316         * path-concat.c (path_concat): Use base_len to compute
9317         base length, not strlen; this means we cannot rely on memcpy
9318         to null-terminate.
9319
9320         * same.c (STREQ): Remove.
9321         (same_name): Handle the case where the basename ends in trailing '/'.
9322
9323         * stripslash.c (strip_trailing_slashes): Return nonzero if
9324         a slash was stripped.  Do not strip the last slash after a
9325         file system prefix.
9326
9327 2001-04-08  Jim Meyering  <meyering@lucent.com>
9328
9329         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9330         recomputed; that's necessary when the offset spans a DST transition.
9331         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9332
9333 2001-04-02  Jim Meyering  <meyering@lucent.com>
9334
9335         * regex.h, regex.c: Update from GNU libc.
9336
9337 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9338
9339         * version-etc.c (version_etc_copyright): Update to 2001.
9340
9341 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9342
9343         * tempname.c (uint64_t): Define to uintmax_t if
9344         not defined, and if UINT64_MAX is not defined.
9345         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9346         Reported by John David Anglin.
9347
9348 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9349
9350         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9351         alias if codeset is empty.
9352         * config.charset (BeOS): Use wildcard syntax.
9353
9354 2001-03-13  Jim Meyering  <meyering@lucent.com>
9355
9356         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9357         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9358         From Bruno Haible.
9359
9360 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9361
9362         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9363         Don't return NULL.
9364         * unicodeio.c (print_unicode_char): Simplify accordingly.
9365
9366 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9367
9368         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9369         support for DOS/DJGPP.
9370
9371 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9372
9373         * Makefile.am (libfetish_a_SOURCES):
9374         Add dup-safer.c, fopen-safer.c.
9375         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9376
9377         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9378
9379 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9380
9381         The mkstemp replacement is taken from glibc 2.2.2, with some
9382         portability fixes for use outside glibc, as follows:
9383
9384         * tempname.c (struct_stat64): New macro.
9385         (direxists, __gen_tempname): Use it.
9386         This avoids a portability problem with Solaris 8.
9387
9388         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9389         (<stddef.h>, <stdint.h>, <string.h>):
9390         Include only if STDC_HEADERS || _LIBC.
9391         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9392         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9393         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9394         (__set_errno): Define this macro if <errno.h> doesn't.
9395         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9396         Define these macros if <stdio.h> doesn't.
9397         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9398         Define these macros if <sys/stat.h>
9399         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9400         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9401         __xstat64): Define if not _LIBC.
9402         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9403         (__gen_tempname): Invoke gettimeofday only if
9404         HAVE_GETTIMEOFDAY || _LIBC;
9405         otherwise, fall back on plain "time".
9406         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9407
9408         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9409
9410         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9411
9412 2001-02-17  Jim Meyering  <meyering@lucent.com>
9413
9414         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9415         around included file name.
9416
9417         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9418
9419         * strftime.c: Update from GNU libc (the only changes were to comments).
9420
9421 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9422
9423         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9424
9425 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9426
9427         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9428         Remove workaround macros for hosts that have mbrtowc but not
9429         mbstate_t, as we now insist on proper declarations for both
9430         before using mbrtowc.
9431
9432 2001-02-17  Jim Meyering  <meyering@lucent.com>
9433
9434         * regex.c: Update from libc.
9435
9436 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9437
9438         * alloca.c (malloc): Undef before defining, since stdlib.h
9439         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9440         Reported by Mark Hounschell via Paul Eggert.
9441
9442 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9443
9444         * config.charset: Update for FreeBSD 4.2.
9445
9446 2001-01-26  Jim Meyering  <meyering@lucent.com>
9447
9448         * quotearg.c: Include stddef.h.
9449         * quote.c: Include stddef.h.
9450         Reported by Axel Kittenberger.
9451
9452         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9453         line in double quotes so that it evokes a better diagnostic.
9454         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9455         Reported by Axel Kittenberger.
9456
9457 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9458
9459         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9460         to avoid a warning.  Add back 'const' to inptr.
9461
9462 2001-01-16  Jim Meyering  <meyering@lucent.com>
9463
9464         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9465         From Bruno Haible.
9466
9467 2001-01-14  Jim Meyering  <meyering@lucent.com>
9468
9469         * rename.c: New file.  From Volker Borchert.
9470         Include stdlib.h, string.h or strings.h, and xalloc.h.
9471         Use strip_trailing_slashes rather than open-coding it.
9472
9473 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9474
9475         * strftime.c: Sync with glibc time/strftime.c 1.81.
9476
9477 2001-01-03  Jim Meyering  <meyering@lucent.com>
9478
9479         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9480         local `inptr' to avoid warning with some system declarations of iconv.
9481
9482 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9483
9484         * modechange.c: Do not assume that mode_t uses the
9485         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9486         the other-execute bit of FOO even if S_IXOTH != 1.
9487
9488         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9489         WOTH, XOTH, ALLM): New macros.
9490         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9491          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9492         Use them.
9493         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9494         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9495         (mode_compile):
9496         No need to use uintmax_t; unsigned long is long enough.
9497         Don't bother to get suffix since we don't use it.
9498
9499 2000-12-24  Jim Meyering  <meyering@lucent.com>
9500
9501         * hash.c (is_prime): Return explicit boolean values.
9502         (hash_get_first): Return NULL to appease Irix5.6's 89.
9503         Reported by Nelson Beebe.
9504
9505 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9506
9507         * localcharset.c (locale_charset): Add support for Win32.
9508
9509 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9510
9511         * physmem.h, physmem.c: New files.
9512
9513         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9514         (noinst_HEADERS): Add physmem.h.
9515
9516         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9517         't' for compatibility with Solaris 8 sort.
9518
9519 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9520
9521         * config.charset: Add support for BeOS.
9522
9523 2000-12-16  Jim Meyering  <meyering@lucent.com>
9524
9525         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9526         SHELLS_FILE to a file name that's useful on djgpp systems.
9527         Include stdlib.h.
9528         (ADDITIONAL_DEFAULT_SHELLS): Define.
9529         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9530         Based mostly on a patch from Prashant TR.
9531
9532 2000-12-16  Jim Meyering  <meyering@lucent.com>
9533
9534         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9535         N and M) would have treated it like `chown N:N FILE'.
9536
9537         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9538
9539 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9540
9541         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9542         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9543         to the list of canonical encodings. Rename EUC-CN to GB2312.
9544
9545 2000-12-08  Andreas Schwab  <schwab@suse.de>
9546
9547         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9548         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9549
9550 2000-12-07  Jim Meyering  <meyering@lucent.com>
9551
9552         * stripslash.c (ISSLASH): Define.
9553         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9554         From Prashant TR.
9555
9556         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9557         (dir_name_r): Declare this function as static.
9558         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9559         manifest itself on a name containing a mix of slashes and
9560         backslashes.
9561         Make this function work with names starting with a DOS-style
9562         drive letter and colon prefix.
9563         (dir_name): Append `.' if necessary.
9564         Based mostly on patches from Prashant TR and Eli Zaretskii.
9565
9566         * dirname.h (dir_name_r): Remove prototype.
9567
9568 2000-12-05  Jim Meyering  <meyering@lucent.com>
9569
9570         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9571
9572 2000-12-04  Jim Meyering  <meyering@lucent.com>
9573
9574         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9575         Also include memory.h, stdlib.h, unistd.h if appropriate.
9576         Reported by Andreas Jaeger (conflicting declaration of malloc).
9577
9578 2000-12-02  Jim Meyering  <meyering@lucent.com>
9579
9580         * closeout.h: Make idempotent, to avoid some obscure warnings.
9581
9582 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9583
9584         * memrchr.c: Include <config.h> before any system include file.
9585
9586 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9587
9588         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9589
9590 2000-11-26  Jim Meyering  <meyering@lucent.com>
9591
9592         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9593
9594 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9595
9596         * strftime.c (my_strftime): Do not invoke mbrlen with a
9597         size of (size_t) -1; it's not portable.
9598
9599 2000-11-17  Akim Demaille  <akim@epita.fr>
9600
9601         * obstack.h: Formatting changes.
9602         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9603         prevent type checking.
9604         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9605         cast the value to (void *): assigning a `foo *' to a `void *'
9606         variable is valid.
9607         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9608
9609 2000-11-17  Jim Meyering  <meyering@lucent.com>
9610
9611         * strstr.c: Update from GNU libc.
9612
9613 2000-11-16  Jim Meyering  <meyering@lucent.com>
9614
9615         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9616
9617 2000-11-11  Jim Meyering  <meyering@lucent.com>
9618
9619         * error.c: Add a couple #includes, merging from GNU libc version.
9620
9621 2000-11-10  Jim Meyering  <meyering@lucent.com>
9622
9623         * obstack.h: Update from GNU libc.
9624         * obstack.c: Likewise.
9625
9626 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9627
9628         * getusershell.c (setusershell): Use rewind rather than
9629         fseek/fseeko, to avoid configuration hassles with fseeko.
9630         Don't bother opening SHELLS_FILE if shellstream is NULL;
9631         it's not necessary.
9632
9633 2000-11-05  Jim Meyering  <meyering@lucent.com>
9634
9635         * makepath.h (make_dir): Declare.
9636         * makepath.c (make_dir): Remove `static' attribute.
9637         Tweak a comment.
9638
9639 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9640
9641         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9642         last one in a bucket, advance to the next bucket.
9643
9644 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9645
9646         * fnmatch.c: Do not comment out all the code if we are using
9647         the GNU C library, because in some cases we are replacing buggy
9648         code in the GNU C library itself.
9649
9650 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9651
9652         * error.h, getline.h, modechange.h:
9653         Remove "2000" from Copyright line, as the file hasn't been
9654         changed this year other than in the copyright notice.
9655
9656         * xalloc.h: Add "2000" to Copyright line, as this file
9657         was changed this year.
9658
9659 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9660
9661         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9662         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9663         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9664
9665 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9666
9667         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9668         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9669         doesn't define __restrict_arr.
9670
9671 2000-10-29  Jim Meyering  <meyering@lucent.com>
9672
9673         * xstat.in: Fix grammar in comment.
9674
9675 2000-10-28  Jim Meyering  <meyering@lucent.com>
9676
9677         * memchr.c: Update from libc.
9678         Adjust for portability:
9679         [HAVE_STDLIB_H]: Include stdlib.h.
9680         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9681         Undef __memchr, too.
9682         [!weak_alias]: Define __memchr to memchr.
9683
9684         * regex.c: Update from libc.
9685         * regex.h: Likewise.
9686         * getopt1.c: Likewise.
9687         * memcmp.c: Likewise.
9688
9689         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9690         Avoid using fseek, when possible -- it's broken by design.
9691         Patch by Ulrich Drepper.
9692
9693 2000-10-26  Jim Meyering  <meyering@lucent.com>
9694
9695         * strftime.c: Update from libc.
9696
9697 2000-10-25  Jim Meyering  <meyering@lucent.com>
9698
9699         * obstack.c: Update from libc.
9700
9701 2000-10-23  Jim Meyering  <meyering@lucent.com>
9702
9703         * hard-locale.c (hard_locale): Revert last change -- it was simply
9704         wrong.  That set_locale call must not have any side effects.
9705         From Paul Eggert.
9706
9707 2000-10-22  Jim Meyering  <meyering@lucent.com>
9708
9709         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9710         [CYCLIC]: Remove now-unused definition.
9711
9712         * save-cwd.c (O_DIRECTORY): Define, if needed.
9713         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9714         Suggestion from Ulrich Drepper.
9715
9716 2000-10-21  Jim Meyering  <meyering@lucent.com>
9717
9718         * dirname.c (dir_name_r): New function, factored out of dir_name.
9719         (dir_name): Use dir_name_r.
9720         * dirname.h (dir_name_r): Declare it.
9721
9722 2000-10-21  Jim Meyering  <meyering@lucent.com>
9723
9724         * dirname.c (memrchr): Declare if necessary.
9725         (dir_name): Remove the restriction that there be no
9726         trailing slashes.  Now, this code skips past them, effectively
9727         ignoring them.
9728         [TEST_DIRNAME] (main): New unit tests.
9729
9730         * memrchr.c: New file from GNU libc.
9731         Undef __memrchr, too.
9732         [!weak_alias]: Define __memrchr to memrchr.
9733         Guard weak_alias use with `#ifdef weak_alias'.
9734
9735 2000-10-17  Jim Meyering  <meyering@lucent.com>
9736
9737         * quote.h (PARAMS): Define and use.
9738         Reported by Akim Demaille.
9739
9740         * getopt.c: Update from libc.
9741
9742 2000-10-16  Jim Meyering  <meyering@lucent.com>
9743
9744         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9745         From Jan Fedak.
9746
9747 2000-09-25  Jim Meyering  <meyering@lucent.com>
9748
9749         * md5.h (rol): Define (from GnuPG).
9750
9751         * sha.c: Give credit (GnuPG) where due.
9752         (M): Use rol rather than open-coding it.
9753         Add a FIXME comment.
9754
9755 2000-09-21  Jim Meyering  <meyering@lucent.com>
9756
9757         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9758         Reported by Michael Stone.
9759
9760 2000-09-20  Jim Meyering  <meyering@lucent.com>
9761
9762         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9763         (noinst_HEADERS): Add sha.h.
9764         Based on code from Scott G. Miller and from GnuPG.
9765
9766 2000-09-15  Jim Meyering  <meyering@lucent.com>
9767
9768         * regex.c: Update from libc.
9769
9770 2000-09-10  Jim Meyering  <meyering@lucent.com>
9771
9772         * getopt.c (_getopt_internal): Update from glibc.
9773
9774 2000-09-09  Jim Meyering  <meyering@lucent.com>
9775
9776         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9777         think it should be used as a general replacement for isascii.
9778         * fnmatch.c: Likewise.
9779         * mbswidth.c: Likewise
9780         * regex.c: Likewise.
9781
9782         Don't use atoi.
9783         * userspec.c: Include sys/param.h and limits.h.
9784         Include xstrtol.h.
9785         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9786         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9787         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9788         UID, GID.  Check range.
9789
9790 2000-09-06  Jim Meyering  <meyering@lucent.com>
9791
9792         * getopt.c (_getopt_internal): Update from glibc.
9793
9794 2000-08-30  Jim Meyering  <meyering@lucent.com>
9795
9796         * strftime.c: Merge in changes from GNU libc.
9797
9798 2000-08-26  Jim Meyering  <meyering@lucent.com>
9799
9800         * closeout.c: Include "__fpending.h".
9801         (close_stdout_status): Return right away if there's nothing to flush.
9802
9803         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9804         * __fpending.c: New file.
9805         * __fpending.h: New file.
9806
9807 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9808
9809         Standardize on "memory exhausted" instead of "Memory exhausted"
9810         or "virtual memory exhausted".
9811         * obstack.c (print_and_abort): Use "memory exhausted", not
9812         "virtual memory exhausted".
9813         * same.c (same_name): Invoke xalloc_die instead of printing
9814         our own message.
9815         * userspec.c (parse_user_spec): Likewise.
9816         * bumpalloc.h: comment fix
9817         * same.c, userspec.c: Include xalloc.h.
9818
9819         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9820         not char *const and pointing to a constant array.
9821         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9822         (xrealloc): Comment fix.
9823
9824         * userspec.c (parse_user_spec):
9825         Don't translate a message until just before returning,
9826         to avoid unnecessary translation.
9827
9828 2000-08-07  Jim Meyering  <meyering@lucent.com>
9829
9830         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9831         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9832         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9833         getgroups.c, gethostname.c, getopt.h, group-member.c,
9834         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9835         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9836         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9837         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9838         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9839         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9840         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9841         yesno.c: Back out Copyright date changes for each file with no change
9842         this year.  This eases coordination with other programs using the same
9843         source code modules.  From Paul Eggert.
9844
9845 2000-08-03  Greg McGary  <greg@mcgary.org>
9846
9847         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9848         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9849         (EXTEND_BUFFER): Use them.
9850
9851 2000-08-01  Jim Meyering  <meyering@lucent.com>
9852
9853         * dirname.c (ISSLASH): Define.
9854         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9855         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9856         both `\' and `/' may be use as path separators.
9857         Based on a patch from Prashant TR.
9858
9859 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9860
9861         * quotearg.c (quotearg_n_options): Don't make the initial
9862         slot vector a constant, since it might get modified.
9863
9864 2000-07-31  Jim Meyering  <meyering@lucent.com>
9865
9866         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9867         * obstack.c (print_and_abort): Likewise.
9868
9869 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9870
9871         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9872         buffer, so that the caller can always quote one small
9873         component of a "memory exhausted" message in slot 0.
9874         From a suggestion by Jim Meyering.
9875
9876 2000-07-30  Jim Meyering  <meyering@lucent.com>
9877
9878         * makepath.c (make_path): Quote the other instance, too.
9879
9880         * quotearg.c (N_STATIC_SLOTVECS): Define.
9881         (STATIC_BUF_SIZE): Define.
9882         (quotearg_n_options): Use only statically allocated storage when
9883         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9884         than STATIC_BUF_SIZE.
9885
9886 2000-07-29  Jim Meyering  <meyering@lucent.com>
9887
9888         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9889         * dirname.c (dir_name): Likewise.
9890
9891         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9892
9893         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9894         (dir_name): Assert that there are no trailing slashes.
9895
9896 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9897
9898         * mbswidth.h (mbswidth): Add a flags argument.
9899         (mbswidth): New declaration.
9900         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9901         * mbswidth.c (mbswidth): Add a flags argument.
9902         (mbsnwidth): New function.
9903
9904 2000-07-24  Jim Meyering  <meyering@lucent.com>
9905
9906         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9907
9908 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9909
9910         * mbswidth.c (_XOPEN_SOURCE):
9911         Don't define; this causes problems on Solaris 7.
9912         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9913
9914 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9915
9916         * quotearg.c:
9917         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9918         so that mbstate_t is always defined.
9919
9920         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9921         be 1 in at least one GCC installation, and this configuration
9922         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9923         performance on hosts that have mbrtowc but have only unibyte
9924         locales, but I assume these hosts are rare.
9925
9926 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9927
9928         * quotearg.c: Streamline by invoking multibyte code only if needed.
9929         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9930         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9931         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9932         invoke multibyte primitives.
9933
9934 2000-07-23  Jim Meyering  <meyering@lucent.com>
9935
9936         * basename.c (base_name): Add an assertion.
9937
9938 2000-07-15  Bruno Haible  <clisp.cons.org>
9939
9940         * quotearg.c: When the system forces us to redefine mbstate_t,
9941         shadow its mbsinit function.
9942
9943 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9944
9945         * mbswidth.h: New file.
9946         * mbswidth.c: New file.
9947         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9948         (noinst_HEADERS): Add mbswidth.h.
9949
9950 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9951
9952         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9953         and IRIX 6.
9954
9955 2000-07-15  Jim Meyering  <meyering@lucent.com>
9956
9957         * makepath.c: Include quote.h.
9958         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9959         corresponding argument in a `quote (...)' call.
9960         Give better diagnostics.
9961
9962         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9963         (noinst_HEADERS): Add quote.h.
9964
9965         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9966         from tar's src/misc.c.
9967         * quote.h: New file.  Prototypes for same.
9968
9969 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9970
9971         From a suggestion by Bruno Haible.
9972         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9973         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9974         to decide whether to define the BeOS workaround macro;
9975         this adjusts to the change to AC_MBSTATE_T.
9976
9977 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9978
9979         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9980
9981         * quotearg.c (quoting_style_args, quoting_style_vals,
9982         quotearg_buffer_restyled): Add support for
9983         clocale_quoting_style.  Undo previous change to
9984         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9985         and "{RIGHT QUOTATION MARK}" msgids.
9986
9987 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9988
9989         The old behavior of quoting `like this' doesn't look good with
9990         newer, ISO-style fonts.  See:
9991         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9992
9993         Instead, quote "like this" by default.  Let the translator
9994         tailor the locale-specific quoting behavior by providing
9995         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9996
9997         * quotearg.c (N_): New macro.
9998         (gettext_default): New function.
9999         (quotearg_buffer_restyled): Use
10000         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10001         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10002
10003 2000-07-09  Jim Meyering  <meyering@lucent.com>
10004
10005         * Most files: Update copyright dates to include 2000.
10006
10007 2000-07-08  Jim Meyering  <meyering@lucent.com>
10008
10009         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10010         if not defined.
10011         (xgethostname): Remove now-unnecessary #ifdef.
10012         Move declaration of `err' into loop where it's used.
10013
10014 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10015
10016         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10017         by allocating a larger buffer. Test the gethostname return value for
10018         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10019         returns an error and ENAMETOOLONG isn't defined.
10020
10021 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10022         and Bruno Haible  <haible@clisp.cons.org>
10023
10024         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10025
10026 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10027
10028         * quotearg.c (struct quoting_options): Simplify quote_these_too
10029         dimension.
10030
10031 2000-07-03  Jim Meyering  <meyering@lucent.com>
10032
10033         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10034         Reported by Bruno Haible.
10035
10036 2000-07-04  Jim Meyering  <meyering@lucent.com>
10037
10038         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10039         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10040         lacks mbrtowc.
10041
10042 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10043         and Bruno Haible  <haible@clisp.cons.org>
10044
10045         * quotearg.c (mbrtowc):
10046         Assign to *pwc, and return 1 only if result is nonzero.
10047         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10048
10049 2000-07-03  Jim Meyering  <meyering@lucent.com>
10050
10051         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10052         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10053         From Bob Proulx.
10054
10055 2000-07-02  Jim Meyering  <meyering@lucent.com>
10056
10057         * quotearg.c (mbstate_t): Don't define here.
10058
10059 2000-07-02  Jim Meyering  <meyering@lucent.com>
10060
10061         * nanosleep.c (SIGCONT): Define if not already defined.
10062
10063 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10064
10065         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10066         per change in ../m4/ls-mntd-fs.m4.
10067         (read_filesystem_list): Ignore symbolic links.
10068
10069 2000-06-29  Jim Meyering  <meyering@lucent.com>
10070
10071         * same.c: Include <string.h> or <strings.h>, as appropriate,
10072         for declaration of strcmp.
10073
10074         * long-options.c: Include <stdlib.h>, for declaration of exit.
10075
10076         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10077         Avoid warning by casting result to `char *' to remove `const'.
10078
10079 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10080
10081         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10082
10083 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10084
10085         savedir now sets errno on failure and invokes xmalloc to get memory.
10086         Fix a couple of other minor bugs while we're at it.
10087
10088         * savedir.c (<unistd.h>): Do not include; there's no need.
10089         (NAMLEN): Remove macro.
10090         (malloc, realloc): Remove decls.
10091         (stpcpy): Likewise.
10092         ("xalloc.h"): Include.
10093         (NAME_SIZE_DEFAULT): New macro.
10094         (savedir): Use xmalloc / xrealloc to allocate memory.
10095         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10096         Skip "" directory entries.
10097         Use strlen to calculate directory entry length, since the old method
10098         is rarely used these days and isn't worth supporting.
10099         Don't use a pointer after freeing it.
10100         Check for integer overflow when calculating allocation size.
10101         Use memcpy to copy entries, instead of stpcpy.
10102         Set errno properly when returning NULL.
10103         Check for readdir error.
10104
10105 2000-06-26  Jim Meyering  <meyering@lucent.com>
10106
10107         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10108
10109 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10110
10111         * getusershell.c (xmalloc, xrealloc): Remove functions.
10112         Include xalloc.h.
10113         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10114
10115 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10116
10117         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10118
10119 2000-06-24  Jim Meyering  <meyering@lucent.com>
10120
10121         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10122
10123 2000-06-21  Jim Meyering  <meyering@lucent.com>
10124
10125         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10126
10127 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10128
10129         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10130         (mbrtowc, mbstate_t): Define substitutes if
10131         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10132         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10133         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10134
10135 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10136
10137         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10138         than 1024, return a memory chunk of least possible size, instead
10139         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10140         Use free/xmalloc instead of xrealloc to avoid copying for very long
10141         paths.
10142
10143 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10144
10145         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10146         address, not strdup.  Include <stdlib.h> and don't declare free().
10147
10148 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10149
10150         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10151         the empty string.
10152
10153 2000-06-21  Jim Meyering  <meyering@lucent.com>
10154
10155         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10156         (noinst_HEADERS): Add getstr.h.
10157
10158         * getline.c (getstr): Move into a separate file.
10159         * getstr.c (getstr): New file, extracted from getline.c, with
10160         the following changes: new parameter, delim2; both delim[12]
10161         parameters have type `int', not `char'.  The latter would lose
10162         with 8-bit delimiters.
10163         * getstr.h: New file.
10164
10165 2000-06-19  Jim Meyering  <meyering@lucent.com>
10166
10167         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10168
10169 2000-06-18  Jim Meyering  <meyering@lucent.com>
10170
10171         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10172         Besides, these days every porting target provides a mkdir function.
10173
10174         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10175         (this snippet comes from src/system.h).
10176
10177 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10178
10179         * human.c (adjust_value): New function.
10180         (human_readable_inexact): Apply rounding style even when
10181         printing approximate values.
10182
10183 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10184
10185         * human.c (human_readable_inexact): Allow an input block
10186         size that is not a multiple of the output block size, and vice versa.
10187         Reported by Piergiorgio Sartor.
10188
10189 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10190
10191         * getdate.y (get_date): Apply relative times after time
10192         zone indicator, not before.  Reported by Todd A. Jacobs.
10193
10194 2000-06-13  Jim Meyering  <meyering@lucent.com>
10195
10196         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10197
10198         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10199
10200 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10201
10202         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10203
10204 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10205
10206         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10207
10208 2000-06-04  Jim Meyering  <meyering@lucent.com>
10209
10210         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10211         SunOS 4.1.4 for which gid_t is an unsigned type.
10212
10213 2000-06-03  Jim Meyering  <meyering@lucent.com>
10214
10215         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10216
10217 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10218
10219         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10220         newer, don't install charset.alias.
10221         * config.charset: Change the Linux/glibc rules so they become empty
10222         on glibc-2.1 or newer.
10223
10224 2000-06-02  Jim Meyering  <meyering@lucent.com>
10225
10226         * mountlist.c: Back out last change.  Instead, do this...
10227         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10228         member using the same `ignore'-testing code.
10229         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10230         fs_type strings.
10231         From Mark D. Roth.
10232
10233 2000-05-29  Jim Meyering  <meyering@lucent.com>
10234
10235         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10236         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10237
10238 2000-05-22  Jim Meyering  <meyering@lucent.com>
10239
10240         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10241
10242 2000-05-18  Jim Meyering  <meyering@lucent.com>
10243
10244         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10245         back, too, since it may have been modified by allocate_entry.
10246         (hash_delete): Rewrite to use neither the assignment operator
10247         nor the comma operator in an if-expression.
10248
10249 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10250
10251         * closeout.c:
10252         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10253         Remove; no longer needed.
10254         "quotearg.h": Add include.
10255         (file_name): Do not bother to explicitly initialize to NULL; it's less
10256         efficient on some hosts.
10257         (close_stdout_status): Remove test as to whether stdout was already
10258         closed; it breaks for the case "echo x | sort >&-".
10259         Quote file name colons.
10260         Do not assume that _("write error") lacks format strings.
10261
10262 2000-05-15  Jim Meyering  <meyering@lucent.com>
10263
10264         * version-etc.c (version_etc_copyright): Update the copyright string
10265         used in all --version output.
10266
10267 2000-05-14  Jim Meyering  <meyering@lucent.com>
10268
10269         * closeout.c (close_stdout_set_file_name): New function.
10270         (close_stdout_status): Use new file-scoped global.
10271         Return right away if fstat says the stdout file descriptor is invalid.
10272         * closeout.h (close_stdout_set_file_name): Declare.
10273
10274 2000-05-10  Jim Meyering  <meyering@lucent.com>
10275
10276         * closeout.c [default_exit_status]: New file-scoped variable.
10277         (close_stdout_set_status): New function.
10278         * closeout.h (close_stdout_set_status): Declare.
10279
10280 2000-05-08  Jim Meyering  <meyering@lucent.com>
10281
10282         * long-options.c: Don't include closeout.h.
10283         (parse_long_options): Don't call close_stdout for --version.
10284
10285 2000-05-06  Jim Meyering  <meyering@lucent.com>
10286
10287         * strnlen.c: Undefine __strnlen and strnlen.
10288         [!weak_alias]: Define __strnlen to strnlen.
10289
10290         * atexit.c: New file, from libiberty.
10291
10292 2000-05-06  Jim Meyering  <meyering@lucent.com>
10293
10294         * closeout.c (close_stdout_status): Also check for errors on the
10295         stderr stream.
10296
10297 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10298
10299         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10300         instead of xmalloc, xrealloc, path_concat.
10301         (locale_charset): Treat empty environment variables as absent.
10302         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10303
10304 2000-05-04  Jim Meyering  <meyering@lucent.com>
10305
10306         * getopt.c: Update from glibc.
10307         * obstack.c: Likewise.
10308         * obstack.h: Likewise.
10309         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10310
10311         * regex.h: Likewise.
10312         * strndup.c: Likewise.
10313         * strnlen.c: New file, from glibc.
10314
10315 2000-05-01  Jim Meyering  <meyering@lucent.com>
10316
10317         * full-write.c (full_write): Remove `FIXME' part of comment.
10318
10319 2000-04-29  Jim Meyering  <meyering@lucent.com>
10320
10321         * path-concat.c: Declare strdup only if it's not defined.
10322         * canon-host.c: Likewise.
10323
10324 2000-04-28  Jim Meyering  <meyering@lucent.com>
10325
10326         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10327         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10328         included first, then limits.h is included by locale.h by libintl.h.
10329         From John David Anglin.
10330
10331 2000-04-25  Jim Meyering  <meyering@lucent.com>
10332
10333         * makepath.c (S_IRWXUGO): Define.
10334         (make_path): Always perform explicit chmod if MODE specifies any
10335         of the `special' permission bits.  Prompted by a bug report against
10336         install from Mate Wierdl and Joost van Baal.
10337
10338 2000-04-18  Jim Meyering  <meyering@lucent.com>
10339
10340         * README: New file.
10341
10342         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10343         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10344
10345 2000-04-17  Jim Meyering  <meyering@lucent.com>
10346
10347         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10348         the definition of it to rpl_strftime also defined-away the system's
10349         declaration.
10350
10351 2000-04-15  Jim Meyering  <meyering@lucent.com>
10352
10353         Use `C' to denote so-called `contiguous' files, the same way
10354         that tar does.
10355         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10356         (ftypelet): Use S_ISCTG.
10357         From Michael Deutschmann.
10358
10359 2000-04-14  Jim Meyering  <meyering@lucent.com>
10360
10361         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10362
10363 2000-04-08  Jim Meyering  <meyering@lucent.com>
10364
10365         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10366         names don't conflict.  Reported by Eli Zaretskii.
10367
10368 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10369
10370         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10371         bug.  Deal with the different error behavior of Irix iconv.
10372
10373 2000-04-07  Jim Meyering  <meyering@lucent.com>
10374
10375         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10376         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10377
10378 2000-04-05  Jim Meyering  <meyering@lucent.com>
10379
10380         Portability tweaks required for ultrix4.3.
10381         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10382         * readutmp.c: Include sys/types.h before sys/stat.h.
10383         * canon-host.c: Declare strdup.
10384         * path-concat.c: Likewise.
10385         From John David Anglin.
10386
10387 2000-04-04  Jim Meyering  <meyering@lucent.com>
10388
10389         Be more DOS 8.3-friendly.
10390         * ref-add.sin: Renamed from ref-add.sed.in.
10391         * ref-del.sin: Renamed from ref-del.sed.in.
10392         * Makefile.am: Reflect renaming.
10393         Reported by Eli Zaretskii.
10394
10395         Use a temporary file name that won't clash with `charset.alias'
10396         in the DOS 8.3 name space.
10397         * Makefile.am (charset_tmp): Define.
10398         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10399         (uninstall-local): Likewise.
10400         Reported by Eli Zaretskii.
10401
10402 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10403
10404         * time/strftime.c (my_strftime): Make sure we call the system
10405         strftime, not ourselves, when invoking the underlying strftime.
10406
10407 2000-03-24  Jim Meyering  <meyering@lucent.com>
10408
10409         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10410         (charset_alias): Define.
10411         (install-exec-local): Factor out common code.
10412         (uninstall-local): Split lines longer than 80.
10413         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10414         (SUFFIXES): Define.
10415         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10416         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10417
10418 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10419
10420         * config.charset: Output a line containing "Packages using this file".
10421         * ref-add.sed.in, ref-del.sed.in: New files.
10422         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10423         ref-del.sed): New rules.
10424
10425 2000-03-17  Jim Meyering  <meyering@lucent.com>
10426
10427         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10428         Otherwise, include <strings.h>
10429
10430 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10431
10432         * unicodeio.c (utf8_wctomb): New function.
10433         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10434         format instead of in UCS-4 with platform dependent endianness.
10435
10436 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10437
10438         * savedir.c (savedir): Work even if directory size is
10439         negative; this can happen with some screwy NFS configurations.
10440
10441 2000-03-06  Jim Meyering  <meyering@lucent.com>
10442
10443         * localcharset.c (get_charset_aliases): Don't try to free file_name
10444         if it's NULL (because we ran out of memory).  From Bruno Haible.
10445
10446 2000-03-05  Jim Meyering  <meyering@lucent.com>
10447
10448         * localcharset.c ("path-concat.h"): Include.
10449         (get_charset_aliases): Use path_concat instead of ANSI string
10450         concatenation.
10451
10452         * unicodeio.h (PARAMS): Define.
10453         Use it to guard prototype.
10454
10455 2000-03-04  Jim Meyering  <meyering@lucent.com>
10456
10457         * Makefile.am (install-exec-local): Create $(libdir) before installing
10458         into it.
10459         (uninstall-local): Uncomment this rule so `make distcheck' works
10460         once again.
10461
10462         * unicodeio.c (<errno.h>): Include it.
10463         (errno): Declare if not defined.
10464
10465         * localcharset.c: Add Bruno's comment justifying use of volatile.
10466
10467         * config.charset: New version, incorporating remarks from a linux
10468         i18n mailing list.  From Bruno Haible.
10469
10470 2000-03-02  Jim Meyering  <meyering@lucent.com>
10471
10472         * Makefile.am (EXTRA_DIST): Add config.charset.
10473
10474 2000-03-01  Jim Meyering  <meyering@lucent.com>
10475
10476         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10477         * unicodeio.c: Likewise.
10478
10479 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10480
10481         * config.charset: New file.
10482         * localcharset.c: New file.
10483         * unicodeio.h, unicodeio.c: New files.
10484         * Makefile.am (DEFS): Add -DLIBDIR=...
10485         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10486         (noinst_HEADERS): Add unicodeio.h.
10487         (all-local, install-exec-local, charset.alias): New targets.
10488
10489 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10490
10491         * quotearg.c (ALERT_CHAR): New macro.
10492         (quotearg_buffer_restyled): Use it.
10493
10494 2000-02-27  Jim Meyering  <meyering@lucent.com>
10495
10496         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10497         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10498
10499         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10500         not `#if STDC_HEADERS'.
10501         Declare malloc if needed.
10502
10503         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10504         now that autoconf always defines the HAVE_DECL_ symbols.
10505         * human.c: Likewise.
10506         * same.c: Likewise.
10507         * strtoumax.c: Likewise.
10508
10509         * backupfile.c: Arrange for cpp to fail if the configure-time
10510         declaration check was not run.
10511         * hash.c: Likewise.
10512         * human.c: Likewise.
10513         * same.c: Likewise.
10514         * strtoumax.c: Likewise.
10515
10516         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10517         then first look up the entire `.'-containing string as a login name.
10518
10519 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10520
10521         * getdate.y: Handle two-digit years with leading zeros correctly.
10522         (textint): New typedef.
10523         (parser_control): Member year changed from int to textint.
10524         All uses changed.
10525         (YYSTYPE): Removed; replaced by %union with int and textint members.
10526         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10527         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10528         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10529         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10530         (date, number, to_year): Use width of number in digits, not its value,
10531         to determine whether it's a 2-digit year, or a 2-digit time.
10532         (yylex): Store number of digits of numeric tokens.
10533         Reported by John Kendall.
10534
10535         (parser_control): Changed from struct parser_control to typedef (for
10536         consistency).  All uses changed.
10537
10538         (tID): Removed; not used.
10539         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10540
10541 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10542
10543         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10544         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10545
10546 2000-02-12  Jim Meyering  <meyering@lucent.com>
10547
10548         * userspec.c (ISDIGIT): Define it.
10549         (isdigit): Remove definition.
10550         (is_number): Use ISDIGIT, not isdigit.
10551         <libintl.h>: Include.
10552         (_ and N_): Define.
10553         (parse_user_spec): Mark translatable strings.
10554
10555 2000-02-10  Jim Meyering  <meyering@lucent.com>
10556
10557         With these changes, nanosleep.[ch] are finally enough like the other
10558         lib/* replacement files to compile on a few more losing systems.
10559
10560         * nanosleep.h: Don't include config.h.
10561         Remove prototype from declaration of nanosleep.
10562         (PARAMS): Remove now-unneeded definition.
10563         * nanosleep.c: #undef nanosleep.
10564         (rpl_nanosleep): Rename from nanosleep.
10565
10566 2000-02-03  Jim Meyering  <meyering@lucent.com>
10567
10568         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10569         rather than with `#if HAVE_UTMPNAME'.
10570
10571 2000-02-01  Jim Meyering  <meyering@lucent.com>
10572
10573         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10574
10575 2000-01-31  Jim Meyering  <meyering@lucent.com>
10576
10577         * nanosleep.h (nanosleep): Guard declaration with
10578         `#if ! HAVE_DECL_NANOSLEEP'.
10579         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10580         the declaration in that vendor's sys/timers.h.
10581         Reported by Christian Krackowizer.
10582
10583         * quotearg.c (ISASCII): Add #undef and move definition to follow
10584         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10585         (ISPRINT): Likewise.
10586         Reported by Tom Tromey.
10587
10588 2000-01-30  Jim Meyering  <meyering@lucent.com>
10589
10590         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10591         uses of ->ut_name.  The latter doesn't work with new Linux header files
10592         where only utmpx.ut_user is declared.
10593
10594         * readutmp.h (UT_USER): Define.
10595
10596 2000-01-23  Jim Meyering  <meyering@lucent.com>
10597
10598         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10599         obstack.c.
10600
10601 2000-01-22  Jim Meyering  <meyering@lucent.com>
10602
10603         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10604         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10605         Required for some AIX systems.  Reported by Christian Krackowizer.
10606         [TESTING] (main): New function.
10607
10608         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10609         * dirname.c (dir_name): Support for DOS-style file names with drive
10610         letters.
10611
10612         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10613
10614         * strverscmp.c (ISDIGIT): Define.
10615         (strverscmp): Use ISDIGIT, not isdigit.
10616
10617 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10618
10619         * nanosleep.c (nanosleep):
10620         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10621         POSIX.1 doesn't require SA_INTERRUPT and some systems
10622         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10623         it's been part of POSIX.1 since day 1 (in 1988).
10624
10625 2000-01-17  Jim Meyering  <meyering@lucent.com>
10626
10627         * interlock: Remove unused file.  Reported by François Pinard.
10628
10629 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10630
10631         * quotearg.c (quotearg_buffer_restyled): Do not quote
10632         alert, backslash, formfeed, and vertical tab unnecessarily in
10633         shell quoting style.
10634
10635
10636 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10637 Free Software Foundation, Inc.
10638 Copying and distribution of this file, with or without modification,
10639 are permitted provided the copyright notice and this notice are preserved.