Fix return type.
[gnulib.git] / lib / ChangeLog
1 2006-10-03  Bruno Haible  <bruno@clisp.org>
2
3         * gl_oset.c (gl_oset_add): Fix return type.
4
5 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
6
7         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
8
9 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
10
11         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
12
13 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
14
15         Work around bug in Solaris 10 /proc file system:
16         /proc/self/fd/NNN/.. isn't the parent directory of
17         the directory whose file descriptor is NNN.  This needs to
18         be worked around at run time, not compile time, since a
19         program might be built on Solaris 8, where things work, and
20         run on Solaris 10.
21         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
22         to use the following interface instead:
23         (OPENAT_BUFFER_SIZE): New macro.
24         (openat_proc_name): New function.
25         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
26         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
27         Likewise.
28         * openat-proc.c: New file.
29
30 2006-09-29  Bruno Haible  <bruno@clisp.org>
31
32         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
33         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
34         argument. Set stdout_closed before testing for ferror, not after.
35         (fwriteerror, fwriteerror_no_ebadf): New functions.
36
37 2006-09-28  Bruno Haible  <bruno@clisp.org>
38
39         * strndup.h: Simplify the redefinition of strndup.
40         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
41
42 2006-09-28  Bruno Haible  <bruno@clisp.org>
43
44         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
45         * gl_linkedhash_list.c: Likewise.
46         * gl_rbtreehash_list.c: Likewise.
47
48 2006-09-28  Jim Meyering  <jim@meyering.net>
49
50         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
51         Include <unistd.h>.
52
53 2006-09-27  Jim Meyering  <jim@meyering.net>
54
55         This file could end up with a definition for a function
56         named __strndup, rather than rpl_strndup on a system with
57         incomplete weak_alias support.
58         * strndup.c (strndup): Rename from __strndup.
59         Remove #defines that used to map __strndup to strndup.
60         Don't use K&R prototypes.
61         Remove LIBC-related code, since this file is not sync'd with glibc.
62         * strndup.h: Revamp, accordingly.
63
64 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
65
66         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
67         getaddrinfo.
68
69         * __fpending.h: Don't include <stdio_ext.h> unless
70         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
71         it causes <stdio_ext.h> to cause a compile-time error.
72         Problem reported by Nelson H. F. Beebe.
73         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
74         of HAVE_DECL___PENDING.
75
76 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
77
78         * savewd.c: Include <signal.h>, for 'raise'.
79
80 2006-09-26  Eric Blake  <ebb9@byu.net>
81
82         * verror.c: Include <config.h> unconditionally.
83
84 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
85
86         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
87         (gl_linked_iterator_from_to): Initialize struct completely.
88         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
89         (gl_tree_iterator_from_to): Likewise
90         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
91         * gl_array_list.c [lint] (gl_array_iterator)
92         (gl_array_iterator_from_to): Likewise.
93         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
94         * gl_carray_list.c [lint] (gl_carray_iterator)
95         (gl_carray_iterator_from_to): Likewise.
96
97         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
98         * md4.c (md4_process_block): Remove unused variable.
99         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
100         parentheses for clarity.
101
102 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
103
104         Import this patch from libc:
105
106         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
107
108         * regex_internal.c (re_string_reconstruct): Handle
109         offset < pstr->valid_raw_len && pstr->offsets_needed case.
110         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
111         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
112         re_string_context_at.
113
114 2006-09-20  Bruno Haible  <bruno@clisp.org>
115
116         * mkdtemp.c: Import from libc.
117         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
118                 * sysdeps/posix/tempname.c (__gen_tempname): Change
119                 attempts_min into a macro.  Use preprocessor to decide how to
120                 initialize attempts [Coverity CID 67].
121         2001-11-27  Paul Eggert  <eggert@twinsun.com>
122                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
123                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
124
125 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
126
127         * mkstemp.h: New file, since some standard headers
128         #define mkstemp.
129         * mkstemp.c: Revamp to put the !_LIBC code together.
130         Include "mkstemp.h".
131         Make the _LIBC code resemble glibc original more,
132         e.g., use K&R style.
133         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
134         (mkstemp): Remove, since mkstemp.h does this for us.
135         * stdlib--.h: Include mkstemp.h.
136
137         Import this patch from libc:
138
139         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
140
141         * tempname.c (__gen_tempname): Change attempts_min
142         into a macro.  Use preprocessor to decide how to initialize
143         attempts [Coverity CID 67].
144
145 2006-09-18  Bruno Haible  <bruno@clisp.org>
146
147         * javaversion.c: Include configmake.h.
148
149 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
150
151         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
152         that prevented coreutils 6.1 from building.  Problem reported
153         by Petter Reinholdtsen.
154
155 2006-09-18  Jim Meyering  <jim@meyering.net>
156
157         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
158
159 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
160
161         * dirchownmod.c: Don't include fcntl.h; no longer needed.
162         (dirchownmod): New arg FD.  All callers changed.
163         Use FD rather than opening the directory ourself, as opening is
164         now the caller's responsibility.
165         * dirchownmod.h: Likewise.
166         * mkancesdirs.c: Include <sys/types.h>, for portability to older
167         hosts that require <sys/types.h> before <sys/stat.h>.  Include
168         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
169         (test_dir): Remove.
170         (mkancesdirs): Return length of prefix of FILE that has already
171         been made, or -2 if there is a child doing the work.  Redo
172         algorithm so that it is O(N) rather than O(N**2).  Optimize away
173         ".", and treat ".." specially since it might stray back into
174         already-created areas.  Use a subprocess if necessary.  New arg
175         WD; all users changed.  MAKE_DIR function should now return 1
176         if it creates a directory that is not readable.  Return -2 if
177         a child process is spun off.
178         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
179         Adjust signature to match code.
180         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
181         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
182         all users changed.
183         * savewd.c, savewd.h: New files.
184
185 2006-09-15  Jim Meyering  <jim@meyering.net>
186
187         * rename-dest-slash.c (has_trailing_slash): Use
188         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
189         (rpl_rename_dest_slash): Perform the cheaper trailing slash
190         test before testing whether SRC is a directory.
191         Suggestions from Bruno Haible.
192
193         Avoid a warning about an unused variable.
194         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
195         into the #ifdef block where it's used.
196
197         * rename-dest-slash.c: New file.
198
199 2006-09-14  Bruno Haible  <bruno@clisp.org>
200
201         * allocsa.c: Include <config.h> unconditionally.
202         * asnprintf.c: Likewise.
203         * asprintf.c: Likewise.
204         * c-strcasecmp.c: Likewise.
205         * c-strcasestr.c: Likewise.
206         * c-strncasecmp.c: Likewise.
207         * c-strstr.c: Likewise.
208         * classpath.c: Likewise.
209         * clean-temp.c: Likewise.
210         * concatpath.c: Likewise.
211         * copy-file.c: Likewise.
212         * csharpcomp.c: Likewise.
213         * csharpexec.c: Likewise.
214         * execute.c: Likewise.
215         * fatal-signal.c: Likewise.
216         * findprog.c: Likewise.
217         * fwriteerror.c: Likewise.
218         * gl_array_list.c: Likewise.
219         * gl_array_oset.c: Likewise.
220         * gl_avltree_list.c: Likewise.
221         * gl_avltree_oset.c: Likewise.
222         * gl_avltreehash_list.c: Likewise.
223         * gl_carray_list.c: Likewise.
224         * gl_linked_list.c: Likewise.
225         * gl_linkedhash_list.c: Likewise.
226         * gl_list.c: Likewise.
227         * gl_oset.c: Likewise.
228         * gl_rbtree_list.c: Likewise.
229         * gl_rbtree_oset.c: Likewise.
230         * gl_rbtreehash_list.c: Likewise.
231         * imaxabs.c: Likewise.
232         * imaxdiv.c: Likewise.
233         * javacomp.c: Likewise.
234         * javaexec.c: Likewise.
235         * javaversion.c: Likewise.
236         * linebreak.c: Likewise.
237         * localcharset.c: Likewise.
238         * lock.c: Likewise.
239         * mbchar.c: Likewise.
240         * mbswidth.c: Likewise.
241         * mkdtemp.c: Likewise.
242         * pipe.c: Likewise.
243         * printf-args.c: Likewise.
244         * printf-parse.c: Likewise.
245         * progname.c: Likewise.
246         * progreloc.c: Likewise.
247         * readlink.c: Likewise.
248         * sh-quote.c: Likewise.
249         * stpcpy.c: Likewise.
250         * stpncpy.c: Likewise.
251         * strcasecmp.c: Likewise.
252         * strcasestr.c: Likewise.
253         * strcspn.c: Likewise.
254         * striconv.c: Likewise.
255         * strncasecmp.c: Likewise.
256         * strnlen1.c: Likewise.
257         * strstr.c: Likewise.
258         * strtok_r.c: Likewise.
259         * tls.c: Likewise.
260         * tmpdir.c: Likewise.
261         * unicodeio.c: Likewise.
262         * unsetenv.c: Likewise.
263         * vasnprintf.c: Likewise.
264         * vasprintf.c: Likewise.
265         * wait-process.c: Likewise.
266         * xallocsa.c: Likewise.
267         * xsetenv.c: Likewise.
268         * xstriconv.c: Likewise.
269
270 2006-09-13  Eric Blake  <ebb9@byu.net>
271
272         * getopt.c: Fix typo in last commit.
273
274 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
275
276         * _fpending.c: Include <config.h> unconditionally, since we no
277         longer worry about uses that don't define HAVE_CONFIG_H.
278         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
279         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
280         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
281         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
282         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
283         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
284         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
285         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
286         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
287         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
288         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
289         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
290         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
291         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
292         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
293         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
294         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
295         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
296         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
297         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
298         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
299         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
300         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
301         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
302         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
303         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
304         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
305         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
306         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
307         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
308         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
309         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
310         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
311         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
312         Likewise.
313
314 2006-09-12  Jim Meyering  <jim@meyering.net>
315
316         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
317         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
318         Reported by Nelson H. F. Beebe.
319
320 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
321
322         * argp-help.c (argp_doc): Make sure NULL is not passed to
323         dgettext.
324
325 2006-09-10  Bruno Haible  <bruno@clisp.org>
326
327         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
328
329 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
330
331         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
332         program_invocation_name and program_invocation_short_name are
333         initialized.
334         * argp-namefrob.h: Move declarations of program_invocation_name
335         and program_invocation_short_name to argp.h, so they are visible
336         to user programs.
337         * argp.h: Likewise
338
339 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
340
341         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
342         convention.  Text proposed by Bruno Haible.
343         (struct argp_option): Document the use of N_() wrappers.
344
345         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
346         and translate the two parts separately, instead of feeding
347         the whole string to gettext.  This allows to exclude
348         '\v' from the strings visible to the translator by writing doc
349         strings as N_("..") "\v" N_("..").
350
351 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
352
353         * mktime.c (guess_time_tm): Fix bug where mktime
354         returned the maximum time_t value rather than (time_t) -1.
355         Problem originally reported by William Bardwell
356         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
357
358         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
359         Moved to here ...
360         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
361         ... from here.
362
363 2006-09-06  Bruno Haible  <bruno@clisp.org>
364
365         * striconv.h: New file.
366         * striconv.c: New file, merging iconvme.c with GNU gettext's
367         iconvstring.c.
368         * xstriconv.h: New file.
369         * xstriconv.c: New file.
370
371 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
372
373         * argz_.h: Sync from Libtool.
374
375         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
376                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
377
378         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
379
380 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
381
382         * trim.h: New file.
383         * trim.c: New file.
384
385 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
386
387         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
388         Problem reported by Ralf Wildenhues in
389         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
390
391         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
392         HAVE_STRUCT_STATFS_F_FSTYPENAME.
393
394 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
395
396         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
397         or stdbool.h, because they might not exist while configuring.
398
399         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
400         Don't include unistd.h or limits.h; not needed, since chdir-long.h
401         does that for us.
402         (O_DIRECTORY): Remove.
403
404 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
405
406         Work around a bug in both the Linux and SunOS 64-bit kernels:
407         nanosleep mishandles sleeps for longer than 2**31 seconds.
408         Problem reported by Frank v Waveren in
409         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
410         * nanosleep.c (BILLION): New constant.
411         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
412         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
413
414 2006-08-30  Jim Meyering  <jim@meyering.net>
415
416         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
417         the parameter.
418
419 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
420
421         * isapipe.c, isapipe.h: New files.
422
423 2006-08-29  Eric Blake  <ebb9@byu.net>
424
425         * error.c (error_at_line, print_errno_message): Match libc, after
426         resolution of upstream bug 3044.
427
428 2006-08-29  Bruno Haible  <bruno@clisp.org>
429
430         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
431
432 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
433
434         Sync from Libtool:
435
436         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
437
438         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
439         sharing with gnulib.  Report by Eric Blake.
440
441 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
442
443         * fcntl_.h: New file.
444         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
445         the fcntl module.
446         * dirchownmod.c: Likewise.
447         * fts.c: Likewise.
448
449         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
450         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
451         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
452         just before including <inttypes.h>, to avoid circular inclusion.
453
454 2006-08-28  Bruno Haible  <bruno@clisp.org>
455
456         * inttypes_.h (SCNX*): Remove definitions.
457         Reported by Eric Blake.
458
459 2006-08-26  Bruno Haible  <bruno@clisp.org>
460
461         * vasnprintf.c (EOVERFLOW): Remove definition.
462         (VASNPRINTF): Return a string of length > INT_MAX without failing.
463         * vasprintf.c: Include errno.h, limits.h.
464         (EOVERFLOW): New fallback definition.
465         (vasprintf): Test here whether the string length is > INT_MAX.
466         * vsnprintf.c: Include errno.h, limits.h.
467         (EOVERFLOW): New fallback definition.
468         (vsnprintf): Fix bug when generated string was too long for the buffer.
469         Test here whether the string length is > INT_MAX.
470
471 2006-08-26  Bruno Haible  <bruno@clisp.org>
472             Simon Josefsson  <jas@extundo.com>
473
474         BeOS portability.
475         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
476
477 2006-08-28  Bruno Haible  <bruno@clisp.org>
478
479         * c-strstr.h: New file, from GNU gettext.
480         * c-strstr.c: New file, from GNU gettext.
481
482 2006-08-26  Bruno Haible  <bruno@clisp.org>
483
484         * inttypes_.h: New file.
485         * inttypes.h: Remove file.
486         * stdint_.h: Include <inttypes.h> through its absolute filename.
487
488         * imaxabs.c: New file.
489
490         * imaxdiv.c: New file.
491
492 2006-08-22  Bruno Haible  <bruno@clisp.org>
493
494         * readutmp.h: Skip most definitions if neither <utmp.h> nor
495         <utmpx.h> exists.
496
497 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
498
499         BeOS portability.
500         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
501         Problem reported by Bruno Haible.
502
503 2006-08-21  Bruno Haible  <bruno@clisp.org>
504
505         BeOS portability.
506         * mbchar.h: Include <wctype.h> only if it exists.
507
508 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
509
510         * cycle-check.h: Include <stdint.h> unconditionally, since we
511         now assume the stdint module.  Do not include inttypes.h.
512         * fsusage.h: Likewise.
513         * getndelim2.c: Likewise.
514         * human.h: Likewise.
515         * inttostr.h: Likewise.
516         * obstack.c: Likewise.
517         * regex_internal.h: Likewise.
518         * tempname.c: Likewise.
519         * utimecmp.c: Likewise.
520         * xstrtol.h: Likewise.
521
522         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
523
524         * strtoimax.c: Adjust to macro name changes in Autoconf,
525         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
526         * xtime.h: Likewise.
527
528 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
529
530         * fchmodat.c: New file, from coreutils.  This was inadvertently
531         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
532
533 2006-08-18  Bruno Haible  <bruno@clisp.org>
534
535         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
536         (ME_DUMMY): Treat "kernfs" as a dummy.
537         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
538
539 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
540
541         Update from coreutils.
542
543         * __fpending.h: Add copyright notice.
544         * fprintftime.h: Likewise.
545         * savedir.c: Use (C) in copyright notice.
546         * savedir.h: Likewise.
547
548         2006-08-15  Jim Meyering  <jim@meyering.net>
549
550         * at-func.c: New file, with the logic of all emulated at-functions.
551         * openat-priv.h: Include <errno.h> and define ENOSYS,
552         in support of the EXPECTED_ERRNO macro.
553         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
554         Instead, define the appropriate symbols and include "at-func.c".
555         * mkdirat.c (mkdirat): Likewise.
556         * fchmodat.c (fchmodat): Likewise.
557         (ENOSYS): Remove definition.
558         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
559         Don't include "unistd--.h" -- it wasn't ever used.
560
561         2006-01-17  Jim Meyering  <jim@meyering.net>
562
563         Rewrite fts.c not to change the current working directory,
564         by using openat, fstatat, fdopendir, etc..
565
566         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
567         (HAVE_OPENAT_SUPPORT): Define.
568         [_LIBC] (fchdir): Don't undef or define; no longer used.
569         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
570         Now, this `function' always succeeds, and consumes its file descriptor
571         parameter -- so callers must not close such FDs.  Update callers.
572         (diropen_fd, opendirat, cwd_advance_fd): New functions.
573         (diropen): Add parameter, SP.  Adjust all callers.
574         Implement using diropen_fd, rather than open.
575         (fts_open): Initialize new member, fts_cwd_fd.
576         Remove fts_rft-setting code.
577         (fts_close): Close fts_cwd_fd, if necessary.
578         (__opendir2): Define in terms of opendir or opendirat,
579         depending on whether the FST_NOCHDIR flag is set.
580         (fts_build): Since fts_safe_changedir consumes its FD, and since
581         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
582         and close the dup'd file descriptor upon failure.
583         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
584         (fts_safe_changedir): Tweak semantics to reflect that this function
585         now calls cwd_advance_fd and hence consumes its FD argument.
586         * fts_.h [struct FTS] (fts_cwd_fd): New member.
587         [struct FTS] (fts_rft): Remove now-unused member.
588         [struct FTS] (fts_cycle.state): Improve comment.
589
590         * openat.c (openat_needs_fchdir): New function.
591         * openat.h (openat_needs_fchdir): Declare it.
592
593 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
594
595         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
596         Problem and fix reported by Pádraig Brady in
597         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
598
599 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
600
601         * memcoll.c (memcoll): Optimize for the common case where the
602         arguments are bytewise equal.
603
604 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
605
606         Change copyright notice from LGPL 2 to GPL 2, since that's the
607         standard form used in the gnulib repository.
608         * lock.c: LGPL -> GPL.
609         * lock.h: Likewise.
610         * strnlen1.c: Likewise.
611         * strnlen1.h: Likewise.
612         * tls.c: Likewise.
613         * tls.h: Likewise.
614         * tmpdir.c: Likewise.
615
616         * TODO: Remove; this belongs only in coreutils.
617
618 2006-08-14  Eric Blake  <ebb9@byu.net>
619
620         Import the following change from libc:
621
622         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
623
624         Upstream bug 2997.
625         * misc/error.c: Add space between program name and message if file
626         name is missing.
627
628 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
629
630         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
631         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
632
633         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
634         in wchar_t.  Problem reported by Eric Blake.
635
636         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
637         LEN is smaller than SIZE.  Suggested by Bruno Haible.
638         Also, help the compiler to keep LEN in a register.
639
640 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
641
642         * .cppi-disable: Add snprintf.h, socket_.h.
643         * snprintf.c: Include <errno.h> and <limits.h>.
644         (EOVERFLOW): Define if the system does not.
645         Do not include "minmax.h"; it wasn't used.
646         (snprintf): Don't assume size_t promotes to an unsigned type.
647         Fix bug when generated string was too long for the buffer: the
648         buffer's contents are supposed to be the initial prefix of the
649         output.  Don't assume vasnprintf returns EOVERFLOW if the size
650         exceeds INT_MAX; do the check ourselves.
651
652         Import the following changes from libc:
653
654         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
655
656         * posix/regex_internal.c (re_string_skip_chars): If no character has
657         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
658         to the byte which couldn't be converted.
659         (re_string_reconstruct): Don't clear valid_raw_len before calling
660         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
661         tip_context using re_string_context_at.
662
663         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
664
665         * posix/regex.h: g++ still cannot handled [restrict].
666
667         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
668
669         * posix/regex.h: Remove special handling for VMS.
670
671 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
672
673         Sync from coreutils.
674
675         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
676
677         * mountlist.c [ME_REMOTE]: Filter out cifs.
678         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
679
680 2006-08-08  Eric Blake  <ebb9@byu.net>
681
682         * verror.c (verror_at_line): Work around glibc bug 2997, so that
683         verror_at_line output complies with GNU Coding Standards even when
684         file is NULL.
685
686 2006-08-08  Eric Blake  <ebb9@byu.net>
687
688         * verror.h, verror.c: New files.
689
690 2006-08-07  Bruno Haible  <bruno@clisp.org>
691
692         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
693         versions of AIX.
694         Reported by Ralf Wildenhues.
695
696 2006-08-06  Eric Blake  <ebb9@byu.net>
697
698         * error.h: Fold in some upstream changes from glibc.
699         * error.c: Likewise.
700
701 2006-07-29  Bruno Haible  <bruno@clisp.org>
702
703         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
704
705 2006-07-29  Bruno Haible  <bruno@clisp.org>
706
707         * setenv.c: Undo unintended modification done on 2006-02-27.
708
709 2006-07-28  Eric Blake  <ebb9@byu.net>
710
711         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
712         macro expansion.
713
714 2006-07-28  Simon Josefsson  <jas@extundo.com>
715
716         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
717         #include's.
718
719 2006-07-28  Simon Josefsson  <jas@extundo.com>
720
721         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
722         #include's.
723
724 2006-07-28  Bruno Haible <bruno@clisp.org>
725
726         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
727
728 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
729
730         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
731         arpa/inet.h.
732
733 2006-07-28  Bruno Haible  <bruno@clisp.org>
734
735         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
736         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
737         fallbacks.
738         Avoids link error on FreeBSD 4.x.
739         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
740
741         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
742         encoding.
743         * mbswidth.c (iswcntrl): Likewise.
744
745 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
746
747         * modechange.c (mode_compile): Numeric modes now affect setuid and
748         setgid on directories only if they set these bits.
749         * modechange.h: Remove obsolete comment about masks.
750
751 2006-07-27  Bruno Haible  <bruno@clisp.org>
752
753         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
754         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
755         defined.
756
757 2006-07-26  Eric Blake  <ebb9@byu.net>
758
759         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
760         like mingw that lack mkstemp.
761         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
762         avoid compilation warning on mingw.
763
764 2006-07-25  Bruno Haible  <bruno@clisp.org>
765
766         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
767         <stdarg.h> or config.h.
768
769 2006-07-24  Bruno Haible  <bruno@clisp.org>
770
771         * clean-temp.h: New file, from GNU gettext.
772         * clean-temp.c: New file, from GNU gettext.
773
774 2006-07-24  Bruno Haible  <bruno@clisp.org>
775
776         * tmpdir.h: New file, from GNU gettext.
777         * tmpdir.c: New file, from GNU gettext.
778
779 2006-07-23  Bruno Haible  <bruno@clisp.org>
780
781         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
782         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
783         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
784         gl_linked_remove_at): Use it.
785
786 2006-07-23  Eric Blake  <ebb9@byu.net>
787
788         * tmpfile-safer.c: New file.
789         * stdio-safer.h (fopen_safer): Add prototype.
790         * stdio--.h (tmpfile): Make safer.
791
792 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
793
794         * close-stream.c, close-stream.h: New files.
795
796 2006-07-22  Bruno Haible  <bruno@clisp.org>
797
798         Merge from GNU gettext 0.15.
799
800         2005-07-05  Bruno Haible  <bruno@clisp.org>
801
802                 * printf-args.c (printf_fetchargs): Work around broken
803                 definition of wint_t on mingw.
804
805         2005-02-12  Bruno Haible  <bruno@clisp.org>
806
807                 * xallocsa.h: Add extern "C" for C++.
808
809         2006-05-17  Bruno Haible  <bruno@clisp.org>
810
811                 Cygwin portability.
812                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
813
814         2006-04-30  Bruno Haible  <bruno@clisp.org>
815
816                 * progreloc.c: Include <mach-o/dyld.h> if available.
817                 (find_executable): Use _NSGetExecutablePath when possible.
818
819         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
820
821                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
822                 function.
823
824         2005-12-29  Bruno Haible  <bruno@clisp.org>
825
826                 * progreloc.c (set_program_name_and_installdir): Fix
827                 compilation error.
828
829         2005-12-04  Bruno Haible  <bruno@clisp.org>
830
831                 Cygwin portability.
832                 * progreloc.c: Include <windows.h> also on Cygwin.
833                 (find_executable): Add support for Cygwin.
834                 (set_program_name_and_installdir): Handle also platforms with
835                 nonempty EXEEXT.
836
837         2006-07-11  Bruno Haible  <bruno@clisp.org>
838
839                 * javacomp.c: Fix a comment.
840                 Reported by Jim Meyering.
841
842         2006-04-30  Bruno Haible  <bruno@clisp.org>
843
844                 * javacomp.h (compile_java_class): Add source_version,
845                 target_version arguments.
846                 * javacomp.c: Rewritten to choose only a compiler that
847                 respects the specified source_version and target_version.
848
849         2006-06-27  Bruno Haible  <bruno@clisp.org>
850
851                 Assume correct S_ISDIR macro.
852                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
853
854         2006-07-22  Bruno Haible  <bruno@clisp.org>
855
856                 * javaversion.h: New file, from GNU gettext.
857                 * javaversion.c: New file, from GNU gettext.
858                 * javaversion.java: New file, from GNU gettext.
859                 * javaversion.class: New file, from GNU gettext.
860
861         2006-05-17  Bruno Haible  <bruno@clisp.org>
862
863                 Cygwin portability.
864                 * javaexec.c (execute_java_class): Test for jview program
865                 also on Cygwin.
866
867         2006-04-09  Bruno Haible  <bruno@clisp.org>
868
869                 * fatal-signal.c: Don't include string.h.
870                 (at_fatal_signal): Use a copying loop instead of memcpy.
871
872         2005-12-04  Bruno Haible  <bruno@clisp.org>
873
874                 * csharpexec.c: Add support for 'clix' launcher (untested).
875                 (execute_csharp_using_sscli): New function.
876                 (execute_csharp_program): Call it.
877
878         2006-06-21  Bruno Haible  <bruno@clisp.org>
879
880                 Avoid warnings from recent versions of mcs.
881                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
882                 -o, -L, -r any more. Use options documented since mcs-1.0
883                 instead. Similarly for -g.
884
885         2005-07-09  Bruno Haible  <bruno@clisp.org>
886
887                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
888                 add a .dll suffix.
889                 Reported by Mark Junker <mjscod@gmx.de>.
890
891         2006-06-17  Bruno Haible  <bruno@clisp.org>
892
893                 * config.charset: Update for NetBSD 3.0.
894
895         2006-05-17  Bruno Haible  <bruno@clisp.org>
896
897                 Cygwin portability.
898                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
899
900         2006-05-16  Bruno Haible  <bruno@clisp.org>
901
902                 * localcharset.c [CYGWIN]: Include <windows.h>.
903                 (get_charset_aliases): For Cygwin, return the same CPxxx
904                 aliases list as under WIN32.
905                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
906                 the environment variables. Fall back to GetACP().
907
908         2006-04-05  Bruno Haible  <bruno@clisp.org>
909
910                 * config.charset: Update Juan Manuel Guerrero's address.
911
912         2005-02-12  Bruno Haible  <bruno@clisp.org>
913
914                 * allocsa.h: Add extern "C" for C++.
915
916         2005-02-10  Bruno Haible  <bruno@clisp.org>
917
918                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
919                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
920
921         2006-07-22  Bruno Haible  <bruno@clisp.org>
922
923                 * gettext.h: Update to GNU gettext-0.15.
924
925 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
926         and Simon Josefsson <jas@extundo.com>
927
928         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
929
930         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
931
932 2006-07-21  Eric Blake  <ebb9@byu.net>
933
934         * stdlib-safer.h: New file from coreutils, required by
935         stdlib--.h.
936
937 2006-07-19  Derek R. Price  <derek@ximbiot.com>
938
939         * getaddrinfo.h: Don't define unimplemented AI_* flags.
940         Reindent and repaginate.
941
942 2006-07-17  Bruno Haible  <bruno@clisp.org>
943
944         * gl_list.h: New file.
945         * gl_list.c: New file.
946         * gl_array_list.h: New file.
947         * gl_array_list.c: New file.
948         * gl_carray_list.h: New file.
949         * gl_carray_list.c: New file.
950         * gl_linked_list.h: New file.
951         * gl_linked_list.c: New file.
952         * gl_anylinked_list1.h: New file.
953         * gl_anylinked_list2.h: New file.
954         * gl_avltree_list.h: New file.
955         * gl_avltree_list.c: New file.
956         * gl_anyavltree_list1.h: New file.
957         * gl_anyavltree_list2.h: New file.
958         * gl_rbtree_list.h: New file.
959         * gl_rbtree_list.c: New file.
960         * gl_anyrbtree_list1.h: New file.
961         * gl_anyrbtree_list2.h: New file.
962         * gl_anytree_list1.h: New file.
963         * gl_anytree_list2.h: New file.
964         * gl_linkedhash_list.h: New file.
965         * gl_linkedhash_list.c: New file.
966         * gl_anyhash_list1.h: New file.
967         * gl_anyhash_list2.h: New file.
968         * gl_avltreehash_list.h: New file.
969         * gl_avltreehash_list.c: New file.
970         * gl_rbtreehash_list.h: New file.
971         * gl_rbtreehash_list.c: New file.
972         * gl_anytreehash_list1.h: New file.
973         * gl_anytreehash_list2.h: New file.
974
975         * gl_oset.h: New file.
976         * gl_oset.c: New file.
977         * gl_array_oset.h: New file.
978         * gl_array_oset.c: New file.
979         * gl_avltree_oset.h: New file.
980         * gl_avltree_oset.c: New file.
981         * gl_rbtree_oset.h: New file.
982         * gl_rbtree_oset.c: New file.
983         * gl_anytree_oset.h: New file.
984
985 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
986
987         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
988         New files.
989         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
990         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
991         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
992         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
993         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
994         callers changed.  Revamp internals significantly, by not
995         attempting to create directories that are temporarily more
996         permissive than the final results.  Do not attempt to use
997         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
998         This removes some race conditions, fixes some bugs, and simplifies
999         things.  Use new dirchownmod function to do owner and mode changes.
1000         * mkdir-p.h: Likewise.
1001         * modechange.c (octal_to_mode): New function.
1002         (struct mode_change): New member mentioned.
1003         (make_node_op_equals): New arg mentioned.  All callers changed.
1004         (mode_compile): Keep track of which mode bits the user has explicitly
1005         mentioned.
1006         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1007         New arg PMODE_BITS, to keep track of which mode bits the user
1008         mentioned; it treats S_ISUID and S_ISGID speciall.
1009         All callers changed.
1010         * modechange.h: Likewise.
1011
1012 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1013
1014         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1015
1016 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1017
1018         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1019         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1020         macros into the GNU _D_EXACT_NAMLEN.
1021         * savedir.c:  Likewise.
1022         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1023
1024 2006-07-09  Jim Meyering  <jim@meyering.net>
1025
1026         * argp-pv.c: Remove a doubled word in a comment.
1027         * check-version.c (check_version): Likewise.
1028         * javacomp.c (compile_java_class): Likewise.
1029
1030 2006-07-08  Jim Meyering  <jim@meyering.net>
1031
1032         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1033
1034 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1035
1036         * getaddrinfo.c: Changes to compile under MSVC6: changed
1037         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1038         brackets.  Other minor changes to suppress some compiler
1039         warnings.
1040
1041 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1042
1043         * getloadavg.c: Use __VMS, not VMS.
1044         * getopt.c: Likewise.
1045         * getpagesize.h: Likewise.
1046         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1047         probably does not work.
1048
1049 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1050         and Paul Eggert  <eggert@cs.ucla.edu>
1051
1052         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1053         Don't worry about this obsolete case any more.
1054         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1055         directories.
1056         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1057         worry about this obsolete case any more.
1058         * fts.c: Likewise.
1059         * getcwd.c: Likewise.
1060         * glob.h: Likewise.
1061         * savedir.c: Likewise.
1062
1063 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1064
1065         * .cppi-disable: Add wcwidth.
1066         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1067         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1068         (ISGRAPH): Remove.  All uses changed to isgraph.
1069         (FOLD) [!defined _LIBC]: Remove special case.
1070         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1071         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1072         HAVE_ISBLANK.
1073         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1074
1075 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1076
1077         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1078
1079 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1080
1081         * memcasecmp.c: Include <limits.h>.
1082         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1083         * strtod.c (strtod): Don't assume isspace works on negative chars.
1084         Don't assume isdigit succeeds only on '0' through '9'.
1085
1086 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1087
1088         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1089         All uses of is_space replaced by isspace.
1090         * exit.h: Don't talk about STDC_HEADERS.
1091         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1092         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1093         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1094         replaced by isprint etc.
1095         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1096         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1097         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1098         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1099         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1100         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1101
1102 2006-07-05  Eric Blake  <ebb9@byu.net>
1103
1104         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1105         missing from netdb.h.
1106         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1107
1108 2006-06-27  Bruno Haible  <bruno@clisp.org>
1109
1110         Assume ANSI C header files and <ctype.h> functions.
1111         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1112         (mbsnwidth): Use isprint, iscntrl instead.
1113
1114 2006-07-03  Jim Meyering  <jim@meyering.net>
1115
1116         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1117         macro is used before the first cycle_check call.
1118
1119 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1120
1121         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1122         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1123         reported by Mark D. Baushke, one in
1124         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1125
1126         Merge from coreutils.
1127
1128         * .cppi-disable: Add stdint_.h.
1129         * .cvsignore: Add stdint.h.
1130
1131         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1132
1133         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1134         both double and long double versions.
1135         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1136         * xstrtold.c: New file.
1137         * xstrtod.h (xstrtold): New decl.
1138
1139         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1140
1141         * filemode.c (setst): Remove.
1142         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1143         (arguably) clearer, and the generated code is a bit smaller on my
1144         Debian GNU/Linux stable x86 host.
1145
1146         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1147
1148         * filemode.c: Include "filemode.h" first, to test the interface.
1149         Assume that filemode.h includes sys/types.h and sys/stat.h.
1150         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1151         (ftypelet): Reorder to put common cases first, for efficiency.
1152         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1153         to do 'M'.
1154         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1155         of 10, for compatibility with FreeBSD.  All callers changed.
1156         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1157         that can't be deduced solely from st_mode.  First arg is now a const
1158         pointer.
1159         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1160         (strmode): Renamed from mode_string.
1161         (filemodestring): New decl.
1162         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1163         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1164         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1165
1166         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1167
1168         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1169         fsusage.h now does that.  Include fsusage.h first, to test interface.
1170         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1171         at most one method (the old code could have generated decls that
1172         didn't conform to C89, not that this was ever exercised).
1173         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1174
1175         2006-03-19  Jim Meyering  <jim@meyering.net>
1176
1177         Work even in a chroot where d_ino values for entries in "/"
1178         don't match the stat.st_ino values for the same names.
1179         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1180         number, iterate through all entries again, using lstat instead.
1181         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1182         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1183
1184         * getcwd.c (__getcwd): Clarify a comment.
1185         Use memcpy in place of a call to strcpy.
1186
1187         2006-03-12  Jim Meyering  <jim@meyering.net>
1188
1189         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1190         that of the current directory (which we're about to chdir ".." out of),
1191         then save the dev-ino of the parent, instead.
1192
1193         * same-inode.h (SAME_INODE): New file/macro.
1194         * chdir-safer.c (SAME_INODE): Remove definition.
1195         Include "same-inode.h", instead.
1196         * same.c: Likewise.
1197         * cycle-check.h: Include "same-inode.h".
1198         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1199         * cycle-check.c (SAME_INODE): Remove definition.
1200         * root-dev-ino.h: Include "same-inode.h".
1201
1202         2006-03-11  Eric Blake  <ebb9@byu.net>
1203
1204         * same.c (same_name): s/base_name/last_component/
1205         * backupfile.c (check_extension, numbered_backup): Likewise.
1206         * filenamecat.c (file_name_concat): Likewise.
1207
1208         2006-03-11  Eric Blake  <ebb9@byu.net>,
1209                     Paul Eggert  <eggert@cs.ucla.edu>
1210
1211         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1212         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1213         drive prefix.
1214         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1215         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1216         (last_component): New method.
1217         * dirname.c (dir_len): Determine when drive letters need a
1218         subsequent slash.  Preserve // when it is special.
1219         (dir_name): Don't append dot when drive letter is absolute.
1220         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1221         * basename.c (base_name): New semantics - malloc the result.
1222         Preserve // when it is special.  Preserve relative files that look
1223         like drive letters.
1224         (base_len): Preserve // when it is special.
1225         (last_component): New method, similar to old base_name semantics.
1226         * stripslash.c (strip_trailing_slashes): Use last_component, not
1227         base_name.  Strip redundant slashes from ///.
1228
1229 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1230
1231         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1232         both are 64 bits, since this seems to be the tradition, and this
1233         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1234         we ever run into a host that prefers long long to long in this
1235         case, we'll need another configure-time test.  Problem reported by
1236         Jim Meyering.
1237
1238 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1239
1240         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1241         possible collision with system files.
1242         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1243         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1244         WCHAR_MIN and WCHAR_MAX in this case.
1245         (<stddef.h>): Do not include; no longer needed.
1246         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1247         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1248         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1249         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1250         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1251         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1252         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1253         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1254         !defined(__c99))]: Include in this case too, since it's harmless
1255         now.
1256         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1257         dangerous to do so.
1258         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1259         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1260         (_STDINT_MIN, _STDINT_MAX): New macros.
1261         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1262         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1263         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1264         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1265         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1266         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1267         macros, not typedefs; this simplifies things quite a bit.
1268         Use long int for all types narrower than int64_t.
1269         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1270         Define in terms of long long int or int64_t or long int,
1271         not int64_t or int32_t.  This saves some compile-time testing.
1272         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1273         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1274         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1275         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1276         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1277         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1278         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1279         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1280         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1281         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1282         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1283         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1284         undef any previous version and define our own version, for
1285         simplicity and consistency with the new macros for types.
1286         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1287         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1288         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1289         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1290         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1291         @WINT_T_SUFFIX@ to keep things simple here.
1292         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1293         Simplify by assuming typical 8/16/32/64 host, since we're
1294         already doing that elsewhere anyway.
1295         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1296         and assume long long int is 64 bits if available.  This
1297         speeds up 'configure'.
1298
1299 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1300
1301         * getaddrinfo.c: fixed typo
1302
1303 2006-06-29  Eric Blake  <ebb9@byu.net>
1304
1305         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1306         unused static function.
1307
1308 2006-06-29  Eric Blake  <ebb9@byu.net>
1309
1310         * stat_.h: New file.
1311
1312 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1313
1314         * strftime.c: Assume strftime() exists.
1315
1316 2006-06-28  Bruno Haible  <bruno@clisp.org>
1317
1318         * getaddrinfo.h: Fix POSIX URL.
1319         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1320         (use_win32_p): Make static.
1321         (getaddrinfo): Reject service name if it is empty or does not consist
1322         solely of decimal digits, or if its value is > 65535.
1323         (getnameinfo): Remove useless casts.
1324
1325 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1326
1327         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1328         Autoconf 2.60 says this stuff was obsolete.
1329
1330 2006-05-12  Bruno Haible  <bruno@clisp.org>
1331
1332         * mkdtemp.c [MINGW]: Include <io.h>.
1333         (mkdir): Define using _mkdir.
1334
1335 2006-06-28  Bruno Haible  <bruno@clisp.org>
1336
1337         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1338         declaration for wcwidth.
1339         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1340
1341 2006-06-28  Eric Blake  <ebb9@byu.net>
1342
1343         * xvasprintf.h: Fix comments.
1344
1345 2006-06-28  Eric Blake  <ebb9@byu.net>
1346
1347         * mbchar.h (wcwidth): Include wcwidth.h.
1348         * mbswidth.c (wcwidth): Move from here...
1349         * wcwidth.h: ...to this new file.
1350
1351 2006-06-28  Simon Josefsson  <jas@extundo.com>
1352
1353         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1354         functions there.  It will succeed on Windows XP, but on Windows
1355         2000 and (presumably) earlier, it will fail, and use the internal
1356         re-implementation.
1357         (use_win32_p): New function.
1358         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1359         Support AI_NUMERICSERV to disable getservbyname.
1360         (getnameinfo): New function, only supports
1361         NI_NUMERICHOST|NI_NUMERICSERV for now.
1362
1363         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1364         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1365         getnameinfo.
1366
1367 2006-06-27  Bruno Haible  <bruno@clisp.org>
1368
1369         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1370
1371 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1372
1373         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1374         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1375         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1376
1377 2006-06-26  Bruno Haible  <bruno@clisp.org>
1378
1379         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1380         WCHAR_MAX.
1381         Reported by Mark D. Baushke and Larry Jones.
1382
1383 2006-06-26  Bruno Haible  <bruno@clisp.org>
1384
1385         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1386         in pre-C99 mode.
1387         Suggested by Mark D. Baushke and Larry Jones.
1388
1389 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1390
1391         * stdint_.h: Treat BSD/OS like OpenBSD.
1392
1393 2006-06-23  Bruno Haible  <bruno@clisp.org>
1394
1395         * stdint_.h: Treat IRIX like OpenBSD.
1396
1397 2006-06-23  Bruno Haible  <bruno@clisp.org>
1398
1399         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1400         ISO C 99 Technical Corrigendum 1.
1401
1402 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1403
1404         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1405         Some compiler complained about some of them.  Problem reported by
1406         Larry Jones in
1407         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1408
1409 2006-06-21  Simon Josefsson  <jas@extundo.com>
1410
1411         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1412         variable.
1413
1414         * socket_.h: Don't define WINVER.
1415
1416         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1417         slightly modified to work in gnulib.
1418
1419 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1420
1421         * read-file.c (fread_file): Start with buffer allocation of
1422         0 bytes rather than 1 byte; this simplifies the code.
1423         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1424         code to free buffer and save/restore errno.
1425         (internal_read_file): Remove unused local.
1426
1427 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1428
1429         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1430         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1431         Problem reported by Denis Excoffier in
1432         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1433
1434 2006-06-19  Simon Josefsson  <jas@extundo.com>
1435
1436         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1437
1438 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1439
1440         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1441
1442 2006-06-17  Bruno Haible  <bruno@clisp.org>
1443
1444         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1445
1446 2006-06-17  Bruno Haible  <bruno@clisp.org>
1447
1448         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1449         problem on Solaris 2.5.1.
1450
1451 2006-06-16  Eric Blake  <ebb9@byu.net>
1452
1453         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1454         * unicodeio.c [!defined errno]: Likewise.
1455         * strtol.c [!defined errno]: Likewise.
1456         * strtod.c [!defined errno]: Likewise.
1457
1458 2006-06-15  Bruno Haible  <bruno@clisp.org>
1459
1460         * stdint_.h: Rewritten to be fully auto-configured.
1461         Fixes bug on HP-UX/IA64.
1462
1463 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1464
1465         * getdate.y (__attribute__): Don't define if already defined.
1466         Problem reported by Larry Jones.
1467         * utimens.c (__attribute__): Likewise.
1468
1469 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1470
1471         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1472         reported by Andreas Schwab.
1473
1474 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1475             Bruno Haible  <bruno@clisp.org>
1476
1477         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1478
1479 2006-05-26  Martin Lambers  <marlam@marlam.de>
1480
1481         * getpass.c: Updates the test for the native W32 API, and adds
1482         missing includes, thus fixing compilation warnings.
1483
1484 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1485
1486         * tempname.c (small_open, large_open): New macros.
1487         (__open, __open64) [!_LIBC]: Remove.
1488         (__gen_tempname): Use small_open and large_open instead of __open
1489         and __open64.  This fixes a portability bug on HP-UX 11.11i
1490         reported by Simon Wing-Tang in
1491         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1492
1493 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1494
1495         * exclude.c (exclude_fnmatch): New function.
1496         (excluded_file_name): Call exclude_fnmatch.
1497         * exclude.h (excluded_file_name): New prototype
1498
1499 2006-05-24  Bruno Haible  <bruno@clisp.org>
1500
1501         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1502         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1503         Reported by Thorsten Maerz <torte@netztorte.de> via
1504         Aaron Stone <aaron@serendipity.cx>.
1505
1506 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1507
1508         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1509         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1510         (my_usleep): Don't mishandle maximum value.
1511
1512 2006-05-19  Jim Meyering  <jim@meyering.net>
1513
1514         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1515
1516 2006-05-17  Bruno Haible  <bruno@clisp.org>
1517
1518         Cygwin portability.
1519         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1520
1521 2006-05-17  Bruno Haible  <bruno@clisp.org>
1522
1523         * stdint_.h: Fix recognition of Cygwin.
1524
1525 2006-05-11  Jim Meyering  <jim@meyering.net>
1526
1527         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1528
1529 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1530
1531         * crc.c (crc32_update): Remove unnecessary L suffix.
1532         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1533         unwanted sign propagation, e.g., on hosts with 64-bit int.
1534         There still are some problems with reeelly weird theoretical hosts
1535         (e.g., 33-bit int) but it's not worth worrying about now.
1536         * sha1.c (rol): Likewise.
1537         (K1, K2, K3, K4): Remove unnecessary L suffix.
1538
1539 2006-05-10  Bruno Haible  <bruno@clisp.org>
1540
1541         * des.c: Cast to avoid warnings.
1542
1543 2006-05-10  Simon Josefsson  <jas@extundo.com>
1544
1545         * md4.c: Typo fix, update copyright years.
1546         (K1, K2): Don't use L because it turn computations into 64-bit on
1547         64-bit platforms.
1548
1549 2006-05-09  Bruno Haible  <bruno@clisp.org>
1550
1551         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1552         (EOVERFLOW): Define fallback value.
1553         (xstrcat): New function.
1554         (xvasprintf): Recognize the special case of a string concatenation.
1555
1556 2006-05-01  Bruno Haible  <bruno@clisp.org>
1557
1558         * stdint_.h: Shorter URL.
1559         * inttypes.h: Likewise.
1560
1561 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1562
1563         * verify.h: Document the internals better.  Most of this change
1564         was written by Bruno Haible.
1565
1566 2006-04-29  Bruno Haible  <bruno@clisp.org>
1567
1568         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1569         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1570
1571 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1572
1573         * getdate.y (get_date): When adding relative date, start with the
1574         initial time, not with the result of the first mktime call.
1575
1576 2006-04-23  Bruno Haible  <bruno@clisp.org>
1577
1578         * copy-file.c: Include <unistd.h> unconditionally.
1579         * execute.c: Likewise.
1580         * fatal-signal.c: Likewise.
1581         * findprog.c: Likewise.
1582         * mkdtemp.c: Likewise.
1583         * pipe.h: Likewise.
1584         * pipe.c: Likewise.
1585         * wait-process.h: Likewise.
1586
1587 2006-04-23  Bruno Haible  <bruno@clisp.org>
1588
1589         * fwriteerror.c (fwriteerror): Call fclose also when an error
1590         condition was already detected.
1591         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1592
1593 2006-04-19  Derek Price  <derek@ximbiot.com>
1594             Eric Blake  <ebb9@byu.net>
1595
1596         * inttypes.h: Correct grammar in comment.
1597
1598 2006-04-18  Derek Price  <derek@ximbiot.com>
1599             Paul Eggert  <eggert@cs.ucla.edu>
1600
1601         * inttypes.h: New file.
1602         * strtoimax.c: Assume <inttypes.h>.
1603
1604 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1605
1606         * utimens.c (futimens): glibc futimesat messes up if /proc
1607         isn't mounted.  Problem reported by Kir Kolyshkin.
1608
1609 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1610
1611         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1612         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1613         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1614
1615 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1616
1617         Merge regex changes from libc, removing some of our
1618         POSIX-conformance changes that were rejected and redoing them in a
1619         less-intrusive way.
1620
1621         * regcomp.c (re_compile_internal, init_dfa):
1622         Length arg is now size_t, not Idx.  All uses changed.
1623         (peek_token): Forward decl now says internal_function.
1624         (__re_error_msgid, __re_error_msgid_idx):
1625         Now static rather than extern with attribute_hidden.
1626         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1627         For some reason libc prefers K&R style defns for external functions.
1628         (regerror) [!defined _LIBC]: Likewise.
1629         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1630         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1631         (build_range_exp, build_collating_symbol):
1632         Use K&R-style defn.
1633         (re_compile_fastmap): Use '\0' to memset, not 0.
1634         (utf8_sb_map): Make the calculations more obvious.
1635         (init_dfa, parse_bracket_exp, build_charclass_op):
1636         Call calloc and cast result, as glibc does.
1637         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1638         (build_range_exp, build_collating_symbol):
1639         Now internal functions.
1640
1641         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1642
1643         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1644         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1645         Don't depend on VMS; depend on __VMS instead, for POSIX
1646         namespace cleanness.
1647         (regoff_t): Define to ssize_t, not long int.
1648
1649         Remove the REG_ macros named below.  Instead, make the old names
1650         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1651         __USE_GNU_REGEX.
1652         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1653         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1654         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1655         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1656         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1657         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1658         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1659         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1660         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1661         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1662         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1663         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1664         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1665         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1666         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1667         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1668         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1669         (REG_NREGS):
1670         Remove.  All uses replaced by the old RE_* names.
1671         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1672         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1673         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1674         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1675         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1676         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1677         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1678         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1679         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1680         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1681         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1682         Don't bother having these macros be independent of each others'
1683         values, since they no longer exist in the POSIX name space.
1684
1685         Rename the following member names back to their old names,
1686         unless !__USE_GNU_REGEX.  All uses changed back.
1687         (buffer): Renamed from re_buffer.
1688         (allocated): Renamed from re_allocated.
1689         (used): Renamed from re_used.
1690         (syntax): Renamed from re_syntax.
1691         (fastmap): Renamed from re_fastmap.
1692         (translate): Renamed from re_translate.
1693         (can_be_null): Renamed from re_can_be_null.
1694         (regs_allocated): Renamed from re_regs_allocated.
1695         (fastmap_accurate): Renamed from re_fastmap_accurate.
1696         (no_sub): Renamed from re_no_sub.
1697         (not_bol): Renamed from re_not_bol.
1698         (not_eol): Renamed from re_not_eol.
1699         (newline_anchor): Renamed from re_newline_anchor.
1700         (num_regs): Renamed from rm_num_regs.
1701         (start): Renamed from rm_start.
1702         (end): Renamed from rm_end.
1703
1704         (free_state): Move up a bit.
1705
1706         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1707         #define to be empty.
1708         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1709         when that is what is intended.
1710         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1711         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1712         (MAX): New macro.
1713         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1714         All uses changed back to re_malloc, etc.  It's now the caller's
1715         responsibility to check for overflow; all callers changed.
1716         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1717         (re_x2nrealloc): Remove.
1718         (free_state): Remove decl.
1719
1720         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1721         (re_set_registers, re_exec):
1722         Use K&R-style defn.
1723
1724         2006-01-31  Roland McGrath  <roland@redhat.com>
1725
1726         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1727         Reported by Mike Frysinger <vapier@gentoo.org>.
1728
1729         2006-01-15  Andreas Jaeger  <aj@suse.de>
1730
1731         [BZ #1950]
1732         * regex_internal.c (re_string_reconstruct): Adjust for
1733         build_wcs_upper_buffer change.
1734         (build_wcs_upper_buffer): Change return type.
1735
1736         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1737
1738         * regex_internal.h: Include <stdint.h> if available.
1739
1740         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1741
1742         * regex_internal.h (SIZE_MAX): Provide a default definition.
1743
1744         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1745
1746         * regcomp.c: Adjust for changed secondary hash function.
1747
1748         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1749
1750         * regex.h: Pretty printing.
1751         Clean up namespace a bit.
1752
1753         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1754
1755         * regexec.c (update_cur_sifted_state, check_arrival,
1756         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1757
1758         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1759                     Ulrich Drepper  <drepper@redhat.com>
1760
1761         [BZ #1302]
1762         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1763         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1764
1765         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1766
1767         [BZ #281]
1768         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1769         * regcomp.c: Remove unnecessary uses of
1770         unsigned RE_TRANSLATE_TYPE.
1771         * regex_internal.h: Likewise.
1772         * regex_internal.c: Likewise.
1773         * regexec.c: Likewise.
1774         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1775
1776         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1777
1778         * regexec.c (find_recover_state): Remove unnecessary
1779         initialization.
1780         (transit_state_bkref): Make DFA a const pointer.
1781         (get_subexp): Likewise.
1782         (check_arrival): Likewise.
1783         (update_cur_sifted_state): Likewise.
1784         (re_search_internal): Likewise.
1785         (prune_impossible_nodes): Likewise.
1786         (acquire_init_state_context): Likewise.
1787         (proceed_next_node): Likewise.
1788         (set_regs): Likewise.
1789         (free_fail_stack_return): Likewise.
1790         (check_arrival_expand_ecl): Mark DFA parameter as const.
1791         (check_arrival_expand_ecl_sub): Likewise.
1792         (check_subexp_limits): Likewise.
1793         (sub_epsilon_src_nodes):  Likewise.
1794         (add_epsilon_src_nodes):  Likewise.
1795         (merge_state_array): Likewise.
1796         (update_regs): Likewise.
1797         (build_trtable): Likewise.
1798         (sift_states_backward): Mark MCTX parameter as const.
1799         (build_sifted_states): Likewise.
1800         (update_cur_sifted_state): Likewise.
1801         (sift_states_mkref): Likewise.
1802         (check_arrival_expand_ecl): Mark eclosure as const.
1803         (check_dst_limits_calc_pos_1): Likewise.
1804         * regex_internal.h (re_match_context_t): Make dfa a const
1805         pointer.
1806
1807         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1808
1809         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1810         (transit_state_sb): Likewise.
1811         (transit_state_mb): Likewise.
1812         (sift_states_iter_mb): Likewise.
1813         (check_arrival_add_next_nodes): Likewise.
1814         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1815         [_LIBC] (re_search_2_stub): Use mempcpy.
1816
1817         * regex_internal.c (re_string_reconstruct): Avoid calling
1818         mbrtowc for very simple UTF-8 case.
1819
1820         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1821         a pointer-to-const.
1822         (re_acquire_state_context): Likewise.
1823         * regex_internal.h: Adjust prototypes.
1824
1825         * regex.c: Prevent using C++ compilers.
1826
1827         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1828         (re_acquire_state_context): Likewise.
1829
1830 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1831             Bruno Haible  <bruno@clisp.org>
1832
1833         * stdint_.h: On OpenBSD, don't redefine types already included in
1834         <sys/types.h> and <inttypes.h>.
1835
1836 2006-03-24  Eric Blake  <ebb9@byu.net>
1837
1838         * time_r.c (copy_string_result): Remove, as it is no longer used.
1839
1840 2006-03-24  Simon Josefsson  <jas@extundo.com>
1841
1842         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1843         including some doc fixes.
1844         (base64_encode_alloc): Fix +1 bug on allocation failures.
1845
1846 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1847
1848         * base64.c (base64_encode): Do not read past end of array with
1849         unsanitized input on systems with CHAR_BIT > 8.
1850
1851 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1852
1853         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1854         Typedef to long int, not to off_, as POSIX will likely change
1855         in that direction.
1856
1857 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1858
1859         * argp-help.c (validate_uparams): Fix typo
1860         * argp-parse.c (argp_default_options): Consistently begin help
1861         messages with a lowercase letter.
1862
1863 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1864
1865         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1866         overrun buffers and shouldn't be used (much as gets shouldn't be
1867         used).
1868         * time_r.c (asctime_r, ctime_r): Likewise.
1869
1870 2006-03-08  Simon Josefsson  <jas@extundo.com>
1871
1872         * gc-gnulib.c (randomize): Don't open files called 'no', they
1873         signal that configure disabled the device.
1874
1875 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1876
1877         * c-stack.c: Include unistd.h unconditionally, since we now assume
1878         the unistd module.
1879         * getlogin_r.c: Likewise.
1880         * getlogin_r.h: Likewise.
1881         * glob.c: Likewise.
1882         * pagealign_alloc.c: Likewise.
1883         * unistd_.h: Remove; no longer needed.
1884
1885 2006-03-07  Simon Josefsson  <jas@extundo.com>
1886
1887         * unistd_.h: New file.
1888
1889 2006-03-07  Simon Josefsson  <jas@extundo.com>
1890
1891         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1892
1893 2006-03-01  Simon Josefsson  <jas@extundo.com>
1894
1895         * readline.c: Fix typo, tiny patch from Stepan Kasal
1896         <kasal@ucw.cz>.
1897
1898 2006-02-28  Simon Josefsson  <jas@extundo.com>
1899
1900         * getopt.c: Protect #include of unistd.h, for MSVS.
1901
1902 2006-02-27  Simon Josefsson  <jas@extundo.com>
1903
1904         * base64.h: Indent #define's.  From Jim Meyering
1905         <jim@meyering.net>.
1906
1907 2006-02-27  Jim Meyering  <jim@meyering.net>
1908
1909         Revert the change of 2006-02-24, so these files can continue
1910         to be sync'd from gettext.
1911         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1912         of `config.h'.
1913
1914 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1915
1916         * glob.c: Say "invalid" rather than "illegal" in comments.
1917
1918 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1919
1920         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1921
1922 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1923
1924         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1925         AT_FDCWD exceeds INT_MAX.
1926         * openat.h (AT_FDCWD): Likewise.
1927
1928 2006-02-14  Jim Meyering  <jim@meyering.net>
1929
1930         Sync from coreutils.
1931
1932         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1933         failure on deficient systems, and simplify gnulib lgpl dependencies.
1934         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1935         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1936
1937         * xalloc-die.c: Remove unused definition of N_.
1938
1939 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1940
1941         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1942
1943 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1944
1945         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1946         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1947
1948 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1949
1950         * argp-namefrob.h: Restore changes accidentally lost during the
1951         "autoupdate" on 2005-12-12.
1952
1953 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1954
1955         * fnmatch.c (L_): Renamed from L, to work around a bug in
1956         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1957         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1958         All uses changed.
1959
1960 2006-01-26  Simon Josefsson  <jas@extundo.com>
1961
1962         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1963         prototype is visible on mingw32.
1964
1965         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1966         for mingw32.
1967
1968         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1969         mingw32).
1970
1971 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1972
1973         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1974         attempt to open for write; this always fails, at least on POSIX
1975         hosts.  This reinstates the 2006-01-09 change, which was
1976         inadvertently removed.
1977
1978 2006-01-26  Bruno Haible  <bruno@clisp.org>
1979             Paul Eggert  <eggert@cs.ucla.edu>
1980
1981         * stdbool_.h (_Bool)
1982         [(! (defined __cplusplus || defined __BEOS__)
1983           && !defined __GNUC__
1984           && !(defined __HP_cc || defined __xlc__
1985                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1986                || defined __sgi))]:
1987         #define to signed char in these cases too; this simplifies
1988         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1989         etc., separately) and makes it more conservative.
1990
1991 2006-01-21  Jim Meyering  <jim@meyering.net>
1992
1993         Sync from the stable (b5) branch of coreutils:
1994
1995         * fts.c (fts_children): Don't let close() clobber errno from
1996         failed fchdir().
1997
1998         * fts.c (fts_stat): When following a symlink-to-directory,
1999         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2000         a dangling symlink.  That can also happen at least for ELOOP.
2001         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2002         FYI, this bug predates the inclusion of fts.c in coreutils.
2003
2004         * fts.c (fts_open): Put new maxarglen declaration and uses
2005         in their own block, so pre-c99 compilers don't object.
2006
2007         Avoid the double-free (first in fts_read, second in fts_close) that
2008         would occur when an `active' directory is made inaccessible (e.g.,
2009         via chmod a-x) during a traversal.
2010         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2011         before returning.  Reproduce this failure by
2012         mkdir -p a/b; cd a; chmod a-x . b
2013         Reported by Stavros Passas.
2014
2015 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2016
2017         * argp-namefrob.h: Bugfix. Remove stray #
2018
2019 2006-01-25  Bruno Haible  <bruno@clisp.org>
2020
2021         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2022         warnings.
2023         Reported by Paul Eggert.
2024
2025 2006-01-25  Jim Meyering  <jim@meyering.net>
2026
2027         * fileblocks.c: Remove more useless parentheses.
2028         * readutmp.h: Likewise.
2029
2030 2006-01-24  Bruno Haible  <bruno@clisp.org>
2031
2032         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2033         has it.
2034         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2035         2005-11-26.
2036
2037         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2038         to avoid problems with the built-in _Bool type.
2039         Reported by Paul Eggert on 2005-11-26.
2040
2041 2006-01-24  Jim Meyering  <jim@meyering.net>
2042
2043         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2044
2045 2006-01-24  Simon Josefsson  <jas@extundo.com>
2046
2047         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2048         Bruno.
2049
2050 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2051
2052         Work around porting bugs reported by Dieter in
2053         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2054         * getopt.c (_NOPROTO): Remove; no longer needed.
2055         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2056         Include "getopt.h" first, to check interface.
2057         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2058         !HAVE_DECL_GETENV.
2059         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2060         (__strndup): Revert to K&R-style function dfns, the glibc style.
2061         * strnlen.c: Don't claim it's taken from glibc; it's not.
2062         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2063         Include strnlen.h first, to get prototype properly.
2064         (strnlen): Renamed from __strnlen.
2065         Remove weak alias.
2066
2067 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2068
2069         These changes imported from libc.
2070         * getopt.c: Use __fxprintf instead of inline stream orientation
2071         test and two separate function calls.
2072         * strndup.c (__strndup): Add libc_hidden_def.
2073
2074 2006-01-22  Bruno Haible  <bruno@clisp.org>
2075
2076         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2077         temporary buffer for sprintf, take into account the precision also
2078         for 'd', 'i', 'u', 'o', 'x', 'X'.
2079
2080 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2081
2082         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2083         to pacify gcc -Wswitch-default.
2084
2085 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2086
2087         * argp-help.c (usage_long_opt): Do not print DOC options.
2088         (__argp_base_name): Removed
2089         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2090         typo.
2091         (__argp_base_name): Provide macro definition or extern declaration
2092         depending on the configuration
2093
2094 2006-01-20  Simon Josefsson  <jas@extundo.com>
2095
2096         * inet_ntop.h: Unconditionally include sys/socket.h.
2097
2098 2006-01-19  Simon Josefsson  <jas@extundo.com>
2099
2100         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2101
2102 2006-01-12  Simon Josefsson  <jas@extundo.com>
2103
2104         * base64.c: Fix warning, reported by Bruno Haible
2105         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2106
2107 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2108
2109         Sync from coreutils.
2110         * md5.c: Fix commentary typos.
2111         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2112         * md5.h (__attribute__): Remove; unused.
2113         * sha1.c: Fix commentary to match md5 better.
2114         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2115         so that we don't need to worry about alignment.  All uses changed.
2116         This merges the 2005-10-28 md5 change into sha1.
2117
2118 2006-01-11  Jim Meyering  <jim@meyering.net>
2119
2120         Sync from coreutils.
2121         * md5.c (OP): Fix spacing.
2122
2123 2006-01-11  Simon Josefsson  <jas@extundo.com>
2124
2125         * stdint_.h (SIZE_MAX): Add missing (.
2126
2127 2006-01-10  Bruno Haible  <bruno@clisp.org>
2128
2129         * argp.h (__const): Remove macro. Use const instead.
2130         * argp-fmtstream.h (__const): Likewise.
2131         * glob_.h (__const): Remove macro.
2132         * glob-libc.h: Use const instead of __const.
2133
2134 2006-01-10  Jim Meyering  <jim@meyering.net>
2135
2136         Avoid the double-free (first in fts_read, second in fts_close) that
2137         would occur when an `active' directory is made inaccessible (e.g.,
2138         via chmod a-x) during a traversal.
2139         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2140         before returning.  Reproduce this failure by
2141         mkdir -p a/b; cd a; chmod a-x . b
2142         Reported by Stavros Passas.
2143
2144         Sync from coreutils.
2145         * sha1.c: Tweak grammar in a comment.
2146
2147 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2148
2149         * regex_internal.h (BITSET_WORD_BITS):
2150         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2151         preprocessor mishandles large unsigned values as if they were signed.
2152         Problem reported by Claudio Fontana in
2153         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2154
2155 2006-01-10  Simon Josefsson  <jas@extundo.com>
2156
2157         * socket_.h: New file.
2158
2159 2006-01-10  Bruno Haible  <bruno@clisp.org>
2160
2161         * localcharset.c: Update from GNU gettext.
2162
2163 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2164
2165         Sync from coreutils.
2166         * chdir-long.c (cdb_free): Don't bother trying to open directory
2167         for write access: POSIX says that must fail.
2168         * fts.c (diropen): Likewise.
2169         * save-cwd.c (save_cwd): Likewise.
2170         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2171         well, for minor improvements on hosts that lack O_DIRECTORY.
2172         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2173         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2174         Fall back on chown if open failed with EACCES.
2175
2176         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2177         Report an error at compile-time if only a 1-second nominal clock
2178         resolution is found.
2179
2180         * lchmod.h: New file.
2181         * mkdir-p.c: Include lchmod.h, lchown.h.
2182         (make_dir_parents): Use lchown rather than chown, and
2183         lchmod rather than chmod.
2184
2185         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2186         too.  Problem with "none" reported by Bob Proulx.  Problem with
2187         "proc" reported by n0dalus.
2188
2189         * mountlist.c: Include <limits.h>.
2190         (dev_from_mount_options)
2191         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2192         New function.  It no longer assumes "dev=" has the System V meaning
2193         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2194         (read_file_system_list)
2195         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2196         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2197         dev= in that case.
2198
2199         * posixtm.h (PDS_PRE_2000): New macro.
2200         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2201         All usages changed.  Reject dates outside the range 1969-1999 if
2202         PDS_PRE_2000 is used.
2203
2204 2006-01-09  Jim Meyering  <jim@meyering.net>
2205
2206         Sync from coreutils.
2207
2208         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2209
2210         * chdir-safer.h, chdir-safer.c: New files.
2211
2212         * modechange.c (mode_compile): Reject an invalid mode string
2213         that starts with an octal digit.  From Andreas Gruenbacher.
2214
2215         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2216         and dup to open_safer and dup_safer, respectively.
2217         (openat_permissive): Fix typo in comment.
2218
2219         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2220         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2221         (_): Remove; no longer needed.
2222         (openat): Renamed from rpl_openat; no need for rpl_openat
2223         since openat.h renames openat for us.
2224         Replace most of the body with a call to openat_permissive,
2225         to avoid duplicate code.
2226         Port to (probably hypothetical) environments were mode_t is
2227         wider than int.
2228         (openat_permissive): Require mode arg, so that we can check
2229         types better.  Put it just after flags.  Change cwd failure
2230         indicator from pointer-to-bool to pointer-to-errno-value.
2231         All callers changed.
2232         Invoke openat_save_fail and/or openat_restore_fail if
2233         cwd_errno is null, so that openat can call us.
2234         (openat_permissive, fdopendir, fstatat, unlinkat):
2235         Simplify errno handling to avoid some duplicate code,
2236         as it's OK to set errno on success.
2237         * openat.h: Revamp code so that function macros depend on
2238         __OPENAT_PREFIX only, not also on AT_FDCWD.
2239         (openat_ro): Remove.  Caller changed to use openat_permissive.
2240         (openat_permissive): Now a macro, if not a function.
2241         (openat_restore_fail, openat_save_fail): Now always functions,
2242         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2243
2244         * openat-priv.h: New file, defining macros used by mkdirat.c
2245         and openat.c.
2246         * mkdirat.c: Include openat-priv.h.
2247         Remove definitions of macros defined therein.
2248         * openat.c: Likewise.
2249
2250         * mkdirat.c (mkdirat): New file and function.
2251         * openat.h (mkdirat): Declare.
2252
2253         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2254
2255         * openat.h (openat_permissive): Declare.
2256         (openat_ro): Define.
2257
2258         * openat.c (EXPECTED_ERRNO): New macro.
2259         (openat_permissive): New function -- used in remove.c rewrite.
2260         (all functions): Set errno just before returning, only if there
2261         was an actual failure.
2262         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2263
2264         Emulate openat-family functions using Linux's procfs, if possible.
2265         Idea and some code based on Ulrich Drepper's glibc changes.
2266
2267         * openat.c: (BUILD_PROC_NAME): New macro.
2268         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2269         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2270         before falling back on save_cwd and restore_cwd.
2271         (fdopendir, fstatat, unlinkat): Likewise.
2272
2273         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2274         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2275
2276         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2277         as second argument to va_arg.  Otherwise, some versions of gcc
2278         warn that `if this code is reached, the program will abort'.
2279
2280 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2281
2282         Sync from coreutils.
2283
2284         Add POSIX ACL support
2285         * acl.h (copy_acl, set_acl): Add declarations.
2286         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2287         systems other than Linux.
2288         (chmod_or_fchmod): New function: use fchmod when possible,
2289         and chmod otherwise.
2290         (file_has_acl): Add a POSIX ACL implementation, with a
2291         Linux-specific subcase.
2292         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2293         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2294         acls are unsupported.
2295         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2296         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2297         are unsupported.
2298
2299 2006-01-09  Bruno Haible  <bruno@clisp.org>
2300
2301         * sysexit_.h (EX_OK): New macro.
2302         Suggested by Martin Lambers <marlam@marlam.de>.
2303
2304 2006-01-09  Bruno Haible  <bruno@clisp.org>
2305
2306         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2307         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2308         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2309         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2310
2311 2006-01-09  Bruno Haible  <bruno@clisp.org>
2312
2313         * stdint_.h (SIZE_MAX): Write the value without involving negative
2314         numbers.
2315
2316 2005-10-16  Bruno Haible  <bruno@clisp.org>
2317
2318         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2319         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2320
2321 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2322
2323         * strftime.c (tzname): Don't declare if it is already #defined.
2324         Problem reported for Mingw by Mark Junker.
2325
2326 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2327
2328         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2329         long int, not int, for nanosecond counts, so that people who are
2330         used to POSIX struct timespec won't be surprised.  Reported by Jim
2331         Meyering.
2332
2333 2005-12-16  Jim Meyering  <jim@meyering.net>
2334
2335         * fprintftime.c, fprintftime.h: New files.
2336
2337 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2338
2339         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2340         * argp-help.c (fill_in_uparams): Check if the constructed
2341         struct uparams is valid. Fall back to the default values if it is
2342         not.
2343
2344 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2345
2346         * argp-help.c (__argp_base_name): New function
2347         (__argp_short_program_name): Rewrite using __argp_base_name
2348         * argp-namefrob.h: Define program_invocation_name and
2349         program_invocation_short_name if requested
2350         (__argp_base_name): Add prototype
2351         * argp-parse.c (argp_def): Use gettext wrappers
2352         (argp_default_parser): Use __argp_base_name
2353         * argp-pin.c: New file. Defines program_invocation_name and
2354         program_invocation_short_name on systems that lack them.
2355
2356 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2357
2358         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2359         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2360         porting problem reported by Georg Schwarz in
2361         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2362
2363 2005-07-09  Bruno Haible  <bruno@clisp.org>
2364
2365         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2366         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2367         Reported by Mark Junker <mjscod@gmx.de>.
2368
2369 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2370
2371         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2372         (uintmax_t) [defined uintmax_t]: Do not declare.
2373         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2374         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2375         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2376         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2377         sake of portability to weird hosts that C allows (though we don't
2378         know of any practical examples).
2379
2380         * savedir.h (fdsavedir): New decl.
2381         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2382         contains most of the former guts of savedir.
2383         (savedir): Use savedirstream.
2384         Include "openat.h".
2385
2386 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2387
2388         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2389         coreutils no longer futzes with rounding modes.
2390
2391 2005-11-14  Jim Meyering  <jim@meyering.net>
2392
2393         * mkstemp-safer.c: Include <config.h>, required for possible
2394         replacement of mkstemp.
2395
2396 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2397
2398         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2399         business.
2400         (gethrxtime) [! (HAVE_NANOUPTIME
2401         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2402         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2403         our own approximation.
2404
2405 2005-11-10  Simon Josefsson  <jas@extundo.com>
2406
2407         * readline.c: Remove EOL.
2408
2409 2005-11-08  Eric Blake  <ebb9@byu.net>
2410
2411         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2412
2413 2005-11-08  Eric Blake  <ebb9@byu.net>
2414
2415         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2416
2417 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2418
2419         Fix porting problem reported by Theodoros V. Kalamatianos.
2420         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2421         Don't assume that futimes failing means we must fail.
2422
2423 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2424
2425         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2426         leave errno alone.  Problem reported by Dmitry V. Levin.
2427
2428 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2429
2430         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2431         errno alone.  Problem reported by Frederic Jolliton.
2432
2433 2005-10-28  Simon Josefsson  <jas@extundo.com>
2434
2435         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2436         "restrict" keywords, as per POSIX.  Protect the function
2437         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2438         Don't use K&R prototypes.  Check the sprintf return values.
2439         Re-define EAFNOSUPPORT if not present.  Indent.
2440
2441         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2442         suggested by Bruno Haible <bruno@clisp.org>.
2443
2444         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2445
2446         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2447
2448         * gc-libgcrypt.c: Add MD2 (which is not available through
2449         libgcrypt).
2450
2451         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2452
2453         * md2.h, md2.c: New files.
2454
2455 2005-10-24  Simon Josefsson  <jas@extundo.com>
2456
2457         * md4.h: Shrink buffer size, now that we changed the type.
2458
2459 2005-10-22  Simon Josefsson  <jas@extundo.com>
2460
2461         * arcfour.h, arcfour.c: Use fixed size indices in the
2462         arcfour_context struct (simplify test vector testing in GNU
2463         Shishi).
2464
2465 2005-10-22  Simon Josefsson  <jas@extundo.com>
2466
2467         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2468         suggested by Bruno Haible <bruno@clisp.org>.
2469
2470 2005-10-22  Simon Josefsson  <jas@extundo.com>
2471
2472         * crc.h: Include stddef.h, for size_t.
2473
2474 2005-10-21  Simon Josefsson  <jas@extundo.com>
2475
2476         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2477         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2478
2479 2005-10-21  Simon Josefsson  <jas@extundo.com>
2480
2481         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2482         block.
2483
2484 2005-10-21  Simon Josefsson  <jas@extundo.com>
2485
2486         * gc-gnulib.c: Support ARCTWO in CBC mode.
2487
2488 2005-10-21  Simon Josefsson  <jas@extundo.com>
2489
2490         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2491         <bruno@clisp.org>.
2492
2493         * hmac-sha1.c (hmac_sha1): Likewise.
2494
2495         * crc.c (crc32_update): Actually use crc parameter, suggested by
2496         Bruno Haible <bruno@clisp.org>.
2497
2498         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2499         <bruno@clisp.org>.
2500
2501 2005-10-21  Simon Josefsson  <jas@extundo.com>
2502
2503         * des.h, des.c: New files.
2504
2505         * gc-gnulib.c: Support DES.c
2506
2507 2005-10-21  Simon Josefsson  <jas@extundo.com>
2508
2509         * arctwo.h, arctwo.c: New files.
2510
2511         * gc-gnulib.c: Support ARCTWO.
2512
2513 2005-10-21  Simon Josefsson  <jas@extundo.com>
2514
2515         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2516
2517 2005-10-19  Simon Josefsson  <jas@extundo.com>
2518
2519         * gc-gnulib.c: Support ARCFOUR.
2520
2521 2005-10-19  Simon Josefsson  <jas@extundo.com>
2522
2523         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2524         support.
2525
2526         * gc.h: Add ECB enum type.
2527
2528         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2529
2530 2005-10-19  Simon Josefsson  <jas@extundo.com>
2531
2532         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2533
2534 2005-10-18  Simon Josefsson  <jas@extundo.com>
2535
2536         * md4.h, md4.c: New files, based on md5.?.
2537
2538 2005-10-17  Simon Josefsson  <jas@extundo.com>
2539
2540         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2541
2542         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2543
2544 2005-10-17  Simon Josefsson  <jas@extundo.com>
2545
2546         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2547
2548 2005-10-17  Simon Josefsson  <jas@extundo.com>
2549
2550         * gc.h, gc-libgcrypt.c: Add ciphers.
2551
2552 2005-10-17  Simon Josefsson  <jas@extundo.com>
2553
2554         * sha1.c: Use uint32_t instead of md5_uint32.t
2555
2556         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2557         md5.h.
2558
2559         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2560
2561         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2562
2563 2005-10-15  Simon Josefsson  <jas@extundo.com>
2564
2565         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2566
2567         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2568
2569 2005-10-14  Simon Josefsson  <jas@extundo.com>
2570
2571         * arcfour.h, arcfour.c: New files.
2572
2573 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2574
2575         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2576         include <wchar.h>; no longer needed.
2577
2578 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2579         and  Ulrich Drepper  <drepper@redhat.com>
2580
2581         Import from libc.
2582         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2583         instead of inline stream orientation test and two separate
2584         function calls.  Pay no attention to USE_IN_LIBIO.
2585
2586 2005-10-14  Roland McGrath  <roland@redhat.com>
2587
2588         Import from libc.  [BZ #1331]
2589         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2590         macro argument.
2591         Reported by Matej Vela <vela@debian.org>.
2592
2593 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2594
2595         * mkdir-p.c (make_dir_parents): Don't report an error if an
2596         intermediate directory is in a read-only file system.  Problem
2597         reported by Eric Blake.
2598
2599 2005-10-13  Simon Josefsson  <jas@extundo.com>
2600
2601         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2602         Move memory allocation outside of loop.
2603
2604 2005-10-12  Simon Josefsson  <jas@extundo.com>
2605
2606         * gc-pbkdf2-sha1.c: New file.
2607
2608         * gc.h: Add gc_pbkdf2_sha1 prototype.
2609
2610 2005-10-12  Simon Josefsson  <jas@extundo.com>
2611
2612         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2613         suggested by Bruno Haible <bruno@clisp.org>.
2614
2615 2005-10-12  Simon Josefsson  <jas@extundo.com>
2616
2617         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2618
2619         * gc-gnulib.c (gc_hmac_sha1): New function.
2620
2621 2005-10-12  Simon Josefsson  <jas@extundo.com>
2622
2623         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2624
2625 2005-10-12  Simon Josefsson  <jas@extundo.com>
2626
2627         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2628         GC_USE_HMAC_MD5, respectively.
2629
2630         * gc-libgcrypt.c (gc_md5): Fix assert call.
2631         (gc_md5): Fix typo.
2632
2633         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2634
2635         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2636
2637         * gc-gnulib.c (gc_hash_buffer): Ditto.
2638
2639 2005-10-11  Bruno Haible  <bruno@clisp.org>
2640
2641         * c-strcasestr.h: New file, from GNU gettext.
2642         * c-strcasestr.c: New file, from GNU gettext.
2643
2644 2005-10-11  Bruno Haible  <bruno@clisp.org>
2645
2646         * c-strcase.h: New file, from GNU gettext.
2647         * c-strcasecmp.c: New file, from GNU gettext.
2648         * c-strncasecmp.c: New file, from GNU gettext.
2649
2650 2005-10-11  Simon Josefsson  <jas@extundo.com>
2651
2652         * crc.h, crc.c: New files.
2653
2654         * gc.h (gc_hash_buffer): Add doc.
2655
2656 2005-10-08  Simon Josefsson  <jas@extundo.com>
2657
2658         * gc.h: Add gc_hash and gc_hash_buffer.
2659
2660         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2661
2662         * gc-libgcrypt.c (gc_hash_buffer): Add.
2663
2664 2005-10-11  Bruno Haible  <bruno@clisp.org>
2665
2666         * strcasecmp.c: Include limits.h.
2667         (strcasecmp): Avoid integer overflow on exotic platforms.
2668         * strncasecmp.c: Include limits.h.
2669         (strncasecmp): Avoid integer overflow on exotic platforms.
2670         Reported by Paul Eggert.
2671
2672 2005-10-06  Simon Josefsson  <jas@extundo.com>
2673
2674         * hmac-md5.c: New file.
2675
2676         * hmac.h: New file.
2677
2678 2005-10-06  Simon Josefsson  <jas@extundo.com>
2679
2680         * memxor.c (memxor): Avoid casts and warnings.
2681
2682 2005-10-05  Derek Price  <derek@ximbiot.com>
2683
2684         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2685
2686 2005-10-05  Simon Josefsson  <jas@extundo.com>
2687
2688         * memxor.c (memxor): Fix compiler error.
2689
2690         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2691         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2692
2693         * memxor.h, memxor.c: New files.
2694
2695         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2696         we assume all systems have it, suggested by Jim Meyering
2697         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2698         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2699         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2700         same reasons.
2701
2702 2005-10-04  Bruno Haible  <bruno@clisp.org>
2703
2704         * verify.h (verify_true): Provide alternative definition for C++.
2705
2706 2005-10-04  Simon Josefsson  <jas@extundo.com>
2707
2708         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2709         D. Baushke" <mdb@gnu.org>.
2710
2711 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2712
2713         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2714         (SSIZE_MAX): New macro, if not already defined.
2715         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2716         than 2 GiB.
2717
2718 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2719
2720         * exclude.c: Include verify.h.
2721         (verify): Remove.  All callers changed to use verify.h's version.
2722         * strtoimax.c: Likewise.
2723         * utimecmp.c: Likewis.e
2724
2725         Sync from coreutils.
2726         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2727         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2728         * .cvsignore: Add fts.h, search.h, t-fpending.
2729         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2730         bother returning ENOSYS if settimeofday or stime fails; just let
2731         them return whatever errno they want to return.
2732         * utimens.c: Include unistd.h, for dup2.
2733         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2734         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2735
2736 2005-10-02  Jim Meyering  <jim@meyering.net>
2737
2738         Sync from coreutils.
2739         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2740         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2741         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2742         Remove AT_FDCWD test.
2743         Do not consume the fd unless successful.
2744         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2745         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2746         block, so that we don't even try to compile it if settimeofday is
2747         available.  This works around a compilation failure on OSF1 V5.1,
2748         due to stime requiring a `long int*' while tv_sec is `int'.
2749
2750 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2751
2752         * getdelim.c (getdelim): Remove unused variables.
2753
2754 2005-10-01  Simon Josefsson  <jas@extundo.com>
2755
2756         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2757         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2758         AI_* and EAI_* definitions.  Protect function declarations.
2759
2760 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2761
2762         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2763         so that the code works even with ancient cpp.  Portability problem
2764         with GCC 2.7.2.1 reported by Thomas M.Ott.
2765
2766 2005-09-27  Jim Meyering  <jim@meyering.net>
2767
2768         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2769
2770         * intprops.h (signed_type_or_expr__): Define.
2771         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2772         for unsigned types.
2773
2774 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2775
2776         * verify.h (verify_expr): Remove, replacing with:
2777         (verify_true): New macro that returns true instead of void.
2778         (verify_type__): Remove.
2779         (verify): Use verify_true rather than verify_type__.
2780
2781 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2782
2783         * utimens.c (ENOSYS): Define if not already defined.
2784         (futimens): Support having a null PATH if the file descriptor
2785         is nonnegative.
2786
2787         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2788         Remove.
2789         (__attribute): Define to empty unless GCC 3.1 or later.
2790         This works around a core dump on OpenBSD 3.4, which has GCC
2791         2.95.3, which dumps core when given __attribute__(()).  It also
2792         simplifies other tests, since we really don't want to bother with
2793         worrying about which ancient version of GCC supported what.
2794         Original problem reported by Yoann Vandoorselaere, with part of
2795         the fix suggested by Derek Price.
2796
2797 2005-09-24  Jim Meyering  <jim@meyering.net>
2798
2799         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2800         so we can once again use a positive bitfield width of 1 -- now we
2801         don't have to explain why we were using a bitfield width of 2.
2802
2803 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2804
2805         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2806         Problem reported by Eric Blake.
2807         (getaddrinfo): Initialize se so that it's not garbage.
2808         Redo internal storage allocation so that it doesn't make unportable
2809         assumptions about alignment.
2810         Fix a memory leak.
2811
2812         * utimens.c (futimens): Use futimesat if available.
2813         Prefer it to futimes since it doesn't have the futimes bug.
2814
2815         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2816         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2817         Instead, declare a function that returns a pointer to an array,
2818         and use verify_type__ to declare the size of the array.
2819         Problem and germ of a solution reported by Bruno Haible.
2820         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2821         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2822
2823 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2824
2825         Sync from coreutils.
2826
2827         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2828         stat-time.h.
2829         * argmatch.h: Include verify.h
2830         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2831         (ARGMATCH_ASSERT): Remove; unused.
2832         * canonicalize.c: Assume STDC_HEADERS.
2833         * exclude.c: Include "strcase.h".
2834         * regex_internal.h [!defined _LIBC]: Likewise.
2835         * getusershell.c: Include stdio--.h rather than stdio.h
2836         and stdio-safer.h.
2837         (getusershell): Call fopen, not fopen_safer.
2838         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2839         Do not include unistd-safer.h.
2840         (save_cwd): Don't call fd_safer; no longer needed
2841         now that we include fcntl--.h.
2842
2843         * getdate.y (relative_time): New type.
2844         (RELATIVE_TIME_0): New constant.
2845         (parser_control): Use relative_time instead of doing it ourselves.
2846         (%union): Add new relative_time rel member.
2847         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2848         Now typeless.
2849         (relunit, relunit_snumber): Now of type rel.
2850         (zone, rel, relunit, get_date): Adjust to above changes.
2851
2852         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2853         Do not include unistd-safer.h.
2854         (getloadavg): Don't call fd_safer; no longer needed
2855         now that we include fcntl--.h.
2856
2857         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2858         (make_dir_parents): Treat ENOSYS like EEXIST.
2859
2860         Improve quality of diagnostics on restore_cwd failure.
2861         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2862         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2863         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2864         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2865         each time through the loop.  Do not diagnose restore_cwd failure;
2866         that is the caller's job (and perhaps the caller does not care).
2867
2868         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2869         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2870         If the file already exists but is not a directory, don't bother
2871         to try to make its parents.
2872         Close potential file descriptor leak if we can't chdir("/") (!).
2873         Don't always return true if chdir($PWD) fails; return true only
2874         if the requested action was done successfully (except for the
2875         chdir($PWD)).
2876         Don't log final directory unless we actually made it.
2877         Refactor to avoid duplicate code to fix up permissions.
2878         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2879
2880         * strftime.c (my_strftime): Rewrite the previous change slightly,
2881         to make it a bit faster and (I hope) clearer.
2882         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2883         Fix bug in formats like %2N.
2884
2885         * verify.h: New file.
2886
2887 2005-09-22  Jim Meyering  <jim@meyering.net>
2888
2889         Sync from coreutils.
2890
2891         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2892
2893         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2894         the .tm_year member, since otherwise gcc-4.0 would now warn about
2895         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2896
2897         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2898         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2899
2900         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2901         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2902         when run in a time zone for which daylight savings time is in effect
2903         for the starting date.
2904
2905         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2906         stop us from restricting permissions of just-created absolute-named
2907         directories.
2908         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2909         to restore initial working directory.
2910         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2911         to tell caller if/when we change the working directory and are
2912         unable to return to the initial one.
2913         * mkdir-p.h (make_dir_parents): Update prototype.
2914         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2915         `return false'.  This fixes a bug introduced on 2004-07-30.
2916
2917         * openat.c (fdopendir): Be sure to close the supplied
2918         file descriptor before returning.  This makes our replacement
2919         implementation a little closer to Solaris's, where fdopendir
2920         ties the file descriptor to the returned DIR* pointer.
2921         * openat.c (unlinkat): New function.
2922         * openat.h (unlinkat): Add prototype.
2923         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2924         (openat_restore_fail): Rename from openat_restore_die.
2925         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2926
2927         Provide an alternative to exiting immediately upon save_cwd or
2928         restore_cwd failure.  Now, an application can arrange e.g.,
2929         to perform a longjump in that case.
2930         * openat.c: Include dirname.h.
2931         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2932         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2933         and openat_restore_die rather than calling error directly.
2934         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2935
2936         * openat-die.c (openat_save_die, openat_restore_die): New file.
2937         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2938
2939         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2940         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2941                             int utc, int nanoseconds);
2942         Background:
2943         date should not have to allocate a megabyte of virtual memory to
2944         handle a format argument like +%1048575T.  When implemented with
2945         strftime, it must allocate such a buffer, use strftime to fill it
2946         in, print it, then free it.
2947         With fprintftime, it simply prints everything and exits.
2948         With no need for memory allocation, that's one fewer way to fail.
2949         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2950         optional field width, not before, so we accept %9:z, not %:9z.
2951         (my_strftime): Be sure to use L_('x') for literals.
2952
2953         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2954         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2955         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2956         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2957         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2958         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2959         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2960         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2961         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2962
2963         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2964         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2965         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2966         and don't include <sys/file.h>).
2967
2968 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2969
2970         Sync from coreutils.
2971
2972         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2973         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2974         [!LDAV_DONE]: Avoid unused variable warning.
2975
2976 2005-09-21  Bruno Haible  <bruno@clisp.org>
2977
2978         * unicodeio.h (unicode_to_mb): New declaration.
2979
2980 2005-09-20  Derek Price  <derek@ximbiot.com>
2981
2982         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2983
2984 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2985
2986         Use a consistent style for including <config.h>.
2987         * __fpending.c, acl.c, argmatch.c,
2988         argp-help.c, argp-parse.c,
2989         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2990         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2991         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2992         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2993         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2994         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2995         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2996         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2997         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2998         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2999         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3000         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3001         modechange.c, mountlist.c, open-safer.c, physmem.c,
3002         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3003         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3004         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3005         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3006         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3007         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3008         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3009         userspec.c, utimecmp.c, version-etc-fsf.c,
3010         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3011         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3012         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3013         Standardize inclusion of config.h.
3014         * __fpending.h, dirfd.h, getdate.h, human.h,
3015         inttostr.h:  Removed inclusion of config.h from header files.
3016         * inttostr.c:  Adjusted in-tree users.
3017         * timespec.h: Remove superfluous warning to include config.h.
3018         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3019         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3020         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3021         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3022
3023 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3024
3025         * stat-time.h: New file.
3026         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3027         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3028         in a different way.
3029         (timespec_cmp): New function.
3030         * utimecmp.c: Include stat-time.h.
3031         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3032         members exist, not on the obsolescent ST_MTIM_NSEC.
3033         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3034
3035 2005-09-15  Derek Price  <derek@ximbiot.com>
3036             Paul Eggert  <eggert@cs.ucla.edu>
3037
3038         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3039         changes, consolidating in...
3040         * regex_internal.h: ...this file.
3041
3042 2005-09-15  Derek Price  <derek@ximbiot.com>
3043
3044         * regex_internal.h: Blank `pure' for GNUC < 3.
3045         * regex_internal.c: Ditto, using this...
3046         (__GNUC_PREREQ): ...new macro.
3047         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3048         (__GNUC_PREREQ): ...this new macro.
3049
3050         * strstr.h: Include string.h. Define strstr as a macro here.
3051
3052 2005-09-13  Derek Price  <derek@ximbiot.com>
3053
3054         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3055         failure.
3056         Reported by Jim Meyering  <jim@meyering.net>.
3057
3058 2005-09-13  Jim Meyering  <jim@meyering.net>
3059
3060         * canon-host.c: Filter through gnu indent and reword comments slightly.
3061         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3062
3063 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3064
3065         * base64.c: Typo.
3066         (base64_encode): Put b64str in initialized data section.
3067
3068 2005-09-12  Derek Price  <derek@ximbiot.com>
3069
3070         Return usable errors from canon-host.
3071         * canon-host.h: New file.
3072         * canon-host.c (canon_host): Wrap...
3073         (canon_host_r): ...this new function, which now relies exclusively on
3074         getaddrinfo.
3075         (ch_strerror): New function.
3076         (last_cherror): New global.
3077         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3078         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3079         void *.
3080         (freeaddrinfo): Free ai->ai_canonname when set.
3081
3082 2005-09-12  Derek Price  <derek@ximbiot.com>
3083             Paul Eggert  <eggert@cs.ucla.edu>
3084
3085         * glob-libc.h: Renamed from glob_.h.  The new version is
3086         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3087         protecting things that should be done only in gnulib contexts.
3088         * glob_.h: New file, containing only the glob things needed for
3089         gnulib.
3090         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3091         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3092         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3093         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3094         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3095         and to respect the namespace rules better.
3096
3097 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3098
3099         Merge glibc and coreutils changes into gnulib, plus a few
3100         extra fixes.
3101         * md5.c: Use #error rather than a string.
3102         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3103         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3104         (__attribute__): Define to empty for non recent-GCC.
3105         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3106         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3107         Renamed from their non-__ counterparts, with new macros replacing
3108         them if not _LIBC.  Add __THROW attribute.
3109         (rol): Remove.
3110         (struct md5_ctx): Align buffer if using GCC.
3111         * sha1.h (struct sha1_ctx): Likewise.
3112         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3113         The old name was backwards.
3114         (NOTSWAP): Remove; not used.
3115         (rol): New macro, moved here from md5.h.
3116         (sha1_process_block): Remove a FIXME that doesn't make sense.
3117
3118 2005-09-12  Derek Price  <derek@ximbiot.com>
3119
3120         * gai_strerror.c: Include config.h when available.  Include
3121         getaddrinfo.h before other headers to test interface.
3122         Reported by Larry Jones <lawrence.jones@ugs.com>.
3123
3124 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3125
3126         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3127         definitions, since that's the preferred style in glibc.
3128         Fix a minor spacing issue, and update copyright notice to match glibc's.
3129
3130 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3131
3132         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3133
3134 2005-09-06  Simon Josefsson  <jas@extundo.com>
3135
3136         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3137         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3138
3139 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3140
3141         Change bitset word type from unsigned int to unsigned long int,
3142         as this has better performance on typical 64-bit hosts.
3143         Port bitset code to hosts with unusual word sizes.
3144         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3145         (build_collating_symbol):
3146         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3147         argument is a bitset.  This is merely a style issue, but it makes
3148         it clearer that an entire array is expected.
3149         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3150         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3151         Port to the case where bitset_word is not the same as unsigned int.
3152         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3153         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3154         Likewise.
3155         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3156         (build_trtable, group_nodes_into_DFAstates):
3157         Likewise.
3158         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3159         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3160         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3161         * regexec.c (group_nodes_into_DFAstates): Likewise.
3162         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3163         * regcomp.c (optimize_subexps, lower_subexp):
3164         Work even if bitset_word has holes in its bitwise representation.
3165         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3166         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3167         Likewise.
3168         * regex_internal.c (re_string_reconstruct):
3169         Don't assume UCHAR_MAX == 255.
3170         * regex_internal.h (bitset_set_all): Likewise.
3171         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3172         All uses changed.
3173         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3174         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3175         All uses changed.
3176         (BITSET_WORD_MAX): New macro.
3177         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3178         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3179         (bitset_empty, bitset_copy):
3180         Prefer sizeof (bitset) to multiplying it out ourselves.
3181         (bitset_not_merge): Remove; unused.
3182         (bitset_contain): Return bool, not unsigned int with one bit on.
3183         All callers changed.
3184         * regexec.c (build_trtable): Don't assume bitset has no stricter
3185         alignment than re_node_set; do this by defining a new internal
3186         type struct dests_alloc and using it to allocate memory.
3187
3188 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3189
3190         Check for arithmetic overflow when calculating sizes, to prevent
3191         some buffer-overflow issues.  These patches are conservative, in the
3192         sense that when I couldn't determine whether an overflow was possible,
3193         I inserted a run-time check.
3194         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3195         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3196         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3197         (re_xnrealloc, re_x2nrealloc): New inline functions.
3198         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3199         (build_equiv_class, build_charclass): Check for arithmetic overflow
3200         in size expression calculations.
3201         * regex_internal.c (re_string_realloc_buffers):
3202         (build_wcs_upper_buffer, re_node_set_add_intersect):
3203         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3204         (re_dfa_add_node, register_state): Likewise.
3205         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3206         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3207         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3208         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3209
3210 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3211
3212         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3213         to avoid a collision with bits/local_lim.h in glibc.
3214         All uses changed.  Problem reported by Dmitry V. Levin in
3215         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3216
3217         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3218         bugs in int versus size_t comparisons.
3219         (re_string_context_at): Fix bug where the code assumed that
3220         Idx is signed.
3221
3222         Use bool where appropriate.
3223         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3224         All callers changed.
3225         (calc_eclosure_iter): Likewise, for ROOT arg.
3226         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3227         (build_charclass_op): Likewise, for NON_MATCH arg.
3228         * regex_internal.c (re_string_allocate, re_string_construct):
3229         (re_string_construct_common): Likewise, for ICASE arg.
3230         * regexec.c (re_search_2_stub, re_search_stub):
3231         Likewise, for RET_LEN arg.
3232         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3233         (set_regs): Likewise, for FL_BACKTRACK arg.
3234         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3235         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3236         (calc_eclosure_iter, parse_bracket_exp):
3237         Use bool for internal variables that are booleans.
3238         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3239         (set_regs, build_sifted_states, sift_states_bkref):
3240         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3241         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3242         (find_collation_sequence_value):
3243         Likewise.
3244         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3245         (re_node_set_compare):
3246         Return bool, not int. All callers changed.
3247         * regexec.c (check_halt_node_context, check_dst_limits):
3248         (build_trtable, check_node_accept): Likewise.
3249         * regex_internal.h: Include stdbool.h.
3250
3251         Fix bugs uncovered when converting to bool.
3252         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3253         failure instead of charging ahead blindly.
3254         * regex_internal.c (register_state): Likewise.
3255         * regexec.c (re_search_2_stub): Use simpler method than boolean
3256         for freeing internal storage.
3257         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3258         bitset pieces used as boolean, to avoid undefined behavior
3259         on hosts that do int overflow checking.
3260
3261 2005-08-31  Derek Price  <derek@ximbiot.com>
3262
3263         * getdelim.c (getdelim): Return EOF on EOF.
3264         Reported by Larry Jones <lawrence.jones@ugs.com>.
3265
3266 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3267
3268         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3269         lengths fit in regoff_t; this isn't true if regoff_t is the same
3270         width as size_t.
3271         * regex.c (re_search_internal): 5th arg is LAST_START
3272         (= START + RANGE) instead of RANGE.  This avoids overflow
3273         problems when regoff_t is the same width as size_t.
3274         All callers changed.
3275         (re_search_2_stub): Check for overflow when adding the
3276         sizes of the two strings.
3277         (re_search_stub): Check for overflow when adding START
3278         to RANGE; if it occurs, substitute the extreme value.
3279
3280 2005-08-31  Jim Meyering  <jim@meyering.net>
3281
3282         * regcomp.c (search_duplicated_node): Make first pointer arg
3283         a pointer-to-const.
3284         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3285         (register_state): Likewise.
3286         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3287         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3288         (group_nodes_into_DFAstates): Likewise.
3289
3290 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3291
3292         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3293         old glibc regex code mishandles strings longer than 2**31 bytes.
3294         This patch fixes this when the regex code is used in gnulib
3295         (i.e., outside glibc).
3296
3297         This patch should not affect the use of the regex code inside
3298         glibc.  No doubt this problem also needs to be handled for glibc
3299         as well, but the result will be an incompatible change to the
3300         glibc ABI, and the old ABI will have to be supported too.  That
3301         can be the the subject for another patch.
3302
3303         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3304         governing whether the rest of this patch is active.  By default,
3305         the macro is disabled and the patch has no effect.
3306         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3307         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3308         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3309         (re_match_2, re_set_registers): Use the new types.
3310         * regex_internal.h (Idx, re_hashval_t): New types.
3311         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3312         New macros.
3313         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3314         (re_string_context_at, bin_tree_t, re_dfastate_t):
3315         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3316         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3317         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3318         (re_string_char_size_at, re_string_wchar_at):
3319         (re_string_elem_size_at):
3320         Use the new types and macros to port to 64-bit hosts.
3321         Use unsigned types for internal values, so that the code
3322         mostly works even for arrays larger than SSIZE_MAX.
3323         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3324         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3325         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3326         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3327         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3328         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3329         (calc_inveclosure, parse_dup_op, build_range_exp):
3330         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3331         (fetch_number, create_token_tree, mark_opt_subexp):
3332         Likewise.
3333         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3334         (create_cd_newstate, re_string_allocate, re_string_construct):
3335         (re_string_realloc_buffers, build_wcs_upper_buffer):
3336         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3337         (re_string_reconstruct, re_string_peek_byte_case):
3338         (re_string_fetch_byte_case, re_string_context_at):
3339         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3340         (re_node_set_init_copy, re_node_set_add_intersect):
3341         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3342         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3343         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3344         (re_acquire_state, re_acquire_state_context, register_state):
3345         Likewise.
3346         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3347         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3348         (re_search_internal, re_search_2_stub, re_search_stub)
3349         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3350         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3351         (update_cur_sifted_state, check_dst_limits):
3352         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3353         (check_subexp_limits, sift_states_bkref, merge_state_array):
3354         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3355         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3356         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3357         (expand_bkref_cache, check_node_accept_bytes):
3358         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3359         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3360         (acquire_init_state_context, check_halt_node_context):
3361         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3362         (sift_states_backward, clean_state_log_if_needed):
3363         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3364         (find_recover_state, transit_state_sb, transit_state_mb):
3365         (transit_state_bkref, build_trtable, match_ctx_clean):
3366         Likewise.
3367         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3368         to work around an assumption that REG_MISSING is negative.
3369
3370         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3371         (seek_collating_symbol_entry) [defined _LIBC]:
3372         (lookup_collation_sequence_value) [defined _LIBC]:
3373         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3374         Use prototypes rather than old-style function definitions.
3375         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3376         (transit_state_sb) [0]:
3377         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3378
3379         * regexec.c (re_search_internal): Simplify update of rm_so and
3380         rm_eo.
3381
3382         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3383         (optimize_subexps, lower_subexp):
3384         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3385         since the signed shift might overflow.  Use 1u<<31 instead.
3386         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3387         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3388         Likewise.
3389
3390         * regcomp.c (optimize_subexps, lower_subexp):
3391         Use CHAR_BIT rather than 8, for clarity.
3392         * regexec.c (check_dst_limits_calc_pos_1):
3393         (check_subexp_matching_top): Likewise.
3394         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3395         have to worry about portability issues when shifting it left.
3396         Remove no-longer-needed test for table_size > 0.
3397         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3398         in a word, as the resulting behavior is undefined.
3399         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3400         in one case, a <= should have been an <, and in another case the
3401         whole test was missing.
3402         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3403         the standard name CHAR_BIT.
3404         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3405         this is not true on one's complement and signed-magnitude hosts.
3406
3407         * regex_internal.h (re_sub_match_top_t): Remove unused member
3408         next_last_offset.
3409         (struct re_dfa_t): Remove unused member states_alloc.
3410         * regcomp.c (init_dfa): Don't initialize unused members.
3411
3412 2005-08-31  Bruno Haible  <bruno@clisp.org>
3413
3414         * strstr.c: Include <stddef.h>, for NULL.
3415         * strcasestr.c: Likewise.
3416         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3417
3418 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3419
3420         * iconvme.h: Add prototype for iconv_alloc.
3421
3422 2005-08-29  Simon Josefsson  <jas@extundo.com>
3423
3424         * iconvme.c: Fix errno.
3425
3426 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3427
3428         * iconvme.c: Split iconv_string into iconv_alloc.
3429
3430 2005-08-27  Jim Meyering  <jim@meyering.net>
3431
3432         * fopen-safer.c: Merge minor changes from coreutils.
3433         * dup-safer.c: Likewise.
3434         * fd-safer.c: Likewise.
3435
3436         Merge from coreutils.
3437         * stdio--.h: New file.
3438         * stdlib--.h: New file.
3439         * mkstemp-safer.c: New file.
3440
3441         GNU tar needs these.
3442         * pipe-safer.c: New file.
3443         * creat-safer.c: New file.
3444         * fcntl--.h (creat): Define to creat_safer.
3445         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3446         * unistd--.h (pipe): Define to pipe_safer.
3447         * unistd-safer.h: Declare pipe_safer.
3448
3449 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3450
3451         * regex_internal.h: Remove all references to
3452         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3453         or better.
3454         (bitset_not, bitset_merge, bitset_not_merge):
3455         (bitset_mask, re_string_allocate, re_string_construct):
3456         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3457         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3458         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3459         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3460         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3461         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3462         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3463         (re_acquire_state_context):
3464         Remove unnecessary forward decls.
3465         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3466         Put __attribute at function definition,
3467         now that the function decl has been removed.
3468         * regex_internal.c (re_string_peek_byte_case):
3469         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3470         Likewise.
3471
3472 2005-08-26  Simon Josefsson  <jas@extundo.com>
3473
3474         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3475         Haible <bruno@clisp.org>.
3476
3477 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3478
3479         * regexec.c (set_regs): Don't alloca with an unbounded size.
3480
3481         alloca modernization/simplification for regex.
3482         * regex.c: Remove portability cruft for alloca.  This no longer
3483         needs to be at the start of the file, and can be moved into
3484         regex_internal.h and simplified.
3485         * regex_internal.h: Include <alloca.h>.
3486         (__libc_use_alloca) [!defined _LIBC]: New macro.
3487         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3488         now works outside glibc.
3489
3490 2005-08-24  Simon Josefsson  <jas@extundo.com>
3491
3492         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3493         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3494         GLIBC specific code.
3495
3496 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3497
3498         Make regex safe for g++.  This fixes one real bug (an "err"
3499         that should have been "*err").  g++ problem reported by
3500         Sam Steingold.
3501         * regex_internal.h (re_calloc): New macro, consistent with
3502         re_malloc etc.  All callers of calloc changed to use re_calloc.
3503         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3504         not int.  All callers changed.
3505         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3506         just use an array of size MB_LEN_MAX.
3507         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3508         (find_recover_state): Change "err" to "*err"; this fixes what
3509         appears to be a real bug.
3510         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3511         versus int.
3512
3513 2005-08-25  Jim Meyering  <jim@meyering.net>
3514
3515         * open-safer.c: Include <config.h>.
3516         Otherwise, we'd lose LARGEFILE support in any file using
3517         e.g. "fcntl--.h"
3518
3519 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3520
3521         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3522         * regex.h (regerror): Likewise.
3523
3524         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3525         requires this.  (The code never needed it.)
3526
3527         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3528         All uses of recently-renamed identifiers changed to use the new,
3529         POSIX-compliant names.  The code will build and run just fine
3530         without these changes, but it's better to eat our own dog food
3531         and use the standard-conforming names.
3532
3533         * regex.h: Fix a multitude of POSIX name space violations.
3534         These changes have an effect only for programs that define
3535         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3536         do not change anything for programs compiled in the normal way.
3537         Also, there is no effect on the ABI.
3538
3539         (_REGEX_SOURCE): New macro.
3540         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3541         defined and _GNU_SOURCE is not; this fixes a name space violation.
3542
3543         Rename the following macros to obey POSIX requirements.
3544         The old names are still visible as macros if _REGEX_SOURCE is defined.
3545         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3546         RE_BACKSLASH_ESCAPE_IN_LISTS.
3547         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3548         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3549         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3550         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3551         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3552         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3553         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3554         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3555         (REG_INTERVALS): renamed from RE_INTERVALS.
3556         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3557         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3558         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3559         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3560         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3561         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3562         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3563         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3564         RE_UNMATCHED_RIGHT_PAREN_ORD.
3565         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3566         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3567         (REG_DEBUG): renamed from RE_DEBUG.
3568         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3569         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3570         unusual, since we can't clash with the POSIX REG_ICASE.
3571         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3572         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3573         (REG_NO_SUB): renamed from RE_NO_SUB.
3574         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3575         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3576         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3577         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3578         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3579         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3580         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3581         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3582         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3583         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3584         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3585         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3586         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3587         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3588         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3589         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3590         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3591         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3592         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3593         (REG_FIXED): Renamed from REGS_FIXED.
3594         (REG_NREGS): Renamed from RE_NREGS.
3595
3596         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3597         of other REG_* macros, since POSIX says the user is allowed to
3598         #undef these macros selectively.
3599
3600         (reg_errcode_t): Update comment stating what other tables need
3601         to be consistent.
3602
3603         Rename the following enum values to obey POSIX requirements.
3604         The old names are still visible as macros.
3605         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3606         is not defined, since GNU is supposed to be a superset of POSIX as
3607         much as possible, and since we want reg_errcode_t to be a signed
3608         type for implementation consistency.
3609         (_REG_NOERROR): Renamed from REG_NOERROR.
3610         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3611         (_REG_BADPAT): Renamed from REG_BADPAT.
3612         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3613         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3614         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3615         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3616         (_REG_EBRACK): Renamed from REG_EBRACK.
3617         (_REG_EPAREN): Renamed from REG_EPAREN.
3618         (_REG_EBRACE): Renamed from REG_EBRACE.
3619         (_REG_BADBR): Renamed from REG_BADBR.
3620         (_REG_ERANGE): Renamed from REG_ERANGE.
3621         (_REG_ESPACE): Renamed from REG_ESPACE.
3622         (_REG_BADRPT): Renamed from REG_BADRPT.
3623         (_REG_EEND): Renamed from REG_EEND.
3624         (_REG_ESIZE): Renamed from REG_ESIZE.
3625         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3626         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3627         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3628         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3629         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3630
3631         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3632         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3633         changed.  But support the old name if the new one is not defined
3634         and if _REGEX_SOURCE.
3635
3636         Change the following member names in struct re_pattern_buffer.
3637         The old names are still supported if !_REGEX_SOURCE.
3638         The new names are always supported, regardless of _REGEX_SOURCE.
3639         (re_buffer): Renamed from buffer.
3640         (re_allocated): Renamed from allocated.
3641         (re_used): Renamed from used.
3642         (re_syntax): Renamed from syntax.
3643         (re_fastmap): Renamed from fastmap.
3644         (re_translate): Renamed from translate.
3645         (re_can_be_null): Renamed from can_be_null.
3646         (re_regs_allocated): Renamed from regs_allocated.
3647         (re_fastmap_accurate): Renamed from fastmap_accurate.
3648         (re_no_sub): Renamed from no_sub.
3649         (re_not_bol): Renamed from not_bol.
3650         (re_not_eol): Renamed from not_eol.
3651         (re_newline_anchor): Renamed from newline_anchor.
3652
3653         Change the following member names in struct re_registers.
3654         The old names are still supported if !_REGEX_SOURCE.
3655         The new names are always supported, regardless of _REGEX_SOURCE.
3656         (rm_num_regs): Renamed from num_regs.
3657         (rm_start): Renamed from start.
3658         (rm_end): Renamed from end.
3659
3660         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3661         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3662         Prepend __ to parameter names.
3663
3664         Undo yesterday's changes.
3665
3666 2005-08-24  Jim Meyering  <jim@meyering.net>
3667
3668         Sync from coreutils.
3669         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3670
3671 2005-08-21  Bruno Haible  <bruno@clisp.org>
3672
3673         * lock.h: Add multiple inclusion guard.
3674         * tls.h: Add multiple inclusion guard.
3675
3676 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3677
3678         * regex.h (REG_NOSYS)
3679         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3680         Define, since POSIX requires it as of 2001.
3681         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3682         New private symbol, used to keep the enum signed in all cases.
3683         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3684         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3685
3686         * regex_internal.c (re_string_skip_chars, register_state):
3687         (calc_state_hash):
3688         Remove forward decls; no longer needed now that we use prototypes.
3689         * regexec.c (acquire_init_state_context, check_halt_node_context):
3690         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3691         (clean_state_log_if_needed): Likewise.
3692
3693 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3694
3695         Fix problems reported by Sam Steingold in
3696         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3697         * regexec.c (sift_states_bkref): Fix portability bug: the code
3698         assumed that reg_errcode_t is a signed type, which is not
3699         necessarily true if _XOPEN_SOURCE is not defined.
3700         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3701         some compilers warn about it otherwise.
3702
3703 2005-08-20  Jim Meyering  <jim@meyering.net>
3704
3705         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3706         of unused local, dfa.
3707
3708 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3709
3710         * regcomp.c (create_initial_state): Remove duplicate decl.
3711         (init_word_char, create_initial_state, duplicate_node_closure):
3712         (fetch_token, peek_token_bracket, build_range_exp):
3713         (build_collating_symbol): Remove forward decls; no longer needed
3714         now that we use prototypes.
3715
3716         * regcomp.c:
3717         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3718         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3719         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3720         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3721         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3722         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3723         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3724         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3725         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3726         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3727         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3728         (build_charclass, build_charclass_op, fetch_number, create_tree):
3729         (create_token_tree, mark_opt_subexp, duplicate_tree):
3730         Use prototypes rather than old-style definitions.
3731
3732         * regex_internal.c:
3733         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3734         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3735         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3736         (re_string_reconstruct, re_string_peek_byte_case):
3737         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3738         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3739         (re_node_set_init_copy, re_node_set_add_intersect):
3740         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3741         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3742         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3743         (re_acquire_state, re_acquire_state_context, register_state):
3744         (create_ci_newstate, create_cd_newstate, free_state):
3745         Likewise.
3746         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3747         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3748         (re_search_internal, prune_impossible_nodes):
3749         (acquire_init_state_context, check_matching, static):
3750         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3751         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3752         (update_regs, sift_states_backward, build_sifted_states):
3753         (clean_state_log_if_needed, merge_state_array):
3754         (update_cur_sifted_state, add_epsilon_src_nodes):
3755         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3756         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3757         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3758         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3759         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3760         (check_arrival, check_arrival_add_next_nodes):
3761         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3762         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3763         (check_node_accept_bytes, check_node_accept, extend_buffers):
3764         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3765         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3766         (sift_ctx_init):
3767         Likewise.
3768
3769         * regex_internal.h:
3770         (re_string_allocate, re_string_construct, re_string_reconstruct):
3771         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3772         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3773         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3774         (re_string_context_at, re_string_peek_byte_case):
3775         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3776         is defined, since we now use prototypes always.
3777
3778         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3779         C89 or better.  All uses removed.
3780
3781 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3782
3783         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3784         [defined lint]: Suppress bogus uninitialized-variable warnings.
3785
3786         * regcomp.c (duplicate_node): Return new index, not an error code,
3787         and let the caller return REG_ESPACE if out of space.  This
3788         removes an uninitialied-variable warning with GCC 4.0.1, and also
3789         avoids taking the address of a local variable.  All callers
3790         changed.
3791
3792 2005-08-19  Jim Meyering  <jim@meyering.net>
3793
3794         * regexec.c (proceed_next_node): Redo local variables to
3795         avoid GCC shadowing warnings.
3796
3797 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3798
3799         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3800         (re_node_set_insert_last, re_dfa_add_node):
3801         Rename local variables to avoid GCC shadowing warnings.
3802
3803 2005-08-18  Bruno Haible  <bruno@clisp.org>
3804
3805         * strstr.c (strstr): Fix return value in multibyte case.
3806         * strcasestr.c (strcasestr): Likewise.
3807
3808 2005-08-17  Jim Meyering  <jim@meyering.net>
3809
3810         Make the %s format (seconds since the epoch) work for a negative
3811         number and when used with a zero-padded field width, e.g. %015s.
3812
3813         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3814         label so that it precedes the code to set `digits'.  Otherwise,
3815         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3816         print `00-22'.  Now, it prints `-0022', as it should.
3817
3818 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3819
3820         * regex.h: Remove useless space-before-tab.  From coreutils.
3821
3822 2005-08-17  Bruno Haible  <bruno@clisp.org>
3823
3824         * strcasestr.h: New file.
3825         * strcasestr.c: New file.
3826
3827 2005-08-17  Bruno Haible  <bruno@clisp.org>
3828
3829         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3830         * strstr.c: Completely rewritten, with multibyte locale support.
3831
3832 2005-08-17  Bruno Haible  <bruno@clisp.org>
3833
3834         * strcasecmp.c: Use mbuiter.h.
3835
3836 2005-08-17  Bruno Haible  <bruno@clisp.org>
3837
3838         * mbuiter.h: New file.
3839
3840 2005-08-16  Bruno Haible  <bruno@clisp.org>
3841
3842         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3843         (mbi_init): Update.
3844         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3845         NUL byte, not after it.
3846
3847 2005-08-16  Bruno Haible  <bruno@clisp.org>
3848
3849         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3850         the valid ones. Makes the comparison operations transitive:
3851         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3852         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3853
3854 2005-08-16  Bruno Haible  <bruno@clisp.org>
3855
3856         * strcase.h (strcasecmp): Add note in comments.
3857         * strncasecmp.c: Use code from strcasecmp.c.
3858         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3859         (strcasecmp): Work correctly in multibyte locales.
3860
3861 2005-08-16  Bruno Haible  <bruno@clisp.org>
3862
3863         * strnlen1.h: New file.
3864         * strnlen1.c: New file.
3865
3866 2005-08-16  Bruno Haible  <bruno@clisp.org>
3867
3868         * mbfile.h: New file.
3869
3870 2005-08-16  Bruno Haible  <bruno@clisp.org>
3871
3872         * mbiter.h: New file.
3873
3874 2005-08-16  Bruno Haible  <bruno@clisp.org>
3875
3876         * mbchar.h: New file.
3877         * mbchar.c: New file.
3878
3879 2005-08-16  Bruno Haible  <bruno@clisp.org>
3880
3881         * tls.h: New file, from GNU gettext.
3882         * tls.c: New file, from GNU gettext.
3883
3884 2005-08-15  Bruno Haible  <bruno@clisp.org>
3885
3886         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3887         is defined.
3888
3889 2005-08-14  Jim Meyering  <jim@meyering.net>
3890
3891         Sync from coreutils.
3892
3893         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3894         Use the hash-table-based cycle-detection code not just when
3895         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3896         Reported by James Youngman in
3897         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3898         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3899         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3900         This lets us compile with -DFTS_DEBUG, once again.
3901         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3902         * fts.c (fd_safer): Remove decl.
3903         Include fcntl--.h rather than unistd-safer.h
3904         (fts_safe_changedir): Don't call fd_safer; no longer needed
3905         now that we include fcntl--.h.
3906
3907 2005-08-11  Simon Josefsson  <jas@extundo.com>
3908
3909         * readline.h, readline.c: New file.
3910
3911 2005-08-11  Bruno Haible  <bruno@clisp.org>
3912
3913         * strnlen.h (strnlen): Change parameter name to match comment.
3914
3915 2005-08-10  Simon Josefsson  <jas@extundo.com>
3916
3917         * strndup.c: Use strnlen.h.
3918
3919         * strnlen.h: New file.
3920
3921 2005-08-02  Simon Josefsson  <jas@extundo.com>
3922
3923         * getline.h, getline.c: Rewrite.
3924
3925         * getdelim.h, getdelim.c: New files, ported from glibc.
3926
3927 2005-07-31  Bruno Haible  <bruno@clisp.org>
3928
3929         * lock.h (gl_lock_initializer): New macro.
3930         (gl_lock_define_initialized): Use it.
3931         (gl_rwlock_initializer): New macro.
3932         (gl_rwlock_define_initialized): Use it.
3933         (gl_recursive_lock_initializer): New macro.
3934         (gl_recursive_lock_define_initialized): Use it.
3935
3936 2005-07-26  Bruno Haible  <bruno@clisp.org>
3937
3938         * lock.h: Update from GNU gettext.
3939         * lock.c: Update from GNU gettext.
3940
3941 2005-07-18  Bruno Haible  <bruno@clisp.org>
3942
3943         * lock.h (gl_once_t): New type.
3944         (gl_once_define, gl_once): New macros.
3945         * lock.c (fresh_once): New variable.
3946         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3947         functions.
3948
3949 2005-07-18  Simon Josefsson  <jas@extundo.com>
3950
3951         * check-version.c (check_version): Accept identical versions too.
3952
3953 2005-07-18  Bruno Haible  <bruno@clisp.org>
3954
3955         * lock.h: New file, from GNU gettext.
3956         * lock.c: New file, from GNU gettext.
3957
3958 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3959
3960         * quotearg.c: Add translator comment suggested by Bruno Haible,
3961         with a minor change.
3962
3963 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3964
3965         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3966         copyright symbol and the year.
3967         * version-etc.c (COPYRIGHT_YEAR): New constant.
3968         (version_etc_va): Use parameterized copyright notice.
3969         Reword to conform to the current GNU coding standards.
3970
3971 2005-07-11  Simon Josefsson  <jas@extundo.com>
3972
3973         * size_max.h: New file.
3974
3975 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3976
3977         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3978         block of defines.
3979
3980 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3981        and  Paul Eggert  <eggert@cs.ucla.edu>
3982
3983         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3984         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3985
3986 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3987
3988         * regex.c, regex.h: Sync from libc.
3989         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3990         New files, synced from libc, except that regex_internal.h
3991         currently has a small porting fix.
3992
3993 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3994
3995         Remove the dependency of the strftime module on the tzset module.
3996         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3997         Copy the input structure, to work around some of the bug with
3998         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3999         Solaris releases, you should also use the tzset module, but we won't
4000         require it as a dependency any more since we don't want LGPLed code
4001         to depend on GPLed code.
4002
4003 2005-07-02  Jim Meyering  <jim@meyering.net>
4004
4005         * backupfile.c (backup_args): Change a `0' to NULL.
4006
4007 2005-07-01  Jim Meyering  <jim@meyering.net>
4008
4009         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4010         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4011         * save-cwd.c, tempname.c:
4012         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4013         and don't include <sys/file.h>).
4014
4015 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4016
4017         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4018         declares only 'struct timespec;' (!).
4019
4020 2005-06-29  Jim Meyering  <jim@meyering.net>
4021
4022         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4023         type name.  Use the variable name instead.
4024         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4025
4026 2005-06-28  Simon Josefsson  <jas@extundo.com>
4027
4028         * check-version.h, check-version.c: New files.
4029
4030 2005-06-28  Simon Josefsson  <jas@extundo.com>
4031
4032         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4033         collision with global variable.  Better indentation.  Don't
4034         increment buffer pointer beyond buffer end.  Based on comments
4035         from Paul Eggert <eggert@cs.ucla.edu>.
4036
4037         * base64.h: Indent.
4038
4039 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4040
4041         * canon-host.c (canon-host): Append trailing "," to 0 in
4042         initializer of struct addrinfo, as an indication that we don't
4043         care how many members the structure has.
4044
4045 2005-06-24  Derek Price  <derek@ximbiot.com>
4046         and Bruno Haible  <bruno@clisp.org>
4047
4048         Remove stat module & update lstat.
4049         * stat.c: Remove this file...
4050         (slash_aware_lstat): ...moving this content and its support...
4051         * lstat.c (rpl_lstat): ...into here.
4052         * lstat.h: New file.
4053
4054 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4055
4056         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4057         (ranged_convert): Don't save conversion in a temporary struct.
4058         This causes a warning with GCC 4.0.0, and anyway in the typical
4059         case it's not worth the extra 100 bytes or so of code.
4060         (ranged_convert, __mktime_internal): When calling a function via a
4061         pointer P, use P () rather than (*P) (), as we now assume C89 or
4062         better.
4063
4064 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4065
4066         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4067         "who -r" failed to give output.  Problem reported by Tim Waugh.
4068
4069         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4070         (xcalloc): Use it to avoid needless tests.
4071         Problem reported by Jim Meyering.
4072
4073 2005-06-16  Jim Meyering  <jim@meyering.net>
4074
4075         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4076         when either N or S is zero.
4077
4078 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4079
4080         * argp.h (__option_is_short): Check upper limit of
4081         __key. Isprint() requires its argument to have the value
4082         of an unsigned char or EOF.
4083
4084 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4085
4086         * fnmatch.c (fnmatch): If there is an encoding error in a
4087         multibyte string or pattern, fall back on unibyte matching.
4088         Problem reported by James Youngman.
4089
4090 2005-06-08  Bruno Haible  <bruno@clisp.org>
4091
4092         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4093         warning on mingw.
4094
4095 2005-06-08  Bruno Haible  <bruno@clisp.org>
4096
4097         * csharpcomp.h: New file, from GNU gettext.
4098         * csharpcomp.c: New file, from GNU gettext.
4099         * csharpcomp.sh.in: New file, from GNU gettext.
4100
4101 2005-06-07  Derek Price  <derek@ximbiot.com>
4102
4103         Sync from CVS.
4104         * glob_.h: Indent nested #ifdef.
4105
4106 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4107
4108         Sync from coreutils.
4109         Use "file name" when talking about file names, instead of "filename"
4110         or "path", as per the GNU coding standards.
4111         * mkdir-p.c: Renamed from makepath.c.
4112         (make_dir_parents): Renamed from make_path.  All callers changed.
4113         * mkdir-p.h: Likewise.  All includers changed.
4114         * filenamecat.c: Renamed from path-concat.c.
4115         (file_name_concat): Renamed from path_concat.  All callers changed.
4116         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4117         * filenamecat.h: Likewise.  All includers changed.
4118         * acl.c: Don't use "path" or "filename" to mean "file name"
4119         in comments or local variable names.
4120         * basename.c: Likewise.
4121         * canonicalize.c, canonicalize.h: Likewise.
4122         * dirname.c, dirname.h: Likewise.
4123         * euidaccess.c: Likewise.
4124         * exclude.c: Likewise
4125         * fnmatch_.h, fnmatch_loop.c: Likewise.
4126         * fsusage.c, fsuage.h: Likewise.
4127         * fts.c, fts_.h: Likewise.
4128         * getcwd.c: Likewise.
4129         * getloadavg.c: Likewise.
4130         * mkstemp.c: Likewise.
4131         * mountlist.c, mountlist.h: Likewise.
4132         * openat.c, openat.h: Likewise.
4133         * readlink-stub.c: Likewise.
4134         * readutmp.c, readutmp.h: Likewise.
4135         * rename.c: Likewise.
4136         * rmdir.c: Likewise.
4137         * same.c: Likewise.
4138         * savedir.c: Likewise.
4139         * stripslash.c: Likewise.
4140         * tempname.c: Likewise.
4141         * xreadlink.c: Likewise.
4142         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4143         All uses changed.
4144         * exclude.h: Likewise.
4145
4146         * euidaccess.c (getuid, getgid, getuid, getegid)
4147         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4148         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4149         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4150         * pathmax.h: Include <limits.h> unconditionally, since other
4151         files have been getting away with it for years (MORE/BSD 4.3
4152         is extinct now).
4153         * userspec.c (getpwnam, getgrnam, getgrgid)
4154         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4155
4156         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4157         Define to 256, not 255, as per modern POSIX.
4158
4159 2005-06-01  Bruno Haible  <bruno@clisp.org>
4160
4161         * csharpexec.h: New file, from GNU gettext.
4162         * csharpexec.c: New file, from GNU gettext.
4163         * csharpexec.sh.in: New file, from GNU gettext.
4164
4165 2005-05-31  Derek Price  <derek@ximbiot.com>
4166             Paul Eggert  <eggert@cs.ucla.edu>
4167
4168         Sync from cvs.
4169         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4170
4171 2005-05-29  Derek Price  <derek@ximbiot.com>
4172             Paul Eggert  <eggert@cs.ucla.edu>
4173
4174         * glob_.h, glob.c: New files.
4175
4176 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4177
4178         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4179
4180         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4181         the configuration hassle isn't worth it.
4182         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4183         (LONGEST_MODIFIER, PRIuMAX): Remove.
4184
4185 2005-05-27  Bruno Haible  <bruno@clisp.org>
4186
4187         * getlogin_r.h: Remove second include of <stddef.h>.
4188
4189 2005-05-25  Bruno Haible  <bruno@clisp.org>
4190             Derek Price  <derek@ximbiot.com>
4191
4192         * getlogin_r.h: Simplify API documentation.
4193
4194 2005-05-25  Derek Price  <derek@ximbiot.com>
4195             Paul Eggert  <eggert@cs.ucla.edu>
4196
4197         * getlogin_r.c, getlogin_r.h: New files.
4198
4199 2005-05-22  Bruno Haible  <bruno@clisp.org>
4200
4201         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4202         Also include <sys/param.h> if it defines MIN, MAX.
4203         Based on a patch by Derek Price <derek@ximbiot.com>.
4204
4205 2005-05-22  Bruno Haible  <bruno@clisp.org>
4206
4207         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4208         (INT64_MIN): Fix definition.
4209         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4210
4211         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4212         NEED_SIGNED_INT_TYPES.
4213
4214         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4215         HAVE_SYSTEM_INTTYPES.
4216
4217 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4218
4219         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4220         so that unistd-safer.h (GPL'ed code) need not be included.
4221
4222 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4223
4224         New fts module.
4225         * fts.c: Don't include "cycle-check.h" or "hash.h".
4226         (setup_dir, free_dir): New functions.
4227         (enter_dir, leave_dir): Define trivial
4228         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4229         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4230         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4231         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4232         Move to fts-cycle.c.
4233         (fts_open): Use setup_dir.
4234         (fts_close): Use free_dir.
4235         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4236         This adds a label and some gotos, but the alternatives were messier.
4237         Check for memory allocation failure when entering a dir.
4238         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4239         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4240         (FTS): New member fts_cycle, that is a union that contains the
4241         old active_dir_ht and cycle_state.  All uses changed to mention
4242         fts_cycle.ht and fts_cycle.state.
4243         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4244         fts.c, with the following changes:
4245         (setup_dir, free_dir): New functions.
4246         (enter_dir): Now returns bool.  Return true if successful, false
4247         if memory exhausted.  All callers changed.
4248         Do not bother partly cleaning up on
4249         memory allocation failure; that is free_dir's job.
4250         However, free ad if hash_insert fails, to avoid memory leak.
4251         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4252         fts->fts_options to see which union member to use.
4253
4254 2005-05-20  Jim Meyering  <jim@meyering.net>
4255
4256         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4257         Now a macro, to pacify GCC.
4258
4259 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4260
4261         * chown.c (rpl_chown): Return -1 on failure.
4262
4263 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4264
4265         * canonicalize.c: Include canonicalize.h first, to test interface.
4266         Include <stddef.h> unconditionally, since we assume C89 now.
4267         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4268         * fts.c: Include fts_.h first, to check interface.
4269         Do not include intprops.h; no longer needed.
4270         Include cycle-check.h and hash.h, since fts_.h no longer does.
4271         Remove unnecessary casts of closedir to void.
4272         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4273         decide whether to decrement nlinks.
4274         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4275         (FTS): Use struct hash_table * instead of Hash_table, so that
4276         we no longer need to include hash.h here.
4277
4278 2005-05-17  Jim Meyering  <jim@meyering.net>
4279
4280         * fts.c, fts_.h: New files, from coreutils.
4281
4282 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4283
4284         Sync from coreutils.
4285         * unlinkdir.c, unlinkdir.h: New files.
4286         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4287         regex.h, unlocked-io.h, xtime.h:
4288         White space changes only.
4289         * makepath.c (make_path): Port to hosts where leading "//" is special.
4290         * yesno.c: Include getline.h, not ctype.h.
4291         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4292         Use getline to remove arbitrary restriction on response length.
4293
4294 2005-05-13  Bruno Haible  <bruno@clisp.org>
4295
4296         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4297         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4298         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4299         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4300         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4301         Add support for 64-bit integers in the MSVC compiler.
4302
4303 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4304
4305         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4306         Change the initial comment to refer to GPL, not LGPL.
4307         gnulib-tool will change it to LGPL as needed.
4308
4309         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4310         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4311         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4312         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4313         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4314         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4315         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4316         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4317         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4318         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4319         concatpath.c, config.charset, copy-file.c, copy-file.h,
4320         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4321         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4322         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4323         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4324         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4325         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4326         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4327         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4328         full-read.c, full-read.h, full-write.c, full-write.h,
4329         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4330         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4331         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4332         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4333         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4334         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4335         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4336         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4337         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4338         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4339         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4340         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4341         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4342         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4343         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4344         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4345         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4346         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4347         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4348         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4349         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4350         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4351         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4352         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4353         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4354         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4355         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4356         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4357         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4358         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4359         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4360         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4361         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4362         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4363         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4364         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4365         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4366         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4367         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4368         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4369         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4370         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4371         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4372         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4373         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4374         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4375         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4376         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4377         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4378         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4379         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4380         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4381         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4382         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4383         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4384         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4385         Update FSF postal mail address.
4386
4387 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4388
4389         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4390         specified in ai_socktype. Fix invalid ai_protocol
4391         check. ai_protocol is usually set to 0 or depending on
4392         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4393         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4394         ai_socktype / ai_protocol in the returned addrinfo structure.
4395
4396 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4397             Bruno Haible  <bruno@clisp.org>
4398
4399         * inet_ntop.h: New file.
4400         * inet_ntop.c: New file, from glibc with modifications.
4401
4402 2005-05-08  Jim Meyering  <jim@meyering.net>
4403
4404         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4405
4406 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4407
4408         Merge from coreutils.  Among other things,
4409         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4410         * fd-safer.c: New file.
4411         * fcntl-safer.h, open-safer.c: Remove.
4412         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4413         * dup-safer.c: Include unistd-safer.h first.
4414         Don't include errno.h.
4415         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4416         * file-type.h: Don't assume invoker included sys/stat.h first.
4417         * file-type.c: Rely on file-type.h change.
4418         * getloadavg.c: Include unistd-safer.h.
4419         (getloadavg): Use safer open.
4420         * getusershell.c: Include "stdio-safer.h".
4421         (getusershell): Use safer fopen.
4422         * long-options.c (long_options): Use NULL rather than 0.
4423         * modechange.h (mode_free): Remove; all callers changed to invoke
4424         'free'.
4425         * modechange.c: Likewise.
4426         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4427         (MODE_DONE): New constant.
4428         (struct mode_change): Remove 'next' member.
4429         (make_node_op_equals): New function; like the old one of the
4430         same name, except it allocates an array.
4431         (mode_compile, mode_create_from_ref): Use it.
4432         (mode_compile): Allocate result as an array, not a linked list.
4433         Parse octal string ourself, so that we catch mistakes like "+0".
4434         (mode_adjust): Arg is an array, not a linked list.
4435         * modechange.c: Include stat-macros.h, xalloc.h.
4436         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4437         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4438         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4439         Remove.  This is now stat-macros.h's job.
4440         (talloc): Remove.  All callers replaced by xalloc, so that
4441         our invokers don't have to worry about reporting memory failures.
4442         (make_node_op_equals): Remove.
4443         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4444         New constants.
4445         (struct mode_change): Moved here from modechange.h.
4446         (mode_append_entry): Remove.
4447         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4448         apps to have incorrect behavior.  Use simpler algorithm for head
4449         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4450         Detect more invalid usages rather than having somewhat-random behavior.
4451         Don't insert an "a=" action, as that leads to incorrect behavior.
4452         (mode_compile, mode_create_from_ref): Return NULL on error instead
4453         of an enum, since now there's only one way to have an error.  All
4454         callers changed.
4455         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4456         at the correct time.  Simplify calculation of "+u" and its ilk.
4457         Don't mishandle "+X".
4458         (mode_free): Remove "register" and localize decls.
4459         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4460         (struct mode_change): Move to modechange.c; callers don't
4461         need to see this stuff.
4462         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4463         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4464         (mode_change, mode_adjust): Reflect the new signatures noted above.
4465         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4466         that might redefine system include files.
4467         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4468         (my_usleep): Use NULL rather than (void *) 0.
4469         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4470         Use siginterrupt to specify that system calls should be interrupted.
4471         (rpl_nanosleep): Move initialization of suspended closer to call of
4472         my_usleep.
4473         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4474         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4475         (desirable_utmp_entry): New function.
4476         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4477         using x2nrealloc, to simplify logic.
4478         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4479         size calculation.  Do not assume utmp file is a regular file.
4480         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4481         (READ_UTMP_CHECK_PIDS): New constant.
4482         * save-cwd.c: Include unistd-safer.h.
4483         (save_cwd): Use fd_safer.
4484         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4485         [!_LIBC] Include "stat-macros.h" instead.
4486         * unistd-safer.h (fd_safer): New decl.
4487
4488 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4489
4490         * byteswap_.h: New file.
4491
4492 2005-04-25  Albert Chin  <china@thewrittenword.com>
4493
4494         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4495         Toolkit C bug.
4496
4497 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4498
4499         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4500         that "UTC +1 second" continues to work.  Problem reported
4501         by Dmitry V. Levin.
4502         (relunit_snumber): New rule.
4503         (relunit): Use it.
4504
4505 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4506
4507         * getdate.y (universal_time_zone_table): New constant.
4508         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4509         universal_time_zone_table.
4510         (lookup_zone): Prefer universal_time_zone_table to
4511         local_time_zone_table, so that "GMT" time stamps are allowed in
4512         London during the summer.  Problem reported by Ian Abbott.
4513
4514 2005-04-12  Jim Meyering  <jim@meyering.net>
4515
4516         * human.c (humblock): Set *options even when returning due to
4517         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4518         warning from gcc-4.
4519
4520 2005-04-09  Jim Meyering  <jim@meyering.net>
4521
4522         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4523         -Wuninitialized: initialize tm0.tm_year.
4524
4525 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4526
4527         * getdate.y (parser_control): rels_seen is now a boolean, not a
4528         count, since there's no maximum.  All uses changed.
4529         Add member dsts_seen.
4530         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4531         not being INT_MAX.
4532         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4533         Use pc_rels_seen to decide whther a date is absolute.
4534
4535         * getdate.y (number): Don't overwrite year.
4536         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4537         check.
4538
4539 2005-04-02  Simon Josefsson  <jas@extundo.com>
4540
4541         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4542         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4543
4544 2005-03-27  Jim Meyering  <jim@meyering.net>
4545
4546         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4547
4548 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4549
4550         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4551         "one's complement" -> "ones' complement" in comment, as per Knuth.
4552         "value of type" -> "type or expression" in comment.
4553         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4554
4555 2005-03-26  Jim Meyering  <jim@meyering.net>
4556
4557         Comment nits.
4558         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4559         Correct typos: s/or/of/.
4560
4561 2005-03-23  Jim Meyering  <jim@meyering.net>
4562
4563         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4564
4565 2005-03-21  Jim Meyering  <jim@meyering.net>
4566
4567         Changes imported from coreutils.
4568
4569         * cycle-check.c: Don't include xalloc.h.
4570
4571         * path-concat.c: Don't include assert.h.
4572         (path_concat): Remove assertion that would have triggered
4573         for ABASE starting with more than one slash.
4574         Reported by Andreas Schwab.
4575
4576         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4577         properly when ABASE is an absolute file name.
4578         Correct the description of this function.
4579         Include <assert.h>.
4580         Add an assertion and a test driver.
4581         This fixes a bug introduced on 2004-07-02.
4582         Andreas Schwab reported the resulting failure of cp --parents:
4583         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4584
4585 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4586
4587         * strftime.c (my_strftime): If the underlying strftime returns 0
4588         (which shouldn't happen), generate nothing instead of returning 0
4589         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4590
4591 2005-03-16  Bruno Haible  <bruno@clisp.org>
4592
4593         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4594
4595 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4596
4597         * strftime.c (my_strftime): Prepend space to format so that we can
4598         reliably distinguish strftime failure from empty output on POSIX
4599         hosts.
4600
4601 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4602
4603         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4604         (iconv_string): Don't guess a size-zero buffer, as that might cause
4605         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4606         result would be 'too large', where 'too large' is (heuristically)
4607         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4608         overflow concerns.  This will prevent some unwanted malloc failures
4609         when the inputs are very large.
4610
4611 2005-03-15  Bruno Haible  <bruno@clisp.org>
4612
4613         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4614         'negate'.
4615
4616         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4617         variable.
4618
4619         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4620
4621 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4622
4623         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4624         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4625         intprops.h.
4626         * strtol.c: Likewise.
4627
4628 2005-03-14  Simon Josefsson  <jas@extundo.com>
4629
4630         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4631         <fx@gnu.org>.
4632
4633 2005-03-14  Jim Meyering  <jim@meyering.net>
4634
4635         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4636         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4637         to be nonzero so that we (and caller) can detect the difference
4638         between a valid zero-length expansion and an error return, even
4639         when the underlying strftime fails before writing anything into
4640         that location.
4641
4642 2005-03-10  Jim Meyering  <jim@meyering.net>
4643
4644         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4645         so that this module works on systems without fchdir.
4646
4647 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4648
4649         Factor int-properties macros into a single file, except for
4650         glibc-related files.
4651         * intprops.h: New file.
4652         * getloadavg.c: Include it instead of limits.h.
4653         (INT_STRLEN_BOUND): Remove.
4654         * human.c: Include intprops.h.
4655         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4656         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4657         * inttostr.h: Include intprops.h instead of limits.h.
4658         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4659         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4660         for consistency with intprops.h.
4661         (time_t_is_integer, twos_complement_arithmetic): Use them.
4662         * sig2str.h: Include <signal.h>, intprops.h.
4663         (INT_STRLEN_BOUND): Remove.
4664         * strftime.c (TYPE_SIGNED): Remove.
4665         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4666         * strtol.c: Adjust comments to match intprops.h.
4667         * userspec.c: Include intprops.h.
4668         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4669         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4670         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4671         instead of rolling our own expressions.
4672         * xstrtol.c: Include xstrtol.h first, to test interface.
4673
4674         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4675         instead of int.
4676         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4677         the right thing even if adding 1900 would overflow.  Similarly
4678         for tm_mon + 1 and tm_yday + 1.
4679         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4680         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4681         (DO_SIGNED_NUMBER): New macro.
4682         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4683
4684 2005-03-07  Bruno Haible  <bruno@clisp.org>
4685
4686         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4687
4688 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4689             Bruno Haible  <bruno@clisp.org>
4690
4691         * pagealign_alloc.h: New file.
4692         * pagealign_alloc.c: New file.
4693
4694 2005-01-28  Bruno Haible  <bruno@clisp.org>
4695
4696         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4697         stpncpy.c uses it.
4698
4699 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4700
4701         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4702         The workaround isn't strictly needed for POSIX conformance, and
4703         it's too much of a pain to configure and maintain.  We'll ask
4704         people to fix their kernels instead.
4705         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4706         (NANOSLEEP_BUG_WORKAROUND): Remove.
4707         (xnanosleep): Remove the workaround.
4708
4709 2005-02-12  Bruno Haible  <bruno@clisp.org>
4710
4711         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4712
4713 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4714
4715         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4716         * timespec.h (gettime): Return void, since it always
4717         succeeds now.  All uses changed.
4718         * gettime.c (gettime) Likewise.
4719         [HAVE_NANOTIME]: Prefer nanotime.
4720         Assume gettimeofday succeeds, as POSIX requires.
4721         Assime time () succeeds, since other code already does.
4722         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4723         (timespec_subtract): Remove.
4724         (NANOSLEEP_BUG_WORKAROUND): New constant.
4725         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4726         things considerably.  Use it only on GNU/Linux hosts, since the
4727         workaround shouldn't be needed elsewhere.
4728
4729 2005-02-24  Bruno Haible  <bruno@clisp.org>
4730
4731         * gettext.h: Update from GNU gettext 0.14.2.
4732
4733 2005-02-24  Bruno Haible  <bruno@clisp.org>
4734
4735         * localcharset.c: Update from GNU gettext 0.14.2.
4736         * config.charset: Update from GNU gettext 0.14.2.
4737
4738 2005-02-22  Simon Josefsson  <jas@extundo.com>
4739
4740         * iconvme.h, iconvme.c: New files, from libc.
4741
4742 2005-02-20  Neil Conway  <neilc@samurai.com>
4743
4744         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4745         returned by OSX/Darwin if the specified buffer is not large
4746         enough for the hostname.
4747
4748 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4749
4750         * memrchr.h: New file.
4751         * chdir-long.c: Include it.
4752         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4753         Don't bother including stddef.h.
4754
4755 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4756
4757         * argp-help.c (__argp_help): Create a fake struct argp_state and
4758         pass it to _help, otherwise the latter coredumps trying to
4759         dereference state.root_argp.
4760
4761 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4762
4763         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4764         inclusion.
4765         Include <sys/types.h>, for dev_t.
4766         (ME_DUMMY, ME_REMOTE): Move from here....
4767         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4768         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4769         Dmitry V. Levin.
4770         Include mountlist.h first, to test the interface.
4771
4772 2005-01-29  Bruno Haible  <bruno@clisp.org>
4773
4774         * progname.c (program_name): Initialize.
4775         Needed when linking statically on MacOS X.
4776
4777 2005-01-28  Bruno Haible  <bruno@clisp.org>
4778
4779         * javacomp.sh.in: New file, from GNU gettext.
4780         * javacomp.h: New file, from GNU gettext.
4781         * javacomp.c: New file, from GNU gettext.
4782
4783 2005-01-26  Bruno Haible  <bruno@clisp.org>
4784
4785         * javaexec.sh.in: New file, from GNU gettext.
4786         * javaexec.h: New file, from GNU gettext.
4787         * javaexec.c: New file, from GNU gettext.
4788
4789 2005-01-26  Simon Josefsson  <jas@extundo.com>
4790
4791         * gai_strerror.c: Use GPL in header.
4792
4793 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4794
4795         * argp-help.c (hol_entry_help): Avoid using non-constant
4796         initializers for struct pentry_state.
4797         (__argp_error): Check return value of __asprintf
4798         (__argp_failure): Translate error message
4799
4800         * argp-parse.c: Removed braces around the expansion of N_()
4801
4802 2005-01-21  Jim Meyering  <jim@meyering.net>
4803
4804         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4805         same value as for Solaris 9.
4806
4807         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4808         component length.  This included changing the parameter to be
4809         of type `char *' rather than `char const *'.
4810         * chdir-long.h (chdir_long): Update prototype.
4811
4812         * openat.c (fdopendir, fstatat): New functions.
4813         * openat.h: Include headers required for use of DIR and struct stat.
4814         [AT_SYMLINK_NOFOLLOW]: Define.
4815         (fdopendir, fstatat): Add prototypes.
4816
4817 2005-01-21  Bruno Haible  <bruno@clisp.org>
4818
4819         * classpath.h: New file, from GNU gettext.
4820         * classpath.c: New file, from GNU gettext.
4821
4822 2005-01-20  Simon Josefsson  <jas@extundo.com>
4823
4824         * version-etc-fsf.c: New file, with version_etc_copyright.
4825         * version-etc.c: Remove version_etc_copyright.
4826         * version-etc.h (version_etc_copyright): Use [] instead of * in
4827         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4828
4829 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4830
4831         * save-cwd.c (save_cwd): Remove code to support the case
4832         where fchdir is missing or flaky.
4833
4834 2005-01-20  Simon Josefsson  <jas@extundo.com>
4835
4836         * base64.h (isbase64): Add.
4837
4838         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4839         using a unsigned prototype, don't inline.
4840         (base64_decode): Use it.
4841
4842 2005-01-19  Bruno Haible  <bruno@clisp.org>
4843
4844         * sh-quote.h: New file, from GNU gettext.
4845         * sh-quote.c: New file, from GNU gettext.
4846
4847 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4848
4849         Merge changes from coreutils, as described below in several
4850         changelogs dated today.
4851
4852         * save-cwd.c: Include "save-cwd.h" before other include files.
4853         (O_DIRECTORY): Remove; not needed here, since "." must be
4854         a directory.  All uses removed.
4855         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4856         universal on Suns, and we also need to test for IRIX.
4857         Revamp code to use 'if' rather than '#if'.
4858         Avoid unnecessary comparison of cwd->desc to 0.
4859
4860         * utimens.c (futimens): Robustify the previous patch, by checking
4861         for known valid error numbers rather than observed invalid ones.
4862
4863 2005-01-18  Jim Meyering  <jim@meyering.net>
4864
4865         * version-etc.c (version_etc_copyright): Update copyright date.
4866
4867         * utimens.c (futimens): Account for the fact that futimes
4868         can also fail with errno == ENOSYS or errno == ENOENT.
4869         Patch from Dmitry V. Levin.
4870
4871         Change the name of the robust chdir function from chdir to chdir_long.
4872         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4873         (restore_cwd): Use chdir_long, not chdir.
4874         * chdir-long.c: Renamed from chdir.c.
4875         * chdir-long.h: Renamed from chdir.h.
4876         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4877         Hurd.
4878
4879 2005-01-18  Bob Proulx  <bob@proulx.com>
4880
4881         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4882         offsetof() macro construct to avoid compile failure with native HP-UX
4883         11.0 ANSI C compiler.
4884
4885 2005-01-06  Bruno Haible  <bruno@clisp.org>
4886
4887         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4888         because stpncpy.m4 takes care of it.
4889
4890 2004-01-24  Bruno Haible  <bruno@clisp.org>
4891
4892         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4893
4894 2003-10-09  Bruno Haible  <bruno@clisp.org>
4895
4896         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4897
4898 2005-01-06  Bruno Haible  <bruno@clisp.org>
4899
4900         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4901         * fwriteerror.c: Include <stdbool.h>.
4902         (fwriteerror): At the end, close the file stream. Record whether
4903         stdout was already closed.
4904
4905 2004-05-27  Bruno Haible  <bruno@clisp.org>
4906
4907         * execute.c (environ): Declare if needed.
4908         * pipe.c (environ): Likewise.
4909         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4910
4911 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4912
4913         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4914         definitions to be after all include files, to avoid collisions.
4915         Problem reported by Bob Proulx.
4916
4917 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4918
4919         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4920         not needed.  This removes a dependency on the gettext module.
4921         [defined _LIBC]: Do not include <libintl.h>; not needed.
4922
4923 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4924
4925         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4926         HAVE_DECL_STRTOLD.
4927
4928 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4929
4930         * argp-parse.c: Include <stddef.h>.
4931         (alignof, alignto): New macros.
4932         (parser_init): Don't assume that void * is aligned sufficiently
4933         for struct option.
4934
4935         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4936         need to extend the stack.
4937         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4938         large.
4939
4940 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4941
4942         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4943
4944 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4945
4946         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4947         Remove now-obsolete comment about AIX.
4948         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4949         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4950         (YYMAXDEPTH): New macro.
4951
4952 2004-12-18  Bruno Haible  <bruno@clisp.org>
4953
4954         * fatal-signal.c (fatal_signals): Make non-const.
4955         (init_fatal_signals): New function.
4956         (uninstall_handlers, install_handlers): Ignore signals that were set to
4957         SIG_IGN.
4958         (at_fatal_signal): Call init_fatal_signals.
4959         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4960         SIG_IGN.
4961         Reported by Paul Eggert.
4962
4963 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4964
4965         * getdate.y (textint): New member "negative".
4966         (time_zone_hhmm): New function.
4967         Expect 14 shift-reduce conflicts, not 13.
4968         (o_colon_minutes): New rule.
4969         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4970         (yylex): Set the "negative" member of signed numbers.
4971
4972 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4973
4974         Changes imported from coreutils.
4975         * hard-locale.c: Assume <locale.h> exists.
4976         Include "strdup.h".
4977         (GLIBC_VERSION): New macro.
4978         (hard_locale): Assume setlocale exists.
4979         Rewrite to avoid #ifdef.
4980         Use strdup rather than malloc + strcpy.
4981         * human.c: Assume <locale.h> exists.
4982         (human_readable): Assume localeconv exists.
4983
4984 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4985
4986         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4987         convert T2, not T.  (Imported from libc.)
4988
4989 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4990
4991         * getcwd.c (is_ENAMETOOLONG): New macro.
4992         (__getcwd.c): Don't restore errno; glibc doesn't.
4993         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4994         first, falling back to our code only if its results look suspicious.
4995         Ensure that the resulting buffer is only as large as necessary.
4996
4997         * readutmp.c: Include readutmp.h first.
4998         Include <errno.h>, since readutmp.h no longer does that.
4999         * readutmp.h: Don't include <errno.h>,
5000         <sys/param.h>, <time.h>; not needed to establish interface.
5001         (errno): Remove decl.
5002         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5003         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5004         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5005
5006 2004-11-28  Simon Josefsson  <jas@extundo.com>
5007
5008         * base64.h, base64.c: New file.
5009
5010 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5011
5012         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5013
5014 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5015
5016         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5017         HP's ANSI C compiler.
5018         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5019         Declaring int functions causes warnings on some modern systems and
5020         shouldn't be needed to compile on ancient ones.
5021         * same.c (MIN) [defined MIN]: Don't define, since it's already
5022         defined.
5023
5024         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5025         with the following changes.
5026         (__set_errno): Parenthesize properly.
5027         Include <stdbool.h>.
5028         (MIN, MAX, MATCHING_INO): New macros.
5029         (__getcwd): Define with prototype, not K&R form.
5030         Use heuristics to allocate default buffer on stack if possible.
5031         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5032         behavior, and to avoid the PATH_MAX limit when computing
5033         ../../../../...
5034         Use MATCHING_INO to compare inode number to file.
5035         Check for arithmetic overflow in size calculations.
5036         Fix bug in reallocation of dot array that caused getcwd to fail
5037         on directories nested deeper than 75.
5038         Be more careful about saving errno on error.
5039         Do not use realloc; use only free+malloc, as this is a bit
5040         more flexible and avoids a needless copy operation.
5041         Do not inspect st_dev and st_ino for symbolic links; POSIX
5042         doesn't specify the latter.
5043         Check for closedir errors.
5044         Avoid needless casts.
5045         Use "#ifdef weak_alias" around weak_alias, to be like other
5046         glibc code.
5047         The following changes to getcwd.c have effect only when used in
5048         gnulib; they have no effect inside glibc proper.
5049         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5050         as alloca isn't used.
5051         (alloca, __alloca): Likewise.
5052         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5053         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5054         unconditionally, as gnulib assumes C89 or better.
5055         Do not include <sys/param.h>.
5056         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5057         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5058         better.
5059         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5060         Include <dirent.h> in a way that is compatible with modern Autoconf.
5061         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5062         New macros, if not already defined.
5063         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5064         Use "_LIBC", not "defined _LIBC", for consistency.
5065         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5066         a mempcpy module.
5067         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5068         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5069         * xgetcwd.c: David MacKenzie's old code was removed, so give
5070         credit only to Jim Meyering and adjust the copyright dates.
5071         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5072         <stdlib.h>, <unistd.h>, "pathmax.h".
5073         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5074         (INITIAL_BUFFER_SIZE): Remove.
5075         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5076
5077 2004-11-23  Jim Meyering  <jim@meyering.net>
5078
5079         * getopt_.h: Remove trailing blanks.
5080
5081 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5082
5083         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5084         (futimens): New function, which uses futimes if available.
5085         (futimens, utimens): Support timespec==NULL, with same semantics
5086         as utime and utimens.
5087         * utimens.h (futimens): New decl.
5088
5089 2004-11-23  Jim Meyering  <jim@meyering.net>
5090
5091         * __fpending.c: Add comment.
5092
5093 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5094
5095         * getopt_.h: Re-addition of __getopt_argv_const caused
5096         redefinition warnings. To avoid them, include the defines
5097         in `#if !defined __need_getopt ... #endif'. The only place
5098         where __getopt_argv_const is used is in definitions
5099         of getopt_long and getopt_long_only below, which are as well
5100         protected by `#ifndef __need_getopt'.
5101         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5102         __need_getopt after including <stdio.h> and <unistd.h> These
5103         headers might have defined it.
5104
5105 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5106
5107         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5108         New macros.
5109         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5110         optopt): Use them instead of invoking ## directly; otherwise, the
5111         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5112
5113 2004-11-19  Bruno Haible  <bruno@clisp.org>
5114
5115         * strtok_r.c: Move comments from here...
5116         * strtok_r.h: ... to here.
5117
5118 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5119
5120         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5121         might fail.  Problem reported by Yoann Vandoorselaere.
5122         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5123         that mishandle size_t overflow.
5124
5125 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5126
5127         * canon-host.c: Include "strdup.h".
5128         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5129         Use strdup instead of malloc/strcpy to duplicate strings.
5130
5131         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5132         (human_space_before_unit): New constant.
5133         * human.c (human_readable): Support it.
5134
5135         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5136         (xgetcwd): Set errno correctly when failing.
5137         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5138         the failure is actually due to a PATH_MAX problem.
5139
5140         Further getopt changes to make it more likely that glibc will
5141         buy the changes back.
5142         * getopt.c (POSIXLY_CORRECT): New constant.
5143         (getopt): Use it, so to preserve glibc semantic
5144         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5145         when compiling for libc.
5146         * getopt_.h (__getopt_argv_const): Bring it back.
5147         (getopt_long, getopt_long_only): Use it.
5148
5149         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5150         New arg POSIXLY_CORRECT.  All callers changed.
5151         (getopt): Argv is now char * const *, as per standard.
5152         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5153         not char *__getopt_argv_const *.
5154         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5155         _getopt_long_only_r): Likewise.
5156         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5157         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5158         _getopt_long_r, _getopt_long_only_r): Likewise.
5159         * getopt_.h (__getopt_argv_const): Remove.
5160         (getopt): Argv is now char * const *, as per standard.
5161
5162         * getdate.y (tORDINAL): New token.
5163         (day, relunit): Allow it for relative times.
5164         (relative_time_table): Use tORDINAL for ordinals.
5165
5166 2004-11-15  Jim Meyering  <jim@meyering.net>
5167
5168         * closeout.c: Include "__fpending.h" once again.
5169         Include <stdbool.h>.
5170         (close_stdout): Don't fail just because stdout was closed initially,
5171         since some programs don't write to stdout in the normal course of
5172         operation (other than --version and --help), and we don't want this
5173         function to make e.g. `touch file >&-' fail.
5174         But do fail if it was closed and someone has tried to write to it.
5175         E.g., `printf foo >&-' must fail.
5176
5177 2004-11-11  Simon Josefsson  <jas@extundo.com>
5178
5179         * strtok_r.h, strtok_r.c: New file.
5180
5181 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5182
5183         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5184         we can stop lying to compilers about the constness of argv when we
5185         are compiled outside glibc.
5186         (getopt, getopt_long, getopt_long_only): Use it.
5187         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5188         getopt): Likewise.
5189         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5190         _getopt_long_only_r): Likewise.
5191         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5192         _getopt_long_only_r): Likewise.
5193
5194         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5195         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5196         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5197         the other external symbols.
5198         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5199         declaration, since the above renaming now works around collisions.
5200
5201 2004-11-11  Jim Meyering  <jim@meyering.net>
5202
5203         * linebreak.c: Remove trailing blanks.
5204         * alloca_.h: Likewise.
5205         * acosl.c: Likewise.
5206         * euidaccess.c: Likewise.
5207         * allocsa.h: Likewise.
5208
5209 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5210
5211         * mktime.c (SHR): New macro, which is a portable
5212         substitute for >> that should work even on Crays.
5213         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5214         Problem reported by Mark D. Baushke in
5215         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5216         * getdate.y (SHR): Likewise.
5217         (tm_diff): Use it.
5218         * strftime.c (SHR): Likewise.
5219         (tm_diff): Use it.
5220         * quotearg.c (struct quoting_options): Use unsigned int for
5221         quote_these_too, so that right shifts are well defined.  All uses
5222         changed.
5223
5224 2004-11-10  Simon Josefsson  <jas@extundo.com>
5225
5226         * getaddrinfo.h, getaddrinfo.c: New files.
5227
5228 2004-11-10  Jim Meyering  <jim@meyering.net>
5229
5230         Ensure that no close failure goes unreported.
5231         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5232         return early when it seems there's nothing to flush.
5233         Don't include __fpending.h.
5234
5235 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5236
5237         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5238
5239 2004-11-05  Bruno Haible  <bruno@clisp.org>
5240
5241         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5242         Reported by Mark D. Baushke <mdb@cvshome.org>.
5243
5244 2004-11-04  Bruno Haible  <bruno@clisp.org>
5245
5246         2004-09-11  Bruno Haible  <bruno@clisp.org>
5247                 * allocsa.valgrind: New file.
5248         2004-02-06  Bruno Haible  <bruno@clisp.org>
5249                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5250                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5251                 Reported by Christopher Seip <chris.seip@hp.com>.
5252
5253 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5254
5255         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5256         with errno == ERANGE if the buffer is too small.
5257         Problem reported by Mark D. Baushke.
5258
5259 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5260
5261         * xreadlink.c (MAXSIZE): New macro.
5262         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5263         size does not exceed MAXSIZE.  Avoid cast.
5264         As suggested by Mark D. Baushke in
5265         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5266         if readlink fails with buffer size just under MAXSIZE, try again
5267         with MAXSIZE.
5268
5269 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5270         and  Paul Eggert  <eggert@cs.ucla.edu>
5271
5272         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5273         (get_date): Overparenthesize to avoid GCC warning.
5274
5275 2004-11-02  Bruno Haible  <bruno@clisp.org>
5276
5277         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5278         function returns void.
5279
5280 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5281
5282         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5283         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5284         already declared.
5285
5286 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5287
5288         * getdate.y: Add support for TZ="foo" within a date string.
5289         Fix some bugs near time_t boundaries.  Reject dates with
5290         out-of-range components, e.g., "Sept 31".
5291         Include <stdlib.h>, "setenv.h", "xalloc.h".
5292         (ISDIGIT_LOCALE): Remove; unused.
5293         Note that the TZ and time functions used here are not reentrant.
5294         (mktime_ok, get_tz): New functions.
5295         (TZBUFSIZE): New constant.
5296         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5297         This requires that we sometimes generate our own TZ="XXX..." setting.
5298
5299 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5300
5301         * mktime.c (not_equal_tm): Remove redundant check.
5302
5303 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5304
5305         * getdate.y: Use Bison 1.875 features, and some minor
5306         code cleanups.  This change does not affect semantics.
5307         Don't include <stdlib.h>; no longer needed.
5308         Don't include unlocked-io.h; only the "#if TEST" code uses
5309         stdio, and performance isn't crucial there.
5310         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5311         Bison 1.875 features as described below.
5312         All uses of "PC." replaced by "pc->".
5313         (YYSTYPE): Add a forward declaration.
5314         (yylex, yyerror): Use full prototypes in forward decls.
5315         Use "%pure-parser" rather than obsolescent "%pure_parser".
5316         Use %parse-param and %lex-param instead of obsolescent
5317         YYPARSE_PARAM and YYLEX_PARAM.
5318         (meridian_table, month_and_day_table, time_units_table,
5319         relative_time_table, time_zone_table, military_table,
5320         lookup_zone, lookup_word, get_date):
5321         Use NULL instead of 0 where appropriate.
5322         (to_hour): Avoid abort (), to avoid a dependency on
5323         stdlib.h.
5324         (yyerror, yylex): Now accepts parser_control * arg.
5325         (main) [TEST]: Use '\0' rather than 0 for char.
5326
5327 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5328
5329         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5330         It's now the caller's responsibility to handle the case where
5331         !HAVE_GETPAGESIZE && !defined getpagesize.
5332
5333         * mktime.c (leapyear): Arg is long int, not int.
5334
5335 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5336
5337         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5338
5339 2004-10-12  Simon Josefsson  <jas@extundo.com>
5340
5341         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5342         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5343         to real functions.
5344
5345 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5346
5347         * vsnprintf.h: New file.
5348         * vsnprintf.c: New file.
5349
5350 2004-10-07  Bruno Haible  <bruno@clisp.org>
5351
5352         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5353         into the provided buffer.
5354
5355 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5356
5357         * diacrit.c, diacrit.h: Add GPL notice.
5358
5359         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5360         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5361         * logl.c (logl): Keep the code as similar to glibc as possible.
5362         This avoids a potential constant-folding bug.
5363
5364 2004-10-05  Bruno Haible  <bruno@clisp.org>
5365
5366         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5367
5368 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5369
5370         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5371         * xmalloc.c (xmemdup): Likewise.
5372         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5373         XFREE): Remove these long-obsolescent macros.
5374         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5375         * xstrdup.c: Remove.
5376
5377         * regex.c (re_comp): Cast gettext return value to char *,
5378         Problem reported by Martin Neitzel via Mark D. Baushke.
5379
5380 2004-10-04  Simon Josefsson  <jas@extundo.com>
5381
5382         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5383         '#ifdef USE_UNLOCKED_IO'.
5384
5385 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5386
5387         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5388         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5389         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5390         regex.c, sha1.c, version-etc.c, yesno.c:
5391         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5392         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5393         the includer's responsibility.
5394
5395         Sync from coreutils.
5396
5397         * modechange.c (mode_compile): Don't decrement a pointer that
5398         points to the start of a string, as the C Standard says the
5399         resulting behavior is undefined.
5400
5401         * backupfile.h (enum backuptype): Rename none -> no_backups,
5402         simple -> simple_backups, numbered_existing ->
5403         numbered_existing_backups, numbered -> numbered_backups
5404         to avoid shadowing problems.  All uses changed.
5405         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5406         * backupfile.c (check_extension, numbered_backup):
5407         Rename locals to avoid shadowing 'basename'.
5408         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5409         once.
5410
5411         * .cppi-disable: Add getopt_.h, getopt_int.h.
5412         * .cvsignore: Add getopt.h.
5413
5414 2004-10-04  Simon Josefsson  <jas@extundo.com>
5415
5416         * memmem.h: New file.
5417         * memmem.c: New file, taken from glibc.
5418
5419 2004-10-02  Jim Meyering  <jim@meyering.net>
5420
5421         * dirfd.h, getpagesize.h: Add copyright notice.
5422
5423 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5424
5425         * snprintf.c: Remove comments as to why each header is needed.
5426
5427 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5428
5429         * strsep.h: New file.
5430         * strsep.c: New file.
5431
5432 2004-10-01  Simon Josefsson  <jas@extundo.com>
5433
5434         * snprintf.c (snprintf): Handle size==0.
5435
5436 2004-10-01  Simon Josefsson  <jas@extundo.com>
5437             Bruno Haible  <bruno@clisp.org>
5438
5439         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5440         (snprintf): Declare 'args'.
5441
5442 2004-09-30  Simon Josefsson  <jas@extundo.com>
5443
5444         * snprintf.h, snprintf.c: New files.
5445
5446 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5447
5448         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5449         (hol_entry_help): Never translate an empty string.
5450         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5451         * argp.h (OPTION_NO_TRANS): New option.
5452
5453 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5454
5455         * xvasprintf.c: Include xalloc.h.
5456         (xvasprintf): Use xalloc_die, not xmalloc_die.
5457
5458 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5459
5460         * dummy.c: Change copyright notice to FSF, and license to GPL.
5461
5462 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5463
5464         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5465         Problem reported by Bruno Haible in:
5466         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5467
5468 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5469
5470         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5471         in case some system header has #define'd it.  Problem reported by
5472         Soeren D. Schulze in
5473         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5474
5475 2004-09-08  Bruno Haible  <bruno@clisp.org>
5476
5477         * stdint_.h: New file, taken from GNU clisp.
5478
5479 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5480
5481         * xvasprintf.h: New file.
5482         * xvasprintf.c: New file.
5483         * xasprintf.c: New file.
5484
5485 2004-09-08  Bruno Haible  <bruno@clisp.org>
5486
5487         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5488         is > INT_MAX.
5489         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5490
5491 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5492
5493         Import from coreutils.
5494         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5495         strings on unbounded length.  alloca's performance benefits aren't
5496         that important here.
5497         (V_STRDUP): Remove.
5498         (parse_with_separator): New function, with most of the internals
5499         of the old parse_user_spec.  Allow user to omit both user and group,
5500         for compatibility with FreeBSD.
5501         Clone only the user name, not the entire spec.
5502         Do not set *uid, *gid unless entirely successful.
5503         Avoid memory leak in some failing cases.
5504         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5505         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5506         (parse_user_spec): Rewrite to use parse_with_separator.
5507
5508 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5509
5510         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5511         its complicated substitute.
5512         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5513         and program_invocation_name.
5514         (__argp_basename) [!_LIBC]: Remove; the only use was
5515         replaced by its body.
5516         (__argp_short_program_name): Change condition from
5517         !defined __argp_short_program_name to
5518         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5519         to match argp-namefrob.h.
5520         (__argp_failure): Don't assume strerror_r returns char *.
5521         * argp-parse.c (N_): Define unconditionally.
5522         (argp_default_options): Fill out initializers with 0 to avoid
5523         gcc warnings.
5524
5525 2004-08-12  Simon Josefsson  <jas@extundo.com>
5526
5527         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5528         * getopt_.h: Renamed from getopt.h.
5529
5530 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5531
5532         Merge from coreutils.
5533
5534         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5535         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5536         for Reliant Unix 5.43.
5537
5538         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5539         (union fooround): Use uintmax_t, not long int.
5540         The rest is a merge from libc:
5541         [defined _LIBC]: Include <shlib-compat.h>.
5542         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5543
5544         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5545
5546         * strverscmp.c: Convert to UTF-8.
5547
5548 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5549
5550         * obstack.h (obstack_empty_p):
5551         Don't assume that chunk->contents is suitably aligned.
5552         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5553         Likewise. Problem reported by Benno in
5554         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5555
5556         * chown.c (rpl_chown): Work even if the file is writeable but not
5557         readable.  This could be improved further but it'd take some work.
5558
5559 2004-08-08  Simon Josefsson  <jas@extundo.com>
5560
5561         * xgethostname.c: Don't include error.h (not used).
5562
5563         * getpass.h: Add.
5564         * getpass.c: Include getpass.h first.
5565
5566 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5567
5568         * xalloc-die.c: New files.
5569         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5570         All uses removed.
5571         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5572         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5573         (_, N_, xalloc_die): Move to xalloc-die.c.
5574         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5575         so that we needn't mess with xalloc_msg_memory_exhausted.
5576
5577         * sha1.h: Renamed from sha.h.
5578         (SHA1_H): Renamed from _SHA_H.
5579         (sha1_ctx): Renamed from sha_ctx.
5580         (sha1_init_ctx): Renamed from sha_init_ctx.
5581         (sha1_process_block): Renamed from sha_process_block.
5582         (sha1_process_bytes): Renamed from sha_process_bytes.
5583         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5584         (sha1_read_ctx): Renamed from sha_read_ctx.
5585         (sha1_stream): Renamed from sha_stream.
5586         (sha1_buffer): Renamed from sha_buffer.
5587         * sha1.c: Likewise; renamed from sha.c.
5588         Do not include <sys/types.h>.
5589         Include <stddef.h> rather than <stdlib.h>.
5590
5591 2004-08-08  Bruno Haible  <bruno@clisp.org>
5592
5593         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5594         FILESYSTEM_PREFIX_LEN.
5595         * progreloc.c: Likewise.
5596         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5597
5598 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5599
5600         Merge from tar.
5601         * argp-help.c (make_hol, hol_append): Don't assume that
5602         SIZE_MAX is a valid preprocessor constant.
5603         (__argp_basename): Change from "#ifndef _LIBC"
5604         to "#ifndef __argp_short_program_name", so that
5605         we don't compile these functions for tar.
5606
5607         More merges from coreutils.
5608         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5609         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5610         yesno.h: New files.
5611         * addext.c: Remove; no longer needed.
5612         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5613         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5614         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5615         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5616         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5617         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5618         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5619         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5620         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5621         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5622         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5623         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5624         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5625         Import changes from coreutils.
5626
5627 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5628
5629         Merge from coreutils.
5630
5631         * .gdb-history: Remove; this doesn't belong here.
5632
5633         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5634         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5635         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5636
5637         * dirname.h: Include <stdbool.h>.
5638         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5639         for consistency with POSIX terminology.  All uses changed.
5640         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5641         (strip_trailing_slashes): Use bool for booleans.
5642         * stripslash.c (strip_trailing_slashes): Likewise.
5643
5644         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5645         sometimes returns a positive errno value even when it succeeds.
5646         (print_errno_message) [!LIBC]: Fall back on strerror if
5647         __strerror_r fails.
5648
5649         * path-concat.c (mempcpy): Don't define if a system header defines it.
5650         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5651         (longest_relative_suffix): New function.
5652         (path_concat): Use it.  Assume first argument is not NULL.
5653         Port to DOS.  Omit redundant separators.
5654         Report an error instead of returning NULL.
5655         Use mempcpy instead of memcpy.
5656         (xpath_concat): Remove: not declared or used.
5657
5658         * same.h: Include <stdbool.h>
5659         (same_name): Return bool, not int.
5660         * same.c (same_name): Likewise.
5661         (errno): Don't declare; we assume C89 or better now.
5662
5663         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5664         if not already defined.
5665
5666         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5667         * dup-safer.c (errno): Likewise.
5668
5669 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5670
5671         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5672         working.
5673
5674 2004-08-03  Simon Josefsson  <jas@extundo.com>
5675
5676         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5677         * progname.h: Don't include stdbool.h.
5678
5679 2004-08-02  Simon Josefsson  <jas@extundo.com>
5680
5681         * getsubopt.h: New file, with comments from Bruno Haible.
5682         * getsubopt.c: New file, from glibc, but slightly modified based on
5683         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5684
5685 2004-08-01  Simon Josefsson  <jas@extundo.com>
5686
5687         * xgetdomainname.c: Include stdlib.h, for free().
5688
5689 2004-07-16  Simon Josefsson  <jas@extundo.com>
5690
5691         * dummy.c: New file.
5692
5693 2004-07-16  Bruno Haible  <bruno@clisp.org>
5694
5695         * backupfile.h: Add extern "C" for C++.
5696         * closeout.h: Likewise.
5697         * copy-file.h: Likewise.
5698         * findprog.h: Likewise.
5699         * full-write.h: Likewise.
5700         * pathname.h: Likewise.
5701         * progname.h: Likewise.
5702         * stpcpy.h: Likewise.
5703         * stpncpy.h: Likewise.
5704         * strcase.h: Likewise.
5705         * strstr.h: Likewise.
5706         * xalloc.h: Likewise.
5707
5708         * mbswidth.h: Add extern "C" for C++.
5709         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5710
5711 2004-07-09  Simon Josefsson  <jas@extundo.com>
5712
5713         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5714         failed without this.)
5715
5716 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5717
5718         * fchown-stub.c: New file.
5719
5720 2004-06-24  Jim Meyering  <jim@meyering.net>
5721
5722         * obstack.h (obstack_base): Cast to (void *), per documentation.
5723
5724 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5725
5726         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5727
5728 2004-06-01  Jim Meyering  <jim@meyering.net>
5729
5730         * calloc.c: New file.
5731
5732 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5733
5734         * getdate.y (yylex): Allow space between sign and number.
5735         Problem reported by Dan Jacobson.
5736
5737 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5738         and  Jim Meyering  <jim@meyering.net>
5739
5740         Merge from coreutils CVS.
5741
5742         * stat-macros.h: New file, with contents from file-type.h
5743         and coreutils' system.h.
5744         * file-type.c: Include "stat-macros.h".
5745         * file-type.h (file_type): Move all macro definitions to new file,
5746         stat-macros.h.
5747
5748         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5749         Wrap old code with this conditional.
5750         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5751         function that does not dereference symlinks.
5752         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5753
5754         * xreadlink.c: Include xreadlink.h first, to catch .h file
5755         dependency problems.
5756         (xreadlink): Accept new arg SIZE, for efficiency.
5757         All decls and uses changed.
5758         * xreadlink.h: Include <stddef.h>, for size_t.
5759
5760         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5761         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5762
5763         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5764
5765 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5766
5767         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5768         macros to be defined.
5769         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5770         the allocator returns NULL because the requested size is zero.
5771
5772 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5773
5774         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5775         var.  Add comment explaining why libc still defines it.  This
5776         merges the following patch from glibc:
5777         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5778
5779 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5780
5781         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5782         present in glibc since revision 1.1 of this file.
5783         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5784         obstack_alignment_mask, obstack_alloc, obstack_base,
5785         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5786         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5787         obstack_grow0, obstack_init, obstack_int_grow,
5788         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5789         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5790         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5791         nonexistent functions.
5792
5793 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5794             Paul Eggert  <eggert@cs.ucla.edu>
5795
5796         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5797
5798 2004-05-14  Bruno Haible  <bruno@clisp.org>
5799
5800         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5801         that consists of a '.' followed by an empty digit string.
5802         Patch by Tor Lillqvist <tml@iki.fi>.
5803
5804 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5805
5806         Port obstack to the AS/400, where pointers are 16 bytes wide and
5807         you cannot cast an integer to a valid pointer.  This patch is
5808         currently waiting to be integrated into glibc; see
5809         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5810
5811         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5812         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5813         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5814         (struct obstack): temp member is now a union of a pointer and
5815         an integer, instead of an integer.  All integer uses changed.
5816         This does not affect the physical layout of struct obstack,
5817         except on hosts (like the AS/400) where the size or alignment of
5818         void * is greater than that of ptrdiff_t.
5819         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5820         __STDC__)]: Store temporary in pointer member of union, not
5821         integer member.
5822         * obstack.c: Include <stddef.h>, for offsetof.
5823         (struct fooalign): Remove; it doesn't need a name.
5824         (union fooround): Change double to long double, and add void *.
5825         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5826         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5827         not a macro.  Hence the values are always int; so remove all
5828         casts-to-int in uses.
5829
5830 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5831             Derek Price  <derek@ximbiot.com>
5832
5833         * alloca.c: Include <alloca.h>, to get our interface.
5834         * alloca_.h: Use __alloca on AIX, so that we don't have to
5835         include <alloca.h> first.  Use C89 prototype for alloca; this
5836         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5837         Use #elif for simplicity, since we can assume C89 now.
5838         Don't try to source the system alloca.h since it will not be found
5839         and to prevent recursively including its replacement.
5840         * fnmatch.c: Include <alloca.h> instead of opencoding.
5841         * regex.c: Likewise.
5842
5843 2004-05-16  Derek Price  <derek@ximbiot.com>
5844             Paul Eggert  <eggert@cs.ucla.edu>
5845
5846         getline cleanup.  This changes the getndelim2 API: both order of
5847         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5848         no delimiter).
5849
5850         * getline.c: Don't include stddef.h or stdio.h, since our
5851         interface does that.
5852         (getline): Always use getdelim, so that we don't have two
5853         copies of this code.
5854         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5855         if available.
5856         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5857         (GETNDELIM2_MAXIMUM): New macro.
5858         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5859         instead of the old practice of delim2==0.  All callers changed.
5860         Return -1 on overflow, instead of returning junk.
5861         Do not set *linesize unless allocation succeeds.
5862         * getndelim2.h: Do not include stddef.h; no longer needed, now
5863         that we include sys/types.h.
5864         * getnline.h: Likewise.
5865         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5866         (getndelim2): Reorder arguments.
5867         * getnline.c (getnline, getndelim):
5868         Don't discard the NMAX argument.
5869         (getnline): Invoke getndelim, to avoid code duplication.
5870         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5871         of (size_t) -1 by callers of the getnline family.
5872
5873 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5874
5875         * nanosleep.c (suspended): Change its type from int to
5876         sig_atomic_t volatile.
5877         (first_call): Make it private to rpl_nanosleep, and have it
5878         be zero initially as that's a bit faster.
5879         (my_usleep): Round up fractional times instead of truncating them,
5880         as this is the usual meaning for 'sleep'.
5881
5882         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5883         doesn't work.
5884         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5885         (ENOSYS): Define if not defined.
5886         (settime): Fall back on stime if it exists and settimeofday fails.
5887         But don't bother with fallbacks if a method fails with errno == EPERM.
5888
5889 2004-05-11  Jim Meyering  <jim@meyering.net>
5890
5891         Prior to this change, the save_cwd caller required read access to the
5892         current directory on most systems (ones with the fchdir function).
5893
5894         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5895         fails, try write-only, and finally, resort to using xgetcwd.
5896
5897 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5898
5899         * obstack.c, obstack.h: Import changes from libc.
5900
5901 2004-04-28  Bruno Haible  <bruno@clisp.org>
5902
5903         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5904         implicitly appends .exe to executables.
5905         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5906         accepts Windows pathnames.
5907         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5908         Cygwin like Windows, since it now accepts Windows pathnames.
5909         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5910         Cygwin like Windows, since it now accepts Windows pathnames.
5911         Reported by Derek Robert Price <derek@ximbiot.com>.
5912
5913 2004-04-20  Jim Meyering  <jim@meyering.net>
5914
5915         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5916
5917 2004-04-20  Jim Meyering  <jim@meyering.net>
5918             Bruno Haible  <bruno@clisp.org>
5919
5920         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5921         memory when realloc fails.
5922
5923 2004-04-18  Jim Meyering  <jim@meyering.net>
5924
5925         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5926         don't leak memory and do call END_UTMP_ENT.
5927
5928 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5929
5930         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5931         (CHAR_BIT): Remove, since we assume C89.
5932         Include <stdint.h> if available, as per current Autoconf CVS advice.
5933
5934 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5935
5936         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5937         not bool, to be more consistent with Unix conventions.
5938         Suggested by Bruno Haible.
5939
5940         Merge from coreutils.
5941
5942         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5943         New files.
5944
5945         * getdate.h: Include stdbool.h, and timespec.h instead of
5946         the usual <time.h> dance.
5947         (get_date): Change signature to support fractional time stamps.
5948         All callers changed.
5949         * getdate.y: Include "getdate.h" first, as we can now
5950         assume C89 and don't need to worry about 'const'.
5951         Similarly, include "unlocked-io.h" near start, not in middle.
5952         Include <limits.h>.
5953         (textint.value): Use long int rather than int.
5954         (textint.digits): Use size_t rather than int.
5955         (BILLION, LOG10_BILLION): New constants.
5956         (parser_control): New member rel_ns.  Members day_ordinal,
5957         time_zone, month, day, hour, minutes, rel_year, rel_month,
5958         rel_day, rel_hour, rel_minutes, rel_seconds
5959         are now long int, not int.  Member seconds is now struct timespec,
5960         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5961         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5962         not int.
5963         (%union.intval): Now long int, not int.
5964         New member timespec.
5965         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5966         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5967         (spec): Now is a timespec or an item list.
5968         (timespec, items): New nonterminals.
5969         (time, rel, relunit, number, get_date):
5970         Add support for fractional seconds.
5971         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5972         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5973         (to_hour): First arg is now long int, not int.
5974         (to_year): Returns long int, not int.
5975         Don't treat year -70 like 70.
5976         (tm_diff): Returns long int, not int.
5977         (lookup_word): Use bool instead of int when appropriate.
5978         (yylex): Use size_t for count, not int.
5979         Detect overflow when parsing large integer constants.
5980         Add support for fractions.
5981         (get_date): Make pointers 'const' if possible.
5982         Use more-portable code to detect integer overflow.
5983         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5984         Don't use ctime; it's not reliable if the year has >4 digits.
5985
5986         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5987         This is for compatibility with BSD.
5988
5989         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5990         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5991         From coreutils' system.h.
5992
5993         * userspec.c: Don't include "posixver.h".
5994         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5995         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5996         compatible extension.  Simplify code by removing a boolean int
5997         that was always nonzero if a string was nonnull.
5998
5999 2004-03-30  Jim Meyering  <jim@meyering.net>
6000
6001         Merge from coreutils.
6002
6003         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6004
6005         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6006         an empty input stream.
6007
6008         * readtokens.c: Include <stdbool.h>.
6009         (readtoken): Use `size_t' rather than int/long.
6010         All callers adjusted.
6011         Use `bool' rather than `int' where appropriate.
6012         Use memset rather than an explicit loop.
6013         Use x2nrealloc rather than xrealloc.
6014         Allow the use of `\0' as a delimiter.
6015         (readtokens): Likewise.
6016         * readtokens.h (readtoken, readtokens): Update prototypes.
6017
6018 2004-03-30  Bruno Haible  <bruno@clisp.org>
6019
6020         * getloadavg.c (getloadavg): Don't assume setlocale returns
6021         nonnull.
6022
6023 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6024
6025         Merge changes to getloadavg.c from coreutils and Emacs.
6026
6027         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6028         Define to an expression, not to the empty string.
6029         Include cloexec.h and xalloc.h.
6030         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6031         Use set_cloexec_flag rather than rolling our own.
6032         * cloexec.c, cloexec.h: New files.
6033
6034 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6035
6036         * getopt.h: Sync with libc CVS.
6037
6038 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6039             Bruno Haible  <bruno@clisp.org>
6040
6041         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6042         not on all platforms that have <wchar.h>.
6043         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6044
6045 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6046
6047         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6048         Sync with libc CVS.
6049         * getopt_int.h: New file, also synced from libc.
6050
6051 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6052
6053         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6054         '#if' expressions.  Unlike the code it replaces, it does not
6055         depend on (defined _SC_PAGESIZE).  However, it does depend on
6056         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6057         first reported by Jason Andrade in
6058         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6059
6060 2004-01-18  Simon Josefsson  <jas@extundo.com>
6061
6062         * strdup.h: New file.
6063         * strdup.c: Include it.
6064         * path-concat.c: Include strdup.h. Drop strdup declaration.
6065         * userspec.c: Include strdup.h. Drop strdup declaration.
6066
6067 2004-02-06  Karl Berry  <karl@gnu.org>
6068
6069         * config.charset: update from gettext 0.14.1.
6070
6071 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6072
6073         Add comments and code, prompted by suggestions from Bruno Haible
6074         for sh-quote.
6075         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6076         describing the enum quoting_style values.
6077         * quotearg.c (quotearg_alloc): New function.
6078         (quotearg_buffer_restyled): Treat lone { and } as special.
6079         Treat = as special.  Work around bug with older shells
6080         that "see" a '\' that is really the 2nd byte of a multibyte char.
6081         Quote empty string with shell_quoting_style.
6082
6083 2004-02-03  Bruno Haible  <bruno@clisp.org>
6084
6085         * pipe.h: New file, from GNU gettext.
6086         * pipe.c: New file, from GNU gettext.
6087
6088 2004-01-27  Bruno Haible  <bruno@clisp.org>
6089
6090         * execute.h: New file, from GNU gettext.
6091         * execute.c: New file, from GNU gettext.
6092         * w32spawn.h: New file, from GNU gettext.
6093
6094 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6095
6096         Exit-status fix from coreutils.
6097
6098         Use exit_failure consistently in place of EXIT_FAILURE,
6099         so that program exit statuses are consistent on failure.
6100
6101         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6102         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6103         * argmatch.h: Comment fix to match the above.
6104         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6105         Now a macro referring to exit_failure, instead of a separate
6106         variable.  Include "exitfail.h" to get it.
6107         * xstrtol.h: Include "exitfail.h".
6108         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6109
6110         * long-options.c (parse_long_options): Use prototype
6111         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6112         for clarity.
6113
6114 2004-01-21  Jim Meyering  <jim@meyering.net>
6115
6116         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6117         so as not to conflict with a different-sized __mktime_internal
6118         function in GNU libc.
6119         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6120         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6121
6122 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6123
6124         Merge from diffutils.
6125
6126         * file-type.c (file_type): Add typed memory objects.
6127         * file-type.h (S_TYPEISTMO): New macro.
6128
6129         * c-stack.h (c_stack_action): Remove argv argument.
6130         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6131         (die): Don't calculate message unless segv_action returns.
6132         (get_stack_location, min_address_from_argv, max_address_from_argv,
6133         volatile stack_base, volatile_stack_size): Remove.
6134         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6135         that every segmentation violation is a stack overflow.  (Ouch!)
6136         See Debian bug 136249 (still outstanding) for more info about why
6137         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6138
6139 2003-11-30  Bruno Haible  <bruno@clisp.org>
6140
6141         Safer stack allocation.
6142         * setenv.c: Include allocsa.h.
6143         (alloca): Remove fallback definition.
6144         (freea): Remove macro.
6145         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6146         instead of freea.
6147
6148 2003-10-17  Bruno Haible  <bruno@clisp.org>
6149
6150         * binary-io.h: Avoid warnings on Cygwin.
6151
6152 2003-12-28  Bruno Haible  <bruno@clisp.org>
6153
6154         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6155         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6156
6157 2003-11-28  Bruno Haible  <bruno@clisp.org>
6158
6159         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6160
6161 2003-11-27  Bruno Haible  <bruno@clisp.org>
6162
6163         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6164
6165 2003-11-17  Bruno Haible  <bruno@clisp.org>
6166
6167         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6168
6169 2003-11-24  Bruno Haible  <bruno@clisp.org>
6170
6171         * xallocsa.h: New file, from GNU gettext.
6172         * xallocsa.c: New file, from GNU gettext.
6173
6174 2003-11-24  Bruno Haible  <bruno@clisp.org>
6175
6176         * allocsa.h: New file, from GNU gettext.
6177         * allocsa.c: New file, from GNU gettext.
6178
6179 2003-11-24  Bruno Haible  <bruno@clisp.org>
6180
6181         * eealloc.h: New file.
6182
6183 2004-01-15  Jim Meyering  <jim@meyering.net>
6184
6185         Merge from coreutils.
6186
6187         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6188         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6189         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6190
6191         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6192         optional configure-time default.
6193
6194         * version-etc.c (version_etc_copyright): Update copyright date.
6195
6196         * xreadlink.c (xreadlink): Correct outdated comment.
6197
6198 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6199
6200         Merge from coreutils.
6201
6202         * posixver.c: Include posixver.h.
6203
6204         * same.c: Include <stdbool.h>, <limits.h>.
6205         (_POSIX_NAME_MAX): Define if not defined.
6206         (MIN): New macro.
6207         (same_name): If file names are silently truncated, report
6208         that the file names are the same if they are the same after
6209         the silent truncation.
6210
6211         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6212         conversion function.
6213         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6214         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6215         longer needed.
6216
6217 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6218
6219         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6220         with like-named macro in fnmatch.c.
6221         (EXT): Use an internal constant instead.
6222
6223         Merge fnmatch patches from glibc.
6224         * fnmatch.c (mbsinit): Remove define.
6225         Add libc_hidden_ver (__fnmatch, fnmatch).
6226         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6227         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6228
6229 2003-12-14  Karl Berry  <karl@gnu.org>
6230
6231         * config.charset: update from gettext-runtime.
6232
6233 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6234
6235         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6236         Bug reported by Alfred M. Szmidt.
6237
6238 2003-11-29  Karl Berry  <karl@gnu.org>
6239
6240         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6241
6242 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6243             Bruno Haible  <bruno@clisp.org>
6244
6245         * printf-parse.h: Don't include sys/types.h.
6246         (ARG_NONE): New macro.
6247         (char_directive): Change type of *arg_index fields to size_t.
6248         * printf-parse.c: Don't include sys/types.h.
6249         (SSIZE_MAX): Remove macro.
6250         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6251         Remove unnecessary overflow check.
6252         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6253         fields.
6254
6255 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6256
6257         * alloca.c: Remove dependency on xalloc module.
6258         (xalloc_die): Remove.
6259         (memory_full) [!defined emacs]: New macro.
6260         [!defined emacs]: Don't include xalloc.h.
6261         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6262         address arithmetic overflows.  Change datatypes a bit to avoid
6263         unnecessary casts.
6264
6265 2003-11-22  Jim Meyering  <jim@meyering.net>
6266
6267         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6268
6269 2003-11-17  Bruno Haible  <bruno@clisp.org>
6270
6271         * vasnprintf.c (alloca): Remove fallback definition.
6272         (freea): Remove definition.
6273         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6274         Reported by Paul Eggert.
6275
6276 2003-11-17  Jim Meyering  <jim@meyering.net>
6277
6278         On systems without utime and without a utimes function capable of
6279         dealing with a NULL struct utimbuf* argument, this utime replacement
6280         could -- in unusual circumstances -- leak a file descriptor.
6281         * utime.c: Include <unistd.h> and <errno.h>.
6282         (utime_null): Be sure to close `fd' and to preserve errno.
6283         Reported by Geoff Collyer via Arnold Robbins.
6284
6285 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6286             Bruno Haible  <bruno@clisp.org>
6287
6288         Protect against address arithmetic overflow.
6289         * printf-args.h: Include stddef.h.
6290         (arguments): Change type of field 'count' to size_t.
6291         * printf-args.c (printf_fetchargs): Use size_t instead of
6292         'unsigned int' where appropriate.
6293         * printf-parse.h: Include sys/types.h.
6294         (char_directive): Change type of *arg_index fields to ssize_t.
6295         (char_directives): Change type of fields 'count', max_*_length to
6296         size_t.
6297         * printf-parse.c: Include sys/types.h and xsize.h.
6298         (SSIZE_MAX): Define fallback value.
6299         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6300         instead of 'int' where appropriate. Check a_allocated, d_allocated
6301         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6302         * vasnprintf.c: Include xsize.h.
6303         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6304         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6305         overflow. Avoid wraparound when converting a width or precision from
6306         decimal to binary.
6307
6308 2003-11-16  Bruno Haible  <bruno@clisp.org>
6309
6310         Update from GNU gettext.
6311         * printf-parse.c: Generalize to it can be compiled for wide strings.
6312         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6313         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6314         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6315         SNPRINTF): New macros.
6316         Don't include <alloca.h> if the file is used inside libintl.
6317         (local_wcslen): New function, for Solaris 2.5.1.
6318         (VASNPRINTF): Use it instead of wcslen.
6319
6320 2003-11-16  Bruno Haible  <bruno@clisp.org>
6321
6322         * xsize.h (xmax): New function.
6323         (xsum, xsum3, xsum4): Declare as "pure" functions.
6324
6325 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6326
6327         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6328         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6329         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6330         heuristic is just as accurate as far as we know, and it removes a
6331         dependency on size_max.m4 and ptrdiff_max.m4.
6332
6333 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6334
6335         * xstrtol.c (__xstrtol): Remove "break" immediately after
6336         "return", to pacify some unknown compiler.  Problem reported
6337         by Joerg Schilling.
6338
6339 2003-11-11  Bruno Haible  <bruno@clisp.org>
6340
6341         * xsize.h (SIZE_MAX): Remove fallback definition.
6342         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6343         defined.
6344
6345 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6346
6347         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6348         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6349         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6350         From Bruno Haible.
6351         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6352         not (size_t) -1, since it's defined here.
6353
6354 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6355
6356         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6357         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6358         Reject sizes of exactly SIZE_MAX bytes.
6359         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6360         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6361
6362 2003-11-05  Bruno Haible  <bruno@clisp.org>
6363
6364         * xsize.h: Include limits.h, to avoid a possible collision with
6365         SIZE_MAX defined in <limits.h> on Solaris.
6366
6367 2003-11-04  Bruno Haible  <bruno@clisp.org>
6368
6369         * xsize.h: New file.
6370         * linebreak.c: Include xsize.h.
6371         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6372         argument for overflow.
6373         Suggested by Paul Eggert.
6374
6375 2003-10-31  Bruno Haible  <bruno@clisp.org>
6376
6377         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6378         to avoid (extremely rare) race condition.
6379         Suggested by Paul Eggert.
6380
6381 2003-11-03  Jim Meyering  <jim@meyering.net>
6382
6383         * userspec.c: Include "userspec.h".
6384         * userspec.h: New file.
6385
6386 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6387
6388         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6389         * mountlist.c (SIZE_MAX): Define if not defined already.
6390         (read_filesystem_list): Set and use me_type_malloced.
6391         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6392         whatever the type happens to be), for brevity and consistency.
6393         Check for size calculation overflow on Alphas running OSF/1.
6394
6395 2003-10-31  Jim Meyering  <jim@meyering.net>
6396
6397         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6398
6399         * linebuffer.c: Include <string.h> for declaration of memset.
6400
6401 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6402             Bruno Haible  <bruno@clisp.org>
6403
6404         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6405         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6406
6407 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6408
6409         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6410         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6411         no longer needed.
6412         * quotearg.c (quotearg_n_options): Use it.
6413         * group-member.c: Include <stdbool.h>.
6414         (free_group_info): Arg is now const *; don't free arg.
6415         (get_group_info): Now returns bool and accepts struct group_info *,
6416         rather than returning a malloc'ed struct group_info *.
6417         All uses changed.  Check for overflow in internal size calculation.
6418
6419         * getusershell.c (readname): Simplify the code by using x2nrealloc
6420         rather than xmalloc/xrealloc.
6421         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6422         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6423         conformance bug: the old code used a pointer after freeing the
6424         storage that it addressed.
6425         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6426         rather than doing it by hand.
6427         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6428         the buffer preserved.  Use free and xmalloc instead.
6429         * quotearg.c (quotearg_n_options): Likewise.
6430         Use a simpler test for size overflow.  Don't use xalloc_oversized
6431         because unsigned int might be wider than size_t (!); this suggests
6432         that we should switch from unsigned int to size_t for slot numbers.
6433
6434 2003-10-27  Bruno Haible  <bruno@clisp.org>
6435
6436         * stdbool_.h: Better support for BeOS.
6437
6438 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6439
6440         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6441         to allocate the returned structure.  Do not allocate a subarray,
6442         as x2nrealloc will do that.
6443         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6444         instead of xnrealloc.
6445         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6446
6447 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6448
6449         * xalloc.h (xalloc_oversized): New static inline function, for
6450         callers that want to do their own size-overflow checking.  Include
6451         <stdbool.h>, since xalloc_oversized returns bool.
6452         * xalloc.c (array_size_overflow): Remove.  All callers changed
6453         to use xalloc_oversized.
6454
6455         Add two functions x2realloc, x2nrealloc, for programs that grow
6456         arrays dynamically by doubling their sizes.
6457         * xalloc.h (x2realloc, x2nrealloc): New decls.
6458         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6459         New functions.
6460
6461         Port to C99 semantics for 'inline' of external functions.
6462         Bug reported by Bruno Haible.
6463         * xmalloc.c (xnmalloc_inline): New static inline function,
6464         with the old contents of xnmalloc.
6465         (xnmalloc, xmalloc): Use it.
6466         (xnrealloc_inline): New static inline function,
6467         with the old contents of xnrealloc.
6468         (xnrealloc, xrealloc): Use it.
6469
6470         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6471
6472 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6473
6474         Fix several address-calculation bugs in the hash modules,
6475         plus some minor code cleanup.
6476
6477         * hash.h: Include <stdbool.h>, for bool.
6478         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6479         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6480         hash_get_n_entries, hash_get_max_bucket_length,
6481         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6482         hash_rehash): Use size_t rather than unsigned.
6483         * hash.c (struct hash_table, hash_get_n_buckets,
6484         hash_get_n_buckets_used, hash_get_n_entries,
6485         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6486         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6487         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6488         Likewise.
6489         (SIZE_MAX): Define if not defined.
6490         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6491         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6492         hash_print):
6493         Use const * when possible.
6494         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6495         (check_tuning): Fix bug: if tuning parameters were very close to
6496         0 or 1, rounding errors could have caused subscript violations.
6497         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6498         (hash_initialize): Add 'fail:' label
6499         to free table and return NULL, and use it to simplify code.
6500         Use calloc rather than clearing the storage ourself.
6501         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6502         buffer size calculations.
6503         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6504         Include <stddef.h>, for size_t.
6505         * hash-pjw.c (hash_pjw): Likewise.
6506         Switch to method described by Bruno Haible.
6507         Include <limits.h>, for CHAR_BIT.
6508         (SIZE_BITS): New macro.
6509
6510 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6511
6512         * getndelim2.c (getndelim2): When size calculation overflows,
6513         ceiling the allocation at NMAX bytes rather than silently
6514         discarding input bytes before NMAX is reached.  This makes
6515         a difference only if NMAX exceeds SIZE_MAX / 2.
6516
6517         * obstack.c: Merge from glibc.
6518         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6519         Add libc_hidden_def (_obstack_newchunk).
6520         (_obstack_free) [! defined _LIBC]: Remove.
6521         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6522         a clone of the function body.
6523         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6524         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6525
6526         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6527         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6528         arg to memcpy.
6529
6530         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6531         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6532         Don't use lvalue casts, as GCC plans to remove support for them
6533         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6534         was also present in the non-GCC version, indicating that this
6535         code had always been buggy and had never been widely used.
6536         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6537         Use the fast variant of each macro, rather than copying the
6538         definiens of the fast variant; that way, we'll be more likely to
6539         catch future bugs in the fast variants.
6540
6541 2003-10-20  Bruno Haible  <bruno@clisp.org>
6542
6543         * wait-process.h: New file, from GNU gettext.
6544         * wait-process.c: New file, from GNU gettext.
6545
6546 2003-10-19  Jim Meyering  <jim@meyering.net>
6547
6548         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6549
6550 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6551
6552         * getgroups.c: Include <errno.h>, <stdlib.h>.
6553         (getgroups): First arg is int, not size_t.
6554         Don't let 'free' mangle errno.
6555
6556 2003-10-16  Jim Meyering  <jim@meyering.net>
6557
6558         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6559
6560 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6561
6562         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6563         (SIZE_MAX): Remove.
6564         (new_exclude, add_exclude_file): Initial size no longer needs to
6565         be a power of 2.
6566         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6567         our own address arithmetic overflow checking.
6568
6569         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6570         (fnmatch): Do not alloca more than 2000 wide characters;
6571         instead, use malloc for large buffers.
6572         Check for address arithmetic overflow, and return -1
6573         with errno set to ENOMEM in that case.
6574         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6575         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6576         instead, return -1.  Check for address arithmetic overflow.
6577
6578 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6579
6580         Handle invalid suffixes and overflow independently, so that
6581         callers can treat them independently as needed.  Fix some bugs in
6582         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6583         suffix for a human-readable blocksize.  The major caller-visible
6584         change is the addition of a new
6585         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6586         that both overflow and suffix chars were found.
6587
6588         * human.c (humblock): Don't check separately for invalid suffix
6589         char; that is xstrtoumax's job (now that its bug is fixed).
6590         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6591         INTMAX_MAX]: New macros.
6592         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6593         TYPE_MAXIMUM): New macros.
6594         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6595         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6596         if overflow occurs, as it's what __strtol does and it's more useful
6597         in practice.
6598         (__xstrtol): If __strtol reports some error other than ERANGE,
6599         reflect it to the caller as LONGINT_INVALID.  If it reports
6600         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6601         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6602         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6603         value.
6604         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6605         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6606         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6607         [defined UINTMAX_MAX]: New macros.
6608
6609 2003-10-14  Bruno Haible  <bruno@clisp.org>
6610
6611         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6612         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6613         Also use volatile where needed.
6614
6615 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6616
6617         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6618         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6619         and define in terms of the other primitives.
6620         * xmalloc.c: Include stdbool.h; do not include exit.h.
6621         (SIZE_MAX): Define if not already defined.
6622         (array_size_overflow): New function.
6623         (xalloc_die): Abort instead of exiting if 'error' returns.
6624         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6625         (xmalloc, xrealloc): Use them.
6626         (xcalloc): Check for address arithmetic overflow.
6627         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6628         a bit faster than strcpy.
6629
6630 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6631
6632         Merge getpass from libc, plus a few fixes.
6633
6634         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6635         Include <stdbool.h>.
6636         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6637         __fsetlocking to empty.
6638         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6639         do include <bits/libc-lock.h>.
6640         Do not include <fcntl.h>; not needed.
6641         [_LIBC]: Include <wchar.h>.
6642         (NOTCANCEL_MODE): New macro.
6643         (flockfile, funlockfile) [_LIBC]: New macros.
6644         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6645         [!_LIBC]: New macros.
6646         (call_fclose): New function.
6647         (getpass): Use it.  Save tty stream separately; this simplifies the
6648         code and makes it more reliable if stdin happens to equal stdout.
6649         Invoke __fsetlocking on tty.
6650         Handle thread cancellation if needed.
6651         Namespace cleanup (use __tcgetattr, __getline).
6652         Use bool for Booleans.
6653         [USE_IN_LIBIO]: Handle wide streams.
6654         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6655         stream might go where.
6656
6657         * unlocked-io.h: Include <stdio.h>, so that the caller
6658         doesn't have to include <stdio.h> before us.
6659         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6660         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6661         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6662         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6663         if not declared, so that we can use getpass.c code from libc without
6664         rewriting it.
6665         (flockfile, ftrylockfile, funlockfile): New macros.
6666
6667 2003-10-06  Bruno Haible  <bruno@clisp.org>
6668
6669         * version-etc-2.h: Remove file.
6670         * version-etc-2.c: Remove file.
6671
6672 2003-09-25  Jim Meyering  <jim@meyering.net>
6673             Bruno Haible  <bruno@clisp.org>
6674
6675         This lets translators provide better translations for the
6676         "Written by ..." part of --version output.
6677         * version-etc.h: Include stdarg.h.
6678         (version_etc_copyright): Declare as readonly.
6679         (version_etc): Make this function variadic with a NULL-terminated list
6680         of author name strings.
6681         (version_etc_va): New declaration.
6682         * version-etc.c: Include stdarg.h, stdlib.h.
6683         (version_etc_copyright): Declare as readonly.
6684         (version_etc_va): New function. Provide a different translatable string
6685         for each possible number of authors < 10. Abbreviate when there are 10
6686         authors or more.
6687         (version_etc): Make this function variadic. Call version_etc_va.
6688         Suggestion from Gary V. Vaughan.
6689
6690         * long-options.h (parse_long_options): Change prototype: the authors
6691         string is moved to the end and becomes variadic.
6692         * long-options.c: Include stdarg.h.
6693         (parse_long_options): Make this function variadic, too.
6694         Call version_etc_va, not version_etc.
6695
6696 2003-10-06  Bruno Haible  <bruno@clisp.org>
6697
6698         * fatal-signal.h: New file, from GNU gettext.
6699         * fatal-signal.c: New file, from GNU gettext.
6700
6701 2003-10-04  Karl Berry  <karl@gnu.org>
6702
6703         * argp*: update from libc.
6704
6705 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6706
6707         * getpass.c (getpass): Use a no-op fseek when switching from input to
6708         output mode on the same stream.
6709
6710 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6711
6712         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6713         Fix arg typo in previous patch.
6714
6715 2003-09-28  Jim Meyering  <jim@meyering.net>
6716
6717         * error.c: Correct cpp indentation.
6718
6719 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6720
6721         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6722         Omit the special code that used __typeof__, since we worry that
6723         it could be more trouble than it's worth.  See:
6724         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6725         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6726
6727         * free.c: New file.
6728
6729 2003-09-26  Jim Meyering  <jim@meyering.net>
6730
6731         * error.c (error_tail): Move some declarations
6732         into inner scope where the local variables are used.
6733
6734 2003-09-26  Bruno Haible  <bruno@clisp.org>
6735
6736         * stpncpy.h (gnu_stpncpy): New declaration.
6737         (stpncpy): Define as alias for gnu_stpncpy.
6738         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6739
6740 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6741
6742         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6743         (error_tail): Do not loop, reallocating temporary buffer, since
6744         the output cannot contain more wide characters than the input
6745         contains bytes, the size must be big enough already.  This avoids
6746         one potential size overflow calculation.  Check for size overflow
6747         when calculating temporary buffer size.  Free temporary buffer
6748         when done, if it was allocated with malloc; this plugs a memory
6749         leak.  Remove casts from void * to pointers, that are no longer
6750         needed now that we're assuming C89 or better.
6751
6752         Merge error changes from glibc.
6753
6754         * error.c, error.h: Update copyright notice header to match glibc.
6755         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6756         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6757         Disable cancellation while printing error.
6758         * error.h: Prepend __ to parameter names.
6759
6760 2003-09-25  Karl Berry  <karl@gnu.org>
6761
6762         * argp-fmtstream.c, argp-help.c: update from libc.
6763
6764 2003-09-25  Bruno Haible  <bruno@clisp.org>
6765
6766         * version-etc-2.h: New file, from version-etc.h with modifications.
6767         * version-etc-2.c: New file, from version-etc.c with modifications.
6768
6769 2003-09-25  Simon Josefsson  <jas@extundo.com>
6770
6771         * xgetdomainname.h: New file.
6772         * xgetdomainname.c: New file.
6773
6774 2003-09-25  Simon Josefsson  <jas@extundo.com>
6775             Bruno Haible  <bruno@clisp.org>
6776
6777         * getdomainname.h: New file.
6778         * getdomainname.c: New file.
6779
6780 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6781
6782         * linebuffer.c (freebuffer): Don't free the argument, just
6783         the buffer associated with the argument.  Bug reported by
6784         Simon Josefsson.
6785
6786 2003-09-19  Karl Berry  <karl@gnu.org>
6787
6788         * argp.h: update from libc.
6789
6790 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6791
6792         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6793         input error, instead of returning NULL the next time we are called
6794         (and therefore losing track of errno).
6795
6796 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6797
6798         * getndelim2.c (getndelim2): Don't trash errno when a read
6799         fails, so that the caller gets the proper errno.
6800
6801         * readutmp.c (read_utmp): Likewise.
6802         Check for fstat error.  Close stream and free storage
6803         when failing.
6804
6805 2003-09-14  Bruno Haible  <bruno@clisp.org>
6806
6807         * fwriteerror.h: New file.
6808         * fwriteerror.c: New file.
6809
6810 2003-09-14  Jim Meyering  <jim@meyering.net>
6811
6812         * getloadavg.c: Correct cpp indentation.
6813         * strdup.c: Likewise.
6814         * vasnprintf.c: Likewise.
6815
6816 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6817
6818         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6819         * obstack.c [!defined _LIBC]: Likewise.
6820         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6821         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6822         * exitfail.c: Don't include stdlib.h; no longer needed.
6823
6824         More changes to assume C89 or better.
6825
6826         * error.c (error_tail): Assume vprintf.
6827
6828         * argmatch.c (getenv): Remove decl.
6829         * progreloc.c (get_full_program_name): Define via prototype.
6830         * setenv.c (clearenv): Likewise.
6831         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6832         needed.
6833         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6834         (malloc, memcpy): Remove decls.
6835         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6836         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6837         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6838         (memcpy): Remove macro.
6839         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6840         (__P): Remove.  All uses removed.
6841         (PTR): Remove.  All uses changed to void *.
6842         (CHAR_BIT, NULL): Remove.
6843         (spaces, zeros, memset_space, memset_zero)
6844         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6845         Remove.
6846         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6847         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6848         Define with prototype.
6849         Remove now-unnecessary prototype decl.
6850         (extra_args_spec): Assume ANSI C.  All uses changed.
6851         (extra_args_spec_iso): Remove.
6852         (my_strftime, emacs_strftimeu): Define via prototype.
6853         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6854         unconditionally.
6855         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6856         * strtoimax.c: Include <stdlib.h> unconditionally.
6857         (strtoul, strtol): Remove decls.
6858         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6859         LONG_MAX): Remove.
6860         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6861         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6862         (LOCALE_PARAM_PROTO): New macro.
6863         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6864         (INTERNAL (strtol), strtol): Define with a prototype.
6865         (PARAMS): Remove.  All uses removed.
6866         * tempname.c: Include <string.h> unconditionally.
6867         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6868         * xgethostname.c (main): Define with a prototype.
6869         * xmalloc.c: Include "xalloc.h" first, to check interface.
6870         Include <stdlib.h> unconditionally.
6871         (calloc, malloc, realloc, free): Remove decls.
6872         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6873         Include <stdlib.h> unconditionally.  Sort include file names.
6874         (strtod): Remove.
6875         (xstrtod): Define with a prototype.
6876         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6877         (strtol, strtoul): Remove decls.
6878
6879 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6880
6881         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6882         Include <stdlib.h>, <string.h> unconditionally.
6883         Remove now-unnecessary cast to char *.
6884         * strnlen.c: Include <string.h> unconditionally.
6885         * yesno.c (yesno): Define with a prototype.
6886
6887 2003-09-10  Bruno Haible  <bruno@clisp.org>
6888
6889         * strcspn.c: Include <string.h> unconditionally.
6890         * strpbrk.c: Include <string.h> unconditionally.
6891         * strstr.c: Include <string.h> unconditionally.
6892         * unicodeio.c: Include <string.h> unconditionally.
6893         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6894         * unsetenv.c: Likewise.
6895         * xreadlink.c: Include <stdlib.h> unconditionally.
6896         * yesno.c: Include <stdlib.h> unconditionally.
6897         (rpmatch): Add prototype.
6898
6899 2003-09-10  Jim Meyering  <jim@meyering.net>
6900
6901         * error.c: Correct indentation of cpp directives.
6902
6903 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6904
6905         More K&R removal.
6906
6907         * acosl.c (main): Use a prototype.
6908         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6909         tanl.c: Likewise.
6910
6911         * getloadavg.c (getloadavg, main): Define via prototypes.
6912
6913         * getopt.h (struct option.name): Assume C89, and use 'const'.
6914         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6915         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6916         with a prototype.
6917         * getopt.c (const): Remove macro.
6918         Include <string.h> unconditionally.
6919         (my_index): Remove; all uses changed to strchr.
6920         (strlen): Remove decl.
6921         (exchange): Remove forward decl; no longer needed.
6922         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6923         Define with prototype.
6924         * getopt1.c (const): Remove macro.
6925         (getopt_long, getopt_long_only, main): Define with prototype.
6926
6927         * getugroups.c: Include <string.h> unconditionally.
6928
6929         * getusershell.c: Include <stdlib.h> unconditionally.
6930         (getusershell, setusershell, endusershell, readname, main):
6931         Define with prototypes.
6932
6933         * group-member.c: Include group-member.h first.
6934         Include <stdlib.h> unconditionally.
6935
6936         * hard-locale.c: Include hard-locale.h first.
6937         Include <stdlib.h>, <string.h> unconditionally.
6938
6939         * hash.c (free, malloc): Remove decls.
6940         Include <stdlib.h> unconditionally.
6941
6942         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6943         (getenv): Do not declare.
6944
6945         * idcache.c: Include <string.h> unconditionally.
6946
6947         * long-options.c: Include long-options.h first, to test interface.
6948         Include <stdlib.h> unconditionally.
6949
6950         * makepath.c: Include makepath.h first, to test interface.
6951         Include <stdlib.h> and <string.h> unconditionally.
6952
6953         * linebuffer.c: Include <stdlib.h>.
6954         (free): Remove decl.
6955
6956         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6957         rpl_malloc returns void *, not char *.
6958         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6959
6960         * md5.h: Include <limits.h> unconditionally.
6961         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6962         (__P): Remove; all uses removed.
6963         * md5.c: Include "md5.h" first.
6964         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6965         md5_buffer, md5_process_bytes, md5_process_block):
6966         Define with prototypes.
6967         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6968         * sha.c: Include "sha.h" first.
6969         Include <stdlib.h>, <string.h> unconditionally.
6970
6971         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6972         * memcmp.c (__ptr_t): Likewise.
6973         * memrchr.c (__ptr_t): Likewise.
6974         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6975         Include <string.h> unconditionally.
6976         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6977         * memchr.c: Include <stdlib.h> unconditionally.
6978         * memchr.c (LONG_MAX): Remove.
6979         * memrchr.c (LONG_MAX): Likewise.
6980         * memchr.c (__memchr): Define via a prototype.
6981         * memrchr.c (__memrchr): Likewise.
6982         * memcmp.c (__P): Remove, and remove all uses.
6983         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6984         Remove forward decls; no longer needed.
6985         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6986         Use types required by C89 in prototype.
6987
6988         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6989         * savedir.c: Likewise.
6990         * mkdir.c (free): Remove decl.
6991         * rmdir.c (rmdir): Define with a prototype.
6992         * savedir.c: Include savedir.h first, to test interface.
6993
6994         * mktime.c (STDC_HEADERS): Remove.
6995         Include <stdlib.h>, <string.h> unconditionally.
6996
6997         * modechange.c: Include <stdlib.h> unconditionally.
6998         (malloc): Remove decl.
6999
7000         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7001         (free): Remove decl.
7002
7003         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7004         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7005         (This type really should be intptr_t, but that's a C99ism.)
7006         (_obstack_memcpy): Remove: all uses changed to memcpy.
7007         Include <string.h> unconditionally.
7008         (struct obstack): Assume __STDC__ for types of members
7009         chunkfun, freefun, extra_arg.
7010         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7011         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7012         obstack_begin, obstack_specify_allocation,
7013         obstack_specify_allocation_with_arg, obstack_chunkfun,
7014         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7015         Remove unprototyped decls and the macros that use them.
7016         * obstack.c (POINTER): Remove.  All uses changed to void *.
7017         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7018         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7019         (defined __STDC__ && __STDC__)]:
7020         Remove nonprototyped code.
7021         Include <stdlib.h> unconditionally.
7022         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7023         _obstack_allocated_p, _obstack_free, obstack_free,
7024         _obstack_memory_used, print_and_abort):
7025         Define using prototypes.
7026         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7027         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7028         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7029         obstack_next_free, obstack_object_size, obstack_room) [0]:
7030         Remove unused, unprototyped code.
7031
7032         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7033
7034         * physmem.c (physmem_total, physmem_available, main): Define
7035         with prototypes.
7036
7037         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7038         (main): Define with a prototype.
7039
7040         * posixver.c (getenv): Remove decl.
7041
7042         * putenv.c (malloc): Returns void *, not char *.
7043         Include <string.h> unconditionally.
7044         (strchr, memcpy, NULL): Do not define.
7045
7046         * readtokens.c: Include readtokens.h first, to test interface.
7047         Include <stdlib.h>, <string.h> unconditionally.
7048         (init_tokenbuffer): Define with a prototype.
7049
7050         * regex.c (PARAMS): Remove.  All uses removed.
7051         All uses of _RE_ARGS removed, too.
7052         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7053         unconditionally.
7054         (bzero): Assume memset exists.
7055         (memcmp, memcpy, NULL): Remove.
7056         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7057         char, or assignments to local vars of type signed char.
7058         (init_syntax_once, PREFIX(extract_number_and_incr),
7059         PREFIX(print_partial_compiled_pattern),
7060         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7061         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7062         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7063         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7064         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7065         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7066         wcs_compile_range, byte_compile_range, truncate_wchar,
7067         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7068         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7069         count_mbs_length, wcs_re_match_2_internal,
7070         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7071         PREFIX(alt_match_null_string_p),
7072         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7073         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7074         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7075         now-unnecessary declaration, if any.
7076         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7077         regcomp, regexec):
7078         Remove now-unnecessary casts among pointer types.
7079         * regex.h (_RE_ARGS): Remove.  All uses removed.
7080
7081         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7082         (free): Remove decl.
7083
7084         * rpmatch.c: Include <stdlib.h> unconditionally.
7085
7086         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7087         (free): Remove decl.
7088
7089         * save-cwd.c: Include <stdlib.h> unconditionally.
7090         * xgetcwd.c: Likewise.
7091
7092         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7093         (free): Remove decl.
7094
7095         * strchrnul.c (strchrnul): Define with a prototype.
7096         Fix bug: c_in was not converted to char before searching.
7097
7098         The following changes are not K&R related:
7099
7100         * group-member.h: Include <sys/types.h>, so that this file is
7101         self-contained.
7102         * makepath.h: Likewise.
7103
7104         * getusershell.c (readname, default_index, line_size, readname):
7105         Use size_t, not int, for sizes.
7106         (readname): If the size overflows, report an error instead of
7107         looping forever.
7108
7109 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7110
7111         * getndelim2.c: Assume stdlib.h per the C89 spec.
7112
7113 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7114
7115         Assume C89 or better; remove K&R cruft.
7116         A few of these changes were first proposed by Derek Robert Price
7117         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7118
7119         * addext.c: Include <string.h> unconditionally.
7120         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7121         Don't declare getenv or malloc.
7122
7123         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7124         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7125         (NULL): Remove.
7126         (find_stack_direction, alloca): Use prototypes.
7127
7128         * atexit.c (atexit): Define using a prototype.
7129
7130         * basename.c, dirname.c, stripslash.c:
7131         Include <string.h> unconditionally.
7132
7133         * bcopy.c: Include <stddef.h>.
7134         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7135
7136         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7137
7138         * error.h (error, error_at_line, error_print_progname)
7139         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7140         * error.c: Include error.h first, to check interface.
7141         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7142         (VA_START): Remove; all uses changeed to va_start.
7143         (exit, strerror): Remove decls.
7144         (error_print_progname): Prototype uncondionally.
7145         Don't include <errno.h>; no longer needed.
7146         (private_strerror): Remove.
7147         (error_tail): Always define.
7148         (error, error_at_line): Assume C89 or better; always use prototypes.
7149         * fatal.c: Include "fatal.h" first, to test interface.
7150         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7151         (VA_START): Remove; all uses changed to va_start.
7152         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7153         this case.
7154         (exit): Remove decl.
7155         (fatal): Prototype unconditionally.  Assume va_start works.
7156         Abort at end, to pacify gcc.
7157
7158         * euidaccess.c (main): Define with a prototype.
7159
7160         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7161
7162         * exitfail.c: Include <stdlib.h> unconditionally.
7163
7164         * fnmatch_.h (__P): Remove.  All uses changed to assume
7165         prototypes.
7166         * fnmatch.c: Include fnmatch.h first, to test interface.
7167         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7168         (getenv): Remove decl.
7169         (fnmatch): Define using a prototype.
7170         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7171         (FCT): Define using a prototype.
7172
7173         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7174
7175         * gethostname.c: Include <stddef.h>.
7176         (gethostname): Define with prototype.  Length is size_t, not int.
7177
7178 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7179
7180         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7181         getversion.c should have been removed then, but was accidentally
7182         preserved.
7183
7184         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7185         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7186
7187 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7188
7189         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7190         copy_tm_result.  Bug reported by Simon Josefsson in
7191         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7192
7193 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7194
7195         * time_r.c, time_r.h: New files.
7196
7197         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7198         __localtime_r.
7199         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7200         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7201
7202         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7203         __gmtime_r.
7204         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7205         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7206         Include <time_r.h>.
7207
7208         * timegm.c: Switch to glibc implementation, with the following changes:
7209         [defined HAVE_CONFIG_H]: Include <config.h>.
7210         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7211         (__mktime_internal) [!defined _LIBC]: New decl.
7212         (__gmtime_r) [!defined _LIBC]: New macro and function.
7213         (timegm): Use a prototype, since gnulib assumes C89.
7214         Do not bother declaring tmp to be const, as it's not really usefu.
7215         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7216         (timegm): Declare only if HAVE_DECL_TIMEGM.
7217
7218 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7219
7220         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7221         Bug reported by Lute Kamstra in
7222         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7223
7224         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7225         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7226         course with correspondingly smaller numbers for tomorrow and
7227         yesterday.  From Tadayoshi Funaba.  Originally installed into
7228         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7229         coreutils merge?).
7230
7231 2003-08-31  Simon Josefsson  <jas@extundo.com>
7232
7233         * timegm.h: New file.
7234         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7235
7236 2003-08-31  Karl Berry  <karl@gnu.org>
7237
7238         * argp.h: update from libc.
7239
7240 2003-08-28  Bruno Haible  <bruno@clisp.org>
7241
7242         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7243         warning on QNX, which defines O_BINARY to 000000.
7244
7245 2003-08-24  Bruno Haible  <bruno@clisp.org>
7246
7247         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7248         MSVC7 <stdio.h> is included later.
7249
7250 2003-08-20  Bruno Haible  <bruno@clisp.org>
7251
7252         * progname.h: New file, from GNU gettext.
7253         * progname.c: New file, from GNU gettext.
7254         * progreloc.c: New file, from GNU gettext.
7255
7256 2003-08-19  Bruno Haible  <bruno@clisp.org>
7257
7258         * xstrdup.c: Assume <string.h> exists.
7259
7260 2003-08-18  Jim Meyering  <jim@meyering.net>
7261
7262         * setenv.h: Indent nested cpp directive.
7263         * vasnprintf.c: Remove trailing blanks.
7264
7265 2003-08-17  Simon Josefsson  <jas@extundo.com>
7266             Bruno Haible  <bruno@clisp.org>
7267
7268         * xstrndup.h: New file.
7269         * xstrndup.c: New file.
7270
7271 2003-08-17  Bruno Haible  <bruno@clisp.org>
7272
7273         * strndup.h: New file.
7274
7275 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7276
7277         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7278         space, undoing this 2003-08-12 change:
7279         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7280
7281 2003-08-16  Jim Meyering  <jim@meyering.net>
7282
7283         Merge from coreutils.
7284         * xstrtoimax.c: #else #if -> #elif.
7285         * xstrtoumax.c: Likewise.
7286
7287 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7288
7289         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7290         rather than tab, after '#' in shell-script copyright notices.
7291         Suggested by Bruno Haible.
7292
7293 2003-08-15  Jim Meyering  <jim@meyering.net>
7294         and Paul Eggert  <eggert@twinsun.com>
7295
7296         Merge from coreutils.
7297         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7298         member but strut utmpx does not.  Needed for AIX 4.3.3.
7299         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7300
7301 2003-08-15  Jim Meyering  <jim@meyering.net>
7302
7303         Merge from coreutils.
7304         * xgethostname.c: Include <stdlib.h>.
7305         (xghostname): Don't exit for anything other than memory-related
7306         failure; just return NULL.
7307         * userspec.c: Include "posixver.h".
7308         (parse_user_spec): Accept `.' as a separator only
7309         in pre-POSIX-200112 mode.
7310         * strtoimax.c: Use #elif rather than #else #if.
7311         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7312         Remove function, now that we can rely on a working tzset function.
7313         [!_LIBC]: Ensure that the required autoconf test has been run.
7314         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7315         Use underlying_strftime for %r.
7316         * sha.c: Merge in some clean-up and optimization changes from glibc.
7317         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7318         Ensure that it is a multiple of 64.
7319         Rearrange loop exit tests so as to avoid performing an
7320         additional fread after encountering an error or EOF.
7321         * realloc.c: Update copyright date.
7322
7323 2003-08-14  Jim Meyering  <jim@meyering.net>
7324
7325         Merge from coreutils.
7326         * obstack.h: Whitespace changes.
7327         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7328         and xcalloc return values.
7329         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7330         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7331         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7332         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7333         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7334         error from mntctl.
7335         Use mntctl's return value to drive the entry-processing loop, since
7336         we can't rely on the value of the vmt_length member in the last
7337         entry.  On some systems doing so could result in exhausting
7338         virtual memory.  Based in part on a patch from Mike Jetzer.
7339
7340 2003-08-14  Jim Meyering  <jim@meyering.net>
7341         and Paul Eggert  <eggert@twinsun.com>
7342
7343         Merges from coreutils, plus other fixes.
7344         * physmem.c: Merge in portability changes from gcc/libiberty
7345         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7346         for credits and details.  Thanks to Kaveh Ghazi for helping
7347         to keep these files in sync.
7348         (ARRAY_SIZE): Define it.
7349         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7350         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7351         (memcasecmp): Don't assume size_t fits in unsigned int.
7352         Remove casts and duplicate code.
7353         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7354         (memcpy): Remove definition.
7355         Merge in some clean-up and optimization changes from glibc.
7356         [BLOCKSIZE]: Move definition to top of file.
7357         Ensure that it is a multiple of 64.
7358         Rearrange loop exit tests so as to avoid performing an
7359         additional fread after encountering an error or EOF.
7360         * md5.h (md5_uintptr): Define.
7361         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7362         return to the initial working directory.  Preserve errno
7363         for caller.
7364         * idcache.c: Include "xalloc.h".
7365         (xmalloc, xrealloc): Remove decls.
7366         (getuser): Remove casts no longer required in C89.
7367         * human.c: Include stdio.h, for sprintf.
7368         * group-member.c: Include "xalloc.h".
7369         (xmalloc, xrealloc): Remove decls.
7370         (get_group_info): Remove casts no longer required in C89.
7371         * getusershell.c (readname): Remove casts no longer required in C89.
7372         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7373         * getline.c: Whitespace fix, from coreutils.
7374
7375 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7376
7377         * exclude.c: Include <ctype.h>
7378         (IN_CTYPE_DOMAIN): New macro.
7379         (is_space): New fn.
7380         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7381         and empty lines.
7382
7383         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7384         Undo previous (whitespace-only) change.
7385
7386 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7387
7388         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7389         Normalize leading white space and remove trailing white space.
7390         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7391         notice, as per ../config/srclist-update.
7392
7393         Merge from coreutils.
7394         * euidaccess.h: New file.
7395         * euidaccess.c: Include it.
7396         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7397         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7398         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7399
7400 2003-08-11  Bruno Haible  <bruno@clisp.org>
7401
7402         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7403         (vasnprintf): Use it instead of wcslen.
7404
7405 2003-08-11  Bruno Haible  <bruno@clisp.org>
7406
7407         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7408         value to ensure that _Bool promotes to int. Use #define for _Bool when
7409         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7410
7411 2003-08-10  Karl Berry  <karl@gnu.org>
7412
7413         * regex.h: update from libc (whitespace fix).
7414
7415 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7416
7417         Merge some files from coreutils.  These changes were
7418         originally made by Jim Meyering.
7419         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7420         many older Unixes require this.
7421         * alloca.c (alloca): Remove cast to argument of free;
7422         no longer needed in C89.
7423         * alloca_.h, regex.h: Fix white space to match
7424         what GNU indent does.
7425
7426 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7427
7428         * bumpalloc.h: Remove.
7429
7430 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7431
7432         * getloadavg.c: Change copyright notice and spacing to conform to
7433         GNU coding style.
7434
7435         Merge from coreutils.
7436         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7437         From glibc.
7438         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7439         from Karl Berry, implemented by Jim Meyering.
7440         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7441         from Dmitry V. Levin.
7442         Remove anachronistic cast of xrealloc.
7443         * fnmatch_.h (__const): Remove.  Use 'const'.
7444         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7445         type. Otherwise, it wouldn't compile with at least /bin/cc on
7446         ymp-cray-unicos9.0.2.X.
7447         Combine two mostly-identical uses of alloca into one.
7448         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7449
7450 2003-08-04  Dave Love <d.love@dl.ac.uk>
7451
7452         [From Emacs.]
7453
7454         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7455         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7456         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7457         obsolete NLIST_NAME_UNION.
7458         [__GNU__]: Undef BSD and FSCALE.
7459         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7460
7461 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7462
7463         * stdbool_.h (_Bool): Make it signed char, instead of
7464         an enum type, so that it's guaranteed to promote to int.  See:
7465         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7466
7467 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7468
7469         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7470         (strerror): Don't assume that a printable int fits in 14 bytes.
7471
7472 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7473             Bruno Haible  <bruno@clisp.org>
7474
7475         * getline.h (getline, getdelim): Change return type to ssize_t.
7476         * getline.c (getline, getdelim): Likewise.
7477         Remove _GNU_SOURCE define; now it's defined in config.h through
7478         m4/getline.m4.
7479
7480 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7481
7482         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7483         over-parenthesization in macros.
7484
7485         Sync with coreutils.
7486
7487         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7488         required by C99.
7489
7490         Use `exit_failure' for xalloc and xmemcoll instead of their own
7491         private exit-failure variables.
7492         * xalloc.h (xalloc_exit_failure): Remove.
7493         * xmalloc.c: Likewise.  Include exitfail.h.
7494         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7495         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7496         * xmemcoll.c: Likewise.  Include exitfail.h.
7497         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7498
7499 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7500
7501         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7502         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7503         to test that it can stand by itself.  Include "exitfail.h".
7504         Clients should set exit_failure instead.
7505         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7506
7507 2003-07-18  Andreas Schwab  <schwab@suse.de>
7508
7509         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7510
7511 2003-07-18  Bruno Haible  <bruno@clisp.org>
7512
7513         * getndelim2.h: New file.
7514         * getndelim2.c: Make into a module of its own. Include config.h,
7515         getndelim2.h.
7516         (getndelim2): Make non-static. Change return type to ssize_t.
7517         * getline.h: Change argument names.
7518         * getline.c: Include getndelim2.h instead of getndelim2.c.
7519         * getnline.c: Include getndelim2.h.
7520
7521 2003-07-17  Bruno Haible  <bruno@clisp.org>
7522
7523         * Makefile.am: Remove file.
7524         * Makefile.in: Remove file.
7525
7526 2003-07-17  Bruno Haible  <bruno@clisp.org>
7527
7528         * getnline.h: New file.
7529         * getnline.c: New file.
7530         * getndelim2.c: New file, extracted from getline.c.
7531         (getndelim2): Renamed from getdelim2, with added nmax argument.
7532         * getline.c: Include getndelim2.c.
7533         (getdelim2): Moved out to getndelim2.c.
7534         (getline, getdelim): Update.
7535
7536 2003-07-15    <karl@gnu.org>
7537
7538         * vasnprintf.c: update from gettext.
7539
7540 2003-07-15  Jim Meyering  <jim@meyering.net>
7541
7542         * makepath.c (make_path): Enclose diagnostic in _(...).
7543
7544 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7545
7546         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7547         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7548         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7549         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7550         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7551         updated automatically by ../config/srclist-update.  This changes
7552         their license from LPGL to GPL.
7553
7554 2003-07-14  Jim Meyering  <jim@meyering.net>
7555
7556         Don't emit diagnostics.  Let callers do that.
7557         * save-cwd.c: Don't include "error.h".
7558         (save_cwd): Don't call error.  Ensure that errno is valid
7559         when returning nonzero.
7560
7561         * save-cwd.h (restore_cwd): Update prototype.
7562         * save-cwd.c (restore_cwd): Remove two parameters.
7563         Simplify.  Don't call error upon failure.  Let callers do that.
7564         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7565         when auditing is enabled.  But don't bother updating the #if.
7566
7567 2003-07-14  Simon Josefsson  <jas@extundo.com>
7568
7569         * mempcpy.h: New file.
7570         * mempcpy.c: New file.
7571
7572 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7573
7574         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7575         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7576         unicodeio.c, unicodeio.h, unlocked-io.h:
7577         Switch from LGPL to GPL.
7578
7579 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7580
7581         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7582         it breaks C++ compilation.
7583         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7584
7585 2003-07-10  Jim Meyering  <jim@meyering.net>
7586
7587         * vasnprintf.c: Remove trailing blanks.
7588         Make cpp indentation consistent.
7589
7590 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7591
7592         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7593         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7594         Switch from LGPL to GPL.
7595
7596 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7597
7598         * mktime.c: Fix some boundary cases and remove need for floating point.
7599
7600         Issue a compile-time diagnostic if time_t is floating point, or if
7601         two's complement arithmetic is not in effect, or if arithmetic
7602         right shift does not propagate the sign.  These assumptions were
7603         all in the original code but they weren't checked.
7604
7605         (TIME_T_MIDPOINT, verify): New macros.
7606         (__isleap): Remove; it has integer overflow problems.
7607         (leapyear): New function, without those problems.
7608         (ydhms_tm_diff): Remove; splitting into two parts.
7609         (ydhms_diff): New function, containing the arithmetic part of
7610         the old ydhms_tm_diff function.  Issue a compile-time
7611         diagnostic if we are not using C99 integer division.
7612         Avoid casts when possible.
7613         (guess_time_tm): New function, containing the checking part of
7614         the old ydhms_tm_diff function.  Return the new value, rather than
7615         the difference between it and the old.  Accept a new argument T
7616         so that *T specifies the old value.  Check for overflow in the result.
7617
7618         (__mktime_internal): Use a time_t offset, not a long int offset.
7619         This undoes the 2003-06-04 change, which is no longer needed now
7620         that we have better overflow checking.
7621         (localtime_offset): Likewise.
7622
7623         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7624         and long are 64-bit but int is only 32-bit.
7625         (ydhms_diff): Use long int to store year1 and yday1.
7626         Issue a compile-time diagnostic if long int is not wide enough.
7627
7628         (__mktime_internal): Use long int to store adjusted year and yday.
7629         Use plain C rather than preprocessor commands, if that doesn't
7630         affect efficiency.
7631         Check for overflow (and try to repair) after each probe
7632         rather than checking only at the very end.  This avoids some bugs
7633         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7634         does not equal GMT offset at maximum time).
7635         Use integer to check for overflow rather than floating point; this
7636         is more portable to non-IEEE hosts, and is a tad faster.
7637         When we detect that we are oscillating between two values,
7638         don't check whether tm_isdst has the requested value, since
7639         we already know the answer.  When tm_isdst has the wrong value,
7640         use a different heuristic to find the right one, based on the
7641         extreme values actually observed in practice in tz2003a,
7642         rather than the (overly optimistic) "previous 3 calendar quarters".
7643
7644         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7645         "T const" to accommodate glibc style.
7646         (check_result): Use less-confusing report format.  "long" -> "long int.
7647         (main): Likewise.
7648         Don't loop if the iteration overflows time_t.
7649         Allow a negative step in the iteration.
7650
7651 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7652
7653         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7654         having it depend on HAVE_SYS_TYPES_H.
7655
7656 2003-06-25  Bruno Haible  <bruno@clisp.org>
7657
7658         * readlink.c: New file.
7659
7660 2003-06-20  Bruno Haible  <bruno@clisp.org>
7661
7662         Assume C89, so PARAMS isn't needed.
7663         * unicodeio.h (PARAMS): Remove.
7664         * unicodeio.c: Don't use PARAMS.
7665
7666 2003-06-18  Jim Meyering  <jim@meyering.net>
7667
7668         Merge changes from coreutils.
7669         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7670         Remove explicit declarations of xmalloc and realloc.
7671         Include xalloc.h.
7672         (read_utmp): Remove anachronistic cast of xmalloc.
7673
7674 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7675
7676         Assume C89, so PARAMS isn't needed.
7677         * backupfile.h (PARAMS): Remove.  All uses removed.
7678         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7679         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7680         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7681         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7682         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7683         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7684         xstrtol.h: Likewise.
7685         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7686         same.h, strverscmp.h: Do not include config.h; no longer needed.
7687         Anyway, config.h should always be included before any other file.
7688
7689 2003-06-11  Simon Josefsson  <jas@extundo.com>
7690
7691         * sysexit_.h: New file.
7692
7693 2003-05-20  Derek Price  <derek@ximbiot.com>
7694
7695         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7696
7697 2003-06-10  Simon Josefsson  <jas@extundo.com>
7698
7699         * strchrnul.h: New file.
7700         * strchrnul.c: New file.
7701
7702 2003-06-10  Simon Josefsson <jas@extundo.com>
7703
7704         * argp.h: New file, from glibc.
7705         * argp-ba.c: New file, from glibc.
7706         * argp-eexst.c: New file, from glibc.
7707         * argp-fmtstream.c: New file, from glibc.
7708         * argp-fmtstream.h: New file, from glibc.
7709         * argp-fs-xinl.c: New file, from glibc.
7710         * argp-help.c: New file, from glibc.
7711         * argp-namefrob.h: New file, from glibc.
7712         * argp-parse.c: New file, from glibc.
7713         * argp-pv.c: New file, from glibc.
7714         * argp-pvh.c: New file, from glibc.
7715         * argp-xinl.c: New file, from glibc.
7716
7717 2003-06-07  Jim Meyering  <jim@meyering.net>
7718
7719         * readtokens.h: Put `Free Software Foundation, Inc.'
7720         in place of my name in the copyright comment.
7721         Remove definition and uses of __P.
7722
7723         From coreutils.
7724         * stat.c: Don't declare xmalloc explicitly.
7725         Instead, include "xalloc.h".
7726         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7727         xrealloc, and xcalloc return values.
7728         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7729         Improve comment.
7730         * xgetcwd.h: Remove definition/uses of PARAMS.
7731
7732 2003-06-06  Jim Meyering  <jim@meyering.net>
7733
7734         * stdbool_.h: Renamed from stdbool.h.in.
7735
7736 2003-06-06  Jim Meyering  <jim@meyering.net>
7737
7738         Merge from coreutils.
7739         * same.c: (same_name): Declare *_basename locals to be `const'.
7740         Consolidate declarations and initializations of *_base* locals.
7741
7742         Merge from coreutils.
7743         This avoids a core dump on systems without GNU putenv,
7744         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7745         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7746         (unsetenv): New static function, from GNU libc.
7747         (rpl_putenv): Use it.
7748
7749         * modechange.c: Remove trailing blanks.
7750
7751         Merge from coreutils.
7752         * fsusage.c: Remove declaration of statfs.
7753         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7754
7755         * posixtm.c: Include <stdbool.h> unconditionally.
7756
7757 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7758
7759         * mktime.c (__mktime_internal): When resolving a tm_isdst
7760         mismatch, look in future quarters as well as past.  This fixes a
7761         bug when processing fall-backwards gaps immediately after a long
7762         period of daylight-saving time.
7763
7764         * mktime.c: Assume freestanding C89 or better.
7765         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7766         (__P): Remove; not used.
7767         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7768         (mktime, not_equal_tm, print_tm, check_result,
7769         main): Use prototypes.  Use const * where appropriate.
7770         (main): Fix typo in testing code that uncovered by above changes.
7771         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7772
7773 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7774
7775         * mktime.c: Fix Debian bug 177940
7776         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7777         (localtime_offset): Now long int, not time_t, because we want it
7778         to be guaranteed to be signed.  All uses changed.
7779         (__mktime_internal): If overflow would occur when adding offset,
7780         don't add it.
7781
7782         Merge 'human' changes from coreutils.  Rewrite to support
7783         locale-specific notations like thousands separators.
7784         * human.c: Simplify authorship notice.
7785         Include human.h immediately after config.h.
7786         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7787         <limits.h>: Do not include, since human.h does.
7788         (SIZE_MAX, UINTMAX_MAX): New macros.
7789         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7790         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7791         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7792         (power_letter): Renamed from suffixes.
7793         (generate_suffix_backwards): Remove.
7794         (adjust_value): Now takes int style (because of human.h changes)
7795         and long double value (for greater precision on some platforms).
7796         (group_number): New function.
7797         (human_readable): Use it.  Use integer options, not enum.
7798         Put the options before the sizes in the arg list.
7799         Support all the new options.
7800         The old human_readable function has been removed;
7801         use inttostr.h instead.
7802         (human_readable, default_block_size, humblock):
7803         Use uintmax_t, not int, for block sizes.
7804         (human_readable_inexact, block_size_types): Remove.
7805         (block_size_opts): New constant.
7806         (human_options): Renamed from human_block_size, with new signature
7807         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7808         * human.h: Add copyright and authorship notice.
7809         Include <limits.h> and <stdbool.h> unconditionally.
7810         (PARAMS): Remove.  All uses removed.
7811         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7812         (enum human_inexact_style): Remove tag; now a nameless enum.
7813         (human_floor, human_ceiling, human_round_to_even): Now have
7814         values 2, 0, 1 rather than -1, 1, 0.
7815         (human_group_digits, human_suppress_point_zero, human_autoscale,
7816         human_base_1024, human_SI, human_B): New constants.
7817         (human_readable_inexact, human_block_size): Remove.
7818         (human_readable): Size args are now uintmax_t, not int.
7819         (human_options): New decl.
7820
7821         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7822         unnecessary now that we assume C89 or better.  This change
7823         imported from coreutils.
7824
7825         * mktime.c (__mktime_internal): Do not reject negative timestamps
7826         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7827         in the 2003-05-30 sync from glibc.
7828
7829         .h files should stand alone, but we shouldn't include <sys/types.h>
7830         if we can get away with just <stddef.h>.
7831
7832         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7833         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7834         rather than <sys/types.h>, as we merely need size_t.
7835         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7836         to get size_t.
7837         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7838         Include <stdio.h>, to get FILE.
7839         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7840         memcasecmp.h has included <stddef.h> and all we need is size_t.
7841         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7842         our interface, instead of including <sys/types.h>
7843
7844 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7845
7846         [from coreutils]
7847         Fix some minor time-related bugs with POSIX time arguments.
7848         Some valid time stamps were being rejected (notably -1, and
7849         time stamps before 1900 on 64-bit hosts).  And some invalid
7850         time stamps were being accepted, e.g. September 31.
7851
7852         * posixtm.h (posixtime): Return bool instead of time_t, so
7853         that we can return (time_t) -1 successfully.
7854         * posixtm.c: Likewise.
7855         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7856         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7857         (t): Remove static var.
7858         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7859         of static var.  All uses changed.
7860         (year): Do not reject years before 1900; they can occur with
7861         64-bit time_t.
7862         (posix_time_parse): Do not check for out-of-range components;
7863         that is now the caller's responsibility, since our checks were
7864         only approximations.
7865         (posixtime): Use mktime to check for out-of-range components,
7866         since it knows them exactly.
7867         If mktime returns (time_t) -1, check whether an error actually occurred
7868         by invoking localtime on -1.
7869         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7870         posixtime failures better.
7871         Improve the test data (in comments only).
7872
7873 2003-05-30    <karl@gnu.org>
7874
7875         * mktime.c: update from libc.
7876
7877 2003-05-30  Bruno Haible  <bruno@clisp.org>
7878
7879         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7880         * localcharset.h: Likewise.
7881         * localcharset.c: Likewise.
7882
7883 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7884
7885         Assume the headers required for C89 freestanding compilers.
7886         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7887         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7888         without checking for HAVE_LIMITS_H.
7889         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7890         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7891         to do that.
7892         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7893         * exclude.c: Include <stdbool.h> unconditionally.
7894         * tempname.c: Include <stddef.h> unconditionally.
7895         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7896         * modechange.c, rpmatch.c (NULL): Don't define, since
7897         <stddef.h> does that.
7898         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7899         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7900         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7901         * xstrtol.c: Likewise.
7902         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7903         * savedir.c: Include <stddef.h> instead of defining NULL.
7904
7905         * addext.c (addext): Use assignment rather than cast, to avoid
7906         warnings on some platforms.
7907
7908         * mktime.c (__mktime_internal): Do not reject negative timestamps
7909         arbitrarily.
7910
7911 2003-05-10  Bruno Haible  <bruno@clisp.org>
7912
7913         * linebreak.c (iconv_string_length): Don't return -1 just because the
7914         string is longer than 4 KB.
7915
7916 2003-05-12  Jim Meyering  <jim@meyering.net>
7917
7918         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7919         the space-padded-by-default conversion specifiers, %e, %k, %l.
7920
7921 2003-05-03  Bruno Haible  <bruno@clisp.org>
7922
7923         Upgrade to Unicode-4.0.
7924         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7925         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7926         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7927         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7928         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7929         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7930         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7931         Change width of U+E0100..U+E01EF from 1 to 0.
7932
7933 2003-04-25  Bruno Haible  <bruno@clisp.org>
7934
7935         * copy-file.c: Include <stddef.h>, for size_t.
7936
7937 2003-04-25  Jim Meyering  <jim@meyering.net>
7938
7939         * copy-file.c (copy_file_preserving): Declare buf_size to be
7940         of type size_t, not int.
7941
7942 2003-04-11  Jim Meyering  <jim@meyering.net>
7943
7944         Merge changes from Coreutils.
7945
7946         2003-03-22  Jim Meyering  <jim@meyering.net>
7947
7948         * strftime.c (widen): Cast alloca return value to proper type.
7949
7950         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7951
7952         From GNU libc.
7953         * strftime.c (my_strftime): Handle very large width
7954         specifications for numeric values correctly.  Improve checks for
7955         overflow.
7956
7957         2003-01-19  Jim Meyering  <jim@meyering.net>
7958
7959         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7960         (nl_get_alt_digit) [! defined my_strftime]: Define.
7961         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7962         _nl_get_alt_digit and _nl_get_walt_digit.
7963
7964         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7965         These changes have no effect outside of _LIBC.
7966
7967 2003-04-10  Bruno Haible  <bruno@clisp.org>
7968
7969         * findprog.h: New file, from GNU gettext.
7970         * findprog.c: New file, from GNU gettext.
7971
7972 2003-04-05  Jim Meyering  <jim@meyering.net>
7973
7974         Merge changes from Coreutils.
7975
7976         * exclude.h (PARAMS): Remove definition and uses.
7977         * exclude.c: Remove uses of `PARAMS'.
7978
7979         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7980         Add test-cases for DOS filenames. Declare program_name.
7981         (main): Set up program_name.  Patch by Rich Dawe.
7982
7983         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7984         error from mntctl.
7985         Use mntctl's return value to drive the entry-processing loop, since
7986         we can't rely on the value of the vmt_length member in the last
7987         entry.  On some systems doing so could result in exhausting
7988         virtual memory.  Based in part on a patch from Mike Jetzer.
7989
7990 2003-04-04  Bruno Haible  <bruno@clisp.org>
7991
7992         * linebreak.h: New file, from GNU gettext.
7993         * linebreak.c: New file, from GNU gettext with slight modifications.
7994         * lbrkprop.h: New file, from GNU gettext.
7995
7996 2003-04-03  Bruno Haible  <bruno@clisp.org>
7997
7998         * utf8-ucs4.h: New file, from GNU gettext.
7999         * utf16-ucs4.h: New file, from GNU gettext.
8000         * ucs4-utf8.h: New file, from GNU gettext.
8001         * ucs4-utf16.h: New file, from GNU gettext.
8002
8003 2003-04-02  Bruno Haible  <bruno@clisp.org>
8004
8005         * binary-io.h: New file, from GNU gettext.
8006
8007 2003-04-01  Bruno Haible  <bruno@clisp.org>
8008
8009         * pathname.h: New file, from GNU gettext.
8010         * concatpath.c: New file, from GNU gettext.
8011
8012 2003-03-30  Bruno Haible  <bruno@clisp.org>
8013
8014         * copy-file.c (copy_file_preserving): Don't set owner if the function
8015         chown() doesn't exist.
8016
8017 2003-03-28  Bruno Haible  <bruno@clisp.org>
8018
8019         * copy-file.h: New file, from GNU gettext.
8020         * copy-file.c: New file, from GNU gettext.
8021
8022 2003-03-18  Jim Meyering  <jim@meyering.net>
8023
8024         * quote.c (quote_n): Fix typo in comment.
8025
8026 2003-03-14  Jim Meyering  <jim@meyering.net>
8027
8028         Merge changes from Coreutils.
8029         * obstack.h (obstack_object_size): Declare temporary, __o,
8030         to be const, in order to avoid warnings.
8031         (obstack_room): Likewise.
8032         (obstack_empty_p): Likewise.
8033
8034 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8035
8036         Merge changes from Bison.
8037         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8038         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8039         when compiling Bison 1.875's `bitset bset = obstack_alloc
8040         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8041         * hash.c: Include <stdbool.h> unconditionally.
8042
8043 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8044
8045         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8046         Reported by Bruce Becker; see:
8047         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8048
8049 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8050             Bruno Haible  <bruno@clisp.org>
8051
8052         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8053         Reported by John Hughes, see
8054         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8055
8056 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8057
8058         * poll_.h: New file.
8059         * poll.c: New file.
8060
8061 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8062
8063         * mathl.h: New file.
8064         * acosl.c: New file.
8065         * asinl.c: New file.
8066         * atanl.c: New file.
8067         * ceill.c: New file.
8068         * cosl.c: New file.
8069         * expl.c: New file.
8070         * floorl.c: New file.
8071         * frexpl.c: New file.
8072         * ldexpl.c: New file.
8073         * logl.c: New file.
8074         * sincosl.c: New file.
8075         * sinl.c: New file.
8076         * sqrtl.c: New file.
8077         * tanl.c: New file.
8078         * trigl.c: New file.
8079         * trigl.h: New file.
8080
8081 2003-02-17  Bruno Haible  <bruno@clisp.org>
8082
8083         * mkdtemp.h: New file, from GNU gettext.
8084         * mkdtemp.c: New file, from GNU gettext.
8085
8086 2003-01-31  Bruno Haible  <bruno@clisp.org>
8087
8088         * rename.c: #undef rename before defining rpl_rename.
8089         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8090
8091 2003-01-30  Bruno Haible  <bruno@clisp.org>
8092
8093         * printf-args.h: New file, from GNU gettext.
8094         * printf-args.c: New file, from GNU gettext.
8095         * printf-parse.h: New file, from GNU gettext.
8096         * printf-parse.c: New file, from GNU gettext.
8097         * vasnprintf.h: New file, from GNU gettext.
8098         * vasnprintf.c: New file, from GNU gettext.
8099         * asnprintf.c: New file, from GNU gettext.
8100         * vasprintf.h: New file, from GNU gettext with modifications.
8101         * vasprintf.c: New file, from GNU gettext.
8102         * asprintf.c: New file, from GNU gettext.
8103
8104 2003-01-29  Bruno Haible  <bruno@clisp.org>
8105
8106         * stpncpy.h: New file, from GNU gettext with modifications.
8107         * stpncpy.c: New file, from GNU gettext with modifications.
8108
8109 2003-01-28  Bruno Haible  <bruno@clisp.org>
8110
8111         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8112         Paul Eggert.
8113         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8114         Paul Eggert.
8115
8116 2003-01-27  Bruno Haible  <bruno@clisp.org>
8117
8118         * xsetenv.h: New file, from GNU gettext.
8119         * xsetenv.c: New file, from GNU gettext.
8120
8121 2003-01-23  Bruno Haible  <bruno@clisp.org>
8122
8123         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8124
8125 2003-01-22  Bruno Haible  <bruno@clisp.org>
8126
8127         * exit.h: New file, from GNU gettext.
8128
8129 2003-01-11  Bruno Haible  <bruno@clisp.org>
8130
8131         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8132         * strcase.h (strcasecmp, strncasecmp): Likewise.
8133
8134 2003-01-14  Jim Meyering  <jim@meyering.net>
8135
8136         * same.c (same_name): Tweak a comment.
8137
8138 2003-01-11  Bruno Haible  <bruno@clisp.org>
8139
8140         * same.c (same_name): Reorder tests so as to avoid calling stat()
8141         when a string comparison is sufficient.
8142
8143 2003-01-11  Bruno Haible  <bruno@clisp.org>
8144
8145         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8146         'unsigned int'.
8147
8148 2003-01-11  Bruno Haible  <bruno@clisp.org>
8149
8150         * hash-pjw.c: Add comment about low quality of this function.
8151
8152 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8153
8154         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8155         to avoid collisions with libcurses and libreadline.
8156
8157         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8158         * getstr.h, getstr.c: Remove.
8159         * getline.c: Include "getline.h", to check interface.
8160         Move body of old getstr.c here: this defines MIN_CHUNK and
8161         declares getdelim2, which is renamed from getstr.
8162         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8163
8164         * linebuffer.c (readlinebuffer): Renamed from readline.
8165         All uses changed.
8166         * linebuffer.h: Likewise.
8167         (readline): Remove backward-compatibility macro.
8168
8169 2003-01-12  Jim Meyering  <jim@meyering.net>
8170
8171         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8172
8173 2003-01-10  Bruno Haible  <bruno@clisp.org>
8174
8175         * alloca_.h: New file.
8176         * getdate.y: Unconditionally include alloca.h.
8177         * makepath.c: Likewise.
8178         * setenv.c: Likewise.
8179         * userspec.c: Likewise.
8180
8181 2003-01-09  Bruno Haible  <bruno@clisp.org>
8182
8183         * stdbool.h.in: New file.
8184
8185 2003-01-08  Bruno Haible  <bruno@clisp.org>
8186
8187         * safe-read.c: Include specification header first, to ensure its
8188         selfcontainedness.
8189         * full-write.c: Likewise.
8190
8191 2003-01-08  Jim Meyering  <jim@meyering.net>
8192
8193         * full-write.c: Undefine and define-away `const' after inclusion
8194         of errno.h, not before.  Suggestion from Bruno Haible.
8195
8196 2003-01-07  Jim Meyering  <jim@meyering.net>
8197
8198         * full-write.c: Rework so that it may serve to define full_read, too.
8199         * full-read.c: Simply #define FULL_READ and include full-write.c.
8200
8201 2003-01-06  Jim Meyering  <jim@meyering.net>
8202
8203         * version-etc.c: Update year in translatable copyright string.
8204
8205 2002-12-25  Bruno Haible  <bruno@clisp.org>
8206
8207         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8208         * xstrtol.h: Likewise.
8209         * xstrtoimax.c: Likewise.
8210         * xstrtoumax.c: Likewise.
8211         * human.h: Likewise.
8212
8213         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8214         on systems that have <inttypes.h> but not <stdint.h>.
8215
8216 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8217
8218         * memcoll.c (memcoll): Fall back on a simple algorithm using
8219         memcmp if strcoll doesn't work.
8220
8221 2002-12-23  Bruno Haible  <bruno@clisp.org>
8222
8223         * localcharset.h: New file.
8224         * localcharset.c: Include it.
8225         * unicodeio.c: Likewise.
8226
8227 2002-12-22  Bruno Haible  <bruno@clisp.org>
8228
8229         * utime.c (utime_null): No need to call ftruncate if the file was
8230         nonempty.
8231
8232 2002-12-23  Bruno Haible  <bruno@clisp.org>
8233
8234         * memcoll.c (STRCOLL): New macro.
8235         (memcoll): Use it.
8236
8237 2002-12-22  Bruno Haible  <bruno@clisp.org>
8238
8239         * getstr.h (getstr): Define, to avoid clash with libcurses.
8240         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8241
8242 2002-12-22  Bruno Haible  <bruno@clisp.org>
8243
8244         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8245
8246 2002-12-23  Bruno Haible  <bruno@clisp.org>
8247
8248         * getline.h: Include <stddef.h>, for size_t.
8249
8250         * unicodeio.h: Include <stddef.h>, for size_t.
8251         * unicodeio.c: Don't include <stddef.h>.
8252
8253 2002-12-17  Bruno Haible  <bruno@clisp.org>
8254
8255         * canon-host.c (strdup): Remove unused declaration.
8256
8257         * fsusage.c: Include full_read.h.
8258         (get_fs_usage): Use full_read instead of safe_read.
8259
8260         * utime.c (utime_null): Use SAFE_READ_ERROR.
8261
8262 2002-12-11  Bruno Haible  <bruno@clisp.org>
8263
8264         * setenv.h: Rewritten to cope with systems that have setenv() but not
8265         unsetenv().
8266         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8267         modifications:
8268
8269         2002-12-11  Bruno Haible  <bruno@clisp.org>
8270
8271                 * setenv.c (alloca): Fall back to malloc.
8272                 (freea): New macro.
8273                 (setenv): Use freea() to free memory allocated with alloca().
8274
8275         2002-11-13  Bruno Haible  <bruno@clisp.org>
8276
8277                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8278                 function declarations.
8279                 * unsetenv.c (unsetenv): Likewise.
8280
8281         2002-03-04  Bruno Haible  <bruno@clisp.org>
8282
8283                 Portability to AIX 4.3.3.
8284                 * unsetenv.c: New file, extracted from setenv.c.
8285                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8286
8287         2001-12-20  Bruno Haible  <bruno@clisp.org>
8288
8289                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8290                 use malloc instead. For SunOS 4.
8291
8292         2001-12-11  Bruno Haible  <bruno@clisp.org>
8293
8294                 * setenv.c: Declare alloca.
8295                 (compar_fn_t): New typedef.
8296                 (KNOWN_VALUE, STORE_VALUE): Use it.
8297
8298         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8299         setenv.h.
8300
8301 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8302
8303         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8304         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8305         Choose values that are less likely to collide with system fnmatch
8306         options.
8307         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8308         defined (e.g., a pure POSIX system).
8309         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8310         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8311
8312 2002-12-06  Jim Meyering  <jim@meyering.net>
8313
8314         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8315
8316         Merge in changes from libc's misc/error.c, in preparation
8317         for the merge of gnulib's changes back into libc.
8318
8319         * error.c (_): Define only if not already defined.
8320         Move definition to follow all #include directives.
8321         Include unlocked-io.h only if !_LIBC.
8322         [_LIBC]: Include <libio/libioP.h>.
8323         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8324         (fflush): Tweak definition to use INTUSE.
8325         (putc): Define.
8326
8327 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8328
8329         * alloca.c [defined emacs]: Include "lisp.h".
8330         (xalloc_die) [defined emacs]: New macro.
8331         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8332         [! defined emacs]: Include <xalloc.h>.
8333         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8334         (pointer): Typedef to POINTER_TYPE *.
8335         (malloc): Remove decl; we now always use xmalloc.
8336         (alloca): Use old-style definition, since Emacs needs this.
8337         Check for arithmetic overflow when computing combined size.
8338
8339 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8340
8341         Do not generate unlocked-io.h automatically, since it's easier to
8342         maintain it by hand.
8343
8344         * unlocked-io.h: New file, from GNU diffutils,
8345         but with proper copyright notice and attribution.
8346         * gen-uio: Remove.
8347         * Makefile.am: Add copyright notice.
8348         (libfetish_a_SOURCES): Add unlocked-io.h.
8349         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8350         (DISTCLEANFILES, io_functions): Remove macros.
8351         (EXTRA_DIST): Remove gen_uio.
8352         (unlocked-io.h): Remove rule.
8353
8354 2002-12-04  Jim Meyering  <jim@meyering.net>
8355
8356         Reflect the fact that stat.c and lstat.c are no longer generated.
8357         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8358         (DISTCLEANFILES): Likewise.
8359         (EXTRA_DIST): Likewise.
8360         (all_local): Don't depend on stat.c or lstat.c.
8361         (stat.c, lstat.c): Remove rules.
8362         (EXTRA_DIST): Remove xstat.in.
8363
8364         * xstat.in: Remove file.  Contents moved into stat.c.
8365         * stat.c: New file.  Contents mostly from xstat.in.
8366         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8367         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8368
8369         * safe-read.c: Rework so that it may serve to define safe_write, too.
8370         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8371
8372 2002-12-03  Jim Meyering  <jim@meyering.net>
8373
8374         * safe-read.c, safe-write.c: Change variable names and comments, but
8375         not semantics, to minimize the differences between these two files.
8376         (safe_read): Change comment to mention SAFE_READ_ERROR.
8377
8378         * safe-read.c (IS_EINTR): Define.
8379         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8380
8381 2002-12-02  Bruno Haible  <bruno@clisp.org>
8382
8383         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8384         Define, taken from safe-read.c.
8385         (INT_MAX): Provide fallback.
8386         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8387         * safe-write.h (SAFE_WRITE_ERROR): Define.
8388
8389         * safe-read.c (EINTR): Remove definition.
8390         (safe_read): Don't use EINTR if it is absent.
8391
8392 2002-12-02  Jim Meyering  <jim@meyering.net>
8393
8394         * safe-read.c (EINTR): Define.
8395         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8396         (INT_MAX): Provide fallback.
8397         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8398
8399         * safe-read.h (SAFE_READ_ERROR): Define.
8400
8401 2002-12-01  Jim Meyering  <jim@meyering.net>
8402
8403         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8404         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8405
8406 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8407
8408         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8409         hash_rehash): Replace `if (limit <= value) abort ();' with
8410         `if (! (value < limit)) abort ();', for readability.
8411
8412 2002-11-26    <karl@gnu.org>
8413
8414         * strdup.c: copy from libc again, with jim's ok.
8415         * .cppi-disable: re-add strdup.c
8416
8417 2002-11-25    <karl@gnu.org>
8418
8419         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8420         instead of "strtol.c".
8421
8422 2002-11-25  Jim Meyering  <jim@meyering.net>
8423
8424         * mktime.c: Sync from libc, now that it has the latest fix.
8425
8426 2002-11-24    <karl@gnu.org>
8427
8428         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8429         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8430
8431 2002-11-24  Jim Meyering  <jim@meyering.net>
8432
8433         Update from coreutils:
8434
8435         * mktime.c: Merge in changes from libc.
8436
8437         Avoid a link-time failure on some Linux systems.
8438         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8439         (__mon_yday): Declare with the STATIC attribute.
8440         (__mktime_internal): Likewise.
8441         Based on a report from Greg Schafer.
8442
8443 2002-11-23  Jim Meyering  <jim@meyering.net>
8444
8445         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8446         Use `unsigned', not `int', as type of index.
8447
8448         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8449
8450         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8451
8452 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8453
8454         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8455         hint that one should use `if (! x) abort ();' rather than `assert
8456         (x);', and anyway it's one less thing to worry about configuring.
8457         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8458         hash_rehash, hash_insert): Use abort rather than assert.
8459
8460 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8461
8462         * quotearg.h: Allow multiple inclusion by surrounding with
8463         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8464         so that we can be included first.
8465         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8466         * quotearg.c: Include quotearg.h immediately after config.h.
8467         No need to include stddef.h or sys/types.h any more.
8468         Surround local include files with "", not "<>".
8469         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8470         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8471         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8472         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8473         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8474         (ISPRINT): Remove; no longer needed now that we assume C89.
8475
8476         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8477         Preserve errno.
8478
8479         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8480         quotearg_char): Use SIZE_MAX rather than
8481         (size_t) -1 when we are talking about "infinity".
8482
8483         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8484
8485 2002-11-22  Bruno Haible  <bruno@clisp.org>
8486
8487         * safe-read.h: Assume C89. Add comments.
8488         (safe_read): Change return type to size_t.
8489         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8490         counts > SSIZE_MAX correctly.
8491         * safe-write.h: New file.
8492         * safe-write.c: New file.
8493         * full-read.h: New file.
8494         * full-read.c: New file.
8495         * full-write.h: Assume C89. Add comments.
8496         * full-write.c: Include safe-write.h.
8497         (full_write): Rewritten to use safe_write.
8498         Suggested by Jim Meyering and Paul Eggert.
8499
8500 2002-11-21  Bruno Haible  <bruno@clisp.org>
8501
8502         Remove case insensitive option matching.
8503         * argmatch.h (argcasematch): Remove declaration.
8504         (ARGCASEMATCH): Remove macro.
8505         (__xargmatch_internal): Remove case_sensitive argument.
8506         (XARGMATCH): Update.
8507         (XARGCASEMATCH): Remove macro.
8508         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8509         case_sensitive argument.
8510         (argcasematch): Remove function.
8511         (__xargmatch_internal): Remove case_sensitive argument.
8512         (main): Use XARGMATCH instead of XARGCASEMATCH.
8513
8514         * xmalloc.c: Change compile-time error message. Add comment about
8515         required autoconf version.
8516
8517 2002-11-21  Jim Meyering  <jim@meyering.net>
8518
8519         * strdup.c (strdup): Tweak comment and initial #if/#include.
8520
8521         Merge in changes from the coreutils.
8522
8523         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8524         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8525         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8526         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8527         int.  Work more efficiently if X is the same width as uintmax_t.
8528         Do not compare X to -1, to avoid bogus compiler warning.
8529         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8530         Don't assume that f_frsize and f_bsize are the same type.
8531
8532         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8533         on FreeBSD.
8534
8535         * makepath.c (make_path): Restore umask *before* creating the final
8536         component.
8537         (make_path): Minor reformatting.
8538
8539         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8540         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8541
8542         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8543         ones.  At least on GNU/Linux systems, `auto' means something else.
8544         From Michael Stone.
8545
8546 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8547
8548         Merge argmatch cleanups from Bison.  Assume C89.
8549
8550         * argmatch.c: Include config.h here, not in argmatch.h.
8551         Include stdlib.h, for EXIT_FAILURE.
8552         Always include <string.h>, since we assume C89.
8553         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8554         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8555         Include <stddef.h> instead, since it's all we need for size_t.
8556         (PARAMS): Remove.  All uses removed.
8557         (ARRAY_CARDINALITY): Do not bother to #undef.
8558         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8559         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8560         Remove unnecessary parentheses.
8561         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8562         Insert necessary parentheses.
8563         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8564         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8565
8566 2002-11-19  Bruno Haible  <bruno@clisp.org>
8567
8568         * mbswidth.c: Include mbswidth.h right at the beginning.
8569         * mbswidth.h: Include <stddef.h>, for size_t.
8570
8571         * mbswidth.h (PARAMS): Remove macro.
8572         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8573         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8574
8575         * gcd.h (PARAMS): Remove macro.
8576         (gcd): Use ANSI C function declarations.
8577         * gcd.c (gcd): Likewise.
8578
8579 2002-11-15  Bruno Haible  <bruno@clisp.org>
8580
8581         * strcspn.c: Include <stddef.h>.
8582         (strcspn): Use ANSI C function declaration. Change return type to
8583         size_t. Use NULL.
8584         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8585         (strpbrk): Use NULL.
8586         * strpbrk.h (PARAMS): Remove macro.
8587         (strpbrk): Use ANSI C function declaration.
8588         * strstr.c: Don't include <sys/types.h>.
8589         * strstr.h (PARAMS): Remove macro.
8590         (strstr): Use ANSI C function declarations.
8591
8592 2002-11-06  Bruno Haible  <bruno@clisp.org>
8593
8594         * gcd.h (gcd): Change argument type to 'unsigned long'.
8595         * gcd.c (gcd): Likewise.
8596
8597 2002-11-05  Bruno Haible  <bruno@clisp.org>
8598
8599         * gcd.h: New file, from gettext-0.11.5.
8600         * gcd.c: New file, from gettext-0.11.5.
8601
8602 2002-11-05  Bruno Haible  <bruno@clisp.org>
8603
8604         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8605         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8606         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8607         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8608
8609         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8610         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8611
8612         * closeout.c: Include gettext.h instead of <libintl.h>.
8613         * human.c: Include gettext.h instead of <libintl.h>.
8614         * quotearg.c: Include gettext.h instead of <libintl.h>.
8615         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8616         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8617         * userspec.c: Include gettext.h instead of <libintl.h>.
8618         * version-etc.c: Include gettext.h instead of <libintl.h>.
8619         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8620         (textdomain): Remove definition.
8621         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8622
8623         * long-options.c: Remove include of <libintl.h> and definition of _.
8624         * same.c: Remove include of <libintl.h> and definition of _.
8625
8626 2002-11-04  Bruno Haible  <bruno@clisp.org>
8627
8628         * stpcpy.h: New file, from GNU gettext-0.11.5.
8629         * strcase.h: New file, from GNU gettext-0.11.5.
8630         * strpbrk.h: New file, from GNU gettext-0.11.5.
8631         * strstr.h: New file, from GNU gettext-0.11.5.
8632         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8633
8634 2002-05-09  Bruno Haible  <bruno@clisp.org>
8635
8636         * config.charset: Update for newest glibc. Add canonical names
8637         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8638
8639 2002-05-09  Bruno Haible  <bruno@clisp.org>
8640
8641         * localcharset.c (get_charset_aliases): Add more Windows specific
8642         aliases.
8643
8644 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8645
8646         * config.charset: A few additions for Solaris.
8647
8648 2001-12-05  Bruno Haible  <bruno@clisp.org>
8649
8650         * localcharset.c (locale_charset): Don't return an empty string.
8651
8652 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8653
8654         * config.charset: msdos in uk_UA uses CP1125.
8655
8656 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8657
8658         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8659         * localcharset.c (locale_charset): Declare as extern "C".
8660
8661 2002-02-15  Bruno Haible  <bruno@clisp.org>
8662
8663         * config.charset [msdosdjgpp]: For Russian, use CP866.
8664
8665 2002-02-11  Bruno Haible  <bruno@clisp.org>
8666
8667         * config.charset: Add support for NetBSD.
8668
8669 2002-09-25    <karl@gnu.org>
8670
8671         * strdup.c: copy from libc/string (via ../config/srclist*).
8672         * getopt*: copy from libc/posix.
8673         * gettext.h: copy from gettext.
8674         * .cppi-disable: add strdup.c, gettext.h.
8675
8676 2002-07-01  Jim Meyering  <meyering@lucent.com>
8677
8678         * c-stack.c: Include sys/time.h.
8679         From Volker Borchert.
8680
8681 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8682
8683         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8684         New macro.  Use it uniformly instead of
8685         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8686         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8687         reported by Vin Shelton.
8688
8689 2002-06-22  Jim Meyering  <meyering@lucent.com>
8690
8691         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8692         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8693
8694 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8695
8696         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8697         Do not assume SA_SIGINFO behavior.
8698         Bug reported by Jim Meyering on NetBSD 1.5.2.
8699
8700 2002-06-22  Jim Meyering  <meyering@lucent.com>
8701
8702         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8703
8704         * exitfail.c, exitfail.h: Likewise.
8705         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8706
8707         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8708         of fnmatch.h.
8709         (EXTRA_DIST): Add fnmatch_loop.c.
8710         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8711
8712         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8713         * fnmatch.c: Update from diffutils-2.8.2.
8714         * fnmatch_.h: New file.  From diffutils-2.8.2.
8715         * fnmatch.h: Remove file.
8716
8717 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8718
8719         * file-type.h: Report an error if neither S_ISREG nor
8720         S_IFREG is defined, instead of using a test specific to glibc
8721         2.2.  This should be safe, since POSIX requires S_ISREG and
8722         Unix Version 7 had S_IFREG.  We don't need to check for
8723         <sys/types.h> since we don't use any symbols that it defines.
8724
8725 2002-06-15  Jim Meyering  <meyering@lucent.com>
8726
8727         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8728         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8729         have been included before this file.
8730
8731 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8732
8733         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8734         so that each temporary file name is unique and valid in the first
8735         8 characters, for operation under DOS.
8736
8737 2002-06-15  Jim Meyering  <meyering@lucent.com>
8738
8739         Work even with DJGPP 2.03, which lacks support for symlinks.
8740         From Richard Dawe.
8741         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8742         is defined.
8743         * lchown.c (S_ISLNK): Likewise.
8744
8745 2002-06-14  Jim Meyering  <meyering@lucent.com>
8746
8747         * file-type.h: Use the version from diffutils-2.8.2.
8748         * file-type.c: Likewise.
8749
8750 2002-05-27  Jim Meyering  <meyering@lucent.com>
8751
8752         Fix a problem seen only on nonconforming systems whereby ls.c's
8753         use of localtime, and then of gettimeofday would cause trouble:
8754         the localtime call used to initialize rpl_gettimeofday's save
8755         mechanism would clobber ls's current local time information so
8756         that in any long listing the first file would always be listed
8757         with date 1970-01-01.  Analysis by Volker Borchert.
8758
8759         * gettimeofday.c (localtime): Undefine.
8760         (rpl_localtime): New function.
8761
8762 2002-05-22  Jim Meyering  <meyering@lucent.com>
8763
8764         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8765         * file-type.h: New file.
8766         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8767
8768 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8769
8770         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8771
8772 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8773
8774         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8775         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8776         of 127, since 64 is the largest conceivable number for ancient
8777         nonstandard hosts.
8778         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8779
8780 2002-04-28  Jim Meyering  <meyering@lucent.com>
8781
8782         * sig2str.c (WTERMSIG): Remove definition (unused).
8783
8784 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8785
8786         * sig2str.h, sig2str.c: New files.
8787         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8788
8789 2002-04-24  Jim Meyering  <meyering@lucent.com>
8790
8791         * gettext.h: New file, from Gettext.
8792         * Makefile.am (INCLUDES): Remove -I../intl.
8793         (libfetish_a_SOURCES): Add gettext.h.
8794
8795 2002-04-16  Jim Meyering  <meyering@lucent.com>
8796
8797         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8798         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8799         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8800
8801 2002-04-12  Jim Meyering  <meyering@lucent.com>
8802
8803         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8804
8805 2002-03-10  Jim Meyering  <meyering@lucent.com>
8806
8807         * makepath.c (make_path): Remove a comma from a diagnostic.
8808         Suggestion from Santiago Vila.
8809
8810 2002-03-08  Jim Meyering  <meyering@lucent.com>
8811
8812         * rename.c: Mention that this wrapper is needed also on
8813         mips-dec-ultrix4.4 systems.
8814
8815 2002-03-02  Jim Meyering  <meyering@lucent.com>
8816
8817         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8818         not HAVE_CLOCK_SETTIME.
8819
8820 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8821
8822         * nanosleep.h: Rename to....
8823         * timespec.h: New name for nanosleep.h.  All uses changed.
8824
8825         * gettime.c: New file.
8826         * settime.c: New file.
8827         * stime.c: Remove.
8828
8829         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8830         timespec.h.  Remove nanosleep.h.
8831
8832 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8833
8834         * acl.c, acl.h: New files.
8835         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8836
8837 2002-02-24  Jim Meyering  <meyering@lucent.com>
8838
8839         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8840         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8841         cause trouble.  Reported by Nelson Beebe.
8842
8843 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8844
8845         * path-concat.c (xpath_concat): Reorder code to pacify
8846         compilers that don't know that xalloc_die never returns.
8847
8848 2002-02-20  Jim Meyering  <meyering@lucent.com>
8849
8850         * getdate.c: Regenerate using bison-1.33.
8851
8852 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8853
8854         * posixver.c, posixver.h: New files.
8855         * Makefile.am (libfetish_a_SOURCES): Add them.
8856
8857 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8858             Bruno Haible  <bruno@clisp.org>
8859
8860         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8861         (fwrite_success_callback): New declaration.
8862         * unicodeio.c (unicode_to_mb): New function, extracted from
8863         print_unicode_char. Call failure callback instead of error.
8864         (fwrite_success_callback): New function.
8865         (exit_failure_callback): New function.
8866         (fallback_failure_callback): New function.
8867         (print_unicode_char): Call unicode_to_mb.
8868
8869 2002-01-26  Jim Meyering  <meyering@lucent.com>
8870
8871         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8872
8873 2002-01-22  Jim Meyering  <meyering@lucent.com>
8874
8875         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8876         Otherwise, some versions of automake would omit the rule that makes
8877         Makefile from Makefile.in.
8878
8879 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8880
8881         * xmemcoll.h, xmemcoll.c: New files.
8882         * Makefile.am (libfetish_a_SOURCES): Add them.
8883         * memcoll.c: Include errno.h, and declare errno if not defined.
8884         (memcoll): Set errno to zero if there is no error.
8885
8886         * quotearg.c (quotearg_buffer_restyled):
8887         Fix bug with quoting buffers containing NUL when backslashing escapes.
8888         This bug was exposed by the other changes in this patch.
8889         (quotearg_n_options): New arg ARGSIZE.
8890         All callers changed.
8891         (quoting_options_from_style): New function.
8892         (quotearg_n_style): Use it.
8893         (quotearg_n_style_mem): New function.
8894
8895         * quotearg.h (quotearg_n_style_mem): New function.
8896
8897 2002-01-16  Jim Meyering  <meyering@lucent.com>
8898
8899         * getdate.y: Add three semicolons, each just before a closing brace.
8900         Bison (as of version 1.31) no longer papers over that mistake.
8901
8902 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8903
8904         * backupfile.c (ISDIGIT): Comment fix.
8905         * getdate.y (ISDIGIT): Likewise.
8906         * posixtm.c (ISDIGIT, year): Likewise.
8907         * strverscmp.c (ISDIGIT): Likewise.
8908         * userspec.c (ISDIGIT): Likewise.
8909
8910 2002-01-05  Jim Meyering  <meyering@lucent.com>
8911
8912         * version-etc.c (version_etc_copyright): Update copyright year.
8913
8914 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8915
8916         * closeout.c (close_stdout_status): If ferror (stdout), do
8917         not silently exit merely because the output buffer happens to
8918         have nothing pending.
8919
8920 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8921
8922         See the big note in ../ChangeLog.
8923         * human.c (suffixes): Prefer K to k for 1024.
8924         (generate_suffix_backwards): New function.
8925         (human_readable_inexact): Use it.
8926         * xstrtol.c (__xstrtol): If there is no number but there
8927         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8928         Accept 'K' as well as 'k'.
8929
8930 2001-12-15  Jim Meyering  <meyering@lucent.com>
8931
8932         * regex.h (__restrict_arr): Update from libc.
8933
8934         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8935         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8936         (STREQ): Define.
8937
8938 2001-12-10  Jim Meyering  <meyering@lucent.com>
8939
8940         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8941         Instead, include "xalloc.h".
8942         (initbuffer): Don't cast xmalloc return value to char*.
8943         (readline): Reword comment.
8944         Don't cast xrealloc return value to char*
8945         Return NULL, not 0.
8946
8947 2001-12-09  Jim Meyering  <meyering@lucent.com>
8948
8949         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8950         `signed and unsigned type in conditional expression'.
8951         * posixtm.c (posix_time_parse): Likewise.
8952
8953         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8954
8955         * readtokens.c (readtoken): Declare an index to be of type unsigned
8956         to avoid a pedantic warning.
8957
8958         * getstr.c: Don't include assert.h.
8959         (getstr): Remove warning-evoking assertions.
8960         Return -1 if offset parameter is out of bounds.
8961         Change the type of a local from int to size_t.
8962
8963         * strftime.c (my_strftime_localtime_r): Include this function
8964         definition in the `#if ! HAVE_TM_GMTOFF' block.
8965
8966         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8967         Include xalloc.h instead.
8968
8969 2001-12-02  Jim Meyering  <meyering@lucent.com>
8970
8971         * tempname.c: Don't declare getenv, thus reverting the change of
8972         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8973         included.
8974
8975         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8976         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8977
8978 2001-11-30  Akim Demaille  <akim@epita.fr>
8979
8980         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8981         before being defined.
8982
8983 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8984
8985         * quotearg.h (quotearg_n, quotearg_n_style):
8986         First arg is int, not unsigned.
8987         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8988         (SIZE_MAX, UINT_MAX): New macros.
8989         (quotearg_n_options): Abort if N is negative.
8990         Avoid overflow check on hosts where size_t is 64 bits and int
8991         is 32 bits, as overflow is impossible there.
8992         Fix off-by-one typo that caused unnecessary reallocation.
8993
8994 2001-11-27  Jim Meyering  <meyering@lucent.com>
8995
8996         * tempname.c: Merge with version from libc.
8997         * regex.c: Likewise.
8998
8999         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9000         for which STDC_HEADERS is 0, it was not included, resulting in a
9001         warning about an integer-to-pointer conversion problem with getenv.
9002         Reported by Volker Borchert.
9003
9004 2001-11-26  Jim Meyering  <meyering@lucent.com>
9005
9006         * gtod.h: Remove file.
9007         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9008         * gettimeofday.c: Don't include gtod.h.
9009         (GTOD_init): Remove function.
9010         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9011         Suggestion from Volker Borchert.
9012
9013 2001-11-23  Jim Meyering  <meyering@lucent.com>
9014
9015         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9016         * hash.c (struct hash_table): Define it here instead.
9017
9018 2001-11-22  Jim Meyering  <meyering@lucent.com>
9019
9020         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9021
9022 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9023
9024         * tempname.c (TMP_MAX): Remove; no longer needed.
9025         (TEMPORARIES): New macro.
9026         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9027         removes an artificial limitation (e.g. HP-UX 10.20, where
9028         TMP_MAX is 17576).
9029
9030 2001-11-18  Jim Meyering  <meyering@lucent.com>
9031
9032         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9033         on SunOS 4.
9034
9035         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9036         files will be created before anything else.
9037
9038 2001-11-17  Jim Meyering  <meyering@lucent.com>
9039
9040         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9041         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9042         rather than group writable.  Patch by Juan F. Codagnone.
9043
9044         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9045         Instead, include "xalloc.h".
9046
9047         * mountlist.c: Include unlocked-io.h after all system headers.
9048         Remove explicit declarations of xmalloc, xrealloc,
9049         and xstrdup.  Instead, include "xalloc.h".
9050
9051         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9052         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9053         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9054
9055         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9056         Reported by Padraig Brady.
9057
9058         * mkstemp.c: #undef mkstemp.
9059         Include config.h.
9060         (rpl_mkstemp): Rename from mkstemp.
9061         Protoize.
9062
9063 2001-11-16  Jim Meyering  <meyering@lucent.com>
9064
9065         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9066         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9067         determine the amount of total physical memory, use pstat_getstatic.
9068         HPUX-11 doesn't define _SC_PHYS_PAGES.
9069         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9070         If sysconf couldn't be used to determine the amount of available
9071         physical memory, use both pstat_getstatic and pstat_getdynamic.
9072         Based on a patch from Bob Proulx.
9073
9074 2001-11-05  Jim Meyering  <meyering@lucent.com>
9075
9076         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9077
9078 2001-11-03  Jim Meyering  <meyering@lucent.com>
9079
9080         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9081         in argmatch_to_argument call.
9082
9083         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9084         argument.
9085
9086         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9087         e.g., a fault due to an attempt to free a NULL pointer.
9088
9089 2001-11-01  Jim Meyering  <meyering@lucent.com>
9090
9091         * dirfd.c, dirfd.h: New files.
9092         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9093
9094         * hash.c (hash_print) [TESTING]: Clean up.
9095
9096 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9097
9098         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9099         to avoid a warning if -Wall.
9100
9101 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9102
9103         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9104
9105 2001-10-21  Jim Meyering  <meyering@lucent.com>
9106
9107         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9108         this code would end up calling gettext even in packages built
9109         with --disable-nls.
9110         * getopt.c (_): Likewise.
9111         * regex.c (_): Likewise.
9112
9113 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9114
9115         * error.c (strerror_r): Do not declare unless !_LIBC.
9116         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9117         Use strerror_r that is only a macro, even if it is not a function.
9118         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9119         (private_strerror): Use prototypes, not old-style function definition.
9120         (print_errno_message): New function.
9121         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9122         char*-flavored one.
9123         (error_tail, error, error_at_line): Use it.
9124
9125 2001-10-11  Jim Meyering  <meyering@lucent.com>
9126
9127         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9128         and quote_n (1, ... to avoid clobbering a buffer.
9129
9130 2001-10-05  Jim Meyering  <meyering@lucent.com>
9131
9132         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9133         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9134         * hash-pjw.h: New file.
9135
9136 2001-09-30  Jim Meyering  <meyering@lucent.com>
9137
9138         * mountlist.c [MOUNTED_GETFSSTAT]:
9139         Include <sys/ucred.h>, for Apple Darwin.
9140         Include sys/mount.h and sys/fs_types.h only if available.
9141         (FS_TYPE): Define.
9142         (read_filesystem_list): Use FS_TYPE.
9143
9144 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9145
9146         * exclude.c (excluded_filename): 0 -> false, since it's
9147         a boolean context.
9148
9149 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9150
9151         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9152         #defines strtoimax.  Also treat the other strto* functions
9153         like strtoimax.
9154
9155         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9156         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9157         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9158
9159 2001-09-26  Jim Meyering  <meyering@lucent.com>
9160
9161         Most macros in unlocked-io.h had the wrong number of arguments.
9162         * gen-uio: New script.
9163         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9164         * unlocked-io.hin: Remove file.
9165         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9166         rather than trying to embed it here.
9167         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9168         Reported by Padraig Brady.
9169
9170 2001-09-25  Volker Borchert  <bt@teknon.de>
9171
9172         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9173
9174 2001-09-23  Jim Meyering  <meyering@lucent.com>
9175
9176         * mountlist.c: Remove useless parentheses in #if directives.
9177         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9178         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9179
9180 2001-09-22  Jim Meyering  <meyering@lucent.com>
9181
9182         * localcharset.c: Update from latest gettext.
9183         * config.charset: Likewise.
9184
9185 2001-09-20  Jim Meyering  <meyering@lucent.com>
9186
9187         * xstrtol.c (strtoimax): Guard declaration with
9188         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9189         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9190         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9191         (strtoumax): Likewise, for completeness (it wasn't necessary).
9192
9193 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9194
9195         * strtoimax.c (HAVE_LONG_LONG):
9196         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9197         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9198         to work around bug in IBM C compiler.
9199
9200 2001-09-16  Jim Meyering  <meyering@lucent.com>
9201
9202         * mkdir.c: New file.
9203
9204 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9205
9206         * xgetcwd.c: Revert some of the previous change; intead,
9207         fix the HAVE_GETCWD_NULL code to behave more like the
9208         !HAVE_GETCWD_NULL code used to.
9209
9210         Include "xalloc.h".
9211         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9212         invoke xalloc_die.
9213
9214 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9215
9216         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9217         Use ssize_t, not int, to store result of readlink.
9218         Check for ssize_t overflow as well as size_t overflow,
9219         as POSIX says the result of readlink is implementation-defined
9220         when ssize_t overflows.
9221         Remove unnecessary cast to char*.
9222         Use free+malloc instead of realloc, as the storage doesn't need
9223         to be preserved and it's clearer and can be more efficient that way.
9224         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9225         * xreadlink.h (xreadlink): Update prototype.
9226
9227 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9228
9229         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9230         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9231         spotted by Jim Meyering.
9232
9233 2001-09-03  Jim Meyering  <meyering@lucent.com>
9234
9235         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9236
9237 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9238
9239         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9240         like the HAVE_GETCWD_NULL code.
9241         Include pathmax.h if not HAVE_GETCWD.
9242         Do not include xalloc.h.
9243         (INITIAL_BUFFER_SIZE): New symbol.
9244         Do not use xmalloc / xrealloc, since the caller is responsible for
9245         handling errors.  Preserve errno around `free' during failure.
9246         Do not overrun buffer when using getwd.
9247
9248 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9249
9250         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9251         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9252
9253 2001-09-02  Jim Meyering  <meyering@lucent.com>
9254
9255         * error.c: Update from GNU libc.
9256
9257 2001-09-01  Jim Meyering  <meyering@lucent.com>
9258
9259         * xreadlink.c: New file.
9260         * xreadlink.h: New file.
9261         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9262
9263         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9264         doesn't conflict with sparc Solaris 7's definition in
9265         /usr/include/sys/int_types.h.
9266
9267         * exclude.c: Use `""', not `<>' to #include non-system header files.
9268         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9269         and strncasecmp as r-values.  Unixware didn't have declarations.
9270
9271 2001-08-31  Jim Meyering  <meyering@lucent.com>
9272
9273         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9274         Use an initial, malloc'd, buffer of length 128 rather than
9275         a statically allocated one of length 1024.
9276
9277 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9278
9279         * xgetcwd.c: Don't include pathmax.h.
9280         Include stdlib.h and unistd.h if available.
9281         Include xalloc.h.
9282         (xmalloc, xstrdup, free): Remove decls.
9283         (xgetcwd): Don't assume sizes fit in unsigned.
9284         Check for overflow when computing sizes.
9285         Simplify reallocation code.
9286
9287 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9288
9289         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9290
9291         * strtoimax.c: Renamed from strtoxmax.c, removing the
9292         old strtoimax.c.
9293
9294         Also, make the following further changes to make this file's
9295         configuration more similar to that of strtol.c:
9296         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9297         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9298         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9299         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9300         changed to signed values.
9301
9302         And make the following changes as well:
9303         Fix copyright notice, as 1999 was missing.
9304         (verify): New macro.
9305         (strtoimax): Check sizes at compile-time, not run-time.
9306         Prefer strtol to strtoll if both work.
9307         (main): Remove; it was not that useful and was a pain to maintain.
9308
9309         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9310
9311 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9312
9313         * savedir.c (savedir): Remove size parameter, as POSIX says that
9314         a directory's st_size can have an arbitrary value, so the old
9315         usage could waste an arbitrary amount of memory.  All uses
9316         changed.
9317         * savedir.h: Update prototype.
9318
9319 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9320
9321         * xstrtol.c (strtoimax): New decl.
9322
9323 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9324
9325         * xstrtol.h: Add copyright notice.
9326         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9327         LONGINT_INVALID_SUFFIX_CHAR.
9328
9329 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9330
9331         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9332         tm to be declared.
9333
9334 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9335
9336         * hash.c: Remove '2001' from copyright notice.
9337
9338 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9339
9340         * full-write.h: New file.
9341         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9342         * full-write.c: Correct credits, as cccp.c no longer
9343         exists and anyway it was so heavily changed from the old cccp
9344         code as to be unrecognizable.  Include full-write.h.
9345         (full_write) Return size_t, with short writes meaning failure.
9346         All callers changed.  This fixes a bug with large buffers
9347         on 64-bit hosts.
9348         * utime.c: Include full-write.h.
9349
9350 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9351
9352         Merge 'exclude' changes from tar 1.13.22.
9353         This fixes one or two unlikely storage allocation overflow bugs,
9354         but doesn't change user-visible behavior otherwise.
9355
9356 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9357
9358         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9359         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9360         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9361         Include if available.
9362         (<xalloc.h>): Include
9363         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9364         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9365         collide with FNM macros.
9366         (struct patopts): New struct.
9367         (struct exclude): Use it, as exclude patterns now come with options.
9368         (new_exclude): Support above changes.
9369         (new_exclude, add_exclude_file):
9370         Initial size must now be a power of two to simplify overflow checking.
9371         (free_exclude, fnmatch_no_wildcards): New function.
9372         (excluded_filename): No longer requires options arg, as the options
9373         are determined by add_exclude.  Now returns bool, not int.
9374         (excluded_filename, add_exclude):
9375         Add support for the fancy new exclusion options.
9376         (add_exclude, add_exclude_file): Now takes int options arg.
9377         Check for arithmetic overflow when computing sizes.
9378         (add_exclude_file): xrealloc might modify errno, so don't
9379         realloc until after errno might be used.
9380
9381         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9382         New macros.
9383         (free_exclude): New decl.
9384         (add_exclude, add_exclude_file): Now takes int options arg.
9385         (excluded_filename): No longer requires options arg, as the options
9386         are determined by add_exclude.  Now returns bool, not int.
9387
9388 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9389
9390         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9391
9392 2001-08-27  Jim Meyering  <meyering@lucent.com>
9393
9394         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9395
9396         * version-etc.c (N_): Remove definition.
9397         Revert most of last change.
9398         Instead, simply don't mark the `Copyright...' string for translation.
9399         Based on advice from Paul Eggert.
9400
9401         * strtoxmax.c: Tweak comment.
9402
9403 2001-08-26  Jim Meyering  <meyering@lucent.com>
9404
9405         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9406         of copyright with `%s' so translators don't get an untranslated
9407         message in 2002.
9408         (COPYRIGHT_YEAR): Define.
9409         (version_etc): Use fprintf rather than fputs.
9410         Suggestion from Ulrich Drepper.
9411
9412         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9413
9414         * strtoll.c: New file, from GNU libc.
9415         * xstrtoimax.c: New file.
9416
9417         * xstrtol.h: Add xstrtoimax.
9418         * strtoumax.c: New file.  Simply include "strtoumax.c".
9419         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9420
9421         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9422         * strtoxmax.c: ... then renamed to this.
9423
9424 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9425
9426         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9427         Port to Solaris 8, where 'sed' requires a space after the 'r'
9428         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9429         Redirect output to $tmp just once.
9430
9431 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9432
9433         * addext.c (<errno.h>): Include.
9434         (errno): Declare if not defined.
9435         (addext): Work correctly when pathconf returns -1 and leaves
9436         errno alone because there is no limit.  Also, work even if
9437         pathconf returns a value greater than SIZE_MAX.
9438
9439 2001-08-12  Jim Meyering  <meyering@lucent.com>
9440
9441         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9442         Simply `return getcwd (NULL, 0);'.
9443         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9444         Use 1300 as initial value for length, not PATH_MAX.
9445
9446         * pathmax.h: Clean up cpp syntax.
9447
9448 2001-08-12  Jim Meyering  <meyering@lucent.com>
9449
9450         * gettimeofday.c: New file.
9451         * gtod.h: New file.
9452         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9453
9454 2001-08-04  Jim Meyering  <meyering@lucent.com>
9455
9456         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9457         to get in sync with glibc.
9458
9459 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9460
9461         The following changes are from gettext 0.10.39 as maintained by
9462         Bruno Haible.
9463
9464         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9465         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9466         with inverted sense.  All uses changed.
9467
9468         * mbswidth.c: Don't include <limits.h>.
9469         Include <stdlib.h> and <string.h> unconditionally.
9470         (iswcntrl, mbsinit, ISCNTRL): New macros.
9471         (mbsnwidth): Use K&R style function declarations.
9472         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9473         can optimize it when MB_CUR_MAX == 1.
9474         The width of control characters is zero, not 1.
9475
9476 2001-07-15  Jim Meyering  <meyering@lucent.com>
9477
9478         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9479         (BUILT_SOURCES): Add unlocked-io.h.
9480         (io_functions): Define.
9481         (unlocked-io.h): New rule.
9482         (DISTCLEANFILES): Add unlocked-io.h.
9483         (all-local): Depend on unlocked-io.h, to ensure it is created.
9484
9485         * unlocked-io.hin: New file
9486
9487         * regex.c: Update from glibc.
9488
9489 2001-07-05  Jim Meyering  <meyering@lucent.com>
9490
9491         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9492         recommendation.
9493         (libfetish_a_SOURCES): Put all .h files here instead.
9494         Remove a thus-exposed (better checks in automake) duplicate and
9495         two unnecessary .h files.
9496
9497 2001-06-11  Jim Meyering  <meyering@lucent.com>
9498
9499         * regex.c: Update from GNU libc.
9500
9501 2001-05-27  Jim Meyering  <meyering@lucent.com>
9502
9503         * readutmp.h (UT_TYPE): Define.
9504
9505 2001-05-24  Jim Meyering  <meyering@lucent.com>
9506
9507         * argmatch.c: Include "quote.h".
9508         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9509         quote function.  Reported by Göran Uddeborg.
9510
9511 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9512
9513         * dirname.c (dir_name): Compute append_dot using path, not newpath
9514         which is not yet declared.
9515
9516 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9517
9518         * Makefile.am (libfetish_a_SOURCES):
9519         Add strftime.c, since we now compile it on all hosts.
9520
9521         * strftime.c (my_strftime):
9522         Define to nstrftime if emacs, but only if my_strftime is not defined.
9523         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9524         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9525         Add one more extra argument: a nanoseconds value.
9526         All uses changed.
9527         (ns): New macro.
9528         (my_strftime function): Add %N format.
9529         (emacs_strftimeu): Renamed from emacs_strftime,
9530         with extra ut argument.
9531
9532 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9533
9534         dirname code cleanup.  base_name now behaves more compatibly
9535         with POSIX basename when given file names that have trailing
9536         slashes, and similarly for dir_name.  Add new primitives
9537         base_len and dir_len.  Put the directory-name-related decls
9538         into dirname.h.
9539
9540         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9541         * backupfile.c (base_name): Likewise.
9542         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9543         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9544         * makepath.c (strip_trailing_slashes): Likewise.
9545         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9546         Likewise.
9547         * rename.c (strip_trailing_slashes): Likewise.
9548         * same.c (base_name): Likewise.
9549         * stripslash.c (ISSLASH): Likewise.
9550
9551         * addext.c: Include <dirname.h> after size_t is defined.
9552         * backupfile.c: Likewise.
9553
9554         * addext.c (addext): Use base_len to trim redundant
9555         trailing slashes instead of doing it ourselves.
9556         But do not trim the last slash if it is not redundant.
9557
9558         * backupfile.c (find_backup_file_name,
9559         max_backup_version): Use base_len instead of rolling it ourselves.
9560         Handle the case of "" and (on DOS) "C:" correctly.
9561
9562         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9563         Include <string.h>, <dirname.h>.
9564         (base_name): Allow file names ending in slashes, other than names
9565         that are all slashes.  In this case, return the basename followed
9566         by the slashes.  This is more general, and can be used in places
9567         where the original base_name purposely had an assertion failure.
9568         (base_len): New function.
9569
9570         * dirname.c: Include <string.h> instead of <stdlib.h>.
9571         Do not include <assert.h>; no longer needed.
9572         Include xalloc.h.
9573         (memrchr): Remove decl.
9574         (dir_name_r): Remove.
9575         (dir_len): Renamed from dirlen.  All callers changed.
9576         Rewrite in terms of base_name, for simplicity and consistency.
9577         (dir_name): Never return NULL.  All callers changed.
9578         Do not include <stdlib.h> in test program; no longer needed.
9579         return 0; is fine for test program.
9580
9581         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9582         New macros.
9583         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9584
9585         * path-concat.c (path_concat): Use base_len to compute
9586         base length, not strlen; this means we cannot rely on memcpy
9587         to null-terminate.
9588
9589         * same.c (STREQ): Remove.
9590         (same_name): Handle the case where the basename ends in trailing '/'.
9591
9592         * stripslash.c (strip_trailing_slashes): Return nonzero if
9593         a slash was stripped.  Do not strip the last slash after a
9594         file system prefix.
9595
9596 2001-04-08  Jim Meyering  <meyering@lucent.com>
9597
9598         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9599         recomputed; that's necessary when the offset spans a DST transition.
9600         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9601
9602 2001-04-02  Jim Meyering  <meyering@lucent.com>
9603
9604         * regex.h, regex.c: Update from GNU libc.
9605
9606 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9607
9608         * version-etc.c (version_etc_copyright): Update to 2001.
9609
9610 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9611
9612         * tempname.c (uint64_t): Define to uintmax_t if
9613         not defined, and if UINT64_MAX is not defined.
9614         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9615         Reported by John David Anglin.
9616
9617 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9618
9619         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9620         alias if codeset is empty.
9621         * config.charset (BeOS): Use wildcard syntax.
9622
9623 2001-03-13  Jim Meyering  <meyering@lucent.com>
9624
9625         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9626         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9627         From Bruno Haible.
9628
9629 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9630
9631         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9632         Don't return NULL.
9633         * unicodeio.c (print_unicode_char): Simplify accordingly.
9634
9635 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9636
9637         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9638         support for DOS/DJGPP.
9639
9640 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9641
9642         * Makefile.am (libfetish_a_SOURCES):
9643         Add dup-safer.c, fopen-safer.c.
9644         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9645
9646         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9647
9648 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9649
9650         The mkstemp replacement is taken from glibc 2.2.2, with some
9651         portability fixes for use outside glibc, as follows:
9652
9653         * tempname.c (struct_stat64): New macro.
9654         (direxists, __gen_tempname): Use it.
9655         This avoids a portability problem with Solaris 8.
9656
9657         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9658         (<stddef.h>, <stdint.h>, <string.h>):
9659         Include only if STDC_HEADERS || _LIBC.
9660         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9661         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9662         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9663         (__set_errno): Define this macro if <errno.h> doesn't.
9664         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9665         Define these macros if <stdio.h> doesn't.
9666         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9667         Define these macros if <sys/stat.h>
9668         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9669         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9670         __xstat64): Define if not _LIBC.
9671         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9672         (__gen_tempname): Invoke gettimeofday only if
9673         HAVE_GETTIMEOFDAY || _LIBC;
9674         otherwise, fall back on plain "time".
9675         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9676
9677         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9678
9679         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9680
9681 2001-02-17  Jim Meyering  <meyering@lucent.com>
9682
9683         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9684         around included file name.
9685
9686         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9687
9688         * strftime.c: Update from GNU libc (the only changes were to comments).
9689
9690 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9691
9692         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9693
9694 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9695
9696         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9697         Remove workaround macros for hosts that have mbrtowc but not
9698         mbstate_t, as we now insist on proper declarations for both
9699         before using mbrtowc.
9700
9701 2001-02-17  Jim Meyering  <meyering@lucent.com>
9702
9703         * regex.c: Update from libc.
9704
9705 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9706
9707         * alloca.c (malloc): Undef before defining, since stdlib.h
9708         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9709         Reported by Mark Hounschell via Paul Eggert.
9710
9711 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9712
9713         * config.charset: Update for FreeBSD 4.2.
9714
9715 2001-01-26  Jim Meyering  <meyering@lucent.com>
9716
9717         * quotearg.c: Include stddef.h.
9718         * quote.c: Include stddef.h.
9719         Reported by Axel Kittenberger.
9720
9721         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9722         line in double quotes so that it evokes a better diagnostic.
9723         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9724         Reported by Axel Kittenberger.
9725
9726 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9727
9728         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9729         to avoid a warning.  Add back 'const' to inptr.
9730
9731 2001-01-16  Jim Meyering  <meyering@lucent.com>
9732
9733         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9734         From Bruno Haible.
9735
9736 2001-01-14  Jim Meyering  <meyering@lucent.com>
9737
9738         * rename.c: New file.  From Volker Borchert.
9739         Include stdlib.h, string.h or strings.h, and xalloc.h.
9740         Use strip_trailing_slashes rather than open-coding it.
9741
9742 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9743
9744         * strftime.c: Sync with glibc time/strftime.c 1.81.
9745
9746 2001-01-03  Jim Meyering  <meyering@lucent.com>
9747
9748         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9749         local `inptr' to avoid warning with some system declarations of iconv.
9750
9751 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9752
9753         * modechange.c: Do not assume that mode_t uses the
9754         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9755         the other-execute bit of FOO even if S_IXOTH != 1.
9756
9757         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9758         WOTH, XOTH, ALLM): New macros.
9759         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9760          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9761         Use them.
9762         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9763         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9764         (mode_compile):
9765         No need to use uintmax_t; unsigned long is long enough.
9766         Don't bother to get suffix since we don't use it.
9767
9768 2000-12-24  Jim Meyering  <meyering@lucent.com>
9769
9770         * hash.c (is_prime): Return explicit boolean values.
9771         (hash_get_first): Return NULL to appease Irix5.6's 89.
9772         Reported by Nelson Beebe.
9773
9774 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9775
9776         * localcharset.c (locale_charset): Add support for Win32.
9777
9778 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9779
9780         * physmem.h, physmem.c: New files.
9781
9782         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9783         (noinst_HEADERS): Add physmem.h.
9784
9785         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9786         't' for compatibility with Solaris 8 sort.
9787
9788 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9789
9790         * config.charset: Add support for BeOS.
9791
9792 2000-12-16  Jim Meyering  <meyering@lucent.com>
9793
9794         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9795         SHELLS_FILE to a file name that's useful on djgpp systems.
9796         Include stdlib.h.
9797         (ADDITIONAL_DEFAULT_SHELLS): Define.
9798         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9799         Based mostly on a patch from Prashant TR.
9800
9801 2000-12-16  Jim Meyering  <meyering@lucent.com>
9802
9803         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9804         N and M) would have treated it like `chown N:N FILE'.
9805
9806         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9807
9808 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9809
9810         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9811         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9812         to the list of canonical encodings. Rename EUC-CN to GB2312.
9813
9814 2000-12-08  Andreas Schwab  <schwab@suse.de>
9815
9816         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9817         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9818
9819 2000-12-07  Jim Meyering  <meyering@lucent.com>
9820
9821         * stripslash.c (ISSLASH): Define.
9822         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9823         From Prashant TR.
9824
9825         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9826         (dir_name_r): Declare this function as static.
9827         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9828         manifest itself on a name containing a mix of slashes and
9829         backslashes.
9830         Make this function work with names starting with a DOS-style
9831         drive letter and colon prefix.
9832         (dir_name): Append `.' if necessary.
9833         Based mostly on patches from Prashant TR and Eli Zaretskii.
9834
9835         * dirname.h (dir_name_r): Remove prototype.
9836
9837 2000-12-05  Jim Meyering  <meyering@lucent.com>
9838
9839         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9840
9841 2000-12-04  Jim Meyering  <meyering@lucent.com>
9842
9843         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9844         Also include memory.h, stdlib.h, unistd.h if appropriate.
9845         Reported by Andreas Jaeger (conflicting declaration of malloc).
9846
9847 2000-12-02  Jim Meyering  <meyering@lucent.com>
9848
9849         * closeout.h: Make idempotent, to avoid some obscure warnings.
9850
9851 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9852
9853         * memrchr.c: Include <config.h> before any system include file.
9854
9855 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9856
9857         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9858
9859 2000-11-26  Jim Meyering  <meyering@lucent.com>
9860
9861         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9862
9863 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9864
9865         * strftime.c (my_strftime): Do not invoke mbrlen with a
9866         size of (size_t) -1; it's not portable.
9867
9868 2000-11-17  Akim Demaille  <akim@epita.fr>
9869
9870         * obstack.h: Formatting changes.
9871         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9872         prevent type checking.
9873         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9874         cast the value to (void *): assigning a `foo *' to a `void *'
9875         variable is valid.
9876         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9877
9878 2000-11-17  Jim Meyering  <meyering@lucent.com>
9879
9880         * strstr.c: Update from GNU libc.
9881
9882 2000-11-16  Jim Meyering  <meyering@lucent.com>
9883
9884         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9885
9886 2000-11-11  Jim Meyering  <meyering@lucent.com>
9887
9888         * error.c: Add a couple #includes, merging from GNU libc version.
9889
9890 2000-11-10  Jim Meyering  <meyering@lucent.com>
9891
9892         * obstack.h: Update from GNU libc.
9893         * obstack.c: Likewise.
9894
9895 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9896
9897         * getusershell.c (setusershell): Use rewind rather than
9898         fseek/fseeko, to avoid configuration hassles with fseeko.
9899         Don't bother opening SHELLS_FILE if shellstream is NULL;
9900         it's not necessary.
9901
9902 2000-11-05  Jim Meyering  <meyering@lucent.com>
9903
9904         * makepath.h (make_dir): Declare.
9905         * makepath.c (make_dir): Remove `static' attribute.
9906         Tweak a comment.
9907
9908 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9909
9910         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9911         last one in a bucket, advance to the next bucket.
9912
9913 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9914
9915         * fnmatch.c: Do not comment out all the code if we are using
9916         the GNU C library, because in some cases we are replacing buggy
9917         code in the GNU C library itself.
9918
9919 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9920
9921         * error.h, getline.h, modechange.h:
9922         Remove "2000" from Copyright line, as the file hasn't been
9923         changed this year other than in the copyright notice.
9924
9925         * xalloc.h: Add "2000" to Copyright line, as this file
9926         was changed this year.
9927
9928 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9929
9930         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9931         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9932         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9933
9934 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9935
9936         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9937         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9938         doesn't define __restrict_arr.
9939
9940 2000-10-29  Jim Meyering  <meyering@lucent.com>
9941
9942         * xstat.in: Fix grammar in comment.
9943
9944 2000-10-28  Jim Meyering  <meyering@lucent.com>
9945
9946         * memchr.c: Update from libc.
9947         Adjust for portability:
9948         [HAVE_STDLIB_H]: Include stdlib.h.
9949         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9950         Undef __memchr, too.
9951         [!weak_alias]: Define __memchr to memchr.
9952
9953         * regex.c: Update from libc.
9954         * regex.h: Likewise.
9955         * getopt1.c: Likewise.
9956         * memcmp.c: Likewise.
9957
9958         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9959         Avoid using fseek, when possible -- it's broken by design.
9960         Patch by Ulrich Drepper.
9961
9962 2000-10-26  Jim Meyering  <meyering@lucent.com>
9963
9964         * strftime.c: Update from libc.
9965
9966 2000-10-25  Jim Meyering  <meyering@lucent.com>
9967
9968         * obstack.c: Update from libc.
9969
9970 2000-10-23  Jim Meyering  <meyering@lucent.com>
9971
9972         * hard-locale.c (hard_locale): Revert last change -- it was simply
9973         wrong.  That set_locale call must not have any side effects.
9974         From Paul Eggert.
9975
9976 2000-10-22  Jim Meyering  <meyering@lucent.com>
9977
9978         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9979         [CYCLIC]: Remove now-unused definition.
9980
9981         * save-cwd.c (O_DIRECTORY): Define, if needed.
9982         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9983         Suggestion from Ulrich Drepper.
9984
9985 2000-10-21  Jim Meyering  <meyering@lucent.com>
9986
9987         * dirname.c (dir_name_r): New function, factored out of dir_name.
9988         (dir_name): Use dir_name_r.
9989         * dirname.h (dir_name_r): Declare it.
9990
9991 2000-10-21  Jim Meyering  <meyering@lucent.com>
9992
9993         * dirname.c (memrchr): Declare if necessary.
9994         (dir_name): Remove the restriction that there be no
9995         trailing slashes.  Now, this code skips past them, effectively
9996         ignoring them.
9997         [TEST_DIRNAME] (main): New unit tests.
9998
9999         * memrchr.c: New file from GNU libc.
10000         Undef __memrchr, too.
10001         [!weak_alias]: Define __memrchr to memrchr.
10002         Guard weak_alias use with `#ifdef weak_alias'.
10003
10004 2000-10-17  Jim Meyering  <meyering@lucent.com>
10005
10006         * quote.h (PARAMS): Define and use.
10007         Reported by Akim Demaille.
10008
10009         * getopt.c: Update from libc.
10010
10011 2000-10-16  Jim Meyering  <meyering@lucent.com>
10012
10013         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10014         From Jan Fedak.
10015
10016 2000-09-25  Jim Meyering  <meyering@lucent.com>
10017
10018         * md5.h (rol): Define (from GnuPG).
10019
10020         * sha.c: Give credit (GnuPG) where due.
10021         (M): Use rol rather than open-coding it.
10022         Add a FIXME comment.
10023
10024 2000-09-21  Jim Meyering  <meyering@lucent.com>
10025
10026         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10027         Reported by Michael Stone.
10028
10029 2000-09-20  Jim Meyering  <meyering@lucent.com>
10030
10031         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10032         (noinst_HEADERS): Add sha.h.
10033         Based on code from Scott G. Miller and from GnuPG.
10034
10035 2000-09-15  Jim Meyering  <meyering@lucent.com>
10036
10037         * regex.c: Update from libc.
10038
10039 2000-09-10  Jim Meyering  <meyering@lucent.com>
10040
10041         * getopt.c (_getopt_internal): Update from glibc.
10042
10043 2000-09-09  Jim Meyering  <meyering@lucent.com>
10044
10045         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10046         think it should be used as a general replacement for isascii.
10047         * fnmatch.c: Likewise.
10048         * mbswidth.c: Likewise
10049         * regex.c: Likewise.
10050
10051         Don't use atoi.
10052         * userspec.c: Include sys/param.h and limits.h.
10053         Include xstrtol.h.
10054         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10055         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10056         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10057         UID, GID.  Check range.
10058
10059 2000-09-06  Jim Meyering  <meyering@lucent.com>
10060
10061         * getopt.c (_getopt_internal): Update from glibc.
10062
10063 2000-08-30  Jim Meyering  <meyering@lucent.com>
10064
10065         * strftime.c: Merge in changes from GNU libc.
10066
10067 2000-08-26  Jim Meyering  <meyering@lucent.com>
10068
10069         * closeout.c: Include "__fpending.h".
10070         (close_stdout_status): Return right away if there's nothing to flush.
10071
10072         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10073         * __fpending.c: New file.
10074         * __fpending.h: New file.
10075
10076 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10077
10078         Standardize on "memory exhausted" instead of "Memory exhausted"
10079         or "virtual memory exhausted".
10080         * obstack.c (print_and_abort): Use "memory exhausted", not
10081         "virtual memory exhausted".
10082         * same.c (same_name): Invoke xalloc_die instead of printing
10083         our own message.
10084         * userspec.c (parse_user_spec): Likewise.
10085         * bumpalloc.h: comment fix
10086         * same.c, userspec.c: Include xalloc.h.
10087
10088         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10089         not char *const and pointing to a constant array.
10090         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10091         (xrealloc): Comment fix.
10092
10093         * userspec.c (parse_user_spec):
10094         Don't translate a message until just before returning,
10095         to avoid unnecessary translation.
10096
10097 2000-08-07  Jim Meyering  <meyering@lucent.com>
10098
10099         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10100         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10101         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10102         getgroups.c, gethostname.c, getopt.h, group-member.c,
10103         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10104         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10105         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10106         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10107         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10108         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10109         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10110         yesno.c: Back out Copyright date changes for each file with no change
10111         this year.  This eases coordination with other programs using the same
10112         source code modules.  From Paul Eggert.
10113
10114 2000-08-03  Greg McGary  <greg@mcgary.org>
10115
10116         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10117         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10118         (EXTEND_BUFFER): Use them.
10119
10120 2000-08-01  Jim Meyering  <meyering@lucent.com>
10121
10122         * dirname.c (ISSLASH): Define.
10123         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10124         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10125         both `\' and `/' may be use as path separators.
10126         Based on a patch from Prashant TR.
10127
10128 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10129
10130         * quotearg.c (quotearg_n_options): Don't make the initial
10131         slot vector a constant, since it might get modified.
10132
10133 2000-07-31  Jim Meyering  <meyering@lucent.com>
10134
10135         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10136         * obstack.c (print_and_abort): Likewise.
10137
10138 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10139
10140         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10141         buffer, so that the caller can always quote one small
10142         component of a "memory exhausted" message in slot 0.
10143         From a suggestion by Jim Meyering.
10144
10145 2000-07-30  Jim Meyering  <meyering@lucent.com>
10146
10147         * makepath.c (make_path): Quote the other instance, too.
10148
10149         * quotearg.c (N_STATIC_SLOTVECS): Define.
10150         (STATIC_BUF_SIZE): Define.
10151         (quotearg_n_options): Use only statically allocated storage when
10152         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10153         than STATIC_BUF_SIZE.
10154
10155 2000-07-29  Jim Meyering  <meyering@lucent.com>
10156
10157         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10158         * dirname.c (dir_name): Likewise.
10159
10160         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10161
10162         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10163         (dir_name): Assert that there are no trailing slashes.
10164
10165 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10166
10167         * mbswidth.h (mbswidth): Add a flags argument.
10168         (mbswidth): New declaration.
10169         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10170         * mbswidth.c (mbswidth): Add a flags argument.
10171         (mbsnwidth): New function.
10172
10173 2000-07-24  Jim Meyering  <meyering@lucent.com>
10174
10175         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10176
10177 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10178
10179         * mbswidth.c (_XOPEN_SOURCE):
10180         Don't define; this causes problems on Solaris 7.
10181         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10182
10183 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10184
10185         * quotearg.c:
10186         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10187         so that mbstate_t is always defined.
10188
10189         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10190         be 1 in at least one GCC installation, and this configuration
10191         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10192         performance on hosts that have mbrtowc but have only unibyte
10193         locales, but I assume these hosts are rare.
10194
10195 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10196
10197         * quotearg.c: Streamline by invoking multibyte code only if needed.
10198         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10199         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10200         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10201         invoke multibyte primitives.
10202
10203 2000-07-23  Jim Meyering  <meyering@lucent.com>
10204
10205         * basename.c (base_name): Add an assertion.
10206
10207 2000-07-15  Bruno Haible  <clisp.cons.org>
10208
10209         * quotearg.c: When the system forces us to redefine mbstate_t,
10210         shadow its mbsinit function.
10211
10212 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10213
10214         * mbswidth.h: New file.
10215         * mbswidth.c: New file.
10216         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10217         (noinst_HEADERS): Add mbswidth.h.
10218
10219 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10220
10221         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10222         and IRIX 6.
10223
10224 2000-07-15  Jim Meyering  <meyering@lucent.com>
10225
10226         * makepath.c: Include quote.h.
10227         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10228         corresponding argument in a `quote (...)' call.
10229         Give better diagnostics.
10230
10231         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10232         (noinst_HEADERS): Add quote.h.
10233
10234         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10235         from tar's src/misc.c.
10236         * quote.h: New file.  Prototypes for same.
10237
10238 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10239
10240         From a suggestion by Bruno Haible.
10241         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10242         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10243         to decide whether to define the BeOS workaround macro;
10244         this adjusts to the change to AC_MBSTATE_T.
10245
10246 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10247
10248         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10249
10250         * quotearg.c (quoting_style_args, quoting_style_vals,
10251         quotearg_buffer_restyled): Add support for
10252         clocale_quoting_style.  Undo previous change to
10253         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10254         and "{RIGHT QUOTATION MARK}" msgids.
10255
10256 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10257
10258         The old behavior of quoting `like this' doesn't look good with
10259         newer, ISO-style fonts.  See:
10260         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10261
10262         Instead, quote "like this" by default.  Let the translator
10263         tailor the locale-specific quoting behavior by providing
10264         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10265
10266         * quotearg.c (N_): New macro.
10267         (gettext_default): New function.
10268         (quotearg_buffer_restyled): Use
10269         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10270         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10271
10272 2000-07-09  Jim Meyering  <meyering@lucent.com>
10273
10274         * Most files: Update copyright dates to include 2000.
10275
10276 2000-07-08  Jim Meyering  <meyering@lucent.com>
10277
10278         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10279         if not defined.
10280         (xgethostname): Remove now-unnecessary #ifdef.
10281         Move declaration of `err' into loop where it's used.
10282
10283 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10284
10285         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10286         by allocating a larger buffer. Test the gethostname return value for
10287         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10288         returns an error and ENAMETOOLONG isn't defined.
10289
10290 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10291         and Bruno Haible  <haible@clisp.cons.org>
10292
10293         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10294
10295 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10296
10297         * quotearg.c (struct quoting_options): Simplify quote_these_too
10298         dimension.
10299
10300 2000-07-03  Jim Meyering  <meyering@lucent.com>
10301
10302         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10303         Reported by Bruno Haible.
10304
10305 2000-07-04  Jim Meyering  <meyering@lucent.com>
10306
10307         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10308         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10309         lacks mbrtowc.
10310
10311 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10312         and Bruno Haible  <haible@clisp.cons.org>
10313
10314         * quotearg.c (mbrtowc):
10315         Assign to *pwc, and return 1 only if result is nonzero.
10316         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10317
10318 2000-07-03  Jim Meyering  <meyering@lucent.com>
10319
10320         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10321         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10322         From Bob Proulx.
10323
10324 2000-07-02  Jim Meyering  <meyering@lucent.com>
10325
10326         * quotearg.c (mbstate_t): Don't define here.
10327
10328 2000-07-02  Jim Meyering  <meyering@lucent.com>
10329
10330         * nanosleep.c (SIGCONT): Define if not already defined.
10331
10332 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10333
10334         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10335         per change in ../m4/ls-mntd-fs.m4.
10336         (read_filesystem_list): Ignore symbolic links.
10337
10338 2000-06-29  Jim Meyering  <meyering@lucent.com>
10339
10340         * same.c: Include <string.h> or <strings.h>, as appropriate,
10341         for declaration of strcmp.
10342
10343         * long-options.c: Include <stdlib.h>, for declaration of exit.
10344
10345         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10346         Avoid warning by casting result to `char *' to remove `const'.
10347
10348 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10349
10350         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10351
10352 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10353
10354         savedir now sets errno on failure and invokes xmalloc to get memory.
10355         Fix a couple of other minor bugs while we're at it.
10356
10357         * savedir.c (<unistd.h>): Do not include; there's no need.
10358         (NAMLEN): Remove macro.
10359         (malloc, realloc): Remove decls.
10360         (stpcpy): Likewise.
10361         ("xalloc.h"): Include.
10362         (NAME_SIZE_DEFAULT): New macro.
10363         (savedir): Use xmalloc / xrealloc to allocate memory.
10364         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10365         Skip "" directory entries.
10366         Use strlen to calculate directory entry length, since the old method
10367         is rarely used these days and isn't worth supporting.
10368         Don't use a pointer after freeing it.
10369         Check for integer overflow when calculating allocation size.
10370         Use memcpy to copy entries, instead of stpcpy.
10371         Set errno properly when returning NULL.
10372         Check for readdir error.
10373
10374 2000-06-26  Jim Meyering  <meyering@lucent.com>
10375
10376         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10377
10378 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10379
10380         * getusershell.c (xmalloc, xrealloc): Remove functions.
10381         Include xalloc.h.
10382         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10383
10384 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10385
10386         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10387
10388 2000-06-24  Jim Meyering  <meyering@lucent.com>
10389
10390         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10391
10392 2000-06-21  Jim Meyering  <meyering@lucent.com>
10393
10394         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10395
10396 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10397
10398         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10399         (mbrtowc, mbstate_t): Define substitutes if
10400         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10401         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10402         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10403
10404 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10405
10406         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10407         than 1024, return a memory chunk of least possible size, instead
10408         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10409         Use free/xmalloc instead of xrealloc to avoid copying for very long
10410         paths.
10411
10412 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10413
10414         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10415         address, not strdup.  Include <stdlib.h> and don't declare free().
10416
10417 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10418
10419         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10420         the empty string.
10421
10422 2000-06-21  Jim Meyering  <meyering@lucent.com>
10423
10424         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10425         (noinst_HEADERS): Add getstr.h.
10426
10427         * getline.c (getstr): Move into a separate file.
10428         * getstr.c (getstr): New file, extracted from getline.c, with
10429         the following changes: new parameter, delim2; both delim[12]
10430         parameters have type `int', not `char'.  The latter would lose
10431         with 8-bit delimiters.
10432         * getstr.h: New file.
10433
10434 2000-06-19  Jim Meyering  <meyering@lucent.com>
10435
10436         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10437
10438 2000-06-18  Jim Meyering  <meyering@lucent.com>
10439
10440         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10441         Besides, these days every porting target provides a mkdir function.
10442
10443         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10444         (this snippet comes from src/system.h).
10445
10446 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10447
10448         * human.c (adjust_value): New function.
10449         (human_readable_inexact): Apply rounding style even when
10450         printing approximate values.
10451
10452 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10453
10454         * human.c (human_readable_inexact): Allow an input block
10455         size that is not a multiple of the output block size, and vice versa.
10456         Reported by Piergiorgio Sartor.
10457
10458 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10459
10460         * getdate.y (get_date): Apply relative times after time
10461         zone indicator, not before.  Reported by Todd A. Jacobs.
10462
10463 2000-06-13  Jim Meyering  <meyering@lucent.com>
10464
10465         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10466
10467         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10468
10469 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10470
10471         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10472
10473 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10474
10475         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10476
10477 2000-06-04  Jim Meyering  <meyering@lucent.com>
10478
10479         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10480         SunOS 4.1.4 for which gid_t is an unsigned type.
10481
10482 2000-06-03  Jim Meyering  <meyering@lucent.com>
10483
10484         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10485
10486 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10487
10488         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10489         newer, don't install charset.alias.
10490         * config.charset: Change the Linux/glibc rules so they become empty
10491         on glibc-2.1 or newer.
10492
10493 2000-06-02  Jim Meyering  <meyering@lucent.com>
10494
10495         * mountlist.c: Back out last change.  Instead, do this...
10496         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10497         member using the same `ignore'-testing code.
10498         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10499         fs_type strings.
10500         From Mark D. Roth.
10501
10502 2000-05-29  Jim Meyering  <meyering@lucent.com>
10503
10504         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10505         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10506
10507 2000-05-22  Jim Meyering  <meyering@lucent.com>
10508
10509         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10510
10511 2000-05-18  Jim Meyering  <meyering@lucent.com>
10512
10513         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10514         back, too, since it may have been modified by allocate_entry.
10515         (hash_delete): Rewrite to use neither the assignment operator
10516         nor the comma operator in an if-expression.
10517
10518 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10519
10520         * closeout.c:
10521         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10522         Remove; no longer needed.
10523         "quotearg.h": Add include.
10524         (file_name): Do not bother to explicitly initialize to NULL; it's less
10525         efficient on some hosts.
10526         (close_stdout_status): Remove test as to whether stdout was already
10527         closed; it breaks for the case "echo x | sort >&-".
10528         Quote file name colons.
10529         Do not assume that _("write error") lacks format strings.
10530
10531 2000-05-15  Jim Meyering  <meyering@lucent.com>
10532
10533         * version-etc.c (version_etc_copyright): Update the copyright string
10534         used in all --version output.
10535
10536 2000-05-14  Jim Meyering  <meyering@lucent.com>
10537
10538         * closeout.c (close_stdout_set_file_name): New function.
10539         (close_stdout_status): Use new file-scoped global.
10540         Return right away if fstat says the stdout file descriptor is invalid.
10541         * closeout.h (close_stdout_set_file_name): Declare.
10542
10543 2000-05-10  Jim Meyering  <meyering@lucent.com>
10544
10545         * closeout.c [default_exit_status]: New file-scoped variable.
10546         (close_stdout_set_status): New function.
10547         * closeout.h (close_stdout_set_status): Declare.
10548
10549 2000-05-08  Jim Meyering  <meyering@lucent.com>
10550
10551         * long-options.c: Don't include closeout.h.
10552         (parse_long_options): Don't call close_stdout for --version.
10553
10554 2000-05-06  Jim Meyering  <meyering@lucent.com>
10555
10556         * strnlen.c: Undefine __strnlen and strnlen.
10557         [!weak_alias]: Define __strnlen to strnlen.
10558
10559         * atexit.c: New file, from libiberty.
10560
10561 2000-05-06  Jim Meyering  <meyering@lucent.com>
10562
10563         * closeout.c (close_stdout_status): Also check for errors on the
10564         stderr stream.
10565
10566 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10567
10568         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10569         instead of xmalloc, xrealloc, path_concat.
10570         (locale_charset): Treat empty environment variables as absent.
10571         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10572
10573 2000-05-04  Jim Meyering  <meyering@lucent.com>
10574
10575         * getopt.c: Update from glibc.
10576         * obstack.c: Likewise.
10577         * obstack.h: Likewise.
10578         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10579
10580         * regex.h: Likewise.
10581         * strndup.c: Likewise.
10582         * strnlen.c: New file, from glibc.
10583
10584 2000-05-01  Jim Meyering  <meyering@lucent.com>
10585
10586         * full-write.c (full_write): Remove `FIXME' part of comment.
10587
10588 2000-04-29  Jim Meyering  <meyering@lucent.com>
10589
10590         * path-concat.c: Declare strdup only if it's not defined.
10591         * canon-host.c: Likewise.
10592
10593 2000-04-28  Jim Meyering  <meyering@lucent.com>
10594
10595         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10596         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10597         included first, then limits.h is included by locale.h by libintl.h.
10598         From John David Anglin.
10599
10600 2000-04-25  Jim Meyering  <meyering@lucent.com>
10601
10602         * makepath.c (S_IRWXUGO): Define.
10603         (make_path): Always perform explicit chmod if MODE specifies any
10604         of the `special' permission bits.  Prompted by a bug report against
10605         install from Mate Wierdl and Joost van Baal.
10606
10607 2000-04-18  Jim Meyering  <meyering@lucent.com>
10608
10609         * README: New file.
10610
10611         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10612         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10613
10614 2000-04-17  Jim Meyering  <meyering@lucent.com>
10615
10616         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10617         the definition of it to rpl_strftime also defined-away the system's
10618         declaration.
10619
10620 2000-04-15  Jim Meyering  <meyering@lucent.com>
10621
10622         Use `C' to denote so-called `contiguous' files, the same way
10623         that tar does.
10624         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10625         (ftypelet): Use S_ISCTG.
10626         From Michael Deutschmann.
10627
10628 2000-04-14  Jim Meyering  <meyering@lucent.com>
10629
10630         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10631
10632 2000-04-08  Jim Meyering  <meyering@lucent.com>
10633
10634         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10635         names don't conflict.  Reported by Eli Zaretskii.
10636
10637 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10638
10639         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10640         bug.  Deal with the different error behavior of Irix iconv.
10641
10642 2000-04-07  Jim Meyering  <meyering@lucent.com>
10643
10644         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10645         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10646
10647 2000-04-05  Jim Meyering  <meyering@lucent.com>
10648
10649         Portability tweaks required for ultrix4.3.
10650         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10651         * readutmp.c: Include sys/types.h before sys/stat.h.
10652         * canon-host.c: Declare strdup.
10653         * path-concat.c: Likewise.
10654         From John David Anglin.
10655
10656 2000-04-04  Jim Meyering  <meyering@lucent.com>
10657
10658         Be more DOS 8.3-friendly.
10659         * ref-add.sin: Renamed from ref-add.sed.in.
10660         * ref-del.sin: Renamed from ref-del.sed.in.
10661         * Makefile.am: Reflect renaming.
10662         Reported by Eli Zaretskii.
10663
10664         Use a temporary file name that won't clash with `charset.alias'
10665         in the DOS 8.3 name space.
10666         * Makefile.am (charset_tmp): Define.
10667         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10668         (uninstall-local): Likewise.
10669         Reported by Eli Zaretskii.
10670
10671 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10672
10673         * time/strftime.c (my_strftime): Make sure we call the system
10674         strftime, not ourselves, when invoking the underlying strftime.
10675
10676 2000-03-24  Jim Meyering  <meyering@lucent.com>
10677
10678         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10679         (charset_alias): Define.
10680         (install-exec-local): Factor out common code.
10681         (uninstall-local): Split lines longer than 80.
10682         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10683         (SUFFIXES): Define.
10684         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10685         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10686
10687 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10688
10689         * config.charset: Output a line containing "Packages using this file".
10690         * ref-add.sed.in, ref-del.sed.in: New files.
10691         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10692         ref-del.sed): New rules.
10693
10694 2000-03-17  Jim Meyering  <meyering@lucent.com>
10695
10696         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10697         Otherwise, include <strings.h>
10698
10699 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10700
10701         * unicodeio.c (utf8_wctomb): New function.
10702         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10703         format instead of in UCS-4 with platform dependent endianness.
10704
10705 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10706
10707         * savedir.c (savedir): Work even if directory size is
10708         negative; this can happen with some screwy NFS configurations.
10709
10710 2000-03-06  Jim Meyering  <meyering@lucent.com>
10711
10712         * localcharset.c (get_charset_aliases): Don't try to free file_name
10713         if it's NULL (because we ran out of memory).  From Bruno Haible.
10714
10715 2000-03-05  Jim Meyering  <meyering@lucent.com>
10716
10717         * localcharset.c ("path-concat.h"): Include.
10718         (get_charset_aliases): Use path_concat instead of ANSI string
10719         concatenation.
10720
10721         * unicodeio.h (PARAMS): Define.
10722         Use it to guard prototype.
10723
10724 2000-03-04  Jim Meyering  <meyering@lucent.com>
10725
10726         * Makefile.am (install-exec-local): Create $(libdir) before installing
10727         into it.
10728         (uninstall-local): Uncomment this rule so `make distcheck' works
10729         once again.
10730
10731         * unicodeio.c (<errno.h>): Include it.
10732         (errno): Declare if not defined.
10733
10734         * localcharset.c: Add Bruno's comment justifying use of volatile.
10735
10736         * config.charset: New version, incorporating remarks from a linux
10737         i18n mailing list.  From Bruno Haible.
10738
10739 2000-03-02  Jim Meyering  <meyering@lucent.com>
10740
10741         * Makefile.am (EXTRA_DIST): Add config.charset.
10742
10743 2000-03-01  Jim Meyering  <meyering@lucent.com>
10744
10745         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10746         * unicodeio.c: Likewise.
10747
10748 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10749
10750         * config.charset: New file.
10751         * localcharset.c: New file.
10752         * unicodeio.h, unicodeio.c: New files.
10753         * Makefile.am (DEFS): Add -DLIBDIR=...
10754         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10755         (noinst_HEADERS): Add unicodeio.h.
10756         (all-local, install-exec-local, charset.alias): New targets.
10757
10758 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10759
10760         * quotearg.c (ALERT_CHAR): New macro.
10761         (quotearg_buffer_restyled): Use it.
10762
10763 2000-02-27  Jim Meyering  <meyering@lucent.com>
10764
10765         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10766         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10767
10768         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10769         not `#if STDC_HEADERS'.
10770         Declare malloc if needed.
10771
10772         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10773         now that autoconf always defines the HAVE_DECL_ symbols.
10774         * human.c: Likewise.
10775         * same.c: Likewise.
10776         * strtoumax.c: Likewise.
10777
10778         * backupfile.c: Arrange for cpp to fail if the configure-time
10779         declaration check was not run.
10780         * hash.c: Likewise.
10781         * human.c: Likewise.
10782         * same.c: Likewise.
10783         * strtoumax.c: Likewise.
10784
10785         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10786         then first look up the entire `.'-containing string as a login name.
10787
10788 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10789
10790         * getdate.y: Handle two-digit years with leading zeros correctly.
10791         (textint): New typedef.
10792         (parser_control): Member year changed from int to textint.
10793         All uses changed.
10794         (YYSTYPE): Removed; replaced by %union with int and textint members.
10795         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10796         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10797         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10798         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10799         (date, number, to_year): Use width of number in digits, not its value,
10800         to determine whether it's a 2-digit year, or a 2-digit time.
10801         (yylex): Store number of digits of numeric tokens.
10802         Reported by John Kendall.
10803
10804         (parser_control): Changed from struct parser_control to typedef (for
10805         consistency).  All uses changed.
10806
10807         (tID): Removed; not used.
10808         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10809
10810 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10811
10812         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10813         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10814
10815 2000-02-12  Jim Meyering  <meyering@lucent.com>
10816
10817         * userspec.c (ISDIGIT): Define it.
10818         (isdigit): Remove definition.
10819         (is_number): Use ISDIGIT, not isdigit.
10820         <libintl.h>: Include.
10821         (_ and N_): Define.
10822         (parse_user_spec): Mark translatable strings.
10823
10824 2000-02-10  Jim Meyering  <meyering@lucent.com>
10825
10826         With these changes, nanosleep.[ch] are finally enough like the other
10827         lib/* replacement files to compile on a few more losing systems.
10828
10829         * nanosleep.h: Don't include config.h.
10830         Remove prototype from declaration of nanosleep.
10831         (PARAMS): Remove now-unneeded definition.
10832         * nanosleep.c: #undef nanosleep.
10833         (rpl_nanosleep): Rename from nanosleep.
10834
10835 2000-02-03  Jim Meyering  <meyering@lucent.com>
10836
10837         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10838         rather than with `#if HAVE_UTMPNAME'.
10839
10840 2000-02-01  Jim Meyering  <meyering@lucent.com>
10841
10842         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10843
10844 2000-01-31  Jim Meyering  <meyering@lucent.com>
10845
10846         * nanosleep.h (nanosleep): Guard declaration with
10847         `#if ! HAVE_DECL_NANOSLEEP'.
10848         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10849         the declaration in that vendor's sys/timers.h.
10850         Reported by Christian Krackowizer.
10851
10852         * quotearg.c (ISASCII): Add #undef and move definition to follow
10853         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10854         (ISPRINT): Likewise.
10855         Reported by Tom Tromey.
10856
10857 2000-01-30  Jim Meyering  <meyering@lucent.com>
10858
10859         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10860         uses of ->ut_name.  The latter doesn't work with new Linux header files
10861         where only utmpx.ut_user is declared.
10862
10863         * readutmp.h (UT_USER): Define.
10864
10865 2000-01-23  Jim Meyering  <meyering@lucent.com>
10866
10867         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10868         obstack.c.
10869
10870 2000-01-22  Jim Meyering  <meyering@lucent.com>
10871
10872         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10873         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10874         Required for some AIX systems.  Reported by Christian Krackowizer.
10875         [TESTING] (main): New function.
10876
10877         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10878         * dirname.c (dir_name): Support for DOS-style file names with drive
10879         letters.
10880
10881         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10882
10883         * strverscmp.c (ISDIGIT): Define.
10884         (strverscmp): Use ISDIGIT, not isdigit.
10885
10886 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10887
10888         * nanosleep.c (nanosleep):
10889         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10890         POSIX.1 doesn't require SA_INTERRUPT and some systems
10891         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10892         it's been part of POSIX.1 since day 1 (in 1988).
10893
10894 2000-01-17  Jim Meyering  <meyering@lucent.com>
10895
10896         * interlock: Remove unused file.  Reported by François Pinard.
10897
10898 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10899
10900         * quotearg.c (quotearg_buffer_restyled): Do not quote
10901         alert, backslash, formfeed, and vertical tab unnecessarily in
10902         shell quoting style.
10903
10904
10905 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10906 Free Software Foundation, Inc.
10907 Copying and distribution of this file, with or without modification,
10908 are permitted provided the copyright notice and this notice are preserved.