New function fwriteerror_no_ebadf.
[pspp] / lib / ChangeLog
1 2006-09-29  Bruno Haible  <bruno@clisp.org>
2
3         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
4         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
5         argument. Set stdout_closed before testing for ferror, not after.
6         (fwriteerror, fwriteerror_no_ebadf): New functions.
7
8 2006-09-28  Bruno Haible  <bruno@clisp.org>
9
10         * strndup.h: Simplify the redefinition of strndup.
11         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
12
13 2006-09-28  Bruno Haible  <bruno@clisp.org>
14
15         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
16         * gl_linkedhash_list.c: Likewise.
17         * gl_rbtreehash_list.c: Likewise.
18
19 2006-09-28  Jim Meyering  <jim@meyering.net>
20
21         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
22         Include <unistd.h>.
23
24 2006-09-27  Jim Meyering  <jim@meyering.net>
25
26         This file could end up with a definition for a function
27         named __strndup, rather than rpl_strndup on a system with
28         incomplete weak_alias support.
29         * strndup.c (strndup): Rename from __strndup.
30         Remove #defines that used to map __strndup to strndup.
31         Don't use K&R prototypes.
32         Remove LIBC-related code, since this file is not sync'd with glibc.
33         * strndup.h: Revamp, accordingly.
34
35 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
36
37         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
38         getaddrinfo.
39
40         * __fpending.h: Don't include <stdio_ext.h> unless
41         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
42         it causes <stdio_ext.h> to cause a compile-time error.
43         Problem reported by Nelson H. F. Beebe.
44         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
45         of HAVE_DECL___PENDING.
46
47 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
48
49         * savewd.c: Include <signal.h>, for 'raise'.
50
51 2006-09-26  Eric Blake  <ebb9@byu.net>
52
53         * verror.c: Include <config.h> unconditionally.
54
55 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
56
57         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
58         (gl_linked_iterator_from_to): Initialize struct completely.
59         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
60         (gl_tree_iterator_from_to): Likewise
61         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
62         * gl_array_list.c [lint] (gl_array_iterator)
63         (gl_array_iterator_from_to): Likewise.
64         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
65         * gl_carray_list.c [lint] (gl_carray_iterator)
66         (gl_carray_iterator_from_to): Likewise.
67
68         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
69         * md4.c (md4_process_block): Remove unused variable.
70         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
71         parentheses for clarity.
72
73 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
74
75         Import this patch from libc:
76
77         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
78
79         * regex_internal.c (re_string_reconstruct): Handle
80         offset < pstr->valid_raw_len && pstr->offsets_needed case.
81         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
82         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
83         re_string_context_at.
84
85 2006-09-20  Bruno Haible  <bruno@clisp.org>
86
87         * mkdtemp.c: Import from libc.
88         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
89                 * sysdeps/posix/tempname.c (__gen_tempname): Change
90                 attempts_min into a macro.  Use preprocessor to decide how to
91                 initialize attempts [Coverity CID 67].
92         2001-11-27  Paul Eggert  <eggert@twinsun.com>
93                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
94                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
95
96 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
97
98         * mkstemp.h: New file, since some standard headers
99         #define mkstemp.
100         * mkstemp.c: Revamp to put the !_LIBC code together.
101         Include "mkstemp.h".
102         Make the _LIBC code resemble glibc original more,
103         e.g., use K&R style.
104         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
105         (mkstemp): Remove, since mkstemp.h does this for us.
106         * stdlib--.h: Include mkstemp.h.
107
108         Import this patch from libc:
109
110         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
111
112         * tempname.c (__gen_tempname): Change attempts_min
113         into a macro.  Use preprocessor to decide how to initialize
114         attempts [Coverity CID 67].
115
116 2006-09-18  Bruno Haible  <bruno@clisp.org>
117
118         * javaversion.c: Include configmake.h.
119
120 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
121
122         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
123         that prevented coreutils 6.1 from building.  Problem reported
124         by Petter Reinholdtsen.
125
126 2006-09-18  Jim Meyering  <jim@meyering.net>
127
128         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
129
130 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
131
132         * dirchownmod.c: Don't include fcntl.h; no longer needed.
133         (dirchownmod): New arg FD.  All callers changed.
134         Use FD rather than opening the directory ourself, as opening is
135         now the caller's responsibility.
136         * dirchownmod.h: Likewise.
137         * mkancesdirs.c: Include <sys/types.h>, for portability to older
138         hosts that require <sys/types.h> before <sys/stat.h>.  Include
139         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
140         (test_dir): Remove.
141         (mkancesdirs): Return length of prefix of FILE that has already
142         been made, or -2 if there is a child doing the work.  Redo
143         algorithm so that it is O(N) rather than O(N**2).  Optimize away
144         ".", and treat ".." specially since it might stray back into
145         already-created areas.  Use a subprocess if necessary.  New arg
146         WD; all users changed.  MAKE_DIR function should now return 1
147         if it creates a directory that is not readable.  Return -2 if
148         a child process is spun off.
149         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
150         Adjust signature to match code.
151         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
152         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
153         all users changed.
154         * savewd.c, savewd.h: New files.
155
156 2006-09-15  Jim Meyering  <jim@meyering.net>
157
158         * rename-dest-slash.c (has_trailing_slash): Use
159         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
160         (rpl_rename_dest_slash): Perform the cheaper trailing slash
161         test before testing whether SRC is a directory.
162         Suggestions from Bruno Haible.
163
164         Avoid a warning about an unused variable.
165         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
166         into the #ifdef block where it's used.
167
168         * rename-dest-slash.c: New file.
169
170 2006-09-14  Bruno Haible  <bruno@clisp.org>
171
172         * allocsa.c: Include <config.h> unconditionally.
173         * asnprintf.c: Likewise.
174         * asprintf.c: Likewise.
175         * c-strcasecmp.c: Likewise.
176         * c-strcasestr.c: Likewise.
177         * c-strncasecmp.c: Likewise.
178         * c-strstr.c: Likewise.
179         * classpath.c: Likewise.
180         * clean-temp.c: Likewise.
181         * concatpath.c: Likewise.
182         * copy-file.c: Likewise.
183         * csharpcomp.c: Likewise.
184         * csharpexec.c: Likewise.
185         * execute.c: Likewise.
186         * fatal-signal.c: Likewise.
187         * findprog.c: Likewise.
188         * fwriteerror.c: Likewise.
189         * gl_array_list.c: Likewise.
190         * gl_array_oset.c: Likewise.
191         * gl_avltree_list.c: Likewise.
192         * gl_avltree_oset.c: Likewise.
193         * gl_avltreehash_list.c: Likewise.
194         * gl_carray_list.c: Likewise.
195         * gl_linked_list.c: Likewise.
196         * gl_linkedhash_list.c: Likewise.
197         * gl_list.c: Likewise.
198         * gl_oset.c: Likewise.
199         * gl_rbtree_list.c: Likewise.
200         * gl_rbtree_oset.c: Likewise.
201         * gl_rbtreehash_list.c: Likewise.
202         * imaxabs.c: Likewise.
203         * imaxdiv.c: Likewise.
204         * javacomp.c: Likewise.
205         * javaexec.c: Likewise.
206         * javaversion.c: Likewise.
207         * linebreak.c: Likewise.
208         * localcharset.c: Likewise.
209         * lock.c: Likewise.
210         * mbchar.c: Likewise.
211         * mbswidth.c: Likewise.
212         * mkdtemp.c: Likewise.
213         * pipe.c: Likewise.
214         * printf-args.c: Likewise.
215         * printf-parse.c: Likewise.
216         * progname.c: Likewise.
217         * progreloc.c: Likewise.
218         * readlink.c: Likewise.
219         * sh-quote.c: Likewise.
220         * stpcpy.c: Likewise.
221         * stpncpy.c: Likewise.
222         * strcasecmp.c: Likewise.
223         * strcasestr.c: Likewise.
224         * strcspn.c: Likewise.
225         * striconv.c: Likewise.
226         * strncasecmp.c: Likewise.
227         * strnlen1.c: Likewise.
228         * strstr.c: Likewise.
229         * strtok_r.c: Likewise.
230         * tls.c: Likewise.
231         * tmpdir.c: Likewise.
232         * unicodeio.c: Likewise.
233         * unsetenv.c: Likewise.
234         * vasnprintf.c: Likewise.
235         * vasprintf.c: Likewise.
236         * wait-process.c: Likewise.
237         * xallocsa.c: Likewise.
238         * xsetenv.c: Likewise.
239         * xstriconv.c: Likewise.
240
241 2006-09-13  Eric Blake  <ebb9@byu.net>
242
243         * getopt.c: Fix typo in last commit.
244
245 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
246
247         * _fpending.c: Include <config.h> unconditionally, since we no
248         longer worry about uses that don't define HAVE_CONFIG_H.
249         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
250         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
251         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
252         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
253         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
254         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
255         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
256         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
257         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
258         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
259         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
260         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
261         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
262         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
263         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
264         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
265         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
266         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
267         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
268         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
269         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
270         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
271         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
272         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
273         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
274         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
275         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
276         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
277         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
278         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
279         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
280         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
281         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
282         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
283         Likewise.
284
285 2006-09-12  Jim Meyering  <jim@meyering.net>
286
287         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
288         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
289         Reported by Nelson H. F. Beebe.
290
291 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
292
293         * argp-help.c (argp_doc): Make sure NULL is not passed to
294         dgettext.
295
296 2006-09-10  Bruno Haible  <bruno@clisp.org>
297
298         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
299
300 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
301
302         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
303         program_invocation_name and program_invocation_short_name are
304         initialized.
305         * argp-namefrob.h: Move declarations of program_invocation_name
306         and program_invocation_short_name to argp.h, so they are visible
307         to user programs.
308         * argp.h: Likewise
309
310 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
311
312         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
313         convention.  Text proposed by Bruno Haible.
314         (struct argp_option): Document the use of N_() wrappers.
315
316         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
317         and translate the two parts separately, instead of feeding
318         the whole string to gettext.  This allows to exclude
319         '\v' from the strings visible to the translator by writing doc
320         strings as N_("..") "\v" N_("..").
321
322 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
323
324         * mktime.c (guess_time_tm): Fix bug where mktime
325         returned the maximum time_t value rather than (time_t) -1.
326         Problem originally reported by William Bardwell
327         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
328
329         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
330         Moved to here ...
331         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
332         ... from here.
333
334 2006-09-06  Bruno Haible  <bruno@clisp.org>
335
336         * striconv.h: New file.
337         * striconv.c: New file, merging iconvme.c with GNU gettext's
338         iconvstring.c.
339         * xstriconv.h: New file.
340         * xstriconv.c: New file.
341
342 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
343
344         * argz_.h: Sync from Libtool.
345
346         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
347                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
348
349         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
350
351 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
352
353         * trim.h: New file.
354         * trim.c: New file.
355
356 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
357
358         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
359         Problem reported by Ralf Wildenhues in
360         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
361
362         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
363         HAVE_STRUCT_STATFS_F_FSTYPENAME.
364
365 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
366
367         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
368         or stdbool.h, because they might not exist while configuring.
369
370         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
371         Don't include unistd.h or limits.h; not needed, since chdir-long.h
372         does that for us.
373         (O_DIRECTORY): Remove.
374
375 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
376
377         Work around a bug in both the Linux and SunOS 64-bit kernels:
378         nanosleep mishandles sleeps for longer than 2**31 seconds.
379         Problem reported by Frank v Waveren in
380         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
381         * nanosleep.c (BILLION): New constant.
382         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
383         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
384
385 2006-08-30  Jim Meyering  <jim@meyering.net>
386
387         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
388         the parameter.
389
390 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
391
392         * isapipe.c, isapipe.h: New files.
393
394 2006-08-29  Eric Blake  <ebb9@byu.net>
395
396         * error.c (error_at_line, print_errno_message): Match libc, after
397         resolution of upstream bug 3044.
398
399 2006-08-29  Bruno Haible  <bruno@clisp.org>
400
401         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
402
403 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
404
405         Sync from Libtool:
406
407         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
408
409         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
410         sharing with gnulib.  Report by Eric Blake.
411
412 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
413
414         * fcntl_.h: New file.
415         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
416         the fcntl module.
417         * dirchownmod.c: Likewise.
418         * fts.c: Likewise.
419
420         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
421         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
422         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
423         just before including <inttypes.h>, to avoid circular inclusion.
424
425 2006-08-28  Bruno Haible  <bruno@clisp.org>
426
427         * inttypes_.h (SCNX*): Remove definitions.
428         Reported by Eric Blake.
429
430 2006-08-26  Bruno Haible  <bruno@clisp.org>
431
432         * vasnprintf.c (EOVERFLOW): Remove definition.
433         (VASNPRINTF): Return a string of length > INT_MAX without failing.
434         * vasprintf.c: Include errno.h, limits.h.
435         (EOVERFLOW): New fallback definition.
436         (vasprintf): Test here whether the string length is > INT_MAX.
437         * vsnprintf.c: Include errno.h, limits.h.
438         (EOVERFLOW): New fallback definition.
439         (vsnprintf): Fix bug when generated string was too long for the buffer.
440         Test here whether the string length is > INT_MAX.
441
442 2006-08-26  Bruno Haible  <bruno@clisp.org>
443             Simon Josefsson  <jas@extundo.com>
444
445         BeOS portability.
446         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
447
448 2006-08-28  Bruno Haible  <bruno@clisp.org>
449
450         * c-strstr.h: New file, from GNU gettext.
451         * c-strstr.c: New file, from GNU gettext.
452
453 2006-08-26  Bruno Haible  <bruno@clisp.org>
454
455         * inttypes_.h: New file.
456         * inttypes.h: Remove file.
457         * stdint_.h: Include <inttypes.h> through its absolute filename.
458
459         * imaxabs.c: New file.
460
461         * imaxdiv.c: New file.
462
463 2006-08-22  Bruno Haible  <bruno@clisp.org>
464
465         * readutmp.h: Skip most definitions if neither <utmp.h> nor
466         <utmpx.h> exists.
467
468 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
469
470         BeOS portability.
471         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
472         Problem reported by Bruno Haible.
473
474 2006-08-21  Bruno Haible  <bruno@clisp.org>
475
476         BeOS portability.
477         * mbchar.h: Include <wctype.h> only if it exists.
478
479 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
480
481         * cycle-check.h: Include <stdint.h> unconditionally, since we
482         now assume the stdint module.  Do not include inttypes.h.
483         * fsusage.h: Likewise.
484         * getndelim2.c: Likewise.
485         * human.h: Likewise.
486         * inttostr.h: Likewise.
487         * obstack.c: Likewise.
488         * regex_internal.h: Likewise.
489         * tempname.c: Likewise.
490         * utimecmp.c: Likewise.
491         * xstrtol.h: Likewise.
492
493         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
494
495         * strtoimax.c: Adjust to macro name changes in Autoconf,
496         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
497         * xtime.h: Likewise.
498
499 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
500
501         * fchmodat.c: New file, from coreutils.  This was inadvertently
502         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
503
504 2006-08-18  Bruno Haible  <bruno@clisp.org>
505
506         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
507         (ME_DUMMY): Treat "kernfs" as a dummy.
508         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
509
510 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
511
512         Update from coreutils.
513
514         * __fpending.h: Add copyright notice.
515         * fprintftime.h: Likewise.
516         * savedir.c: Use (C) in copyright notice.
517         * savedir.h: Likewise.
518
519         2006-08-15  Jim Meyering  <jim@meyering.net>
520
521         * at-func.c: New file, with the logic of all emulated at-functions.
522         * openat-priv.h: Include <errno.h> and define ENOSYS,
523         in support of the EXPECTED_ERRNO macro.
524         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
525         Instead, define the appropriate symbols and include "at-func.c".
526         * mkdirat.c (mkdirat): Likewise.
527         * fchmodat.c (fchmodat): Likewise.
528         (ENOSYS): Remove definition.
529         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
530         Don't include "unistd--.h" -- it wasn't ever used.
531
532         2006-01-17  Jim Meyering  <jim@meyering.net>
533
534         Rewrite fts.c not to change the current working directory,
535         by using openat, fstatat, fdopendir, etc..
536
537         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
538         (HAVE_OPENAT_SUPPORT): Define.
539         [_LIBC] (fchdir): Don't undef or define; no longer used.
540         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
541         Now, this `function' always succeeds, and consumes its file descriptor
542         parameter -- so callers must not close such FDs.  Update callers.
543         (diropen_fd, opendirat, cwd_advance_fd): New functions.
544         (diropen): Add parameter, SP.  Adjust all callers.
545         Implement using diropen_fd, rather than open.
546         (fts_open): Initialize new member, fts_cwd_fd.
547         Remove fts_rft-setting code.
548         (fts_close): Close fts_cwd_fd, if necessary.
549         (__opendir2): Define in terms of opendir or opendirat,
550         depending on whether the FST_NOCHDIR flag is set.
551         (fts_build): Since fts_safe_changedir consumes its FD, and since
552         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
553         and close the dup'd file descriptor upon failure.
554         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
555         (fts_safe_changedir): Tweak semantics to reflect that this function
556         now calls cwd_advance_fd and hence consumes its FD argument.
557         * fts_.h [struct FTS] (fts_cwd_fd): New member.
558         [struct FTS] (fts_rft): Remove now-unused member.
559         [struct FTS] (fts_cycle.state): Improve comment.
560
561         * openat.c (openat_needs_fchdir): New function.
562         * openat.h (openat_needs_fchdir): Declare it.
563
564 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
565
566         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
567         Problem and fix reported by Pádraig Brady in
568         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
569
570 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
571
572         * memcoll.c (memcoll): Optimize for the common case where the
573         arguments are bytewise equal.
574
575 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
576
577         Change copyright notice from LGPL 2 to GPL 2, since that's the
578         standard form used in the gnulib repository.
579         * lock.c: LGPL -> GPL.
580         * lock.h: Likewise.
581         * strnlen1.c: Likewise.
582         * strnlen1.h: Likewise.
583         * tls.c: Likewise.
584         * tls.h: Likewise.
585         * tmpdir.c: Likewise.
586
587         * TODO: Remove; this belongs only in coreutils.
588
589 2006-08-14  Eric Blake  <ebb9@byu.net>
590
591         Import the following change from libc:
592
593         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
594
595         Upstream bug 2997.
596         * misc/error.c: Add space between program name and message if file
597         name is missing.
598
599 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
600
601         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
602         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
603
604         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
605         in wchar_t.  Problem reported by Eric Blake.
606
607         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
608         LEN is smaller than SIZE.  Suggested by Bruno Haible.
609         Also, help the compiler to keep LEN in a register.
610
611 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
612
613         * .cppi-disable: Add snprintf.h, socket_.h.
614         * snprintf.c: Include <errno.h> and <limits.h>.
615         (EOVERFLOW): Define if the system does not.
616         Do not include "minmax.h"; it wasn't used.
617         (snprintf): Don't assume size_t promotes to an unsigned type.
618         Fix bug when generated string was too long for the buffer: the
619         buffer's contents are supposed to be the initial prefix of the
620         output.  Don't assume vasnprintf returns EOVERFLOW if the size
621         exceeds INT_MAX; do the check ourselves.
622
623         Import the following changes from libc:
624
625         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
626
627         * posix/regex_internal.c (re_string_skip_chars): If no character has
628         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
629         to the byte which couldn't be converted.
630         (re_string_reconstruct): Don't clear valid_raw_len before calling
631         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
632         tip_context using re_string_context_at.
633
634         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
635
636         * posix/regex.h: g++ still cannot handled [restrict].
637
638         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
639
640         * posix/regex.h: Remove special handling for VMS.
641
642 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
643
644         Sync from coreutils.
645
646         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
647
648         * mountlist.c [ME_REMOTE]: Filter out cifs.
649         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
650
651 2006-08-08  Eric Blake  <ebb9@byu.net>
652
653         * verror.c (verror_at_line): Work around glibc bug 2997, so that
654         verror_at_line output complies with GNU Coding Standards even when
655         file is NULL.
656
657 2006-08-08  Eric Blake  <ebb9@byu.net>
658
659         * verror.h, verror.c: New files.
660
661 2006-08-07  Bruno Haible  <bruno@clisp.org>
662
663         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
664         versions of AIX.
665         Reported by Ralf Wildenhues.
666
667 2006-08-06  Eric Blake  <ebb9@byu.net>
668
669         * error.h: Fold in some upstream changes from glibc.
670         * error.c: Likewise.
671
672 2006-07-29  Bruno Haible  <bruno@clisp.org>
673
674         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
675
676 2006-07-29  Bruno Haible  <bruno@clisp.org>
677
678         * setenv.c: Undo unintended modification done on 2006-02-27.
679
680 2006-07-28  Eric Blake  <ebb9@byu.net>
681
682         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
683         macro expansion.
684
685 2006-07-28  Simon Josefsson  <jas@extundo.com>
686
687         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
688         #include's.
689
690 2006-07-28  Simon Josefsson  <jas@extundo.com>
691
692         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
693         #include's.
694
695 2006-07-28  Bruno Haible <bruno@clisp.org>
696
697         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
698
699 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
700
701         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
702         arpa/inet.h.
703
704 2006-07-28  Bruno Haible  <bruno@clisp.org>
705
706         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
707         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
708         fallbacks.
709         Avoids link error on FreeBSD 4.x.
710         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
711
712         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
713         encoding.
714         * mbswidth.c (iswcntrl): Likewise.
715
716 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
717
718         * modechange.c (mode_compile): Numeric modes now affect setuid and
719         setgid on directories only if they set these bits.
720         * modechange.h: Remove obsolete comment about masks.
721
722 2006-07-27  Bruno Haible  <bruno@clisp.org>
723
724         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
725         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
726         defined.
727
728 2006-07-26  Eric Blake  <ebb9@byu.net>
729
730         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
731         like mingw that lack mkstemp.
732         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
733         avoid compilation warning on mingw.
734
735 2006-07-25  Bruno Haible  <bruno@clisp.org>
736
737         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
738         <stdarg.h> or config.h.
739
740 2006-07-24  Bruno Haible  <bruno@clisp.org>
741
742         * clean-temp.h: New file, from GNU gettext.
743         * clean-temp.c: New file, from GNU gettext.
744
745 2006-07-24  Bruno Haible  <bruno@clisp.org>
746
747         * tmpdir.h: New file, from GNU gettext.
748         * tmpdir.c: New file, from GNU gettext.
749
750 2006-07-23  Bruno Haible  <bruno@clisp.org>
751
752         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
753         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
754         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
755         gl_linked_remove_at): Use it.
756
757 2006-07-23  Eric Blake  <ebb9@byu.net>
758
759         * tmpfile-safer.c: New file.
760         * stdio-safer.h (fopen_safer): Add prototype.
761         * stdio--.h (tmpfile): Make safer.
762
763 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
764
765         * close-stream.c, close-stream.h: New files.
766
767 2006-07-22  Bruno Haible  <bruno@clisp.org>
768
769         Merge from GNU gettext 0.15.
770
771         2005-07-05  Bruno Haible  <bruno@clisp.org>
772
773                 * printf-args.c (printf_fetchargs): Work around broken
774                 definition of wint_t on mingw.
775
776         2005-02-12  Bruno Haible  <bruno@clisp.org>
777
778                 * xallocsa.h: Add extern "C" for C++.
779
780         2006-05-17  Bruno Haible  <bruno@clisp.org>
781
782                 Cygwin portability.
783                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
784
785         2006-04-30  Bruno Haible  <bruno@clisp.org>
786
787                 * progreloc.c: Include <mach-o/dyld.h> if available.
788                 (find_executable): Use _NSGetExecutablePath when possible.
789
790         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
791
792                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
793                 function.
794
795         2005-12-29  Bruno Haible  <bruno@clisp.org>
796
797                 * progreloc.c (set_program_name_and_installdir): Fix
798                 compilation error.
799
800         2005-12-04  Bruno Haible  <bruno@clisp.org>
801
802                 Cygwin portability.
803                 * progreloc.c: Include <windows.h> also on Cygwin.
804                 (find_executable): Add support for Cygwin.
805                 (set_program_name_and_installdir): Handle also platforms with
806                 nonempty EXEEXT.
807
808         2006-07-11  Bruno Haible  <bruno@clisp.org>
809
810                 * javacomp.c: Fix a comment.
811                 Reported by Jim Meyering.
812
813         2006-04-30  Bruno Haible  <bruno@clisp.org>
814
815                 * javacomp.h (compile_java_class): Add source_version,
816                 target_version arguments.
817                 * javacomp.c: Rewritten to choose only a compiler that
818                 respects the specified source_version and target_version.
819
820         2006-06-27  Bruno Haible  <bruno@clisp.org>
821
822                 Assume correct S_ISDIR macro.
823                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
824
825         2006-07-22  Bruno Haible  <bruno@clisp.org>
826
827                 * javaversion.h: New file, from GNU gettext.
828                 * javaversion.c: New file, from GNU gettext.
829                 * javaversion.java: New file, from GNU gettext.
830                 * javaversion.class: New file, from GNU gettext.
831
832         2006-05-17  Bruno Haible  <bruno@clisp.org>
833
834                 Cygwin portability.
835                 * javaexec.c (execute_java_class): Test for jview program
836                 also on Cygwin.
837
838         2006-04-09  Bruno Haible  <bruno@clisp.org>
839
840                 * fatal-signal.c: Don't include string.h.
841                 (at_fatal_signal): Use a copying loop instead of memcpy.
842
843         2005-12-04  Bruno Haible  <bruno@clisp.org>
844
845                 * csharpexec.c: Add support for 'clix' launcher (untested).
846                 (execute_csharp_using_sscli): New function.
847                 (execute_csharp_program): Call it.
848
849         2006-06-21  Bruno Haible  <bruno@clisp.org>
850
851                 Avoid warnings from recent versions of mcs.
852                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
853                 -o, -L, -r any more. Use options documented since mcs-1.0
854                 instead. Similarly for -g.
855
856         2005-07-09  Bruno Haible  <bruno@clisp.org>
857
858                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
859                 add a .dll suffix.
860                 Reported by Mark Junker <mjscod@gmx.de>.
861
862         2006-06-17  Bruno Haible  <bruno@clisp.org>
863
864                 * config.charset: Update for NetBSD 3.0.
865
866         2006-05-17  Bruno Haible  <bruno@clisp.org>
867
868                 Cygwin portability.
869                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
870
871         2006-05-16  Bruno Haible  <bruno@clisp.org>
872
873                 * localcharset.c [CYGWIN]: Include <windows.h>.
874                 (get_charset_aliases): For Cygwin, return the same CPxxx
875                 aliases list as under WIN32.
876                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
877                 the environment variables. Fall back to GetACP().
878
879         2006-04-05  Bruno Haible  <bruno@clisp.org>
880
881                 * config.charset: Update Juan Manuel Guerrero's address.
882
883         2005-02-12  Bruno Haible  <bruno@clisp.org>
884
885                 * allocsa.h: Add extern "C" for C++.
886
887         2005-02-10  Bruno Haible  <bruno@clisp.org>
888
889                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
890                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
891
892         2006-07-22  Bruno Haible  <bruno@clisp.org>
893
894                 * gettext.h: Update to GNU gettext-0.15.
895
896 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
897         and Simon Josefsson <jas@extundo.com>
898
899         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
900
901         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
902
903 2006-07-21  Eric Blake  <ebb9@byu.net>
904
905         * stdlib-safer.h: New file from coreutils, required by
906         stdlib--.h.
907
908 2006-07-19  Derek R. Price  <derek@ximbiot.com>
909
910         * getaddrinfo.h: Don't define unimplemented AI_* flags.
911         Reindent and repaginate.
912
913 2006-07-17  Bruno Haible  <bruno@clisp.org>
914
915         * gl_list.h: New file.
916         * gl_list.c: New file.
917         * gl_array_list.h: New file.
918         * gl_array_list.c: New file.
919         * gl_carray_list.h: New file.
920         * gl_carray_list.c: New file.
921         * gl_linked_list.h: New file.
922         * gl_linked_list.c: New file.
923         * gl_anylinked_list1.h: New file.
924         * gl_anylinked_list2.h: New file.
925         * gl_avltree_list.h: New file.
926         * gl_avltree_list.c: New file.
927         * gl_anyavltree_list1.h: New file.
928         * gl_anyavltree_list2.h: New file.
929         * gl_rbtree_list.h: New file.
930         * gl_rbtree_list.c: New file.
931         * gl_anyrbtree_list1.h: New file.
932         * gl_anyrbtree_list2.h: New file.
933         * gl_anytree_list1.h: New file.
934         * gl_anytree_list2.h: New file.
935         * gl_linkedhash_list.h: New file.
936         * gl_linkedhash_list.c: New file.
937         * gl_anyhash_list1.h: New file.
938         * gl_anyhash_list2.h: New file.
939         * gl_avltreehash_list.h: New file.
940         * gl_avltreehash_list.c: New file.
941         * gl_rbtreehash_list.h: New file.
942         * gl_rbtreehash_list.c: New file.
943         * gl_anytreehash_list1.h: New file.
944         * gl_anytreehash_list2.h: New file.
945
946         * gl_oset.h: New file.
947         * gl_oset.c: New file.
948         * gl_array_oset.h: New file.
949         * gl_array_oset.c: New file.
950         * gl_avltree_oset.h: New file.
951         * gl_avltree_oset.c: New file.
952         * gl_rbtree_oset.h: New file.
953         * gl_rbtree_oset.c: New file.
954         * gl_anytree_oset.h: New file.
955
956 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
957
958         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
959         New files.
960         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
961         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
962         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
963         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
964         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
965         callers changed.  Revamp internals significantly, by not
966         attempting to create directories that are temporarily more
967         permissive than the final results.  Do not attempt to use
968         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
969         This removes some race conditions, fixes some bugs, and simplifies
970         things.  Use new dirchownmod function to do owner and mode changes.
971         * mkdir-p.h: Likewise.
972         * modechange.c (octal_to_mode): New function.
973         (struct mode_change): New member mentioned.
974         (make_node_op_equals): New arg mentioned.  All callers changed.
975         (mode_compile): Keep track of which mode bits the user has explicitly
976         mentioned.
977         (mode_adjust): New arg DIR, so that we implement the X op correctly.
978         New arg PMODE_BITS, to keep track of which mode bits the user
979         mentioned; it treats S_ISUID and S_ISGID speciall.
980         All callers changed.
981         * modechange.h: Likewise.
982
983 2006-07-11  Derek R. Price  <derek@ximbiot.com>
984
985         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
986
987 2006-07-10  Derek R. Price  <derek@ximbiot.com>
988
989         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
990         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
991         macros into the GNU _D_EXACT_NAMLEN.
992         * savedir.c:  Likewise.
993         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
994
995 2006-07-09  Jim Meyering  <jim@meyering.net>
996
997         * argp-pv.c: Remove a doubled word in a comment.
998         * check-version.c (check_version): Likewise.
999         * javacomp.c (compile_java_class): Likewise.
1000
1001 2006-07-08  Jim Meyering  <jim@meyering.net>
1002
1003         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1004
1005 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1006
1007         * getaddrinfo.c: Changes to compile under MSVC6: changed
1008         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1009         brackets.  Other minor changes to suppress some compiler
1010         warnings.
1011
1012 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1013
1014         * getloadavg.c: Use __VMS, not VMS.
1015         * getopt.c: Likewise.
1016         * getpagesize.h: Likewise.
1017         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1018         probably does not work.
1019
1020 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1021         and Paul Eggert  <eggert@cs.ucla.edu>
1022
1023         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1024         Don't worry about this obsolete case any more.
1025         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1026         directories.
1027         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1028         worry about this obsolete case any more.
1029         * fts.c: Likewise.
1030         * getcwd.c: Likewise.
1031         * glob.h: Likewise.
1032         * savedir.c: Likewise.
1033
1034 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1035
1036         * .cppi-disable: Add wcwidth.
1037         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1038         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1039         (ISGRAPH): Remove.  All uses changed to isgraph.
1040         (FOLD) [!defined _LIBC]: Remove special case.
1041         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1042         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1043         HAVE_ISBLANK.
1044         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1045
1046 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1047
1048         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1049
1050 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1051
1052         * memcasecmp.c: Include <limits.h>.
1053         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1054         * strtod.c (strtod): Don't assume isspace works on negative chars.
1055         Don't assume isdigit succeeds only on '0' through '9'.
1056
1057 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1058
1059         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1060         All uses of is_space replaced by isspace.
1061         * exit.h: Don't talk about STDC_HEADERS.
1062         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1063         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1064         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1065         replaced by isprint etc.
1066         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1067         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1068         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1069         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1070         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1071         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1072
1073 2006-07-05  Eric Blake  <ebb9@byu.net>
1074
1075         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1076         missing from netdb.h.
1077         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1078
1079 2006-06-27  Bruno Haible  <bruno@clisp.org>
1080
1081         Assume ANSI C header files and <ctype.h> functions.
1082         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1083         (mbsnwidth): Use isprint, iscntrl instead.
1084
1085 2006-07-03  Jim Meyering  <jim@meyering.net>
1086
1087         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1088         macro is used before the first cycle_check call.
1089
1090 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1091
1092         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1093         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1094         reported by Mark D. Baushke, one in
1095         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1096
1097         Merge from coreutils.
1098
1099         * .cppi-disable: Add stdint_.h.
1100         * .cvsignore: Add stdint.h.
1101
1102         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1103
1104         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1105         both double and long double versions.
1106         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1107         * xstrtold.c: New file.
1108         * xstrtod.h (xstrtold): New decl.
1109
1110         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1111
1112         * filemode.c (setst): Remove.
1113         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1114         (arguably) clearer, and the generated code is a bit smaller on my
1115         Debian GNU/Linux stable x86 host.
1116
1117         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1118
1119         * filemode.c: Include "filemode.h" first, to test the interface.
1120         Assume that filemode.h includes sys/types.h and sys/stat.h.
1121         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1122         (ftypelet): Reorder to put common cases first, for efficiency.
1123         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1124         to do 'M'.
1125         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1126         of 10, for compatibility with FreeBSD.  All callers changed.
1127         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1128         that can't be deduced solely from st_mode.  First arg is now a const
1129         pointer.
1130         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1131         (strmode): Renamed from mode_string.
1132         (filemodestring): New decl.
1133         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1134         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1135         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1136
1137         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1138
1139         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1140         fsusage.h now does that.  Include fsusage.h first, to test interface.
1141         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1142         at most one method (the old code could have generated decls that
1143         didn't conform to C89, not that this was ever exercised).
1144         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1145
1146         2006-03-19  Jim Meyering  <jim@meyering.net>
1147
1148         Work even in a chroot where d_ino values for entries in "/"
1149         don't match the stat.st_ino values for the same names.
1150         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1151         number, iterate through all entries again, using lstat instead.
1152         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1153         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1154
1155         * getcwd.c (__getcwd): Clarify a comment.
1156         Use memcpy in place of a call to strcpy.
1157
1158         2006-03-12  Jim Meyering  <jim@meyering.net>
1159
1160         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1161         that of the current directory (which we're about to chdir ".." out of),
1162         then save the dev-ino of the parent, instead.
1163
1164         * same-inode.h (SAME_INODE): New file/macro.
1165         * chdir-safer.c (SAME_INODE): Remove definition.
1166         Include "same-inode.h", instead.
1167         * same.c: Likewise.
1168         * cycle-check.h: Include "same-inode.h".
1169         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1170         * cycle-check.c (SAME_INODE): Remove definition.
1171         * root-dev-ino.h: Include "same-inode.h".
1172
1173         2006-03-11  Eric Blake  <ebb9@byu.net>
1174
1175         * same.c (same_name): s/base_name/last_component/
1176         * backupfile.c (check_extension, numbered_backup): Likewise.
1177         * filenamecat.c (file_name_concat): Likewise.
1178
1179         2006-03-11  Eric Blake  <ebb9@byu.net>,
1180                     Paul Eggert  <eggert@cs.ucla.edu>
1181
1182         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1183         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1184         drive prefix.
1185         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1186         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1187         (last_component): New method.
1188         * dirname.c (dir_len): Determine when drive letters need a
1189         subsequent slash.  Preserve // when it is special.
1190         (dir_name): Don't append dot when drive letter is absolute.
1191         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1192         * basename.c (base_name): New semantics - malloc the result.
1193         Preserve // when it is special.  Preserve relative files that look
1194         like drive letters.
1195         (base_len): Preserve // when it is special.
1196         (last_component): New method, similar to old base_name semantics.
1197         * stripslash.c (strip_trailing_slashes): Use last_component, not
1198         base_name.  Strip redundant slashes from ///.
1199
1200 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1201
1202         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1203         both are 64 bits, since this seems to be the tradition, and this
1204         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1205         we ever run into a host that prefers long long to long in this
1206         case, we'll need another configure-time test.  Problem reported by
1207         Jim Meyering.
1208
1209 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1210
1211         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1212         possible collision with system files.
1213         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1214         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1215         WCHAR_MIN and WCHAR_MAX in this case.
1216         (<stddef.h>): Do not include; no longer needed.
1217         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1218         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1219         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1220         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1221         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1222         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1223         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1224         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1225         !defined(__c99))]: Include in this case too, since it's harmless
1226         now.
1227         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1228         dangerous to do so.
1229         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1230         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1231         (_STDINT_MIN, _STDINT_MAX): New macros.
1232         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1233         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1234         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1235         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1236         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1237         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1238         macros, not typedefs; this simplifies things quite a bit.
1239         Use long int for all types narrower than int64_t.
1240         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1241         Define in terms of long long int or int64_t or long int,
1242         not int64_t or int32_t.  This saves some compile-time testing.
1243         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1244         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1245         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1246         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1247         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1248         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1249         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1250         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1251         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1252         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1253         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1254         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1255         undef any previous version and define our own version, for
1256         simplicity and consistency with the new macros for types.
1257         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1258         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1259         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1260         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1261         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1262         @WINT_T_SUFFIX@ to keep things simple here.
1263         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1264         Simplify by assuming typical 8/16/32/64 host, since we're
1265         already doing that elsewhere anyway.
1266         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1267         and assume long long int is 64 bits if available.  This
1268         speeds up 'configure'.
1269
1270 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1271
1272         * getaddrinfo.c: fixed typo
1273
1274 2006-06-29  Eric Blake  <ebb9@byu.net>
1275
1276         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1277         unused static function.
1278
1279 2006-06-29  Eric Blake  <ebb9@byu.net>
1280
1281         * stat_.h: New file.
1282
1283 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1284
1285         * strftime.c: Assume strftime() exists.
1286
1287 2006-06-28  Bruno Haible  <bruno@clisp.org>
1288
1289         * getaddrinfo.h: Fix POSIX URL.
1290         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1291         (use_win32_p): Make static.
1292         (getaddrinfo): Reject service name if it is empty or does not consist
1293         solely of decimal digits, or if its value is > 65535.
1294         (getnameinfo): Remove useless casts.
1295
1296 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1297
1298         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1299         Autoconf 2.60 says this stuff was obsolete.
1300
1301 2006-05-12  Bruno Haible  <bruno@clisp.org>
1302
1303         * mkdtemp.c [MINGW]: Include <io.h>.
1304         (mkdir): Define using _mkdir.
1305
1306 2006-06-28  Bruno Haible  <bruno@clisp.org>
1307
1308         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1309         declaration for wcwidth.
1310         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1311
1312 2006-06-28  Eric Blake  <ebb9@byu.net>
1313
1314         * xvasprintf.h: Fix comments.
1315
1316 2006-06-28  Eric Blake  <ebb9@byu.net>
1317
1318         * mbchar.h (wcwidth): Include wcwidth.h.
1319         * mbswidth.c (wcwidth): Move from here...
1320         * wcwidth.h: ...to this new file.
1321
1322 2006-06-28  Simon Josefsson  <jas@extundo.com>
1323
1324         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1325         functions there.  It will succeed on Windows XP, but on Windows
1326         2000 and (presumably) earlier, it will fail, and use the internal
1327         re-implementation.
1328         (use_win32_p): New function.
1329         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1330         Support AI_NUMERICSERV to disable getservbyname.
1331         (getnameinfo): New function, only supports
1332         NI_NUMERICHOST|NI_NUMERICSERV for now.
1333
1334         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1335         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1336         getnameinfo.
1337
1338 2006-06-27  Bruno Haible  <bruno@clisp.org>
1339
1340         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1341
1342 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1343
1344         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1345         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1346         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1347
1348 2006-06-26  Bruno Haible  <bruno@clisp.org>
1349
1350         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1351         WCHAR_MAX.
1352         Reported by Mark D. Baushke and Larry Jones.
1353
1354 2006-06-26  Bruno Haible  <bruno@clisp.org>
1355
1356         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1357         in pre-C99 mode.
1358         Suggested by Mark D. Baushke and Larry Jones.
1359
1360 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1361
1362         * stdint_.h: Treat BSD/OS like OpenBSD.
1363
1364 2006-06-23  Bruno Haible  <bruno@clisp.org>
1365
1366         * stdint_.h: Treat IRIX like OpenBSD.
1367
1368 2006-06-23  Bruno Haible  <bruno@clisp.org>
1369
1370         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1371         ISO C 99 Technical Corrigendum 1.
1372
1373 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1374
1375         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1376         Some compiler complained about some of them.  Problem reported by
1377         Larry Jones in
1378         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1379
1380 2006-06-21  Simon Josefsson  <jas@extundo.com>
1381
1382         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1383         variable.
1384
1385         * socket_.h: Don't define WINVER.
1386
1387         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1388         slightly modified to work in gnulib.
1389
1390 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1391
1392         * read-file.c (fread_file): Start with buffer allocation of
1393         0 bytes rather than 1 byte; this simplifies the code.
1394         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1395         code to free buffer and save/restore errno.
1396         (internal_read_file): Remove unused local.
1397
1398 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1399
1400         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1401         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1402         Problem reported by Denis Excoffier in
1403         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1404
1405 2006-06-19  Simon Josefsson  <jas@extundo.com>
1406
1407         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1408
1409 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1410
1411         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1412
1413 2006-06-17  Bruno Haible  <bruno@clisp.org>
1414
1415         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1416
1417 2006-06-17  Bruno Haible  <bruno@clisp.org>
1418
1419         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1420         problem on Solaris 2.5.1.
1421
1422 2006-06-16  Eric Blake  <ebb9@byu.net>
1423
1424         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1425         * unicodeio.c [!defined errno]: Likewise.
1426         * strtol.c [!defined errno]: Likewise.
1427         * strtod.c [!defined errno]: Likewise.
1428
1429 2006-06-15  Bruno Haible  <bruno@clisp.org>
1430
1431         * stdint_.h: Rewritten to be fully auto-configured.
1432         Fixes bug on HP-UX/IA64.
1433
1434 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1435
1436         * getdate.y (__attribute__): Don't define if already defined.
1437         Problem reported by Larry Jones.
1438         * utimens.c (__attribute__): Likewise.
1439
1440 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1441
1442         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1443         reported by Andreas Schwab.
1444
1445 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1446             Bruno Haible  <bruno@clisp.org>
1447
1448         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1449
1450 2006-05-26  Martin Lambers  <marlam@marlam.de>
1451
1452         * getpass.c: Updates the test for the native W32 API, and adds
1453         missing includes, thus fixing compilation warnings.
1454
1455 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1456
1457         * tempname.c (small_open, large_open): New macros.
1458         (__open, __open64) [!_LIBC]: Remove.
1459         (__gen_tempname): Use small_open and large_open instead of __open
1460         and __open64.  This fixes a portability bug on HP-UX 11.11i
1461         reported by Simon Wing-Tang in
1462         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1463
1464 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1465
1466         * exclude.c (exclude_fnmatch): New function.
1467         (excluded_file_name): Call exclude_fnmatch.
1468         * exclude.h (excluded_file_name): New prototype
1469
1470 2006-05-24  Bruno Haible  <bruno@clisp.org>
1471
1472         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1473         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1474         Reported by Thorsten Maerz <torte@netztorte.de> via
1475         Aaron Stone <aaron@serendipity.cx>.
1476
1477 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1478
1479         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1480         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1481         (my_usleep): Don't mishandle maximum value.
1482
1483 2006-05-19  Jim Meyering  <jim@meyering.net>
1484
1485         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1486
1487 2006-05-17  Bruno Haible  <bruno@clisp.org>
1488
1489         Cygwin portability.
1490         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1491
1492 2006-05-17  Bruno Haible  <bruno@clisp.org>
1493
1494         * stdint_.h: Fix recognition of Cygwin.
1495
1496 2006-05-11  Jim Meyering  <jim@meyering.net>
1497
1498         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1499
1500 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1501
1502         * crc.c (crc32_update): Remove unnecessary L suffix.
1503         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1504         unwanted sign propagation, e.g., on hosts with 64-bit int.
1505         There still are some problems with reeelly weird theoretical hosts
1506         (e.g., 33-bit int) but it's not worth worrying about now.
1507         * sha1.c (rol): Likewise.
1508         (K1, K2, K3, K4): Remove unnecessary L suffix.
1509
1510 2006-05-10  Bruno Haible  <bruno@clisp.org>
1511
1512         * des.c: Cast to avoid warnings.
1513
1514 2006-05-10  Simon Josefsson  <jas@extundo.com>
1515
1516         * md4.c: Typo fix, update copyright years.
1517         (K1, K2): Don't use L because it turn computations into 64-bit on
1518         64-bit platforms.
1519
1520 2006-05-09  Bruno Haible  <bruno@clisp.org>
1521
1522         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1523         (EOVERFLOW): Define fallback value.
1524         (xstrcat): New function.
1525         (xvasprintf): Recognize the special case of a string concatenation.
1526
1527 2006-05-01  Bruno Haible  <bruno@clisp.org>
1528
1529         * stdint_.h: Shorter URL.
1530         * inttypes.h: Likewise.
1531
1532 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1533
1534         * verify.h: Document the internals better.  Most of this change
1535         was written by Bruno Haible.
1536
1537 2006-04-29  Bruno Haible  <bruno@clisp.org>
1538
1539         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1540         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1541
1542 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1543
1544         * getdate.y (get_date): When adding relative date, start with the
1545         initial time, not with the result of the first mktime call.
1546
1547 2006-04-23  Bruno Haible  <bruno@clisp.org>
1548
1549         * copy-file.c: Include <unistd.h> unconditionally.
1550         * execute.c: Likewise.
1551         * fatal-signal.c: Likewise.
1552         * findprog.c: Likewise.
1553         * mkdtemp.c: Likewise.
1554         * pipe.h: Likewise.
1555         * pipe.c: Likewise.
1556         * wait-process.h: Likewise.
1557
1558 2006-04-23  Bruno Haible  <bruno@clisp.org>
1559
1560         * fwriteerror.c (fwriteerror): Call fclose also when an error
1561         condition was already detected.
1562         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1563
1564 2006-04-19  Derek Price  <derek@ximbiot.com>
1565             Eric Blake  <ebb9@byu.net>
1566
1567         * inttypes.h: Correct grammar in comment.
1568
1569 2006-04-18  Derek Price  <derek@ximbiot.com>
1570             Paul Eggert  <eggert@cs.ucla.edu>
1571
1572         * inttypes.h: New file.
1573         * strtoimax.c: Assume <inttypes.h>.
1574
1575 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1576
1577         * utimens.c (futimens): glibc futimesat messes up if /proc
1578         isn't mounted.  Problem reported by Kir Kolyshkin.
1579
1580 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1581
1582         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1583         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1584         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1585
1586 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1587
1588         Merge regex changes from libc, removing some of our
1589         POSIX-conformance changes that were rejected and redoing them in a
1590         less-intrusive way.
1591
1592         * regcomp.c (re_compile_internal, init_dfa):
1593         Length arg is now size_t, not Idx.  All uses changed.
1594         (peek_token): Forward decl now says internal_function.
1595         (__re_error_msgid, __re_error_msgid_idx):
1596         Now static rather than extern with attribute_hidden.
1597         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1598         For some reason libc prefers K&R style defns for external functions.
1599         (regerror) [!defined _LIBC]: Likewise.
1600         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1601         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1602         (build_range_exp, build_collating_symbol):
1603         Use K&R-style defn.
1604         (re_compile_fastmap): Use '\0' to memset, not 0.
1605         (utf8_sb_map): Make the calculations more obvious.
1606         (init_dfa, parse_bracket_exp, build_charclass_op):
1607         Call calloc and cast result, as glibc does.
1608         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1609         (build_range_exp, build_collating_symbol):
1610         Now internal functions.
1611
1612         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1613
1614         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1615         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1616         Don't depend on VMS; depend on __VMS instead, for POSIX
1617         namespace cleanness.
1618         (regoff_t): Define to ssize_t, not long int.
1619
1620         Remove the REG_ macros named below.  Instead, make the old names
1621         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1622         __USE_GNU_REGEX.
1623         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1624         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1625         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1626         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1627         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1628         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1629         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1630         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1631         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1632         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1633         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1634         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1635         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1636         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1637         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1638         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1639         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1640         (REG_NREGS):
1641         Remove.  All uses replaced by the old RE_* names.
1642         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1643         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1644         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1645         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1646         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1647         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1648         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1649         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1650         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1651         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1652         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1653         Don't bother having these macros be independent of each others'
1654         values, since they no longer exist in the POSIX name space.
1655
1656         Rename the following member names back to their old names,
1657         unless !__USE_GNU_REGEX.  All uses changed back.
1658         (buffer): Renamed from re_buffer.
1659         (allocated): Renamed from re_allocated.
1660         (used): Renamed from re_used.
1661         (syntax): Renamed from re_syntax.
1662         (fastmap): Renamed from re_fastmap.
1663         (translate): Renamed from re_translate.
1664         (can_be_null): Renamed from re_can_be_null.
1665         (regs_allocated): Renamed from re_regs_allocated.
1666         (fastmap_accurate): Renamed from re_fastmap_accurate.
1667         (no_sub): Renamed from re_no_sub.
1668         (not_bol): Renamed from re_not_bol.
1669         (not_eol): Renamed from re_not_eol.
1670         (newline_anchor): Renamed from re_newline_anchor.
1671         (num_regs): Renamed from rm_num_regs.
1672         (start): Renamed from rm_start.
1673         (end): Renamed from rm_end.
1674
1675         (free_state): Move up a bit.
1676
1677         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1678         #define to be empty.
1679         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1680         when that is what is intended.
1681         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1682         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1683         (MAX): New macro.
1684         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1685         All uses changed back to re_malloc, etc.  It's now the caller's
1686         responsibility to check for overflow; all callers changed.
1687         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1688         (re_x2nrealloc): Remove.
1689         (free_state): Remove decl.
1690
1691         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1692         (re_set_registers, re_exec):
1693         Use K&R-style defn.
1694
1695         2006-01-31  Roland McGrath  <roland@redhat.com>
1696
1697         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1698         Reported by Mike Frysinger <vapier@gentoo.org>.
1699
1700         2006-01-15  Andreas Jaeger  <aj@suse.de>
1701
1702         [BZ #1950]
1703         * regex_internal.c (re_string_reconstruct): Adjust for
1704         build_wcs_upper_buffer change.
1705         (build_wcs_upper_buffer): Change return type.
1706
1707         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1708
1709         * regex_internal.h: Include <stdint.h> if available.
1710
1711         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1712
1713         * regex_internal.h (SIZE_MAX): Provide a default definition.
1714
1715         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1716
1717         * regcomp.c: Adjust for changed secondary hash function.
1718
1719         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1720
1721         * regex.h: Pretty printing.
1722         Clean up namespace a bit.
1723
1724         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1725
1726         * regexec.c (update_cur_sifted_state, check_arrival,
1727         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1728
1729         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1730                     Ulrich Drepper  <drepper@redhat.com>
1731
1732         [BZ #1302]
1733         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1734         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1735
1736         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1737
1738         [BZ #281]
1739         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1740         * regcomp.c: Remove unnecessary uses of
1741         unsigned RE_TRANSLATE_TYPE.
1742         * regex_internal.h: Likewise.
1743         * regex_internal.c: Likewise.
1744         * regexec.c: Likewise.
1745         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1746
1747         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1748
1749         * regexec.c (find_recover_state): Remove unnecessary
1750         initialization.
1751         (transit_state_bkref): Make DFA a const pointer.
1752         (get_subexp): Likewise.
1753         (check_arrival): Likewise.
1754         (update_cur_sifted_state): Likewise.
1755         (re_search_internal): Likewise.
1756         (prune_impossible_nodes): Likewise.
1757         (acquire_init_state_context): Likewise.
1758         (proceed_next_node): Likewise.
1759         (set_regs): Likewise.
1760         (free_fail_stack_return): Likewise.
1761         (check_arrival_expand_ecl): Mark DFA parameter as const.
1762         (check_arrival_expand_ecl_sub): Likewise.
1763         (check_subexp_limits): Likewise.
1764         (sub_epsilon_src_nodes):  Likewise.
1765         (add_epsilon_src_nodes):  Likewise.
1766         (merge_state_array): Likewise.
1767         (update_regs): Likewise.
1768         (build_trtable): Likewise.
1769         (sift_states_backward): Mark MCTX parameter as const.
1770         (build_sifted_states): Likewise.
1771         (update_cur_sifted_state): Likewise.
1772         (sift_states_mkref): Likewise.
1773         (check_arrival_expand_ecl): Mark eclosure as const.
1774         (check_dst_limits_calc_pos_1): Likewise.
1775         * regex_internal.h (re_match_context_t): Make dfa a const
1776         pointer.
1777
1778         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1779
1780         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1781         (transit_state_sb): Likewise.
1782         (transit_state_mb): Likewise.
1783         (sift_states_iter_mb): Likewise.
1784         (check_arrival_add_next_nodes): Likewise.
1785         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1786         [_LIBC] (re_search_2_stub): Use mempcpy.
1787
1788         * regex_internal.c (re_string_reconstruct): Avoid calling
1789         mbrtowc for very simple UTF-8 case.
1790
1791         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1792         a pointer-to-const.
1793         (re_acquire_state_context): Likewise.
1794         * regex_internal.h: Adjust prototypes.
1795
1796         * regex.c: Prevent using C++ compilers.
1797
1798         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1799         (re_acquire_state_context): Likewise.
1800
1801 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1802             Bruno Haible  <bruno@clisp.org>
1803
1804         * stdint_.h: On OpenBSD, don't redefine types already included in
1805         <sys/types.h> and <inttypes.h>.
1806
1807 2006-03-24  Eric Blake  <ebb9@byu.net>
1808
1809         * time_r.c (copy_string_result): Remove, as it is no longer used.
1810
1811 2006-03-24  Simon Josefsson  <jas@extundo.com>
1812
1813         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1814         including some doc fixes.
1815         (base64_encode_alloc): Fix +1 bug on allocation failures.
1816
1817 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1818
1819         * base64.c (base64_encode): Do not read past end of array with
1820         unsanitized input on systems with CHAR_BIT > 8.
1821
1822 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1823
1824         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1825         Typedef to long int, not to off_, as POSIX will likely change
1826         in that direction.
1827
1828 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1829
1830         * argp-help.c (validate_uparams): Fix typo
1831         * argp-parse.c (argp_default_options): Consistently begin help
1832         messages with a lowercase letter.
1833
1834 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1835
1836         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1837         overrun buffers and shouldn't be used (much as gets shouldn't be
1838         used).
1839         * time_r.c (asctime_r, ctime_r): Likewise.
1840
1841 2006-03-08  Simon Josefsson  <jas@extundo.com>
1842
1843         * gc-gnulib.c (randomize): Don't open files called 'no', they
1844         signal that configure disabled the device.
1845
1846 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1847
1848         * c-stack.c: Include unistd.h unconditionally, since we now assume
1849         the unistd module.
1850         * getlogin_r.c: Likewise.
1851         * getlogin_r.h: Likewise.
1852         * glob.c: Likewise.
1853         * pagealign_alloc.c: Likewise.
1854         * unistd_.h: Remove; no longer needed.
1855
1856 2006-03-07  Simon Josefsson  <jas@extundo.com>
1857
1858         * unistd_.h: New file.
1859
1860 2006-03-07  Simon Josefsson  <jas@extundo.com>
1861
1862         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1863
1864 2006-03-01  Simon Josefsson  <jas@extundo.com>
1865
1866         * readline.c: Fix typo, tiny patch from Stepan Kasal
1867         <kasal@ucw.cz>.
1868
1869 2006-02-28  Simon Josefsson  <jas@extundo.com>
1870
1871         * getopt.c: Protect #include of unistd.h, for MSVS.
1872
1873 2006-02-27  Simon Josefsson  <jas@extundo.com>
1874
1875         * base64.h: Indent #define's.  From Jim Meyering
1876         <jim@meyering.net>.
1877
1878 2006-02-27  Jim Meyering  <jim@meyering.net>
1879
1880         Revert the change of 2006-02-24, so these files can continue
1881         to be sync'd from gettext.
1882         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1883         of `config.h'.
1884
1885 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1886
1887         * glob.c: Say "invalid" rather than "illegal" in comments.
1888
1889 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1890
1891         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1892
1893 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1894
1895         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1896         AT_FDCWD exceeds INT_MAX.
1897         * openat.h (AT_FDCWD): Likewise.
1898
1899 2006-02-14  Jim Meyering  <jim@meyering.net>
1900
1901         Sync from coreutils.
1902
1903         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1904         failure on deficient systems, and simplify gnulib lgpl dependencies.
1905         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1906         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1907
1908         * xalloc-die.c: Remove unused definition of N_.
1909
1910 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1911
1912         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1913
1914 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1915
1916         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1917         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1918
1919 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1920
1921         * argp-namefrob.h: Restore changes accidentally lost during the
1922         "autoupdate" on 2005-12-12.
1923
1924 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1925
1926         * fnmatch.c (L_): Renamed from L, to work around a bug in
1927         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1928         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1929         All uses changed.
1930
1931 2006-01-26  Simon Josefsson  <jas@extundo.com>
1932
1933         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1934         prototype is visible on mingw32.
1935
1936         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1937         for mingw32.
1938
1939         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1940         mingw32).
1941
1942 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1943
1944         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1945         attempt to open for write; this always fails, at least on POSIX
1946         hosts.  This reinstates the 2006-01-09 change, which was
1947         inadvertently removed.
1948
1949 2006-01-26  Bruno Haible  <bruno@clisp.org>
1950             Paul Eggert  <eggert@cs.ucla.edu>
1951
1952         * stdbool_.h (_Bool)
1953         [(! (defined __cplusplus || defined __BEOS__)
1954           && !defined __GNUC__
1955           && !(defined __HP_cc || defined __xlc__
1956                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1957                || defined __sgi))]:
1958         #define to signed char in these cases too; this simplifies
1959         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1960         etc., separately) and makes it more conservative.
1961
1962 2006-01-21  Jim Meyering  <jim@meyering.net>
1963
1964         Sync from the stable (b5) branch of coreutils:
1965
1966         * fts.c (fts_children): Don't let close() clobber errno from
1967         failed fchdir().
1968
1969         * fts.c (fts_stat): When following a symlink-to-directory,
1970         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1971         a dangling symlink.  That can also happen at least for ELOOP.
1972         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1973         FYI, this bug predates the inclusion of fts.c in coreutils.
1974
1975         * fts.c (fts_open): Put new maxarglen declaration and uses
1976         in their own block, so pre-c99 compilers don't object.
1977
1978         Avoid the double-free (first in fts_read, second in fts_close) that
1979         would occur when an `active' directory is made inaccessible (e.g.,
1980         via chmod a-x) during a traversal.
1981         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1982         before returning.  Reproduce this failure by
1983         mkdir -p a/b; cd a; chmod a-x . b
1984         Reported by Stavros Passas.
1985
1986 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1987
1988         * argp-namefrob.h: Bugfix. Remove stray #
1989
1990 2006-01-25  Bruno Haible  <bruno@clisp.org>
1991
1992         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1993         warnings.
1994         Reported by Paul Eggert.
1995
1996 2006-01-25  Jim Meyering  <jim@meyering.net>
1997
1998         * fileblocks.c: Remove more useless parentheses.
1999         * readutmp.h: Likewise.
2000
2001 2006-01-24  Bruno Haible  <bruno@clisp.org>
2002
2003         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2004         has it.
2005         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2006         2005-11-26.
2007
2008         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2009         to avoid problems with the built-in _Bool type.
2010         Reported by Paul Eggert on 2005-11-26.
2011
2012 2006-01-24  Jim Meyering  <jim@meyering.net>
2013
2014         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2015
2016 2006-01-24  Simon Josefsson  <jas@extundo.com>
2017
2018         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2019         Bruno.
2020
2021 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2022
2023         Work around porting bugs reported by Dieter in
2024         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2025         * getopt.c (_NOPROTO): Remove; no longer needed.
2026         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2027         Include "getopt.h" first, to check interface.
2028         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2029         !HAVE_DECL_GETENV.
2030         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2031         (__strndup): Revert to K&R-style function dfns, the glibc style.
2032         * strnlen.c: Don't claim it's taken from glibc; it's not.
2033         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2034         Include strnlen.h first, to get prototype properly.
2035         (strnlen): Renamed from __strnlen.
2036         Remove weak alias.
2037
2038 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2039
2040         These changes imported from libc.
2041         * getopt.c: Use __fxprintf instead of inline stream orientation
2042         test and two separate function calls.
2043         * strndup.c (__strndup): Add libc_hidden_def.
2044
2045 2006-01-22  Bruno Haible  <bruno@clisp.org>
2046
2047         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2048         temporary buffer for sprintf, take into account the precision also
2049         for 'd', 'i', 'u', 'o', 'x', 'X'.
2050
2051 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2052
2053         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2054         to pacify gcc -Wswitch-default.
2055
2056 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2057
2058         * argp-help.c (usage_long_opt): Do not print DOC options.
2059         (__argp_base_name): Removed
2060         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2061         typo.
2062         (__argp_base_name): Provide macro definition or extern declaration
2063         depending on the configuration
2064
2065 2006-01-20  Simon Josefsson  <jas@extundo.com>
2066
2067         * inet_ntop.h: Unconditionally include sys/socket.h.
2068
2069 2006-01-19  Simon Josefsson  <jas@extundo.com>
2070
2071         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2072
2073 2006-01-12  Simon Josefsson  <jas@extundo.com>
2074
2075         * base64.c: Fix warning, reported by Bruno Haible
2076         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2077
2078 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2079
2080         Sync from coreutils.
2081         * md5.c: Fix commentary typos.
2082         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2083         * md5.h (__attribute__): Remove; unused.
2084         * sha1.c: Fix commentary to match md5 better.
2085         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2086         so that we don't need to worry about alignment.  All uses changed.
2087         This merges the 2005-10-28 md5 change into sha1.
2088
2089 2006-01-11  Jim Meyering  <jim@meyering.net>
2090
2091         Sync from coreutils.
2092         * md5.c (OP): Fix spacing.
2093
2094 2006-01-11  Simon Josefsson  <jas@extundo.com>
2095
2096         * stdint_.h (SIZE_MAX): Add missing (.
2097
2098 2006-01-10  Bruno Haible  <bruno@clisp.org>
2099
2100         * argp.h (__const): Remove macro. Use const instead.
2101         * argp-fmtstream.h (__const): Likewise.
2102         * glob_.h (__const): Remove macro.
2103         * glob-libc.h: Use const instead of __const.
2104
2105 2006-01-10  Jim Meyering  <jim@meyering.net>
2106
2107         Avoid the double-free (first in fts_read, second in fts_close) that
2108         would occur when an `active' directory is made inaccessible (e.g.,
2109         via chmod a-x) during a traversal.
2110         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2111         before returning.  Reproduce this failure by
2112         mkdir -p a/b; cd a; chmod a-x . b
2113         Reported by Stavros Passas.
2114
2115         Sync from coreutils.
2116         * sha1.c: Tweak grammar in a comment.
2117
2118 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2119
2120         * regex_internal.h (BITSET_WORD_BITS):
2121         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2122         preprocessor mishandles large unsigned values as if they were signed.
2123         Problem reported by Claudio Fontana in
2124         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2125
2126 2006-01-10  Simon Josefsson  <jas@extundo.com>
2127
2128         * socket_.h: New file.
2129
2130 2006-01-10  Bruno Haible  <bruno@clisp.org>
2131
2132         * localcharset.c: Update from GNU gettext.
2133
2134 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2135
2136         Sync from coreutils.
2137         * chdir-long.c (cdb_free): Don't bother trying to open directory
2138         for write access: POSIX says that must fail.
2139         * fts.c (diropen): Likewise.
2140         * save-cwd.c (save_cwd): Likewise.
2141         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2142         well, for minor improvements on hosts that lack O_DIRECTORY.
2143         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2144         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2145         Fall back on chown if open failed with EACCES.
2146
2147         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2148         Report an error at compile-time if only a 1-second nominal clock
2149         resolution is found.
2150
2151         * lchmod.h: New file.
2152         * mkdir-p.c: Include lchmod.h, lchown.h.
2153         (make_dir_parents): Use lchown rather than chown, and
2154         lchmod rather than chmod.
2155
2156         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2157         too.  Problem with "none" reported by Bob Proulx.  Problem with
2158         "proc" reported by n0dalus.
2159
2160         * mountlist.c: Include <limits.h>.
2161         (dev_from_mount_options)
2162         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2163         New function.  It no longer assumes "dev=" has the System V meaning
2164         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2165         (read_file_system_list)
2166         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2167         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2168         dev= in that case.
2169
2170         * posixtm.h (PDS_PRE_2000): New macro.
2171         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2172         All usages changed.  Reject dates outside the range 1969-1999 if
2173         PDS_PRE_2000 is used.
2174
2175 2006-01-09  Jim Meyering  <jim@meyering.net>
2176
2177         Sync from coreutils.
2178
2179         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2180
2181         * chdir-safer.h, chdir-safer.c: New files.
2182
2183         * modechange.c (mode_compile): Reject an invalid mode string
2184         that starts with an octal digit.  From Andreas Gruenbacher.
2185
2186         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2187         and dup to open_safer and dup_safer, respectively.
2188         (openat_permissive): Fix typo in comment.
2189
2190         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2191         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2192         (_): Remove; no longer needed.
2193         (openat): Renamed from rpl_openat; no need for rpl_openat
2194         since openat.h renames openat for us.
2195         Replace most of the body with a call to openat_permissive,
2196         to avoid duplicate code.
2197         Port to (probably hypothetical) environments were mode_t is
2198         wider than int.
2199         (openat_permissive): Require mode arg, so that we can check
2200         types better.  Put it just after flags.  Change cwd failure
2201         indicator from pointer-to-bool to pointer-to-errno-value.
2202         All callers changed.
2203         Invoke openat_save_fail and/or openat_restore_fail if
2204         cwd_errno is null, so that openat can call us.
2205         (openat_permissive, fdopendir, fstatat, unlinkat):
2206         Simplify errno handling to avoid some duplicate code,
2207         as it's OK to set errno on success.
2208         * openat.h: Revamp code so that function macros depend on
2209         __OPENAT_PREFIX only, not also on AT_FDCWD.
2210         (openat_ro): Remove.  Caller changed to use openat_permissive.
2211         (openat_permissive): Now a macro, if not a function.
2212         (openat_restore_fail, openat_save_fail): Now always functions,
2213         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2214
2215         * openat-priv.h: New file, defining macros used by mkdirat.c
2216         and openat.c.
2217         * mkdirat.c: Include openat-priv.h.
2218         Remove definitions of macros defined therein.
2219         * openat.c: Likewise.
2220
2221         * mkdirat.c (mkdirat): New file and function.
2222         * openat.h (mkdirat): Declare.
2223
2224         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2225
2226         * openat.h (openat_permissive): Declare.
2227         (openat_ro): Define.
2228
2229         * openat.c (EXPECTED_ERRNO): New macro.
2230         (openat_permissive): New function -- used in remove.c rewrite.
2231         (all functions): Set errno just before returning, only if there
2232         was an actual failure.
2233         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2234
2235         Emulate openat-family functions using Linux's procfs, if possible.
2236         Idea and some code based on Ulrich Drepper's glibc changes.
2237
2238         * openat.c: (BUILD_PROC_NAME): New macro.
2239         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2240         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2241         before falling back on save_cwd and restore_cwd.
2242         (fdopendir, fstatat, unlinkat): Likewise.
2243
2244         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2245         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2246
2247         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2248         as second argument to va_arg.  Otherwise, some versions of gcc
2249         warn that `if this code is reached, the program will abort'.
2250
2251 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2252
2253         Sync from coreutils.
2254
2255         Add POSIX ACL support
2256         * acl.h (copy_acl, set_acl): Add declarations.
2257         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2258         systems other than Linux.
2259         (chmod_or_fchmod): New function: use fchmod when possible,
2260         and chmod otherwise.
2261         (file_has_acl): Add a POSIX ACL implementation, with a
2262         Linux-specific subcase.
2263         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2264         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2265         acls are unsupported.
2266         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2267         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2268         are unsupported.
2269
2270 2006-01-09  Bruno Haible  <bruno@clisp.org>
2271
2272         * sysexit_.h (EX_OK): New macro.
2273         Suggested by Martin Lambers <marlam@marlam.de>.
2274
2275 2006-01-09  Bruno Haible  <bruno@clisp.org>
2276
2277         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2278         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2279         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2280         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2281
2282 2006-01-09  Bruno Haible  <bruno@clisp.org>
2283
2284         * stdint_.h (SIZE_MAX): Write the value without involving negative
2285         numbers.
2286
2287 2005-10-16  Bruno Haible  <bruno@clisp.org>
2288
2289         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2290         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2291
2292 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2293
2294         * strftime.c (tzname): Don't declare if it is already #defined.
2295         Problem reported for Mingw by Mark Junker.
2296
2297 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2298
2299         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2300         long int, not int, for nanosecond counts, so that people who are
2301         used to POSIX struct timespec won't be surprised.  Reported by Jim
2302         Meyering.
2303
2304 2005-12-16  Jim Meyering  <jim@meyering.net>
2305
2306         * fprintftime.c, fprintftime.h: New files.
2307
2308 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2309
2310         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2311         * argp-help.c (fill_in_uparams): Check if the constructed
2312         struct uparams is valid. Fall back to the default values if it is
2313         not.
2314
2315 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2316
2317         * argp-help.c (__argp_base_name): New function
2318         (__argp_short_program_name): Rewrite using __argp_base_name
2319         * argp-namefrob.h: Define program_invocation_name and
2320         program_invocation_short_name if requested
2321         (__argp_base_name): Add prototype
2322         * argp-parse.c (argp_def): Use gettext wrappers
2323         (argp_default_parser): Use __argp_base_name
2324         * argp-pin.c: New file. Defines program_invocation_name and
2325         program_invocation_short_name on systems that lack them.
2326
2327 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2328
2329         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2330         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2331         porting problem reported by Georg Schwarz in
2332         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2333
2334 2005-07-09  Bruno Haible  <bruno@clisp.org>
2335
2336         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2337         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2338         Reported by Mark Junker <mjscod@gmx.de>.
2339
2340 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2341
2342         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2343         (uintmax_t) [defined uintmax_t]: Do not declare.
2344         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2345         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2346         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2347         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2348         sake of portability to weird hosts that C allows (though we don't
2349         know of any practical examples).
2350
2351         * savedir.h (fdsavedir): New decl.
2352         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2353         contains most of the former guts of savedir.
2354         (savedir): Use savedirstream.
2355         Include "openat.h".
2356
2357 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2358
2359         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2360         coreutils no longer futzes with rounding modes.
2361
2362 2005-11-14  Jim Meyering  <jim@meyering.net>
2363
2364         * mkstemp-safer.c: Include <config.h>, required for possible
2365         replacement of mkstemp.
2366
2367 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2368
2369         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2370         business.
2371         (gethrxtime) [! (HAVE_NANOUPTIME
2372         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2373         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2374         our own approximation.
2375
2376 2005-11-10  Simon Josefsson  <jas@extundo.com>
2377
2378         * readline.c: Remove EOL.
2379
2380 2005-11-08  Eric Blake  <ebb9@byu.net>
2381
2382         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2383
2384 2005-11-08  Eric Blake  <ebb9@byu.net>
2385
2386         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2387
2388 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2389
2390         Fix porting problem reported by Theodoros V. Kalamatianos.
2391         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2392         Don't assume that futimes failing means we must fail.
2393
2394 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2395
2396         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2397         leave errno alone.  Problem reported by Dmitry V. Levin.
2398
2399 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2400
2401         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2402         errno alone.  Problem reported by Frederic Jolliton.
2403
2404 2005-10-28  Simon Josefsson  <jas@extundo.com>
2405
2406         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2407         "restrict" keywords, as per POSIX.  Protect the function
2408         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2409         Don't use K&R prototypes.  Check the sprintf return values.
2410         Re-define EAFNOSUPPORT if not present.  Indent.
2411
2412         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2413         suggested by Bruno Haible <bruno@clisp.org>.
2414
2415         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2416
2417         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2418
2419         * gc-libgcrypt.c: Add MD2 (which is not available through
2420         libgcrypt).
2421
2422         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2423
2424         * md2.h, md2.c: New files.
2425
2426 2005-10-24  Simon Josefsson  <jas@extundo.com>
2427
2428         * md4.h: Shrink buffer size, now that we changed the type.
2429
2430 2005-10-22  Simon Josefsson  <jas@extundo.com>
2431
2432         * arcfour.h, arcfour.c: Use fixed size indices in the
2433         arcfour_context struct (simplify test vector testing in GNU
2434         Shishi).
2435
2436 2005-10-22  Simon Josefsson  <jas@extundo.com>
2437
2438         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2439         suggested by Bruno Haible <bruno@clisp.org>.
2440
2441 2005-10-22  Simon Josefsson  <jas@extundo.com>
2442
2443         * crc.h: Include stddef.h, for size_t.
2444
2445 2005-10-21  Simon Josefsson  <jas@extundo.com>
2446
2447         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2448         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2449
2450 2005-10-21  Simon Josefsson  <jas@extundo.com>
2451
2452         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2453         block.
2454
2455 2005-10-21  Simon Josefsson  <jas@extundo.com>
2456
2457         * gc-gnulib.c: Support ARCTWO in CBC mode.
2458
2459 2005-10-21  Simon Josefsson  <jas@extundo.com>
2460
2461         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2462         <bruno@clisp.org>.
2463
2464         * hmac-sha1.c (hmac_sha1): Likewise.
2465
2466         * crc.c (crc32_update): Actually use crc parameter, suggested by
2467         Bruno Haible <bruno@clisp.org>.
2468
2469         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2470         <bruno@clisp.org>.
2471
2472 2005-10-21  Simon Josefsson  <jas@extundo.com>
2473
2474         * des.h, des.c: New files.
2475
2476         * gc-gnulib.c: Support DES.c
2477
2478 2005-10-21  Simon Josefsson  <jas@extundo.com>
2479
2480         * arctwo.h, arctwo.c: New files.
2481
2482         * gc-gnulib.c: Support ARCTWO.
2483
2484 2005-10-21  Simon Josefsson  <jas@extundo.com>
2485
2486         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2487
2488 2005-10-19  Simon Josefsson  <jas@extundo.com>
2489
2490         * gc-gnulib.c: Support ARCFOUR.
2491
2492 2005-10-19  Simon Josefsson  <jas@extundo.com>
2493
2494         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2495         support.
2496
2497         * gc.h: Add ECB enum type.
2498
2499         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2500
2501 2005-10-19  Simon Josefsson  <jas@extundo.com>
2502
2503         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2504
2505 2005-10-18  Simon Josefsson  <jas@extundo.com>
2506
2507         * md4.h, md4.c: New files, based on md5.?.
2508
2509 2005-10-17  Simon Josefsson  <jas@extundo.com>
2510
2511         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2512
2513         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2514
2515 2005-10-17  Simon Josefsson  <jas@extundo.com>
2516
2517         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2518
2519 2005-10-17  Simon Josefsson  <jas@extundo.com>
2520
2521         * gc.h, gc-libgcrypt.c: Add ciphers.
2522
2523 2005-10-17  Simon Josefsson  <jas@extundo.com>
2524
2525         * sha1.c: Use uint32_t instead of md5_uint32.t
2526
2527         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2528         md5.h.
2529
2530         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2531
2532         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2533
2534 2005-10-15  Simon Josefsson  <jas@extundo.com>
2535
2536         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2537
2538         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2539
2540 2005-10-14  Simon Josefsson  <jas@extundo.com>
2541
2542         * arcfour.h, arcfour.c: New files.
2543
2544 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2545
2546         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2547         include <wchar.h>; no longer needed.
2548
2549 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2550         and  Ulrich Drepper  <drepper@redhat.com>
2551
2552         Import from libc.
2553         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2554         instead of inline stream orientation test and two separate
2555         function calls.  Pay no attention to USE_IN_LIBIO.
2556
2557 2005-10-14  Roland McGrath  <roland@redhat.com>
2558
2559         Import from libc.  [BZ #1331]
2560         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2561         macro argument.
2562         Reported by Matej Vela <vela@debian.org>.
2563
2564 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2565
2566         * mkdir-p.c (make_dir_parents): Don't report an error if an
2567         intermediate directory is in a read-only file system.  Problem
2568         reported by Eric Blake.
2569
2570 2005-10-13  Simon Josefsson  <jas@extundo.com>
2571
2572         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2573         Move memory allocation outside of loop.
2574
2575 2005-10-12  Simon Josefsson  <jas@extundo.com>
2576
2577         * gc-pbkdf2-sha1.c: New file.
2578
2579         * gc.h: Add gc_pbkdf2_sha1 prototype.
2580
2581 2005-10-12  Simon Josefsson  <jas@extundo.com>
2582
2583         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2584         suggested by Bruno Haible <bruno@clisp.org>.
2585
2586 2005-10-12  Simon Josefsson  <jas@extundo.com>
2587
2588         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2589
2590         * gc-gnulib.c (gc_hmac_sha1): New function.
2591
2592 2005-10-12  Simon Josefsson  <jas@extundo.com>
2593
2594         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2595
2596 2005-10-12  Simon Josefsson  <jas@extundo.com>
2597
2598         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2599         GC_USE_HMAC_MD5, respectively.
2600
2601         * gc-libgcrypt.c (gc_md5): Fix assert call.
2602         (gc_md5): Fix typo.
2603
2604         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2605
2606         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2607
2608         * gc-gnulib.c (gc_hash_buffer): Ditto.
2609
2610 2005-10-11  Bruno Haible  <bruno@clisp.org>
2611
2612         * c-strcasestr.h: New file, from GNU gettext.
2613         * c-strcasestr.c: New file, from GNU gettext.
2614
2615 2005-10-11  Bruno Haible  <bruno@clisp.org>
2616
2617         * c-strcase.h: New file, from GNU gettext.
2618         * c-strcasecmp.c: New file, from GNU gettext.
2619         * c-strncasecmp.c: New file, from GNU gettext.
2620
2621 2005-10-11  Simon Josefsson  <jas@extundo.com>
2622
2623         * crc.h, crc.c: New files.
2624
2625         * gc.h (gc_hash_buffer): Add doc.
2626
2627 2005-10-08  Simon Josefsson  <jas@extundo.com>
2628
2629         * gc.h: Add gc_hash and gc_hash_buffer.
2630
2631         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2632
2633         * gc-libgcrypt.c (gc_hash_buffer): Add.
2634
2635 2005-10-11  Bruno Haible  <bruno@clisp.org>
2636
2637         * strcasecmp.c: Include limits.h.
2638         (strcasecmp): Avoid integer overflow on exotic platforms.
2639         * strncasecmp.c: Include limits.h.
2640         (strncasecmp): Avoid integer overflow on exotic platforms.
2641         Reported by Paul Eggert.
2642
2643 2005-10-06  Simon Josefsson  <jas@extundo.com>
2644
2645         * hmac-md5.c: New file.
2646
2647         * hmac.h: New file.
2648
2649 2005-10-06  Simon Josefsson  <jas@extundo.com>
2650
2651         * memxor.c (memxor): Avoid casts and warnings.
2652
2653 2005-10-05  Derek Price  <derek@ximbiot.com>
2654
2655         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2656
2657 2005-10-05  Simon Josefsson  <jas@extundo.com>
2658
2659         * memxor.c (memxor): Fix compiler error.
2660
2661         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2662         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2663
2664         * memxor.h, memxor.c: New files.
2665
2666         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2667         we assume all systems have it, suggested by Jim Meyering
2668         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2669         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2670         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2671         same reasons.
2672
2673 2005-10-04  Bruno Haible  <bruno@clisp.org>
2674
2675         * verify.h (verify_true): Provide alternative definition for C++.
2676
2677 2005-10-04  Simon Josefsson  <jas@extundo.com>
2678
2679         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2680         D. Baushke" <mdb@gnu.org>.
2681
2682 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2683
2684         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2685         (SSIZE_MAX): New macro, if not already defined.
2686         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2687         than 2 GiB.
2688
2689 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2690
2691         * exclude.c: Include verify.h.
2692         (verify): Remove.  All callers changed to use verify.h's version.
2693         * strtoimax.c: Likewise.
2694         * utimecmp.c: Likewis.e
2695
2696         Sync from coreutils.
2697         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2698         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2699         * .cvsignore: Add fts.h, search.h, t-fpending.
2700         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2701         bother returning ENOSYS if settimeofday or stime fails; just let
2702         them return whatever errno they want to return.
2703         * utimens.c: Include unistd.h, for dup2.
2704         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2705         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2706
2707 2005-10-02  Jim Meyering  <jim@meyering.net>
2708
2709         Sync from coreutils.
2710         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2711         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2712         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2713         Remove AT_FDCWD test.
2714         Do not consume the fd unless successful.
2715         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2716         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2717         block, so that we don't even try to compile it if settimeofday is
2718         available.  This works around a compilation failure on OSF1 V5.1,
2719         due to stime requiring a `long int*' while tv_sec is `int'.
2720
2721 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2722
2723         * getdelim.c (getdelim): Remove unused variables.
2724
2725 2005-10-01  Simon Josefsson  <jas@extundo.com>
2726
2727         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2728         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2729         AI_* and EAI_* definitions.  Protect function declarations.
2730
2731 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2732
2733         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2734         so that the code works even with ancient cpp.  Portability problem
2735         with GCC 2.7.2.1 reported by Thomas M.Ott.
2736
2737 2005-09-27  Jim Meyering  <jim@meyering.net>
2738
2739         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2740
2741         * intprops.h (signed_type_or_expr__): Define.
2742         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2743         for unsigned types.
2744
2745 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2746
2747         * verify.h (verify_expr): Remove, replacing with:
2748         (verify_true): New macro that returns true instead of void.
2749         (verify_type__): Remove.
2750         (verify): Use verify_true rather than verify_type__.
2751
2752 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2753
2754         * utimens.c (ENOSYS): Define if not already defined.
2755         (futimens): Support having a null PATH if the file descriptor
2756         is nonnegative.
2757
2758         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2759         Remove.
2760         (__attribute): Define to empty unless GCC 3.1 or later.
2761         This works around a core dump on OpenBSD 3.4, which has GCC
2762         2.95.3, which dumps core when given __attribute__(()).  It also
2763         simplifies other tests, since we really don't want to bother with
2764         worrying about which ancient version of GCC supported what.
2765         Original problem reported by Yoann Vandoorselaere, with part of
2766         the fix suggested by Derek Price.
2767
2768 2005-09-24  Jim Meyering  <jim@meyering.net>
2769
2770         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2771         so we can once again use a positive bitfield width of 1 -- now we
2772         don't have to explain why we were using a bitfield width of 2.
2773
2774 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2775
2776         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2777         Problem reported by Eric Blake.
2778         (getaddrinfo): Initialize se so that it's not garbage.
2779         Redo internal storage allocation so that it doesn't make unportable
2780         assumptions about alignment.
2781         Fix a memory leak.
2782
2783         * utimens.c (futimens): Use futimesat if available.
2784         Prefer it to futimes since it doesn't have the futimes bug.
2785
2786         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2787         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2788         Instead, declare a function that returns a pointer to an array,
2789         and use verify_type__ to declare the size of the array.
2790         Problem and germ of a solution reported by Bruno Haible.
2791         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2792         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2793
2794 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2795
2796         Sync from coreutils.
2797
2798         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2799         stat-time.h.
2800         * argmatch.h: Include verify.h
2801         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2802         (ARGMATCH_ASSERT): Remove; unused.
2803         * canonicalize.c: Assume STDC_HEADERS.
2804         * exclude.c: Include "strcase.h".
2805         * regex_internal.h [!defined _LIBC]: Likewise.
2806         * getusershell.c: Include stdio--.h rather than stdio.h
2807         and stdio-safer.h.
2808         (getusershell): Call fopen, not fopen_safer.
2809         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2810         Do not include unistd-safer.h.
2811         (save_cwd): Don't call fd_safer; no longer needed
2812         now that we include fcntl--.h.
2813
2814         * getdate.y (relative_time): New type.
2815         (RELATIVE_TIME_0): New constant.
2816         (parser_control): Use relative_time instead of doing it ourselves.
2817         (%union): Add new relative_time rel member.
2818         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2819         Now typeless.
2820         (relunit, relunit_snumber): Now of type rel.
2821         (zone, rel, relunit, get_date): Adjust to above changes.
2822
2823         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2824         Do not include unistd-safer.h.
2825         (getloadavg): Don't call fd_safer; no longer needed
2826         now that we include fcntl--.h.
2827
2828         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2829         (make_dir_parents): Treat ENOSYS like EEXIST.
2830
2831         Improve quality of diagnostics on restore_cwd failure.
2832         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2833         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2834         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2835         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2836         each time through the loop.  Do not diagnose restore_cwd failure;
2837         that is the caller's job (and perhaps the caller does not care).
2838
2839         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2840         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2841         If the file already exists but is not a directory, don't bother
2842         to try to make its parents.
2843         Close potential file descriptor leak if we can't chdir("/") (!).
2844         Don't always return true if chdir($PWD) fails; return true only
2845         if the requested action was done successfully (except for the
2846         chdir($PWD)).
2847         Don't log final directory unless we actually made it.
2848         Refactor to avoid duplicate code to fix up permissions.
2849         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2850
2851         * strftime.c (my_strftime): Rewrite the previous change slightly,
2852         to make it a bit faster and (I hope) clearer.
2853         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2854         Fix bug in formats like %2N.
2855
2856         * verify.h: New file.
2857
2858 2005-09-22  Jim Meyering  <jim@meyering.net>
2859
2860         Sync from coreutils.
2861
2862         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2863
2864         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2865         the .tm_year member, since otherwise gcc-4.0 would now warn about
2866         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2867
2868         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2869         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2870
2871         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2872         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2873         when run in a time zone for which daylight savings time is in effect
2874         for the starting date.
2875
2876         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2877         stop us from restricting permissions of just-created absolute-named
2878         directories.
2879         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2880         to restore initial working directory.
2881         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2882         to tell caller if/when we change the working directory and are
2883         unable to return to the initial one.
2884         * mkdir-p.h (make_dir_parents): Update prototype.
2885         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2886         `return false'.  This fixes a bug introduced on 2004-07-30.
2887
2888         * openat.c (fdopendir): Be sure to close the supplied
2889         file descriptor before returning.  This makes our replacement
2890         implementation a little closer to Solaris's, where fdopendir
2891         ties the file descriptor to the returned DIR* pointer.
2892         * openat.c (unlinkat): New function.
2893         * openat.h (unlinkat): Add prototype.
2894         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2895         (openat_restore_fail): Rename from openat_restore_die.
2896         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2897
2898         Provide an alternative to exiting immediately upon save_cwd or
2899         restore_cwd failure.  Now, an application can arrange e.g.,
2900         to perform a longjump in that case.
2901         * openat.c: Include dirname.h.
2902         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2903         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2904         and openat_restore_die rather than calling error directly.
2905         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2906
2907         * openat-die.c (openat_save_die, openat_restore_die): New file.
2908         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2909
2910         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2911         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2912                             int utc, int nanoseconds);
2913         Background:
2914         date should not have to allocate a megabyte of virtual memory to
2915         handle a format argument like +%1048575T.  When implemented with
2916         strftime, it must allocate such a buffer, use strftime to fill it
2917         in, print it, then free it.
2918         With fprintftime, it simply prints everything and exits.
2919         With no need for memory allocation, that's one fewer way to fail.
2920         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2921         optional field width, not before, so we accept %9:z, not %:9z.
2922         (my_strftime): Be sure to use L_('x') for literals.
2923
2924         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2925         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2926         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2927         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2928         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2929         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2930         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2931         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2932         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2933
2934         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2935         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2936         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2937         and don't include <sys/file.h>).
2938
2939 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2940
2941         Sync from coreutils.
2942
2943         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2944         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2945         [!LDAV_DONE]: Avoid unused variable warning.
2946
2947 2005-09-21  Bruno Haible  <bruno@clisp.org>
2948
2949         * unicodeio.h (unicode_to_mb): New declaration.
2950
2951 2005-09-20  Derek Price  <derek@ximbiot.com>
2952
2953         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2954
2955 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2956
2957         Use a consistent style for including <config.h>.
2958         * __fpending.c, acl.c, argmatch.c,
2959         argp-help.c, argp-parse.c,
2960         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2961         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2962         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2963         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2964         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2965         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2966         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2967         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2968         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2969         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2970         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2971         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2972         modechange.c, mountlist.c, open-safer.c, physmem.c,
2973         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2974         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2975         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2976         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2977         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2978         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2979         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2980         userspec.c, utimecmp.c, version-etc-fsf.c,
2981         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2982         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2983         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2984         Standardize inclusion of config.h.
2985         * __fpending.h, dirfd.h, getdate.h, human.h,
2986         inttostr.h:  Removed inclusion of config.h from header files.
2987         * inttostr.c:  Adjusted in-tree users.
2988         * timespec.h: Remove superfluous warning to include config.h.
2989         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2990         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2991         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2992         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2993
2994 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2995
2996         * stat-time.h: New file.
2997         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2998         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2999         in a different way.
3000         (timespec_cmp): New function.
3001         * utimecmp.c: Include stat-time.h.
3002         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3003         members exist, not on the obsolescent ST_MTIM_NSEC.
3004         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3005
3006 2005-09-15  Derek Price  <derek@ximbiot.com>
3007             Paul Eggert  <eggert@cs.ucla.edu>
3008
3009         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3010         changes, consolidating in...
3011         * regex_internal.h: ...this file.
3012
3013 2005-09-15  Derek Price  <derek@ximbiot.com>
3014
3015         * regex_internal.h: Blank `pure' for GNUC < 3.
3016         * regex_internal.c: Ditto, using this...
3017         (__GNUC_PREREQ): ...new macro.
3018         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3019         (__GNUC_PREREQ): ...this new macro.
3020
3021         * strstr.h: Include string.h. Define strstr as a macro here.
3022
3023 2005-09-13  Derek Price  <derek@ximbiot.com>
3024
3025         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3026         failure.
3027         Reported by Jim Meyering  <jim@meyering.net>.
3028
3029 2005-09-13  Jim Meyering  <jim@meyering.net>
3030
3031         * canon-host.c: Filter through gnu indent and reword comments slightly.
3032         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3033
3034 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3035
3036         * base64.c: Typo.
3037         (base64_encode): Put b64str in initialized data section.
3038
3039 2005-09-12  Derek Price  <derek@ximbiot.com>
3040
3041         Return usable errors from canon-host.
3042         * canon-host.h: New file.
3043         * canon-host.c (canon_host): Wrap...
3044         (canon_host_r): ...this new function, which now relies exclusively on
3045         getaddrinfo.
3046         (ch_strerror): New function.
3047         (last_cherror): New global.
3048         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3049         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3050         void *.
3051         (freeaddrinfo): Free ai->ai_canonname when set.
3052
3053 2005-09-12  Derek Price  <derek@ximbiot.com>
3054             Paul Eggert  <eggert@cs.ucla.edu>
3055
3056         * glob-libc.h: Renamed from glob_.h.  The new version is
3057         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3058         protecting things that should be done only in gnulib contexts.
3059         * glob_.h: New file, containing only the glob things needed for
3060         gnulib.
3061         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3062         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3063         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3064         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3065         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3066         and to respect the namespace rules better.
3067
3068 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3069
3070         Merge glibc and coreutils changes into gnulib, plus a few
3071         extra fixes.
3072         * md5.c: Use #error rather than a string.
3073         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3074         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3075         (__attribute__): Define to empty for non recent-GCC.
3076         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3077         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3078         Renamed from their non-__ counterparts, with new macros replacing
3079         them if not _LIBC.  Add __THROW attribute.
3080         (rol): Remove.
3081         (struct md5_ctx): Align buffer if using GCC.
3082         * sha1.h (struct sha1_ctx): Likewise.
3083         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3084         The old name was backwards.
3085         (NOTSWAP): Remove; not used.
3086         (rol): New macro, moved here from md5.h.
3087         (sha1_process_block): Remove a FIXME that doesn't make sense.
3088
3089 2005-09-12  Derek Price  <derek@ximbiot.com>
3090
3091         * gai_strerror.c: Include config.h when available.  Include
3092         getaddrinfo.h before other headers to test interface.
3093         Reported by Larry Jones <lawrence.jones@ugs.com>.
3094
3095 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3096
3097         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3098         definitions, since that's the preferred style in glibc.
3099         Fix a minor spacing issue, and update copyright notice to match glibc's.
3100
3101 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3102
3103         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3104
3105 2005-09-06  Simon Josefsson  <jas@extundo.com>
3106
3107         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3108         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3109
3110 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3111
3112         Change bitset word type from unsigned int to unsigned long int,
3113         as this has better performance on typical 64-bit hosts.
3114         Port bitset code to hosts with unusual word sizes.
3115         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3116         (build_collating_symbol):
3117         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3118         argument is a bitset.  This is merely a style issue, but it makes
3119         it clearer that an entire array is expected.
3120         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3121         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3122         Port to the case where bitset_word is not the same as unsigned int.
3123         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3124         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3125         Likewise.
3126         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3127         (build_trtable, group_nodes_into_DFAstates):
3128         Likewise.
3129         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3130         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3131         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3132         * regexec.c (group_nodes_into_DFAstates): Likewise.
3133         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3134         * regcomp.c (optimize_subexps, lower_subexp):
3135         Work even if bitset_word has holes in its bitwise representation.
3136         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3137         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3138         Likewise.
3139         * regex_internal.c (re_string_reconstruct):
3140         Don't assume UCHAR_MAX == 255.
3141         * regex_internal.h (bitset_set_all): Likewise.
3142         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3143         All uses changed.
3144         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3145         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3146         All uses changed.
3147         (BITSET_WORD_MAX): New macro.
3148         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3149         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3150         (bitset_empty, bitset_copy):
3151         Prefer sizeof (bitset) to multiplying it out ourselves.
3152         (bitset_not_merge): Remove; unused.
3153         (bitset_contain): Return bool, not unsigned int with one bit on.
3154         All callers changed.
3155         * regexec.c (build_trtable): Don't assume bitset has no stricter
3156         alignment than re_node_set; do this by defining a new internal
3157         type struct dests_alloc and using it to allocate memory.
3158
3159 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3160
3161         Check for arithmetic overflow when calculating sizes, to prevent
3162         some buffer-overflow issues.  These patches are conservative, in the
3163         sense that when I couldn't determine whether an overflow was possible,
3164         I inserted a run-time check.
3165         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3166         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3167         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3168         (re_xnrealloc, re_x2nrealloc): New inline functions.
3169         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3170         (build_equiv_class, build_charclass): Check for arithmetic overflow
3171         in size expression calculations.
3172         * regex_internal.c (re_string_realloc_buffers):
3173         (build_wcs_upper_buffer, re_node_set_add_intersect):
3174         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3175         (re_dfa_add_node, register_state): Likewise.
3176         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3177         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3178         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3179         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3180
3181 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3182
3183         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3184         to avoid a collision with bits/local_lim.h in glibc.
3185         All uses changed.  Problem reported by Dmitry V. Levin in
3186         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3187
3188         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3189         bugs in int versus size_t comparisons.
3190         (re_string_context_at): Fix bug where the code assumed that
3191         Idx is signed.
3192
3193         Use bool where appropriate.
3194         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3195         All callers changed.
3196         (calc_eclosure_iter): Likewise, for ROOT arg.
3197         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3198         (build_charclass_op): Likewise, for NON_MATCH arg.
3199         * regex_internal.c (re_string_allocate, re_string_construct):
3200         (re_string_construct_common): Likewise, for ICASE arg.
3201         * regexec.c (re_search_2_stub, re_search_stub):
3202         Likewise, for RET_LEN arg.
3203         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3204         (set_regs): Likewise, for FL_BACKTRACK arg.
3205         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3206         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3207         (calc_eclosure_iter, parse_bracket_exp):
3208         Use bool for internal variables that are booleans.
3209         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3210         (set_regs, build_sifted_states, sift_states_bkref):
3211         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3212         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3213         (find_collation_sequence_value):
3214         Likewise.
3215         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3216         (re_node_set_compare):
3217         Return bool, not int. All callers changed.
3218         * regexec.c (check_halt_node_context, check_dst_limits):
3219         (build_trtable, check_node_accept): Likewise.
3220         * regex_internal.h: Include stdbool.h.
3221
3222         Fix bugs uncovered when converting to bool.
3223         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3224         failure instead of charging ahead blindly.
3225         * regex_internal.c (register_state): Likewise.
3226         * regexec.c (re_search_2_stub): Use simpler method than boolean
3227         for freeing internal storage.
3228         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3229         bitset pieces used as boolean, to avoid undefined behavior
3230         on hosts that do int overflow checking.
3231
3232 2005-08-31  Derek Price  <derek@ximbiot.com>
3233
3234         * getdelim.c (getdelim): Return EOF on EOF.
3235         Reported by Larry Jones <lawrence.jones@ugs.com>.
3236
3237 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3238
3239         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3240         lengths fit in regoff_t; this isn't true if regoff_t is the same
3241         width as size_t.
3242         * regex.c (re_search_internal): 5th arg is LAST_START
3243         (= START + RANGE) instead of RANGE.  This avoids overflow
3244         problems when regoff_t is the same width as size_t.
3245         All callers changed.
3246         (re_search_2_stub): Check for overflow when adding the
3247         sizes of the two strings.
3248         (re_search_stub): Check for overflow when adding START
3249         to RANGE; if it occurs, substitute the extreme value.
3250
3251 2005-08-31  Jim Meyering  <jim@meyering.net>
3252
3253         * regcomp.c (search_duplicated_node): Make first pointer arg
3254         a pointer-to-const.
3255         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3256         (register_state): Likewise.
3257         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3258         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3259         (group_nodes_into_DFAstates): Likewise.
3260
3261 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3262
3263         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3264         old glibc regex code mishandles strings longer than 2**31 bytes.
3265         This patch fixes this when the regex code is used in gnulib
3266         (i.e., outside glibc).
3267
3268         This patch should not affect the use of the regex code inside
3269         glibc.  No doubt this problem also needs to be handled for glibc
3270         as well, but the result will be an incompatible change to the
3271         glibc ABI, and the old ABI will have to be supported too.  That
3272         can be the the subject for another patch.
3273
3274         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3275         governing whether the rest of this patch is active.  By default,
3276         the macro is disabled and the patch has no effect.
3277         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3278         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3279         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3280         (re_match_2, re_set_registers): Use the new types.
3281         * regex_internal.h (Idx, re_hashval_t): New types.
3282         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3283         New macros.
3284         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3285         (re_string_context_at, bin_tree_t, re_dfastate_t):
3286         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3287         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3288         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3289         (re_string_char_size_at, re_string_wchar_at):
3290         (re_string_elem_size_at):
3291         Use the new types and macros to port to 64-bit hosts.
3292         Use unsigned types for internal values, so that the code
3293         mostly works even for arrays larger than SSIZE_MAX.
3294         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3295         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3296         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3297         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3298         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3299         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3300         (calc_inveclosure, parse_dup_op, build_range_exp):
3301         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3302         (fetch_number, create_token_tree, mark_opt_subexp):
3303         Likewise.
3304         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3305         (create_cd_newstate, re_string_allocate, re_string_construct):
3306         (re_string_realloc_buffers, build_wcs_upper_buffer):
3307         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3308         (re_string_reconstruct, re_string_peek_byte_case):
3309         (re_string_fetch_byte_case, re_string_context_at):
3310         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3311         (re_node_set_init_copy, re_node_set_add_intersect):
3312         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3313         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3314         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3315         (re_acquire_state, re_acquire_state_context, register_state):
3316         Likewise.
3317         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3318         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3319         (re_search_internal, re_search_2_stub, re_search_stub)
3320         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3321         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3322         (update_cur_sifted_state, check_dst_limits):
3323         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3324         (check_subexp_limits, sift_states_bkref, merge_state_array):
3325         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3326         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3327         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3328         (expand_bkref_cache, check_node_accept_bytes):
3329         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3330         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3331         (acquire_init_state_context, check_halt_node_context):
3332         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3333         (sift_states_backward, clean_state_log_if_needed):
3334         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3335         (find_recover_state, transit_state_sb, transit_state_mb):
3336         (transit_state_bkref, build_trtable, match_ctx_clean):
3337         Likewise.
3338         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3339         to work around an assumption that REG_MISSING is negative.
3340
3341         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3342         (seek_collating_symbol_entry) [defined _LIBC]:
3343         (lookup_collation_sequence_value) [defined _LIBC]:
3344         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3345         Use prototypes rather than old-style function definitions.
3346         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3347         (transit_state_sb) [0]:
3348         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3349
3350         * regexec.c (re_search_internal): Simplify update of rm_so and
3351         rm_eo.
3352
3353         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3354         (optimize_subexps, lower_subexp):
3355         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3356         since the signed shift might overflow.  Use 1u<<31 instead.
3357         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3358         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3359         Likewise.
3360
3361         * regcomp.c (optimize_subexps, lower_subexp):
3362         Use CHAR_BIT rather than 8, for clarity.
3363         * regexec.c (check_dst_limits_calc_pos_1):
3364         (check_subexp_matching_top): Likewise.
3365         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3366         have to worry about portability issues when shifting it left.
3367         Remove no-longer-needed test for table_size > 0.
3368         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3369         in a word, as the resulting behavior is undefined.
3370         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3371         in one case, a <= should have been an <, and in another case the
3372         whole test was missing.
3373         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3374         the standard name CHAR_BIT.
3375         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3376         this is not true on one's complement and signed-magnitude hosts.
3377
3378         * regex_internal.h (re_sub_match_top_t): Remove unused member
3379         next_last_offset.
3380         (struct re_dfa_t): Remove unused member states_alloc.
3381         * regcomp.c (init_dfa): Don't initialize unused members.
3382
3383 2005-08-31  Bruno Haible  <bruno@clisp.org>
3384
3385         * strstr.c: Include <stddef.h>, for NULL.
3386         * strcasestr.c: Likewise.
3387         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3388
3389 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3390
3391         * iconvme.h: Add prototype for iconv_alloc.
3392
3393 2005-08-29  Simon Josefsson  <jas@extundo.com>
3394
3395         * iconvme.c: Fix errno.
3396
3397 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3398
3399         * iconvme.c: Split iconv_string into iconv_alloc.
3400
3401 2005-08-27  Jim Meyering  <jim@meyering.net>
3402
3403         * fopen-safer.c: Merge minor changes from coreutils.
3404         * dup-safer.c: Likewise.
3405         * fd-safer.c: Likewise.
3406
3407         Merge from coreutils.
3408         * stdio--.h: New file.
3409         * stdlib--.h: New file.
3410         * mkstemp-safer.c: New file.
3411
3412         GNU tar needs these.
3413         * pipe-safer.c: New file.
3414         * creat-safer.c: New file.
3415         * fcntl--.h (creat): Define to creat_safer.
3416         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3417         * unistd--.h (pipe): Define to pipe_safer.
3418         * unistd-safer.h: Declare pipe_safer.
3419
3420 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3421
3422         * regex_internal.h: Remove all references to
3423         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3424         or better.
3425         (bitset_not, bitset_merge, bitset_not_merge):
3426         (bitset_mask, re_string_allocate, re_string_construct):
3427         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3428         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3429         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3430         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3431         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3432         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3433         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3434         (re_acquire_state_context):
3435         Remove unnecessary forward decls.
3436         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3437         Put __attribute at function definition,
3438         now that the function decl has been removed.
3439         * regex_internal.c (re_string_peek_byte_case):
3440         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3441         Likewise.
3442
3443 2005-08-26  Simon Josefsson  <jas@extundo.com>
3444
3445         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3446         Haible <bruno@clisp.org>.
3447
3448 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3449
3450         * regexec.c (set_regs): Don't alloca with an unbounded size.
3451
3452         alloca modernization/simplification for regex.
3453         * regex.c: Remove portability cruft for alloca.  This no longer
3454         needs to be at the start of the file, and can be moved into
3455         regex_internal.h and simplified.
3456         * regex_internal.h: Include <alloca.h>.
3457         (__libc_use_alloca) [!defined _LIBC]: New macro.
3458         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3459         now works outside glibc.
3460
3461 2005-08-24  Simon Josefsson  <jas@extundo.com>
3462
3463         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3464         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3465         GLIBC specific code.
3466
3467 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3468
3469         Make regex safe for g++.  This fixes one real bug (an "err"
3470         that should have been "*err").  g++ problem reported by
3471         Sam Steingold.
3472         * regex_internal.h (re_calloc): New macro, consistent with
3473         re_malloc etc.  All callers of calloc changed to use re_calloc.
3474         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3475         not int.  All callers changed.
3476         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3477         just use an array of size MB_LEN_MAX.
3478         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3479         (find_recover_state): Change "err" to "*err"; this fixes what
3480         appears to be a real bug.
3481         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3482         versus int.
3483
3484 2005-08-25  Jim Meyering  <jim@meyering.net>
3485
3486         * open-safer.c: Include <config.h>.
3487         Otherwise, we'd lose LARGEFILE support in any file using
3488         e.g. "fcntl--.h"
3489
3490 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3491
3492         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3493         * regex.h (regerror): Likewise.
3494
3495         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3496         requires this.  (The code never needed it.)
3497
3498         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3499         All uses of recently-renamed identifiers changed to use the new,
3500         POSIX-compliant names.  The code will build and run just fine
3501         without these changes, but it's better to eat our own dog food
3502         and use the standard-conforming names.
3503
3504         * regex.h: Fix a multitude of POSIX name space violations.
3505         These changes have an effect only for programs that define
3506         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3507         do not change anything for programs compiled in the normal way.
3508         Also, there is no effect on the ABI.
3509
3510         (_REGEX_SOURCE): New macro.
3511         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3512         defined and _GNU_SOURCE is not; this fixes a name space violation.
3513
3514         Rename the following macros to obey POSIX requirements.
3515         The old names are still visible as macros if _REGEX_SOURCE is defined.
3516         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3517         RE_BACKSLASH_ESCAPE_IN_LISTS.
3518         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3519         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3520         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3521         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3522         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3523         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3524         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3525         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3526         (REG_INTERVALS): renamed from RE_INTERVALS.
3527         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3528         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3529         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3530         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3531         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3532         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3533         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3534         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3535         RE_UNMATCHED_RIGHT_PAREN_ORD.
3536         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3537         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3538         (REG_DEBUG): renamed from RE_DEBUG.
3539         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3540         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3541         unusual, since we can't clash with the POSIX REG_ICASE.
3542         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3543         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3544         (REG_NO_SUB): renamed from RE_NO_SUB.
3545         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3546         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3547         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3548         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3549         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3550         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3551         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3552         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3553         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3554         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3555         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3556         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3557         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3558         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3559         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3560         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3561         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3562         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3563         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3564         (REG_FIXED): Renamed from REGS_FIXED.
3565         (REG_NREGS): Renamed from RE_NREGS.
3566
3567         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3568         of other REG_* macros, since POSIX says the user is allowed to
3569         #undef these macros selectively.
3570
3571         (reg_errcode_t): Update comment stating what other tables need
3572         to be consistent.
3573
3574         Rename the following enum values to obey POSIX requirements.
3575         The old names are still visible as macros.
3576         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3577         is not defined, since GNU is supposed to be a superset of POSIX as
3578         much as possible, and since we want reg_errcode_t to be a signed
3579         type for implementation consistency.
3580         (_REG_NOERROR): Renamed from REG_NOERROR.
3581         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3582         (_REG_BADPAT): Renamed from REG_BADPAT.
3583         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3584         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3585         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3586         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3587         (_REG_EBRACK): Renamed from REG_EBRACK.
3588         (_REG_EPAREN): Renamed from REG_EPAREN.
3589         (_REG_EBRACE): Renamed from REG_EBRACE.
3590         (_REG_BADBR): Renamed from REG_BADBR.
3591         (_REG_ERANGE): Renamed from REG_ERANGE.
3592         (_REG_ESPACE): Renamed from REG_ESPACE.
3593         (_REG_BADRPT): Renamed from REG_BADRPT.
3594         (_REG_EEND): Renamed from REG_EEND.
3595         (_REG_ESIZE): Renamed from REG_ESIZE.
3596         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3597         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3598         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3599         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3600         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3601
3602         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3603         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3604         changed.  But support the old name if the new one is not defined
3605         and if _REGEX_SOURCE.
3606
3607         Change the following member names in struct re_pattern_buffer.
3608         The old names are still supported if !_REGEX_SOURCE.
3609         The new names are always supported, regardless of _REGEX_SOURCE.
3610         (re_buffer): Renamed from buffer.
3611         (re_allocated): Renamed from allocated.
3612         (re_used): Renamed from used.
3613         (re_syntax): Renamed from syntax.
3614         (re_fastmap): Renamed from fastmap.
3615         (re_translate): Renamed from translate.
3616         (re_can_be_null): Renamed from can_be_null.
3617         (re_regs_allocated): Renamed from regs_allocated.
3618         (re_fastmap_accurate): Renamed from fastmap_accurate.
3619         (re_no_sub): Renamed from no_sub.
3620         (re_not_bol): Renamed from not_bol.
3621         (re_not_eol): Renamed from not_eol.
3622         (re_newline_anchor): Renamed from newline_anchor.
3623
3624         Change the following member names in struct re_registers.
3625         The old names are still supported if !_REGEX_SOURCE.
3626         The new names are always supported, regardless of _REGEX_SOURCE.
3627         (rm_num_regs): Renamed from num_regs.
3628         (rm_start): Renamed from start.
3629         (rm_end): Renamed from end.
3630
3631         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3632         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3633         Prepend __ to parameter names.
3634
3635         Undo yesterday's changes.
3636
3637 2005-08-24  Jim Meyering  <jim@meyering.net>
3638
3639         Sync from coreutils.
3640         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3641
3642 2005-08-21  Bruno Haible  <bruno@clisp.org>
3643
3644         * lock.h: Add multiple inclusion guard.
3645         * tls.h: Add multiple inclusion guard.
3646
3647 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3648
3649         * regex.h (REG_NOSYS)
3650         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3651         Define, since POSIX requires it as of 2001.
3652         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3653         New private symbol, used to keep the enum signed in all cases.
3654         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3655         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3656
3657         * regex_internal.c (re_string_skip_chars, register_state):
3658         (calc_state_hash):
3659         Remove forward decls; no longer needed now that we use prototypes.
3660         * regexec.c (acquire_init_state_context, check_halt_node_context):
3661         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3662         (clean_state_log_if_needed): Likewise.
3663
3664 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3665
3666         Fix problems reported by Sam Steingold in
3667         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3668         * regexec.c (sift_states_bkref): Fix portability bug: the code
3669         assumed that reg_errcode_t is a signed type, which is not
3670         necessarily true if _XOPEN_SOURCE is not defined.
3671         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3672         some compilers warn about it otherwise.
3673
3674 2005-08-20  Jim Meyering  <jim@meyering.net>
3675
3676         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3677         of unused local, dfa.
3678
3679 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3680
3681         * regcomp.c (create_initial_state): Remove duplicate decl.
3682         (init_word_char, create_initial_state, duplicate_node_closure):
3683         (fetch_token, peek_token_bracket, build_range_exp):
3684         (build_collating_symbol): Remove forward decls; no longer needed
3685         now that we use prototypes.
3686
3687         * regcomp.c:
3688         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3689         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3690         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3691         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3692         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3693         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3694         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3695         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3696         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3697         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3698         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3699         (build_charclass, build_charclass_op, fetch_number, create_tree):
3700         (create_token_tree, mark_opt_subexp, duplicate_tree):
3701         Use prototypes rather than old-style definitions.
3702
3703         * regex_internal.c:
3704         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3705         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3706         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3707         (re_string_reconstruct, re_string_peek_byte_case):
3708         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3709         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3710         (re_node_set_init_copy, re_node_set_add_intersect):
3711         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3712         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3713         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3714         (re_acquire_state, re_acquire_state_context, register_state):
3715         (create_ci_newstate, create_cd_newstate, free_state):
3716         Likewise.
3717         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3718         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3719         (re_search_internal, prune_impossible_nodes):
3720         (acquire_init_state_context, check_matching, static):
3721         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3722         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3723         (update_regs, sift_states_backward, build_sifted_states):
3724         (clean_state_log_if_needed, merge_state_array):
3725         (update_cur_sifted_state, add_epsilon_src_nodes):
3726         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3727         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3728         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3729         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3730         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3731         (check_arrival, check_arrival_add_next_nodes):
3732         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3733         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3734         (check_node_accept_bytes, check_node_accept, extend_buffers):
3735         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3736         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3737         (sift_ctx_init):
3738         Likewise.
3739
3740         * regex_internal.h:
3741         (re_string_allocate, re_string_construct, re_string_reconstruct):
3742         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3743         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3744         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3745         (re_string_context_at, re_string_peek_byte_case):
3746         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3747         is defined, since we now use prototypes always.
3748
3749         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3750         C89 or better.  All uses removed.
3751
3752 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3753
3754         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3755         [defined lint]: Suppress bogus uninitialized-variable warnings.
3756
3757         * regcomp.c (duplicate_node): Return new index, not an error code,
3758         and let the caller return REG_ESPACE if out of space.  This
3759         removes an uninitialied-variable warning with GCC 4.0.1, and also
3760         avoids taking the address of a local variable.  All callers
3761         changed.
3762
3763 2005-08-19  Jim Meyering  <jim@meyering.net>
3764
3765         * regexec.c (proceed_next_node): Redo local variables to
3766         avoid GCC shadowing warnings.
3767
3768 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3769
3770         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3771         (re_node_set_insert_last, re_dfa_add_node):
3772         Rename local variables to avoid GCC shadowing warnings.
3773
3774 2005-08-18  Bruno Haible  <bruno@clisp.org>
3775
3776         * strstr.c (strstr): Fix return value in multibyte case.
3777         * strcasestr.c (strcasestr): Likewise.
3778
3779 2005-08-17  Jim Meyering  <jim@meyering.net>
3780
3781         Make the %s format (seconds since the epoch) work for a negative
3782         number and when used with a zero-padded field width, e.g. %015s.
3783
3784         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3785         label so that it precedes the code to set `digits'.  Otherwise,
3786         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3787         print `00-22'.  Now, it prints `-0022', as it should.
3788
3789 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3790
3791         * regex.h: Remove useless space-before-tab.  From coreutils.
3792
3793 2005-08-17  Bruno Haible  <bruno@clisp.org>
3794
3795         * strcasestr.h: New file.
3796         * strcasestr.c: New file.
3797
3798 2005-08-17  Bruno Haible  <bruno@clisp.org>
3799
3800         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3801         * strstr.c: Completely rewritten, with multibyte locale support.
3802
3803 2005-08-17  Bruno Haible  <bruno@clisp.org>
3804
3805         * strcasecmp.c: Use mbuiter.h.
3806
3807 2005-08-17  Bruno Haible  <bruno@clisp.org>
3808
3809         * mbuiter.h: New file.
3810
3811 2005-08-16  Bruno Haible  <bruno@clisp.org>
3812
3813         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3814         (mbi_init): Update.
3815         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3816         NUL byte, not after it.
3817
3818 2005-08-16  Bruno Haible  <bruno@clisp.org>
3819
3820         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3821         the valid ones. Makes the comparison operations transitive:
3822         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3823         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3824
3825 2005-08-16  Bruno Haible  <bruno@clisp.org>
3826
3827         * strcase.h (strcasecmp): Add note in comments.
3828         * strncasecmp.c: Use code from strcasecmp.c.
3829         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3830         (strcasecmp): Work correctly in multibyte locales.
3831
3832 2005-08-16  Bruno Haible  <bruno@clisp.org>
3833
3834         * strnlen1.h: New file.
3835         * strnlen1.c: New file.
3836
3837 2005-08-16  Bruno Haible  <bruno@clisp.org>
3838
3839         * mbfile.h: New file.
3840
3841 2005-08-16  Bruno Haible  <bruno@clisp.org>
3842
3843         * mbiter.h: New file.
3844
3845 2005-08-16  Bruno Haible  <bruno@clisp.org>
3846
3847         * mbchar.h: New file.
3848         * mbchar.c: New file.
3849
3850 2005-08-16  Bruno Haible  <bruno@clisp.org>
3851
3852         * tls.h: New file, from GNU gettext.
3853         * tls.c: New file, from GNU gettext.
3854
3855 2005-08-15  Bruno Haible  <bruno@clisp.org>
3856
3857         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3858         is defined.
3859
3860 2005-08-14  Jim Meyering  <jim@meyering.net>
3861
3862         Sync from coreutils.
3863
3864         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3865         Use the hash-table-based cycle-detection code not just when
3866         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3867         Reported by James Youngman in
3868         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3869         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3870         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3871         This lets us compile with -DFTS_DEBUG, once again.
3872         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3873         * fts.c (fd_safer): Remove decl.
3874         Include fcntl--.h rather than unistd-safer.h
3875         (fts_safe_changedir): Don't call fd_safer; no longer needed
3876         now that we include fcntl--.h.
3877
3878 2005-08-11  Simon Josefsson  <jas@extundo.com>
3879
3880         * readline.h, readline.c: New file.
3881
3882 2005-08-11  Bruno Haible  <bruno@clisp.org>
3883
3884         * strnlen.h (strnlen): Change parameter name to match comment.
3885
3886 2005-08-10  Simon Josefsson  <jas@extundo.com>
3887
3888         * strndup.c: Use strnlen.h.
3889
3890         * strnlen.h: New file.
3891
3892 2005-08-02  Simon Josefsson  <jas@extundo.com>
3893
3894         * getline.h, getline.c: Rewrite.
3895
3896         * getdelim.h, getdelim.c: New files, ported from glibc.
3897
3898 2005-07-31  Bruno Haible  <bruno@clisp.org>
3899
3900         * lock.h (gl_lock_initializer): New macro.
3901         (gl_lock_define_initialized): Use it.
3902         (gl_rwlock_initializer): New macro.
3903         (gl_rwlock_define_initialized): Use it.
3904         (gl_recursive_lock_initializer): New macro.
3905         (gl_recursive_lock_define_initialized): Use it.
3906
3907 2005-07-26  Bruno Haible  <bruno@clisp.org>
3908
3909         * lock.h: Update from GNU gettext.
3910         * lock.c: Update from GNU gettext.
3911
3912 2005-07-18  Bruno Haible  <bruno@clisp.org>
3913
3914         * lock.h (gl_once_t): New type.
3915         (gl_once_define, gl_once): New macros.
3916         * lock.c (fresh_once): New variable.
3917         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3918         functions.
3919
3920 2005-07-18  Simon Josefsson  <jas@extundo.com>
3921
3922         * check-version.c (check_version): Accept identical versions too.
3923
3924 2005-07-18  Bruno Haible  <bruno@clisp.org>
3925
3926         * lock.h: New file, from GNU gettext.
3927         * lock.c: New file, from GNU gettext.
3928
3929 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3930
3931         * quotearg.c: Add translator comment suggested by Bruno Haible,
3932         with a minor change.
3933
3934 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3935
3936         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3937         copyright symbol and the year.
3938         * version-etc.c (COPYRIGHT_YEAR): New constant.
3939         (version_etc_va): Use parameterized copyright notice.
3940         Reword to conform to the current GNU coding standards.
3941
3942 2005-07-11  Simon Josefsson  <jas@extundo.com>
3943
3944         * size_max.h: New file.
3945
3946 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3947
3948         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3949         block of defines.
3950
3951 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3952        and  Paul Eggert  <eggert@cs.ucla.edu>
3953
3954         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3955         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3956
3957 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3958
3959         * regex.c, regex.h: Sync from libc.
3960         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3961         New files, synced from libc, except that regex_internal.h
3962         currently has a small porting fix.
3963
3964 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3965
3966         Remove the dependency of the strftime module on the tzset module.
3967         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3968         Copy the input structure, to work around some of the bug with
3969         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3970         Solaris releases, you should also use the tzset module, but we won't
3971         require it as a dependency any more since we don't want LGPLed code
3972         to depend on GPLed code.
3973
3974 2005-07-02  Jim Meyering  <jim@meyering.net>
3975
3976         * backupfile.c (backup_args): Change a `0' to NULL.
3977
3978 2005-07-01  Jim Meyering  <jim@meyering.net>
3979
3980         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3981         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3982         * save-cwd.c, tempname.c:
3983         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3984         and don't include <sys/file.h>).
3985
3986 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3987
3988         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3989         declares only 'struct timespec;' (!).
3990
3991 2005-06-29  Jim Meyering  <jim@meyering.net>
3992
3993         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3994         type name.  Use the variable name instead.
3995         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3996
3997 2005-06-28  Simon Josefsson  <jas@extundo.com>
3998
3999         * check-version.h, check-version.c: New files.
4000
4001 2005-06-28  Simon Josefsson  <jas@extundo.com>
4002
4003         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4004         collision with global variable.  Better indentation.  Don't
4005         increment buffer pointer beyond buffer end.  Based on comments
4006         from Paul Eggert <eggert@cs.ucla.edu>.
4007
4008         * base64.h: Indent.
4009
4010 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4011
4012         * canon-host.c (canon-host): Append trailing "," to 0 in
4013         initializer of struct addrinfo, as an indication that we don't
4014         care how many members the structure has.
4015
4016 2005-06-24  Derek Price  <derek@ximbiot.com>
4017         and Bruno Haible  <bruno@clisp.org>
4018
4019         Remove stat module & update lstat.
4020         * stat.c: Remove this file...
4021         (slash_aware_lstat): ...moving this content and its support...
4022         * lstat.c (rpl_lstat): ...into here.
4023         * lstat.h: New file.
4024
4025 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4026
4027         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4028         (ranged_convert): Don't save conversion in a temporary struct.
4029         This causes a warning with GCC 4.0.0, and anyway in the typical
4030         case it's not worth the extra 100 bytes or so of code.
4031         (ranged_convert, __mktime_internal): When calling a function via a
4032         pointer P, use P () rather than (*P) (), as we now assume C89 or
4033         better.
4034
4035 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4036
4037         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4038         "who -r" failed to give output.  Problem reported by Tim Waugh.
4039
4040         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4041         (xcalloc): Use it to avoid needless tests.
4042         Problem reported by Jim Meyering.
4043
4044 2005-06-16  Jim Meyering  <jim@meyering.net>
4045
4046         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4047         when either N or S is zero.
4048
4049 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4050
4051         * argp.h (__option_is_short): Check upper limit of
4052         __key. Isprint() requires its argument to have the value
4053         of an unsigned char or EOF.
4054
4055 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4056
4057         * fnmatch.c (fnmatch): If there is an encoding error in a
4058         multibyte string or pattern, fall back on unibyte matching.
4059         Problem reported by James Youngman.
4060
4061 2005-06-08  Bruno Haible  <bruno@clisp.org>
4062
4063         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4064         warning on mingw.
4065
4066 2005-06-08  Bruno Haible  <bruno@clisp.org>
4067
4068         * csharpcomp.h: New file, from GNU gettext.
4069         * csharpcomp.c: New file, from GNU gettext.
4070         * csharpcomp.sh.in: New file, from GNU gettext.
4071
4072 2005-06-07  Derek Price  <derek@ximbiot.com>
4073
4074         Sync from CVS.
4075         * glob_.h: Indent nested #ifdef.
4076
4077 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4078
4079         Sync from coreutils.
4080         Use "file name" when talking about file names, instead of "filename"
4081         or "path", as per the GNU coding standards.
4082         * mkdir-p.c: Renamed from makepath.c.
4083         (make_dir_parents): Renamed from make_path.  All callers changed.
4084         * mkdir-p.h: Likewise.  All includers changed.
4085         * filenamecat.c: Renamed from path-concat.c.
4086         (file_name_concat): Renamed from path_concat.  All callers changed.
4087         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4088         * filenamecat.h: Likewise.  All includers changed.
4089         * acl.c: Don't use "path" or "filename" to mean "file name"
4090         in comments or local variable names.
4091         * basename.c: Likewise.
4092         * canonicalize.c, canonicalize.h: Likewise.
4093         * dirname.c, dirname.h: Likewise.
4094         * euidaccess.c: Likewise.
4095         * exclude.c: Likewise
4096         * fnmatch_.h, fnmatch_loop.c: Likewise.
4097         * fsusage.c, fsuage.h: Likewise.
4098         * fts.c, fts_.h: Likewise.
4099         * getcwd.c: Likewise.
4100         * getloadavg.c: Likewise.
4101         * mkstemp.c: Likewise.
4102         * mountlist.c, mountlist.h: Likewise.
4103         * openat.c, openat.h: Likewise.
4104         * readlink-stub.c: Likewise.
4105         * readutmp.c, readutmp.h: Likewise.
4106         * rename.c: Likewise.
4107         * rmdir.c: Likewise.
4108         * same.c: Likewise.
4109         * savedir.c: Likewise.
4110         * stripslash.c: Likewise.
4111         * tempname.c: Likewise.
4112         * xreadlink.c: Likewise.
4113         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4114         All uses changed.
4115         * exclude.h: Likewise.
4116
4117         * euidaccess.c (getuid, getgid, getuid, getegid)
4118         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4119         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4120         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4121         * pathmax.h: Include <limits.h> unconditionally, since other
4122         files have been getting away with it for years (MORE/BSD 4.3
4123         is extinct now).
4124         * userspec.c (getpwnam, getgrnam, getgrgid)
4125         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4126
4127         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4128         Define to 256, not 255, as per modern POSIX.
4129
4130 2005-06-01  Bruno Haible  <bruno@clisp.org>
4131
4132         * csharpexec.h: New file, from GNU gettext.
4133         * csharpexec.c: New file, from GNU gettext.
4134         * csharpexec.sh.in: New file, from GNU gettext.
4135
4136 2005-05-31  Derek Price  <derek@ximbiot.com>
4137             Paul Eggert  <eggert@cs.ucla.edu>
4138
4139         Sync from cvs.
4140         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4141
4142 2005-05-29  Derek Price  <derek@ximbiot.com>
4143             Paul Eggert  <eggert@cs.ucla.edu>
4144
4145         * glob_.h, glob.c: New files.
4146
4147 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4148
4149         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4150
4151         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4152         the configuration hassle isn't worth it.
4153         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4154         (LONGEST_MODIFIER, PRIuMAX): Remove.
4155
4156 2005-05-27  Bruno Haible  <bruno@clisp.org>
4157
4158         * getlogin_r.h: Remove second include of <stddef.h>.
4159
4160 2005-05-25  Bruno Haible  <bruno@clisp.org>
4161             Derek Price  <derek@ximbiot.com>
4162
4163         * getlogin_r.h: Simplify API documentation.
4164
4165 2005-05-25  Derek Price  <derek@ximbiot.com>
4166             Paul Eggert  <eggert@cs.ucla.edu>
4167
4168         * getlogin_r.c, getlogin_r.h: New files.
4169
4170 2005-05-22  Bruno Haible  <bruno@clisp.org>
4171
4172         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4173         Also include <sys/param.h> if it defines MIN, MAX.
4174         Based on a patch by Derek Price <derek@ximbiot.com>.
4175
4176 2005-05-22  Bruno Haible  <bruno@clisp.org>
4177
4178         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4179         (INT64_MIN): Fix definition.
4180         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4181
4182         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4183         NEED_SIGNED_INT_TYPES.
4184
4185         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4186         HAVE_SYSTEM_INTTYPES.
4187
4188 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4189
4190         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4191         so that unistd-safer.h (GPL'ed code) need not be included.
4192
4193 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4194
4195         New fts module.
4196         * fts.c: Don't include "cycle-check.h" or "hash.h".
4197         (setup_dir, free_dir): New functions.
4198         (enter_dir, leave_dir): Define trivial
4199         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4200         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4201         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4202         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4203         Move to fts-cycle.c.
4204         (fts_open): Use setup_dir.
4205         (fts_close): Use free_dir.
4206         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4207         This adds a label and some gotos, but the alternatives were messier.
4208         Check for memory allocation failure when entering a dir.
4209         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4210         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4211         (FTS): New member fts_cycle, that is a union that contains the
4212         old active_dir_ht and cycle_state.  All uses changed to mention
4213         fts_cycle.ht and fts_cycle.state.
4214         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4215         fts.c, with the following changes:
4216         (setup_dir, free_dir): New functions.
4217         (enter_dir): Now returns bool.  Return true if successful, false
4218         if memory exhausted.  All callers changed.
4219         Do not bother partly cleaning up on
4220         memory allocation failure; that is free_dir's job.
4221         However, free ad if hash_insert fails, to avoid memory leak.
4222         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4223         fts->fts_options to see which union member to use.
4224
4225 2005-05-20  Jim Meyering  <jim@meyering.net>
4226
4227         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4228         Now a macro, to pacify GCC.
4229
4230 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4231
4232         * chown.c (rpl_chown): Return -1 on failure.
4233
4234 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4235
4236         * canonicalize.c: Include canonicalize.h first, to test interface.
4237         Include <stddef.h> unconditionally, since we assume C89 now.
4238         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4239         * fts.c: Include fts_.h first, to check interface.
4240         Do not include intprops.h; no longer needed.
4241         Include cycle-check.h and hash.h, since fts_.h no longer does.
4242         Remove unnecessary casts of closedir to void.
4243         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4244         decide whether to decrement nlinks.
4245         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4246         (FTS): Use struct hash_table * instead of Hash_table, so that
4247         we no longer need to include hash.h here.
4248
4249 2005-05-17  Jim Meyering  <jim@meyering.net>
4250
4251         * fts.c, fts_.h: New files, from coreutils.
4252
4253 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4254
4255         Sync from coreutils.
4256         * unlinkdir.c, unlinkdir.h: New files.
4257         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4258         regex.h, unlocked-io.h, xtime.h:
4259         White space changes only.
4260         * makepath.c (make_path): Port to hosts where leading "//" is special.
4261         * yesno.c: Include getline.h, not ctype.h.
4262         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4263         Use getline to remove arbitrary restriction on response length.
4264
4265 2005-05-13  Bruno Haible  <bruno@clisp.org>
4266
4267         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4268         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4269         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4270         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4271         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4272         Add support for 64-bit integers in the MSVC compiler.
4273
4274 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4275
4276         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4277         Change the initial comment to refer to GPL, not LGPL.
4278         gnulib-tool will change it to LGPL as needed.
4279
4280         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4281         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4282         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4283         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4284         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4285         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4286         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4287         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4288         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4289         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4290         concatpath.c, config.charset, copy-file.c, copy-file.h,
4291         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4292         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4293         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4294         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4295         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4296         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4297         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4298         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4299         full-read.c, full-read.h, full-write.c, full-write.h,
4300         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4301         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4302         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4303         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4304         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4305         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4306         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4307         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4308         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4309         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4310         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4311         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4312         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4313         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4314         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4315         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4316         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4317         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4318         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4319         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4320         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4321         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4322         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4323         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4324         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4325         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4326         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4327         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4328         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4329         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4330         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4331         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4332         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4333         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4334         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4335         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4336         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4337         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4338         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4339         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4340         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4341         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4342         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4343         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4344         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4345         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4346         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4347         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4348         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4349         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4350         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4351         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4352         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4353         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4354         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4355         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4356         Update FSF postal mail address.
4357
4358 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4359
4360         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4361         specified in ai_socktype. Fix invalid ai_protocol
4362         check. ai_protocol is usually set to 0 or depending on
4363         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4364         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4365         ai_socktype / ai_protocol in the returned addrinfo structure.
4366
4367 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4368             Bruno Haible  <bruno@clisp.org>
4369
4370         * inet_ntop.h: New file.
4371         * inet_ntop.c: New file, from glibc with modifications.
4372
4373 2005-05-08  Jim Meyering  <jim@meyering.net>
4374
4375         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4376
4377 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4378
4379         Merge from coreutils.  Among other things,
4380         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4381         * fd-safer.c: New file.
4382         * fcntl-safer.h, open-safer.c: Remove.
4383         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4384         * dup-safer.c: Include unistd-safer.h first.
4385         Don't include errno.h.
4386         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4387         * file-type.h: Don't assume invoker included sys/stat.h first.
4388         * file-type.c: Rely on file-type.h change.
4389         * getloadavg.c: Include unistd-safer.h.
4390         (getloadavg): Use safer open.
4391         * getusershell.c: Include "stdio-safer.h".
4392         (getusershell): Use safer fopen.
4393         * long-options.c (long_options): Use NULL rather than 0.
4394         * modechange.h (mode_free): Remove; all callers changed to invoke
4395         'free'.
4396         * modechange.c: Likewise.
4397         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4398         (MODE_DONE): New constant.
4399         (struct mode_change): Remove 'next' member.
4400         (make_node_op_equals): New function; like the old one of the
4401         same name, except it allocates an array.
4402         (mode_compile, mode_create_from_ref): Use it.
4403         (mode_compile): Allocate result as an array, not a linked list.
4404         Parse octal string ourself, so that we catch mistakes like "+0".
4405         (mode_adjust): Arg is an array, not a linked list.
4406         * modechange.c: Include stat-macros.h, xalloc.h.
4407         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4408         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4409         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4410         Remove.  This is now stat-macros.h's job.
4411         (talloc): Remove.  All callers replaced by xalloc, so that
4412         our invokers don't have to worry about reporting memory failures.
4413         (make_node_op_equals): Remove.
4414         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4415         New constants.
4416         (struct mode_change): Moved here from modechange.h.
4417         (mode_append_entry): Remove.
4418         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4419         apps to have incorrect behavior.  Use simpler algorithm for head
4420         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4421         Detect more invalid usages rather than having somewhat-random behavior.
4422         Don't insert an "a=" action, as that leads to incorrect behavior.
4423         (mode_compile, mode_create_from_ref): Return NULL on error instead
4424         of an enum, since now there's only one way to have an error.  All
4425         callers changed.
4426         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4427         at the correct time.  Simplify calculation of "+u" and its ilk.
4428         Don't mishandle "+X".
4429         (mode_free): Remove "register" and localize decls.
4430         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4431         (struct mode_change): Move to modechange.c; callers don't
4432         need to see this stuff.
4433         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4434         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4435         (mode_change, mode_adjust): Reflect the new signatures noted above.
4436         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4437         that might redefine system include files.
4438         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4439         (my_usleep): Use NULL rather than (void *) 0.
4440         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4441         Use siginterrupt to specify that system calls should be interrupted.
4442         (rpl_nanosleep): Move initialization of suspended closer to call of
4443         my_usleep.
4444         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4445         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4446         (desirable_utmp_entry): New function.
4447         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4448         using x2nrealloc, to simplify logic.
4449         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4450         size calculation.  Do not assume utmp file is a regular file.
4451         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4452         (READ_UTMP_CHECK_PIDS): New constant.
4453         * save-cwd.c: Include unistd-safer.h.
4454         (save_cwd): Use fd_safer.
4455         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4456         [!_LIBC] Include "stat-macros.h" instead.
4457         * unistd-safer.h (fd_safer): New decl.
4458
4459 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4460
4461         * byteswap_.h: New file.
4462
4463 2005-04-25  Albert Chin  <china@thewrittenword.com>
4464
4465         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4466         Toolkit C bug.
4467
4468 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4469
4470         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4471         that "UTC +1 second" continues to work.  Problem reported
4472         by Dmitry V. Levin.
4473         (relunit_snumber): New rule.
4474         (relunit): Use it.
4475
4476 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4477
4478         * getdate.y (universal_time_zone_table): New constant.
4479         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4480         universal_time_zone_table.
4481         (lookup_zone): Prefer universal_time_zone_table to
4482         local_time_zone_table, so that "GMT" time stamps are allowed in
4483         London during the summer.  Problem reported by Ian Abbott.
4484
4485 2005-04-12  Jim Meyering  <jim@meyering.net>
4486
4487         * human.c (humblock): Set *options even when returning due to
4488         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4489         warning from gcc-4.
4490
4491 2005-04-09  Jim Meyering  <jim@meyering.net>
4492
4493         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4494         -Wuninitialized: initialize tm0.tm_year.
4495
4496 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4497
4498         * getdate.y (parser_control): rels_seen is now a boolean, not a
4499         count, since there's no maximum.  All uses changed.
4500         Add member dsts_seen.
4501         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4502         not being INT_MAX.
4503         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4504         Use pc_rels_seen to decide whther a date is absolute.
4505
4506         * getdate.y (number): Don't overwrite year.
4507         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4508         check.
4509
4510 2005-04-02  Simon Josefsson  <jas@extundo.com>
4511
4512         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4513         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4514
4515 2005-03-27  Jim Meyering  <jim@meyering.net>
4516
4517         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4518
4519 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4520
4521         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4522         "one's complement" -> "ones' complement" in comment, as per Knuth.
4523         "value of type" -> "type or expression" in comment.
4524         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4525
4526 2005-03-26  Jim Meyering  <jim@meyering.net>
4527
4528         Comment nits.
4529         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4530         Correct typos: s/or/of/.
4531
4532 2005-03-23  Jim Meyering  <jim@meyering.net>
4533
4534         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4535
4536 2005-03-21  Jim Meyering  <jim@meyering.net>
4537
4538         Changes imported from coreutils.
4539
4540         * cycle-check.c: Don't include xalloc.h.
4541
4542         * path-concat.c: Don't include assert.h.
4543         (path_concat): Remove assertion that would have triggered
4544         for ABASE starting with more than one slash.
4545         Reported by Andreas Schwab.
4546
4547         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4548         properly when ABASE is an absolute file name.
4549         Correct the description of this function.
4550         Include <assert.h>.
4551         Add an assertion and a test driver.
4552         This fixes a bug introduced on 2004-07-02.
4553         Andreas Schwab reported the resulting failure of cp --parents:
4554         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4555
4556 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4557
4558         * strftime.c (my_strftime): If the underlying strftime returns 0
4559         (which shouldn't happen), generate nothing instead of returning 0
4560         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4561
4562 2005-03-16  Bruno Haible  <bruno@clisp.org>
4563
4564         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4565
4566 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4567
4568         * strftime.c (my_strftime): Prepend space to format so that we can
4569         reliably distinguish strftime failure from empty output on POSIX
4570         hosts.
4571
4572 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4573
4574         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4575         (iconv_string): Don't guess a size-zero buffer, as that might cause
4576         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4577         result would be 'too large', where 'too large' is (heuristically)
4578         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4579         overflow concerns.  This will prevent some unwanted malloc failures
4580         when the inputs are very large.
4581
4582 2005-03-15  Bruno Haible  <bruno@clisp.org>
4583
4584         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4585         'negate'.
4586
4587         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4588         variable.
4589
4590         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4591
4592 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4593
4594         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4595         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4596         intprops.h.
4597         * strtol.c: Likewise.
4598
4599 2005-03-14  Simon Josefsson  <jas@extundo.com>
4600
4601         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4602         <fx@gnu.org>.
4603
4604 2005-03-14  Jim Meyering  <jim@meyering.net>
4605
4606         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4607         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4608         to be nonzero so that we (and caller) can detect the difference
4609         between a valid zero-length expansion and an error return, even
4610         when the underlying strftime fails before writing anything into
4611         that location.
4612
4613 2005-03-10  Jim Meyering  <jim@meyering.net>
4614
4615         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4616         so that this module works on systems without fchdir.
4617
4618 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4619
4620         Factor int-properties macros into a single file, except for
4621         glibc-related files.
4622         * intprops.h: New file.
4623         * getloadavg.c: Include it instead of limits.h.
4624         (INT_STRLEN_BOUND): Remove.
4625         * human.c: Include intprops.h.
4626         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4627         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4628         * inttostr.h: Include intprops.h instead of limits.h.
4629         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4630         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4631         for consistency with intprops.h.
4632         (time_t_is_integer, twos_complement_arithmetic): Use them.
4633         * sig2str.h: Include <signal.h>, intprops.h.
4634         (INT_STRLEN_BOUND): Remove.
4635         * strftime.c (TYPE_SIGNED): Remove.
4636         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4637         * strtol.c: Adjust comments to match intprops.h.
4638         * userspec.c: Include intprops.h.
4639         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4640         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4641         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4642         instead of rolling our own expressions.
4643         * xstrtol.c: Include xstrtol.h first, to test interface.
4644
4645         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4646         instead of int.
4647         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4648         the right thing even if adding 1900 would overflow.  Similarly
4649         for tm_mon + 1 and tm_yday + 1.
4650         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4651         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4652         (DO_SIGNED_NUMBER): New macro.
4653         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4654
4655 2005-03-07  Bruno Haible  <bruno@clisp.org>
4656
4657         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4658
4659 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4660             Bruno Haible  <bruno@clisp.org>
4661
4662         * pagealign_alloc.h: New file.
4663         * pagealign_alloc.c: New file.
4664
4665 2005-01-28  Bruno Haible  <bruno@clisp.org>
4666
4667         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4668         stpncpy.c uses it.
4669
4670 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4671
4672         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4673         The workaround isn't strictly needed for POSIX conformance, and
4674         it's too much of a pain to configure and maintain.  We'll ask
4675         people to fix their kernels instead.
4676         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4677         (NANOSLEEP_BUG_WORKAROUND): Remove.
4678         (xnanosleep): Remove the workaround.
4679
4680 2005-02-12  Bruno Haible  <bruno@clisp.org>
4681
4682         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4683
4684 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4685
4686         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4687         * timespec.h (gettime): Return void, since it always
4688         succeeds now.  All uses changed.
4689         * gettime.c (gettime) Likewise.
4690         [HAVE_NANOTIME]: Prefer nanotime.
4691         Assume gettimeofday succeeds, as POSIX requires.
4692         Assime time () succeeds, since other code already does.
4693         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4694         (timespec_subtract): Remove.
4695         (NANOSLEEP_BUG_WORKAROUND): New constant.
4696         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4697         things considerably.  Use it only on GNU/Linux hosts, since the
4698         workaround shouldn't be needed elsewhere.
4699
4700 2005-02-24  Bruno Haible  <bruno@clisp.org>
4701
4702         * gettext.h: Update from GNU gettext 0.14.2.
4703
4704 2005-02-24  Bruno Haible  <bruno@clisp.org>
4705
4706         * localcharset.c: Update from GNU gettext 0.14.2.
4707         * config.charset: Update from GNU gettext 0.14.2.
4708
4709 2005-02-22  Simon Josefsson  <jas@extundo.com>
4710
4711         * iconvme.h, iconvme.c: New files, from libc.
4712
4713 2005-02-20  Neil Conway  <neilc@samurai.com>
4714
4715         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4716         returned by OSX/Darwin if the specified buffer is not large
4717         enough for the hostname.
4718
4719 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4720
4721         * memrchr.h: New file.
4722         * chdir-long.c: Include it.
4723         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4724         Don't bother including stddef.h.
4725
4726 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4727
4728         * argp-help.c (__argp_help): Create a fake struct argp_state and
4729         pass it to _help, otherwise the latter coredumps trying to
4730         dereference state.root_argp.
4731
4732 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4733
4734         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4735         inclusion.
4736         Include <sys/types.h>, for dev_t.
4737         (ME_DUMMY, ME_REMOTE): Move from here....
4738         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4739         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4740         Dmitry V. Levin.
4741         Include mountlist.h first, to test the interface.
4742
4743 2005-01-29  Bruno Haible  <bruno@clisp.org>
4744
4745         * progname.c (program_name): Initialize.
4746         Needed when linking statically on MacOS X.
4747
4748 2005-01-28  Bruno Haible  <bruno@clisp.org>
4749
4750         * javacomp.sh.in: New file, from GNU gettext.
4751         * javacomp.h: New file, from GNU gettext.
4752         * javacomp.c: New file, from GNU gettext.
4753
4754 2005-01-26  Bruno Haible  <bruno@clisp.org>
4755
4756         * javaexec.sh.in: New file, from GNU gettext.
4757         * javaexec.h: New file, from GNU gettext.
4758         * javaexec.c: New file, from GNU gettext.
4759
4760 2005-01-26  Simon Josefsson  <jas@extundo.com>
4761
4762         * gai_strerror.c: Use GPL in header.
4763
4764 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4765
4766         * argp-help.c (hol_entry_help): Avoid using non-constant
4767         initializers for struct pentry_state.
4768         (__argp_error): Check return value of __asprintf
4769         (__argp_failure): Translate error message
4770
4771         * argp-parse.c: Removed braces around the expansion of N_()
4772
4773 2005-01-21  Jim Meyering  <jim@meyering.net>
4774
4775         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4776         same value as for Solaris 9.
4777
4778         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4779         component length.  This included changing the parameter to be
4780         of type `char *' rather than `char const *'.
4781         * chdir-long.h (chdir_long): Update prototype.
4782
4783         * openat.c (fdopendir, fstatat): New functions.
4784         * openat.h: Include headers required for use of DIR and struct stat.
4785         [AT_SYMLINK_NOFOLLOW]: Define.
4786         (fdopendir, fstatat): Add prototypes.
4787
4788 2005-01-21  Bruno Haible  <bruno@clisp.org>
4789
4790         * classpath.h: New file, from GNU gettext.
4791         * classpath.c: New file, from GNU gettext.
4792
4793 2005-01-20  Simon Josefsson  <jas@extundo.com>
4794
4795         * version-etc-fsf.c: New file, with version_etc_copyright.
4796         * version-etc.c: Remove version_etc_copyright.
4797         * version-etc.h (version_etc_copyright): Use [] instead of * in
4798         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4799
4800 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4801
4802         * save-cwd.c (save_cwd): Remove code to support the case
4803         where fchdir is missing or flaky.
4804
4805 2005-01-20  Simon Josefsson  <jas@extundo.com>
4806
4807         * base64.h (isbase64): Add.
4808
4809         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4810         using a unsigned prototype, don't inline.
4811         (base64_decode): Use it.
4812
4813 2005-01-19  Bruno Haible  <bruno@clisp.org>
4814
4815         * sh-quote.h: New file, from GNU gettext.
4816         * sh-quote.c: New file, from GNU gettext.
4817
4818 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4819
4820         Merge changes from coreutils, as described below in several
4821         changelogs dated today.
4822
4823         * save-cwd.c: Include "save-cwd.h" before other include files.
4824         (O_DIRECTORY): Remove; not needed here, since "." must be
4825         a directory.  All uses removed.
4826         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4827         universal on Suns, and we also need to test for IRIX.
4828         Revamp code to use 'if' rather than '#if'.
4829         Avoid unnecessary comparison of cwd->desc to 0.
4830
4831         * utimens.c (futimens): Robustify the previous patch, by checking
4832         for known valid error numbers rather than observed invalid ones.
4833
4834 2005-01-18  Jim Meyering  <jim@meyering.net>
4835
4836         * version-etc.c (version_etc_copyright): Update copyright date.
4837
4838         * utimens.c (futimens): Account for the fact that futimes
4839         can also fail with errno == ENOSYS or errno == ENOENT.
4840         Patch from Dmitry V. Levin.
4841
4842         Change the name of the robust chdir function from chdir to chdir_long.
4843         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4844         (restore_cwd): Use chdir_long, not chdir.
4845         * chdir-long.c: Renamed from chdir.c.
4846         * chdir-long.h: Renamed from chdir.h.
4847         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4848         Hurd.
4849
4850 2005-01-18  Bob Proulx  <bob@proulx.com>
4851
4852         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4853         offsetof() macro construct to avoid compile failure with native HP-UX
4854         11.0 ANSI C compiler.
4855
4856 2005-01-06  Bruno Haible  <bruno@clisp.org>
4857
4858         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4859         because stpncpy.m4 takes care of it.
4860
4861 2004-01-24  Bruno Haible  <bruno@clisp.org>
4862
4863         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4864
4865 2003-10-09  Bruno Haible  <bruno@clisp.org>
4866
4867         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4868
4869 2005-01-06  Bruno Haible  <bruno@clisp.org>
4870
4871         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4872         * fwriteerror.c: Include <stdbool.h>.
4873         (fwriteerror): At the end, close the file stream. Record whether
4874         stdout was already closed.
4875
4876 2004-05-27  Bruno Haible  <bruno@clisp.org>
4877
4878         * execute.c (environ): Declare if needed.
4879         * pipe.c (environ): Likewise.
4880         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4881
4882 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4883
4884         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4885         definitions to be after all include files, to avoid collisions.
4886         Problem reported by Bob Proulx.
4887
4888 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4889
4890         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4891         not needed.  This removes a dependency on the gettext module.
4892         [defined _LIBC]: Do not include <libintl.h>; not needed.
4893
4894 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4895
4896         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4897         HAVE_DECL_STRTOLD.
4898
4899 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4900
4901         * argp-parse.c: Include <stddef.h>.
4902         (alignof, alignto): New macros.
4903         (parser_init): Don't assume that void * is aligned sufficiently
4904         for struct option.
4905
4906         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4907         need to extend the stack.
4908         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4909         large.
4910
4911 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4912
4913         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4914
4915 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4916
4917         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4918         Remove now-obsolete comment about AIX.
4919         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4920         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4921         (YYMAXDEPTH): New macro.
4922
4923 2004-12-18  Bruno Haible  <bruno@clisp.org>
4924
4925         * fatal-signal.c (fatal_signals): Make non-const.
4926         (init_fatal_signals): New function.
4927         (uninstall_handlers, install_handlers): Ignore signals that were set to
4928         SIG_IGN.
4929         (at_fatal_signal): Call init_fatal_signals.
4930         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4931         SIG_IGN.
4932         Reported by Paul Eggert.
4933
4934 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4935
4936         * getdate.y (textint): New member "negative".
4937         (time_zone_hhmm): New function.
4938         Expect 14 shift-reduce conflicts, not 13.
4939         (o_colon_minutes): New rule.
4940         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4941         (yylex): Set the "negative" member of signed numbers.
4942
4943 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4944
4945         Changes imported from coreutils.
4946         * hard-locale.c: Assume <locale.h> exists.
4947         Include "strdup.h".
4948         (GLIBC_VERSION): New macro.
4949         (hard_locale): Assume setlocale exists.
4950         Rewrite to avoid #ifdef.
4951         Use strdup rather than malloc + strcpy.
4952         * human.c: Assume <locale.h> exists.
4953         (human_readable): Assume localeconv exists.
4954
4955 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4956
4957         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4958         convert T2, not T.  (Imported from libc.)
4959
4960 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4961
4962         * getcwd.c (is_ENAMETOOLONG): New macro.
4963         (__getcwd.c): Don't restore errno; glibc doesn't.
4964         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4965         first, falling back to our code only if its results look suspicious.
4966         Ensure that the resulting buffer is only as large as necessary.
4967
4968         * readutmp.c: Include readutmp.h first.
4969         Include <errno.h>, since readutmp.h no longer does that.
4970         * readutmp.h: Don't include <errno.h>,
4971         <sys/param.h>, <time.h>; not needed to establish interface.
4972         (errno): Remove decl.
4973         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4974         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4975         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4976
4977 2004-11-28  Simon Josefsson  <jas@extundo.com>
4978
4979         * base64.h, base64.c: New file.
4980
4981 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4982
4983         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4984
4985 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4988         HP's ANSI C compiler.
4989         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4990         Declaring int functions causes warnings on some modern systems and
4991         shouldn't be needed to compile on ancient ones.
4992         * same.c (MIN) [defined MIN]: Don't define, since it's already
4993         defined.
4994
4995         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4996         with the following changes.
4997         (__set_errno): Parenthesize properly.
4998         Include <stdbool.h>.
4999         (MIN, MAX, MATCHING_INO): New macros.
5000         (__getcwd): Define with prototype, not K&R form.
5001         Use heuristics to allocate default buffer on stack if possible.
5002         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5003         behavior, and to avoid the PATH_MAX limit when computing
5004         ../../../../...
5005         Use MATCHING_INO to compare inode number to file.
5006         Check for arithmetic overflow in size calculations.
5007         Fix bug in reallocation of dot array that caused getcwd to fail
5008         on directories nested deeper than 75.
5009         Be more careful about saving errno on error.
5010         Do not use realloc; use only free+malloc, as this is a bit
5011         more flexible and avoids a needless copy operation.
5012         Do not inspect st_dev and st_ino for symbolic links; POSIX
5013         doesn't specify the latter.
5014         Check for closedir errors.
5015         Avoid needless casts.
5016         Use "#ifdef weak_alias" around weak_alias, to be like other
5017         glibc code.
5018         The following changes to getcwd.c have effect only when used in
5019         gnulib; they have no effect inside glibc proper.
5020         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5021         as alloca isn't used.
5022         (alloca, __alloca): Likewise.
5023         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5024         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5025         unconditionally, as gnulib assumes C89 or better.
5026         Do not include <sys/param.h>.
5027         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5028         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5029         better.
5030         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5031         Include <dirent.h> in a way that is compatible with modern Autoconf.
5032         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5033         New macros, if not already defined.
5034         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5035         Use "_LIBC", not "defined _LIBC", for consistency.
5036         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5037         a mempcpy module.
5038         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5039         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5040         * xgetcwd.c: David MacKenzie's old code was removed, so give
5041         credit only to Jim Meyering and adjust the copyright dates.
5042         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5043         <stdlib.h>, <unistd.h>, "pathmax.h".
5044         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5045         (INITIAL_BUFFER_SIZE): Remove.
5046         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5047
5048 2004-11-23  Jim Meyering  <jim@meyering.net>
5049
5050         * getopt_.h: Remove trailing blanks.
5051
5052 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5053
5054         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5055         (futimens): New function, which uses futimes if available.
5056         (futimens, utimens): Support timespec==NULL, with same semantics
5057         as utime and utimens.
5058         * utimens.h (futimens): New decl.
5059
5060 2004-11-23  Jim Meyering  <jim@meyering.net>
5061
5062         * __fpending.c: Add comment.
5063
5064 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5065
5066         * getopt_.h: Re-addition of __getopt_argv_const caused
5067         redefinition warnings. To avoid them, include the defines
5068         in `#if !defined __need_getopt ... #endif'. The only place
5069         where __getopt_argv_const is used is in definitions
5070         of getopt_long and getopt_long_only below, which are as well
5071         protected by `#ifndef __need_getopt'.
5072         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5073         __need_getopt after including <stdio.h> and <unistd.h> These
5074         headers might have defined it.
5075
5076 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5077
5078         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5079         New macros.
5080         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5081         optopt): Use them instead of invoking ## directly; otherwise, the
5082         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5083
5084 2004-11-19  Bruno Haible  <bruno@clisp.org>
5085
5086         * strtok_r.c: Move comments from here...
5087         * strtok_r.h: ... to here.
5088
5089 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5090
5091         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5092         might fail.  Problem reported by Yoann Vandoorselaere.
5093         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5094         that mishandle size_t overflow.
5095
5096 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5097
5098         * canon-host.c: Include "strdup.h".
5099         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5100         Use strdup instead of malloc/strcpy to duplicate strings.
5101
5102         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5103         (human_space_before_unit): New constant.
5104         * human.c (human_readable): Support it.
5105
5106         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5107         (xgetcwd): Set errno correctly when failing.
5108         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5109         the failure is actually due to a PATH_MAX problem.
5110
5111         Further getopt changes to make it more likely that glibc will
5112         buy the changes back.
5113         * getopt.c (POSIXLY_CORRECT): New constant.
5114         (getopt): Use it, so to preserve glibc semantic
5115         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5116         when compiling for libc.
5117         * getopt_.h (__getopt_argv_const): Bring it back.
5118         (getopt_long, getopt_long_only): Use it.
5119
5120         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5121         New arg POSIXLY_CORRECT.  All callers changed.
5122         (getopt): Argv is now char * const *, as per standard.
5123         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5124         not char *__getopt_argv_const *.
5125         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5126         _getopt_long_only_r): Likewise.
5127         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5128         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5129         _getopt_long_r, _getopt_long_only_r): Likewise.
5130         * getopt_.h (__getopt_argv_const): Remove.
5131         (getopt): Argv is now char * const *, as per standard.
5132
5133         * getdate.y (tORDINAL): New token.
5134         (day, relunit): Allow it for relative times.
5135         (relative_time_table): Use tORDINAL for ordinals.
5136
5137 2004-11-15  Jim Meyering  <jim@meyering.net>
5138
5139         * closeout.c: Include "__fpending.h" once again.
5140         Include <stdbool.h>.
5141         (close_stdout): Don't fail just because stdout was closed initially,
5142         since some programs don't write to stdout in the normal course of
5143         operation (other than --version and --help), and we don't want this
5144         function to make e.g. `touch file >&-' fail.
5145         But do fail if it was closed and someone has tried to write to it.
5146         E.g., `printf foo >&-' must fail.
5147
5148 2004-11-11  Simon Josefsson  <jas@extundo.com>
5149
5150         * strtok_r.h, strtok_r.c: New file.
5151
5152 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5153
5154         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5155         we can stop lying to compilers about the constness of argv when we
5156         are compiled outside glibc.
5157         (getopt, getopt_long, getopt_long_only): Use it.
5158         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5159         getopt): Likewise.
5160         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5161         _getopt_long_only_r): Likewise.
5162         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5163         _getopt_long_only_r): Likewise.
5164
5165         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5166         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5167         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5168         the other external symbols.
5169         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5170         declaration, since the above renaming now works around collisions.
5171
5172 2004-11-11  Jim Meyering  <jim@meyering.net>
5173
5174         * linebreak.c: Remove trailing blanks.
5175         * alloca_.h: Likewise.
5176         * acosl.c: Likewise.
5177         * euidaccess.c: Likewise.
5178         * allocsa.h: Likewise.
5179
5180 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5181
5182         * mktime.c (SHR): New macro, which is a portable
5183         substitute for >> that should work even on Crays.
5184         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5185         Problem reported by Mark D. Baushke in
5186         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5187         * getdate.y (SHR): Likewise.
5188         (tm_diff): Use it.
5189         * strftime.c (SHR): Likewise.
5190         (tm_diff): Use it.
5191         * quotearg.c (struct quoting_options): Use unsigned int for
5192         quote_these_too, so that right shifts are well defined.  All uses
5193         changed.
5194
5195 2004-11-10  Simon Josefsson  <jas@extundo.com>
5196
5197         * getaddrinfo.h, getaddrinfo.c: New files.
5198
5199 2004-11-10  Jim Meyering  <jim@meyering.net>
5200
5201         Ensure that no close failure goes unreported.
5202         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5203         return early when it seems there's nothing to flush.
5204         Don't include __fpending.h.
5205
5206 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5207
5208         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5209
5210 2004-11-05  Bruno Haible  <bruno@clisp.org>
5211
5212         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5213         Reported by Mark D. Baushke <mdb@cvshome.org>.
5214
5215 2004-11-04  Bruno Haible  <bruno@clisp.org>
5216
5217         2004-09-11  Bruno Haible  <bruno@clisp.org>
5218                 * allocsa.valgrind: New file.
5219         2004-02-06  Bruno Haible  <bruno@clisp.org>
5220                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5221                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5222                 Reported by Christopher Seip <chris.seip@hp.com>.
5223
5224 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5225
5226         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5227         with errno == ERANGE if the buffer is too small.
5228         Problem reported by Mark D. Baushke.
5229
5230 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5231
5232         * xreadlink.c (MAXSIZE): New macro.
5233         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5234         size does not exceed MAXSIZE.  Avoid cast.
5235         As suggested by Mark D. Baushke in
5236         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5237         if readlink fails with buffer size just under MAXSIZE, try again
5238         with MAXSIZE.
5239
5240 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5241         and  Paul Eggert  <eggert@cs.ucla.edu>
5242
5243         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5244         (get_date): Overparenthesize to avoid GCC warning.
5245
5246 2004-11-02  Bruno Haible  <bruno@clisp.org>
5247
5248         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5249         function returns void.
5250
5251 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5252
5253         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5254         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5255         already declared.
5256
5257 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5258
5259         * getdate.y: Add support for TZ="foo" within a date string.
5260         Fix some bugs near time_t boundaries.  Reject dates with
5261         out-of-range components, e.g., "Sept 31".
5262         Include <stdlib.h>, "setenv.h", "xalloc.h".
5263         (ISDIGIT_LOCALE): Remove; unused.
5264         Note that the TZ and time functions used here are not reentrant.
5265         (mktime_ok, get_tz): New functions.
5266         (TZBUFSIZE): New constant.
5267         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5268         This requires that we sometimes generate our own TZ="XXX..." setting.
5269
5270 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5271
5272         * mktime.c (not_equal_tm): Remove redundant check.
5273
5274 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5275
5276         * getdate.y: Use Bison 1.875 features, and some minor
5277         code cleanups.  This change does not affect semantics.
5278         Don't include <stdlib.h>; no longer needed.
5279         Don't include unlocked-io.h; only the "#if TEST" code uses
5280         stdio, and performance isn't crucial there.
5281         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5282         Bison 1.875 features as described below.
5283         All uses of "PC." replaced by "pc->".
5284         (YYSTYPE): Add a forward declaration.
5285         (yylex, yyerror): Use full prototypes in forward decls.
5286         Use "%pure-parser" rather than obsolescent "%pure_parser".
5287         Use %parse-param and %lex-param instead of obsolescent
5288         YYPARSE_PARAM and YYLEX_PARAM.
5289         (meridian_table, month_and_day_table, time_units_table,
5290         relative_time_table, time_zone_table, military_table,
5291         lookup_zone, lookup_word, get_date):
5292         Use NULL instead of 0 where appropriate.
5293         (to_hour): Avoid abort (), to avoid a dependency on
5294         stdlib.h.
5295         (yyerror, yylex): Now accepts parser_control * arg.
5296         (main) [TEST]: Use '\0' rather than 0 for char.
5297
5298 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5299
5300         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5301         It's now the caller's responsibility to handle the case where
5302         !HAVE_GETPAGESIZE && !defined getpagesize.
5303
5304         * mktime.c (leapyear): Arg is long int, not int.
5305
5306 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5307
5308         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5309
5310 2004-10-12  Simon Josefsson  <jas@extundo.com>
5311
5312         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5313         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5314         to real functions.
5315
5316 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5317
5318         * vsnprintf.h: New file.
5319         * vsnprintf.c: New file.
5320
5321 2004-10-07  Bruno Haible  <bruno@clisp.org>
5322
5323         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5324         into the provided buffer.
5325
5326 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5327
5328         * diacrit.c, diacrit.h: Add GPL notice.
5329
5330         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5331         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5332         * logl.c (logl): Keep the code as similar to glibc as possible.
5333         This avoids a potential constant-folding bug.
5334
5335 2004-10-05  Bruno Haible  <bruno@clisp.org>
5336
5337         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5338
5339 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5340
5341         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5342         * xmalloc.c (xmemdup): Likewise.
5343         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5344         XFREE): Remove these long-obsolescent macros.
5345         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5346         * xstrdup.c: Remove.
5347
5348         * regex.c (re_comp): Cast gettext return value to char *,
5349         Problem reported by Martin Neitzel via Mark D. Baushke.
5350
5351 2004-10-04  Simon Josefsson  <jas@extundo.com>
5352
5353         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5354         '#ifdef USE_UNLOCKED_IO'.
5355
5356 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5357
5358         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5359         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5360         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5361         regex.c, sha1.c, version-etc.c, yesno.c:
5362         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5363         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5364         the includer's responsibility.
5365
5366         Sync from coreutils.
5367
5368         * modechange.c (mode_compile): Don't decrement a pointer that
5369         points to the start of a string, as the C Standard says the
5370         resulting behavior is undefined.
5371
5372         * backupfile.h (enum backuptype): Rename none -> no_backups,
5373         simple -> simple_backups, numbered_existing ->
5374         numbered_existing_backups, numbered -> numbered_backups
5375         to avoid shadowing problems.  All uses changed.
5376         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5377         * backupfile.c (check_extension, numbered_backup):
5378         Rename locals to avoid shadowing 'basename'.
5379         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5380         once.
5381
5382         * .cppi-disable: Add getopt_.h, getopt_int.h.
5383         * .cvsignore: Add getopt.h.
5384
5385 2004-10-04  Simon Josefsson  <jas@extundo.com>
5386
5387         * memmem.h: New file.
5388         * memmem.c: New file, taken from glibc.
5389
5390 2004-10-02  Jim Meyering  <jim@meyering.net>
5391
5392         * dirfd.h, getpagesize.h: Add copyright notice.
5393
5394 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5395
5396         * snprintf.c: Remove comments as to why each header is needed.
5397
5398 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5399
5400         * strsep.h: New file.
5401         * strsep.c: New file.
5402
5403 2004-10-01  Simon Josefsson  <jas@extundo.com>
5404
5405         * snprintf.c (snprintf): Handle size==0.
5406
5407 2004-10-01  Simon Josefsson  <jas@extundo.com>
5408             Bruno Haible  <bruno@clisp.org>
5409
5410         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5411         (snprintf): Declare 'args'.
5412
5413 2004-09-30  Simon Josefsson  <jas@extundo.com>
5414
5415         * snprintf.h, snprintf.c: New files.
5416
5417 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5418
5419         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5420         (hol_entry_help): Never translate an empty string.
5421         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5422         * argp.h (OPTION_NO_TRANS): New option.
5423
5424 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5425
5426         * xvasprintf.c: Include xalloc.h.
5427         (xvasprintf): Use xalloc_die, not xmalloc_die.
5428
5429 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5430
5431         * dummy.c: Change copyright notice to FSF, and license to GPL.
5432
5433 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5434
5435         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5436         Problem reported by Bruno Haible in:
5437         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5438
5439 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5440
5441         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5442         in case some system header has #define'd it.  Problem reported by
5443         Soeren D. Schulze in
5444         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5445
5446 2004-09-08  Bruno Haible  <bruno@clisp.org>
5447
5448         * stdint_.h: New file, taken from GNU clisp.
5449
5450 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5451
5452         * xvasprintf.h: New file.
5453         * xvasprintf.c: New file.
5454         * xasprintf.c: New file.
5455
5456 2004-09-08  Bruno Haible  <bruno@clisp.org>
5457
5458         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5459         is > INT_MAX.
5460         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5461
5462 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5463
5464         Import from coreutils.
5465         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5466         strings on unbounded length.  alloca's performance benefits aren't
5467         that important here.
5468         (V_STRDUP): Remove.
5469         (parse_with_separator): New function, with most of the internals
5470         of the old parse_user_spec.  Allow user to omit both user and group,
5471         for compatibility with FreeBSD.
5472         Clone only the user name, not the entire spec.
5473         Do not set *uid, *gid unless entirely successful.
5474         Avoid memory leak in some failing cases.
5475         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5476         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5477         (parse_user_spec): Rewrite to use parse_with_separator.
5478
5479 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5480
5481         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5482         its complicated substitute.
5483         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5484         and program_invocation_name.
5485         (__argp_basename) [!_LIBC]: Remove; the only use was
5486         replaced by its body.
5487         (__argp_short_program_name): Change condition from
5488         !defined __argp_short_program_name to
5489         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5490         to match argp-namefrob.h.
5491         (__argp_failure): Don't assume strerror_r returns char *.
5492         * argp-parse.c (N_): Define unconditionally.
5493         (argp_default_options): Fill out initializers with 0 to avoid
5494         gcc warnings.
5495
5496 2004-08-12  Simon Josefsson  <jas@extundo.com>
5497
5498         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5499         * getopt_.h: Renamed from getopt.h.
5500
5501 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5502
5503         Merge from coreutils.
5504
5505         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5506         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5507         for Reliant Unix 5.43.
5508
5509         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5510         (union fooround): Use uintmax_t, not long int.
5511         The rest is a merge from libc:
5512         [defined _LIBC]: Include <shlib-compat.h>.
5513         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5514
5515         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5516
5517         * strverscmp.c: Convert to UTF-8.
5518
5519 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5520
5521         * obstack.h (obstack_empty_p):
5522         Don't assume that chunk->contents is suitably aligned.
5523         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5524         Likewise. Problem reported by Benno in
5525         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5526
5527         * chown.c (rpl_chown): Work even if the file is writeable but not
5528         readable.  This could be improved further but it'd take some work.
5529
5530 2004-08-08  Simon Josefsson  <jas@extundo.com>
5531
5532         * xgethostname.c: Don't include error.h (not used).
5533
5534         * getpass.h: Add.
5535         * getpass.c: Include getpass.h first.
5536
5537 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5538
5539         * xalloc-die.c: New files.
5540         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5541         All uses removed.
5542         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5543         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5544         (_, N_, xalloc_die): Move to xalloc-die.c.
5545         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5546         so that we needn't mess with xalloc_msg_memory_exhausted.
5547
5548         * sha1.h: Renamed from sha.h.
5549         (SHA1_H): Renamed from _SHA_H.
5550         (sha1_ctx): Renamed from sha_ctx.
5551         (sha1_init_ctx): Renamed from sha_init_ctx.
5552         (sha1_process_block): Renamed from sha_process_block.
5553         (sha1_process_bytes): Renamed from sha_process_bytes.
5554         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5555         (sha1_read_ctx): Renamed from sha_read_ctx.
5556         (sha1_stream): Renamed from sha_stream.
5557         (sha1_buffer): Renamed from sha_buffer.
5558         * sha1.c: Likewise; renamed from sha.c.
5559         Do not include <sys/types.h>.
5560         Include <stddef.h> rather than <stdlib.h>.
5561
5562 2004-08-08  Bruno Haible  <bruno@clisp.org>
5563
5564         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5565         FILESYSTEM_PREFIX_LEN.
5566         * progreloc.c: Likewise.
5567         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5568
5569 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5570
5571         Merge from tar.
5572         * argp-help.c (make_hol, hol_append): Don't assume that
5573         SIZE_MAX is a valid preprocessor constant.
5574         (__argp_basename): Change from "#ifndef _LIBC"
5575         to "#ifndef __argp_short_program_name", so that
5576         we don't compile these functions for tar.
5577
5578         More merges from coreutils.
5579         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5580         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5581         yesno.h: New files.
5582         * addext.c: Remove; no longer needed.
5583         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5584         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5585         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5586         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5587         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5588         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5589         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5590         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5591         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5592         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5593         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5594         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5595         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5596         Import changes from coreutils.
5597
5598 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5599
5600         Merge from coreutils.
5601
5602         * .gdb-history: Remove; this doesn't belong here.
5603
5604         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5605         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5606         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5607
5608         * dirname.h: Include <stdbool.h>.
5609         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5610         for consistency with POSIX terminology.  All uses changed.
5611         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5612         (strip_trailing_slashes): Use bool for booleans.
5613         * stripslash.c (strip_trailing_slashes): Likewise.
5614
5615         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5616         sometimes returns a positive errno value even when it succeeds.
5617         (print_errno_message) [!LIBC]: Fall back on strerror if
5618         __strerror_r fails.
5619
5620         * path-concat.c (mempcpy): Don't define if a system header defines it.
5621         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5622         (longest_relative_suffix): New function.
5623         (path_concat): Use it.  Assume first argument is not NULL.
5624         Port to DOS.  Omit redundant separators.
5625         Report an error instead of returning NULL.
5626         Use mempcpy instead of memcpy.
5627         (xpath_concat): Remove: not declared or used.
5628
5629         * same.h: Include <stdbool.h>
5630         (same_name): Return bool, not int.
5631         * same.c (same_name): Likewise.
5632         (errno): Don't declare; we assume C89 or better now.
5633
5634         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5635         if not already defined.
5636
5637         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5638         * dup-safer.c (errno): Likewise.
5639
5640 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5641
5642         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5643         working.
5644
5645 2004-08-03  Simon Josefsson  <jas@extundo.com>
5646
5647         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5648         * progname.h: Don't include stdbool.h.
5649
5650 2004-08-02  Simon Josefsson  <jas@extundo.com>
5651
5652         * getsubopt.h: New file, with comments from Bruno Haible.
5653         * getsubopt.c: New file, from glibc, but slightly modified based on
5654         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5655
5656 2004-08-01  Simon Josefsson  <jas@extundo.com>
5657
5658         * xgetdomainname.c: Include stdlib.h, for free().
5659
5660 2004-07-16  Simon Josefsson  <jas@extundo.com>
5661
5662         * dummy.c: New file.
5663
5664 2004-07-16  Bruno Haible  <bruno@clisp.org>
5665
5666         * backupfile.h: Add extern "C" for C++.
5667         * closeout.h: Likewise.
5668         * copy-file.h: Likewise.
5669         * findprog.h: Likewise.
5670         * full-write.h: Likewise.
5671         * pathname.h: Likewise.
5672         * progname.h: Likewise.
5673         * stpcpy.h: Likewise.
5674         * stpncpy.h: Likewise.
5675         * strcase.h: Likewise.
5676         * strstr.h: Likewise.
5677         * xalloc.h: Likewise.
5678
5679         * mbswidth.h: Add extern "C" for C++.
5680         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5681
5682 2004-07-09  Simon Josefsson  <jas@extundo.com>
5683
5684         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5685         failed without this.)
5686
5687 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5688
5689         * fchown-stub.c: New file.
5690
5691 2004-06-24  Jim Meyering  <jim@meyering.net>
5692
5693         * obstack.h (obstack_base): Cast to (void *), per documentation.
5694
5695 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5696
5697         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5698
5699 2004-06-01  Jim Meyering  <jim@meyering.net>
5700
5701         * calloc.c: New file.
5702
5703 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5704
5705         * getdate.y (yylex): Allow space between sign and number.
5706         Problem reported by Dan Jacobson.
5707
5708 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5709         and  Jim Meyering  <jim@meyering.net>
5710
5711         Merge from coreutils CVS.
5712
5713         * stat-macros.h: New file, with contents from file-type.h
5714         and coreutils' system.h.
5715         * file-type.c: Include "stat-macros.h".
5716         * file-type.h (file_type): Move all macro definitions to new file,
5717         stat-macros.h.
5718
5719         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5720         Wrap old code with this conditional.
5721         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5722         function that does not dereference symlinks.
5723         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5724
5725         * xreadlink.c: Include xreadlink.h first, to catch .h file
5726         dependency problems.
5727         (xreadlink): Accept new arg SIZE, for efficiency.
5728         All decls and uses changed.
5729         * xreadlink.h: Include <stddef.h>, for size_t.
5730
5731         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5732         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5733
5734         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5735
5736 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5737
5738         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5739         macros to be defined.
5740         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5741         the allocator returns NULL because the requested size is zero.
5742
5743 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5744
5745         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5746         var.  Add comment explaining why libc still defines it.  This
5747         merges the following patch from glibc:
5748         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5749
5750 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5751
5752         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5753         present in glibc since revision 1.1 of this file.
5754         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5755         obstack_alignment_mask, obstack_alloc, obstack_base,
5756         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5757         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5758         obstack_grow0, obstack_init, obstack_int_grow,
5759         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5760         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5761         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5762         nonexistent functions.
5763
5764 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5765             Paul Eggert  <eggert@cs.ucla.edu>
5766
5767         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5768
5769 2004-05-14  Bruno Haible  <bruno@clisp.org>
5770
5771         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5772         that consists of a '.' followed by an empty digit string.
5773         Patch by Tor Lillqvist <tml@iki.fi>.
5774
5775 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5776
5777         Port obstack to the AS/400, where pointers are 16 bytes wide and
5778         you cannot cast an integer to a valid pointer.  This patch is
5779         currently waiting to be integrated into glibc; see
5780         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5781
5782         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5783         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5784         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5785         (struct obstack): temp member is now a union of a pointer and
5786         an integer, instead of an integer.  All integer uses changed.
5787         This does not affect the physical layout of struct obstack,
5788         except on hosts (like the AS/400) where the size or alignment of
5789         void * is greater than that of ptrdiff_t.
5790         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5791         __STDC__)]: Store temporary in pointer member of union, not
5792         integer member.
5793         * obstack.c: Include <stddef.h>, for offsetof.
5794         (struct fooalign): Remove; it doesn't need a name.
5795         (union fooround): Change double to long double, and add void *.
5796         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5797         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5798         not a macro.  Hence the values are always int; so remove all
5799         casts-to-int in uses.
5800
5801 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5802             Derek Price  <derek@ximbiot.com>
5803
5804         * alloca.c: Include <alloca.h>, to get our interface.
5805         * alloca_.h: Use __alloca on AIX, so that we don't have to
5806         include <alloca.h> first.  Use C89 prototype for alloca; this
5807         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5808         Use #elif for simplicity, since we can assume C89 now.
5809         Don't try to source the system alloca.h since it will not be found
5810         and to prevent recursively including its replacement.
5811         * fnmatch.c: Include <alloca.h> instead of opencoding.
5812         * regex.c: Likewise.
5813
5814 2004-05-16  Derek Price  <derek@ximbiot.com>
5815             Paul Eggert  <eggert@cs.ucla.edu>
5816
5817         getline cleanup.  This changes the getndelim2 API: both order of
5818         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5819         no delimiter).
5820
5821         * getline.c: Don't include stddef.h or stdio.h, since our
5822         interface does that.
5823         (getline): Always use getdelim, so that we don't have two
5824         copies of this code.
5825         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5826         if available.
5827         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5828         (GETNDELIM2_MAXIMUM): New macro.
5829         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5830         instead of the old practice of delim2==0.  All callers changed.
5831         Return -1 on overflow, instead of returning junk.
5832         Do not set *linesize unless allocation succeeds.
5833         * getndelim2.h: Do not include stddef.h; no longer needed, now
5834         that we include sys/types.h.
5835         * getnline.h: Likewise.
5836         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5837         (getndelim2): Reorder arguments.
5838         * getnline.c (getnline, getndelim):
5839         Don't discard the NMAX argument.
5840         (getnline): Invoke getndelim, to avoid code duplication.
5841         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5842         of (size_t) -1 by callers of the getnline family.
5843
5844 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5845
5846         * nanosleep.c (suspended): Change its type from int to
5847         sig_atomic_t volatile.
5848         (first_call): Make it private to rpl_nanosleep, and have it
5849         be zero initially as that's a bit faster.
5850         (my_usleep): Round up fractional times instead of truncating them,
5851         as this is the usual meaning for 'sleep'.
5852
5853         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5854         doesn't work.
5855         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5856         (ENOSYS): Define if not defined.
5857         (settime): Fall back on stime if it exists and settimeofday fails.
5858         But don't bother with fallbacks if a method fails with errno == EPERM.
5859
5860 2004-05-11  Jim Meyering  <jim@meyering.net>
5861
5862         Prior to this change, the save_cwd caller required read access to the
5863         current directory on most systems (ones with the fchdir function).
5864
5865         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5866         fails, try write-only, and finally, resort to using xgetcwd.
5867
5868 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5869
5870         * obstack.c, obstack.h: Import changes from libc.
5871
5872 2004-04-28  Bruno Haible  <bruno@clisp.org>
5873
5874         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5875         implicitly appends .exe to executables.
5876         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5877         accepts Windows pathnames.
5878         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5879         Cygwin like Windows, since it now accepts Windows pathnames.
5880         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5881         Cygwin like Windows, since it now accepts Windows pathnames.
5882         Reported by Derek Robert Price <derek@ximbiot.com>.
5883
5884 2004-04-20  Jim Meyering  <jim@meyering.net>
5885
5886         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5887
5888 2004-04-20  Jim Meyering  <jim@meyering.net>
5889             Bruno Haible  <bruno@clisp.org>
5890
5891         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5892         memory when realloc fails.
5893
5894 2004-04-18  Jim Meyering  <jim@meyering.net>
5895
5896         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5897         don't leak memory and do call END_UTMP_ENT.
5898
5899 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5900
5901         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5902         (CHAR_BIT): Remove, since we assume C89.
5903         Include <stdint.h> if available, as per current Autoconf CVS advice.
5904
5905 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5906
5907         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5908         not bool, to be more consistent with Unix conventions.
5909         Suggested by Bruno Haible.
5910
5911         Merge from coreutils.
5912
5913         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5914         New files.
5915
5916         * getdate.h: Include stdbool.h, and timespec.h instead of
5917         the usual <time.h> dance.
5918         (get_date): Change signature to support fractional time stamps.
5919         All callers changed.
5920         * getdate.y: Include "getdate.h" first, as we can now
5921         assume C89 and don't need to worry about 'const'.
5922         Similarly, include "unlocked-io.h" near start, not in middle.
5923         Include <limits.h>.
5924         (textint.value): Use long int rather than int.
5925         (textint.digits): Use size_t rather than int.
5926         (BILLION, LOG10_BILLION): New constants.
5927         (parser_control): New member rel_ns.  Members day_ordinal,
5928         time_zone, month, day, hour, minutes, rel_year, rel_month,
5929         rel_day, rel_hour, rel_minutes, rel_seconds
5930         are now long int, not int.  Member seconds is now struct timespec,
5931         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5932         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5933         not int.
5934         (%union.intval): Now long int, not int.
5935         New member timespec.
5936         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5937         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5938         (spec): Now is a timespec or an item list.
5939         (timespec, items): New nonterminals.
5940         (time, rel, relunit, number, get_date):
5941         Add support for fractional seconds.
5942         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5943         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5944         (to_hour): First arg is now long int, not int.
5945         (to_year): Returns long int, not int.
5946         Don't treat year -70 like 70.
5947         (tm_diff): Returns long int, not int.
5948         (lookup_word): Use bool instead of int when appropriate.
5949         (yylex): Use size_t for count, not int.
5950         Detect overflow when parsing large integer constants.
5951         Add support for fractions.
5952         (get_date): Make pointers 'const' if possible.
5953         Use more-portable code to detect integer overflow.
5954         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5955         Don't use ctime; it's not reliable if the year has >4 digits.
5956
5957         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5958         This is for compatibility with BSD.
5959
5960         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5961         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5962         From coreutils' system.h.
5963
5964         * userspec.c: Don't include "posixver.h".
5965         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5966         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5967         compatible extension.  Simplify code by removing a boolean int
5968         that was always nonzero if a string was nonnull.
5969
5970 2004-03-30  Jim Meyering  <jim@meyering.net>
5971
5972         Merge from coreutils.
5973
5974         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5975
5976         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5977         an empty input stream.
5978
5979         * readtokens.c: Include <stdbool.h>.
5980         (readtoken): Use `size_t' rather than int/long.
5981         All callers adjusted.
5982         Use `bool' rather than `int' where appropriate.
5983         Use memset rather than an explicit loop.
5984         Use x2nrealloc rather than xrealloc.
5985         Allow the use of `\0' as a delimiter.
5986         (readtokens): Likewise.
5987         * readtokens.h (readtoken, readtokens): Update prototypes.
5988
5989 2004-03-30  Bruno Haible  <bruno@clisp.org>
5990
5991         * getloadavg.c (getloadavg): Don't assume setlocale returns
5992         nonnull.
5993
5994 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5995
5996         Merge changes to getloadavg.c from coreutils and Emacs.
5997
5998         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5999         Define to an expression, not to the empty string.
6000         Include cloexec.h and xalloc.h.
6001         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6002         Use set_cloexec_flag rather than rolling our own.
6003         * cloexec.c, cloexec.h: New files.
6004
6005 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6006
6007         * getopt.h: Sync with libc CVS.
6008
6009 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6010             Bruno Haible  <bruno@clisp.org>
6011
6012         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6013         not on all platforms that have <wchar.h>.
6014         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6015
6016 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6017
6018         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6019         Sync with libc CVS.
6020         * getopt_int.h: New file, also synced from libc.
6021
6022 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6023
6024         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6025         '#if' expressions.  Unlike the code it replaces, it does not
6026         depend on (defined _SC_PAGESIZE).  However, it does depend on
6027         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6028         first reported by Jason Andrade in
6029         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6030
6031 2004-01-18  Simon Josefsson  <jas@extundo.com>
6032
6033         * strdup.h: New file.
6034         * strdup.c: Include it.
6035         * path-concat.c: Include strdup.h. Drop strdup declaration.
6036         * userspec.c: Include strdup.h. Drop strdup declaration.
6037
6038 2004-02-06  Karl Berry  <karl@gnu.org>
6039
6040         * config.charset: update from gettext 0.14.1.
6041
6042 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6043
6044         Add comments and code, prompted by suggestions from Bruno Haible
6045         for sh-quote.
6046         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6047         describing the enum quoting_style values.
6048         * quotearg.c (quotearg_alloc): New function.
6049         (quotearg_buffer_restyled): Treat lone { and } as special.
6050         Treat = as special.  Work around bug with older shells
6051         that "see" a '\' that is really the 2nd byte of a multibyte char.
6052         Quote empty string with shell_quoting_style.
6053
6054 2004-02-03  Bruno Haible  <bruno@clisp.org>
6055
6056         * pipe.h: New file, from GNU gettext.
6057         * pipe.c: New file, from GNU gettext.
6058
6059 2004-01-27  Bruno Haible  <bruno@clisp.org>
6060
6061         * execute.h: New file, from GNU gettext.
6062         * execute.c: New file, from GNU gettext.
6063         * w32spawn.h: New file, from GNU gettext.
6064
6065 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6066
6067         Exit-status fix from coreutils.
6068
6069         Use exit_failure consistently in place of EXIT_FAILURE,
6070         so that program exit statuses are consistent on failure.
6071
6072         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6073         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6074         * argmatch.h: Comment fix to match the above.
6075         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6076         Now a macro referring to exit_failure, instead of a separate
6077         variable.  Include "exitfail.h" to get it.
6078         * xstrtol.h: Include "exitfail.h".
6079         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6080
6081         * long-options.c (parse_long_options): Use prototype
6082         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6083         for clarity.
6084
6085 2004-01-21  Jim Meyering  <jim@meyering.net>
6086
6087         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6088         so as not to conflict with a different-sized __mktime_internal
6089         function in GNU libc.
6090         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6091         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6092
6093 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6094
6095         Merge from diffutils.
6096
6097         * file-type.c (file_type): Add typed memory objects.
6098         * file-type.h (S_TYPEISTMO): New macro.
6099
6100         * c-stack.h (c_stack_action): Remove argv argument.
6101         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6102         (die): Don't calculate message unless segv_action returns.
6103         (get_stack_location, min_address_from_argv, max_address_from_argv,
6104         volatile stack_base, volatile_stack_size): Remove.
6105         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6106         that every segmentation violation is a stack overflow.  (Ouch!)
6107         See Debian bug 136249 (still outstanding) for more info about why
6108         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6109
6110 2003-11-30  Bruno Haible  <bruno@clisp.org>
6111
6112         Safer stack allocation.
6113         * setenv.c: Include allocsa.h.
6114         (alloca): Remove fallback definition.
6115         (freea): Remove macro.
6116         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6117         instead of freea.
6118
6119 2003-10-17  Bruno Haible  <bruno@clisp.org>
6120
6121         * binary-io.h: Avoid warnings on Cygwin.
6122
6123 2003-12-28  Bruno Haible  <bruno@clisp.org>
6124
6125         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6126         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6127
6128 2003-11-28  Bruno Haible  <bruno@clisp.org>
6129
6130         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6131
6132 2003-11-27  Bruno Haible  <bruno@clisp.org>
6133
6134         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6135
6136 2003-11-17  Bruno Haible  <bruno@clisp.org>
6137
6138         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6139
6140 2003-11-24  Bruno Haible  <bruno@clisp.org>
6141
6142         * xallocsa.h: New file, from GNU gettext.
6143         * xallocsa.c: New file, from GNU gettext.
6144
6145 2003-11-24  Bruno Haible  <bruno@clisp.org>
6146
6147         * allocsa.h: New file, from GNU gettext.
6148         * allocsa.c: New file, from GNU gettext.
6149
6150 2003-11-24  Bruno Haible  <bruno@clisp.org>
6151
6152         * eealloc.h: New file.
6153
6154 2004-01-15  Jim Meyering  <jim@meyering.net>
6155
6156         Merge from coreutils.
6157
6158         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6159         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6160         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6161
6162         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6163         optional configure-time default.
6164
6165         * version-etc.c (version_etc_copyright): Update copyright date.
6166
6167         * xreadlink.c (xreadlink): Correct outdated comment.
6168
6169 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6170
6171         Merge from coreutils.
6172
6173         * posixver.c: Include posixver.h.
6174
6175         * same.c: Include <stdbool.h>, <limits.h>.
6176         (_POSIX_NAME_MAX): Define if not defined.
6177         (MIN): New macro.
6178         (same_name): If file names are silently truncated, report
6179         that the file names are the same if they are the same after
6180         the silent truncation.
6181
6182         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6183         conversion function.
6184         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6185         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6186         longer needed.
6187
6188 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6189
6190         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6191         with like-named macro in fnmatch.c.
6192         (EXT): Use an internal constant instead.
6193
6194         Merge fnmatch patches from glibc.
6195         * fnmatch.c (mbsinit): Remove define.
6196         Add libc_hidden_ver (__fnmatch, fnmatch).
6197         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6198         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6199
6200 2003-12-14  Karl Berry  <karl@gnu.org>
6201
6202         * config.charset: update from gettext-runtime.
6203
6204 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6205
6206         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6207         Bug reported by Alfred M. Szmidt.
6208
6209 2003-11-29  Karl Berry  <karl@gnu.org>
6210
6211         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6212
6213 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6214             Bruno Haible  <bruno@clisp.org>
6215
6216         * printf-parse.h: Don't include sys/types.h.
6217         (ARG_NONE): New macro.
6218         (char_directive): Change type of *arg_index fields to size_t.
6219         * printf-parse.c: Don't include sys/types.h.
6220         (SSIZE_MAX): Remove macro.
6221         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6222         Remove unnecessary overflow check.
6223         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6224         fields.
6225
6226 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6227
6228         * alloca.c: Remove dependency on xalloc module.
6229         (xalloc_die): Remove.
6230         (memory_full) [!defined emacs]: New macro.
6231         [!defined emacs]: Don't include xalloc.h.
6232         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6233         address arithmetic overflows.  Change datatypes a bit to avoid
6234         unnecessary casts.
6235
6236 2003-11-22  Jim Meyering  <jim@meyering.net>
6237
6238         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6239
6240 2003-11-17  Bruno Haible  <bruno@clisp.org>
6241
6242         * vasnprintf.c (alloca): Remove fallback definition.
6243         (freea): Remove definition.
6244         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6245         Reported by Paul Eggert.
6246
6247 2003-11-17  Jim Meyering  <jim@meyering.net>
6248
6249         On systems without utime and without a utimes function capable of
6250         dealing with a NULL struct utimbuf* argument, this utime replacement
6251         could -- in unusual circumstances -- leak a file descriptor.
6252         * utime.c: Include <unistd.h> and <errno.h>.
6253         (utime_null): Be sure to close `fd' and to preserve errno.
6254         Reported by Geoff Collyer via Arnold Robbins.
6255
6256 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6257             Bruno Haible  <bruno@clisp.org>
6258
6259         Protect against address arithmetic overflow.
6260         * printf-args.h: Include stddef.h.
6261         (arguments): Change type of field 'count' to size_t.
6262         * printf-args.c (printf_fetchargs): Use size_t instead of
6263         'unsigned int' where appropriate.
6264         * printf-parse.h: Include sys/types.h.
6265         (char_directive): Change type of *arg_index fields to ssize_t.
6266         (char_directives): Change type of fields 'count', max_*_length to
6267         size_t.
6268         * printf-parse.c: Include sys/types.h and xsize.h.
6269         (SSIZE_MAX): Define fallback value.
6270         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6271         instead of 'int' where appropriate. Check a_allocated, d_allocated
6272         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6273         * vasnprintf.c: Include xsize.h.
6274         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6275         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6276         overflow. Avoid wraparound when converting a width or precision from
6277         decimal to binary.
6278
6279 2003-11-16  Bruno Haible  <bruno@clisp.org>
6280
6281         Update from GNU gettext.
6282         * printf-parse.c: Generalize to it can be compiled for wide strings.
6283         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6284         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6285         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6286         SNPRINTF): New macros.
6287         Don't include <alloca.h> if the file is used inside libintl.
6288         (local_wcslen): New function, for Solaris 2.5.1.
6289         (VASNPRINTF): Use it instead of wcslen.
6290
6291 2003-11-16  Bruno Haible  <bruno@clisp.org>
6292
6293         * xsize.h (xmax): New function.
6294         (xsum, xsum3, xsum4): Declare as "pure" functions.
6295
6296 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6297
6298         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6299         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6300         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6301         heuristic is just as accurate as far as we know, and it removes a
6302         dependency on size_max.m4 and ptrdiff_max.m4.
6303
6304 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6305
6306         * xstrtol.c (__xstrtol): Remove "break" immediately after
6307         "return", to pacify some unknown compiler.  Problem reported
6308         by Joerg Schilling.
6309
6310 2003-11-11  Bruno Haible  <bruno@clisp.org>
6311
6312         * xsize.h (SIZE_MAX): Remove fallback definition.
6313         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6314         defined.
6315
6316 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6317
6318         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6319         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6320         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6321         From Bruno Haible.
6322         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6323         not (size_t) -1, since it's defined here.
6324
6325 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6326
6327         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6328         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6329         Reject sizes of exactly SIZE_MAX bytes.
6330         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6331         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6332
6333 2003-11-05  Bruno Haible  <bruno@clisp.org>
6334
6335         * xsize.h: Include limits.h, to avoid a possible collision with
6336         SIZE_MAX defined in <limits.h> on Solaris.
6337
6338 2003-11-04  Bruno Haible  <bruno@clisp.org>
6339
6340         * xsize.h: New file.
6341         * linebreak.c: Include xsize.h.
6342         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6343         argument for overflow.
6344         Suggested by Paul Eggert.
6345
6346 2003-10-31  Bruno Haible  <bruno@clisp.org>
6347
6348         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6349         to avoid (extremely rare) race condition.
6350         Suggested by Paul Eggert.
6351
6352 2003-11-03  Jim Meyering  <jim@meyering.net>
6353
6354         * userspec.c: Include "userspec.h".
6355         * userspec.h: New file.
6356
6357 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6358
6359         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6360         * mountlist.c (SIZE_MAX): Define if not defined already.
6361         (read_filesystem_list): Set and use me_type_malloced.
6362         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6363         whatever the type happens to be), for brevity and consistency.
6364         Check for size calculation overflow on Alphas running OSF/1.
6365
6366 2003-10-31  Jim Meyering  <jim@meyering.net>
6367
6368         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6369
6370         * linebuffer.c: Include <string.h> for declaration of memset.
6371
6372 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6373             Bruno Haible  <bruno@clisp.org>
6374
6375         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6376         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6377
6378 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6379
6380         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6381         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6382         no longer needed.
6383         * quotearg.c (quotearg_n_options): Use it.
6384         * group-member.c: Include <stdbool.h>.
6385         (free_group_info): Arg is now const *; don't free arg.
6386         (get_group_info): Now returns bool and accepts struct group_info *,
6387         rather than returning a malloc'ed struct group_info *.
6388         All uses changed.  Check for overflow in internal size calculation.
6389
6390         * getusershell.c (readname): Simplify the code by using x2nrealloc
6391         rather than xmalloc/xrealloc.
6392         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6393         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6394         conformance bug: the old code used a pointer after freeing the
6395         storage that it addressed.
6396         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6397         rather than doing it by hand.
6398         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6399         the buffer preserved.  Use free and xmalloc instead.
6400         * quotearg.c (quotearg_n_options): Likewise.
6401         Use a simpler test for size overflow.  Don't use xalloc_oversized
6402         because unsigned int might be wider than size_t (!); this suggests
6403         that we should switch from unsigned int to size_t for slot numbers.
6404
6405 2003-10-27  Bruno Haible  <bruno@clisp.org>
6406
6407         * stdbool_.h: Better support for BeOS.
6408
6409 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6410
6411         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6412         to allocate the returned structure.  Do not allocate a subarray,
6413         as x2nrealloc will do that.
6414         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6415         instead of xnrealloc.
6416         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6417
6418 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6419
6420         * xalloc.h (xalloc_oversized): New static inline function, for
6421         callers that want to do their own size-overflow checking.  Include
6422         <stdbool.h>, since xalloc_oversized returns bool.
6423         * xalloc.c (array_size_overflow): Remove.  All callers changed
6424         to use xalloc_oversized.
6425
6426         Add two functions x2realloc, x2nrealloc, for programs that grow
6427         arrays dynamically by doubling their sizes.
6428         * xalloc.h (x2realloc, x2nrealloc): New decls.
6429         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6430         New functions.
6431
6432         Port to C99 semantics for 'inline' of external functions.
6433         Bug reported by Bruno Haible.
6434         * xmalloc.c (xnmalloc_inline): New static inline function,
6435         with the old contents of xnmalloc.
6436         (xnmalloc, xmalloc): Use it.
6437         (xnrealloc_inline): New static inline function,
6438         with the old contents of xnrealloc.
6439         (xnrealloc, xrealloc): Use it.
6440
6441         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6442
6443 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6444
6445         Fix several address-calculation bugs in the hash modules,
6446         plus some minor code cleanup.
6447
6448         * hash.h: Include <stdbool.h>, for bool.
6449         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6450         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6451         hash_get_n_entries, hash_get_max_bucket_length,
6452         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6453         hash_rehash): Use size_t rather than unsigned.
6454         * hash.c (struct hash_table, hash_get_n_buckets,
6455         hash_get_n_buckets_used, hash_get_n_entries,
6456         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6457         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6458         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6459         Likewise.
6460         (SIZE_MAX): Define if not defined.
6461         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6462         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6463         hash_print):
6464         Use const * when possible.
6465         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6466         (check_tuning): Fix bug: if tuning parameters were very close to
6467         0 or 1, rounding errors could have caused subscript violations.
6468         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6469         (hash_initialize): Add 'fail:' label
6470         to free table and return NULL, and use it to simplify code.
6471         Use calloc rather than clearing the storage ourself.
6472         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6473         buffer size calculations.
6474         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6475         Include <stddef.h>, for size_t.
6476         * hash-pjw.c (hash_pjw): Likewise.
6477         Switch to method described by Bruno Haible.
6478         Include <limits.h>, for CHAR_BIT.
6479         (SIZE_BITS): New macro.
6480
6481 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6482
6483         * getndelim2.c (getndelim2): When size calculation overflows,
6484         ceiling the allocation at NMAX bytes rather than silently
6485         discarding input bytes before NMAX is reached.  This makes
6486         a difference only if NMAX exceeds SIZE_MAX / 2.
6487
6488         * obstack.c: Merge from glibc.
6489         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6490         Add libc_hidden_def (_obstack_newchunk).
6491         (_obstack_free) [! defined _LIBC]: Remove.
6492         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6493         a clone of the function body.
6494         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6495         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6496
6497         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6498         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6499         arg to memcpy.
6500
6501         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6502         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6503         Don't use lvalue casts, as GCC plans to remove support for them
6504         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6505         was also present in the non-GCC version, indicating that this
6506         code had always been buggy and had never been widely used.
6507         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6508         Use the fast variant of each macro, rather than copying the
6509         definiens of the fast variant; that way, we'll be more likely to
6510         catch future bugs in the fast variants.
6511
6512 2003-10-20  Bruno Haible  <bruno@clisp.org>
6513
6514         * wait-process.h: New file, from GNU gettext.
6515         * wait-process.c: New file, from GNU gettext.
6516
6517 2003-10-19  Jim Meyering  <jim@meyering.net>
6518
6519         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6520
6521 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6522
6523         * getgroups.c: Include <errno.h>, <stdlib.h>.
6524         (getgroups): First arg is int, not size_t.
6525         Don't let 'free' mangle errno.
6526
6527 2003-10-16  Jim Meyering  <jim@meyering.net>
6528
6529         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6530
6531 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6532
6533         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6534         (SIZE_MAX): Remove.
6535         (new_exclude, add_exclude_file): Initial size no longer needs to
6536         be a power of 2.
6537         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6538         our own address arithmetic overflow checking.
6539
6540         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6541         (fnmatch): Do not alloca more than 2000 wide characters;
6542         instead, use malloc for large buffers.
6543         Check for address arithmetic overflow, and return -1
6544         with errno set to ENOMEM in that case.
6545         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6546         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6547         instead, return -1.  Check for address arithmetic overflow.
6548
6549 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6550
6551         Handle invalid suffixes and overflow independently, so that
6552         callers can treat them independently as needed.  Fix some bugs in
6553         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6554         suffix for a human-readable blocksize.  The major caller-visible
6555         change is the addition of a new
6556         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6557         that both overflow and suffix chars were found.
6558
6559         * human.c (humblock): Don't check separately for invalid suffix
6560         char; that is xstrtoumax's job (now that its bug is fixed).
6561         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6562         INTMAX_MAX]: New macros.
6563         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6564         TYPE_MAXIMUM): New macros.
6565         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6566         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6567         if overflow occurs, as it's what __strtol does and it's more useful
6568         in practice.
6569         (__xstrtol): If __strtol reports some error other than ERANGE,
6570         reflect it to the caller as LONGINT_INVALID.  If it reports
6571         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6572         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6573         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6574         value.
6575         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6576         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6577         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6578         [defined UINTMAX_MAX]: New macros.
6579
6580 2003-10-14  Bruno Haible  <bruno@clisp.org>
6581
6582         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6583         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6584         Also use volatile where needed.
6585
6586 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6587
6588         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6589         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6590         and define in terms of the other primitives.
6591         * xmalloc.c: Include stdbool.h; do not include exit.h.
6592         (SIZE_MAX): Define if not already defined.
6593         (array_size_overflow): New function.
6594         (xalloc_die): Abort instead of exiting if 'error' returns.
6595         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6596         (xmalloc, xrealloc): Use them.
6597         (xcalloc): Check for address arithmetic overflow.
6598         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6599         a bit faster than strcpy.
6600
6601 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6602
6603         Merge getpass from libc, plus a few fixes.
6604
6605         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6606         Include <stdbool.h>.
6607         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6608         __fsetlocking to empty.
6609         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6610         do include <bits/libc-lock.h>.
6611         Do not include <fcntl.h>; not needed.
6612         [_LIBC]: Include <wchar.h>.
6613         (NOTCANCEL_MODE): New macro.
6614         (flockfile, funlockfile) [_LIBC]: New macros.
6615         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6616         [!_LIBC]: New macros.
6617         (call_fclose): New function.
6618         (getpass): Use it.  Save tty stream separately; this simplifies the
6619         code and makes it more reliable if stdin happens to equal stdout.
6620         Invoke __fsetlocking on tty.
6621         Handle thread cancellation if needed.
6622         Namespace cleanup (use __tcgetattr, __getline).
6623         Use bool for Booleans.
6624         [USE_IN_LIBIO]: Handle wide streams.
6625         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6626         stream might go where.
6627
6628         * unlocked-io.h: Include <stdio.h>, so that the caller
6629         doesn't have to include <stdio.h> before us.
6630         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6631         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6632         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6633         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6634         if not declared, so that we can use getpass.c code from libc without
6635         rewriting it.
6636         (flockfile, ftrylockfile, funlockfile): New macros.
6637
6638 2003-10-06  Bruno Haible  <bruno@clisp.org>
6639
6640         * version-etc-2.h: Remove file.
6641         * version-etc-2.c: Remove file.
6642
6643 2003-09-25  Jim Meyering  <jim@meyering.net>
6644             Bruno Haible  <bruno@clisp.org>
6645
6646         This lets translators provide better translations for the
6647         "Written by ..." part of --version output.
6648         * version-etc.h: Include stdarg.h.
6649         (version_etc_copyright): Declare as readonly.
6650         (version_etc): Make this function variadic with a NULL-terminated list
6651         of author name strings.
6652         (version_etc_va): New declaration.
6653         * version-etc.c: Include stdarg.h, stdlib.h.
6654         (version_etc_copyright): Declare as readonly.
6655         (version_etc_va): New function. Provide a different translatable string
6656         for each possible number of authors < 10. Abbreviate when there are 10
6657         authors or more.
6658         (version_etc): Make this function variadic. Call version_etc_va.
6659         Suggestion from Gary V. Vaughan.
6660
6661         * long-options.h (parse_long_options): Change prototype: the authors
6662         string is moved to the end and becomes variadic.
6663         * long-options.c: Include stdarg.h.
6664         (parse_long_options): Make this function variadic, too.
6665         Call version_etc_va, not version_etc.
6666
6667 2003-10-06  Bruno Haible  <bruno@clisp.org>
6668
6669         * fatal-signal.h: New file, from GNU gettext.
6670         * fatal-signal.c: New file, from GNU gettext.
6671
6672 2003-10-04  Karl Berry  <karl@gnu.org>
6673
6674         * argp*: update from libc.
6675
6676 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6677
6678         * getpass.c (getpass): Use a no-op fseek when switching from input to
6679         output mode on the same stream.
6680
6681 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6682
6683         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6684         Fix arg typo in previous patch.
6685
6686 2003-09-28  Jim Meyering  <jim@meyering.net>
6687
6688         * error.c: Correct cpp indentation.
6689
6690 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6691
6692         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6693         Omit the special code that used __typeof__, since we worry that
6694         it could be more trouble than it's worth.  See:
6695         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6696         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6697
6698         * free.c: New file.
6699
6700 2003-09-26  Jim Meyering  <jim@meyering.net>
6701
6702         * error.c (error_tail): Move some declarations
6703         into inner scope where the local variables are used.
6704
6705 2003-09-26  Bruno Haible  <bruno@clisp.org>
6706
6707         * stpncpy.h (gnu_stpncpy): New declaration.
6708         (stpncpy): Define as alias for gnu_stpncpy.
6709         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6710
6711 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6712
6713         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6714         (error_tail): Do not loop, reallocating temporary buffer, since
6715         the output cannot contain more wide characters than the input
6716         contains bytes, the size must be big enough already.  This avoids
6717         one potential size overflow calculation.  Check for size overflow
6718         when calculating temporary buffer size.  Free temporary buffer
6719         when done, if it was allocated with malloc; this plugs a memory
6720         leak.  Remove casts from void * to pointers, that are no longer
6721         needed now that we're assuming C89 or better.
6722
6723         Merge error changes from glibc.
6724
6725         * error.c, error.h: Update copyright notice header to match glibc.
6726         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6727         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6728         Disable cancellation while printing error.
6729         * error.h: Prepend __ to parameter names.
6730
6731 2003-09-25  Karl Berry  <karl@gnu.org>
6732
6733         * argp-fmtstream.c, argp-help.c: update from libc.
6734
6735 2003-09-25  Bruno Haible  <bruno@clisp.org>
6736
6737         * version-etc-2.h: New file, from version-etc.h with modifications.
6738         * version-etc-2.c: New file, from version-etc.c with modifications.
6739
6740 2003-09-25  Simon Josefsson  <jas@extundo.com>
6741
6742         * xgetdomainname.h: New file.
6743         * xgetdomainname.c: New file.
6744
6745 2003-09-25  Simon Josefsson  <jas@extundo.com>
6746             Bruno Haible  <bruno@clisp.org>
6747
6748         * getdomainname.h: New file.
6749         * getdomainname.c: New file.
6750
6751 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6752
6753         * linebuffer.c (freebuffer): Don't free the argument, just
6754         the buffer associated with the argument.  Bug reported by
6755         Simon Josefsson.
6756
6757 2003-09-19  Karl Berry  <karl@gnu.org>
6758
6759         * argp.h: update from libc.
6760
6761 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6762
6763         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6764         input error, instead of returning NULL the next time we are called
6765         (and therefore losing track of errno).
6766
6767 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6768
6769         * getndelim2.c (getndelim2): Don't trash errno when a read
6770         fails, so that the caller gets the proper errno.
6771
6772         * readutmp.c (read_utmp): Likewise.
6773         Check for fstat error.  Close stream and free storage
6774         when failing.
6775
6776 2003-09-14  Bruno Haible  <bruno@clisp.org>
6777
6778         * fwriteerror.h: New file.
6779         * fwriteerror.c: New file.
6780
6781 2003-09-14  Jim Meyering  <jim@meyering.net>
6782
6783         * getloadavg.c: Correct cpp indentation.
6784         * strdup.c: Likewise.
6785         * vasnprintf.c: Likewise.
6786
6787 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6788
6789         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6790         * obstack.c [!defined _LIBC]: Likewise.
6791         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6792         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6793         * exitfail.c: Don't include stdlib.h; no longer needed.
6794
6795         More changes to assume C89 or better.
6796
6797         * error.c (error_tail): Assume vprintf.
6798
6799         * argmatch.c (getenv): Remove decl.
6800         * progreloc.c (get_full_program_name): Define via prototype.
6801         * setenv.c (clearenv): Likewise.
6802         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6803         needed.
6804         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6805         (malloc, memcpy): Remove decls.
6806         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6807         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6808         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6809         (memcpy): Remove macro.
6810         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6811         (__P): Remove.  All uses removed.
6812         (PTR): Remove.  All uses changed to void *.
6813         (CHAR_BIT, NULL): Remove.
6814         (spaces, zeros, memset_space, memset_zero)
6815         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6816         Remove.
6817         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6818         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6819         Define with prototype.
6820         Remove now-unnecessary prototype decl.
6821         (extra_args_spec): Assume ANSI C.  All uses changed.
6822         (extra_args_spec_iso): Remove.
6823         (my_strftime, emacs_strftimeu): Define via prototype.
6824         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6825         unconditionally.
6826         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6827         * strtoimax.c: Include <stdlib.h> unconditionally.
6828         (strtoul, strtol): Remove decls.
6829         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6830         LONG_MAX): Remove.
6831         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6832         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6833         (LOCALE_PARAM_PROTO): New macro.
6834         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6835         (INTERNAL (strtol), strtol): Define with a prototype.
6836         (PARAMS): Remove.  All uses removed.
6837         * tempname.c: Include <string.h> unconditionally.
6838         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6839         * xgethostname.c (main): Define with a prototype.
6840         * xmalloc.c: Include "xalloc.h" first, to check interface.
6841         Include <stdlib.h> unconditionally.
6842         (calloc, malloc, realloc, free): Remove decls.
6843         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6844         Include <stdlib.h> unconditionally.  Sort include file names.
6845         (strtod): Remove.
6846         (xstrtod): Define with a prototype.
6847         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6848         (strtol, strtoul): Remove decls.
6849
6850 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6851
6852         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6853         Include <stdlib.h>, <string.h> unconditionally.
6854         Remove now-unnecessary cast to char *.
6855         * strnlen.c: Include <string.h> unconditionally.
6856         * yesno.c (yesno): Define with a prototype.
6857
6858 2003-09-10  Bruno Haible  <bruno@clisp.org>
6859
6860         * strcspn.c: Include <string.h> unconditionally.
6861         * strpbrk.c: Include <string.h> unconditionally.
6862         * strstr.c: Include <string.h> unconditionally.
6863         * unicodeio.c: Include <string.h> unconditionally.
6864         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6865         * unsetenv.c: Likewise.
6866         * xreadlink.c: Include <stdlib.h> unconditionally.
6867         * yesno.c: Include <stdlib.h> unconditionally.
6868         (rpmatch): Add prototype.
6869
6870 2003-09-10  Jim Meyering  <jim@meyering.net>
6871
6872         * error.c: Correct indentation of cpp directives.
6873
6874 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6875
6876         More K&R removal.
6877
6878         * acosl.c (main): Use a prototype.
6879         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6880         tanl.c: Likewise.
6881
6882         * getloadavg.c (getloadavg, main): Define via prototypes.
6883
6884         * getopt.h (struct option.name): Assume C89, and use 'const'.
6885         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6886         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6887         with a prototype.
6888         * getopt.c (const): Remove macro.
6889         Include <string.h> unconditionally.
6890         (my_index): Remove; all uses changed to strchr.
6891         (strlen): Remove decl.
6892         (exchange): Remove forward decl; no longer needed.
6893         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6894         Define with prototype.
6895         * getopt1.c (const): Remove macro.
6896         (getopt_long, getopt_long_only, main): Define with prototype.
6897
6898         * getugroups.c: Include <string.h> unconditionally.
6899
6900         * getusershell.c: Include <stdlib.h> unconditionally.
6901         (getusershell, setusershell, endusershell, readname, main):
6902         Define with prototypes.
6903
6904         * group-member.c: Include group-member.h first.
6905         Include <stdlib.h> unconditionally.
6906
6907         * hard-locale.c: Include hard-locale.h first.
6908         Include <stdlib.h>, <string.h> unconditionally.
6909
6910         * hash.c (free, malloc): Remove decls.
6911         Include <stdlib.h> unconditionally.
6912
6913         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6914         (getenv): Do not declare.
6915
6916         * idcache.c: Include <string.h> unconditionally.
6917
6918         * long-options.c: Include long-options.h first, to test interface.
6919         Include <stdlib.h> unconditionally.
6920
6921         * makepath.c: Include makepath.h first, to test interface.
6922         Include <stdlib.h> and <string.h> unconditionally.
6923
6924         * linebuffer.c: Include <stdlib.h>.
6925         (free): Remove decl.
6926
6927         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6928         rpl_malloc returns void *, not char *.
6929         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6930
6931         * md5.h: Include <limits.h> unconditionally.
6932         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6933         (__P): Remove; all uses removed.
6934         * md5.c: Include "md5.h" first.
6935         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6936         md5_buffer, md5_process_bytes, md5_process_block):
6937         Define with prototypes.
6938         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6939         * sha.c: Include "sha.h" first.
6940         Include <stdlib.h>, <string.h> unconditionally.
6941
6942         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6943         * memcmp.c (__ptr_t): Likewise.
6944         * memrchr.c (__ptr_t): Likewise.
6945         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6946         Include <string.h> unconditionally.
6947         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6948         * memchr.c: Include <stdlib.h> unconditionally.
6949         * memchr.c (LONG_MAX): Remove.
6950         * memrchr.c (LONG_MAX): Likewise.
6951         * memchr.c (__memchr): Define via a prototype.
6952         * memrchr.c (__memrchr): Likewise.
6953         * memcmp.c (__P): Remove, and remove all uses.
6954         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6955         Remove forward decls; no longer needed.
6956         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6957         Use types required by C89 in prototype.
6958
6959         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6960         * savedir.c: Likewise.
6961         * mkdir.c (free): Remove decl.
6962         * rmdir.c (rmdir): Define with a prototype.
6963         * savedir.c: Include savedir.h first, to test interface.
6964
6965         * mktime.c (STDC_HEADERS): Remove.
6966         Include <stdlib.h>, <string.h> unconditionally.
6967
6968         * modechange.c: Include <stdlib.h> unconditionally.
6969         (malloc): Remove decl.
6970
6971         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6972         (free): Remove decl.
6973
6974         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6975         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6976         (This type really should be intptr_t, but that's a C99ism.)
6977         (_obstack_memcpy): Remove: all uses changed to memcpy.
6978         Include <string.h> unconditionally.
6979         (struct obstack): Assume __STDC__ for types of members
6980         chunkfun, freefun, extra_arg.
6981         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6982         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6983         obstack_begin, obstack_specify_allocation,
6984         obstack_specify_allocation_with_arg, obstack_chunkfun,
6985         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6986         Remove unprototyped decls and the macros that use them.
6987         * obstack.c (POINTER): Remove.  All uses changed to void *.
6988         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6989         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6990         (defined __STDC__ && __STDC__)]:
6991         Remove nonprototyped code.
6992         Include <stdlib.h> unconditionally.
6993         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6994         _obstack_allocated_p, _obstack_free, obstack_free,
6995         _obstack_memory_used, print_and_abort):
6996         Define using prototypes.
6997         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6998         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6999         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7000         obstack_next_free, obstack_object_size, obstack_room) [0]:
7001         Remove unused, unprototyped code.
7002
7003         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7004
7005         * physmem.c (physmem_total, physmem_available, main): Define
7006         with prototypes.
7007
7008         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7009         (main): Define with a prototype.
7010
7011         * posixver.c (getenv): Remove decl.
7012
7013         * putenv.c (malloc): Returns void *, not char *.
7014         Include <string.h> unconditionally.
7015         (strchr, memcpy, NULL): Do not define.
7016
7017         * readtokens.c: Include readtokens.h first, to test interface.
7018         Include <stdlib.h>, <string.h> unconditionally.
7019         (init_tokenbuffer): Define with a prototype.
7020
7021         * regex.c (PARAMS): Remove.  All uses removed.
7022         All uses of _RE_ARGS removed, too.
7023         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7024         unconditionally.
7025         (bzero): Assume memset exists.
7026         (memcmp, memcpy, NULL): Remove.
7027         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7028         char, or assignments to local vars of type signed char.
7029         (init_syntax_once, PREFIX(extract_number_and_incr),
7030         PREFIX(print_partial_compiled_pattern),
7031         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7032         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7033         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7034         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7035         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7036         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7037         wcs_compile_range, byte_compile_range, truncate_wchar,
7038         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7039         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7040         count_mbs_length, wcs_re_match_2_internal,
7041         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7042         PREFIX(alt_match_null_string_p),
7043         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7044         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7045         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7046         now-unnecessary declaration, if any.
7047         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7048         regcomp, regexec):
7049         Remove now-unnecessary casts among pointer types.
7050         * regex.h (_RE_ARGS): Remove.  All uses removed.
7051
7052         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7053         (free): Remove decl.
7054
7055         * rpmatch.c: Include <stdlib.h> unconditionally.
7056
7057         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7058         (free): Remove decl.
7059
7060         * save-cwd.c: Include <stdlib.h> unconditionally.
7061         * xgetcwd.c: Likewise.
7062
7063         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7064         (free): Remove decl.
7065
7066         * strchrnul.c (strchrnul): Define with a prototype.
7067         Fix bug: c_in was not converted to char before searching.
7068
7069         The following changes are not K&R related:
7070
7071         * group-member.h: Include <sys/types.h>, so that this file is
7072         self-contained.
7073         * makepath.h: Likewise.
7074
7075         * getusershell.c (readname, default_index, line_size, readname):
7076         Use size_t, not int, for sizes.
7077         (readname): If the size overflows, report an error instead of
7078         looping forever.
7079
7080 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7081
7082         * getndelim2.c: Assume stdlib.h per the C89 spec.
7083
7084 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7085
7086         Assume C89 or better; remove K&R cruft.
7087         A few of these changes were first proposed by Derek Robert Price
7088         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7089
7090         * addext.c: Include <string.h> unconditionally.
7091         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7092         Don't declare getenv or malloc.
7093
7094         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7095         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7096         (NULL): Remove.
7097         (find_stack_direction, alloca): Use prototypes.
7098
7099         * atexit.c (atexit): Define using a prototype.
7100
7101         * basename.c, dirname.c, stripslash.c:
7102         Include <string.h> unconditionally.
7103
7104         * bcopy.c: Include <stddef.h>.
7105         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7106
7107         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7108
7109         * error.h (error, error_at_line, error_print_progname)
7110         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7111         * error.c: Include error.h first, to check interface.
7112         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7113         (VA_START): Remove; all uses changeed to va_start.
7114         (exit, strerror): Remove decls.
7115         (error_print_progname): Prototype uncondionally.
7116         Don't include <errno.h>; no longer needed.
7117         (private_strerror): Remove.
7118         (error_tail): Always define.
7119         (error, error_at_line): Assume C89 or better; always use prototypes.
7120         * fatal.c: Include "fatal.h" first, to test interface.
7121         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7122         (VA_START): Remove; all uses changed to va_start.
7123         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7124         this case.
7125         (exit): Remove decl.
7126         (fatal): Prototype unconditionally.  Assume va_start works.
7127         Abort at end, to pacify gcc.
7128
7129         * euidaccess.c (main): Define with a prototype.
7130
7131         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7132
7133         * exitfail.c: Include <stdlib.h> unconditionally.
7134
7135         * fnmatch_.h (__P): Remove.  All uses changed to assume
7136         prototypes.
7137         * fnmatch.c: Include fnmatch.h first, to test interface.
7138         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7139         (getenv): Remove decl.
7140         (fnmatch): Define using a prototype.
7141         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7142         (FCT): Define using a prototype.
7143
7144         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7145
7146         * gethostname.c: Include <stddef.h>.
7147         (gethostname): Define with prototype.  Length is size_t, not int.
7148
7149 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7150
7151         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7152         getversion.c should have been removed then, but was accidentally
7153         preserved.
7154
7155         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7156         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7157
7158 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7159
7160         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7161         copy_tm_result.  Bug reported by Simon Josefsson in
7162         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7163
7164 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7165
7166         * time_r.c, time_r.h: New files.
7167
7168         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7169         __localtime_r.
7170         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7171         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7172
7173         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7174         __gmtime_r.
7175         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7176         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7177         Include <time_r.h>.
7178
7179         * timegm.c: Switch to glibc implementation, with the following changes:
7180         [defined HAVE_CONFIG_H]: Include <config.h>.
7181         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7182         (__mktime_internal) [!defined _LIBC]: New decl.
7183         (__gmtime_r) [!defined _LIBC]: New macro and function.
7184         (timegm): Use a prototype, since gnulib assumes C89.
7185         Do not bother declaring tmp to be const, as it's not really usefu.
7186         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7187         (timegm): Declare only if HAVE_DECL_TIMEGM.
7188
7189 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7190
7191         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7192         Bug reported by Lute Kamstra in
7193         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7194
7195         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7196         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7197         course with correspondingly smaller numbers for tomorrow and
7198         yesterday.  From Tadayoshi Funaba.  Originally installed into
7199         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7200         coreutils merge?).
7201
7202 2003-08-31  Simon Josefsson  <jas@extundo.com>
7203
7204         * timegm.h: New file.
7205         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7206
7207 2003-08-31  Karl Berry  <karl@gnu.org>
7208
7209         * argp.h: update from libc.
7210
7211 2003-08-28  Bruno Haible  <bruno@clisp.org>
7212
7213         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7214         warning on QNX, which defines O_BINARY to 000000.
7215
7216 2003-08-24  Bruno Haible  <bruno@clisp.org>
7217
7218         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7219         MSVC7 <stdio.h> is included later.
7220
7221 2003-08-20  Bruno Haible  <bruno@clisp.org>
7222
7223         * progname.h: New file, from GNU gettext.
7224         * progname.c: New file, from GNU gettext.
7225         * progreloc.c: New file, from GNU gettext.
7226
7227 2003-08-19  Bruno Haible  <bruno@clisp.org>
7228
7229         * xstrdup.c: Assume <string.h> exists.
7230
7231 2003-08-18  Jim Meyering  <jim@meyering.net>
7232
7233         * setenv.h: Indent nested cpp directive.
7234         * vasnprintf.c: Remove trailing blanks.
7235
7236 2003-08-17  Simon Josefsson  <jas@extundo.com>
7237             Bruno Haible  <bruno@clisp.org>
7238
7239         * xstrndup.h: New file.
7240         * xstrndup.c: New file.
7241
7242 2003-08-17  Bruno Haible  <bruno@clisp.org>
7243
7244         * strndup.h: New file.
7245
7246 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7247
7248         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7249         space, undoing this 2003-08-12 change:
7250         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7251
7252 2003-08-16  Jim Meyering  <jim@meyering.net>
7253
7254         Merge from coreutils.
7255         * xstrtoimax.c: #else #if -> #elif.
7256         * xstrtoumax.c: Likewise.
7257
7258 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7259
7260         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7261         rather than tab, after '#' in shell-script copyright notices.
7262         Suggested by Bruno Haible.
7263
7264 2003-08-15  Jim Meyering  <jim@meyering.net>
7265         and Paul Eggert  <eggert@twinsun.com>
7266
7267         Merge from coreutils.
7268         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7269         member but strut utmpx does not.  Needed for AIX 4.3.3.
7270         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7271
7272 2003-08-15  Jim Meyering  <jim@meyering.net>
7273
7274         Merge from coreutils.
7275         * xgethostname.c: Include <stdlib.h>.
7276         (xghostname): Don't exit for anything other than memory-related
7277         failure; just return NULL.
7278         * userspec.c: Include "posixver.h".
7279         (parse_user_spec): Accept `.' as a separator only
7280         in pre-POSIX-200112 mode.
7281         * strtoimax.c: Use #elif rather than #else #if.
7282         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7283         Remove function, now that we can rely on a working tzset function.
7284         [!_LIBC]: Ensure that the required autoconf test has been run.
7285         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7286         Use underlying_strftime for %r.
7287         * sha.c: Merge in some clean-up and optimization changes from glibc.
7288         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7289         Ensure that it is a multiple of 64.
7290         Rearrange loop exit tests so as to avoid performing an
7291         additional fread after encountering an error or EOF.
7292         * realloc.c: Update copyright date.
7293
7294 2003-08-14  Jim Meyering  <jim@meyering.net>
7295
7296         Merge from coreutils.
7297         * obstack.h: Whitespace changes.
7298         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7299         and xcalloc return values.
7300         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7301         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7302         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7303         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7304         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7305         error from mntctl.
7306         Use mntctl's return value to drive the entry-processing loop, since
7307         we can't rely on the value of the vmt_length member in the last
7308         entry.  On some systems doing so could result in exhausting
7309         virtual memory.  Based in part on a patch from Mike Jetzer.
7310
7311 2003-08-14  Jim Meyering  <jim@meyering.net>
7312         and Paul Eggert  <eggert@twinsun.com>
7313
7314         Merges from coreutils, plus other fixes.
7315         * physmem.c: Merge in portability changes from gcc/libiberty
7316         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7317         for credits and details.  Thanks to Kaveh Ghazi for helping
7318         to keep these files in sync.
7319         (ARRAY_SIZE): Define it.
7320         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7321         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7322         (memcasecmp): Don't assume size_t fits in unsigned int.
7323         Remove casts and duplicate code.
7324         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7325         (memcpy): Remove definition.
7326         Merge in some clean-up and optimization changes from glibc.
7327         [BLOCKSIZE]: Move definition to top of file.
7328         Ensure that it is a multiple of 64.
7329         Rearrange loop exit tests so as to avoid performing an
7330         additional fread after encountering an error or EOF.
7331         * md5.h (md5_uintptr): Define.
7332         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7333         return to the initial working directory.  Preserve errno
7334         for caller.
7335         * idcache.c: Include "xalloc.h".
7336         (xmalloc, xrealloc): Remove decls.
7337         (getuser): Remove casts no longer required in C89.
7338         * human.c: Include stdio.h, for sprintf.
7339         * group-member.c: Include "xalloc.h".
7340         (xmalloc, xrealloc): Remove decls.
7341         (get_group_info): Remove casts no longer required in C89.
7342         * getusershell.c (readname): Remove casts no longer required in C89.
7343         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7344         * getline.c: Whitespace fix, from coreutils.
7345
7346 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7347
7348         * exclude.c: Include <ctype.h>
7349         (IN_CTYPE_DOMAIN): New macro.
7350         (is_space): New fn.
7351         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7352         and empty lines.
7353
7354         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7355         Undo previous (whitespace-only) change.
7356
7357 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7358
7359         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7360         Normalize leading white space and remove trailing white space.
7361         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7362         notice, as per ../config/srclist-update.
7363
7364         Merge from coreutils.
7365         * euidaccess.h: New file.
7366         * euidaccess.c: Include it.
7367         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7368         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7369         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7370
7371 2003-08-11  Bruno Haible  <bruno@clisp.org>
7372
7373         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7374         (vasnprintf): Use it instead of wcslen.
7375
7376 2003-08-11  Bruno Haible  <bruno@clisp.org>
7377
7378         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7379         value to ensure that _Bool promotes to int. Use #define for _Bool when
7380         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7381
7382 2003-08-10  Karl Berry  <karl@gnu.org>
7383
7384         * regex.h: update from libc (whitespace fix).
7385
7386 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7387
7388         Merge some files from coreutils.  These changes were
7389         originally made by Jim Meyering.
7390         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7391         many older Unixes require this.
7392         * alloca.c (alloca): Remove cast to argument of free;
7393         no longer needed in C89.
7394         * alloca_.h, regex.h: Fix white space to match
7395         what GNU indent does.
7396
7397 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7398
7399         * bumpalloc.h: Remove.
7400
7401 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7402
7403         * getloadavg.c: Change copyright notice and spacing to conform to
7404         GNU coding style.
7405
7406         Merge from coreutils.
7407         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7408         From glibc.
7409         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7410         from Karl Berry, implemented by Jim Meyering.
7411         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7412         from Dmitry V. Levin.
7413         Remove anachronistic cast of xrealloc.
7414         * fnmatch_.h (__const): Remove.  Use 'const'.
7415         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7416         type. Otherwise, it wouldn't compile with at least /bin/cc on
7417         ymp-cray-unicos9.0.2.X.
7418         Combine two mostly-identical uses of alloca into one.
7419         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7420
7421 2003-08-04  Dave Love <d.love@dl.ac.uk>
7422
7423         [From Emacs.]
7424
7425         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7426         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7427         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7428         obsolete NLIST_NAME_UNION.
7429         [__GNU__]: Undef BSD and FSCALE.
7430         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7431
7432 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7433
7434         * stdbool_.h (_Bool): Make it signed char, instead of
7435         an enum type, so that it's guaranteed to promote to int.  See:
7436         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7437
7438 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7439
7440         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7441         (strerror): Don't assume that a printable int fits in 14 bytes.
7442
7443 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7444             Bruno Haible  <bruno@clisp.org>
7445
7446         * getline.h (getline, getdelim): Change return type to ssize_t.
7447         * getline.c (getline, getdelim): Likewise.
7448         Remove _GNU_SOURCE define; now it's defined in config.h through
7449         m4/getline.m4.
7450
7451 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7452
7453         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7454         over-parenthesization in macros.
7455
7456         Sync with coreutils.
7457
7458         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7459         required by C99.
7460
7461         Use `exit_failure' for xalloc and xmemcoll instead of their own
7462         private exit-failure variables.
7463         * xalloc.h (xalloc_exit_failure): Remove.
7464         * xmalloc.c: Likewise.  Include exitfail.h.
7465         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7466         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7467         * xmemcoll.c: Likewise.  Include exitfail.h.
7468         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7469
7470 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7471
7472         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7473         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7474         to test that it can stand by itself.  Include "exitfail.h".
7475         Clients should set exit_failure instead.
7476         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7477
7478 2003-07-18  Andreas Schwab  <schwab@suse.de>
7479
7480         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7481
7482 2003-07-18  Bruno Haible  <bruno@clisp.org>
7483
7484         * getndelim2.h: New file.
7485         * getndelim2.c: Make into a module of its own. Include config.h,
7486         getndelim2.h.
7487         (getndelim2): Make non-static. Change return type to ssize_t.
7488         * getline.h: Change argument names.
7489         * getline.c: Include getndelim2.h instead of getndelim2.c.
7490         * getnline.c: Include getndelim2.h.
7491
7492 2003-07-17  Bruno Haible  <bruno@clisp.org>
7493
7494         * Makefile.am: Remove file.
7495         * Makefile.in: Remove file.
7496
7497 2003-07-17  Bruno Haible  <bruno@clisp.org>
7498
7499         * getnline.h: New file.
7500         * getnline.c: New file.
7501         * getndelim2.c: New file, extracted from getline.c.
7502         (getndelim2): Renamed from getdelim2, with added nmax argument.
7503         * getline.c: Include getndelim2.c.
7504         (getdelim2): Moved out to getndelim2.c.
7505         (getline, getdelim): Update.
7506
7507 2003-07-15    <karl@gnu.org>
7508
7509         * vasnprintf.c: update from gettext.
7510
7511 2003-07-15  Jim Meyering  <jim@meyering.net>
7512
7513         * makepath.c (make_path): Enclose diagnostic in _(...).
7514
7515 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7516
7517         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7518         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7519         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7520         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7521         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7522         updated automatically by ../config/srclist-update.  This changes
7523         their license from LPGL to GPL.
7524
7525 2003-07-14  Jim Meyering  <jim@meyering.net>
7526
7527         Don't emit diagnostics.  Let callers do that.
7528         * save-cwd.c: Don't include "error.h".
7529         (save_cwd): Don't call error.  Ensure that errno is valid
7530         when returning nonzero.
7531
7532         * save-cwd.h (restore_cwd): Update prototype.
7533         * save-cwd.c (restore_cwd): Remove two parameters.
7534         Simplify.  Don't call error upon failure.  Let callers do that.
7535         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7536         when auditing is enabled.  But don't bother updating the #if.
7537
7538 2003-07-14  Simon Josefsson  <jas@extundo.com>
7539
7540         * mempcpy.h: New file.
7541         * mempcpy.c: New file.
7542
7543 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7544
7545         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7546         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7547         unicodeio.c, unicodeio.h, unlocked-io.h:
7548         Switch from LGPL to GPL.
7549
7550 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7551
7552         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7553         it breaks C++ compilation.
7554         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7555
7556 2003-07-10  Jim Meyering  <jim@meyering.net>
7557
7558         * vasnprintf.c: Remove trailing blanks.
7559         Make cpp indentation consistent.
7560
7561 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7562
7563         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7564         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7565         Switch from LGPL to GPL.
7566
7567 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7568
7569         * mktime.c: Fix some boundary cases and remove need for floating point.
7570
7571         Issue a compile-time diagnostic if time_t is floating point, or if
7572         two's complement arithmetic is not in effect, or if arithmetic
7573         right shift does not propagate the sign.  These assumptions were
7574         all in the original code but they weren't checked.
7575
7576         (TIME_T_MIDPOINT, verify): New macros.
7577         (__isleap): Remove; it has integer overflow problems.
7578         (leapyear): New function, without those problems.
7579         (ydhms_tm_diff): Remove; splitting into two parts.
7580         (ydhms_diff): New function, containing the arithmetic part of
7581         the old ydhms_tm_diff function.  Issue a compile-time
7582         diagnostic if we are not using C99 integer division.
7583         Avoid casts when possible.
7584         (guess_time_tm): New function, containing the checking part of
7585         the old ydhms_tm_diff function.  Return the new value, rather than
7586         the difference between it and the old.  Accept a new argument T
7587         so that *T specifies the old value.  Check for overflow in the result.
7588
7589         (__mktime_internal): Use a time_t offset, not a long int offset.
7590         This undoes the 2003-06-04 change, which is no longer needed now
7591         that we have better overflow checking.
7592         (localtime_offset): Likewise.
7593
7594         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7595         and long are 64-bit but int is only 32-bit.
7596         (ydhms_diff): Use long int to store year1 and yday1.
7597         Issue a compile-time diagnostic if long int is not wide enough.
7598
7599         (__mktime_internal): Use long int to store adjusted year and yday.
7600         Use plain C rather than preprocessor commands, if that doesn't
7601         affect efficiency.
7602         Check for overflow (and try to repair) after each probe
7603         rather than checking only at the very end.  This avoids some bugs
7604         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7605         does not equal GMT offset at maximum time).
7606         Use integer to check for overflow rather than floating point; this
7607         is more portable to non-IEEE hosts, and is a tad faster.
7608         When we detect that we are oscillating between two values,
7609         don't check whether tm_isdst has the requested value, since
7610         we already know the answer.  When tm_isdst has the wrong value,
7611         use a different heuristic to find the right one, based on the
7612         extreme values actually observed in practice in tz2003a,
7613         rather than the (overly optimistic) "previous 3 calendar quarters".
7614
7615         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7616         "T const" to accommodate glibc style.
7617         (check_result): Use less-confusing report format.  "long" -> "long int.
7618         (main): Likewise.
7619         Don't loop if the iteration overflows time_t.
7620         Allow a negative step in the iteration.
7621
7622 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7623
7624         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7625         having it depend on HAVE_SYS_TYPES_H.
7626
7627 2003-06-25  Bruno Haible  <bruno@clisp.org>
7628
7629         * readlink.c: New file.
7630
7631 2003-06-20  Bruno Haible  <bruno@clisp.org>
7632
7633         Assume C89, so PARAMS isn't needed.
7634         * unicodeio.h (PARAMS): Remove.
7635         * unicodeio.c: Don't use PARAMS.
7636
7637 2003-06-18  Jim Meyering  <jim@meyering.net>
7638
7639         Merge changes from coreutils.
7640         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7641         Remove explicit declarations of xmalloc and realloc.
7642         Include xalloc.h.
7643         (read_utmp): Remove anachronistic cast of xmalloc.
7644
7645 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7646
7647         Assume C89, so PARAMS isn't needed.
7648         * backupfile.h (PARAMS): Remove.  All uses removed.
7649         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7650         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7651         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7652         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7653         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7654         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7655         xstrtol.h: Likewise.
7656         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7657         same.h, strverscmp.h: Do not include config.h; no longer needed.
7658         Anyway, config.h should always be included before any other file.
7659
7660 2003-06-11  Simon Josefsson  <jas@extundo.com>
7661
7662         * sysexit_.h: New file.
7663
7664 2003-05-20  Derek Price  <derek@ximbiot.com>
7665
7666         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7667
7668 2003-06-10  Simon Josefsson  <jas@extundo.com>
7669
7670         * strchrnul.h: New file.
7671         * strchrnul.c: New file.
7672
7673 2003-06-10  Simon Josefsson <jas@extundo.com>
7674
7675         * argp.h: New file, from glibc.
7676         * argp-ba.c: New file, from glibc.
7677         * argp-eexst.c: New file, from glibc.
7678         * argp-fmtstream.c: New file, from glibc.
7679         * argp-fmtstream.h: New file, from glibc.
7680         * argp-fs-xinl.c: New file, from glibc.
7681         * argp-help.c: New file, from glibc.
7682         * argp-namefrob.h: New file, from glibc.
7683         * argp-parse.c: New file, from glibc.
7684         * argp-pv.c: New file, from glibc.
7685         * argp-pvh.c: New file, from glibc.
7686         * argp-xinl.c: New file, from glibc.
7687
7688 2003-06-07  Jim Meyering  <jim@meyering.net>
7689
7690         * readtokens.h: Put `Free Software Foundation, Inc.'
7691         in place of my name in the copyright comment.
7692         Remove definition and uses of __P.
7693
7694         From coreutils.
7695         * stat.c: Don't declare xmalloc explicitly.
7696         Instead, include "xalloc.h".
7697         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7698         xrealloc, and xcalloc return values.
7699         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7700         Improve comment.
7701         * xgetcwd.h: Remove definition/uses of PARAMS.
7702
7703 2003-06-06  Jim Meyering  <jim@meyering.net>
7704
7705         * stdbool_.h: Renamed from stdbool.h.in.
7706
7707 2003-06-06  Jim Meyering  <jim@meyering.net>
7708
7709         Merge from coreutils.
7710         * same.c: (same_name): Declare *_basename locals to be `const'.
7711         Consolidate declarations and initializations of *_base* locals.
7712
7713         Merge from coreutils.
7714         This avoids a core dump on systems without GNU putenv,
7715         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7716         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7717         (unsetenv): New static function, from GNU libc.
7718         (rpl_putenv): Use it.
7719
7720         * modechange.c: Remove trailing blanks.
7721
7722         Merge from coreutils.
7723         * fsusage.c: Remove declaration of statfs.
7724         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7725
7726         * posixtm.c: Include <stdbool.h> unconditionally.
7727
7728 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7729
7730         * mktime.c (__mktime_internal): When resolving a tm_isdst
7731         mismatch, look in future quarters as well as past.  This fixes a
7732         bug when processing fall-backwards gaps immediately after a long
7733         period of daylight-saving time.
7734
7735         * mktime.c: Assume freestanding C89 or better.
7736         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7737         (__P): Remove; not used.
7738         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7739         (mktime, not_equal_tm, print_tm, check_result,
7740         main): Use prototypes.  Use const * where appropriate.
7741         (main): Fix typo in testing code that uncovered by above changes.
7742         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7743
7744 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7745
7746         * mktime.c: Fix Debian bug 177940
7747         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7748         (localtime_offset): Now long int, not time_t, because we want it
7749         to be guaranteed to be signed.  All uses changed.
7750         (__mktime_internal): If overflow would occur when adding offset,
7751         don't add it.
7752
7753         Merge 'human' changes from coreutils.  Rewrite to support
7754         locale-specific notations like thousands separators.
7755         * human.c: Simplify authorship notice.
7756         Include human.h immediately after config.h.
7757         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7758         <limits.h>: Do not include, since human.h does.
7759         (SIZE_MAX, UINTMAX_MAX): New macros.
7760         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7761         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7762         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7763         (power_letter): Renamed from suffixes.
7764         (generate_suffix_backwards): Remove.
7765         (adjust_value): Now takes int style (because of human.h changes)
7766         and long double value (for greater precision on some platforms).
7767         (group_number): New function.
7768         (human_readable): Use it.  Use integer options, not enum.
7769         Put the options before the sizes in the arg list.
7770         Support all the new options.
7771         The old human_readable function has been removed;
7772         use inttostr.h instead.
7773         (human_readable, default_block_size, humblock):
7774         Use uintmax_t, not int, for block sizes.
7775         (human_readable_inexact, block_size_types): Remove.
7776         (block_size_opts): New constant.
7777         (human_options): Renamed from human_block_size, with new signature
7778         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7779         * human.h: Add copyright and authorship notice.
7780         Include <limits.h> and <stdbool.h> unconditionally.
7781         (PARAMS): Remove.  All uses removed.
7782         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7783         (enum human_inexact_style): Remove tag; now a nameless enum.
7784         (human_floor, human_ceiling, human_round_to_even): Now have
7785         values 2, 0, 1 rather than -1, 1, 0.
7786         (human_group_digits, human_suppress_point_zero, human_autoscale,
7787         human_base_1024, human_SI, human_B): New constants.
7788         (human_readable_inexact, human_block_size): Remove.
7789         (human_readable): Size args are now uintmax_t, not int.
7790         (human_options): New decl.
7791
7792         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7793         unnecessary now that we assume C89 or better.  This change
7794         imported from coreutils.
7795
7796         * mktime.c (__mktime_internal): Do not reject negative timestamps
7797         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7798         in the 2003-05-30 sync from glibc.
7799
7800         .h files should stand alone, but we shouldn't include <sys/types.h>
7801         if we can get away with just <stddef.h>.
7802
7803         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7804         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7805         rather than <sys/types.h>, as we merely need size_t.
7806         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7807         to get size_t.
7808         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7809         Include <stdio.h>, to get FILE.
7810         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7811         memcasecmp.h has included <stddef.h> and all we need is size_t.
7812         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7813         our interface, instead of including <sys/types.h>
7814
7815 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7816
7817         [from coreutils]
7818         Fix some minor time-related bugs with POSIX time arguments.
7819         Some valid time stamps were being rejected (notably -1, and
7820         time stamps before 1900 on 64-bit hosts).  And some invalid
7821         time stamps were being accepted, e.g. September 31.
7822
7823         * posixtm.h (posixtime): Return bool instead of time_t, so
7824         that we can return (time_t) -1 successfully.
7825         * posixtm.c: Likewise.
7826         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7827         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7828         (t): Remove static var.
7829         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7830         of static var.  All uses changed.
7831         (year): Do not reject years before 1900; they can occur with
7832         64-bit time_t.
7833         (posix_time_parse): Do not check for out-of-range components;
7834         that is now the caller's responsibility, since our checks were
7835         only approximations.
7836         (posixtime): Use mktime to check for out-of-range components,
7837         since it knows them exactly.
7838         If mktime returns (time_t) -1, check whether an error actually occurred
7839         by invoking localtime on -1.
7840         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7841         posixtime failures better.
7842         Improve the test data (in comments only).
7843
7844 2003-05-30    <karl@gnu.org>
7845
7846         * mktime.c: update from libc.
7847
7848 2003-05-30  Bruno Haible  <bruno@clisp.org>
7849
7850         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7851         * localcharset.h: Likewise.
7852         * localcharset.c: Likewise.
7853
7854 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7855
7856         Assume the headers required for C89 freestanding compilers.
7857         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7858         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7859         without checking for HAVE_LIMITS_H.
7860         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7861         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7862         to do that.
7863         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7864         * exclude.c: Include <stdbool.h> unconditionally.
7865         * tempname.c: Include <stddef.h> unconditionally.
7866         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7867         * modechange.c, rpmatch.c (NULL): Don't define, since
7868         <stddef.h> does that.
7869         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7870         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7871         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7872         * xstrtol.c: Likewise.
7873         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7874         * savedir.c: Include <stddef.h> instead of defining NULL.
7875
7876         * addext.c (addext): Use assignment rather than cast, to avoid
7877         warnings on some platforms.
7878
7879         * mktime.c (__mktime_internal): Do not reject negative timestamps
7880         arbitrarily.
7881
7882 2003-05-10  Bruno Haible  <bruno@clisp.org>
7883
7884         * linebreak.c (iconv_string_length): Don't return -1 just because the
7885         string is longer than 4 KB.
7886
7887 2003-05-12  Jim Meyering  <jim@meyering.net>
7888
7889         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7890         the space-padded-by-default conversion specifiers, %e, %k, %l.
7891
7892 2003-05-03  Bruno Haible  <bruno@clisp.org>
7893
7894         Upgrade to Unicode-4.0.
7895         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7896         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7897         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7898         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7899         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7900         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7901         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7902         Change width of U+E0100..U+E01EF from 1 to 0.
7903
7904 2003-04-25  Bruno Haible  <bruno@clisp.org>
7905
7906         * copy-file.c: Include <stddef.h>, for size_t.
7907
7908 2003-04-25  Jim Meyering  <jim@meyering.net>
7909
7910         * copy-file.c (copy_file_preserving): Declare buf_size to be
7911         of type size_t, not int.
7912
7913 2003-04-11  Jim Meyering  <jim@meyering.net>
7914
7915         Merge changes from Coreutils.
7916
7917         2003-03-22  Jim Meyering  <jim@meyering.net>
7918
7919         * strftime.c (widen): Cast alloca return value to proper type.
7920
7921         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7922
7923         From GNU libc.
7924         * strftime.c (my_strftime): Handle very large width
7925         specifications for numeric values correctly.  Improve checks for
7926         overflow.
7927
7928         2003-01-19  Jim Meyering  <jim@meyering.net>
7929
7930         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7931         (nl_get_alt_digit) [! defined my_strftime]: Define.
7932         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7933         _nl_get_alt_digit and _nl_get_walt_digit.
7934
7935         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7936         These changes have no effect outside of _LIBC.
7937
7938 2003-04-10  Bruno Haible  <bruno@clisp.org>
7939
7940         * findprog.h: New file, from GNU gettext.
7941         * findprog.c: New file, from GNU gettext.
7942
7943 2003-04-05  Jim Meyering  <jim@meyering.net>
7944
7945         Merge changes from Coreutils.
7946
7947         * exclude.h (PARAMS): Remove definition and uses.
7948         * exclude.c: Remove uses of `PARAMS'.
7949
7950         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7951         Add test-cases for DOS filenames. Declare program_name.
7952         (main): Set up program_name.  Patch by Rich Dawe.
7953
7954         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7955         error from mntctl.
7956         Use mntctl's return value to drive the entry-processing loop, since
7957         we can't rely on the value of the vmt_length member in the last
7958         entry.  On some systems doing so could result in exhausting
7959         virtual memory.  Based in part on a patch from Mike Jetzer.
7960
7961 2003-04-04  Bruno Haible  <bruno@clisp.org>
7962
7963         * linebreak.h: New file, from GNU gettext.
7964         * linebreak.c: New file, from GNU gettext with slight modifications.
7965         * lbrkprop.h: New file, from GNU gettext.
7966
7967 2003-04-03  Bruno Haible  <bruno@clisp.org>
7968
7969         * utf8-ucs4.h: New file, from GNU gettext.
7970         * utf16-ucs4.h: New file, from GNU gettext.
7971         * ucs4-utf8.h: New file, from GNU gettext.
7972         * ucs4-utf16.h: New file, from GNU gettext.
7973
7974 2003-04-02  Bruno Haible  <bruno@clisp.org>
7975
7976         * binary-io.h: New file, from GNU gettext.
7977
7978 2003-04-01  Bruno Haible  <bruno@clisp.org>
7979
7980         * pathname.h: New file, from GNU gettext.
7981         * concatpath.c: New file, from GNU gettext.
7982
7983 2003-03-30  Bruno Haible  <bruno@clisp.org>
7984
7985         * copy-file.c (copy_file_preserving): Don't set owner if the function
7986         chown() doesn't exist.
7987
7988 2003-03-28  Bruno Haible  <bruno@clisp.org>
7989
7990         * copy-file.h: New file, from GNU gettext.
7991         * copy-file.c: New file, from GNU gettext.
7992
7993 2003-03-18  Jim Meyering  <jim@meyering.net>
7994
7995         * quote.c (quote_n): Fix typo in comment.
7996
7997 2003-03-14  Jim Meyering  <jim@meyering.net>
7998
7999         Merge changes from Coreutils.
8000         * obstack.h (obstack_object_size): Declare temporary, __o,
8001         to be const, in order to avoid warnings.
8002         (obstack_room): Likewise.
8003         (obstack_empty_p): Likewise.
8004
8005 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8006
8007         Merge changes from Bison.
8008         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8009         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8010         when compiling Bison 1.875's `bitset bset = obstack_alloc
8011         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8012         * hash.c: Include <stdbool.h> unconditionally.
8013
8014 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8015
8016         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8017         Reported by Bruce Becker; see:
8018         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8019
8020 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8021             Bruno Haible  <bruno@clisp.org>
8022
8023         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8024         Reported by John Hughes, see
8025         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8026
8027 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8028
8029         * poll_.h: New file.
8030         * poll.c: New file.
8031
8032 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8033
8034         * mathl.h: New file.
8035         * acosl.c: New file.
8036         * asinl.c: New file.
8037         * atanl.c: New file.
8038         * ceill.c: New file.
8039         * cosl.c: New file.
8040         * expl.c: New file.
8041         * floorl.c: New file.
8042         * frexpl.c: New file.
8043         * ldexpl.c: New file.
8044         * logl.c: New file.
8045         * sincosl.c: New file.
8046         * sinl.c: New file.
8047         * sqrtl.c: New file.
8048         * tanl.c: New file.
8049         * trigl.c: New file.
8050         * trigl.h: New file.
8051
8052 2003-02-17  Bruno Haible  <bruno@clisp.org>
8053
8054         * mkdtemp.h: New file, from GNU gettext.
8055         * mkdtemp.c: New file, from GNU gettext.
8056
8057 2003-01-31  Bruno Haible  <bruno@clisp.org>
8058
8059         * rename.c: #undef rename before defining rpl_rename.
8060         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8061
8062 2003-01-30  Bruno Haible  <bruno@clisp.org>
8063
8064         * printf-args.h: New file, from GNU gettext.
8065         * printf-args.c: New file, from GNU gettext.
8066         * printf-parse.h: New file, from GNU gettext.
8067         * printf-parse.c: New file, from GNU gettext.
8068         * vasnprintf.h: New file, from GNU gettext.
8069         * vasnprintf.c: New file, from GNU gettext.
8070         * asnprintf.c: New file, from GNU gettext.
8071         * vasprintf.h: New file, from GNU gettext with modifications.
8072         * vasprintf.c: New file, from GNU gettext.
8073         * asprintf.c: New file, from GNU gettext.
8074
8075 2003-01-29  Bruno Haible  <bruno@clisp.org>
8076
8077         * stpncpy.h: New file, from GNU gettext with modifications.
8078         * stpncpy.c: New file, from GNU gettext with modifications.
8079
8080 2003-01-28  Bruno Haible  <bruno@clisp.org>
8081
8082         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8083         Paul Eggert.
8084         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8085         Paul Eggert.
8086
8087 2003-01-27  Bruno Haible  <bruno@clisp.org>
8088
8089         * xsetenv.h: New file, from GNU gettext.
8090         * xsetenv.c: New file, from GNU gettext.
8091
8092 2003-01-23  Bruno Haible  <bruno@clisp.org>
8093
8094         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8095
8096 2003-01-22  Bruno Haible  <bruno@clisp.org>
8097
8098         * exit.h: New file, from GNU gettext.
8099
8100 2003-01-11  Bruno Haible  <bruno@clisp.org>
8101
8102         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8103         * strcase.h (strcasecmp, strncasecmp): Likewise.
8104
8105 2003-01-14  Jim Meyering  <jim@meyering.net>
8106
8107         * same.c (same_name): Tweak a comment.
8108
8109 2003-01-11  Bruno Haible  <bruno@clisp.org>
8110
8111         * same.c (same_name): Reorder tests so as to avoid calling stat()
8112         when a string comparison is sufficient.
8113
8114 2003-01-11  Bruno Haible  <bruno@clisp.org>
8115
8116         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8117         'unsigned int'.
8118
8119 2003-01-11  Bruno Haible  <bruno@clisp.org>
8120
8121         * hash-pjw.c: Add comment about low quality of this function.
8122
8123 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8124
8125         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8126         to avoid collisions with libcurses and libreadline.
8127
8128         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8129         * getstr.h, getstr.c: Remove.
8130         * getline.c: Include "getline.h", to check interface.
8131         Move body of old getstr.c here: this defines MIN_CHUNK and
8132         declares getdelim2, which is renamed from getstr.
8133         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8134
8135         * linebuffer.c (readlinebuffer): Renamed from readline.
8136         All uses changed.
8137         * linebuffer.h: Likewise.
8138         (readline): Remove backward-compatibility macro.
8139
8140 2003-01-12  Jim Meyering  <jim@meyering.net>
8141
8142         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8143
8144 2003-01-10  Bruno Haible  <bruno@clisp.org>
8145
8146         * alloca_.h: New file.
8147         * getdate.y: Unconditionally include alloca.h.
8148         * makepath.c: Likewise.
8149         * setenv.c: Likewise.
8150         * userspec.c: Likewise.
8151
8152 2003-01-09  Bruno Haible  <bruno@clisp.org>
8153
8154         * stdbool.h.in: New file.
8155
8156 2003-01-08  Bruno Haible  <bruno@clisp.org>
8157
8158         * safe-read.c: Include specification header first, to ensure its
8159         selfcontainedness.
8160         * full-write.c: Likewise.
8161
8162 2003-01-08  Jim Meyering  <jim@meyering.net>
8163
8164         * full-write.c: Undefine and define-away `const' after inclusion
8165         of errno.h, not before.  Suggestion from Bruno Haible.
8166
8167 2003-01-07  Jim Meyering  <jim@meyering.net>
8168
8169         * full-write.c: Rework so that it may serve to define full_read, too.
8170         * full-read.c: Simply #define FULL_READ and include full-write.c.
8171
8172 2003-01-06  Jim Meyering  <jim@meyering.net>
8173
8174         * version-etc.c: Update year in translatable copyright string.
8175
8176 2002-12-25  Bruno Haible  <bruno@clisp.org>
8177
8178         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8179         * xstrtol.h: Likewise.
8180         * xstrtoimax.c: Likewise.
8181         * xstrtoumax.c: Likewise.
8182         * human.h: Likewise.
8183
8184         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8185         on systems that have <inttypes.h> but not <stdint.h>.
8186
8187 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8188
8189         * memcoll.c (memcoll): Fall back on a simple algorithm using
8190         memcmp if strcoll doesn't work.
8191
8192 2002-12-23  Bruno Haible  <bruno@clisp.org>
8193
8194         * localcharset.h: New file.
8195         * localcharset.c: Include it.
8196         * unicodeio.c: Likewise.
8197
8198 2002-12-22  Bruno Haible  <bruno@clisp.org>
8199
8200         * utime.c (utime_null): No need to call ftruncate if the file was
8201         nonempty.
8202
8203 2002-12-23  Bruno Haible  <bruno@clisp.org>
8204
8205         * memcoll.c (STRCOLL): New macro.
8206         (memcoll): Use it.
8207
8208 2002-12-22  Bruno Haible  <bruno@clisp.org>
8209
8210         * getstr.h (getstr): Define, to avoid clash with libcurses.
8211         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8212
8213 2002-12-22  Bruno Haible  <bruno@clisp.org>
8214
8215         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8216
8217 2002-12-23  Bruno Haible  <bruno@clisp.org>
8218
8219         * getline.h: Include <stddef.h>, for size_t.
8220
8221         * unicodeio.h: Include <stddef.h>, for size_t.
8222         * unicodeio.c: Don't include <stddef.h>.
8223
8224 2002-12-17  Bruno Haible  <bruno@clisp.org>
8225
8226         * canon-host.c (strdup): Remove unused declaration.
8227
8228         * fsusage.c: Include full_read.h.
8229         (get_fs_usage): Use full_read instead of safe_read.
8230
8231         * utime.c (utime_null): Use SAFE_READ_ERROR.
8232
8233 2002-12-11  Bruno Haible  <bruno@clisp.org>
8234
8235         * setenv.h: Rewritten to cope with systems that have setenv() but not
8236         unsetenv().
8237         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8238         modifications:
8239
8240         2002-12-11  Bruno Haible  <bruno@clisp.org>
8241
8242                 * setenv.c (alloca): Fall back to malloc.
8243                 (freea): New macro.
8244                 (setenv): Use freea() to free memory allocated with alloca().
8245
8246         2002-11-13  Bruno Haible  <bruno@clisp.org>
8247
8248                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8249                 function declarations.
8250                 * unsetenv.c (unsetenv): Likewise.
8251
8252         2002-03-04  Bruno Haible  <bruno@clisp.org>
8253
8254                 Portability to AIX 4.3.3.
8255                 * unsetenv.c: New file, extracted from setenv.c.
8256                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8257
8258         2001-12-20  Bruno Haible  <bruno@clisp.org>
8259
8260                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8261                 use malloc instead. For SunOS 4.
8262
8263         2001-12-11  Bruno Haible  <bruno@clisp.org>
8264
8265                 * setenv.c: Declare alloca.
8266                 (compar_fn_t): New typedef.
8267                 (KNOWN_VALUE, STORE_VALUE): Use it.
8268
8269         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8270         setenv.h.
8271
8272 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8273
8274         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8275         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8276         Choose values that are less likely to collide with system fnmatch
8277         options.
8278         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8279         defined (e.g., a pure POSIX system).
8280         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8281         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8282
8283 2002-12-06  Jim Meyering  <jim@meyering.net>
8284
8285         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8286
8287         Merge in changes from libc's misc/error.c, in preparation
8288         for the merge of gnulib's changes back into libc.
8289
8290         * error.c (_): Define only if not already defined.
8291         Move definition to follow all #include directives.
8292         Include unlocked-io.h only if !_LIBC.
8293         [_LIBC]: Include <libio/libioP.h>.
8294         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8295         (fflush): Tweak definition to use INTUSE.
8296         (putc): Define.
8297
8298 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8299
8300         * alloca.c [defined emacs]: Include "lisp.h".
8301         (xalloc_die) [defined emacs]: New macro.
8302         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8303         [! defined emacs]: Include <xalloc.h>.
8304         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8305         (pointer): Typedef to POINTER_TYPE *.
8306         (malloc): Remove decl; we now always use xmalloc.
8307         (alloca): Use old-style definition, since Emacs needs this.
8308         Check for arithmetic overflow when computing combined size.
8309
8310 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8311
8312         Do not generate unlocked-io.h automatically, since it's easier to
8313         maintain it by hand.
8314
8315         * unlocked-io.h: New file, from GNU diffutils,
8316         but with proper copyright notice and attribution.
8317         * gen-uio: Remove.
8318         * Makefile.am: Add copyright notice.
8319         (libfetish_a_SOURCES): Add unlocked-io.h.
8320         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8321         (DISTCLEANFILES, io_functions): Remove macros.
8322         (EXTRA_DIST): Remove gen_uio.
8323         (unlocked-io.h): Remove rule.
8324
8325 2002-12-04  Jim Meyering  <jim@meyering.net>
8326
8327         Reflect the fact that stat.c and lstat.c are no longer generated.
8328         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8329         (DISTCLEANFILES): Likewise.
8330         (EXTRA_DIST): Likewise.
8331         (all_local): Don't depend on stat.c or lstat.c.
8332         (stat.c, lstat.c): Remove rules.
8333         (EXTRA_DIST): Remove xstat.in.
8334
8335         * xstat.in: Remove file.  Contents moved into stat.c.
8336         * stat.c: New file.  Contents mostly from xstat.in.
8337         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8338         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8339
8340         * safe-read.c: Rework so that it may serve to define safe_write, too.
8341         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8342
8343 2002-12-03  Jim Meyering  <jim@meyering.net>
8344
8345         * safe-read.c, safe-write.c: Change variable names and comments, but
8346         not semantics, to minimize the differences between these two files.
8347         (safe_read): Change comment to mention SAFE_READ_ERROR.
8348
8349         * safe-read.c (IS_EINTR): Define.
8350         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8351
8352 2002-12-02  Bruno Haible  <bruno@clisp.org>
8353
8354         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8355         Define, taken from safe-read.c.
8356         (INT_MAX): Provide fallback.
8357         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8358         * safe-write.h (SAFE_WRITE_ERROR): Define.
8359
8360         * safe-read.c (EINTR): Remove definition.
8361         (safe_read): Don't use EINTR if it is absent.
8362
8363 2002-12-02  Jim Meyering  <jim@meyering.net>
8364
8365         * safe-read.c (EINTR): Define.
8366         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8367         (INT_MAX): Provide fallback.
8368         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8369
8370         * safe-read.h (SAFE_READ_ERROR): Define.
8371
8372 2002-12-01  Jim Meyering  <jim@meyering.net>
8373
8374         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8375         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8376
8377 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8378
8379         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8380         hash_rehash): Replace `if (limit <= value) abort ();' with
8381         `if (! (value < limit)) abort ();', for readability.
8382
8383 2002-11-26    <karl@gnu.org>
8384
8385         * strdup.c: copy from libc again, with jim's ok.
8386         * .cppi-disable: re-add strdup.c
8387
8388 2002-11-25    <karl@gnu.org>
8389
8390         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8391         instead of "strtol.c".
8392
8393 2002-11-25  Jim Meyering  <jim@meyering.net>
8394
8395         * mktime.c: Sync from libc, now that it has the latest fix.
8396
8397 2002-11-24    <karl@gnu.org>
8398
8399         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8400         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8401
8402 2002-11-24  Jim Meyering  <jim@meyering.net>
8403
8404         Update from coreutils:
8405
8406         * mktime.c: Merge in changes from libc.
8407
8408         Avoid a link-time failure on some Linux systems.
8409         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8410         (__mon_yday): Declare with the STATIC attribute.
8411         (__mktime_internal): Likewise.
8412         Based on a report from Greg Schafer.
8413
8414 2002-11-23  Jim Meyering  <jim@meyering.net>
8415
8416         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8417         Use `unsigned', not `int', as type of index.
8418
8419         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8420
8421         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8422
8423 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8424
8425         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8426         hint that one should use `if (! x) abort ();' rather than `assert
8427         (x);', and anyway it's one less thing to worry about configuring.
8428         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8429         hash_rehash, hash_insert): Use abort rather than assert.
8430
8431 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8432
8433         * quotearg.h: Allow multiple inclusion by surrounding with
8434         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8435         so that we can be included first.
8436         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8437         * quotearg.c: Include quotearg.h immediately after config.h.
8438         No need to include stddef.h or sys/types.h any more.
8439         Surround local include files with "", not "<>".
8440         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8441         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8442         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8443         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8444         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8445         (ISPRINT): Remove; no longer needed now that we assume C89.
8446
8447         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8448         Preserve errno.
8449
8450         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8451         quotearg_char): Use SIZE_MAX rather than
8452         (size_t) -1 when we are talking about "infinity".
8453
8454         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8455
8456 2002-11-22  Bruno Haible  <bruno@clisp.org>
8457
8458         * safe-read.h: Assume C89. Add comments.
8459         (safe_read): Change return type to size_t.
8460         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8461         counts > SSIZE_MAX correctly.
8462         * safe-write.h: New file.
8463         * safe-write.c: New file.
8464         * full-read.h: New file.
8465         * full-read.c: New file.
8466         * full-write.h: Assume C89. Add comments.
8467         * full-write.c: Include safe-write.h.
8468         (full_write): Rewritten to use safe_write.
8469         Suggested by Jim Meyering and Paul Eggert.
8470
8471 2002-11-21  Bruno Haible  <bruno@clisp.org>
8472
8473         Remove case insensitive option matching.
8474         * argmatch.h (argcasematch): Remove declaration.
8475         (ARGCASEMATCH): Remove macro.
8476         (__xargmatch_internal): Remove case_sensitive argument.
8477         (XARGMATCH): Update.
8478         (XARGCASEMATCH): Remove macro.
8479         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8480         case_sensitive argument.
8481         (argcasematch): Remove function.
8482         (__xargmatch_internal): Remove case_sensitive argument.
8483         (main): Use XARGMATCH instead of XARGCASEMATCH.
8484
8485         * xmalloc.c: Change compile-time error message. Add comment about
8486         required autoconf version.
8487
8488 2002-11-21  Jim Meyering  <jim@meyering.net>
8489
8490         * strdup.c (strdup): Tweak comment and initial #if/#include.
8491
8492         Merge in changes from the coreutils.
8493
8494         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8495         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8496         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8497         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8498         int.  Work more efficiently if X is the same width as uintmax_t.
8499         Do not compare X to -1, to avoid bogus compiler warning.
8500         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8501         Don't assume that f_frsize and f_bsize are the same type.
8502
8503         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8504         on FreeBSD.
8505
8506         * makepath.c (make_path): Restore umask *before* creating the final
8507         component.
8508         (make_path): Minor reformatting.
8509
8510         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8511         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8512
8513         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8514         ones.  At least on GNU/Linux systems, `auto' means something else.
8515         From Michael Stone.
8516
8517 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8518
8519         Merge argmatch cleanups from Bison.  Assume C89.
8520
8521         * argmatch.c: Include config.h here, not in argmatch.h.
8522         Include stdlib.h, for EXIT_FAILURE.
8523         Always include <string.h>, since we assume C89.
8524         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8525         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8526         Include <stddef.h> instead, since it's all we need for size_t.
8527         (PARAMS): Remove.  All uses removed.
8528         (ARRAY_CARDINALITY): Do not bother to #undef.
8529         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8530         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8531         Remove unnecessary parentheses.
8532         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8533         Insert necessary parentheses.
8534         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8535         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8536
8537 2002-11-19  Bruno Haible  <bruno@clisp.org>
8538
8539         * mbswidth.c: Include mbswidth.h right at the beginning.
8540         * mbswidth.h: Include <stddef.h>, for size_t.
8541
8542         * mbswidth.h (PARAMS): Remove macro.
8543         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8544         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8545
8546         * gcd.h (PARAMS): Remove macro.
8547         (gcd): Use ANSI C function declarations.
8548         * gcd.c (gcd): Likewise.
8549
8550 2002-11-15  Bruno Haible  <bruno@clisp.org>
8551
8552         * strcspn.c: Include <stddef.h>.
8553         (strcspn): Use ANSI C function declaration. Change return type to
8554         size_t. Use NULL.
8555         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8556         (strpbrk): Use NULL.
8557         * strpbrk.h (PARAMS): Remove macro.
8558         (strpbrk): Use ANSI C function declaration.
8559         * strstr.c: Don't include <sys/types.h>.
8560         * strstr.h (PARAMS): Remove macro.
8561         (strstr): Use ANSI C function declarations.
8562
8563 2002-11-06  Bruno Haible  <bruno@clisp.org>
8564
8565         * gcd.h (gcd): Change argument type to 'unsigned long'.
8566         * gcd.c (gcd): Likewise.
8567
8568 2002-11-05  Bruno Haible  <bruno@clisp.org>
8569
8570         * gcd.h: New file, from gettext-0.11.5.
8571         * gcd.c: New file, from gettext-0.11.5.
8572
8573 2002-11-05  Bruno Haible  <bruno@clisp.org>
8574
8575         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8576         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8577         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8578         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8579
8580         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8581         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8582
8583         * closeout.c: Include gettext.h instead of <libintl.h>.
8584         * human.c: Include gettext.h instead of <libintl.h>.
8585         * quotearg.c: Include gettext.h instead of <libintl.h>.
8586         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8587         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8588         * userspec.c: Include gettext.h instead of <libintl.h>.
8589         * version-etc.c: Include gettext.h instead of <libintl.h>.
8590         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8591         (textdomain): Remove definition.
8592         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8593
8594         * long-options.c: Remove include of <libintl.h> and definition of _.
8595         * same.c: Remove include of <libintl.h> and definition of _.
8596
8597 2002-11-04  Bruno Haible  <bruno@clisp.org>
8598
8599         * stpcpy.h: New file, from GNU gettext-0.11.5.
8600         * strcase.h: New file, from GNU gettext-0.11.5.
8601         * strpbrk.h: New file, from GNU gettext-0.11.5.
8602         * strstr.h: New file, from GNU gettext-0.11.5.
8603         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8604
8605 2002-05-09  Bruno Haible  <bruno@clisp.org>
8606
8607         * config.charset: Update for newest glibc. Add canonical names
8608         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8609
8610 2002-05-09  Bruno Haible  <bruno@clisp.org>
8611
8612         * localcharset.c (get_charset_aliases): Add more Windows specific
8613         aliases.
8614
8615 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8616
8617         * config.charset: A few additions for Solaris.
8618
8619 2001-12-05  Bruno Haible  <bruno@clisp.org>
8620
8621         * localcharset.c (locale_charset): Don't return an empty string.
8622
8623 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8624
8625         * config.charset: msdos in uk_UA uses CP1125.
8626
8627 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8628
8629         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8630         * localcharset.c (locale_charset): Declare as extern "C".
8631
8632 2002-02-15  Bruno Haible  <bruno@clisp.org>
8633
8634         * config.charset [msdosdjgpp]: For Russian, use CP866.
8635
8636 2002-02-11  Bruno Haible  <bruno@clisp.org>
8637
8638         * config.charset: Add support for NetBSD.
8639
8640 2002-09-25    <karl@gnu.org>
8641
8642         * strdup.c: copy from libc/string (via ../config/srclist*).
8643         * getopt*: copy from libc/posix.
8644         * gettext.h: copy from gettext.
8645         * .cppi-disable: add strdup.c, gettext.h.
8646
8647 2002-07-01  Jim Meyering  <meyering@lucent.com>
8648
8649         * c-stack.c: Include sys/time.h.
8650         From Volker Borchert.
8651
8652 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8653
8654         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8655         New macro.  Use it uniformly instead of
8656         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8657         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8658         reported by Vin Shelton.
8659
8660 2002-06-22  Jim Meyering  <meyering@lucent.com>
8661
8662         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8663         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8664
8665 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8666
8667         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8668         Do not assume SA_SIGINFO behavior.
8669         Bug reported by Jim Meyering on NetBSD 1.5.2.
8670
8671 2002-06-22  Jim Meyering  <meyering@lucent.com>
8672
8673         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8674
8675         * exitfail.c, exitfail.h: Likewise.
8676         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8677
8678         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8679         of fnmatch.h.
8680         (EXTRA_DIST): Add fnmatch_loop.c.
8681         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8682
8683         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8684         * fnmatch.c: Update from diffutils-2.8.2.
8685         * fnmatch_.h: New file.  From diffutils-2.8.2.
8686         * fnmatch.h: Remove file.
8687
8688 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8689
8690         * file-type.h: Report an error if neither S_ISREG nor
8691         S_IFREG is defined, instead of using a test specific to glibc
8692         2.2.  This should be safe, since POSIX requires S_ISREG and
8693         Unix Version 7 had S_IFREG.  We don't need to check for
8694         <sys/types.h> since we don't use any symbols that it defines.
8695
8696 2002-06-15  Jim Meyering  <meyering@lucent.com>
8697
8698         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8699         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8700         have been included before this file.
8701
8702 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8703
8704         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8705         so that each temporary file name is unique and valid in the first
8706         8 characters, for operation under DOS.
8707
8708 2002-06-15  Jim Meyering  <meyering@lucent.com>
8709
8710         Work even with DJGPP 2.03, which lacks support for symlinks.
8711         From Richard Dawe.
8712         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8713         is defined.
8714         * lchown.c (S_ISLNK): Likewise.
8715
8716 2002-06-14  Jim Meyering  <meyering@lucent.com>
8717
8718         * file-type.h: Use the version from diffutils-2.8.2.
8719         * file-type.c: Likewise.
8720
8721 2002-05-27  Jim Meyering  <meyering@lucent.com>
8722
8723         Fix a problem seen only on nonconforming systems whereby ls.c's
8724         use of localtime, and then of gettimeofday would cause trouble:
8725         the localtime call used to initialize rpl_gettimeofday's save
8726         mechanism would clobber ls's current local time information so
8727         that in any long listing the first file would always be listed
8728         with date 1970-01-01.  Analysis by Volker Borchert.
8729
8730         * gettimeofday.c (localtime): Undefine.
8731         (rpl_localtime): New function.
8732
8733 2002-05-22  Jim Meyering  <meyering@lucent.com>
8734
8735         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8736         * file-type.h: New file.
8737         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8738
8739 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8740
8741         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8742
8743 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8744
8745         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8746         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8747         of 127, since 64 is the largest conceivable number for ancient
8748         nonstandard hosts.
8749         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8750
8751 2002-04-28  Jim Meyering  <meyering@lucent.com>
8752
8753         * sig2str.c (WTERMSIG): Remove definition (unused).
8754
8755 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8756
8757         * sig2str.h, sig2str.c: New files.
8758         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8759
8760 2002-04-24  Jim Meyering  <meyering@lucent.com>
8761
8762         * gettext.h: New file, from Gettext.
8763         * Makefile.am (INCLUDES): Remove -I../intl.
8764         (libfetish_a_SOURCES): Add gettext.h.
8765
8766 2002-04-16  Jim Meyering  <meyering@lucent.com>
8767
8768         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8769         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8770         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8771
8772 2002-04-12  Jim Meyering  <meyering@lucent.com>
8773
8774         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8775
8776 2002-03-10  Jim Meyering  <meyering@lucent.com>
8777
8778         * makepath.c (make_path): Remove a comma from a diagnostic.
8779         Suggestion from Santiago Vila.
8780
8781 2002-03-08  Jim Meyering  <meyering@lucent.com>
8782
8783         * rename.c: Mention that this wrapper is needed also on
8784         mips-dec-ultrix4.4 systems.
8785
8786 2002-03-02  Jim Meyering  <meyering@lucent.com>
8787
8788         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8789         not HAVE_CLOCK_SETTIME.
8790
8791 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8792
8793         * nanosleep.h: Rename to....
8794         * timespec.h: New name for nanosleep.h.  All uses changed.
8795
8796         * gettime.c: New file.
8797         * settime.c: New file.
8798         * stime.c: Remove.
8799
8800         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8801         timespec.h.  Remove nanosleep.h.
8802
8803 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8804
8805         * acl.c, acl.h: New files.
8806         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8807
8808 2002-02-24  Jim Meyering  <meyering@lucent.com>
8809
8810         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8811         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8812         cause trouble.  Reported by Nelson Beebe.
8813
8814 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8815
8816         * path-concat.c (xpath_concat): Reorder code to pacify
8817         compilers that don't know that xalloc_die never returns.
8818
8819 2002-02-20  Jim Meyering  <meyering@lucent.com>
8820
8821         * getdate.c: Regenerate using bison-1.33.
8822
8823 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8824
8825         * posixver.c, posixver.h: New files.
8826         * Makefile.am (libfetish_a_SOURCES): Add them.
8827
8828 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8829             Bruno Haible  <bruno@clisp.org>
8830
8831         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8832         (fwrite_success_callback): New declaration.
8833         * unicodeio.c (unicode_to_mb): New function, extracted from
8834         print_unicode_char. Call failure callback instead of error.
8835         (fwrite_success_callback): New function.
8836         (exit_failure_callback): New function.
8837         (fallback_failure_callback): New function.
8838         (print_unicode_char): Call unicode_to_mb.
8839
8840 2002-01-26  Jim Meyering  <meyering@lucent.com>
8841
8842         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8843
8844 2002-01-22  Jim Meyering  <meyering@lucent.com>
8845
8846         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8847         Otherwise, some versions of automake would omit the rule that makes
8848         Makefile from Makefile.in.
8849
8850 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8851
8852         * xmemcoll.h, xmemcoll.c: New files.
8853         * Makefile.am (libfetish_a_SOURCES): Add them.
8854         * memcoll.c: Include errno.h, and declare errno if not defined.
8855         (memcoll): Set errno to zero if there is no error.
8856
8857         * quotearg.c (quotearg_buffer_restyled):
8858         Fix bug with quoting buffers containing NUL when backslashing escapes.
8859         This bug was exposed by the other changes in this patch.
8860         (quotearg_n_options): New arg ARGSIZE.
8861         All callers changed.
8862         (quoting_options_from_style): New function.
8863         (quotearg_n_style): Use it.
8864         (quotearg_n_style_mem): New function.
8865
8866         * quotearg.h (quotearg_n_style_mem): New function.
8867
8868 2002-01-16  Jim Meyering  <meyering@lucent.com>
8869
8870         * getdate.y: Add three semicolons, each just before a closing brace.
8871         Bison (as of version 1.31) no longer papers over that mistake.
8872
8873 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8874
8875         * backupfile.c (ISDIGIT): Comment fix.
8876         * getdate.y (ISDIGIT): Likewise.
8877         * posixtm.c (ISDIGIT, year): Likewise.
8878         * strverscmp.c (ISDIGIT): Likewise.
8879         * userspec.c (ISDIGIT): Likewise.
8880
8881 2002-01-05  Jim Meyering  <meyering@lucent.com>
8882
8883         * version-etc.c (version_etc_copyright): Update copyright year.
8884
8885 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8886
8887         * closeout.c (close_stdout_status): If ferror (stdout), do
8888         not silently exit merely because the output buffer happens to
8889         have nothing pending.
8890
8891 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8892
8893         See the big note in ../ChangeLog.
8894         * human.c (suffixes): Prefer K to k for 1024.
8895         (generate_suffix_backwards): New function.
8896         (human_readable_inexact): Use it.
8897         * xstrtol.c (__xstrtol): If there is no number but there
8898         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8899         Accept 'K' as well as 'k'.
8900
8901 2001-12-15  Jim Meyering  <meyering@lucent.com>
8902
8903         * regex.h (__restrict_arr): Update from libc.
8904
8905         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8906         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8907         (STREQ): Define.
8908
8909 2001-12-10  Jim Meyering  <meyering@lucent.com>
8910
8911         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8912         Instead, include "xalloc.h".
8913         (initbuffer): Don't cast xmalloc return value to char*.
8914         (readline): Reword comment.
8915         Don't cast xrealloc return value to char*
8916         Return NULL, not 0.
8917
8918 2001-12-09  Jim Meyering  <meyering@lucent.com>
8919
8920         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8921         `signed and unsigned type in conditional expression'.
8922         * posixtm.c (posix_time_parse): Likewise.
8923
8924         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8925
8926         * readtokens.c (readtoken): Declare an index to be of type unsigned
8927         to avoid a pedantic warning.
8928
8929         * getstr.c: Don't include assert.h.
8930         (getstr): Remove warning-evoking assertions.
8931         Return -1 if offset parameter is out of bounds.
8932         Change the type of a local from int to size_t.
8933
8934         * strftime.c (my_strftime_localtime_r): Include this function
8935         definition in the `#if ! HAVE_TM_GMTOFF' block.
8936
8937         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8938         Include xalloc.h instead.
8939
8940 2001-12-02  Jim Meyering  <meyering@lucent.com>
8941
8942         * tempname.c: Don't declare getenv, thus reverting the change of
8943         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8944         included.
8945
8946         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8947         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8948
8949 2001-11-30  Akim Demaille  <akim@epita.fr>
8950
8951         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8952         before being defined.
8953
8954 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8955
8956         * quotearg.h (quotearg_n, quotearg_n_style):
8957         First arg is int, not unsigned.
8958         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8959         (SIZE_MAX, UINT_MAX): New macros.
8960         (quotearg_n_options): Abort if N is negative.
8961         Avoid overflow check on hosts where size_t is 64 bits and int
8962         is 32 bits, as overflow is impossible there.
8963         Fix off-by-one typo that caused unnecessary reallocation.
8964
8965 2001-11-27  Jim Meyering  <meyering@lucent.com>
8966
8967         * tempname.c: Merge with version from libc.
8968         * regex.c: Likewise.
8969
8970         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8971         for which STDC_HEADERS is 0, it was not included, resulting in a
8972         warning about an integer-to-pointer conversion problem with getenv.
8973         Reported by Volker Borchert.
8974
8975 2001-11-26  Jim Meyering  <meyering@lucent.com>
8976
8977         * gtod.h: Remove file.
8978         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8979         * gettimeofday.c: Don't include gtod.h.
8980         (GTOD_init): Remove function.
8981         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8982         Suggestion from Volker Borchert.
8983
8984 2001-11-23  Jim Meyering  <meyering@lucent.com>
8985
8986         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8987         * hash.c (struct hash_table): Define it here instead.
8988
8989 2001-11-22  Jim Meyering  <meyering@lucent.com>
8990
8991         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8992
8993 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8994
8995         * tempname.c (TMP_MAX): Remove; no longer needed.
8996         (TEMPORARIES): New macro.
8997         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8998         removes an artificial limitation (e.g. HP-UX 10.20, where
8999         TMP_MAX is 17576).
9000
9001 2001-11-18  Jim Meyering  <meyering@lucent.com>
9002
9003         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9004         on SunOS 4.
9005
9006         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9007         files will be created before anything else.
9008
9009 2001-11-17  Jim Meyering  <meyering@lucent.com>
9010
9011         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9012         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9013         rather than group writable.  Patch by Juan F. Codagnone.
9014
9015         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9016         Instead, include "xalloc.h".
9017
9018         * mountlist.c: Include unlocked-io.h after all system headers.
9019         Remove explicit declarations of xmalloc, xrealloc,
9020         and xstrdup.  Instead, include "xalloc.h".
9021
9022         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9023         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9024         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9025
9026         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9027         Reported by Padraig Brady.
9028
9029         * mkstemp.c: #undef mkstemp.
9030         Include config.h.
9031         (rpl_mkstemp): Rename from mkstemp.
9032         Protoize.
9033
9034 2001-11-16  Jim Meyering  <meyering@lucent.com>
9035
9036         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9037         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9038         determine the amount of total physical memory, use pstat_getstatic.
9039         HPUX-11 doesn't define _SC_PHYS_PAGES.
9040         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9041         If sysconf couldn't be used to determine the amount of available
9042         physical memory, use both pstat_getstatic and pstat_getdynamic.
9043         Based on a patch from Bob Proulx.
9044
9045 2001-11-05  Jim Meyering  <meyering@lucent.com>
9046
9047         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9048
9049 2001-11-03  Jim Meyering  <meyering@lucent.com>
9050
9051         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9052         in argmatch_to_argument call.
9053
9054         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9055         argument.
9056
9057         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9058         e.g., a fault due to an attempt to free a NULL pointer.
9059
9060 2001-11-01  Jim Meyering  <meyering@lucent.com>
9061
9062         * dirfd.c, dirfd.h: New files.
9063         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9064
9065         * hash.c (hash_print) [TESTING]: Clean up.
9066
9067 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9068
9069         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9070         to avoid a warning if -Wall.
9071
9072 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9073
9074         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9075
9076 2001-10-21  Jim Meyering  <meyering@lucent.com>
9077
9078         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9079         this code would end up calling gettext even in packages built
9080         with --disable-nls.
9081         * getopt.c (_): Likewise.
9082         * regex.c (_): Likewise.
9083
9084 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9085
9086         * error.c (strerror_r): Do not declare unless !_LIBC.
9087         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9088         Use strerror_r that is only a macro, even if it is not a function.
9089         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9090         (private_strerror): Use prototypes, not old-style function definition.
9091         (print_errno_message): New function.
9092         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9093         char*-flavored one.
9094         (error_tail, error, error_at_line): Use it.
9095
9096 2001-10-11  Jim Meyering  <meyering@lucent.com>
9097
9098         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9099         and quote_n (1, ... to avoid clobbering a buffer.
9100
9101 2001-10-05  Jim Meyering  <meyering@lucent.com>
9102
9103         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9104         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9105         * hash-pjw.h: New file.
9106
9107 2001-09-30  Jim Meyering  <meyering@lucent.com>
9108
9109         * mountlist.c [MOUNTED_GETFSSTAT]:
9110         Include <sys/ucred.h>, for Apple Darwin.
9111         Include sys/mount.h and sys/fs_types.h only if available.
9112         (FS_TYPE): Define.
9113         (read_filesystem_list): Use FS_TYPE.
9114
9115 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9116
9117         * exclude.c (excluded_filename): 0 -> false, since it's
9118         a boolean context.
9119
9120 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9121
9122         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9123         #defines strtoimax.  Also treat the other strto* functions
9124         like strtoimax.
9125
9126         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9127         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9128         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9129
9130 2001-09-26  Jim Meyering  <meyering@lucent.com>
9131
9132         Most macros in unlocked-io.h had the wrong number of arguments.
9133         * gen-uio: New script.
9134         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9135         * unlocked-io.hin: Remove file.
9136         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9137         rather than trying to embed it here.
9138         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9139         Reported by Padraig Brady.
9140
9141 2001-09-25  Volker Borchert  <bt@teknon.de>
9142
9143         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9144
9145 2001-09-23  Jim Meyering  <meyering@lucent.com>
9146
9147         * mountlist.c: Remove useless parentheses in #if directives.
9148         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9149         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9150
9151 2001-09-22  Jim Meyering  <meyering@lucent.com>
9152
9153         * localcharset.c: Update from latest gettext.
9154         * config.charset: Likewise.
9155
9156 2001-09-20  Jim Meyering  <meyering@lucent.com>
9157
9158         * xstrtol.c (strtoimax): Guard declaration with
9159         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9160         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9161         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9162         (strtoumax): Likewise, for completeness (it wasn't necessary).
9163
9164 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9165
9166         * strtoimax.c (HAVE_LONG_LONG):
9167         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9168         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9169         to work around bug in IBM C compiler.
9170
9171 2001-09-16  Jim Meyering  <meyering@lucent.com>
9172
9173         * mkdir.c: New file.
9174
9175 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9176
9177         * xgetcwd.c: Revert some of the previous change; intead,
9178         fix the HAVE_GETCWD_NULL code to behave more like the
9179         !HAVE_GETCWD_NULL code used to.
9180
9181         Include "xalloc.h".
9182         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9183         invoke xalloc_die.
9184
9185 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9186
9187         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9188         Use ssize_t, not int, to store result of readlink.
9189         Check for ssize_t overflow as well as size_t overflow,
9190         as POSIX says the result of readlink is implementation-defined
9191         when ssize_t overflows.
9192         Remove unnecessary cast to char*.
9193         Use free+malloc instead of realloc, as the storage doesn't need
9194         to be preserved and it's clearer and can be more efficient that way.
9195         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9196         * xreadlink.h (xreadlink): Update prototype.
9197
9198 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9199
9200         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9201         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9202         spotted by Jim Meyering.
9203
9204 2001-09-03  Jim Meyering  <meyering@lucent.com>
9205
9206         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9207
9208 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9209
9210         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9211         like the HAVE_GETCWD_NULL code.
9212         Include pathmax.h if not HAVE_GETCWD.
9213         Do not include xalloc.h.
9214         (INITIAL_BUFFER_SIZE): New symbol.
9215         Do not use xmalloc / xrealloc, since the caller is responsible for
9216         handling errors.  Preserve errno around `free' during failure.
9217         Do not overrun buffer when using getwd.
9218
9219 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9220
9221         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9222         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9223
9224 2001-09-02  Jim Meyering  <meyering@lucent.com>
9225
9226         * error.c: Update from GNU libc.
9227
9228 2001-09-01  Jim Meyering  <meyering@lucent.com>
9229
9230         * xreadlink.c: New file.
9231         * xreadlink.h: New file.
9232         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9233
9234         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9235         doesn't conflict with sparc Solaris 7's definition in
9236         /usr/include/sys/int_types.h.
9237
9238         * exclude.c: Use `""', not `<>' to #include non-system header files.
9239         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9240         and strncasecmp as r-values.  Unixware didn't have declarations.
9241
9242 2001-08-31  Jim Meyering  <meyering@lucent.com>
9243
9244         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9245         Use an initial, malloc'd, buffer of length 128 rather than
9246         a statically allocated one of length 1024.
9247
9248 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9249
9250         * xgetcwd.c: Don't include pathmax.h.
9251         Include stdlib.h and unistd.h if available.
9252         Include xalloc.h.
9253         (xmalloc, xstrdup, free): Remove decls.
9254         (xgetcwd): Don't assume sizes fit in unsigned.
9255         Check for overflow when computing sizes.
9256         Simplify reallocation code.
9257
9258 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9259
9260         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9261
9262         * strtoimax.c: Renamed from strtoxmax.c, removing the
9263         old strtoimax.c.
9264
9265         Also, make the following further changes to make this file's
9266         configuration more similar to that of strtol.c:
9267         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9268         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9269         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9270         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9271         changed to signed values.
9272
9273         And make the following changes as well:
9274         Fix copyright notice, as 1999 was missing.
9275         (verify): New macro.
9276         (strtoimax): Check sizes at compile-time, not run-time.
9277         Prefer strtol to strtoll if both work.
9278         (main): Remove; it was not that useful and was a pain to maintain.
9279
9280         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9281
9282 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9283
9284         * savedir.c (savedir): Remove size parameter, as POSIX says that
9285         a directory's st_size can have an arbitrary value, so the old
9286         usage could waste an arbitrary amount of memory.  All uses
9287         changed.
9288         * savedir.h: Update prototype.
9289
9290 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9291
9292         * xstrtol.c (strtoimax): New decl.
9293
9294 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9295
9296         * xstrtol.h: Add copyright notice.
9297         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9298         LONGINT_INVALID_SUFFIX_CHAR.
9299
9300 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9301
9302         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9303         tm to be declared.
9304
9305 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9306
9307         * hash.c: Remove '2001' from copyright notice.
9308
9309 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9310
9311         * full-write.h: New file.
9312         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9313         * full-write.c: Correct credits, as cccp.c no longer
9314         exists and anyway it was so heavily changed from the old cccp
9315         code as to be unrecognizable.  Include full-write.h.
9316         (full_write) Return size_t, with short writes meaning failure.
9317         All callers changed.  This fixes a bug with large buffers
9318         on 64-bit hosts.
9319         * utime.c: Include full-write.h.
9320
9321 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9322
9323         Merge 'exclude' changes from tar 1.13.22.
9324         This fixes one or two unlikely storage allocation overflow bugs,
9325         but doesn't change user-visible behavior otherwise.
9326
9327 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9328
9329         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9330         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9331         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9332         Include if available.
9333         (<xalloc.h>): Include
9334         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9335         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9336         collide with FNM macros.
9337         (struct patopts): New struct.
9338         (struct exclude): Use it, as exclude patterns now come with options.
9339         (new_exclude): Support above changes.
9340         (new_exclude, add_exclude_file):
9341         Initial size must now be a power of two to simplify overflow checking.
9342         (free_exclude, fnmatch_no_wildcards): New function.
9343         (excluded_filename): No longer requires options arg, as the options
9344         are determined by add_exclude.  Now returns bool, not int.
9345         (excluded_filename, add_exclude):
9346         Add support for the fancy new exclusion options.
9347         (add_exclude, add_exclude_file): Now takes int options arg.
9348         Check for arithmetic overflow when computing sizes.
9349         (add_exclude_file): xrealloc might modify errno, so don't
9350         realloc until after errno might be used.
9351
9352         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9353         New macros.
9354         (free_exclude): New decl.
9355         (add_exclude, add_exclude_file): Now takes int options arg.
9356         (excluded_filename): No longer requires options arg, as the options
9357         are determined by add_exclude.  Now returns bool, not int.
9358
9359 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9360
9361         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9362
9363 2001-08-27  Jim Meyering  <meyering@lucent.com>
9364
9365         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9366
9367         * version-etc.c (N_): Remove definition.
9368         Revert most of last change.
9369         Instead, simply don't mark the `Copyright...' string for translation.
9370         Based on advice from Paul Eggert.
9371
9372         * strtoxmax.c: Tweak comment.
9373
9374 2001-08-26  Jim Meyering  <meyering@lucent.com>
9375
9376         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9377         of copyright with `%s' so translators don't get an untranslated
9378         message in 2002.
9379         (COPYRIGHT_YEAR): Define.
9380         (version_etc): Use fprintf rather than fputs.
9381         Suggestion from Ulrich Drepper.
9382
9383         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9384
9385         * strtoll.c: New file, from GNU libc.
9386         * xstrtoimax.c: New file.
9387
9388         * xstrtol.h: Add xstrtoimax.
9389         * strtoumax.c: New file.  Simply include "strtoumax.c".
9390         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9391
9392         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9393         * strtoxmax.c: ... then renamed to this.
9394
9395 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9396
9397         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9398         Port to Solaris 8, where 'sed' requires a space after the 'r'
9399         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9400         Redirect output to $tmp just once.
9401
9402 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9403
9404         * addext.c (<errno.h>): Include.
9405         (errno): Declare if not defined.
9406         (addext): Work correctly when pathconf returns -1 and leaves
9407         errno alone because there is no limit.  Also, work even if
9408         pathconf returns a value greater than SIZE_MAX.
9409
9410 2001-08-12  Jim Meyering  <meyering@lucent.com>
9411
9412         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9413         Simply `return getcwd (NULL, 0);'.
9414         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9415         Use 1300 as initial value for length, not PATH_MAX.
9416
9417         * pathmax.h: Clean up cpp syntax.
9418
9419 2001-08-12  Jim Meyering  <meyering@lucent.com>
9420
9421         * gettimeofday.c: New file.
9422         * gtod.h: New file.
9423         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9424
9425 2001-08-04  Jim Meyering  <meyering@lucent.com>
9426
9427         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9428         to get in sync with glibc.
9429
9430 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9431
9432         The following changes are from gettext 0.10.39 as maintained by
9433         Bruno Haible.
9434
9435         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9436         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9437         with inverted sense.  All uses changed.
9438
9439         * mbswidth.c: Don't include <limits.h>.
9440         Include <stdlib.h> and <string.h> unconditionally.
9441         (iswcntrl, mbsinit, ISCNTRL): New macros.
9442         (mbsnwidth): Use K&R style function declarations.
9443         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9444         can optimize it when MB_CUR_MAX == 1.
9445         The width of control characters is zero, not 1.
9446
9447 2001-07-15  Jim Meyering  <meyering@lucent.com>
9448
9449         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9450         (BUILT_SOURCES): Add unlocked-io.h.
9451         (io_functions): Define.
9452         (unlocked-io.h): New rule.
9453         (DISTCLEANFILES): Add unlocked-io.h.
9454         (all-local): Depend on unlocked-io.h, to ensure it is created.
9455
9456         * unlocked-io.hin: New file
9457
9458         * regex.c: Update from glibc.
9459
9460 2001-07-05  Jim Meyering  <meyering@lucent.com>
9461
9462         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9463         recommendation.
9464         (libfetish_a_SOURCES): Put all .h files here instead.
9465         Remove a thus-exposed (better checks in automake) duplicate and
9466         two unnecessary .h files.
9467
9468 2001-06-11  Jim Meyering  <meyering@lucent.com>
9469
9470         * regex.c: Update from GNU libc.
9471
9472 2001-05-27  Jim Meyering  <meyering@lucent.com>
9473
9474         * readutmp.h (UT_TYPE): Define.
9475
9476 2001-05-24  Jim Meyering  <meyering@lucent.com>
9477
9478         * argmatch.c: Include "quote.h".
9479         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9480         quote function.  Reported by Göran Uddeborg.
9481
9482 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9483
9484         * dirname.c (dir_name): Compute append_dot using path, not newpath
9485         which is not yet declared.
9486
9487 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9488
9489         * Makefile.am (libfetish_a_SOURCES):
9490         Add strftime.c, since we now compile it on all hosts.
9491
9492         * strftime.c (my_strftime):
9493         Define to nstrftime if emacs, but only if my_strftime is not defined.
9494         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9495         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9496         Add one more extra argument: a nanoseconds value.
9497         All uses changed.
9498         (ns): New macro.
9499         (my_strftime function): Add %N format.
9500         (emacs_strftimeu): Renamed from emacs_strftime,
9501         with extra ut argument.
9502
9503 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9504
9505         dirname code cleanup.  base_name now behaves more compatibly
9506         with POSIX basename when given file names that have trailing
9507         slashes, and similarly for dir_name.  Add new primitives
9508         base_len and dir_len.  Put the directory-name-related decls
9509         into dirname.h.
9510
9511         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9512         * backupfile.c (base_name): Likewise.
9513         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9514         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9515         * makepath.c (strip_trailing_slashes): Likewise.
9516         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9517         Likewise.
9518         * rename.c (strip_trailing_slashes): Likewise.
9519         * same.c (base_name): Likewise.
9520         * stripslash.c (ISSLASH): Likewise.
9521
9522         * addext.c: Include <dirname.h> after size_t is defined.
9523         * backupfile.c: Likewise.
9524
9525         * addext.c (addext): Use base_len to trim redundant
9526         trailing slashes instead of doing it ourselves.
9527         But do not trim the last slash if it is not redundant.
9528
9529         * backupfile.c (find_backup_file_name,
9530         max_backup_version): Use base_len instead of rolling it ourselves.
9531         Handle the case of "" and (on DOS) "C:" correctly.
9532
9533         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9534         Include <string.h>, <dirname.h>.
9535         (base_name): Allow file names ending in slashes, other than names
9536         that are all slashes.  In this case, return the basename followed
9537         by the slashes.  This is more general, and can be used in places
9538         where the original base_name purposely had an assertion failure.
9539         (base_len): New function.
9540
9541         * dirname.c: Include <string.h> instead of <stdlib.h>.
9542         Do not include <assert.h>; no longer needed.
9543         Include xalloc.h.
9544         (memrchr): Remove decl.
9545         (dir_name_r): Remove.
9546         (dir_len): Renamed from dirlen.  All callers changed.
9547         Rewrite in terms of base_name, for simplicity and consistency.
9548         (dir_name): Never return NULL.  All callers changed.
9549         Do not include <stdlib.h> in test program; no longer needed.
9550         return 0; is fine for test program.
9551
9552         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9553         New macros.
9554         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9555
9556         * path-concat.c (path_concat): Use base_len to compute
9557         base length, not strlen; this means we cannot rely on memcpy
9558         to null-terminate.
9559
9560         * same.c (STREQ): Remove.
9561         (same_name): Handle the case where the basename ends in trailing '/'.
9562
9563         * stripslash.c (strip_trailing_slashes): Return nonzero if
9564         a slash was stripped.  Do not strip the last slash after a
9565         file system prefix.
9566
9567 2001-04-08  Jim Meyering  <meyering@lucent.com>
9568
9569         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9570         recomputed; that's necessary when the offset spans a DST transition.
9571         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9572
9573 2001-04-02  Jim Meyering  <meyering@lucent.com>
9574
9575         * regex.h, regex.c: Update from GNU libc.
9576
9577 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9578
9579         * version-etc.c (version_etc_copyright): Update to 2001.
9580
9581 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9582
9583         * tempname.c (uint64_t): Define to uintmax_t if
9584         not defined, and if UINT64_MAX is not defined.
9585         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9586         Reported by John David Anglin.
9587
9588 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9589
9590         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9591         alias if codeset is empty.
9592         * config.charset (BeOS): Use wildcard syntax.
9593
9594 2001-03-13  Jim Meyering  <meyering@lucent.com>
9595
9596         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9597         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9598         From Bruno Haible.
9599
9600 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9601
9602         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9603         Don't return NULL.
9604         * unicodeio.c (print_unicode_char): Simplify accordingly.
9605
9606 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9607
9608         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9609         support for DOS/DJGPP.
9610
9611 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9612
9613         * Makefile.am (libfetish_a_SOURCES):
9614         Add dup-safer.c, fopen-safer.c.
9615         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9616
9617         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9618
9619 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9620
9621         The mkstemp replacement is taken from glibc 2.2.2, with some
9622         portability fixes for use outside glibc, as follows:
9623
9624         * tempname.c (struct_stat64): New macro.
9625         (direxists, __gen_tempname): Use it.
9626         This avoids a portability problem with Solaris 8.
9627
9628         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9629         (<stddef.h>, <stdint.h>, <string.h>):
9630         Include only if STDC_HEADERS || _LIBC.
9631         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9632         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9633         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9634         (__set_errno): Define this macro if <errno.h> doesn't.
9635         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9636         Define these macros if <stdio.h> doesn't.
9637         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9638         Define these macros if <sys/stat.h>
9639         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9640         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9641         __xstat64): Define if not _LIBC.
9642         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9643         (__gen_tempname): Invoke gettimeofday only if
9644         HAVE_GETTIMEOFDAY || _LIBC;
9645         otherwise, fall back on plain "time".
9646         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9647
9648         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9649
9650         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9651
9652 2001-02-17  Jim Meyering  <meyering@lucent.com>
9653
9654         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9655         around included file name.
9656
9657         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9658
9659         * strftime.c: Update from GNU libc (the only changes were to comments).
9660
9661 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9662
9663         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9664
9665 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9666
9667         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9668         Remove workaround macros for hosts that have mbrtowc but not
9669         mbstate_t, as we now insist on proper declarations for both
9670         before using mbrtowc.
9671
9672 2001-02-17  Jim Meyering  <meyering@lucent.com>
9673
9674         * regex.c: Update from libc.
9675
9676 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9677
9678         * alloca.c (malloc): Undef before defining, since stdlib.h
9679         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9680         Reported by Mark Hounschell via Paul Eggert.
9681
9682 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9683
9684         * config.charset: Update for FreeBSD 4.2.
9685
9686 2001-01-26  Jim Meyering  <meyering@lucent.com>
9687
9688         * quotearg.c: Include stddef.h.
9689         * quote.c: Include stddef.h.
9690         Reported by Axel Kittenberger.
9691
9692         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9693         line in double quotes so that it evokes a better diagnostic.
9694         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9695         Reported by Axel Kittenberger.
9696
9697 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9698
9699         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9700         to avoid a warning.  Add back 'const' to inptr.
9701
9702 2001-01-16  Jim Meyering  <meyering@lucent.com>
9703
9704         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9705         From Bruno Haible.
9706
9707 2001-01-14  Jim Meyering  <meyering@lucent.com>
9708
9709         * rename.c: New file.  From Volker Borchert.
9710         Include stdlib.h, string.h or strings.h, and xalloc.h.
9711         Use strip_trailing_slashes rather than open-coding it.
9712
9713 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9714
9715         * strftime.c: Sync with glibc time/strftime.c 1.81.
9716
9717 2001-01-03  Jim Meyering  <meyering@lucent.com>
9718
9719         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9720         local `inptr' to avoid warning with some system declarations of iconv.
9721
9722 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9723
9724         * modechange.c: Do not assume that mode_t uses the
9725         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9726         the other-execute bit of FOO even if S_IXOTH != 1.
9727
9728         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9729         WOTH, XOTH, ALLM): New macros.
9730         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9731          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9732         Use them.
9733         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9734         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9735         (mode_compile):
9736         No need to use uintmax_t; unsigned long is long enough.
9737         Don't bother to get suffix since we don't use it.
9738
9739 2000-12-24  Jim Meyering  <meyering@lucent.com>
9740
9741         * hash.c (is_prime): Return explicit boolean values.
9742         (hash_get_first): Return NULL to appease Irix5.6's 89.
9743         Reported by Nelson Beebe.
9744
9745 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9746
9747         * localcharset.c (locale_charset): Add support for Win32.
9748
9749 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9750
9751         * physmem.h, physmem.c: New files.
9752
9753         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9754         (noinst_HEADERS): Add physmem.h.
9755
9756         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9757         't' for compatibility with Solaris 8 sort.
9758
9759 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9760
9761         * config.charset: Add support for BeOS.
9762
9763 2000-12-16  Jim Meyering  <meyering@lucent.com>
9764
9765         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9766         SHELLS_FILE to a file name that's useful on djgpp systems.
9767         Include stdlib.h.
9768         (ADDITIONAL_DEFAULT_SHELLS): Define.
9769         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9770         Based mostly on a patch from Prashant TR.
9771
9772 2000-12-16  Jim Meyering  <meyering@lucent.com>
9773
9774         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9775         N and M) would have treated it like `chown N:N FILE'.
9776
9777         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9778
9779 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9780
9781         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9782         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9783         to the list of canonical encodings. Rename EUC-CN to GB2312.
9784
9785 2000-12-08  Andreas Schwab  <schwab@suse.de>
9786
9787         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9788         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9789
9790 2000-12-07  Jim Meyering  <meyering@lucent.com>
9791
9792         * stripslash.c (ISSLASH): Define.
9793         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9794         From Prashant TR.
9795
9796         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9797         (dir_name_r): Declare this function as static.
9798         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9799         manifest itself on a name containing a mix of slashes and
9800         backslashes.
9801         Make this function work with names starting with a DOS-style
9802         drive letter and colon prefix.
9803         (dir_name): Append `.' if necessary.
9804         Based mostly on patches from Prashant TR and Eli Zaretskii.
9805
9806         * dirname.h (dir_name_r): Remove prototype.
9807
9808 2000-12-05  Jim Meyering  <meyering@lucent.com>
9809
9810         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9811
9812 2000-12-04  Jim Meyering  <meyering@lucent.com>
9813
9814         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9815         Also include memory.h, stdlib.h, unistd.h if appropriate.
9816         Reported by Andreas Jaeger (conflicting declaration of malloc).
9817
9818 2000-12-02  Jim Meyering  <meyering@lucent.com>
9819
9820         * closeout.h: Make idempotent, to avoid some obscure warnings.
9821
9822 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9823
9824         * memrchr.c: Include <config.h> before any system include file.
9825
9826 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9827
9828         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9829
9830 2000-11-26  Jim Meyering  <meyering@lucent.com>
9831
9832         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9833
9834 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9835
9836         * strftime.c (my_strftime): Do not invoke mbrlen with a
9837         size of (size_t) -1; it's not portable.
9838
9839 2000-11-17  Akim Demaille  <akim@epita.fr>
9840
9841         * obstack.h: Formatting changes.
9842         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9843         prevent type checking.
9844         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9845         cast the value to (void *): assigning a `foo *' to a `void *'
9846         variable is valid.
9847         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9848
9849 2000-11-17  Jim Meyering  <meyering@lucent.com>
9850
9851         * strstr.c: Update from GNU libc.
9852
9853 2000-11-16  Jim Meyering  <meyering@lucent.com>
9854
9855         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9856
9857 2000-11-11  Jim Meyering  <meyering@lucent.com>
9858
9859         * error.c: Add a couple #includes, merging from GNU libc version.
9860
9861 2000-11-10  Jim Meyering  <meyering@lucent.com>
9862
9863         * obstack.h: Update from GNU libc.
9864         * obstack.c: Likewise.
9865
9866 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9867
9868         * getusershell.c (setusershell): Use rewind rather than
9869         fseek/fseeko, to avoid configuration hassles with fseeko.
9870         Don't bother opening SHELLS_FILE if shellstream is NULL;
9871         it's not necessary.
9872
9873 2000-11-05  Jim Meyering  <meyering@lucent.com>
9874
9875         * makepath.h (make_dir): Declare.
9876         * makepath.c (make_dir): Remove `static' attribute.
9877         Tweak a comment.
9878
9879 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9880
9881         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9882         last one in a bucket, advance to the next bucket.
9883
9884 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9885
9886         * fnmatch.c: Do not comment out all the code if we are using
9887         the GNU C library, because in some cases we are replacing buggy
9888         code in the GNU C library itself.
9889
9890 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9891
9892         * error.h, getline.h, modechange.h:
9893         Remove "2000" from Copyright line, as the file hasn't been
9894         changed this year other than in the copyright notice.
9895
9896         * xalloc.h: Add "2000" to Copyright line, as this file
9897         was changed this year.
9898
9899 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9900
9901         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9902         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9903         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9904
9905 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9906
9907         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9908         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9909         doesn't define __restrict_arr.
9910
9911 2000-10-29  Jim Meyering  <meyering@lucent.com>
9912
9913         * xstat.in: Fix grammar in comment.
9914
9915 2000-10-28  Jim Meyering  <meyering@lucent.com>
9916
9917         * memchr.c: Update from libc.
9918         Adjust for portability:
9919         [HAVE_STDLIB_H]: Include stdlib.h.
9920         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9921         Undef __memchr, too.
9922         [!weak_alias]: Define __memchr to memchr.
9923
9924         * regex.c: Update from libc.
9925         * regex.h: Likewise.
9926         * getopt1.c: Likewise.
9927         * memcmp.c: Likewise.
9928
9929         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9930         Avoid using fseek, when possible -- it's broken by design.
9931         Patch by Ulrich Drepper.
9932
9933 2000-10-26  Jim Meyering  <meyering@lucent.com>
9934
9935         * strftime.c: Update from libc.
9936
9937 2000-10-25  Jim Meyering  <meyering@lucent.com>
9938
9939         * obstack.c: Update from libc.
9940
9941 2000-10-23  Jim Meyering  <meyering@lucent.com>
9942
9943         * hard-locale.c (hard_locale): Revert last change -- it was simply
9944         wrong.  That set_locale call must not have any side effects.
9945         From Paul Eggert.
9946
9947 2000-10-22  Jim Meyering  <meyering@lucent.com>
9948
9949         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9950         [CYCLIC]: Remove now-unused definition.
9951
9952         * save-cwd.c (O_DIRECTORY): Define, if needed.
9953         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9954         Suggestion from Ulrich Drepper.
9955
9956 2000-10-21  Jim Meyering  <meyering@lucent.com>
9957
9958         * dirname.c (dir_name_r): New function, factored out of dir_name.
9959         (dir_name): Use dir_name_r.
9960         * dirname.h (dir_name_r): Declare it.
9961
9962 2000-10-21  Jim Meyering  <meyering@lucent.com>
9963
9964         * dirname.c (memrchr): Declare if necessary.
9965         (dir_name): Remove the restriction that there be no
9966         trailing slashes.  Now, this code skips past them, effectively
9967         ignoring them.
9968         [TEST_DIRNAME] (main): New unit tests.
9969
9970         * memrchr.c: New file from GNU libc.
9971         Undef __memrchr, too.
9972         [!weak_alias]: Define __memrchr to memrchr.
9973         Guard weak_alias use with `#ifdef weak_alias'.
9974
9975 2000-10-17  Jim Meyering  <meyering@lucent.com>
9976
9977         * quote.h (PARAMS): Define and use.
9978         Reported by Akim Demaille.
9979
9980         * getopt.c: Update from libc.
9981
9982 2000-10-16  Jim Meyering  <meyering@lucent.com>
9983
9984         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9985         From Jan Fedak.
9986
9987 2000-09-25  Jim Meyering  <meyering@lucent.com>
9988
9989         * md5.h (rol): Define (from GnuPG).
9990
9991         * sha.c: Give credit (GnuPG) where due.
9992         (M): Use rol rather than open-coding it.
9993         Add a FIXME comment.
9994
9995 2000-09-21  Jim Meyering  <meyering@lucent.com>
9996
9997         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9998         Reported by Michael Stone.
9999
10000 2000-09-20  Jim Meyering  <meyering@lucent.com>
10001
10002         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10003         (noinst_HEADERS): Add sha.h.
10004         Based on code from Scott G. Miller and from GnuPG.
10005
10006 2000-09-15  Jim Meyering  <meyering@lucent.com>
10007
10008         * regex.c: Update from libc.
10009
10010 2000-09-10  Jim Meyering  <meyering@lucent.com>
10011
10012         * getopt.c (_getopt_internal): Update from glibc.
10013
10014 2000-09-09  Jim Meyering  <meyering@lucent.com>
10015
10016         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10017         think it should be used as a general replacement for isascii.
10018         * fnmatch.c: Likewise.
10019         * mbswidth.c: Likewise
10020         * regex.c: Likewise.
10021
10022         Don't use atoi.
10023         * userspec.c: Include sys/param.h and limits.h.
10024         Include xstrtol.h.
10025         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10026         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10027         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10028         UID, GID.  Check range.
10029
10030 2000-09-06  Jim Meyering  <meyering@lucent.com>
10031
10032         * getopt.c (_getopt_internal): Update from glibc.
10033
10034 2000-08-30  Jim Meyering  <meyering@lucent.com>
10035
10036         * strftime.c: Merge in changes from GNU libc.
10037
10038 2000-08-26  Jim Meyering  <meyering@lucent.com>
10039
10040         * closeout.c: Include "__fpending.h".
10041         (close_stdout_status): Return right away if there's nothing to flush.
10042
10043         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10044         * __fpending.c: New file.
10045         * __fpending.h: New file.
10046
10047 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10048
10049         Standardize on "memory exhausted" instead of "Memory exhausted"
10050         or "virtual memory exhausted".
10051         * obstack.c (print_and_abort): Use "memory exhausted", not
10052         "virtual memory exhausted".
10053         * same.c (same_name): Invoke xalloc_die instead of printing
10054         our own message.
10055         * userspec.c (parse_user_spec): Likewise.
10056         * bumpalloc.h: comment fix
10057         * same.c, userspec.c: Include xalloc.h.
10058
10059         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10060         not char *const and pointing to a constant array.
10061         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10062         (xrealloc): Comment fix.
10063
10064         * userspec.c (parse_user_spec):
10065         Don't translate a message until just before returning,
10066         to avoid unnecessary translation.
10067
10068 2000-08-07  Jim Meyering  <meyering@lucent.com>
10069
10070         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10071         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10072         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10073         getgroups.c, gethostname.c, getopt.h, group-member.c,
10074         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10075         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10076         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10077         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10078         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10079         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10080         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10081         yesno.c: Back out Copyright date changes for each file with no change
10082         this year.  This eases coordination with other programs using the same
10083         source code modules.  From Paul Eggert.
10084
10085 2000-08-03  Greg McGary  <greg@mcgary.org>
10086
10087         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10088         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10089         (EXTEND_BUFFER): Use them.
10090
10091 2000-08-01  Jim Meyering  <meyering@lucent.com>
10092
10093         * dirname.c (ISSLASH): Define.
10094         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10095         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10096         both `\' and `/' may be use as path separators.
10097         Based on a patch from Prashant TR.
10098
10099 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10100
10101         * quotearg.c (quotearg_n_options): Don't make the initial
10102         slot vector a constant, since it might get modified.
10103
10104 2000-07-31  Jim Meyering  <meyering@lucent.com>
10105
10106         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10107         * obstack.c (print_and_abort): Likewise.
10108
10109 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10110
10111         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10112         buffer, so that the caller can always quote one small
10113         component of a "memory exhausted" message in slot 0.
10114         From a suggestion by Jim Meyering.
10115
10116 2000-07-30  Jim Meyering  <meyering@lucent.com>
10117
10118         * makepath.c (make_path): Quote the other instance, too.
10119
10120         * quotearg.c (N_STATIC_SLOTVECS): Define.
10121         (STATIC_BUF_SIZE): Define.
10122         (quotearg_n_options): Use only statically allocated storage when
10123         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10124         than STATIC_BUF_SIZE.
10125
10126 2000-07-29  Jim Meyering  <meyering@lucent.com>
10127
10128         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10129         * dirname.c (dir_name): Likewise.
10130
10131         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10132
10133         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10134         (dir_name): Assert that there are no trailing slashes.
10135
10136 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10137
10138         * mbswidth.h (mbswidth): Add a flags argument.
10139         (mbswidth): New declaration.
10140         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10141         * mbswidth.c (mbswidth): Add a flags argument.
10142         (mbsnwidth): New function.
10143
10144 2000-07-24  Jim Meyering  <meyering@lucent.com>
10145
10146         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10147
10148 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10149
10150         * mbswidth.c (_XOPEN_SOURCE):
10151         Don't define; this causes problems on Solaris 7.
10152         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10153
10154 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10155
10156         * quotearg.c:
10157         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10158         so that mbstate_t is always defined.
10159
10160         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10161         be 1 in at least one GCC installation, and this configuration
10162         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10163         performance on hosts that have mbrtowc but have only unibyte
10164         locales, but I assume these hosts are rare.
10165
10166 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10167
10168         * quotearg.c: Streamline by invoking multibyte code only if needed.
10169         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10170         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10171         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10172         invoke multibyte primitives.
10173
10174 2000-07-23  Jim Meyering  <meyering@lucent.com>
10175
10176         * basename.c (base_name): Add an assertion.
10177
10178 2000-07-15  Bruno Haible  <clisp.cons.org>
10179
10180         * quotearg.c: When the system forces us to redefine mbstate_t,
10181         shadow its mbsinit function.
10182
10183 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10184
10185         * mbswidth.h: New file.
10186         * mbswidth.c: New file.
10187         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10188         (noinst_HEADERS): Add mbswidth.h.
10189
10190 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10191
10192         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10193         and IRIX 6.
10194
10195 2000-07-15  Jim Meyering  <meyering@lucent.com>
10196
10197         * makepath.c: Include quote.h.
10198         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10199         corresponding argument in a `quote (...)' call.
10200         Give better diagnostics.
10201
10202         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10203         (noinst_HEADERS): Add quote.h.
10204
10205         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10206         from tar's src/misc.c.
10207         * quote.h: New file.  Prototypes for same.
10208
10209 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10210
10211         From a suggestion by Bruno Haible.
10212         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10213         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10214         to decide whether to define the BeOS workaround macro;
10215         this adjusts to the change to AC_MBSTATE_T.
10216
10217 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10218
10219         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10220
10221         * quotearg.c (quoting_style_args, quoting_style_vals,
10222         quotearg_buffer_restyled): Add support for
10223         clocale_quoting_style.  Undo previous change to
10224         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10225         and "{RIGHT QUOTATION MARK}" msgids.
10226
10227 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10228
10229         The old behavior of quoting `like this' doesn't look good with
10230         newer, ISO-style fonts.  See:
10231         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10232
10233         Instead, quote "like this" by default.  Let the translator
10234         tailor the locale-specific quoting behavior by providing
10235         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10236
10237         * quotearg.c (N_): New macro.
10238         (gettext_default): New function.
10239         (quotearg_buffer_restyled): Use
10240         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10241         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10242
10243 2000-07-09  Jim Meyering  <meyering@lucent.com>
10244
10245         * Most files: Update copyright dates to include 2000.
10246
10247 2000-07-08  Jim Meyering  <meyering@lucent.com>
10248
10249         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10250         if not defined.
10251         (xgethostname): Remove now-unnecessary #ifdef.
10252         Move declaration of `err' into loop where it's used.
10253
10254 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10255
10256         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10257         by allocating a larger buffer. Test the gethostname return value for
10258         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10259         returns an error and ENAMETOOLONG isn't defined.
10260
10261 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10262         and Bruno Haible  <haible@clisp.cons.org>
10263
10264         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10265
10266 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10267
10268         * quotearg.c (struct quoting_options): Simplify quote_these_too
10269         dimension.
10270
10271 2000-07-03  Jim Meyering  <meyering@lucent.com>
10272
10273         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10274         Reported by Bruno Haible.
10275
10276 2000-07-04  Jim Meyering  <meyering@lucent.com>
10277
10278         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10279         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10280         lacks mbrtowc.
10281
10282 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10283         and Bruno Haible  <haible@clisp.cons.org>
10284
10285         * quotearg.c (mbrtowc):
10286         Assign to *pwc, and return 1 only if result is nonzero.
10287         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10288
10289 2000-07-03  Jim Meyering  <meyering@lucent.com>
10290
10291         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10292         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10293         From Bob Proulx.
10294
10295 2000-07-02  Jim Meyering  <meyering@lucent.com>
10296
10297         * quotearg.c (mbstate_t): Don't define here.
10298
10299 2000-07-02  Jim Meyering  <meyering@lucent.com>
10300
10301         * nanosleep.c (SIGCONT): Define if not already defined.
10302
10303 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10304
10305         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10306         per change in ../m4/ls-mntd-fs.m4.
10307         (read_filesystem_list): Ignore symbolic links.
10308
10309 2000-06-29  Jim Meyering  <meyering@lucent.com>
10310
10311         * same.c: Include <string.h> or <strings.h>, as appropriate,
10312         for declaration of strcmp.
10313
10314         * long-options.c: Include <stdlib.h>, for declaration of exit.
10315
10316         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10317         Avoid warning by casting result to `char *' to remove `const'.
10318
10319 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10320
10321         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10322
10323 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10324
10325         savedir now sets errno on failure and invokes xmalloc to get memory.
10326         Fix a couple of other minor bugs while we're at it.
10327
10328         * savedir.c (<unistd.h>): Do not include; there's no need.
10329         (NAMLEN): Remove macro.
10330         (malloc, realloc): Remove decls.
10331         (stpcpy): Likewise.
10332         ("xalloc.h"): Include.
10333         (NAME_SIZE_DEFAULT): New macro.
10334         (savedir): Use xmalloc / xrealloc to allocate memory.
10335         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10336         Skip "" directory entries.
10337         Use strlen to calculate directory entry length, since the old method
10338         is rarely used these days and isn't worth supporting.
10339         Don't use a pointer after freeing it.
10340         Check for integer overflow when calculating allocation size.
10341         Use memcpy to copy entries, instead of stpcpy.
10342         Set errno properly when returning NULL.
10343         Check for readdir error.
10344
10345 2000-06-26  Jim Meyering  <meyering@lucent.com>
10346
10347         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10348
10349 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10350
10351         * getusershell.c (xmalloc, xrealloc): Remove functions.
10352         Include xalloc.h.
10353         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10354
10355 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10356
10357         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10358
10359 2000-06-24  Jim Meyering  <meyering@lucent.com>
10360
10361         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10362
10363 2000-06-21  Jim Meyering  <meyering@lucent.com>
10364
10365         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10366
10367 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10368
10369         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10370         (mbrtowc, mbstate_t): Define substitutes if
10371         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10372         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10373         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10374
10375 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10376
10377         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10378         than 1024, return a memory chunk of least possible size, instead
10379         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10380         Use free/xmalloc instead of xrealloc to avoid copying for very long
10381         paths.
10382
10383 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10384
10385         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10386         address, not strdup.  Include <stdlib.h> and don't declare free().
10387
10388 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10389
10390         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10391         the empty string.
10392
10393 2000-06-21  Jim Meyering  <meyering@lucent.com>
10394
10395         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10396         (noinst_HEADERS): Add getstr.h.
10397
10398         * getline.c (getstr): Move into a separate file.
10399         * getstr.c (getstr): New file, extracted from getline.c, with
10400         the following changes: new parameter, delim2; both delim[12]
10401         parameters have type `int', not `char'.  The latter would lose
10402         with 8-bit delimiters.
10403         * getstr.h: New file.
10404
10405 2000-06-19  Jim Meyering  <meyering@lucent.com>
10406
10407         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10408
10409 2000-06-18  Jim Meyering  <meyering@lucent.com>
10410
10411         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10412         Besides, these days every porting target provides a mkdir function.
10413
10414         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10415         (this snippet comes from src/system.h).
10416
10417 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10418
10419         * human.c (adjust_value): New function.
10420         (human_readable_inexact): Apply rounding style even when
10421         printing approximate values.
10422
10423 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10424
10425         * human.c (human_readable_inexact): Allow an input block
10426         size that is not a multiple of the output block size, and vice versa.
10427         Reported by Piergiorgio Sartor.
10428
10429 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10430
10431         * getdate.y (get_date): Apply relative times after time
10432         zone indicator, not before.  Reported by Todd A. Jacobs.
10433
10434 2000-06-13  Jim Meyering  <meyering@lucent.com>
10435
10436         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10437
10438         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10439
10440 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10441
10442         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10443
10444 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10445
10446         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10447
10448 2000-06-04  Jim Meyering  <meyering@lucent.com>
10449
10450         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10451         SunOS 4.1.4 for which gid_t is an unsigned type.
10452
10453 2000-06-03  Jim Meyering  <meyering@lucent.com>
10454
10455         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10456
10457 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10458
10459         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10460         newer, don't install charset.alias.
10461         * config.charset: Change the Linux/glibc rules so they become empty
10462         on glibc-2.1 or newer.
10463
10464 2000-06-02  Jim Meyering  <meyering@lucent.com>
10465
10466         * mountlist.c: Back out last change.  Instead, do this...
10467         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10468         member using the same `ignore'-testing code.
10469         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10470         fs_type strings.
10471         From Mark D. Roth.
10472
10473 2000-05-29  Jim Meyering  <meyering@lucent.com>
10474
10475         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10476         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10477
10478 2000-05-22  Jim Meyering  <meyering@lucent.com>
10479
10480         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10481
10482 2000-05-18  Jim Meyering  <meyering@lucent.com>
10483
10484         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10485         back, too, since it may have been modified by allocate_entry.
10486         (hash_delete): Rewrite to use neither the assignment operator
10487         nor the comma operator in an if-expression.
10488
10489 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10490
10491         * closeout.c:
10492         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10493         Remove; no longer needed.
10494         "quotearg.h": Add include.
10495         (file_name): Do not bother to explicitly initialize to NULL; it's less
10496         efficient on some hosts.
10497         (close_stdout_status): Remove test as to whether stdout was already
10498         closed; it breaks for the case "echo x | sort >&-".
10499         Quote file name colons.
10500         Do not assume that _("write error") lacks format strings.
10501
10502 2000-05-15  Jim Meyering  <meyering@lucent.com>
10503
10504         * version-etc.c (version_etc_copyright): Update the copyright string
10505         used in all --version output.
10506
10507 2000-05-14  Jim Meyering  <meyering@lucent.com>
10508
10509         * closeout.c (close_stdout_set_file_name): New function.
10510         (close_stdout_status): Use new file-scoped global.
10511         Return right away if fstat says the stdout file descriptor is invalid.
10512         * closeout.h (close_stdout_set_file_name): Declare.
10513
10514 2000-05-10  Jim Meyering  <meyering@lucent.com>
10515
10516         * closeout.c [default_exit_status]: New file-scoped variable.
10517         (close_stdout_set_status): New function.
10518         * closeout.h (close_stdout_set_status): Declare.
10519
10520 2000-05-08  Jim Meyering  <meyering@lucent.com>
10521
10522         * long-options.c: Don't include closeout.h.
10523         (parse_long_options): Don't call close_stdout for --version.
10524
10525 2000-05-06  Jim Meyering  <meyering@lucent.com>
10526
10527         * strnlen.c: Undefine __strnlen and strnlen.
10528         [!weak_alias]: Define __strnlen to strnlen.
10529
10530         * atexit.c: New file, from libiberty.
10531
10532 2000-05-06  Jim Meyering  <meyering@lucent.com>
10533
10534         * closeout.c (close_stdout_status): Also check for errors on the
10535         stderr stream.
10536
10537 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10538
10539         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10540         instead of xmalloc, xrealloc, path_concat.
10541         (locale_charset): Treat empty environment variables as absent.
10542         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10543
10544 2000-05-04  Jim Meyering  <meyering@lucent.com>
10545
10546         * getopt.c: Update from glibc.
10547         * obstack.c: Likewise.
10548         * obstack.h: Likewise.
10549         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10550
10551         * regex.h: Likewise.
10552         * strndup.c: Likewise.
10553         * strnlen.c: New file, from glibc.
10554
10555 2000-05-01  Jim Meyering  <meyering@lucent.com>
10556
10557         * full-write.c (full_write): Remove `FIXME' part of comment.
10558
10559 2000-04-29  Jim Meyering  <meyering@lucent.com>
10560
10561         * path-concat.c: Declare strdup only if it's not defined.
10562         * canon-host.c: Likewise.
10563
10564 2000-04-28  Jim Meyering  <meyering@lucent.com>
10565
10566         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10567         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10568         included first, then limits.h is included by locale.h by libintl.h.
10569         From John David Anglin.
10570
10571 2000-04-25  Jim Meyering  <meyering@lucent.com>
10572
10573         * makepath.c (S_IRWXUGO): Define.
10574         (make_path): Always perform explicit chmod if MODE specifies any
10575         of the `special' permission bits.  Prompted by a bug report against
10576         install from Mate Wierdl and Joost van Baal.
10577
10578 2000-04-18  Jim Meyering  <meyering@lucent.com>
10579
10580         * README: New file.
10581
10582         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10583         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10584
10585 2000-04-17  Jim Meyering  <meyering@lucent.com>
10586
10587         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10588         the definition of it to rpl_strftime also defined-away the system's
10589         declaration.
10590
10591 2000-04-15  Jim Meyering  <meyering@lucent.com>
10592
10593         Use `C' to denote so-called `contiguous' files, the same way
10594         that tar does.
10595         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10596         (ftypelet): Use S_ISCTG.
10597         From Michael Deutschmann.
10598
10599 2000-04-14  Jim Meyering  <meyering@lucent.com>
10600
10601         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10602
10603 2000-04-08  Jim Meyering  <meyering@lucent.com>
10604
10605         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10606         names don't conflict.  Reported by Eli Zaretskii.
10607
10608 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10609
10610         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10611         bug.  Deal with the different error behavior of Irix iconv.
10612
10613 2000-04-07  Jim Meyering  <meyering@lucent.com>
10614
10615         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10616         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10617
10618 2000-04-05  Jim Meyering  <meyering@lucent.com>
10619
10620         Portability tweaks required for ultrix4.3.
10621         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10622         * readutmp.c: Include sys/types.h before sys/stat.h.
10623         * canon-host.c: Declare strdup.
10624         * path-concat.c: Likewise.
10625         From John David Anglin.
10626
10627 2000-04-04  Jim Meyering  <meyering@lucent.com>
10628
10629         Be more DOS 8.3-friendly.
10630         * ref-add.sin: Renamed from ref-add.sed.in.
10631         * ref-del.sin: Renamed from ref-del.sed.in.
10632         * Makefile.am: Reflect renaming.
10633         Reported by Eli Zaretskii.
10634
10635         Use a temporary file name that won't clash with `charset.alias'
10636         in the DOS 8.3 name space.
10637         * Makefile.am (charset_tmp): Define.
10638         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10639         (uninstall-local): Likewise.
10640         Reported by Eli Zaretskii.
10641
10642 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10643
10644         * time/strftime.c (my_strftime): Make sure we call the system
10645         strftime, not ourselves, when invoking the underlying strftime.
10646
10647 2000-03-24  Jim Meyering  <meyering@lucent.com>
10648
10649         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10650         (charset_alias): Define.
10651         (install-exec-local): Factor out common code.
10652         (uninstall-local): Split lines longer than 80.
10653         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10654         (SUFFIXES): Define.
10655         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10656         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10657
10658 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10659
10660         * config.charset: Output a line containing "Packages using this file".
10661         * ref-add.sed.in, ref-del.sed.in: New files.
10662         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10663         ref-del.sed): New rules.
10664
10665 2000-03-17  Jim Meyering  <meyering@lucent.com>
10666
10667         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10668         Otherwise, include <strings.h>
10669
10670 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10671
10672         * unicodeio.c (utf8_wctomb): New function.
10673         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10674         format instead of in UCS-4 with platform dependent endianness.
10675
10676 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10677
10678         * savedir.c (savedir): Work even if directory size is
10679         negative; this can happen with some screwy NFS configurations.
10680
10681 2000-03-06  Jim Meyering  <meyering@lucent.com>
10682
10683         * localcharset.c (get_charset_aliases): Don't try to free file_name
10684         if it's NULL (because we ran out of memory).  From Bruno Haible.
10685
10686 2000-03-05  Jim Meyering  <meyering@lucent.com>
10687
10688         * localcharset.c ("path-concat.h"): Include.
10689         (get_charset_aliases): Use path_concat instead of ANSI string
10690         concatenation.
10691
10692         * unicodeio.h (PARAMS): Define.
10693         Use it to guard prototype.
10694
10695 2000-03-04  Jim Meyering  <meyering@lucent.com>
10696
10697         * Makefile.am (install-exec-local): Create $(libdir) before installing
10698         into it.
10699         (uninstall-local): Uncomment this rule so `make distcheck' works
10700         once again.
10701
10702         * unicodeio.c (<errno.h>): Include it.
10703         (errno): Declare if not defined.
10704
10705         * localcharset.c: Add Bruno's comment justifying use of volatile.
10706
10707         * config.charset: New version, incorporating remarks from a linux
10708         i18n mailing list.  From Bruno Haible.
10709
10710 2000-03-02  Jim Meyering  <meyering@lucent.com>
10711
10712         * Makefile.am (EXTRA_DIST): Add config.charset.
10713
10714 2000-03-01  Jim Meyering  <meyering@lucent.com>
10715
10716         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10717         * unicodeio.c: Likewise.
10718
10719 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10720
10721         * config.charset: New file.
10722         * localcharset.c: New file.
10723         * unicodeio.h, unicodeio.c: New files.
10724         * Makefile.am (DEFS): Add -DLIBDIR=...
10725         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10726         (noinst_HEADERS): Add unicodeio.h.
10727         (all-local, install-exec-local, charset.alias): New targets.
10728
10729 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10730
10731         * quotearg.c (ALERT_CHAR): New macro.
10732         (quotearg_buffer_restyled): Use it.
10733
10734 2000-02-27  Jim Meyering  <meyering@lucent.com>
10735
10736         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10737         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10738
10739         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10740         not `#if STDC_HEADERS'.
10741         Declare malloc if needed.
10742
10743         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10744         now that autoconf always defines the HAVE_DECL_ symbols.
10745         * human.c: Likewise.
10746         * same.c: Likewise.
10747         * strtoumax.c: Likewise.
10748
10749         * backupfile.c: Arrange for cpp to fail if the configure-time
10750         declaration check was not run.
10751         * hash.c: Likewise.
10752         * human.c: Likewise.
10753         * same.c: Likewise.
10754         * strtoumax.c: Likewise.
10755
10756         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10757         then first look up the entire `.'-containing string as a login name.
10758
10759 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10760
10761         * getdate.y: Handle two-digit years with leading zeros correctly.
10762         (textint): New typedef.
10763         (parser_control): Member year changed from int to textint.
10764         All uses changed.
10765         (YYSTYPE): Removed; replaced by %union with int and textint members.
10766         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10767         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10768         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10769         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10770         (date, number, to_year): Use width of number in digits, not its value,
10771         to determine whether it's a 2-digit year, or a 2-digit time.
10772         (yylex): Store number of digits of numeric tokens.
10773         Reported by John Kendall.
10774
10775         (parser_control): Changed from struct parser_control to typedef (for
10776         consistency).  All uses changed.
10777
10778         (tID): Removed; not used.
10779         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10780
10781 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10782
10783         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10784         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10785
10786 2000-02-12  Jim Meyering  <meyering@lucent.com>
10787
10788         * userspec.c (ISDIGIT): Define it.
10789         (isdigit): Remove definition.
10790         (is_number): Use ISDIGIT, not isdigit.
10791         <libintl.h>: Include.
10792         (_ and N_): Define.
10793         (parse_user_spec): Mark translatable strings.
10794
10795 2000-02-10  Jim Meyering  <meyering@lucent.com>
10796
10797         With these changes, nanosleep.[ch] are finally enough like the other
10798         lib/* replacement files to compile on a few more losing systems.
10799
10800         * nanosleep.h: Don't include config.h.
10801         Remove prototype from declaration of nanosleep.
10802         (PARAMS): Remove now-unneeded definition.
10803         * nanosleep.c: #undef nanosleep.
10804         (rpl_nanosleep): Rename from nanosleep.
10805
10806 2000-02-03  Jim Meyering  <meyering@lucent.com>
10807
10808         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10809         rather than with `#if HAVE_UTMPNAME'.
10810
10811 2000-02-01  Jim Meyering  <meyering@lucent.com>
10812
10813         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10814
10815 2000-01-31  Jim Meyering  <meyering@lucent.com>
10816
10817         * nanosleep.h (nanosleep): Guard declaration with
10818         `#if ! HAVE_DECL_NANOSLEEP'.
10819         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10820         the declaration in that vendor's sys/timers.h.
10821         Reported by Christian Krackowizer.
10822
10823         * quotearg.c (ISASCII): Add #undef and move definition to follow
10824         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10825         (ISPRINT): Likewise.
10826         Reported by Tom Tromey.
10827
10828 2000-01-30  Jim Meyering  <meyering@lucent.com>
10829
10830         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10831         uses of ->ut_name.  The latter doesn't work with new Linux header files
10832         where only utmpx.ut_user is declared.
10833
10834         * readutmp.h (UT_USER): Define.
10835
10836 2000-01-23  Jim Meyering  <meyering@lucent.com>
10837
10838         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10839         obstack.c.
10840
10841 2000-01-22  Jim Meyering  <meyering@lucent.com>
10842
10843         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10844         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10845         Required for some AIX systems.  Reported by Christian Krackowizer.
10846         [TESTING] (main): New function.
10847
10848         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10849         * dirname.c (dir_name): Support for DOS-style file names with drive
10850         letters.
10851
10852         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10853
10854         * strverscmp.c (ISDIGIT): Define.
10855         (strverscmp): Use ISDIGIT, not isdigit.
10856
10857 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10858
10859         * nanosleep.c (nanosleep):
10860         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10861         POSIX.1 doesn't require SA_INTERRUPT and some systems
10862         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10863         it's been part of POSIX.1 since day 1 (in 1988).
10864
10865 2000-01-17  Jim Meyering  <meyering@lucent.com>
10866
10867         * interlock: Remove unused file.  Reported by François Pinard.
10868
10869 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10870
10871         * quotearg.c (quotearg_buffer_restyled): Do not quote
10872         alert, backslash, formfeed, and vertical tab unnecessarily in
10873         shell quoting style.
10874
10875
10876 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10877 Free Software Foundation, Inc.
10878 Copying and distribution of this file, with or without modification,
10879 are permitted provided the copyright notice and this notice are preserved.