Add searching operations, limited to a subsequence of the list.
[gnulib.git] / lib / ChangeLog
1 2006-10-03  Bruno Haible  <bruno@clisp.org>
2
3         * gl_list.h (gl_list_search_from, gl_list_search_from_to,
4         gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
5         (struct gl_list_implementation): Add fields search_from_to,
6         indexof_from_to. Remove fields search, indexof.
7         (gl_list_search): Use the search_from_to method.
8         (gl_list_search_from, gl_list_search_from_to): New functions.
9         (gl_list_indexof): Use the indexof_from_to method.
10         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
11         * gl_list.c (gl_list_search): Use the search_from_to method.
12         (gl_list_search_from, gl_list_search_from_to): New functions.
13         (gl_list_indexof): Use the indexof_from_to method.
14         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
15         * gl_array_list.c (gl_array_indexof_from_to): Renamed from
16         gl_array_indexof. Add start_index, end_index arguments.
17         (gl_array_search_from_to): Renamed from gl_array_search. Add
18         start_index, end_index arguments.
19         (gl_array_remove, gl_array_list_implementation): Update.
20         * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
21         gl_carray_indexof. Add start_index, end_index arguments.
22         (gl_carray_search_from_to): Renamed from gl_carray_search. Add
23         start_index, end_index arguments.
24         (gl_carray_remove, gl_carray_list_implementation): Update.
25         * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
26         gl_linked_search. Add start_index, end_index arguments.
27         (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
28         start_index, end_index arguments.
29         (gl_linked_remove): Update.
30         * gl_linked_list.c (gl_linked_list_implementation): Update.
31         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
32         * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
33         to 'size_t'.
34         * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
35         gl_tree_search. Add start_index, end_index arguments.
36         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
37         start_index, end_index arguments.
38         (gl_tree_remove): Update.
39         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
40         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
41         * gl_anytreehash_list1.h (compare_position_threshold): New function.
42         * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
43         gl_tree_search. Add start_index, end_index arguments.
44         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
45         start_index, end_index arguments.
46         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
47         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
48
49 2006-10-04  Bruno Haible  <bruno@clisp.org>
50
51         * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
52
53 2006-10-03  Bruno Haible  <bruno@clisp.org>
54
55         * gl_oset.h (gl_setelement_threshold_fn): New type.
56         (gl_oset_search_atleast): New declaration.
57         (struct gl_oset_implementation): Add field 'search_atleast'.
58         (gl_oset_search_atleast): New inline function.
59         * gl_oset.c (gl_oset_search_atleast): New function.
60         * gl_array_oset.c (gl_array_search_atleast): New function.
61         (gl_array_oset_implementation): Update.
62         * gl_anytree_oset.h (gl_tree_search_atleast): New function.
63         * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
64         * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
65
66 2006-10-04  Jim Meyering  <jim@meyering.net>
67
68         * fts.c (fts_open): Tiny comment change.
69
70 2006-10-03  Bruno Haible  <bruno@clisp.org>
71
72         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
73         from gl_avltreehash_list_implementation.
74
75 2006-10-03  Bruno Haible  <bruno@clisp.org>
76
77         * gl_oset.c (gl_oset_add): Fix return type.
78
79 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
80
81         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
82
83 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
84
85         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
86
87 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
88
89         Work around bug in Solaris 10 /proc file system:
90         /proc/self/fd/NNN/.. isn't the parent directory of
91         the directory whose file descriptor is NNN.  This needs to
92         be worked around at run time, not compile time, since a
93         program might be built on Solaris 8, where things work, and
94         run on Solaris 10.
95         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
96         to use the following interface instead:
97         (OPENAT_BUFFER_SIZE): New macro.
98         (openat_proc_name): New function.
99         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
100         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
101         Likewise.
102         * openat-proc.c: New file.
103
104 2006-09-29  Bruno Haible  <bruno@clisp.org>
105
106         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
107         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
108         argument. Set stdout_closed before testing for ferror, not after.
109         (fwriteerror, fwriteerror_no_ebadf): New functions.
110
111 2006-09-28  Bruno Haible  <bruno@clisp.org>
112
113         * strndup.h: Simplify the redefinition of strndup.
114         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
115
116 2006-09-28  Bruno Haible  <bruno@clisp.org>
117
118         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
119         * gl_linkedhash_list.c: Likewise.
120         * gl_rbtreehash_list.c: Likewise.
121
122 2006-09-28  Jim Meyering  <jim@meyering.net>
123
124         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
125         Include <unistd.h>.
126
127 2006-09-27  Jim Meyering  <jim@meyering.net>
128
129         This file could end up with a definition for a function
130         named __strndup, rather than rpl_strndup on a system with
131         incomplete weak_alias support.
132         * strndup.c (strndup): Rename from __strndup.
133         Remove #defines that used to map __strndup to strndup.
134         Don't use K&R prototypes.
135         Remove LIBC-related code, since this file is not sync'd with glibc.
136         * strndup.h: Revamp, accordingly.
137
138 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
139
140         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
141         getaddrinfo.
142
143         * __fpending.h: Don't include <stdio_ext.h> unless
144         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
145         it causes <stdio_ext.h> to cause a compile-time error.
146         Problem reported by Nelson H. F. Beebe.
147         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
148         of HAVE_DECL___PENDING.
149
150 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
151
152         * savewd.c: Include <signal.h>, for 'raise'.
153
154 2006-09-26  Eric Blake  <ebb9@byu.net>
155
156         * verror.c: Include <config.h> unconditionally.
157
158 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
159
160         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
161         (gl_linked_iterator_from_to): Initialize struct completely.
162         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
163         (gl_tree_iterator_from_to): Likewise
164         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
165         * gl_array_list.c [lint] (gl_array_iterator)
166         (gl_array_iterator_from_to): Likewise.
167         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
168         * gl_carray_list.c [lint] (gl_carray_iterator)
169         (gl_carray_iterator_from_to): Likewise.
170
171         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
172         * md4.c (md4_process_block): Remove unused variable.
173         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
174         parentheses for clarity.
175
176 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
177
178         Import this patch from libc:
179
180         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
181
182         * regex_internal.c (re_string_reconstruct): Handle
183         offset < pstr->valid_raw_len && pstr->offsets_needed case.
184         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
185         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
186         re_string_context_at.
187
188 2006-09-20  Bruno Haible  <bruno@clisp.org>
189
190         * mkdtemp.c: Import from libc.
191         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
192                 * sysdeps/posix/tempname.c (__gen_tempname): Change
193                 attempts_min into a macro.  Use preprocessor to decide how to
194                 initialize attempts [Coverity CID 67].
195         2001-11-27  Paul Eggert  <eggert@twinsun.com>
196                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
197                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
198
199 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
200
201         * mkstemp.h: New file, since some standard headers
202         #define mkstemp.
203         * mkstemp.c: Revamp to put the !_LIBC code together.
204         Include "mkstemp.h".
205         Make the _LIBC code resemble glibc original more,
206         e.g., use K&R style.
207         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
208         (mkstemp): Remove, since mkstemp.h does this for us.
209         * stdlib--.h: Include mkstemp.h.
210
211         Import this patch from libc:
212
213         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
214
215         * tempname.c (__gen_tempname): Change attempts_min
216         into a macro.  Use preprocessor to decide how to initialize
217         attempts [Coverity CID 67].
218
219 2006-09-18  Bruno Haible  <bruno@clisp.org>
220
221         * javaversion.c: Include configmake.h.
222
223 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
224
225         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
226         that prevented coreutils 6.1 from building.  Problem reported
227         by Petter Reinholdtsen.
228
229 2006-09-18  Jim Meyering  <jim@meyering.net>
230
231         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
232
233 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
234
235         * dirchownmod.c: Don't include fcntl.h; no longer needed.
236         (dirchownmod): New arg FD.  All callers changed.
237         Use FD rather than opening the directory ourself, as opening is
238         now the caller's responsibility.
239         * dirchownmod.h: Likewise.
240         * mkancesdirs.c: Include <sys/types.h>, for portability to older
241         hosts that require <sys/types.h> before <sys/stat.h>.  Include
242         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
243         (test_dir): Remove.
244         (mkancesdirs): Return length of prefix of FILE that has already
245         been made, or -2 if there is a child doing the work.  Redo
246         algorithm so that it is O(N) rather than O(N**2).  Optimize away
247         ".", and treat ".." specially since it might stray back into
248         already-created areas.  Use a subprocess if necessary.  New arg
249         WD; all users changed.  MAKE_DIR function should now return 1
250         if it creates a directory that is not readable.  Return -2 if
251         a child process is spun off.
252         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
253         Adjust signature to match code.
254         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
255         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
256         all users changed.
257         * savewd.c, savewd.h: New files.
258
259 2006-09-15  Jim Meyering  <jim@meyering.net>
260
261         * rename-dest-slash.c (has_trailing_slash): Use
262         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
263         (rpl_rename_dest_slash): Perform the cheaper trailing slash
264         test before testing whether SRC is a directory.
265         Suggestions from Bruno Haible.
266
267         Avoid a warning about an unused variable.
268         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
269         into the #ifdef block where it's used.
270
271         * rename-dest-slash.c: New file.
272
273 2006-09-14  Bruno Haible  <bruno@clisp.org>
274
275         * allocsa.c: Include <config.h> unconditionally.
276         * asnprintf.c: Likewise.
277         * asprintf.c: Likewise.
278         * c-strcasecmp.c: Likewise.
279         * c-strcasestr.c: Likewise.
280         * c-strncasecmp.c: Likewise.
281         * c-strstr.c: Likewise.
282         * classpath.c: Likewise.
283         * clean-temp.c: Likewise.
284         * concatpath.c: Likewise.
285         * copy-file.c: Likewise.
286         * csharpcomp.c: Likewise.
287         * csharpexec.c: Likewise.
288         * execute.c: Likewise.
289         * fatal-signal.c: Likewise.
290         * findprog.c: Likewise.
291         * fwriteerror.c: Likewise.
292         * gl_array_list.c: Likewise.
293         * gl_array_oset.c: Likewise.
294         * gl_avltree_list.c: Likewise.
295         * gl_avltree_oset.c: Likewise.
296         * gl_avltreehash_list.c: Likewise.
297         * gl_carray_list.c: Likewise.
298         * gl_linked_list.c: Likewise.
299         * gl_linkedhash_list.c: Likewise.
300         * gl_list.c: Likewise.
301         * gl_oset.c: Likewise.
302         * gl_rbtree_list.c: Likewise.
303         * gl_rbtree_oset.c: Likewise.
304         * gl_rbtreehash_list.c: Likewise.
305         * imaxabs.c: Likewise.
306         * imaxdiv.c: Likewise.
307         * javacomp.c: Likewise.
308         * javaexec.c: Likewise.
309         * javaversion.c: Likewise.
310         * linebreak.c: Likewise.
311         * localcharset.c: Likewise.
312         * lock.c: Likewise.
313         * mbchar.c: Likewise.
314         * mbswidth.c: Likewise.
315         * mkdtemp.c: Likewise.
316         * pipe.c: Likewise.
317         * printf-args.c: Likewise.
318         * printf-parse.c: Likewise.
319         * progname.c: Likewise.
320         * progreloc.c: Likewise.
321         * readlink.c: Likewise.
322         * sh-quote.c: Likewise.
323         * stpcpy.c: Likewise.
324         * stpncpy.c: Likewise.
325         * strcasecmp.c: Likewise.
326         * strcasestr.c: Likewise.
327         * strcspn.c: Likewise.
328         * striconv.c: Likewise.
329         * strncasecmp.c: Likewise.
330         * strnlen1.c: Likewise.
331         * strstr.c: Likewise.
332         * strtok_r.c: Likewise.
333         * tls.c: Likewise.
334         * tmpdir.c: Likewise.
335         * unicodeio.c: Likewise.
336         * unsetenv.c: Likewise.
337         * vasnprintf.c: Likewise.
338         * vasprintf.c: Likewise.
339         * wait-process.c: Likewise.
340         * xallocsa.c: Likewise.
341         * xsetenv.c: Likewise.
342         * xstriconv.c: Likewise.
343
344 2006-09-13  Eric Blake  <ebb9@byu.net>
345
346         * getopt.c: Fix typo in last commit.
347
348 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
349
350         * _fpending.c: Include <config.h> unconditionally, since we no
351         longer worry about uses that don't define HAVE_CONFIG_H.
352         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
353         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
354         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
355         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
356         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
357         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
358         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
359         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
360         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
361         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
362         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
363         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
364         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
365         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
366         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
367         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
368         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
369         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
370         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
371         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
372         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
373         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
374         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
375         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
376         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
377         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
378         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
379         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
380         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
381         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
382         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
383         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
384         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
385         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
386         Likewise.
387
388 2006-09-12  Jim Meyering  <jim@meyering.net>
389
390         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
391         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
392         Reported by Nelson H. F. Beebe.
393
394 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
395
396         * argp-help.c (argp_doc): Make sure NULL is not passed to
397         dgettext.
398
399 2006-09-10  Bruno Haible  <bruno@clisp.org>
400
401         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
402
403 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
404
405         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
406         program_invocation_name and program_invocation_short_name are
407         initialized.
408         * argp-namefrob.h: Move declarations of program_invocation_name
409         and program_invocation_short_name to argp.h, so they are visible
410         to user programs.
411         * argp.h: Likewise
412
413 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
414
415         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
416         convention.  Text proposed by Bruno Haible.
417         (struct argp_option): Document the use of N_() wrappers.
418
419         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
420         and translate the two parts separately, instead of feeding
421         the whole string to gettext.  This allows to exclude
422         '\v' from the strings visible to the translator by writing doc
423         strings as N_("..") "\v" N_("..").
424
425 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
426
427         * mktime.c (guess_time_tm): Fix bug where mktime
428         returned the maximum time_t value rather than (time_t) -1.
429         Problem originally reported by William Bardwell
430         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
431
432         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
433         Moved to here ...
434         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
435         ... from here.
436
437 2006-09-06  Bruno Haible  <bruno@clisp.org>
438
439         * striconv.h: New file.
440         * striconv.c: New file, merging iconvme.c with GNU gettext's
441         iconvstring.c.
442         * xstriconv.h: New file.
443         * xstriconv.c: New file.
444
445 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
446
447         * argz_.h: Sync from Libtool.
448
449         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
450                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
451
452         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
453
454 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
455
456         * trim.h: New file.
457         * trim.c: New file.
458
459 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
460
461         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
462         Problem reported by Ralf Wildenhues in
463         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
464
465         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
466         HAVE_STRUCT_STATFS_F_FSTYPENAME.
467
468 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
469
470         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
471         or stdbool.h, because they might not exist while configuring.
472
473         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
474         Don't include unistd.h or limits.h; not needed, since chdir-long.h
475         does that for us.
476         (O_DIRECTORY): Remove.
477
478 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
479
480         Work around a bug in both the Linux and SunOS 64-bit kernels:
481         nanosleep mishandles sleeps for longer than 2**31 seconds.
482         Problem reported by Frank v Waveren in
483         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
484         * nanosleep.c (BILLION): New constant.
485         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
486         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
487
488 2006-08-30  Jim Meyering  <jim@meyering.net>
489
490         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
491         the parameter.
492
493 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
494
495         * isapipe.c, isapipe.h: New files.
496
497 2006-08-29  Eric Blake  <ebb9@byu.net>
498
499         * error.c (error_at_line, print_errno_message): Match libc, after
500         resolution of upstream bug 3044.
501
502 2006-08-29  Bruno Haible  <bruno@clisp.org>
503
504         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
505
506 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
507
508         Sync from Libtool:
509
510         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
511
512         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
513         sharing with gnulib.  Report by Eric Blake.
514
515 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
516
517         * fcntl_.h: New file.
518         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
519         the fcntl module.
520         * dirchownmod.c: Likewise.
521         * fts.c: Likewise.
522
523         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
524         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
525         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
526         just before including <inttypes.h>, to avoid circular inclusion.
527
528 2006-08-28  Bruno Haible  <bruno@clisp.org>
529
530         * inttypes_.h (SCNX*): Remove definitions.
531         Reported by Eric Blake.
532
533 2006-08-26  Bruno Haible  <bruno@clisp.org>
534
535         * vasnprintf.c (EOVERFLOW): Remove definition.
536         (VASNPRINTF): Return a string of length > INT_MAX without failing.
537         * vasprintf.c: Include errno.h, limits.h.
538         (EOVERFLOW): New fallback definition.
539         (vasprintf): Test here whether the string length is > INT_MAX.
540         * vsnprintf.c: Include errno.h, limits.h.
541         (EOVERFLOW): New fallback definition.
542         (vsnprintf): Fix bug when generated string was too long for the buffer.
543         Test here whether the string length is > INT_MAX.
544
545 2006-08-26  Bruno Haible  <bruno@clisp.org>
546             Simon Josefsson  <jas@extundo.com>
547
548         BeOS portability.
549         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
550
551 2006-08-28  Bruno Haible  <bruno@clisp.org>
552
553         * c-strstr.h: New file, from GNU gettext.
554         * c-strstr.c: New file, from GNU gettext.
555
556 2006-08-26  Bruno Haible  <bruno@clisp.org>
557
558         * inttypes_.h: New file.
559         * inttypes.h: Remove file.
560         * stdint_.h: Include <inttypes.h> through its absolute filename.
561
562         * imaxabs.c: New file.
563
564         * imaxdiv.c: New file.
565
566 2006-08-22  Bruno Haible  <bruno@clisp.org>
567
568         * readutmp.h: Skip most definitions if neither <utmp.h> nor
569         <utmpx.h> exists.
570
571 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
572
573         BeOS portability.
574         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
575         Problem reported by Bruno Haible.
576
577 2006-08-21  Bruno Haible  <bruno@clisp.org>
578
579         BeOS portability.
580         * mbchar.h: Include <wctype.h> only if it exists.
581
582 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
583
584         * cycle-check.h: Include <stdint.h> unconditionally, since we
585         now assume the stdint module.  Do not include inttypes.h.
586         * fsusage.h: Likewise.
587         * getndelim2.c: Likewise.
588         * human.h: Likewise.
589         * inttostr.h: Likewise.
590         * obstack.c: Likewise.
591         * regex_internal.h: Likewise.
592         * tempname.c: Likewise.
593         * utimecmp.c: Likewise.
594         * xstrtol.h: Likewise.
595
596         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
597
598         * strtoimax.c: Adjust to macro name changes in Autoconf,
599         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
600         * xtime.h: Likewise.
601
602 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
603
604         * fchmodat.c: New file, from coreutils.  This was inadvertently
605         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
606
607 2006-08-18  Bruno Haible  <bruno@clisp.org>
608
609         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
610         (ME_DUMMY): Treat "kernfs" as a dummy.
611         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
612
613 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
614
615         Update from coreutils.
616
617         * __fpending.h: Add copyright notice.
618         * fprintftime.h: Likewise.
619         * savedir.c: Use (C) in copyright notice.
620         * savedir.h: Likewise.
621
622         2006-08-15  Jim Meyering  <jim@meyering.net>
623
624         * at-func.c: New file, with the logic of all emulated at-functions.
625         * openat-priv.h: Include <errno.h> and define ENOSYS,
626         in support of the EXPECTED_ERRNO macro.
627         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
628         Instead, define the appropriate symbols and include "at-func.c".
629         * mkdirat.c (mkdirat): Likewise.
630         * fchmodat.c (fchmodat): Likewise.
631         (ENOSYS): Remove definition.
632         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
633         Don't include "unistd--.h" -- it wasn't ever used.
634
635         2006-01-17  Jim Meyering  <jim@meyering.net>
636
637         Rewrite fts.c not to change the current working directory,
638         by using openat, fstatat, fdopendir, etc..
639
640         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
641         (HAVE_OPENAT_SUPPORT): Define.
642         [_LIBC] (fchdir): Don't undef or define; no longer used.
643         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
644         Now, this `function' always succeeds, and consumes its file descriptor
645         parameter -- so callers must not close such FDs.  Update callers.
646         (diropen_fd, opendirat, cwd_advance_fd): New functions.
647         (diropen): Add parameter, SP.  Adjust all callers.
648         Implement using diropen_fd, rather than open.
649         (fts_open): Initialize new member, fts_cwd_fd.
650         Remove fts_rft-setting code.
651         (fts_close): Close fts_cwd_fd, if necessary.
652         (__opendir2): Define in terms of opendir or opendirat,
653         depending on whether the FST_NOCHDIR flag is set.
654         (fts_build): Since fts_safe_changedir consumes its FD, and since
655         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
656         and close the dup'd file descriptor upon failure.
657         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
658         (fts_safe_changedir): Tweak semantics to reflect that this function
659         now calls cwd_advance_fd and hence consumes its FD argument.
660         * fts_.h [struct FTS] (fts_cwd_fd): New member.
661         [struct FTS] (fts_rft): Remove now-unused member.
662         [struct FTS] (fts_cycle.state): Improve comment.
663
664         * openat.c (openat_needs_fchdir): New function.
665         * openat.h (openat_needs_fchdir): Declare it.
666
667 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
668
669         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
670         Problem and fix reported by Pádraig Brady in
671         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
672
673 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
674
675         * memcoll.c (memcoll): Optimize for the common case where the
676         arguments are bytewise equal.
677
678 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
679
680         Change copyright notice from LGPL 2 to GPL 2, since that's the
681         standard form used in the gnulib repository.
682         * lock.c: LGPL -> GPL.
683         * lock.h: Likewise.
684         * strnlen1.c: Likewise.
685         * strnlen1.h: Likewise.
686         * tls.c: Likewise.
687         * tls.h: Likewise.
688         * tmpdir.c: Likewise.
689
690         * TODO: Remove; this belongs only in coreutils.
691
692 2006-08-14  Eric Blake  <ebb9@byu.net>
693
694         Import the following change from libc:
695
696         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
697
698         Upstream bug 2997.
699         * misc/error.c: Add space between program name and message if file
700         name is missing.
701
702 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
703
704         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
705         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
706
707         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
708         in wchar_t.  Problem reported by Eric Blake.
709
710         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
711         LEN is smaller than SIZE.  Suggested by Bruno Haible.
712         Also, help the compiler to keep LEN in a register.
713
714 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
715
716         * .cppi-disable: Add snprintf.h, socket_.h.
717         * snprintf.c: Include <errno.h> and <limits.h>.
718         (EOVERFLOW): Define if the system does not.
719         Do not include "minmax.h"; it wasn't used.
720         (snprintf): Don't assume size_t promotes to an unsigned type.
721         Fix bug when generated string was too long for the buffer: the
722         buffer's contents are supposed to be the initial prefix of the
723         output.  Don't assume vasnprintf returns EOVERFLOW if the size
724         exceeds INT_MAX; do the check ourselves.
725
726         Import the following changes from libc:
727
728         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
729
730         * posix/regex_internal.c (re_string_skip_chars): If no character has
731         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
732         to the byte which couldn't be converted.
733         (re_string_reconstruct): Don't clear valid_raw_len before calling
734         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
735         tip_context using re_string_context_at.
736
737         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
738
739         * posix/regex.h: g++ still cannot handled [restrict].
740
741         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
742
743         * posix/regex.h: Remove special handling for VMS.
744
745 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
746
747         Sync from coreutils.
748
749         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
750
751         * mountlist.c [ME_REMOTE]: Filter out cifs.
752         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
753
754 2006-08-08  Eric Blake  <ebb9@byu.net>
755
756         * verror.c (verror_at_line): Work around glibc bug 2997, so that
757         verror_at_line output complies with GNU Coding Standards even when
758         file is NULL.
759
760 2006-08-08  Eric Blake  <ebb9@byu.net>
761
762         * verror.h, verror.c: New files.
763
764 2006-08-07  Bruno Haible  <bruno@clisp.org>
765
766         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
767         versions of AIX.
768         Reported by Ralf Wildenhues.
769
770 2006-08-06  Eric Blake  <ebb9@byu.net>
771
772         * error.h: Fold in some upstream changes from glibc.
773         * error.c: Likewise.
774
775 2006-07-29  Bruno Haible  <bruno@clisp.org>
776
777         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
778
779 2006-07-29  Bruno Haible  <bruno@clisp.org>
780
781         * setenv.c: Undo unintended modification done on 2006-02-27.
782
783 2006-07-28  Eric Blake  <ebb9@byu.net>
784
785         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
786         macro expansion.
787
788 2006-07-28  Simon Josefsson  <jas@extundo.com>
789
790         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
791         #include's.
792
793 2006-07-28  Simon Josefsson  <jas@extundo.com>
794
795         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
796         #include's.
797
798 2006-07-28  Bruno Haible <bruno@clisp.org>
799
800         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
801
802 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
803
804         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
805         arpa/inet.h.
806
807 2006-07-28  Bruno Haible  <bruno@clisp.org>
808
809         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
810         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
811         fallbacks.
812         Avoids link error on FreeBSD 4.x.
813         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
814
815         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
816         encoding.
817         * mbswidth.c (iswcntrl): Likewise.
818
819 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
820
821         * modechange.c (mode_compile): Numeric modes now affect setuid and
822         setgid on directories only if they set these bits.
823         * modechange.h: Remove obsolete comment about masks.
824
825 2006-07-27  Bruno Haible  <bruno@clisp.org>
826
827         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
828         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
829         defined.
830
831 2006-07-26  Eric Blake  <ebb9@byu.net>
832
833         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
834         like mingw that lack mkstemp.
835         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
836         avoid compilation warning on mingw.
837
838 2006-07-25  Bruno Haible  <bruno@clisp.org>
839
840         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
841         <stdarg.h> or config.h.
842
843 2006-07-24  Bruno Haible  <bruno@clisp.org>
844
845         * clean-temp.h: New file, from GNU gettext.
846         * clean-temp.c: New file, from GNU gettext.
847
848 2006-07-24  Bruno Haible  <bruno@clisp.org>
849
850         * tmpdir.h: New file, from GNU gettext.
851         * tmpdir.c: New file, from GNU gettext.
852
853 2006-07-23  Bruno Haible  <bruno@clisp.org>
854
855         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
856         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
857         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
858         gl_linked_remove_at): Use it.
859
860 2006-07-23  Eric Blake  <ebb9@byu.net>
861
862         * tmpfile-safer.c: New file.
863         * stdio-safer.h (fopen_safer): Add prototype.
864         * stdio--.h (tmpfile): Make safer.
865
866 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
867
868         * close-stream.c, close-stream.h: New files.
869
870 2006-07-22  Bruno Haible  <bruno@clisp.org>
871
872         Merge from GNU gettext 0.15.
873
874         2005-07-05  Bruno Haible  <bruno@clisp.org>
875
876                 * printf-args.c (printf_fetchargs): Work around broken
877                 definition of wint_t on mingw.
878
879         2005-02-12  Bruno Haible  <bruno@clisp.org>
880
881                 * xallocsa.h: Add extern "C" for C++.
882
883         2006-05-17  Bruno Haible  <bruno@clisp.org>
884
885                 Cygwin portability.
886                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
887
888         2006-04-30  Bruno Haible  <bruno@clisp.org>
889
890                 * progreloc.c: Include <mach-o/dyld.h> if available.
891                 (find_executable): Use _NSGetExecutablePath when possible.
892
893         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
894
895                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
896                 function.
897
898         2005-12-29  Bruno Haible  <bruno@clisp.org>
899
900                 * progreloc.c (set_program_name_and_installdir): Fix
901                 compilation error.
902
903         2005-12-04  Bruno Haible  <bruno@clisp.org>
904
905                 Cygwin portability.
906                 * progreloc.c: Include <windows.h> also on Cygwin.
907                 (find_executable): Add support for Cygwin.
908                 (set_program_name_and_installdir): Handle also platforms with
909                 nonempty EXEEXT.
910
911         2006-07-11  Bruno Haible  <bruno@clisp.org>
912
913                 * javacomp.c: Fix a comment.
914                 Reported by Jim Meyering.
915
916         2006-04-30  Bruno Haible  <bruno@clisp.org>
917
918                 * javacomp.h (compile_java_class): Add source_version,
919                 target_version arguments.
920                 * javacomp.c: Rewritten to choose only a compiler that
921                 respects the specified source_version and target_version.
922
923         2006-06-27  Bruno Haible  <bruno@clisp.org>
924
925                 Assume correct S_ISDIR macro.
926                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
927
928         2006-07-22  Bruno Haible  <bruno@clisp.org>
929
930                 * javaversion.h: New file, from GNU gettext.
931                 * javaversion.c: New file, from GNU gettext.
932                 * javaversion.java: New file, from GNU gettext.
933                 * javaversion.class: New file, from GNU gettext.
934
935         2006-05-17  Bruno Haible  <bruno@clisp.org>
936
937                 Cygwin portability.
938                 * javaexec.c (execute_java_class): Test for jview program
939                 also on Cygwin.
940
941         2006-04-09  Bruno Haible  <bruno@clisp.org>
942
943                 * fatal-signal.c: Don't include string.h.
944                 (at_fatal_signal): Use a copying loop instead of memcpy.
945
946         2005-12-04  Bruno Haible  <bruno@clisp.org>
947
948                 * csharpexec.c: Add support for 'clix' launcher (untested).
949                 (execute_csharp_using_sscli): New function.
950                 (execute_csharp_program): Call it.
951
952         2006-06-21  Bruno Haible  <bruno@clisp.org>
953
954                 Avoid warnings from recent versions of mcs.
955                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
956                 -o, -L, -r any more. Use options documented since mcs-1.0
957                 instead. Similarly for -g.
958
959         2005-07-09  Bruno Haible  <bruno@clisp.org>
960
961                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
962                 add a .dll suffix.
963                 Reported by Mark Junker <mjscod@gmx.de>.
964
965         2006-06-17  Bruno Haible  <bruno@clisp.org>
966
967                 * config.charset: Update for NetBSD 3.0.
968
969         2006-05-17  Bruno Haible  <bruno@clisp.org>
970
971                 Cygwin portability.
972                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
973
974         2006-05-16  Bruno Haible  <bruno@clisp.org>
975
976                 * localcharset.c [CYGWIN]: Include <windows.h>.
977                 (get_charset_aliases): For Cygwin, return the same CPxxx
978                 aliases list as under WIN32.
979                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
980                 the environment variables. Fall back to GetACP().
981
982         2006-04-05  Bruno Haible  <bruno@clisp.org>
983
984                 * config.charset: Update Juan Manuel Guerrero's address.
985
986         2005-02-12  Bruno Haible  <bruno@clisp.org>
987
988                 * allocsa.h: Add extern "C" for C++.
989
990         2005-02-10  Bruno Haible  <bruno@clisp.org>
991
992                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
993                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
994
995         2006-07-22  Bruno Haible  <bruno@clisp.org>
996
997                 * gettext.h: Update to GNU gettext-0.15.
998
999 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1000         and Simon Josefsson <jas@extundo.com>
1001
1002         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1003
1004         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1005
1006 2006-07-21  Eric Blake  <ebb9@byu.net>
1007
1008         * stdlib-safer.h: New file from coreutils, required by
1009         stdlib--.h.
1010
1011 2006-07-19  Derek R. Price  <derek@ximbiot.com>
1012
1013         * getaddrinfo.h: Don't define unimplemented AI_* flags.
1014         Reindent and repaginate.
1015
1016 2006-07-17  Bruno Haible  <bruno@clisp.org>
1017
1018         * gl_list.h: New file.
1019         * gl_list.c: New file.
1020         * gl_array_list.h: New file.
1021         * gl_array_list.c: New file.
1022         * gl_carray_list.h: New file.
1023         * gl_carray_list.c: New file.
1024         * gl_linked_list.h: New file.
1025         * gl_linked_list.c: New file.
1026         * gl_anylinked_list1.h: New file.
1027         * gl_anylinked_list2.h: New file.
1028         * gl_avltree_list.h: New file.
1029         * gl_avltree_list.c: New file.
1030         * gl_anyavltree_list1.h: New file.
1031         * gl_anyavltree_list2.h: New file.
1032         * gl_rbtree_list.h: New file.
1033         * gl_rbtree_list.c: New file.
1034         * gl_anyrbtree_list1.h: New file.
1035         * gl_anyrbtree_list2.h: New file.
1036         * gl_anytree_list1.h: New file.
1037         * gl_anytree_list2.h: New file.
1038         * gl_linkedhash_list.h: New file.
1039         * gl_linkedhash_list.c: New file.
1040         * gl_anyhash_list1.h: New file.
1041         * gl_anyhash_list2.h: New file.
1042         * gl_avltreehash_list.h: New file.
1043         * gl_avltreehash_list.c: New file.
1044         * gl_rbtreehash_list.h: New file.
1045         * gl_rbtreehash_list.c: New file.
1046         * gl_anytreehash_list1.h: New file.
1047         * gl_anytreehash_list2.h: New file.
1048
1049         * gl_oset.h: New file.
1050         * gl_oset.c: New file.
1051         * gl_array_oset.h: New file.
1052         * gl_array_oset.c: New file.
1053         * gl_avltree_oset.h: New file.
1054         * gl_avltree_oset.c: New file.
1055         * gl_rbtree_oset.h: New file.
1056         * gl_rbtree_oset.c: New file.
1057         * gl_anytree_oset.h: New file.
1058
1059 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1060
1061         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1062         New files.
1063         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1064         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1065         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
1066         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1067         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
1068         callers changed.  Revamp internals significantly, by not
1069         attempting to create directories that are temporarily more
1070         permissive than the final results.  Do not attempt to use
1071         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1072         This removes some race conditions, fixes some bugs, and simplifies
1073         things.  Use new dirchownmod function to do owner and mode changes.
1074         * mkdir-p.h: Likewise.
1075         * modechange.c (octal_to_mode): New function.
1076         (struct mode_change): New member mentioned.
1077         (make_node_op_equals): New arg mentioned.  All callers changed.
1078         (mode_compile): Keep track of which mode bits the user has explicitly
1079         mentioned.
1080         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1081         New arg PMODE_BITS, to keep track of which mode bits the user
1082         mentioned; it treats S_ISUID and S_ISGID speciall.
1083         All callers changed.
1084         * modechange.h: Likewise.
1085
1086 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1087
1088         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1089
1090 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1091
1092         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1093         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1094         macros into the GNU _D_EXACT_NAMLEN.
1095         * savedir.c:  Likewise.
1096         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1097
1098 2006-07-09  Jim Meyering  <jim@meyering.net>
1099
1100         * argp-pv.c: Remove a doubled word in a comment.
1101         * check-version.c (check_version): Likewise.
1102         * javacomp.c (compile_java_class): Likewise.
1103
1104 2006-07-08  Jim Meyering  <jim@meyering.net>
1105
1106         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1107
1108 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1109
1110         * getaddrinfo.c: Changes to compile under MSVC6: changed
1111         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1112         brackets.  Other minor changes to suppress some compiler
1113         warnings.
1114
1115 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1116
1117         * getloadavg.c: Use __VMS, not VMS.
1118         * getopt.c: Likewise.
1119         * getpagesize.h: Likewise.
1120         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1121         probably does not work.
1122
1123 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1124         and Paul Eggert  <eggert@cs.ucla.edu>
1125
1126         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1127         Don't worry about this obsolete case any more.
1128         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1129         directories.
1130         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1131         worry about this obsolete case any more.
1132         * fts.c: Likewise.
1133         * getcwd.c: Likewise.
1134         * glob.h: Likewise.
1135         * savedir.c: Likewise.
1136
1137 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1138
1139         * .cppi-disable: Add wcwidth.
1140         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1141         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1142         (ISGRAPH): Remove.  All uses changed to isgraph.
1143         (FOLD) [!defined _LIBC]: Remove special case.
1144         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1145         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1146         HAVE_ISBLANK.
1147         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1148
1149 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1150
1151         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1152
1153 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1154
1155         * memcasecmp.c: Include <limits.h>.
1156         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1157         * strtod.c (strtod): Don't assume isspace works on negative chars.
1158         Don't assume isdigit succeeds only on '0' through '9'.
1159
1160 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1161
1162         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1163         All uses of is_space replaced by isspace.
1164         * exit.h: Don't talk about STDC_HEADERS.
1165         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1166         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1167         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1168         replaced by isprint etc.
1169         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1170         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1171         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1172         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1173         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1174         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1175
1176 2006-07-05  Eric Blake  <ebb9@byu.net>
1177
1178         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1179         missing from netdb.h.
1180         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1181
1182 2006-06-27  Bruno Haible  <bruno@clisp.org>
1183
1184         Assume ANSI C header files and <ctype.h> functions.
1185         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1186         (mbsnwidth): Use isprint, iscntrl instead.
1187
1188 2006-07-03  Jim Meyering  <jim@meyering.net>
1189
1190         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1191         macro is used before the first cycle_check call.
1192
1193 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1194
1195         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1196         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1197         reported by Mark D. Baushke, one in
1198         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1199
1200         Merge from coreutils.
1201
1202         * .cppi-disable: Add stdint_.h.
1203         * .cvsignore: Add stdint.h.
1204
1205         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1206
1207         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1208         both double and long double versions.
1209         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1210         * xstrtold.c: New file.
1211         * xstrtod.h (xstrtold): New decl.
1212
1213         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1214
1215         * filemode.c (setst): Remove.
1216         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1217         (arguably) clearer, and the generated code is a bit smaller on my
1218         Debian GNU/Linux stable x86 host.
1219
1220         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1221
1222         * filemode.c: Include "filemode.h" first, to test the interface.
1223         Assume that filemode.h includes sys/types.h and sys/stat.h.
1224         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1225         (ftypelet): Reorder to put common cases first, for efficiency.
1226         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1227         to do 'M'.
1228         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1229         of 10, for compatibility with FreeBSD.  All callers changed.
1230         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1231         that can't be deduced solely from st_mode.  First arg is now a const
1232         pointer.
1233         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1234         (strmode): Renamed from mode_string.
1235         (filemodestring): New decl.
1236         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1237         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1238         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1239
1240         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1241
1242         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1243         fsusage.h now does that.  Include fsusage.h first, to test interface.
1244         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1245         at most one method (the old code could have generated decls that
1246         didn't conform to C89, not that this was ever exercised).
1247         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1248
1249         2006-03-19  Jim Meyering  <jim@meyering.net>
1250
1251         Work even in a chroot where d_ino values for entries in "/"
1252         don't match the stat.st_ino values for the same names.
1253         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1254         number, iterate through all entries again, using lstat instead.
1255         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1256         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1257
1258         * getcwd.c (__getcwd): Clarify a comment.
1259         Use memcpy in place of a call to strcpy.
1260
1261         2006-03-12  Jim Meyering  <jim@meyering.net>
1262
1263         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1264         that of the current directory (which we're about to chdir ".." out of),
1265         then save the dev-ino of the parent, instead.
1266
1267         * same-inode.h (SAME_INODE): New file/macro.
1268         * chdir-safer.c (SAME_INODE): Remove definition.
1269         Include "same-inode.h", instead.
1270         * same.c: Likewise.
1271         * cycle-check.h: Include "same-inode.h".
1272         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1273         * cycle-check.c (SAME_INODE): Remove definition.
1274         * root-dev-ino.h: Include "same-inode.h".
1275
1276         2006-03-11  Eric Blake  <ebb9@byu.net>
1277
1278         * same.c (same_name): s/base_name/last_component/
1279         * backupfile.c (check_extension, numbered_backup): Likewise.
1280         * filenamecat.c (file_name_concat): Likewise.
1281
1282         2006-03-11  Eric Blake  <ebb9@byu.net>,
1283                     Paul Eggert  <eggert@cs.ucla.edu>
1284
1285         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1286         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1287         drive prefix.
1288         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1289         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1290         (last_component): New method.
1291         * dirname.c (dir_len): Determine when drive letters need a
1292         subsequent slash.  Preserve // when it is special.
1293         (dir_name): Don't append dot when drive letter is absolute.
1294         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1295         * basename.c (base_name): New semantics - malloc the result.
1296         Preserve // when it is special.  Preserve relative files that look
1297         like drive letters.
1298         (base_len): Preserve // when it is special.
1299         (last_component): New method, similar to old base_name semantics.
1300         * stripslash.c (strip_trailing_slashes): Use last_component, not
1301         base_name.  Strip redundant slashes from ///.
1302
1303 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1304
1305         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1306         both are 64 bits, since this seems to be the tradition, and this
1307         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1308         we ever run into a host that prefers long long to long in this
1309         case, we'll need another configure-time test.  Problem reported by
1310         Jim Meyering.
1311
1312 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1313
1314         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1315         possible collision with system files.
1316         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1317         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1318         WCHAR_MIN and WCHAR_MAX in this case.
1319         (<stddef.h>): Do not include; no longer needed.
1320         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1321         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1322         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1323         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1324         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1325         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1326         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1327         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1328         !defined(__c99))]: Include in this case too, since it's harmless
1329         now.
1330         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1331         dangerous to do so.
1332         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1333         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1334         (_STDINT_MIN, _STDINT_MAX): New macros.
1335         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1336         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1337         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1338         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1339         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1340         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1341         macros, not typedefs; this simplifies things quite a bit.
1342         Use long int for all types narrower than int64_t.
1343         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1344         Define in terms of long long int or int64_t or long int,
1345         not int64_t or int32_t.  This saves some compile-time testing.
1346         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1347         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1348         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1349         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1350         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1351         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1352         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1353         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1354         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1355         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1356         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1357         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1358         undef any previous version and define our own version, for
1359         simplicity and consistency with the new macros for types.
1360         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1361         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1362         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1363         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1364         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1365         @WINT_T_SUFFIX@ to keep things simple here.
1366         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1367         Simplify by assuming typical 8/16/32/64 host, since we're
1368         already doing that elsewhere anyway.
1369         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1370         and assume long long int is 64 bits if available.  This
1371         speeds up 'configure'.
1372
1373 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1374
1375         * getaddrinfo.c: fixed typo
1376
1377 2006-06-29  Eric Blake  <ebb9@byu.net>
1378
1379         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1380         unused static function.
1381
1382 2006-06-29  Eric Blake  <ebb9@byu.net>
1383
1384         * stat_.h: New file.
1385
1386 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1387
1388         * strftime.c: Assume strftime() exists.
1389
1390 2006-06-28  Bruno Haible  <bruno@clisp.org>
1391
1392         * getaddrinfo.h: Fix POSIX URL.
1393         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1394         (use_win32_p): Make static.
1395         (getaddrinfo): Reject service name if it is empty or does not consist
1396         solely of decimal digits, or if its value is > 65535.
1397         (getnameinfo): Remove useless casts.
1398
1399 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1400
1401         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1402         Autoconf 2.60 says this stuff was obsolete.
1403
1404 2006-05-12  Bruno Haible  <bruno@clisp.org>
1405
1406         * mkdtemp.c [MINGW]: Include <io.h>.
1407         (mkdir): Define using _mkdir.
1408
1409 2006-06-28  Bruno Haible  <bruno@clisp.org>
1410
1411         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1412         declaration for wcwidth.
1413         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1414
1415 2006-06-28  Eric Blake  <ebb9@byu.net>
1416
1417         * xvasprintf.h: Fix comments.
1418
1419 2006-06-28  Eric Blake  <ebb9@byu.net>
1420
1421         * mbchar.h (wcwidth): Include wcwidth.h.
1422         * mbswidth.c (wcwidth): Move from here...
1423         * wcwidth.h: ...to this new file.
1424
1425 2006-06-28  Simon Josefsson  <jas@extundo.com>
1426
1427         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1428         functions there.  It will succeed on Windows XP, but on Windows
1429         2000 and (presumably) earlier, it will fail, and use the internal
1430         re-implementation.
1431         (use_win32_p): New function.
1432         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1433         Support AI_NUMERICSERV to disable getservbyname.
1434         (getnameinfo): New function, only supports
1435         NI_NUMERICHOST|NI_NUMERICSERV for now.
1436
1437         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1438         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1439         getnameinfo.
1440
1441 2006-06-27  Bruno Haible  <bruno@clisp.org>
1442
1443         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1444
1445 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1446
1447         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1448         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1449         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1450
1451 2006-06-26  Bruno Haible  <bruno@clisp.org>
1452
1453         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1454         WCHAR_MAX.
1455         Reported by Mark D. Baushke and Larry Jones.
1456
1457 2006-06-26  Bruno Haible  <bruno@clisp.org>
1458
1459         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1460         in pre-C99 mode.
1461         Suggested by Mark D. Baushke and Larry Jones.
1462
1463 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1464
1465         * stdint_.h: Treat BSD/OS like OpenBSD.
1466
1467 2006-06-23  Bruno Haible  <bruno@clisp.org>
1468
1469         * stdint_.h: Treat IRIX like OpenBSD.
1470
1471 2006-06-23  Bruno Haible  <bruno@clisp.org>
1472
1473         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1474         ISO C 99 Technical Corrigendum 1.
1475
1476 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1477
1478         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1479         Some compiler complained about some of them.  Problem reported by
1480         Larry Jones in
1481         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1482
1483 2006-06-21  Simon Josefsson  <jas@extundo.com>
1484
1485         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1486         variable.
1487
1488         * socket_.h: Don't define WINVER.
1489
1490         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1491         slightly modified to work in gnulib.
1492
1493 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1494
1495         * read-file.c (fread_file): Start with buffer allocation of
1496         0 bytes rather than 1 byte; this simplifies the code.
1497         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1498         code to free buffer and save/restore errno.
1499         (internal_read_file): Remove unused local.
1500
1501 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1502
1503         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1504         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1505         Problem reported by Denis Excoffier in
1506         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1507
1508 2006-06-19  Simon Josefsson  <jas@extundo.com>
1509
1510         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1511
1512 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1513
1514         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1515
1516 2006-06-17  Bruno Haible  <bruno@clisp.org>
1517
1518         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1519
1520 2006-06-17  Bruno Haible  <bruno@clisp.org>
1521
1522         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1523         problem on Solaris 2.5.1.
1524
1525 2006-06-16  Eric Blake  <ebb9@byu.net>
1526
1527         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1528         * unicodeio.c [!defined errno]: Likewise.
1529         * strtol.c [!defined errno]: Likewise.
1530         * strtod.c [!defined errno]: Likewise.
1531
1532 2006-06-15  Bruno Haible  <bruno@clisp.org>
1533
1534         * stdint_.h: Rewritten to be fully auto-configured.
1535         Fixes bug on HP-UX/IA64.
1536
1537 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1538
1539         * getdate.y (__attribute__): Don't define if already defined.
1540         Problem reported by Larry Jones.
1541         * utimens.c (__attribute__): Likewise.
1542
1543 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1544
1545         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1546         reported by Andreas Schwab.
1547
1548 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1549             Bruno Haible  <bruno@clisp.org>
1550
1551         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1552
1553 2006-05-26  Martin Lambers  <marlam@marlam.de>
1554
1555         * getpass.c: Updates the test for the native W32 API, and adds
1556         missing includes, thus fixing compilation warnings.
1557
1558 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1559
1560         * tempname.c (small_open, large_open): New macros.
1561         (__open, __open64) [!_LIBC]: Remove.
1562         (__gen_tempname): Use small_open and large_open instead of __open
1563         and __open64.  This fixes a portability bug on HP-UX 11.11i
1564         reported by Simon Wing-Tang in
1565         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1566
1567 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1568
1569         * exclude.c (exclude_fnmatch): New function.
1570         (excluded_file_name): Call exclude_fnmatch.
1571         * exclude.h (excluded_file_name): New prototype
1572
1573 2006-05-24  Bruno Haible  <bruno@clisp.org>
1574
1575         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1576         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1577         Reported by Thorsten Maerz <torte@netztorte.de> via
1578         Aaron Stone <aaron@serendipity.cx>.
1579
1580 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1581
1582         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1583         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1584         (my_usleep): Don't mishandle maximum value.
1585
1586 2006-05-19  Jim Meyering  <jim@meyering.net>
1587
1588         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1589
1590 2006-05-17  Bruno Haible  <bruno@clisp.org>
1591
1592         Cygwin portability.
1593         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1594
1595 2006-05-17  Bruno Haible  <bruno@clisp.org>
1596
1597         * stdint_.h: Fix recognition of Cygwin.
1598
1599 2006-05-11  Jim Meyering  <jim@meyering.net>
1600
1601         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1602
1603 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1604
1605         * crc.c (crc32_update): Remove unnecessary L suffix.
1606         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1607         unwanted sign propagation, e.g., on hosts with 64-bit int.
1608         There still are some problems with reeelly weird theoretical hosts
1609         (e.g., 33-bit int) but it's not worth worrying about now.
1610         * sha1.c (rol): Likewise.
1611         (K1, K2, K3, K4): Remove unnecessary L suffix.
1612
1613 2006-05-10  Bruno Haible  <bruno@clisp.org>
1614
1615         * des.c: Cast to avoid warnings.
1616
1617 2006-05-10  Simon Josefsson  <jas@extundo.com>
1618
1619         * md4.c: Typo fix, update copyright years.
1620         (K1, K2): Don't use L because it turn computations into 64-bit on
1621         64-bit platforms.
1622
1623 2006-05-09  Bruno Haible  <bruno@clisp.org>
1624
1625         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1626         (EOVERFLOW): Define fallback value.
1627         (xstrcat): New function.
1628         (xvasprintf): Recognize the special case of a string concatenation.
1629
1630 2006-05-01  Bruno Haible  <bruno@clisp.org>
1631
1632         * stdint_.h: Shorter URL.
1633         * inttypes.h: Likewise.
1634
1635 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1636
1637         * verify.h: Document the internals better.  Most of this change
1638         was written by Bruno Haible.
1639
1640 2006-04-29  Bruno Haible  <bruno@clisp.org>
1641
1642         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1643         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1644
1645 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1646
1647         * getdate.y (get_date): When adding relative date, start with the
1648         initial time, not with the result of the first mktime call.
1649
1650 2006-04-23  Bruno Haible  <bruno@clisp.org>
1651
1652         * copy-file.c: Include <unistd.h> unconditionally.
1653         * execute.c: Likewise.
1654         * fatal-signal.c: Likewise.
1655         * findprog.c: Likewise.
1656         * mkdtemp.c: Likewise.
1657         * pipe.h: Likewise.
1658         * pipe.c: Likewise.
1659         * wait-process.h: Likewise.
1660
1661 2006-04-23  Bruno Haible  <bruno@clisp.org>
1662
1663         * fwriteerror.c (fwriteerror): Call fclose also when an error
1664         condition was already detected.
1665         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1666
1667 2006-04-19  Derek Price  <derek@ximbiot.com>
1668             Eric Blake  <ebb9@byu.net>
1669
1670         * inttypes.h: Correct grammar in comment.
1671
1672 2006-04-18  Derek Price  <derek@ximbiot.com>
1673             Paul Eggert  <eggert@cs.ucla.edu>
1674
1675         * inttypes.h: New file.
1676         * strtoimax.c: Assume <inttypes.h>.
1677
1678 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1679
1680         * utimens.c (futimens): glibc futimesat messes up if /proc
1681         isn't mounted.  Problem reported by Kir Kolyshkin.
1682
1683 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1684
1685         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1686         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1687         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1688
1689 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1690
1691         Merge regex changes from libc, removing some of our
1692         POSIX-conformance changes that were rejected and redoing them in a
1693         less-intrusive way.
1694
1695         * regcomp.c (re_compile_internal, init_dfa):
1696         Length arg is now size_t, not Idx.  All uses changed.
1697         (peek_token): Forward decl now says internal_function.
1698         (__re_error_msgid, __re_error_msgid_idx):
1699         Now static rather than extern with attribute_hidden.
1700         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1701         For some reason libc prefers K&R style defns for external functions.
1702         (regerror) [!defined _LIBC]: Likewise.
1703         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1704         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1705         (build_range_exp, build_collating_symbol):
1706         Use K&R-style defn.
1707         (re_compile_fastmap): Use '\0' to memset, not 0.
1708         (utf8_sb_map): Make the calculations more obvious.
1709         (init_dfa, parse_bracket_exp, build_charclass_op):
1710         Call calloc and cast result, as glibc does.
1711         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1712         (build_range_exp, build_collating_symbol):
1713         Now internal functions.
1714
1715         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1716
1717         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1718         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1719         Don't depend on VMS; depend on __VMS instead, for POSIX
1720         namespace cleanness.
1721         (regoff_t): Define to ssize_t, not long int.
1722
1723         Remove the REG_ macros named below.  Instead, make the old names
1724         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1725         __USE_GNU_REGEX.
1726         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1727         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1728         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1729         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1730         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1731         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1732         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1733         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1734         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1735         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1736         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1737         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1738         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1739         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1740         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1741         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1742         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1743         (REG_NREGS):
1744         Remove.  All uses replaced by the old RE_* names.
1745         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1746         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1747         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1748         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1749         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1750         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1751         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1752         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1753         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1754         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1755         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1756         Don't bother having these macros be independent of each others'
1757         values, since they no longer exist in the POSIX name space.
1758
1759         Rename the following member names back to their old names,
1760         unless !__USE_GNU_REGEX.  All uses changed back.
1761         (buffer): Renamed from re_buffer.
1762         (allocated): Renamed from re_allocated.
1763         (used): Renamed from re_used.
1764         (syntax): Renamed from re_syntax.
1765         (fastmap): Renamed from re_fastmap.
1766         (translate): Renamed from re_translate.
1767         (can_be_null): Renamed from re_can_be_null.
1768         (regs_allocated): Renamed from re_regs_allocated.
1769         (fastmap_accurate): Renamed from re_fastmap_accurate.
1770         (no_sub): Renamed from re_no_sub.
1771         (not_bol): Renamed from re_not_bol.
1772         (not_eol): Renamed from re_not_eol.
1773         (newline_anchor): Renamed from re_newline_anchor.
1774         (num_regs): Renamed from rm_num_regs.
1775         (start): Renamed from rm_start.
1776         (end): Renamed from rm_end.
1777
1778         (free_state): Move up a bit.
1779
1780         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1781         #define to be empty.
1782         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1783         when that is what is intended.
1784         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1785         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1786         (MAX): New macro.
1787         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1788         All uses changed back to re_malloc, etc.  It's now the caller's
1789         responsibility to check for overflow; all callers changed.
1790         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1791         (re_x2nrealloc): Remove.
1792         (free_state): Remove decl.
1793
1794         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1795         (re_set_registers, re_exec):
1796         Use K&R-style defn.
1797
1798         2006-01-31  Roland McGrath  <roland@redhat.com>
1799
1800         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1801         Reported by Mike Frysinger <vapier@gentoo.org>.
1802
1803         2006-01-15  Andreas Jaeger  <aj@suse.de>
1804
1805         [BZ #1950]
1806         * regex_internal.c (re_string_reconstruct): Adjust for
1807         build_wcs_upper_buffer change.
1808         (build_wcs_upper_buffer): Change return type.
1809
1810         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1811
1812         * regex_internal.h: Include <stdint.h> if available.
1813
1814         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1815
1816         * regex_internal.h (SIZE_MAX): Provide a default definition.
1817
1818         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1819
1820         * regcomp.c: Adjust for changed secondary hash function.
1821
1822         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1823
1824         * regex.h: Pretty printing.
1825         Clean up namespace a bit.
1826
1827         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1828
1829         * regexec.c (update_cur_sifted_state, check_arrival,
1830         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1831
1832         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1833                     Ulrich Drepper  <drepper@redhat.com>
1834
1835         [BZ #1302]
1836         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1837         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1838
1839         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1840
1841         [BZ #281]
1842         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1843         * regcomp.c: Remove unnecessary uses of
1844         unsigned RE_TRANSLATE_TYPE.
1845         * regex_internal.h: Likewise.
1846         * regex_internal.c: Likewise.
1847         * regexec.c: Likewise.
1848         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1849
1850         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1851
1852         * regexec.c (find_recover_state): Remove unnecessary
1853         initialization.
1854         (transit_state_bkref): Make DFA a const pointer.
1855         (get_subexp): Likewise.
1856         (check_arrival): Likewise.
1857         (update_cur_sifted_state): Likewise.
1858         (re_search_internal): Likewise.
1859         (prune_impossible_nodes): Likewise.
1860         (acquire_init_state_context): Likewise.
1861         (proceed_next_node): Likewise.
1862         (set_regs): Likewise.
1863         (free_fail_stack_return): Likewise.
1864         (check_arrival_expand_ecl): Mark DFA parameter as const.
1865         (check_arrival_expand_ecl_sub): Likewise.
1866         (check_subexp_limits): Likewise.
1867         (sub_epsilon_src_nodes):  Likewise.
1868         (add_epsilon_src_nodes):  Likewise.
1869         (merge_state_array): Likewise.
1870         (update_regs): Likewise.
1871         (build_trtable): Likewise.
1872         (sift_states_backward): Mark MCTX parameter as const.
1873         (build_sifted_states): Likewise.
1874         (update_cur_sifted_state): Likewise.
1875         (sift_states_mkref): Likewise.
1876         (check_arrival_expand_ecl): Mark eclosure as const.
1877         (check_dst_limits_calc_pos_1): Likewise.
1878         * regex_internal.h (re_match_context_t): Make dfa a const
1879         pointer.
1880
1881         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1882
1883         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1884         (transit_state_sb): Likewise.
1885         (transit_state_mb): Likewise.
1886         (sift_states_iter_mb): Likewise.
1887         (check_arrival_add_next_nodes): Likewise.
1888         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1889         [_LIBC] (re_search_2_stub): Use mempcpy.
1890
1891         * regex_internal.c (re_string_reconstruct): Avoid calling
1892         mbrtowc for very simple UTF-8 case.
1893
1894         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1895         a pointer-to-const.
1896         (re_acquire_state_context): Likewise.
1897         * regex_internal.h: Adjust prototypes.
1898
1899         * regex.c: Prevent using C++ compilers.
1900
1901         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1902         (re_acquire_state_context): Likewise.
1903
1904 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1905             Bruno Haible  <bruno@clisp.org>
1906
1907         * stdint_.h: On OpenBSD, don't redefine types already included in
1908         <sys/types.h> and <inttypes.h>.
1909
1910 2006-03-24  Eric Blake  <ebb9@byu.net>
1911
1912         * time_r.c (copy_string_result): Remove, as it is no longer used.
1913
1914 2006-03-24  Simon Josefsson  <jas@extundo.com>
1915
1916         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1917         including some doc fixes.
1918         (base64_encode_alloc): Fix +1 bug on allocation failures.
1919
1920 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1921
1922         * base64.c (base64_encode): Do not read past end of array with
1923         unsanitized input on systems with CHAR_BIT > 8.
1924
1925 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1926
1927         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1928         Typedef to long int, not to off_, as POSIX will likely change
1929         in that direction.
1930
1931 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1932
1933         * argp-help.c (validate_uparams): Fix typo
1934         * argp-parse.c (argp_default_options): Consistently begin help
1935         messages with a lowercase letter.
1936
1937 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1938
1939         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1940         overrun buffers and shouldn't be used (much as gets shouldn't be
1941         used).
1942         * time_r.c (asctime_r, ctime_r): Likewise.
1943
1944 2006-03-08  Simon Josefsson  <jas@extundo.com>
1945
1946         * gc-gnulib.c (randomize): Don't open files called 'no', they
1947         signal that configure disabled the device.
1948
1949 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1950
1951         * c-stack.c: Include unistd.h unconditionally, since we now assume
1952         the unistd module.
1953         * getlogin_r.c: Likewise.
1954         * getlogin_r.h: Likewise.
1955         * glob.c: Likewise.
1956         * pagealign_alloc.c: Likewise.
1957         * unistd_.h: Remove; no longer needed.
1958
1959 2006-03-07  Simon Josefsson  <jas@extundo.com>
1960
1961         * unistd_.h: New file.
1962
1963 2006-03-07  Simon Josefsson  <jas@extundo.com>
1964
1965         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1966
1967 2006-03-01  Simon Josefsson  <jas@extundo.com>
1968
1969         * readline.c: Fix typo, tiny patch from Stepan Kasal
1970         <kasal@ucw.cz>.
1971
1972 2006-02-28  Simon Josefsson  <jas@extundo.com>
1973
1974         * getopt.c: Protect #include of unistd.h, for MSVS.
1975
1976 2006-02-27  Simon Josefsson  <jas@extundo.com>
1977
1978         * base64.h: Indent #define's.  From Jim Meyering
1979         <jim@meyering.net>.
1980
1981 2006-02-27  Jim Meyering  <jim@meyering.net>
1982
1983         Revert the change of 2006-02-24, so these files can continue
1984         to be sync'd from gettext.
1985         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1986         of `config.h'.
1987
1988 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1989
1990         * glob.c: Say "invalid" rather than "illegal" in comments.
1991
1992 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1993
1994         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1995
1996 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1997
1998         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1999         AT_FDCWD exceeds INT_MAX.
2000         * openat.h (AT_FDCWD): Likewise.
2001
2002 2006-02-14  Jim Meyering  <jim@meyering.net>
2003
2004         Sync from coreutils.
2005
2006         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2007         failure on deficient systems, and simplify gnulib lgpl dependencies.
2008         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2009         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2010
2011         * xalloc-die.c: Remove unused definition of N_.
2012
2013 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2014
2015         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2016
2017 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
2018
2019         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2020         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2021
2022 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2023
2024         * argp-namefrob.h: Restore changes accidentally lost during the
2025         "autoupdate" on 2005-12-12.
2026
2027 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
2028
2029         * fnmatch.c (L_): Renamed from L, to work around a bug in
2030         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2031         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2032         All uses changed.
2033
2034 2006-01-26  Simon Josefsson  <jas@extundo.com>
2035
2036         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2037         prototype is visible on mingw32.
2038
2039         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2040         for mingw32.
2041
2042         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2043         mingw32).
2044
2045 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2046
2047         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
2048         attempt to open for write; this always fails, at least on POSIX
2049         hosts.  This reinstates the 2006-01-09 change, which was
2050         inadvertently removed.
2051
2052 2006-01-26  Bruno Haible  <bruno@clisp.org>
2053             Paul Eggert  <eggert@cs.ucla.edu>
2054
2055         * stdbool_.h (_Bool)
2056         [(! (defined __cplusplus || defined __BEOS__)
2057           && !defined __GNUC__
2058           && !(defined __HP_cc || defined __xlc__
2059                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2060                || defined __sgi))]:
2061         #define to signed char in these cases too; this simplifies
2062         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2063         etc., separately) and makes it more conservative.
2064
2065 2006-01-21  Jim Meyering  <jim@meyering.net>
2066
2067         Sync from the stable (b5) branch of coreutils:
2068
2069         * fts.c (fts_children): Don't let close() clobber errno from
2070         failed fchdir().
2071
2072         * fts.c (fts_stat): When following a symlink-to-directory,
2073         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2074         a dangling symlink.  That can also happen at least for ELOOP.
2075         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2076         FYI, this bug predates the inclusion of fts.c in coreutils.
2077
2078         * fts.c (fts_open): Put new maxarglen declaration and uses
2079         in their own block, so pre-c99 compilers don't object.
2080
2081         Avoid the double-free (first in fts_read, second in fts_close) that
2082         would occur when an `active' directory is made inaccessible (e.g.,
2083         via chmod a-x) during a traversal.
2084         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2085         before returning.  Reproduce this failure by
2086         mkdir -p a/b; cd a; chmod a-x . b
2087         Reported by Stavros Passas.
2088
2089 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2090
2091         * argp-namefrob.h: Bugfix. Remove stray #
2092
2093 2006-01-25  Bruno Haible  <bruno@clisp.org>
2094
2095         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2096         warnings.
2097         Reported by Paul Eggert.
2098
2099 2006-01-25  Jim Meyering  <jim@meyering.net>
2100
2101         * fileblocks.c: Remove more useless parentheses.
2102         * readutmp.h: Likewise.
2103
2104 2006-01-24  Bruno Haible  <bruno@clisp.org>
2105
2106         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2107         has it.
2108         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2109         2005-11-26.
2110
2111         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2112         to avoid problems with the built-in _Bool type.
2113         Reported by Paul Eggert on 2005-11-26.
2114
2115 2006-01-24  Jim Meyering  <jim@meyering.net>
2116
2117         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2118
2119 2006-01-24  Simon Josefsson  <jas@extundo.com>
2120
2121         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2122         Bruno.
2123
2124 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2125
2126         Work around porting bugs reported by Dieter in
2127         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2128         * getopt.c (_NOPROTO): Remove; no longer needed.
2129         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2130         Include "getopt.h" first, to check interface.
2131         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2132         !HAVE_DECL_GETENV.
2133         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2134         (__strndup): Revert to K&R-style function dfns, the glibc style.
2135         * strnlen.c: Don't claim it's taken from glibc; it's not.
2136         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2137         Include strnlen.h first, to get prototype properly.
2138         (strnlen): Renamed from __strnlen.
2139         Remove weak alias.
2140
2141 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2142
2143         These changes imported from libc.
2144         * getopt.c: Use __fxprintf instead of inline stream orientation
2145         test and two separate function calls.
2146         * strndup.c (__strndup): Add libc_hidden_def.
2147
2148 2006-01-22  Bruno Haible  <bruno@clisp.org>
2149
2150         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2151         temporary buffer for sprintf, take into account the precision also
2152         for 'd', 'i', 'u', 'o', 'x', 'X'.
2153
2154 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2155
2156         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2157         to pacify gcc -Wswitch-default.
2158
2159 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2160
2161         * argp-help.c (usage_long_opt): Do not print DOC options.
2162         (__argp_base_name): Removed
2163         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2164         typo.
2165         (__argp_base_name): Provide macro definition or extern declaration
2166         depending on the configuration
2167
2168 2006-01-20  Simon Josefsson  <jas@extundo.com>
2169
2170         * inet_ntop.h: Unconditionally include sys/socket.h.
2171
2172 2006-01-19  Simon Josefsson  <jas@extundo.com>
2173
2174         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2175
2176 2006-01-12  Simon Josefsson  <jas@extundo.com>
2177
2178         * base64.c: Fix warning, reported by Bruno Haible
2179         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2180
2181 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2182
2183         Sync from coreutils.
2184         * md5.c: Fix commentary typos.
2185         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2186         * md5.h (__attribute__): Remove; unused.
2187         * sha1.c: Fix commentary to match md5 better.
2188         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2189         so that we don't need to worry about alignment.  All uses changed.
2190         This merges the 2005-10-28 md5 change into sha1.
2191
2192 2006-01-11  Jim Meyering  <jim@meyering.net>
2193
2194         Sync from coreutils.
2195         * md5.c (OP): Fix spacing.
2196
2197 2006-01-11  Simon Josefsson  <jas@extundo.com>
2198
2199         * stdint_.h (SIZE_MAX): Add missing (.
2200
2201 2006-01-10  Bruno Haible  <bruno@clisp.org>
2202
2203         * argp.h (__const): Remove macro. Use const instead.
2204         * argp-fmtstream.h (__const): Likewise.
2205         * glob_.h (__const): Remove macro.
2206         * glob-libc.h: Use const instead of __const.
2207
2208 2006-01-10  Jim Meyering  <jim@meyering.net>
2209
2210         Avoid the double-free (first in fts_read, second in fts_close) that
2211         would occur when an `active' directory is made inaccessible (e.g.,
2212         via chmod a-x) during a traversal.
2213         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2214         before returning.  Reproduce this failure by
2215         mkdir -p a/b; cd a; chmod a-x . b
2216         Reported by Stavros Passas.
2217
2218         Sync from coreutils.
2219         * sha1.c: Tweak grammar in a comment.
2220
2221 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2222
2223         * regex_internal.h (BITSET_WORD_BITS):
2224         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2225         preprocessor mishandles large unsigned values as if they were signed.
2226         Problem reported by Claudio Fontana in
2227         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2228
2229 2006-01-10  Simon Josefsson  <jas@extundo.com>
2230
2231         * socket_.h: New file.
2232
2233 2006-01-10  Bruno Haible  <bruno@clisp.org>
2234
2235         * localcharset.c: Update from GNU gettext.
2236
2237 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2238
2239         Sync from coreutils.
2240         * chdir-long.c (cdb_free): Don't bother trying to open directory
2241         for write access: POSIX says that must fail.
2242         * fts.c (diropen): Likewise.
2243         * save-cwd.c (save_cwd): Likewise.
2244         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2245         well, for minor improvements on hosts that lack O_DIRECTORY.
2246         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2247         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2248         Fall back on chown if open failed with EACCES.
2249
2250         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2251         Report an error at compile-time if only a 1-second nominal clock
2252         resolution is found.
2253
2254         * lchmod.h: New file.
2255         * mkdir-p.c: Include lchmod.h, lchown.h.
2256         (make_dir_parents): Use lchown rather than chown, and
2257         lchmod rather than chmod.
2258
2259         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2260         too.  Problem with "none" reported by Bob Proulx.  Problem with
2261         "proc" reported by n0dalus.
2262
2263         * mountlist.c: Include <limits.h>.
2264         (dev_from_mount_options)
2265         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2266         New function.  It no longer assumes "dev=" has the System V meaning
2267         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2268         (read_file_system_list)
2269         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2270         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2271         dev= in that case.
2272
2273         * posixtm.h (PDS_PRE_2000): New macro.
2274         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2275         All usages changed.  Reject dates outside the range 1969-1999 if
2276         PDS_PRE_2000 is used.
2277
2278 2006-01-09  Jim Meyering  <jim@meyering.net>
2279
2280         Sync from coreutils.
2281
2282         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2283
2284         * chdir-safer.h, chdir-safer.c: New files.
2285
2286         * modechange.c (mode_compile): Reject an invalid mode string
2287         that starts with an octal digit.  From Andreas Gruenbacher.
2288
2289         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2290         and dup to open_safer and dup_safer, respectively.
2291         (openat_permissive): Fix typo in comment.
2292
2293         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2294         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2295         (_): Remove; no longer needed.
2296         (openat): Renamed from rpl_openat; no need for rpl_openat
2297         since openat.h renames openat for us.
2298         Replace most of the body with a call to openat_permissive,
2299         to avoid duplicate code.
2300         Port to (probably hypothetical) environments were mode_t is
2301         wider than int.
2302         (openat_permissive): Require mode arg, so that we can check
2303         types better.  Put it just after flags.  Change cwd failure
2304         indicator from pointer-to-bool to pointer-to-errno-value.
2305         All callers changed.
2306         Invoke openat_save_fail and/or openat_restore_fail if
2307         cwd_errno is null, so that openat can call us.
2308         (openat_permissive, fdopendir, fstatat, unlinkat):
2309         Simplify errno handling to avoid some duplicate code,
2310         as it's OK to set errno on success.
2311         * openat.h: Revamp code so that function macros depend on
2312         __OPENAT_PREFIX only, not also on AT_FDCWD.
2313         (openat_ro): Remove.  Caller changed to use openat_permissive.
2314         (openat_permissive): Now a macro, if not a function.
2315         (openat_restore_fail, openat_save_fail): Now always functions,
2316         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2317
2318         * openat-priv.h: New file, defining macros used by mkdirat.c
2319         and openat.c.
2320         * mkdirat.c: Include openat-priv.h.
2321         Remove definitions of macros defined therein.
2322         * openat.c: Likewise.
2323
2324         * mkdirat.c (mkdirat): New file and function.
2325         * openat.h (mkdirat): Declare.
2326
2327         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2328
2329         * openat.h (openat_permissive): Declare.
2330         (openat_ro): Define.
2331
2332         * openat.c (EXPECTED_ERRNO): New macro.
2333         (openat_permissive): New function -- used in remove.c rewrite.
2334         (all functions): Set errno just before returning, only if there
2335         was an actual failure.
2336         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2337
2338         Emulate openat-family functions using Linux's procfs, if possible.
2339         Idea and some code based on Ulrich Drepper's glibc changes.
2340
2341         * openat.c: (BUILD_PROC_NAME): New macro.
2342         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2343         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2344         before falling back on save_cwd and restore_cwd.
2345         (fdopendir, fstatat, unlinkat): Likewise.
2346
2347         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2348         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2349
2350         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2351         as second argument to va_arg.  Otherwise, some versions of gcc
2352         warn that `if this code is reached, the program will abort'.
2353
2354 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2355
2356         Sync from coreutils.
2357
2358         Add POSIX ACL support
2359         * acl.h (copy_acl, set_acl): Add declarations.
2360         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2361         systems other than Linux.
2362         (chmod_or_fchmod): New function: use fchmod when possible,
2363         and chmod otherwise.
2364         (file_has_acl): Add a POSIX ACL implementation, with a
2365         Linux-specific subcase.
2366         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2367         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2368         acls are unsupported.
2369         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2370         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2371         are unsupported.
2372
2373 2006-01-09  Bruno Haible  <bruno@clisp.org>
2374
2375         * sysexit_.h (EX_OK): New macro.
2376         Suggested by Martin Lambers <marlam@marlam.de>.
2377
2378 2006-01-09  Bruno Haible  <bruno@clisp.org>
2379
2380         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2381         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2382         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2383         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2384
2385 2006-01-09  Bruno Haible  <bruno@clisp.org>
2386
2387         * stdint_.h (SIZE_MAX): Write the value without involving negative
2388         numbers.
2389
2390 2005-10-16  Bruno Haible  <bruno@clisp.org>
2391
2392         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2393         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2394
2395 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2396
2397         * strftime.c (tzname): Don't declare if it is already #defined.
2398         Problem reported for Mingw by Mark Junker.
2399
2400 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2401
2402         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2403         long int, not int, for nanosecond counts, so that people who are
2404         used to POSIX struct timespec won't be surprised.  Reported by Jim
2405         Meyering.
2406
2407 2005-12-16  Jim Meyering  <jim@meyering.net>
2408
2409         * fprintftime.c, fprintftime.h: New files.
2410
2411 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2412
2413         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2414         * argp-help.c (fill_in_uparams): Check if the constructed
2415         struct uparams is valid. Fall back to the default values if it is
2416         not.
2417
2418 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2419
2420         * argp-help.c (__argp_base_name): New function
2421         (__argp_short_program_name): Rewrite using __argp_base_name
2422         * argp-namefrob.h: Define program_invocation_name and
2423         program_invocation_short_name if requested
2424         (__argp_base_name): Add prototype
2425         * argp-parse.c (argp_def): Use gettext wrappers
2426         (argp_default_parser): Use __argp_base_name
2427         * argp-pin.c: New file. Defines program_invocation_name and
2428         program_invocation_short_name on systems that lack them.
2429
2430 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2431
2432         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2433         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2434         porting problem reported by Georg Schwarz in
2435         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2436
2437 2005-07-09  Bruno Haible  <bruno@clisp.org>
2438
2439         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2440         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2441         Reported by Mark Junker <mjscod@gmx.de>.
2442
2443 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2444
2445         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2446         (uintmax_t) [defined uintmax_t]: Do not declare.
2447         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2448         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2449         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2450         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2451         sake of portability to weird hosts that C allows (though we don't
2452         know of any practical examples).
2453
2454         * savedir.h (fdsavedir): New decl.
2455         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2456         contains most of the former guts of savedir.
2457         (savedir): Use savedirstream.
2458         Include "openat.h".
2459
2460 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2461
2462         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2463         coreutils no longer futzes with rounding modes.
2464
2465 2005-11-14  Jim Meyering  <jim@meyering.net>
2466
2467         * mkstemp-safer.c: Include <config.h>, required for possible
2468         replacement of mkstemp.
2469
2470 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2471
2472         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2473         business.
2474         (gethrxtime) [! (HAVE_NANOUPTIME
2475         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2476         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2477         our own approximation.
2478
2479 2005-11-10  Simon Josefsson  <jas@extundo.com>
2480
2481         * readline.c: Remove EOL.
2482
2483 2005-11-08  Eric Blake  <ebb9@byu.net>
2484
2485         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2486
2487 2005-11-08  Eric Blake  <ebb9@byu.net>
2488
2489         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2490
2491 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2492
2493         Fix porting problem reported by Theodoros V. Kalamatianos.
2494         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2495         Don't assume that futimes failing means we must fail.
2496
2497 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2498
2499         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2500         leave errno alone.  Problem reported by Dmitry V. Levin.
2501
2502 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2503
2504         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2505         errno alone.  Problem reported by Frederic Jolliton.
2506
2507 2005-10-28  Simon Josefsson  <jas@extundo.com>
2508
2509         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2510         "restrict" keywords, as per POSIX.  Protect the function
2511         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2512         Don't use K&R prototypes.  Check the sprintf return values.
2513         Re-define EAFNOSUPPORT if not present.  Indent.
2514
2515         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2516         suggested by Bruno Haible <bruno@clisp.org>.
2517
2518         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2519
2520         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2521
2522         * gc-libgcrypt.c: Add MD2 (which is not available through
2523         libgcrypt).
2524
2525         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2526
2527         * md2.h, md2.c: New files.
2528
2529 2005-10-24  Simon Josefsson  <jas@extundo.com>
2530
2531         * md4.h: Shrink buffer size, now that we changed the type.
2532
2533 2005-10-22  Simon Josefsson  <jas@extundo.com>
2534
2535         * arcfour.h, arcfour.c: Use fixed size indices in the
2536         arcfour_context struct (simplify test vector testing in GNU
2537         Shishi).
2538
2539 2005-10-22  Simon Josefsson  <jas@extundo.com>
2540
2541         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2542         suggested by Bruno Haible <bruno@clisp.org>.
2543
2544 2005-10-22  Simon Josefsson  <jas@extundo.com>
2545
2546         * crc.h: Include stddef.h, for size_t.
2547
2548 2005-10-21  Simon Josefsson  <jas@extundo.com>
2549
2550         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2551         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2552
2553 2005-10-21  Simon Josefsson  <jas@extundo.com>
2554
2555         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2556         block.
2557
2558 2005-10-21  Simon Josefsson  <jas@extundo.com>
2559
2560         * gc-gnulib.c: Support ARCTWO in CBC mode.
2561
2562 2005-10-21  Simon Josefsson  <jas@extundo.com>
2563
2564         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2565         <bruno@clisp.org>.
2566
2567         * hmac-sha1.c (hmac_sha1): Likewise.
2568
2569         * crc.c (crc32_update): Actually use crc parameter, suggested by
2570         Bruno Haible <bruno@clisp.org>.
2571
2572         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2573         <bruno@clisp.org>.
2574
2575 2005-10-21  Simon Josefsson  <jas@extundo.com>
2576
2577         * des.h, des.c: New files.
2578
2579         * gc-gnulib.c: Support DES.c
2580
2581 2005-10-21  Simon Josefsson  <jas@extundo.com>
2582
2583         * arctwo.h, arctwo.c: New files.
2584
2585         * gc-gnulib.c: Support ARCTWO.
2586
2587 2005-10-21  Simon Josefsson  <jas@extundo.com>
2588
2589         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2590
2591 2005-10-19  Simon Josefsson  <jas@extundo.com>
2592
2593         * gc-gnulib.c: Support ARCFOUR.
2594
2595 2005-10-19  Simon Josefsson  <jas@extundo.com>
2596
2597         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2598         support.
2599
2600         * gc.h: Add ECB enum type.
2601
2602         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2603
2604 2005-10-19  Simon Josefsson  <jas@extundo.com>
2605
2606         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2607
2608 2005-10-18  Simon Josefsson  <jas@extundo.com>
2609
2610         * md4.h, md4.c: New files, based on md5.?.
2611
2612 2005-10-17  Simon Josefsson  <jas@extundo.com>
2613
2614         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2615
2616         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2617
2618 2005-10-17  Simon Josefsson  <jas@extundo.com>
2619
2620         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2621
2622 2005-10-17  Simon Josefsson  <jas@extundo.com>
2623
2624         * gc.h, gc-libgcrypt.c: Add ciphers.
2625
2626 2005-10-17  Simon Josefsson  <jas@extundo.com>
2627
2628         * sha1.c: Use uint32_t instead of md5_uint32.t
2629
2630         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2631         md5.h.
2632
2633         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2634
2635         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2636
2637 2005-10-15  Simon Josefsson  <jas@extundo.com>
2638
2639         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2640
2641         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2642
2643 2005-10-14  Simon Josefsson  <jas@extundo.com>
2644
2645         * arcfour.h, arcfour.c: New files.
2646
2647 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2648
2649         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2650         include <wchar.h>; no longer needed.
2651
2652 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2653         and  Ulrich Drepper  <drepper@redhat.com>
2654
2655         Import from libc.
2656         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2657         instead of inline stream orientation test and two separate
2658         function calls.  Pay no attention to USE_IN_LIBIO.
2659
2660 2005-10-14  Roland McGrath  <roland@redhat.com>
2661
2662         Import from libc.  [BZ #1331]
2663         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2664         macro argument.
2665         Reported by Matej Vela <vela@debian.org>.
2666
2667 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2668
2669         * mkdir-p.c (make_dir_parents): Don't report an error if an
2670         intermediate directory is in a read-only file system.  Problem
2671         reported by Eric Blake.
2672
2673 2005-10-13  Simon Josefsson  <jas@extundo.com>
2674
2675         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2676         Move memory allocation outside of loop.
2677
2678 2005-10-12  Simon Josefsson  <jas@extundo.com>
2679
2680         * gc-pbkdf2-sha1.c: New file.
2681
2682         * gc.h: Add gc_pbkdf2_sha1 prototype.
2683
2684 2005-10-12  Simon Josefsson  <jas@extundo.com>
2685
2686         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2687         suggested by Bruno Haible <bruno@clisp.org>.
2688
2689 2005-10-12  Simon Josefsson  <jas@extundo.com>
2690
2691         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2692
2693         * gc-gnulib.c (gc_hmac_sha1): New function.
2694
2695 2005-10-12  Simon Josefsson  <jas@extundo.com>
2696
2697         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2698
2699 2005-10-12  Simon Josefsson  <jas@extundo.com>
2700
2701         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2702         GC_USE_HMAC_MD5, respectively.
2703
2704         * gc-libgcrypt.c (gc_md5): Fix assert call.
2705         (gc_md5): Fix typo.
2706
2707         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2708
2709         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2710
2711         * gc-gnulib.c (gc_hash_buffer): Ditto.
2712
2713 2005-10-11  Bruno Haible  <bruno@clisp.org>
2714
2715         * c-strcasestr.h: New file, from GNU gettext.
2716         * c-strcasestr.c: New file, from GNU gettext.
2717
2718 2005-10-11  Bruno Haible  <bruno@clisp.org>
2719
2720         * c-strcase.h: New file, from GNU gettext.
2721         * c-strcasecmp.c: New file, from GNU gettext.
2722         * c-strncasecmp.c: New file, from GNU gettext.
2723
2724 2005-10-11  Simon Josefsson  <jas@extundo.com>
2725
2726         * crc.h, crc.c: New files.
2727
2728         * gc.h (gc_hash_buffer): Add doc.
2729
2730 2005-10-08  Simon Josefsson  <jas@extundo.com>
2731
2732         * gc.h: Add gc_hash and gc_hash_buffer.
2733
2734         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2735
2736         * gc-libgcrypt.c (gc_hash_buffer): Add.
2737
2738 2005-10-11  Bruno Haible  <bruno@clisp.org>
2739
2740         * strcasecmp.c: Include limits.h.
2741         (strcasecmp): Avoid integer overflow on exotic platforms.
2742         * strncasecmp.c: Include limits.h.
2743         (strncasecmp): Avoid integer overflow on exotic platforms.
2744         Reported by Paul Eggert.
2745
2746 2005-10-06  Simon Josefsson  <jas@extundo.com>
2747
2748         * hmac-md5.c: New file.
2749
2750         * hmac.h: New file.
2751
2752 2005-10-06  Simon Josefsson  <jas@extundo.com>
2753
2754         * memxor.c (memxor): Avoid casts and warnings.
2755
2756 2005-10-05  Derek Price  <derek@ximbiot.com>
2757
2758         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2759
2760 2005-10-05  Simon Josefsson  <jas@extundo.com>
2761
2762         * memxor.c (memxor): Fix compiler error.
2763
2764         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2765         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2766
2767         * memxor.h, memxor.c: New files.
2768
2769         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2770         we assume all systems have it, suggested by Jim Meyering
2771         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2772         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2773         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2774         same reasons.
2775
2776 2005-10-04  Bruno Haible  <bruno@clisp.org>
2777
2778         * verify.h (verify_true): Provide alternative definition for C++.
2779
2780 2005-10-04  Simon Josefsson  <jas@extundo.com>
2781
2782         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2783         D. Baushke" <mdb@gnu.org>.
2784
2785 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2786
2787         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2788         (SSIZE_MAX): New macro, if not already defined.
2789         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2790         than 2 GiB.
2791
2792 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2793
2794         * exclude.c: Include verify.h.
2795         (verify): Remove.  All callers changed to use verify.h's version.
2796         * strtoimax.c: Likewise.
2797         * utimecmp.c: Likewis.e
2798
2799         Sync from coreutils.
2800         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2801         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2802         * .cvsignore: Add fts.h, search.h, t-fpending.
2803         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2804         bother returning ENOSYS if settimeofday or stime fails; just let
2805         them return whatever errno they want to return.
2806         * utimens.c: Include unistd.h, for dup2.
2807         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2808         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2809
2810 2005-10-02  Jim Meyering  <jim@meyering.net>
2811
2812         Sync from coreutils.
2813         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2814         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2815         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2816         Remove AT_FDCWD test.
2817         Do not consume the fd unless successful.
2818         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2819         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2820         block, so that we don't even try to compile it if settimeofday is
2821         available.  This works around a compilation failure on OSF1 V5.1,
2822         due to stime requiring a `long int*' while tv_sec is `int'.
2823
2824 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2825
2826         * getdelim.c (getdelim): Remove unused variables.
2827
2828 2005-10-01  Simon Josefsson  <jas@extundo.com>
2829
2830         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2831         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2832         AI_* and EAI_* definitions.  Protect function declarations.
2833
2834 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2835
2836         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2837         so that the code works even with ancient cpp.  Portability problem
2838         with GCC 2.7.2.1 reported by Thomas M.Ott.
2839
2840 2005-09-27  Jim Meyering  <jim@meyering.net>
2841
2842         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2843
2844         * intprops.h (signed_type_or_expr__): Define.
2845         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2846         for unsigned types.
2847
2848 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2849
2850         * verify.h (verify_expr): Remove, replacing with:
2851         (verify_true): New macro that returns true instead of void.
2852         (verify_type__): Remove.
2853         (verify): Use verify_true rather than verify_type__.
2854
2855 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2856
2857         * utimens.c (ENOSYS): Define if not already defined.
2858         (futimens): Support having a null PATH if the file descriptor
2859         is nonnegative.
2860
2861         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2862         Remove.
2863         (__attribute): Define to empty unless GCC 3.1 or later.
2864         This works around a core dump on OpenBSD 3.4, which has GCC
2865         2.95.3, which dumps core when given __attribute__(()).  It also
2866         simplifies other tests, since we really don't want to bother with
2867         worrying about which ancient version of GCC supported what.
2868         Original problem reported by Yoann Vandoorselaere, with part of
2869         the fix suggested by Derek Price.
2870
2871 2005-09-24  Jim Meyering  <jim@meyering.net>
2872
2873         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2874         so we can once again use a positive bitfield width of 1 -- now we
2875         don't have to explain why we were using a bitfield width of 2.
2876
2877 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2878
2879         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2880         Problem reported by Eric Blake.
2881         (getaddrinfo): Initialize se so that it's not garbage.
2882         Redo internal storage allocation so that it doesn't make unportable
2883         assumptions about alignment.
2884         Fix a memory leak.
2885
2886         * utimens.c (futimens): Use futimesat if available.
2887         Prefer it to futimes since it doesn't have the futimes bug.
2888
2889         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2890         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2891         Instead, declare a function that returns a pointer to an array,
2892         and use verify_type__ to declare the size of the array.
2893         Problem and germ of a solution reported by Bruno Haible.
2894         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2895         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2896
2897 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2898
2899         Sync from coreutils.
2900
2901         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2902         stat-time.h.
2903         * argmatch.h: Include verify.h
2904         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2905         (ARGMATCH_ASSERT): Remove; unused.
2906         * canonicalize.c: Assume STDC_HEADERS.
2907         * exclude.c: Include "strcase.h".
2908         * regex_internal.h [!defined _LIBC]: Likewise.
2909         * getusershell.c: Include stdio--.h rather than stdio.h
2910         and stdio-safer.h.
2911         (getusershell): Call fopen, not fopen_safer.
2912         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2913         Do not include unistd-safer.h.
2914         (save_cwd): Don't call fd_safer; no longer needed
2915         now that we include fcntl--.h.
2916
2917         * getdate.y (relative_time): New type.
2918         (RELATIVE_TIME_0): New constant.
2919         (parser_control): Use relative_time instead of doing it ourselves.
2920         (%union): Add new relative_time rel member.
2921         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2922         Now typeless.
2923         (relunit, relunit_snumber): Now of type rel.
2924         (zone, rel, relunit, get_date): Adjust to above changes.
2925
2926         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2927         Do not include unistd-safer.h.
2928         (getloadavg): Don't call fd_safer; no longer needed
2929         now that we include fcntl--.h.
2930
2931         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2932         (make_dir_parents): Treat ENOSYS like EEXIST.
2933
2934         Improve quality of diagnostics on restore_cwd failure.
2935         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2936         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2937         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2938         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2939         each time through the loop.  Do not diagnose restore_cwd failure;
2940         that is the caller's job (and perhaps the caller does not care).
2941
2942         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2943         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2944         If the file already exists but is not a directory, don't bother
2945         to try to make its parents.
2946         Close potential file descriptor leak if we can't chdir("/") (!).
2947         Don't always return true if chdir($PWD) fails; return true only
2948         if the requested action was done successfully (except for the
2949         chdir($PWD)).
2950         Don't log final directory unless we actually made it.
2951         Refactor to avoid duplicate code to fix up permissions.
2952         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2953
2954         * strftime.c (my_strftime): Rewrite the previous change slightly,
2955         to make it a bit faster and (I hope) clearer.
2956         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2957         Fix bug in formats like %2N.
2958
2959         * verify.h: New file.
2960
2961 2005-09-22  Jim Meyering  <jim@meyering.net>
2962
2963         Sync from coreutils.
2964
2965         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2966
2967         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2968         the .tm_year member, since otherwise gcc-4.0 would now warn about
2969         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2970
2971         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2972         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2973
2974         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2975         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2976         when run in a time zone for which daylight savings time is in effect
2977         for the starting date.
2978
2979         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2980         stop us from restricting permissions of just-created absolute-named
2981         directories.
2982         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2983         to restore initial working directory.
2984         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2985         to tell caller if/when we change the working directory and are
2986         unable to return to the initial one.
2987         * mkdir-p.h (make_dir_parents): Update prototype.
2988         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2989         `return false'.  This fixes a bug introduced on 2004-07-30.
2990
2991         * openat.c (fdopendir): Be sure to close the supplied
2992         file descriptor before returning.  This makes our replacement
2993         implementation a little closer to Solaris's, where fdopendir
2994         ties the file descriptor to the returned DIR* pointer.
2995         * openat.c (unlinkat): New function.
2996         * openat.h (unlinkat): Add prototype.
2997         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2998         (openat_restore_fail): Rename from openat_restore_die.
2999         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3000
3001         Provide an alternative to exiting immediately upon save_cwd or
3002         restore_cwd failure.  Now, an application can arrange e.g.,
3003         to perform a longjump in that case.
3004         * openat.c: Include dirname.h.
3005         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3006         (rpl_openat, fdopendir, fstatat): Call openat_save_die
3007         and openat_restore_die rather than calling error directly.
3008         Don't include "error.h" or "exitfail.h"; they're no longer needed.
3009
3010         * openat-die.c (openat_save_die, openat_restore_die): New file.
3011         * openat.h (openat_save_die, openat_restore_die): Declare and define.
3012
3013         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3014         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3015                             int utc, int nanoseconds);
3016         Background:
3017         date should not have to allocate a megabyte of virtual memory to
3018         handle a format argument like +%1048575T.  When implemented with
3019         strftime, it must allocate such a buffer, use strftime to fill it
3020         in, print it, then free it.
3021         With fprintftime, it simply prints everything and exits.
3022         With no need for memory allocation, that's one fewer way to fail.
3023         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3024         optional field width, not before, so we accept %9:z, not %:9z.
3025         (my_strftime): Be sure to use L_('x') for literals.
3026
3027         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3028         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3029         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3030         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3031         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3032         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3033         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3034         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3035         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3036
3037         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3038         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3039         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3040         and don't include <sys/file.h>).
3041
3042 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
3043
3044         Sync from coreutils.
3045
3046         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3047         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3048         [!LDAV_DONE]: Avoid unused variable warning.
3049
3050 2005-09-21  Bruno Haible  <bruno@clisp.org>
3051
3052         * unicodeio.h (unicode_to_mb): New declaration.
3053
3054 2005-09-20  Derek Price  <derek@ximbiot.com>
3055
3056         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3057
3058 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3059
3060         Use a consistent style for including <config.h>.
3061         * __fpending.c, acl.c, argmatch.c,
3062         argp-help.c, argp-parse.c,
3063         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3064         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3065         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3066         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3067         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3068         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3069         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3070         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3071         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3072         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3073         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3074         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3075         modechange.c, mountlist.c, open-safer.c, physmem.c,
3076         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3077         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3078         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3079         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3080         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3081         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3082         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3083         userspec.c, utimecmp.c, version-etc-fsf.c,
3084         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3085         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3086         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3087         Standardize inclusion of config.h.
3088         * __fpending.h, dirfd.h, getdate.h, human.h,
3089         inttostr.h:  Removed inclusion of config.h from header files.
3090         * inttostr.c:  Adjusted in-tree users.
3091         * timespec.h: Remove superfluous warning to include config.h.
3092         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3093         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3094         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3095         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3096
3097 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3098
3099         * stat-time.h: New file.
3100         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3101         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3102         in a different way.
3103         (timespec_cmp): New function.
3104         * utimecmp.c: Include stat-time.h.
3105         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3106         members exist, not on the obsolescent ST_MTIM_NSEC.
3107         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3108
3109 2005-09-15  Derek Price  <derek@ximbiot.com>
3110             Paul Eggert  <eggert@cs.ucla.edu>
3111
3112         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3113         changes, consolidating in...
3114         * regex_internal.h: ...this file.
3115
3116 2005-09-15  Derek Price  <derek@ximbiot.com>
3117
3118         * regex_internal.h: Blank `pure' for GNUC < 3.
3119         * regex_internal.c: Ditto, using this...
3120         (__GNUC_PREREQ): ...new macro.
3121         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3122         (__GNUC_PREREQ): ...this new macro.
3123
3124         * strstr.h: Include string.h. Define strstr as a macro here.
3125
3126 2005-09-13  Derek Price  <derek@ximbiot.com>
3127
3128         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3129         failure.
3130         Reported by Jim Meyering  <jim@meyering.net>.
3131
3132 2005-09-13  Jim Meyering  <jim@meyering.net>
3133
3134         * canon-host.c: Filter through gnu indent and reword comments slightly.
3135         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3136
3137 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3138
3139         * base64.c: Typo.
3140         (base64_encode): Put b64str in initialized data section.
3141
3142 2005-09-12  Derek Price  <derek@ximbiot.com>
3143
3144         Return usable errors from canon-host.
3145         * canon-host.h: New file.
3146         * canon-host.c (canon_host): Wrap...
3147         (canon_host_r): ...this new function, which now relies exclusively on
3148         getaddrinfo.
3149         (ch_strerror): New function.
3150         (last_cherror): New global.
3151         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3152         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3153         void *.
3154         (freeaddrinfo): Free ai->ai_canonname when set.
3155
3156 2005-09-12  Derek Price  <derek@ximbiot.com>
3157             Paul Eggert  <eggert@cs.ucla.edu>
3158
3159         * glob-libc.h: Renamed from glob_.h.  The new version is
3160         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3161         protecting things that should be done only in gnulib contexts.
3162         * glob_.h: New file, containing only the glob things needed for
3163         gnulib.
3164         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3165         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3166         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3167         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3168         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3169         and to respect the namespace rules better.
3170
3171 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3172
3173         Merge glibc and coreutils changes into gnulib, plus a few
3174         extra fixes.
3175         * md5.c: Use #error rather than a string.
3176         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3177         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3178         (__attribute__): Define to empty for non recent-GCC.
3179         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3180         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3181         Renamed from their non-__ counterparts, with new macros replacing
3182         them if not _LIBC.  Add __THROW attribute.
3183         (rol): Remove.
3184         (struct md5_ctx): Align buffer if using GCC.
3185         * sha1.h (struct sha1_ctx): Likewise.
3186         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3187         The old name was backwards.
3188         (NOTSWAP): Remove; not used.
3189         (rol): New macro, moved here from md5.h.
3190         (sha1_process_block): Remove a FIXME that doesn't make sense.
3191
3192 2005-09-12  Derek Price  <derek@ximbiot.com>
3193
3194         * gai_strerror.c: Include config.h when available.  Include
3195         getaddrinfo.h before other headers to test interface.
3196         Reported by Larry Jones <lawrence.jones@ugs.com>.
3197
3198 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3199
3200         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3201         definitions, since that's the preferred style in glibc.
3202         Fix a minor spacing issue, and update copyright notice to match glibc's.
3203
3204 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3205
3206         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3207
3208 2005-09-06  Simon Josefsson  <jas@extundo.com>
3209
3210         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3211         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3212
3213 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3214
3215         Change bitset word type from unsigned int to unsigned long int,
3216         as this has better performance on typical 64-bit hosts.
3217         Port bitset code to hosts with unusual word sizes.
3218         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3219         (build_collating_symbol):
3220         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3221         argument is a bitset.  This is merely a style issue, but it makes
3222         it clearer that an entire array is expected.
3223         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3224         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3225         Port to the case where bitset_word is not the same as unsigned int.
3226         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3227         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3228         Likewise.
3229         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3230         (build_trtable, group_nodes_into_DFAstates):
3231         Likewise.
3232         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3233         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3234         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3235         * regexec.c (group_nodes_into_DFAstates): Likewise.
3236         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3237         * regcomp.c (optimize_subexps, lower_subexp):
3238         Work even if bitset_word has holes in its bitwise representation.
3239         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3240         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3241         Likewise.
3242         * regex_internal.c (re_string_reconstruct):
3243         Don't assume UCHAR_MAX == 255.
3244         * regex_internal.h (bitset_set_all): Likewise.
3245         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3246         All uses changed.
3247         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3248         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3249         All uses changed.
3250         (BITSET_WORD_MAX): New macro.
3251         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3252         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3253         (bitset_empty, bitset_copy):
3254         Prefer sizeof (bitset) to multiplying it out ourselves.
3255         (bitset_not_merge): Remove; unused.
3256         (bitset_contain): Return bool, not unsigned int with one bit on.
3257         All callers changed.
3258         * regexec.c (build_trtable): Don't assume bitset has no stricter
3259         alignment than re_node_set; do this by defining a new internal
3260         type struct dests_alloc and using it to allocate memory.
3261
3262 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3263
3264         Check for arithmetic overflow when calculating sizes, to prevent
3265         some buffer-overflow issues.  These patches are conservative, in the
3266         sense that when I couldn't determine whether an overflow was possible,
3267         I inserted a run-time check.
3268         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3269         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3270         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3271         (re_xnrealloc, re_x2nrealloc): New inline functions.
3272         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3273         (build_equiv_class, build_charclass): Check for arithmetic overflow
3274         in size expression calculations.
3275         * regex_internal.c (re_string_realloc_buffers):
3276         (build_wcs_upper_buffer, re_node_set_add_intersect):
3277         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3278         (re_dfa_add_node, register_state): Likewise.
3279         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3280         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3281         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3282         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3283
3284 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3285
3286         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3287         to avoid a collision with bits/local_lim.h in glibc.
3288         All uses changed.  Problem reported by Dmitry V. Levin in
3289         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3290
3291         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3292         bugs in int versus size_t comparisons.
3293         (re_string_context_at): Fix bug where the code assumed that
3294         Idx is signed.
3295
3296         Use bool where appropriate.
3297         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3298         All callers changed.
3299         (calc_eclosure_iter): Likewise, for ROOT arg.
3300         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3301         (build_charclass_op): Likewise, for NON_MATCH arg.
3302         * regex_internal.c (re_string_allocate, re_string_construct):
3303         (re_string_construct_common): Likewise, for ICASE arg.
3304         * regexec.c (re_search_2_stub, re_search_stub):
3305         Likewise, for RET_LEN arg.
3306         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3307         (set_regs): Likewise, for FL_BACKTRACK arg.
3308         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3309         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3310         (calc_eclosure_iter, parse_bracket_exp):
3311         Use bool for internal variables that are booleans.
3312         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3313         (set_regs, build_sifted_states, sift_states_bkref):
3314         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3315         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3316         (find_collation_sequence_value):
3317         Likewise.
3318         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3319         (re_node_set_compare):
3320         Return bool, not int. All callers changed.
3321         * regexec.c (check_halt_node_context, check_dst_limits):
3322         (build_trtable, check_node_accept): Likewise.
3323         * regex_internal.h: Include stdbool.h.
3324
3325         Fix bugs uncovered when converting to bool.
3326         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3327         failure instead of charging ahead blindly.
3328         * regex_internal.c (register_state): Likewise.
3329         * regexec.c (re_search_2_stub): Use simpler method than boolean
3330         for freeing internal storage.
3331         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3332         bitset pieces used as boolean, to avoid undefined behavior
3333         on hosts that do int overflow checking.
3334
3335 2005-08-31  Derek Price  <derek@ximbiot.com>
3336
3337         * getdelim.c (getdelim): Return EOF on EOF.
3338         Reported by Larry Jones <lawrence.jones@ugs.com>.
3339
3340 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3341
3342         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3343         lengths fit in regoff_t; this isn't true if regoff_t is the same
3344         width as size_t.
3345         * regex.c (re_search_internal): 5th arg is LAST_START
3346         (= START + RANGE) instead of RANGE.  This avoids overflow
3347         problems when regoff_t is the same width as size_t.
3348         All callers changed.
3349         (re_search_2_stub): Check for overflow when adding the
3350         sizes of the two strings.
3351         (re_search_stub): Check for overflow when adding START
3352         to RANGE; if it occurs, substitute the extreme value.
3353
3354 2005-08-31  Jim Meyering  <jim@meyering.net>
3355
3356         * regcomp.c (search_duplicated_node): Make first pointer arg
3357         a pointer-to-const.
3358         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3359         (register_state): Likewise.
3360         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3361         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3362         (group_nodes_into_DFAstates): Likewise.
3363
3364 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3365
3366         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3367         old glibc regex code mishandles strings longer than 2**31 bytes.
3368         This patch fixes this when the regex code is used in gnulib
3369         (i.e., outside glibc).
3370
3371         This patch should not affect the use of the regex code inside
3372         glibc.  No doubt this problem also needs to be handled for glibc
3373         as well, but the result will be an incompatible change to the
3374         glibc ABI, and the old ABI will have to be supported too.  That
3375         can be the the subject for another patch.
3376
3377         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3378         governing whether the rest of this patch is active.  By default,
3379         the macro is disabled and the patch has no effect.
3380         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3381         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3382         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3383         (re_match_2, re_set_registers): Use the new types.
3384         * regex_internal.h (Idx, re_hashval_t): New types.
3385         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3386         New macros.
3387         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3388         (re_string_context_at, bin_tree_t, re_dfastate_t):
3389         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3390         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3391         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3392         (re_string_char_size_at, re_string_wchar_at):
3393         (re_string_elem_size_at):
3394         Use the new types and macros to port to 64-bit hosts.
3395         Use unsigned types for internal values, so that the code
3396         mostly works even for arrays larger than SSIZE_MAX.
3397         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3398         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3399         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3400         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3401         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3402         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3403         (calc_inveclosure, parse_dup_op, build_range_exp):
3404         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3405         (fetch_number, create_token_tree, mark_opt_subexp):
3406         Likewise.
3407         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3408         (create_cd_newstate, re_string_allocate, re_string_construct):
3409         (re_string_realloc_buffers, build_wcs_upper_buffer):
3410         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3411         (re_string_reconstruct, re_string_peek_byte_case):
3412         (re_string_fetch_byte_case, re_string_context_at):
3413         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3414         (re_node_set_init_copy, re_node_set_add_intersect):
3415         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3416         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3417         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3418         (re_acquire_state, re_acquire_state_context, register_state):
3419         Likewise.
3420         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3421         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3422         (re_search_internal, re_search_2_stub, re_search_stub)
3423         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3424         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3425         (update_cur_sifted_state, check_dst_limits):
3426         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3427         (check_subexp_limits, sift_states_bkref, merge_state_array):
3428         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3429         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3430         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3431         (expand_bkref_cache, check_node_accept_bytes):
3432         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3433         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3434         (acquire_init_state_context, check_halt_node_context):
3435         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3436         (sift_states_backward, clean_state_log_if_needed):
3437         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3438         (find_recover_state, transit_state_sb, transit_state_mb):
3439         (transit_state_bkref, build_trtable, match_ctx_clean):
3440         Likewise.
3441         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3442         to work around an assumption that REG_MISSING is negative.
3443
3444         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3445         (seek_collating_symbol_entry) [defined _LIBC]:
3446         (lookup_collation_sequence_value) [defined _LIBC]:
3447         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3448         Use prototypes rather than old-style function definitions.
3449         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3450         (transit_state_sb) [0]:
3451         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3452
3453         * regexec.c (re_search_internal): Simplify update of rm_so and
3454         rm_eo.
3455
3456         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3457         (optimize_subexps, lower_subexp):
3458         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3459         since the signed shift might overflow.  Use 1u<<31 instead.
3460         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3461         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3462         Likewise.
3463
3464         * regcomp.c (optimize_subexps, lower_subexp):
3465         Use CHAR_BIT rather than 8, for clarity.
3466         * regexec.c (check_dst_limits_calc_pos_1):
3467         (check_subexp_matching_top): Likewise.
3468         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3469         have to worry about portability issues when shifting it left.
3470         Remove no-longer-needed test for table_size > 0.
3471         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3472         in a word, as the resulting behavior is undefined.
3473         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3474         in one case, a <= should have been an <, and in another case the
3475         whole test was missing.
3476         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3477         the standard name CHAR_BIT.
3478         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3479         this is not true on one's complement and signed-magnitude hosts.
3480
3481         * regex_internal.h (re_sub_match_top_t): Remove unused member
3482         next_last_offset.
3483         (struct re_dfa_t): Remove unused member states_alloc.
3484         * regcomp.c (init_dfa): Don't initialize unused members.
3485
3486 2005-08-31  Bruno Haible  <bruno@clisp.org>
3487
3488         * strstr.c: Include <stddef.h>, for NULL.
3489         * strcasestr.c: Likewise.
3490         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3491
3492 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3493
3494         * iconvme.h: Add prototype for iconv_alloc.
3495
3496 2005-08-29  Simon Josefsson  <jas@extundo.com>
3497
3498         * iconvme.c: Fix errno.
3499
3500 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3501
3502         * iconvme.c: Split iconv_string into iconv_alloc.
3503
3504 2005-08-27  Jim Meyering  <jim@meyering.net>
3505
3506         * fopen-safer.c: Merge minor changes from coreutils.
3507         * dup-safer.c: Likewise.
3508         * fd-safer.c: Likewise.
3509
3510         Merge from coreutils.
3511         * stdio--.h: New file.
3512         * stdlib--.h: New file.
3513         * mkstemp-safer.c: New file.
3514
3515         GNU tar needs these.
3516         * pipe-safer.c: New file.
3517         * creat-safer.c: New file.
3518         * fcntl--.h (creat): Define to creat_safer.
3519         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3520         * unistd--.h (pipe): Define to pipe_safer.
3521         * unistd-safer.h: Declare pipe_safer.
3522
3523 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3524
3525         * regex_internal.h: Remove all references to
3526         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3527         or better.
3528         (bitset_not, bitset_merge, bitset_not_merge):
3529         (bitset_mask, re_string_allocate, re_string_construct):
3530         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3531         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3532         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3533         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3534         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3535         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3536         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3537         (re_acquire_state_context):
3538         Remove unnecessary forward decls.
3539         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3540         Put __attribute at function definition,
3541         now that the function decl has been removed.
3542         * regex_internal.c (re_string_peek_byte_case):
3543         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3544         Likewise.
3545
3546 2005-08-26  Simon Josefsson  <jas@extundo.com>
3547
3548         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3549         Haible <bruno@clisp.org>.
3550
3551 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3552
3553         * regexec.c (set_regs): Don't alloca with an unbounded size.
3554
3555         alloca modernization/simplification for regex.
3556         * regex.c: Remove portability cruft for alloca.  This no longer
3557         needs to be at the start of the file, and can be moved into
3558         regex_internal.h and simplified.
3559         * regex_internal.h: Include <alloca.h>.
3560         (__libc_use_alloca) [!defined _LIBC]: New macro.
3561         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3562         now works outside glibc.
3563
3564 2005-08-24  Simon Josefsson  <jas@extundo.com>
3565
3566         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3567         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3568         GLIBC specific code.
3569
3570 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3571
3572         Make regex safe for g++.  This fixes one real bug (an "err"
3573         that should have been "*err").  g++ problem reported by
3574         Sam Steingold.
3575         * regex_internal.h (re_calloc): New macro, consistent with
3576         re_malloc etc.  All callers of calloc changed to use re_calloc.
3577         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3578         not int.  All callers changed.
3579         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3580         just use an array of size MB_LEN_MAX.
3581         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3582         (find_recover_state): Change "err" to "*err"; this fixes what
3583         appears to be a real bug.
3584         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3585         versus int.
3586
3587 2005-08-25  Jim Meyering  <jim@meyering.net>
3588
3589         * open-safer.c: Include <config.h>.
3590         Otherwise, we'd lose LARGEFILE support in any file using
3591         e.g. "fcntl--.h"
3592
3593 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3594
3595         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3596         * regex.h (regerror): Likewise.
3597
3598         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3599         requires this.  (The code never needed it.)
3600
3601         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3602         All uses of recently-renamed identifiers changed to use the new,
3603         POSIX-compliant names.  The code will build and run just fine
3604         without these changes, but it's better to eat our own dog food
3605         and use the standard-conforming names.
3606
3607         * regex.h: Fix a multitude of POSIX name space violations.
3608         These changes have an effect only for programs that define
3609         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3610         do not change anything for programs compiled in the normal way.
3611         Also, there is no effect on the ABI.
3612
3613         (_REGEX_SOURCE): New macro.
3614         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3615         defined and _GNU_SOURCE is not; this fixes a name space violation.
3616
3617         Rename the following macros to obey POSIX requirements.
3618         The old names are still visible as macros if _REGEX_SOURCE is defined.
3619         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3620         RE_BACKSLASH_ESCAPE_IN_LISTS.
3621         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3622         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3623         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3624         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3625         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3626         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3627         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3628         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3629         (REG_INTERVALS): renamed from RE_INTERVALS.
3630         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3631         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3632         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3633         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3634         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3635         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3636         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3637         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3638         RE_UNMATCHED_RIGHT_PAREN_ORD.
3639         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3640         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3641         (REG_DEBUG): renamed from RE_DEBUG.
3642         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3643         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3644         unusual, since we can't clash with the POSIX REG_ICASE.
3645         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3646         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3647         (REG_NO_SUB): renamed from RE_NO_SUB.
3648         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3649         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3650         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3651         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3652         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3653         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3654         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3655         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3656         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3657         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3658         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3659         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3660         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3661         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3662         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3663         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3664         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3665         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3666         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3667         (REG_FIXED): Renamed from REGS_FIXED.
3668         (REG_NREGS): Renamed from RE_NREGS.
3669
3670         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3671         of other REG_* macros, since POSIX says the user is allowed to
3672         #undef these macros selectively.
3673
3674         (reg_errcode_t): Update comment stating what other tables need
3675         to be consistent.
3676
3677         Rename the following enum values to obey POSIX requirements.
3678         The old names are still visible as macros.
3679         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3680         is not defined, since GNU is supposed to be a superset of POSIX as
3681         much as possible, and since we want reg_errcode_t to be a signed
3682         type for implementation consistency.
3683         (_REG_NOERROR): Renamed from REG_NOERROR.
3684         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3685         (_REG_BADPAT): Renamed from REG_BADPAT.
3686         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3687         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3688         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3689         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3690         (_REG_EBRACK): Renamed from REG_EBRACK.
3691         (_REG_EPAREN): Renamed from REG_EPAREN.
3692         (_REG_EBRACE): Renamed from REG_EBRACE.
3693         (_REG_BADBR): Renamed from REG_BADBR.
3694         (_REG_ERANGE): Renamed from REG_ERANGE.
3695         (_REG_ESPACE): Renamed from REG_ESPACE.
3696         (_REG_BADRPT): Renamed from REG_BADRPT.
3697         (_REG_EEND): Renamed from REG_EEND.
3698         (_REG_ESIZE): Renamed from REG_ESIZE.
3699         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3700         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3701         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3702         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3703         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3704
3705         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3706         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3707         changed.  But support the old name if the new one is not defined
3708         and if _REGEX_SOURCE.
3709
3710         Change the following member names in struct re_pattern_buffer.
3711         The old names are still supported if !_REGEX_SOURCE.
3712         The new names are always supported, regardless of _REGEX_SOURCE.
3713         (re_buffer): Renamed from buffer.
3714         (re_allocated): Renamed from allocated.
3715         (re_used): Renamed from used.
3716         (re_syntax): Renamed from syntax.
3717         (re_fastmap): Renamed from fastmap.
3718         (re_translate): Renamed from translate.
3719         (re_can_be_null): Renamed from can_be_null.
3720         (re_regs_allocated): Renamed from regs_allocated.
3721         (re_fastmap_accurate): Renamed from fastmap_accurate.
3722         (re_no_sub): Renamed from no_sub.
3723         (re_not_bol): Renamed from not_bol.
3724         (re_not_eol): Renamed from not_eol.
3725         (re_newline_anchor): Renamed from newline_anchor.
3726
3727         Change the following member names in struct re_registers.
3728         The old names are still supported if !_REGEX_SOURCE.
3729         The new names are always supported, regardless of _REGEX_SOURCE.
3730         (rm_num_regs): Renamed from num_regs.
3731         (rm_start): Renamed from start.
3732         (rm_end): Renamed from end.
3733
3734         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3735         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3736         Prepend __ to parameter names.
3737
3738         Undo yesterday's changes.
3739
3740 2005-08-24  Jim Meyering  <jim@meyering.net>
3741
3742         Sync from coreutils.
3743         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3744
3745 2005-08-21  Bruno Haible  <bruno@clisp.org>
3746
3747         * lock.h: Add multiple inclusion guard.
3748         * tls.h: Add multiple inclusion guard.
3749
3750 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3751
3752         * regex.h (REG_NOSYS)
3753         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3754         Define, since POSIX requires it as of 2001.
3755         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3756         New private symbol, used to keep the enum signed in all cases.
3757         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3758         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3759
3760         * regex_internal.c (re_string_skip_chars, register_state):
3761         (calc_state_hash):
3762         Remove forward decls; no longer needed now that we use prototypes.
3763         * regexec.c (acquire_init_state_context, check_halt_node_context):
3764         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3765         (clean_state_log_if_needed): Likewise.
3766
3767 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3768
3769         Fix problems reported by Sam Steingold in
3770         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3771         * regexec.c (sift_states_bkref): Fix portability bug: the code
3772         assumed that reg_errcode_t is a signed type, which is not
3773         necessarily true if _XOPEN_SOURCE is not defined.
3774         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3775         some compilers warn about it otherwise.
3776
3777 2005-08-20  Jim Meyering  <jim@meyering.net>
3778
3779         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3780         of unused local, dfa.
3781
3782 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3783
3784         * regcomp.c (create_initial_state): Remove duplicate decl.
3785         (init_word_char, create_initial_state, duplicate_node_closure):
3786         (fetch_token, peek_token_bracket, build_range_exp):
3787         (build_collating_symbol): Remove forward decls; no longer needed
3788         now that we use prototypes.
3789
3790         * regcomp.c:
3791         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3792         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3793         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3794         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3795         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3796         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3797         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3798         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3799         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3800         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3801         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3802         (build_charclass, build_charclass_op, fetch_number, create_tree):
3803         (create_token_tree, mark_opt_subexp, duplicate_tree):
3804         Use prototypes rather than old-style definitions.
3805
3806         * regex_internal.c:
3807         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3808         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3809         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3810         (re_string_reconstruct, re_string_peek_byte_case):
3811         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3812         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3813         (re_node_set_init_copy, re_node_set_add_intersect):
3814         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3815         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3816         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3817         (re_acquire_state, re_acquire_state_context, register_state):
3818         (create_ci_newstate, create_cd_newstate, free_state):
3819         Likewise.
3820         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3821         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3822         (re_search_internal, prune_impossible_nodes):
3823         (acquire_init_state_context, check_matching, static):
3824         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3825         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3826         (update_regs, sift_states_backward, build_sifted_states):
3827         (clean_state_log_if_needed, merge_state_array):
3828         (update_cur_sifted_state, add_epsilon_src_nodes):
3829         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3830         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3831         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3832         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3833         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3834         (check_arrival, check_arrival_add_next_nodes):
3835         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3836         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3837         (check_node_accept_bytes, check_node_accept, extend_buffers):
3838         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3839         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3840         (sift_ctx_init):
3841         Likewise.
3842
3843         * regex_internal.h:
3844         (re_string_allocate, re_string_construct, re_string_reconstruct):
3845         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3846         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3847         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3848         (re_string_context_at, re_string_peek_byte_case):
3849         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3850         is defined, since we now use prototypes always.
3851
3852         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3853         C89 or better.  All uses removed.
3854
3855 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3856
3857         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3858         [defined lint]: Suppress bogus uninitialized-variable warnings.
3859
3860         * regcomp.c (duplicate_node): Return new index, not an error code,
3861         and let the caller return REG_ESPACE if out of space.  This
3862         removes an uninitialied-variable warning with GCC 4.0.1, and also
3863         avoids taking the address of a local variable.  All callers
3864         changed.
3865
3866 2005-08-19  Jim Meyering  <jim@meyering.net>
3867
3868         * regexec.c (proceed_next_node): Redo local variables to
3869         avoid GCC shadowing warnings.
3870
3871 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3872
3873         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3874         (re_node_set_insert_last, re_dfa_add_node):
3875         Rename local variables to avoid GCC shadowing warnings.
3876
3877 2005-08-18  Bruno Haible  <bruno@clisp.org>
3878
3879         * strstr.c (strstr): Fix return value in multibyte case.
3880         * strcasestr.c (strcasestr): Likewise.
3881
3882 2005-08-17  Jim Meyering  <jim@meyering.net>
3883
3884         Make the %s format (seconds since the epoch) work for a negative
3885         number and when used with a zero-padded field width, e.g. %015s.
3886
3887         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3888         label so that it precedes the code to set `digits'.  Otherwise,
3889         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3890         print `00-22'.  Now, it prints `-0022', as it should.
3891
3892 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3893
3894         * regex.h: Remove useless space-before-tab.  From coreutils.
3895
3896 2005-08-17  Bruno Haible  <bruno@clisp.org>
3897
3898         * strcasestr.h: New file.
3899         * strcasestr.c: New file.
3900
3901 2005-08-17  Bruno Haible  <bruno@clisp.org>
3902
3903         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3904         * strstr.c: Completely rewritten, with multibyte locale support.
3905
3906 2005-08-17  Bruno Haible  <bruno@clisp.org>
3907
3908         * strcasecmp.c: Use mbuiter.h.
3909
3910 2005-08-17  Bruno Haible  <bruno@clisp.org>
3911
3912         * mbuiter.h: New file.
3913
3914 2005-08-16  Bruno Haible  <bruno@clisp.org>
3915
3916         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3917         (mbi_init): Update.
3918         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3919         NUL byte, not after it.
3920
3921 2005-08-16  Bruno Haible  <bruno@clisp.org>
3922
3923         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3924         the valid ones. Makes the comparison operations transitive:
3925         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3926         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3927
3928 2005-08-16  Bruno Haible  <bruno@clisp.org>
3929
3930         * strcase.h (strcasecmp): Add note in comments.
3931         * strncasecmp.c: Use code from strcasecmp.c.
3932         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3933         (strcasecmp): Work correctly in multibyte locales.
3934
3935 2005-08-16  Bruno Haible  <bruno@clisp.org>
3936
3937         * strnlen1.h: New file.
3938         * strnlen1.c: New file.
3939
3940 2005-08-16  Bruno Haible  <bruno@clisp.org>
3941
3942         * mbfile.h: New file.
3943
3944 2005-08-16  Bruno Haible  <bruno@clisp.org>
3945
3946         * mbiter.h: New file.
3947
3948 2005-08-16  Bruno Haible  <bruno@clisp.org>
3949
3950         * mbchar.h: New file.
3951         * mbchar.c: New file.
3952
3953 2005-08-16  Bruno Haible  <bruno@clisp.org>
3954
3955         * tls.h: New file, from GNU gettext.
3956         * tls.c: New file, from GNU gettext.
3957
3958 2005-08-15  Bruno Haible  <bruno@clisp.org>
3959
3960         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3961         is defined.
3962
3963 2005-08-14  Jim Meyering  <jim@meyering.net>
3964
3965         Sync from coreutils.
3966
3967         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3968         Use the hash-table-based cycle-detection code not just when
3969         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3970         Reported by James Youngman in
3971         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3972         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3973         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3974         This lets us compile with -DFTS_DEBUG, once again.
3975         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3976         * fts.c (fd_safer): Remove decl.
3977         Include fcntl--.h rather than unistd-safer.h
3978         (fts_safe_changedir): Don't call fd_safer; no longer needed
3979         now that we include fcntl--.h.
3980
3981 2005-08-11  Simon Josefsson  <jas@extundo.com>
3982
3983         * readline.h, readline.c: New file.
3984
3985 2005-08-11  Bruno Haible  <bruno@clisp.org>
3986
3987         * strnlen.h (strnlen): Change parameter name to match comment.
3988
3989 2005-08-10  Simon Josefsson  <jas@extundo.com>
3990
3991         * strndup.c: Use strnlen.h.
3992
3993         * strnlen.h: New file.
3994
3995 2005-08-02  Simon Josefsson  <jas@extundo.com>
3996
3997         * getline.h, getline.c: Rewrite.
3998
3999         * getdelim.h, getdelim.c: New files, ported from glibc.
4000
4001 2005-07-31  Bruno Haible  <bruno@clisp.org>
4002
4003         * lock.h (gl_lock_initializer): New macro.
4004         (gl_lock_define_initialized): Use it.
4005         (gl_rwlock_initializer): New macro.
4006         (gl_rwlock_define_initialized): Use it.
4007         (gl_recursive_lock_initializer): New macro.
4008         (gl_recursive_lock_define_initialized): Use it.
4009
4010 2005-07-26  Bruno Haible  <bruno@clisp.org>
4011
4012         * lock.h: Update from GNU gettext.
4013         * lock.c: Update from GNU gettext.
4014
4015 2005-07-18  Bruno Haible  <bruno@clisp.org>
4016
4017         * lock.h (gl_once_t): New type.
4018         (gl_once_define, gl_once): New macros.
4019         * lock.c (fresh_once): New variable.
4020         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4021         functions.
4022
4023 2005-07-18  Simon Josefsson  <jas@extundo.com>
4024
4025         * check-version.c (check_version): Accept identical versions too.
4026
4027 2005-07-18  Bruno Haible  <bruno@clisp.org>
4028
4029         * lock.h: New file, from GNU gettext.
4030         * lock.c: New file, from GNU gettext.
4031
4032 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
4033
4034         * quotearg.c: Add translator comment suggested by Bruno Haible,
4035         with a minor change.
4036
4037 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4038
4039         * version-etc-fsf.c (version_etc_copyright): Parameterize the
4040         copyright symbol and the year.
4041         * version-etc.c (COPYRIGHT_YEAR): New constant.
4042         (version_etc_va): Use parameterized copyright notice.
4043         Reword to conform to the current GNU coding standards.
4044
4045 2005-07-11  Simon Josefsson  <jas@extundo.com>
4046
4047         * size_max.h: New file.
4048
4049 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4050
4051         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4052         block of defines.
4053
4054 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
4055        and  Paul Eggert  <eggert@cs.ucla.edu>
4056
4057         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4058         in wint_t, not wchar_t.  Remove now-unnecessary cast.
4059
4060 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4061
4062         * regex.c, regex.h: Sync from libc.
4063         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4064         New files, synced from libc, except that regex_internal.h
4065         currently has a small porting fix.
4066
4067 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
4068
4069         Remove the dependency of the strftime module on the tzset module.
4070         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4071         Copy the input structure, to work around some of the bug with
4072         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
4073         Solaris releases, you should also use the tzset module, but we won't
4074         require it as a dependency any more since we don't want LGPLed code
4075         to depend on GPLed code.
4076
4077 2005-07-02  Jim Meyering  <jim@meyering.net>
4078
4079         * backupfile.c (backup_args): Change a `0' to NULL.
4080
4081 2005-07-01  Jim Meyering  <jim@meyering.net>
4082
4083         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4084         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4085         * save-cwd.c, tempname.c:
4086         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4087         and don't include <sys/file.h>).
4088
4089 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4090
4091         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4092         declares only 'struct timespec;' (!).
4093
4094 2005-06-29  Jim Meyering  <jim@meyering.net>
4095
4096         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4097         type name.  Use the variable name instead.
4098         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4099
4100 2005-06-28  Simon Josefsson  <jas@extundo.com>
4101
4102         * check-version.h, check-version.c: New files.
4103
4104 2005-06-28  Simon Josefsson  <jas@extundo.com>
4105
4106         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4107         collision with global variable.  Better indentation.  Don't
4108         increment buffer pointer beyond buffer end.  Based on comments
4109         from Paul Eggert <eggert@cs.ucla.edu>.
4110
4111         * base64.h: Indent.
4112
4113 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4114
4115         * canon-host.c (canon-host): Append trailing "," to 0 in
4116         initializer of struct addrinfo, as an indication that we don't
4117         care how many members the structure has.
4118
4119 2005-06-24  Derek Price  <derek@ximbiot.com>
4120         and Bruno Haible  <bruno@clisp.org>
4121
4122         Remove stat module & update lstat.
4123         * stat.c: Remove this file...
4124         (slash_aware_lstat): ...moving this content and its support...
4125         * lstat.c (rpl_lstat): ...into here.
4126         * lstat.h: New file.
4127
4128 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4129
4130         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4131         (ranged_convert): Don't save conversion in a temporary struct.
4132         This causes a warning with GCC 4.0.0, and anyway in the typical
4133         case it's not worth the extra 100 bytes or so of code.
4134         (ranged_convert, __mktime_internal): When calling a function via a
4135         pointer P, use P () rather than (*P) (), as we now assume C89 or
4136         better.
4137
4138 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4139
4140         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4141         "who -r" failed to give output.  Problem reported by Tim Waugh.
4142
4143         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4144         (xcalloc): Use it to avoid needless tests.
4145         Problem reported by Jim Meyering.
4146
4147 2005-06-16  Jim Meyering  <jim@meyering.net>
4148
4149         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4150         when either N or S is zero.
4151
4152 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4153
4154         * argp.h (__option_is_short): Check upper limit of
4155         __key. Isprint() requires its argument to have the value
4156         of an unsigned char or EOF.
4157
4158 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4159
4160         * fnmatch.c (fnmatch): If there is an encoding error in a
4161         multibyte string or pattern, fall back on unibyte matching.
4162         Problem reported by James Youngman.
4163
4164 2005-06-08  Bruno Haible  <bruno@clisp.org>
4165
4166         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4167         warning on mingw.
4168
4169 2005-06-08  Bruno Haible  <bruno@clisp.org>
4170
4171         * csharpcomp.h: New file, from GNU gettext.
4172         * csharpcomp.c: New file, from GNU gettext.
4173         * csharpcomp.sh.in: New file, from GNU gettext.
4174
4175 2005-06-07  Derek Price  <derek@ximbiot.com>
4176
4177         Sync from CVS.
4178         * glob_.h: Indent nested #ifdef.
4179
4180 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4181
4182         Sync from coreutils.
4183         Use "file name" when talking about file names, instead of "filename"
4184         or "path", as per the GNU coding standards.
4185         * mkdir-p.c: Renamed from makepath.c.
4186         (make_dir_parents): Renamed from make_path.  All callers changed.
4187         * mkdir-p.h: Likewise.  All includers changed.
4188         * filenamecat.c: Renamed from path-concat.c.
4189         (file_name_concat): Renamed from path_concat.  All callers changed.
4190         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4191         * filenamecat.h: Likewise.  All includers changed.
4192         * acl.c: Don't use "path" or "filename" to mean "file name"
4193         in comments or local variable names.
4194         * basename.c: Likewise.
4195         * canonicalize.c, canonicalize.h: Likewise.
4196         * dirname.c, dirname.h: Likewise.
4197         * euidaccess.c: Likewise.
4198         * exclude.c: Likewise
4199         * fnmatch_.h, fnmatch_loop.c: Likewise.
4200         * fsusage.c, fsuage.h: Likewise.
4201         * fts.c, fts_.h: Likewise.
4202         * getcwd.c: Likewise.
4203         * getloadavg.c: Likewise.
4204         * mkstemp.c: Likewise.
4205         * mountlist.c, mountlist.h: Likewise.
4206         * openat.c, openat.h: Likewise.
4207         * readlink-stub.c: Likewise.
4208         * readutmp.c, readutmp.h: Likewise.
4209         * rename.c: Likewise.
4210         * rmdir.c: Likewise.
4211         * same.c: Likewise.
4212         * savedir.c: Likewise.
4213         * stripslash.c: Likewise.
4214         * tempname.c: Likewise.
4215         * xreadlink.c: Likewise.
4216         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4217         All uses changed.
4218         * exclude.h: Likewise.
4219
4220         * euidaccess.c (getuid, getgid, getuid, getegid)
4221         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4222         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4223         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4224         * pathmax.h: Include <limits.h> unconditionally, since other
4225         files have been getting away with it for years (MORE/BSD 4.3
4226         is extinct now).
4227         * userspec.c (getpwnam, getgrnam, getgrgid)
4228         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4229
4230         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4231         Define to 256, not 255, as per modern POSIX.
4232
4233 2005-06-01  Bruno Haible  <bruno@clisp.org>
4234
4235         * csharpexec.h: New file, from GNU gettext.
4236         * csharpexec.c: New file, from GNU gettext.
4237         * csharpexec.sh.in: New file, from GNU gettext.
4238
4239 2005-05-31  Derek Price  <derek@ximbiot.com>
4240             Paul Eggert  <eggert@cs.ucla.edu>
4241
4242         Sync from cvs.
4243         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4244
4245 2005-05-29  Derek Price  <derek@ximbiot.com>
4246             Paul Eggert  <eggert@cs.ucla.edu>
4247
4248         * glob_.h, glob.c: New files.
4249
4250 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4251
4252         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4253
4254         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4255         the configuration hassle isn't worth it.
4256         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4257         (LONGEST_MODIFIER, PRIuMAX): Remove.
4258
4259 2005-05-27  Bruno Haible  <bruno@clisp.org>
4260
4261         * getlogin_r.h: Remove second include of <stddef.h>.
4262
4263 2005-05-25  Bruno Haible  <bruno@clisp.org>
4264             Derek Price  <derek@ximbiot.com>
4265
4266         * getlogin_r.h: Simplify API documentation.
4267
4268 2005-05-25  Derek Price  <derek@ximbiot.com>
4269             Paul Eggert  <eggert@cs.ucla.edu>
4270
4271         * getlogin_r.c, getlogin_r.h: New files.
4272
4273 2005-05-22  Bruno Haible  <bruno@clisp.org>
4274
4275         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4276         Also include <sys/param.h> if it defines MIN, MAX.
4277         Based on a patch by Derek Price <derek@ximbiot.com>.
4278
4279 2005-05-22  Bruno Haible  <bruno@clisp.org>
4280
4281         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4282         (INT64_MIN): Fix definition.
4283         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4284
4285         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4286         NEED_SIGNED_INT_TYPES.
4287
4288         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4289         HAVE_SYSTEM_INTTYPES.
4290
4291 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4292
4293         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4294         so that unistd-safer.h (GPL'ed code) need not be included.
4295
4296 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4297
4298         New fts module.
4299         * fts.c: Don't include "cycle-check.h" or "hash.h".
4300         (setup_dir, free_dir): New functions.
4301         (enter_dir, leave_dir): Define trivial
4302         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4303         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4304         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4305         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4306         Move to fts-cycle.c.
4307         (fts_open): Use setup_dir.
4308         (fts_close): Use free_dir.
4309         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4310         This adds a label and some gotos, but the alternatives were messier.
4311         Check for memory allocation failure when entering a dir.
4312         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4313         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4314         (FTS): New member fts_cycle, that is a union that contains the
4315         old active_dir_ht and cycle_state.  All uses changed to mention
4316         fts_cycle.ht and fts_cycle.state.
4317         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4318         fts.c, with the following changes:
4319         (setup_dir, free_dir): New functions.
4320         (enter_dir): Now returns bool.  Return true if successful, false
4321         if memory exhausted.  All callers changed.
4322         Do not bother partly cleaning up on
4323         memory allocation failure; that is free_dir's job.
4324         However, free ad if hash_insert fails, to avoid memory leak.
4325         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4326         fts->fts_options to see which union member to use.
4327
4328 2005-05-20  Jim Meyering  <jim@meyering.net>
4329
4330         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4331         Now a macro, to pacify GCC.
4332
4333 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4334
4335         * chown.c (rpl_chown): Return -1 on failure.
4336
4337 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4338
4339         * canonicalize.c: Include canonicalize.h first, to test interface.
4340         Include <stddef.h> unconditionally, since we assume C89 now.
4341         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4342         * fts.c: Include fts_.h first, to check interface.
4343         Do not include intprops.h; no longer needed.
4344         Include cycle-check.h and hash.h, since fts_.h no longer does.
4345         Remove unnecessary casts of closedir to void.
4346         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4347         decide whether to decrement nlinks.
4348         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4349         (FTS): Use struct hash_table * instead of Hash_table, so that
4350         we no longer need to include hash.h here.
4351
4352 2005-05-17  Jim Meyering  <jim@meyering.net>
4353
4354         * fts.c, fts_.h: New files, from coreutils.
4355
4356 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4357
4358         Sync from coreutils.
4359         * unlinkdir.c, unlinkdir.h: New files.
4360         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4361         regex.h, unlocked-io.h, xtime.h:
4362         White space changes only.
4363         * makepath.c (make_path): Port to hosts where leading "//" is special.
4364         * yesno.c: Include getline.h, not ctype.h.
4365         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4366         Use getline to remove arbitrary restriction on response length.
4367
4368 2005-05-13  Bruno Haible  <bruno@clisp.org>
4369
4370         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4371         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4372         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4373         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4374         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4375         Add support for 64-bit integers in the MSVC compiler.
4376
4377 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4378
4379         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4380         Change the initial comment to refer to GPL, not LGPL.
4381         gnulib-tool will change it to LGPL as needed.
4382
4383         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4384         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4385         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4386         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4387         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4388         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4389         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4390         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4391         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4392         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4393         concatpath.c, config.charset, copy-file.c, copy-file.h,
4394         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4395         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4396         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4397         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4398         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4399         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4400         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4401         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4402         full-read.c, full-read.h, full-write.c, full-write.h,
4403         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4404         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4405         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4406         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4407         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4408         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4409         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4410         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4411         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4412         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4413         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4414         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4415         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4416         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4417         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4418         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4419         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4420         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4421         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4422         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4423         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4424         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4425         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4426         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4427         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4428         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4429         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4430         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4431         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4432         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4433         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4434         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4435         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4436         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4437         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4438         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4439         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4440         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4441         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4442         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4443         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4444         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4445         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4446         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4447         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4448         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4449         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4450         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4451         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4452         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4453         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4454         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4455         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4456         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4457         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4458         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4459         Update FSF postal mail address.
4460
4461 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4462
4463         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4464         specified in ai_socktype. Fix invalid ai_protocol
4465         check. ai_protocol is usually set to 0 or depending on
4466         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4467         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4468         ai_socktype / ai_protocol in the returned addrinfo structure.
4469
4470 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4471             Bruno Haible  <bruno@clisp.org>
4472
4473         * inet_ntop.h: New file.
4474         * inet_ntop.c: New file, from glibc with modifications.
4475
4476 2005-05-08  Jim Meyering  <jim@meyering.net>
4477
4478         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4479
4480 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4481
4482         Merge from coreutils.  Among other things,
4483         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4484         * fd-safer.c: New file.
4485         * fcntl-safer.h, open-safer.c: Remove.
4486         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4487         * dup-safer.c: Include unistd-safer.h first.
4488         Don't include errno.h.
4489         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4490         * file-type.h: Don't assume invoker included sys/stat.h first.
4491         * file-type.c: Rely on file-type.h change.
4492         * getloadavg.c: Include unistd-safer.h.
4493         (getloadavg): Use safer open.
4494         * getusershell.c: Include "stdio-safer.h".
4495         (getusershell): Use safer fopen.
4496         * long-options.c (long_options): Use NULL rather than 0.
4497         * modechange.h (mode_free): Remove; all callers changed to invoke
4498         'free'.
4499         * modechange.c: Likewise.
4500         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4501         (MODE_DONE): New constant.
4502         (struct mode_change): Remove 'next' member.
4503         (make_node_op_equals): New function; like the old one of the
4504         same name, except it allocates an array.
4505         (mode_compile, mode_create_from_ref): Use it.
4506         (mode_compile): Allocate result as an array, not a linked list.
4507         Parse octal string ourself, so that we catch mistakes like "+0".
4508         (mode_adjust): Arg is an array, not a linked list.
4509         * modechange.c: Include stat-macros.h, xalloc.h.
4510         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4511         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4512         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4513         Remove.  This is now stat-macros.h's job.
4514         (talloc): Remove.  All callers replaced by xalloc, so that
4515         our invokers don't have to worry about reporting memory failures.
4516         (make_node_op_equals): Remove.
4517         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4518         New constants.
4519         (struct mode_change): Moved here from modechange.h.
4520         (mode_append_entry): Remove.
4521         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4522         apps to have incorrect behavior.  Use simpler algorithm for head
4523         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4524         Detect more invalid usages rather than having somewhat-random behavior.
4525         Don't insert an "a=" action, as that leads to incorrect behavior.
4526         (mode_compile, mode_create_from_ref): Return NULL on error instead
4527         of an enum, since now there's only one way to have an error.  All
4528         callers changed.
4529         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4530         at the correct time.  Simplify calculation of "+u" and its ilk.
4531         Don't mishandle "+X".
4532         (mode_free): Remove "register" and localize decls.
4533         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4534         (struct mode_change): Move to modechange.c; callers don't
4535         need to see this stuff.
4536         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4537         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4538         (mode_change, mode_adjust): Reflect the new signatures noted above.
4539         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4540         that might redefine system include files.
4541         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4542         (my_usleep): Use NULL rather than (void *) 0.
4543         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4544         Use siginterrupt to specify that system calls should be interrupted.
4545         (rpl_nanosleep): Move initialization of suspended closer to call of
4546         my_usleep.
4547         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4548         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4549         (desirable_utmp_entry): New function.
4550         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4551         using x2nrealloc, to simplify logic.
4552         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4553         size calculation.  Do not assume utmp file is a regular file.
4554         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4555         (READ_UTMP_CHECK_PIDS): New constant.
4556         * save-cwd.c: Include unistd-safer.h.
4557         (save_cwd): Use fd_safer.
4558         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4559         [!_LIBC] Include "stat-macros.h" instead.
4560         * unistd-safer.h (fd_safer): New decl.
4561
4562 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4563
4564         * byteswap_.h: New file.
4565
4566 2005-04-25  Albert Chin  <china@thewrittenword.com>
4567
4568         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4569         Toolkit C bug.
4570
4571 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4572
4573         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4574         that "UTC +1 second" continues to work.  Problem reported
4575         by Dmitry V. Levin.
4576         (relunit_snumber): New rule.
4577         (relunit): Use it.
4578
4579 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4580
4581         * getdate.y (universal_time_zone_table): New constant.
4582         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4583         universal_time_zone_table.
4584         (lookup_zone): Prefer universal_time_zone_table to
4585         local_time_zone_table, so that "GMT" time stamps are allowed in
4586         London during the summer.  Problem reported by Ian Abbott.
4587
4588 2005-04-12  Jim Meyering  <jim@meyering.net>
4589
4590         * human.c (humblock): Set *options even when returning due to
4591         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4592         warning from gcc-4.
4593
4594 2005-04-09  Jim Meyering  <jim@meyering.net>
4595
4596         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4597         -Wuninitialized: initialize tm0.tm_year.
4598
4599 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4600
4601         * getdate.y (parser_control): rels_seen is now a boolean, not a
4602         count, since there's no maximum.  All uses changed.
4603         Add member dsts_seen.
4604         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4605         not being INT_MAX.
4606         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4607         Use pc_rels_seen to decide whther a date is absolute.
4608
4609         * getdate.y (number): Don't overwrite year.
4610         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4611         check.
4612
4613 2005-04-02  Simon Josefsson  <jas@extundo.com>
4614
4615         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4616         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4617
4618 2005-03-27  Jim Meyering  <jim@meyering.net>
4619
4620         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4621
4622 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4623
4624         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4625         "one's complement" -> "ones' complement" in comment, as per Knuth.
4626         "value of type" -> "type or expression" in comment.
4627         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4628
4629 2005-03-26  Jim Meyering  <jim@meyering.net>
4630
4631         Comment nits.
4632         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4633         Correct typos: s/or/of/.
4634
4635 2005-03-23  Jim Meyering  <jim@meyering.net>
4636
4637         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4638
4639 2005-03-21  Jim Meyering  <jim@meyering.net>
4640
4641         Changes imported from coreutils.
4642
4643         * cycle-check.c: Don't include xalloc.h.
4644
4645         * path-concat.c: Don't include assert.h.
4646         (path_concat): Remove assertion that would have triggered
4647         for ABASE starting with more than one slash.
4648         Reported by Andreas Schwab.
4649
4650         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4651         properly when ABASE is an absolute file name.
4652         Correct the description of this function.
4653         Include <assert.h>.
4654         Add an assertion and a test driver.
4655         This fixes a bug introduced on 2004-07-02.
4656         Andreas Schwab reported the resulting failure of cp --parents:
4657         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4658
4659 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4660
4661         * strftime.c (my_strftime): If the underlying strftime returns 0
4662         (which shouldn't happen), generate nothing instead of returning 0
4663         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4664
4665 2005-03-16  Bruno Haible  <bruno@clisp.org>
4666
4667         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4668
4669 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4670
4671         * strftime.c (my_strftime): Prepend space to format so that we can
4672         reliably distinguish strftime failure from empty output on POSIX
4673         hosts.
4674
4675 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4676
4677         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4678         (iconv_string): Don't guess a size-zero buffer, as that might cause
4679         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4680         result would be 'too large', where 'too large' is (heuristically)
4681         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4682         overflow concerns.  This will prevent some unwanted malloc failures
4683         when the inputs are very large.
4684
4685 2005-03-15  Bruno Haible  <bruno@clisp.org>
4686
4687         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4688         'negate'.
4689
4690         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4691         variable.
4692
4693         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4694
4695 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4696
4697         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4698         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4699         intprops.h.
4700         * strtol.c: Likewise.
4701
4702 2005-03-14  Simon Josefsson  <jas@extundo.com>
4703
4704         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4705         <fx@gnu.org>.
4706
4707 2005-03-14  Jim Meyering  <jim@meyering.net>
4708
4709         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4710         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4711         to be nonzero so that we (and caller) can detect the difference
4712         between a valid zero-length expansion and an error return, even
4713         when the underlying strftime fails before writing anything into
4714         that location.
4715
4716 2005-03-10  Jim Meyering  <jim@meyering.net>
4717
4718         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4719         so that this module works on systems without fchdir.
4720
4721 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4722
4723         Factor int-properties macros into a single file, except for
4724         glibc-related files.
4725         * intprops.h: New file.
4726         * getloadavg.c: Include it instead of limits.h.
4727         (INT_STRLEN_BOUND): Remove.
4728         * human.c: Include intprops.h.
4729         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4730         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4731         * inttostr.h: Include intprops.h instead of limits.h.
4732         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4733         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4734         for consistency with intprops.h.
4735         (time_t_is_integer, twos_complement_arithmetic): Use them.
4736         * sig2str.h: Include <signal.h>, intprops.h.
4737         (INT_STRLEN_BOUND): Remove.
4738         * strftime.c (TYPE_SIGNED): Remove.
4739         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4740         * strtol.c: Adjust comments to match intprops.h.
4741         * userspec.c: Include intprops.h.
4742         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4743         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4744         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4745         instead of rolling our own expressions.
4746         * xstrtol.c: Include xstrtol.h first, to test interface.
4747
4748         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4749         instead of int.
4750         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4751         the right thing even if adding 1900 would overflow.  Similarly
4752         for tm_mon + 1 and tm_yday + 1.
4753         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4754         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4755         (DO_SIGNED_NUMBER): New macro.
4756         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4757
4758 2005-03-07  Bruno Haible  <bruno@clisp.org>
4759
4760         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4761
4762 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4763             Bruno Haible  <bruno@clisp.org>
4764
4765         * pagealign_alloc.h: New file.
4766         * pagealign_alloc.c: New file.
4767
4768 2005-01-28  Bruno Haible  <bruno@clisp.org>
4769
4770         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4771         stpncpy.c uses it.
4772
4773 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4774
4775         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4776         The workaround isn't strictly needed for POSIX conformance, and
4777         it's too much of a pain to configure and maintain.  We'll ask
4778         people to fix their kernels instead.
4779         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4780         (NANOSLEEP_BUG_WORKAROUND): Remove.
4781         (xnanosleep): Remove the workaround.
4782
4783 2005-02-12  Bruno Haible  <bruno@clisp.org>
4784
4785         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4786
4787 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4788
4789         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4790         * timespec.h (gettime): Return void, since it always
4791         succeeds now.  All uses changed.
4792         * gettime.c (gettime) Likewise.
4793         [HAVE_NANOTIME]: Prefer nanotime.
4794         Assume gettimeofday succeeds, as POSIX requires.
4795         Assime time () succeeds, since other code already does.
4796         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4797         (timespec_subtract): Remove.
4798         (NANOSLEEP_BUG_WORKAROUND): New constant.
4799         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4800         things considerably.  Use it only on GNU/Linux hosts, since the
4801         workaround shouldn't be needed elsewhere.
4802
4803 2005-02-24  Bruno Haible  <bruno@clisp.org>
4804
4805         * gettext.h: Update from GNU gettext 0.14.2.
4806
4807 2005-02-24  Bruno Haible  <bruno@clisp.org>
4808
4809         * localcharset.c: Update from GNU gettext 0.14.2.
4810         * config.charset: Update from GNU gettext 0.14.2.
4811
4812 2005-02-22  Simon Josefsson  <jas@extundo.com>
4813
4814         * iconvme.h, iconvme.c: New files, from libc.
4815
4816 2005-02-20  Neil Conway  <neilc@samurai.com>
4817
4818         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4819         returned by OSX/Darwin if the specified buffer is not large
4820         enough for the hostname.
4821
4822 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4823
4824         * memrchr.h: New file.
4825         * chdir-long.c: Include it.
4826         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4827         Don't bother including stddef.h.
4828
4829 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4830
4831         * argp-help.c (__argp_help): Create a fake struct argp_state and
4832         pass it to _help, otherwise the latter coredumps trying to
4833         dereference state.root_argp.
4834
4835 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4836
4837         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4838         inclusion.
4839         Include <sys/types.h>, for dev_t.
4840         (ME_DUMMY, ME_REMOTE): Move from here....
4841         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4842         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4843         Dmitry V. Levin.
4844         Include mountlist.h first, to test the interface.
4845
4846 2005-01-29  Bruno Haible  <bruno@clisp.org>
4847
4848         * progname.c (program_name): Initialize.
4849         Needed when linking statically on MacOS X.
4850
4851 2005-01-28  Bruno Haible  <bruno@clisp.org>
4852
4853         * javacomp.sh.in: New file, from GNU gettext.
4854         * javacomp.h: New file, from GNU gettext.
4855         * javacomp.c: New file, from GNU gettext.
4856
4857 2005-01-26  Bruno Haible  <bruno@clisp.org>
4858
4859         * javaexec.sh.in: New file, from GNU gettext.
4860         * javaexec.h: New file, from GNU gettext.
4861         * javaexec.c: New file, from GNU gettext.
4862
4863 2005-01-26  Simon Josefsson  <jas@extundo.com>
4864
4865         * gai_strerror.c: Use GPL in header.
4866
4867 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4868
4869         * argp-help.c (hol_entry_help): Avoid using non-constant
4870         initializers for struct pentry_state.
4871         (__argp_error): Check return value of __asprintf
4872         (__argp_failure): Translate error message
4873
4874         * argp-parse.c: Removed braces around the expansion of N_()
4875
4876 2005-01-21  Jim Meyering  <jim@meyering.net>
4877
4878         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4879         same value as for Solaris 9.
4880
4881         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4882         component length.  This included changing the parameter to be
4883         of type `char *' rather than `char const *'.
4884         * chdir-long.h (chdir_long): Update prototype.
4885
4886         * openat.c (fdopendir, fstatat): New functions.
4887         * openat.h: Include headers required for use of DIR and struct stat.
4888         [AT_SYMLINK_NOFOLLOW]: Define.
4889         (fdopendir, fstatat): Add prototypes.
4890
4891 2005-01-21  Bruno Haible  <bruno@clisp.org>
4892
4893         * classpath.h: New file, from GNU gettext.
4894         * classpath.c: New file, from GNU gettext.
4895
4896 2005-01-20  Simon Josefsson  <jas@extundo.com>
4897
4898         * version-etc-fsf.c: New file, with version_etc_copyright.
4899         * version-etc.c: Remove version_etc_copyright.
4900         * version-etc.h (version_etc_copyright): Use [] instead of * in
4901         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4902
4903 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4904
4905         * save-cwd.c (save_cwd): Remove code to support the case
4906         where fchdir is missing or flaky.
4907
4908 2005-01-20  Simon Josefsson  <jas@extundo.com>
4909
4910         * base64.h (isbase64): Add.
4911
4912         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4913         using a unsigned prototype, don't inline.
4914         (base64_decode): Use it.
4915
4916 2005-01-19  Bruno Haible  <bruno@clisp.org>
4917
4918         * sh-quote.h: New file, from GNU gettext.
4919         * sh-quote.c: New file, from GNU gettext.
4920
4921 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4922
4923         Merge changes from coreutils, as described below in several
4924         changelogs dated today.
4925
4926         * save-cwd.c: Include "save-cwd.h" before other include files.
4927         (O_DIRECTORY): Remove; not needed here, since "." must be
4928         a directory.  All uses removed.
4929         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4930         universal on Suns, and we also need to test for IRIX.
4931         Revamp code to use 'if' rather than '#if'.
4932         Avoid unnecessary comparison of cwd->desc to 0.
4933
4934         * utimens.c (futimens): Robustify the previous patch, by checking
4935         for known valid error numbers rather than observed invalid ones.
4936
4937 2005-01-18  Jim Meyering  <jim@meyering.net>
4938
4939         * version-etc.c (version_etc_copyright): Update copyright date.
4940
4941         * utimens.c (futimens): Account for the fact that futimes
4942         can also fail with errno == ENOSYS or errno == ENOENT.
4943         Patch from Dmitry V. Levin.
4944
4945         Change the name of the robust chdir function from chdir to chdir_long.
4946         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4947         (restore_cwd): Use chdir_long, not chdir.
4948         * chdir-long.c: Renamed from chdir.c.
4949         * chdir-long.h: Renamed from chdir.h.
4950         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4951         Hurd.
4952
4953 2005-01-18  Bob Proulx  <bob@proulx.com>
4954
4955         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4956         offsetof() macro construct to avoid compile failure with native HP-UX
4957         11.0 ANSI C compiler.
4958
4959 2005-01-06  Bruno Haible  <bruno@clisp.org>
4960
4961         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4962         because stpncpy.m4 takes care of it.
4963
4964 2004-01-24  Bruno Haible  <bruno@clisp.org>
4965
4966         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4967
4968 2003-10-09  Bruno Haible  <bruno@clisp.org>
4969
4970         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4971
4972 2005-01-06  Bruno Haible  <bruno@clisp.org>
4973
4974         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4975         * fwriteerror.c: Include <stdbool.h>.
4976         (fwriteerror): At the end, close the file stream. Record whether
4977         stdout was already closed.
4978
4979 2004-05-27  Bruno Haible  <bruno@clisp.org>
4980
4981         * execute.c (environ): Declare if needed.
4982         * pipe.c (environ): Likewise.
4983         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4984
4985 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4988         definitions to be after all include files, to avoid collisions.
4989         Problem reported by Bob Proulx.
4990
4991 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4992
4993         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4994         not needed.  This removes a dependency on the gettext module.
4995         [defined _LIBC]: Do not include <libintl.h>; not needed.
4996
4997 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4998
4999         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5000         HAVE_DECL_STRTOLD.
5001
5002 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
5003
5004         * argp-parse.c: Include <stddef.h>.
5005         (alignof, alignto): New macros.
5006         (parser_init): Don't assume that void * is aligned sufficiently
5007         for struct option.
5008
5009         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5010         need to extend the stack.
5011         (YYINITDEPTH): New macro, so that the initial stack isn't overly
5012         large.
5013
5014 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5015
5016         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5017
5018 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
5019
5020         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5021         Remove now-obsolete comment about AIX.
5022         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5023         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5024         (YYMAXDEPTH): New macro.
5025
5026 2004-12-18  Bruno Haible  <bruno@clisp.org>
5027
5028         * fatal-signal.c (fatal_signals): Make non-const.
5029         (init_fatal_signals): New function.
5030         (uninstall_handlers, install_handlers): Ignore signals that were set to
5031         SIG_IGN.
5032         (at_fatal_signal): Call init_fatal_signals.
5033         (init_fatal_signal_set): Likewise. Ignore signals that were set to
5034         SIG_IGN.
5035         Reported by Paul Eggert.
5036
5037 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
5038
5039         * getdate.y (textint): New member "negative".
5040         (time_zone_hhmm): New function.
5041         Expect 14 shift-reduce conflicts, not 13.
5042         (o_colon_minutes): New rule.
5043         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5044         (yylex): Set the "negative" member of signed numbers.
5045
5046 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
5047
5048         Changes imported from coreutils.
5049         * hard-locale.c: Assume <locale.h> exists.
5050         Include "strdup.h".
5051         (GLIBC_VERSION): New macro.
5052         (hard_locale): Assume setlocale exists.
5053         Rewrite to avoid #ifdef.
5054         Use strdup rather than malloc + strcpy.
5055         * human.c: Assume <locale.h> exists.
5056         (human_readable): Assume localeconv exists.
5057
5058 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5059
5060         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5061         convert T2, not T.  (Imported from libc.)
5062
5063 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5064
5065         * getcwd.c (is_ENAMETOOLONG): New macro.
5066         (__getcwd.c): Don't restore errno; glibc doesn't.
5067         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5068         first, falling back to our code only if its results look suspicious.
5069         Ensure that the resulting buffer is only as large as necessary.
5070
5071         * readutmp.c: Include readutmp.h first.
5072         Include <errno.h>, since readutmp.h no longer does that.
5073         * readutmp.h: Don't include <errno.h>,
5074         <sys/param.h>, <time.h>; not needed to establish interface.
5075         (errno): Remove decl.
5076         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5077         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5078         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5079
5080 2004-11-28  Simon Josefsson  <jas@extundo.com>
5081
5082         * base64.h, base64.c: New file.
5083
5084 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5085
5086         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5087
5088 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5089
5090         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5091         HP's ANSI C compiler.
5092         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5093         Declaring int functions causes warnings on some modern systems and
5094         shouldn't be needed to compile on ancient ones.
5095         * same.c (MIN) [defined MIN]: Don't define, since it's already
5096         defined.
5097
5098         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5099         with the following changes.
5100         (__set_errno): Parenthesize properly.
5101         Include <stdbool.h>.
5102         (MIN, MAX, MATCHING_INO): New macros.
5103         (__getcwd): Define with prototype, not K&R form.
5104         Use heuristics to allocate default buffer on stack if possible.
5105         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5106         behavior, and to avoid the PATH_MAX limit when computing
5107         ../../../../...
5108         Use MATCHING_INO to compare inode number to file.
5109         Check for arithmetic overflow in size calculations.
5110         Fix bug in reallocation of dot array that caused getcwd to fail
5111         on directories nested deeper than 75.
5112         Be more careful about saving errno on error.
5113         Do not use realloc; use only free+malloc, as this is a bit
5114         more flexible and avoids a needless copy operation.
5115         Do not inspect st_dev and st_ino for symbolic links; POSIX
5116         doesn't specify the latter.
5117         Check for closedir errors.
5118         Avoid needless casts.
5119         Use "#ifdef weak_alias" around weak_alias, to be like other
5120         glibc code.
5121         The following changes to getcwd.c have effect only when used in
5122         gnulib; they have no effect inside glibc proper.
5123         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5124         as alloca isn't used.
5125         (alloca, __alloca): Likewise.
5126         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5127         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5128         unconditionally, as gnulib assumes C89 or better.
5129         Do not include <sys/param.h>.
5130         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5131         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5132         better.
5133         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5134         Include <dirent.h> in a way that is compatible with modern Autoconf.
5135         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5136         New macros, if not already defined.
5137         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5138         Use "_LIBC", not "defined _LIBC", for consistency.
5139         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5140         a mempcpy module.
5141         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5142         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5143         * xgetcwd.c: David MacKenzie's old code was removed, so give
5144         credit only to Jim Meyering and adjust the copyright dates.
5145         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5146         <stdlib.h>, <unistd.h>, "pathmax.h".
5147         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5148         (INITIAL_BUFFER_SIZE): Remove.
5149         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5150
5151 2004-11-23  Jim Meyering  <jim@meyering.net>
5152
5153         * getopt_.h: Remove trailing blanks.
5154
5155 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5158         (futimens): New function, which uses futimes if available.
5159         (futimens, utimens): Support timespec==NULL, with same semantics
5160         as utime and utimens.
5161         * utimens.h (futimens): New decl.
5162
5163 2004-11-23  Jim Meyering  <jim@meyering.net>
5164
5165         * __fpending.c: Add comment.
5166
5167 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5168
5169         * getopt_.h: Re-addition of __getopt_argv_const caused
5170         redefinition warnings. To avoid them, include the defines
5171         in `#if !defined __need_getopt ... #endif'. The only place
5172         where __getopt_argv_const is used is in definitions
5173         of getopt_long and getopt_long_only below, which are as well
5174         protected by `#ifndef __need_getopt'.
5175         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5176         __need_getopt after including <stdio.h> and <unistd.h> These
5177         headers might have defined it.
5178
5179 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5180
5181         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5182         New macros.
5183         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5184         optopt): Use them instead of invoking ## directly; otherwise, the
5185         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5186
5187 2004-11-19  Bruno Haible  <bruno@clisp.org>
5188
5189         * strtok_r.c: Move comments from here...
5190         * strtok_r.h: ... to here.
5191
5192 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5193
5194         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5195         might fail.  Problem reported by Yoann Vandoorselaere.
5196         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5197         that mishandle size_t overflow.
5198
5199 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5200
5201         * canon-host.c: Include "strdup.h".
5202         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5203         Use strdup instead of malloc/strcpy to duplicate strings.
5204
5205         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5206         (human_space_before_unit): New constant.
5207         * human.c (human_readable): Support it.
5208
5209         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5210         (xgetcwd): Set errno correctly when failing.
5211         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5212         the failure is actually due to a PATH_MAX problem.
5213
5214         Further getopt changes to make it more likely that glibc will
5215         buy the changes back.
5216         * getopt.c (POSIXLY_CORRECT): New constant.
5217         (getopt): Use it, so to preserve glibc semantic
5218         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5219         when compiling for libc.
5220         * getopt_.h (__getopt_argv_const): Bring it back.
5221         (getopt_long, getopt_long_only): Use it.
5222
5223         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5224         New arg POSIXLY_CORRECT.  All callers changed.
5225         (getopt): Argv is now char * const *, as per standard.
5226         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5227         not char *__getopt_argv_const *.
5228         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5229         _getopt_long_only_r): Likewise.
5230         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5231         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5232         _getopt_long_r, _getopt_long_only_r): Likewise.
5233         * getopt_.h (__getopt_argv_const): Remove.
5234         (getopt): Argv is now char * const *, as per standard.
5235
5236         * getdate.y (tORDINAL): New token.
5237         (day, relunit): Allow it for relative times.
5238         (relative_time_table): Use tORDINAL for ordinals.
5239
5240 2004-11-15  Jim Meyering  <jim@meyering.net>
5241
5242         * closeout.c: Include "__fpending.h" once again.
5243         Include <stdbool.h>.
5244         (close_stdout): Don't fail just because stdout was closed initially,
5245         since some programs don't write to stdout in the normal course of
5246         operation (other than --version and --help), and we don't want this
5247         function to make e.g. `touch file >&-' fail.
5248         But do fail if it was closed and someone has tried to write to it.
5249         E.g., `printf foo >&-' must fail.
5250
5251 2004-11-11  Simon Josefsson  <jas@extundo.com>
5252
5253         * strtok_r.h, strtok_r.c: New file.
5254
5255 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5256
5257         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5258         we can stop lying to compilers about the constness of argv when we
5259         are compiled outside glibc.
5260         (getopt, getopt_long, getopt_long_only): Use it.
5261         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5262         getopt): Likewise.
5263         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5264         _getopt_long_only_r): Likewise.
5265         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5266         _getopt_long_only_r): Likewise.
5267
5268         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5269         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5270         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5271         the other external symbols.
5272         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5273         declaration, since the above renaming now works around collisions.
5274
5275 2004-11-11  Jim Meyering  <jim@meyering.net>
5276
5277         * linebreak.c: Remove trailing blanks.
5278         * alloca_.h: Likewise.
5279         * acosl.c: Likewise.
5280         * euidaccess.c: Likewise.
5281         * allocsa.h: Likewise.
5282
5283 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5284
5285         * mktime.c (SHR): New macro, which is a portable
5286         substitute for >> that should work even on Crays.
5287         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5288         Problem reported by Mark D. Baushke in
5289         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5290         * getdate.y (SHR): Likewise.
5291         (tm_diff): Use it.
5292         * strftime.c (SHR): Likewise.
5293         (tm_diff): Use it.
5294         * quotearg.c (struct quoting_options): Use unsigned int for
5295         quote_these_too, so that right shifts are well defined.  All uses
5296         changed.
5297
5298 2004-11-10  Simon Josefsson  <jas@extundo.com>
5299
5300         * getaddrinfo.h, getaddrinfo.c: New files.
5301
5302 2004-11-10  Jim Meyering  <jim@meyering.net>
5303
5304         Ensure that no close failure goes unreported.
5305         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5306         return early when it seems there's nothing to flush.
5307         Don't include __fpending.h.
5308
5309 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5310
5311         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5312
5313 2004-11-05  Bruno Haible  <bruno@clisp.org>
5314
5315         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5316         Reported by Mark D. Baushke <mdb@cvshome.org>.
5317
5318 2004-11-04  Bruno Haible  <bruno@clisp.org>
5319
5320         2004-09-11  Bruno Haible  <bruno@clisp.org>
5321                 * allocsa.valgrind: New file.
5322         2004-02-06  Bruno Haible  <bruno@clisp.org>
5323                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5324                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5325                 Reported by Christopher Seip <chris.seip@hp.com>.
5326
5327 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5328
5329         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5330         with errno == ERANGE if the buffer is too small.
5331         Problem reported by Mark D. Baushke.
5332
5333 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5334
5335         * xreadlink.c (MAXSIZE): New macro.
5336         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5337         size does not exceed MAXSIZE.  Avoid cast.
5338         As suggested by Mark D. Baushke in
5339         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5340         if readlink fails with buffer size just under MAXSIZE, try again
5341         with MAXSIZE.
5342
5343 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5344         and  Paul Eggert  <eggert@cs.ucla.edu>
5345
5346         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5347         (get_date): Overparenthesize to avoid GCC warning.
5348
5349 2004-11-02  Bruno Haible  <bruno@clisp.org>
5350
5351         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5352         function returns void.
5353
5354 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5355
5356         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5357         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5358         already declared.
5359
5360 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5361
5362         * getdate.y: Add support for TZ="foo" within a date string.
5363         Fix some bugs near time_t boundaries.  Reject dates with
5364         out-of-range components, e.g., "Sept 31".
5365         Include <stdlib.h>, "setenv.h", "xalloc.h".
5366         (ISDIGIT_LOCALE): Remove; unused.
5367         Note that the TZ and time functions used here are not reentrant.
5368         (mktime_ok, get_tz): New functions.
5369         (TZBUFSIZE): New constant.
5370         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5371         This requires that we sometimes generate our own TZ="XXX..." setting.
5372
5373 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5374
5375         * mktime.c (not_equal_tm): Remove redundant check.
5376
5377 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5378
5379         * getdate.y: Use Bison 1.875 features, and some minor
5380         code cleanups.  This change does not affect semantics.
5381         Don't include <stdlib.h>; no longer needed.
5382         Don't include unlocked-io.h; only the "#if TEST" code uses
5383         stdio, and performance isn't crucial there.
5384         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5385         Bison 1.875 features as described below.
5386         All uses of "PC." replaced by "pc->".
5387         (YYSTYPE): Add a forward declaration.
5388         (yylex, yyerror): Use full prototypes in forward decls.
5389         Use "%pure-parser" rather than obsolescent "%pure_parser".
5390         Use %parse-param and %lex-param instead of obsolescent
5391         YYPARSE_PARAM and YYLEX_PARAM.
5392         (meridian_table, month_and_day_table, time_units_table,
5393         relative_time_table, time_zone_table, military_table,
5394         lookup_zone, lookup_word, get_date):
5395         Use NULL instead of 0 where appropriate.
5396         (to_hour): Avoid abort (), to avoid a dependency on
5397         stdlib.h.
5398         (yyerror, yylex): Now accepts parser_control * arg.
5399         (main) [TEST]: Use '\0' rather than 0 for char.
5400
5401 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5402
5403         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5404         It's now the caller's responsibility to handle the case where
5405         !HAVE_GETPAGESIZE && !defined getpagesize.
5406
5407         * mktime.c (leapyear): Arg is long int, not int.
5408
5409 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5410
5411         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5412
5413 2004-10-12  Simon Josefsson  <jas@extundo.com>
5414
5415         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5416         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5417         to real functions.
5418
5419 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5420
5421         * vsnprintf.h: New file.
5422         * vsnprintf.c: New file.
5423
5424 2004-10-07  Bruno Haible  <bruno@clisp.org>
5425
5426         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5427         into the provided buffer.
5428
5429 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5430
5431         * diacrit.c, diacrit.h: Add GPL notice.
5432
5433         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5434         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5435         * logl.c (logl): Keep the code as similar to glibc as possible.
5436         This avoids a potential constant-folding bug.
5437
5438 2004-10-05  Bruno Haible  <bruno@clisp.org>
5439
5440         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5441
5442 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5443
5444         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5445         * xmalloc.c (xmemdup): Likewise.
5446         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5447         XFREE): Remove these long-obsolescent macros.
5448         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5449         * xstrdup.c: Remove.
5450
5451         * regex.c (re_comp): Cast gettext return value to char *,
5452         Problem reported by Martin Neitzel via Mark D. Baushke.
5453
5454 2004-10-04  Simon Josefsson  <jas@extundo.com>
5455
5456         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5457         '#ifdef USE_UNLOCKED_IO'.
5458
5459 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5460
5461         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5462         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5463         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5464         regex.c, sha1.c, version-etc.c, yesno.c:
5465         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5466         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5467         the includer's responsibility.
5468
5469         Sync from coreutils.
5470
5471         * modechange.c (mode_compile): Don't decrement a pointer that
5472         points to the start of a string, as the C Standard says the
5473         resulting behavior is undefined.
5474
5475         * backupfile.h (enum backuptype): Rename none -> no_backups,
5476         simple -> simple_backups, numbered_existing ->
5477         numbered_existing_backups, numbered -> numbered_backups
5478         to avoid shadowing problems.  All uses changed.
5479         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5480         * backupfile.c (check_extension, numbered_backup):
5481         Rename locals to avoid shadowing 'basename'.
5482         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5483         once.
5484
5485         * .cppi-disable: Add getopt_.h, getopt_int.h.
5486         * .cvsignore: Add getopt.h.
5487
5488 2004-10-04  Simon Josefsson  <jas@extundo.com>
5489
5490         * memmem.h: New file.
5491         * memmem.c: New file, taken from glibc.
5492
5493 2004-10-02  Jim Meyering  <jim@meyering.net>
5494
5495         * dirfd.h, getpagesize.h: Add copyright notice.
5496
5497 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5498
5499         * snprintf.c: Remove comments as to why each header is needed.
5500
5501 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5502
5503         * strsep.h: New file.
5504         * strsep.c: New file.
5505
5506 2004-10-01  Simon Josefsson  <jas@extundo.com>
5507
5508         * snprintf.c (snprintf): Handle size==0.
5509
5510 2004-10-01  Simon Josefsson  <jas@extundo.com>
5511             Bruno Haible  <bruno@clisp.org>
5512
5513         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5514         (snprintf): Declare 'args'.
5515
5516 2004-09-30  Simon Josefsson  <jas@extundo.com>
5517
5518         * snprintf.h, snprintf.c: New files.
5519
5520 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5521
5522         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5523         (hol_entry_help): Never translate an empty string.
5524         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5525         * argp.h (OPTION_NO_TRANS): New option.
5526
5527 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5528
5529         * xvasprintf.c: Include xalloc.h.
5530         (xvasprintf): Use xalloc_die, not xmalloc_die.
5531
5532 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5533
5534         * dummy.c: Change copyright notice to FSF, and license to GPL.
5535
5536 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5537
5538         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5539         Problem reported by Bruno Haible in:
5540         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5541
5542 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5543
5544         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5545         in case some system header has #define'd it.  Problem reported by
5546         Soeren D. Schulze in
5547         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5548
5549 2004-09-08  Bruno Haible  <bruno@clisp.org>
5550
5551         * stdint_.h: New file, taken from GNU clisp.
5552
5553 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5554
5555         * xvasprintf.h: New file.
5556         * xvasprintf.c: New file.
5557         * xasprintf.c: New file.
5558
5559 2004-09-08  Bruno Haible  <bruno@clisp.org>
5560
5561         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5562         is > INT_MAX.
5563         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5564
5565 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5566
5567         Import from coreutils.
5568         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5569         strings on unbounded length.  alloca's performance benefits aren't
5570         that important here.
5571         (V_STRDUP): Remove.
5572         (parse_with_separator): New function, with most of the internals
5573         of the old parse_user_spec.  Allow user to omit both user and group,
5574         for compatibility with FreeBSD.
5575         Clone only the user name, not the entire spec.
5576         Do not set *uid, *gid unless entirely successful.
5577         Avoid memory leak in some failing cases.
5578         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5579         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5580         (parse_user_spec): Rewrite to use parse_with_separator.
5581
5582 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5583
5584         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5585         its complicated substitute.
5586         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5587         and program_invocation_name.
5588         (__argp_basename) [!_LIBC]: Remove; the only use was
5589         replaced by its body.
5590         (__argp_short_program_name): Change condition from
5591         !defined __argp_short_program_name to
5592         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5593         to match argp-namefrob.h.
5594         (__argp_failure): Don't assume strerror_r returns char *.
5595         * argp-parse.c (N_): Define unconditionally.
5596         (argp_default_options): Fill out initializers with 0 to avoid
5597         gcc warnings.
5598
5599 2004-08-12  Simon Josefsson  <jas@extundo.com>
5600
5601         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5602         * getopt_.h: Renamed from getopt.h.
5603
5604 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5605
5606         Merge from coreutils.
5607
5608         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5609         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5610         for Reliant Unix 5.43.
5611
5612         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5613         (union fooround): Use uintmax_t, not long int.
5614         The rest is a merge from libc:
5615         [defined _LIBC]: Include <shlib-compat.h>.
5616         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5617
5618         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5619
5620         * strverscmp.c: Convert to UTF-8.
5621
5622 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5623
5624         * obstack.h (obstack_empty_p):
5625         Don't assume that chunk->contents is suitably aligned.
5626         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5627         Likewise. Problem reported by Benno in
5628         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5629
5630         * chown.c (rpl_chown): Work even if the file is writeable but not
5631         readable.  This could be improved further but it'd take some work.
5632
5633 2004-08-08  Simon Josefsson  <jas@extundo.com>
5634
5635         * xgethostname.c: Don't include error.h (not used).
5636
5637         * getpass.h: Add.
5638         * getpass.c: Include getpass.h first.
5639
5640 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5641
5642         * xalloc-die.c: New files.
5643         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5644         All uses removed.
5645         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5646         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5647         (_, N_, xalloc_die): Move to xalloc-die.c.
5648         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5649         so that we needn't mess with xalloc_msg_memory_exhausted.
5650
5651         * sha1.h: Renamed from sha.h.
5652         (SHA1_H): Renamed from _SHA_H.
5653         (sha1_ctx): Renamed from sha_ctx.
5654         (sha1_init_ctx): Renamed from sha_init_ctx.
5655         (sha1_process_block): Renamed from sha_process_block.
5656         (sha1_process_bytes): Renamed from sha_process_bytes.
5657         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5658         (sha1_read_ctx): Renamed from sha_read_ctx.
5659         (sha1_stream): Renamed from sha_stream.
5660         (sha1_buffer): Renamed from sha_buffer.
5661         * sha1.c: Likewise; renamed from sha.c.
5662         Do not include <sys/types.h>.
5663         Include <stddef.h> rather than <stdlib.h>.
5664
5665 2004-08-08  Bruno Haible  <bruno@clisp.org>
5666
5667         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5668         FILESYSTEM_PREFIX_LEN.
5669         * progreloc.c: Likewise.
5670         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5671
5672 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5673
5674         Merge from tar.
5675         * argp-help.c (make_hol, hol_append): Don't assume that
5676         SIZE_MAX is a valid preprocessor constant.
5677         (__argp_basename): Change from "#ifndef _LIBC"
5678         to "#ifndef __argp_short_program_name", so that
5679         we don't compile these functions for tar.
5680
5681         More merges from coreutils.
5682         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5683         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5684         yesno.h: New files.
5685         * addext.c: Remove; no longer needed.
5686         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5687         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5688         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5689         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5690         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5691         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5692         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5693         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5694         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5695         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5696         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5697         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5698         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5699         Import changes from coreutils.
5700
5701 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5702
5703         Merge from coreutils.
5704
5705         * .gdb-history: Remove; this doesn't belong here.
5706
5707         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5708         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5709         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5710
5711         * dirname.h: Include <stdbool.h>.
5712         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5713         for consistency with POSIX terminology.  All uses changed.
5714         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5715         (strip_trailing_slashes): Use bool for booleans.
5716         * stripslash.c (strip_trailing_slashes): Likewise.
5717
5718         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5719         sometimes returns a positive errno value even when it succeeds.
5720         (print_errno_message) [!LIBC]: Fall back on strerror if
5721         __strerror_r fails.
5722
5723         * path-concat.c (mempcpy): Don't define if a system header defines it.
5724         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5725         (longest_relative_suffix): New function.
5726         (path_concat): Use it.  Assume first argument is not NULL.
5727         Port to DOS.  Omit redundant separators.
5728         Report an error instead of returning NULL.
5729         Use mempcpy instead of memcpy.
5730         (xpath_concat): Remove: not declared or used.
5731
5732         * same.h: Include <stdbool.h>
5733         (same_name): Return bool, not int.
5734         * same.c (same_name): Likewise.
5735         (errno): Don't declare; we assume C89 or better now.
5736
5737         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5738         if not already defined.
5739
5740         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5741         * dup-safer.c (errno): Likewise.
5742
5743 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5744
5745         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5746         working.
5747
5748 2004-08-03  Simon Josefsson  <jas@extundo.com>
5749
5750         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5751         * progname.h: Don't include stdbool.h.
5752
5753 2004-08-02  Simon Josefsson  <jas@extundo.com>
5754
5755         * getsubopt.h: New file, with comments from Bruno Haible.
5756         * getsubopt.c: New file, from glibc, but slightly modified based on
5757         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5758
5759 2004-08-01  Simon Josefsson  <jas@extundo.com>
5760
5761         * xgetdomainname.c: Include stdlib.h, for free().
5762
5763 2004-07-16  Simon Josefsson  <jas@extundo.com>
5764
5765         * dummy.c: New file.
5766
5767 2004-07-16  Bruno Haible  <bruno@clisp.org>
5768
5769         * backupfile.h: Add extern "C" for C++.
5770         * closeout.h: Likewise.
5771         * copy-file.h: Likewise.
5772         * findprog.h: Likewise.
5773         * full-write.h: Likewise.
5774         * pathname.h: Likewise.
5775         * progname.h: Likewise.
5776         * stpcpy.h: Likewise.
5777         * stpncpy.h: Likewise.
5778         * strcase.h: Likewise.
5779         * strstr.h: Likewise.
5780         * xalloc.h: Likewise.
5781
5782         * mbswidth.h: Add extern "C" for C++.
5783         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5784
5785 2004-07-09  Simon Josefsson  <jas@extundo.com>
5786
5787         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5788         failed without this.)
5789
5790 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5791
5792         * fchown-stub.c: New file.
5793
5794 2004-06-24  Jim Meyering  <jim@meyering.net>
5795
5796         * obstack.h (obstack_base): Cast to (void *), per documentation.
5797
5798 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5799
5800         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5801
5802 2004-06-01  Jim Meyering  <jim@meyering.net>
5803
5804         * calloc.c: New file.
5805
5806 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5807
5808         * getdate.y (yylex): Allow space between sign and number.
5809         Problem reported by Dan Jacobson.
5810
5811 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5812         and  Jim Meyering  <jim@meyering.net>
5813
5814         Merge from coreutils CVS.
5815
5816         * stat-macros.h: New file, with contents from file-type.h
5817         and coreutils' system.h.
5818         * file-type.c: Include "stat-macros.h".
5819         * file-type.h (file_type): Move all macro definitions to new file,
5820         stat-macros.h.
5821
5822         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5823         Wrap old code with this conditional.
5824         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5825         function that does not dereference symlinks.
5826         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5827
5828         * xreadlink.c: Include xreadlink.h first, to catch .h file
5829         dependency problems.
5830         (xreadlink): Accept new arg SIZE, for efficiency.
5831         All decls and uses changed.
5832         * xreadlink.h: Include <stddef.h>, for size_t.
5833
5834         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5835         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5836
5837         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5838
5839 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5840
5841         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5842         macros to be defined.
5843         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5844         the allocator returns NULL because the requested size is zero.
5845
5846 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5847
5848         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5849         var.  Add comment explaining why libc still defines it.  This
5850         merges the following patch from glibc:
5851         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5852
5853 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5854
5855         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5856         present in glibc since revision 1.1 of this file.
5857         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5858         obstack_alignment_mask, obstack_alloc, obstack_base,
5859         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5860         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5861         obstack_grow0, obstack_init, obstack_int_grow,
5862         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5863         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5864         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5865         nonexistent functions.
5866
5867 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5868             Paul Eggert  <eggert@cs.ucla.edu>
5869
5870         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5871
5872 2004-05-14  Bruno Haible  <bruno@clisp.org>
5873
5874         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5875         that consists of a '.' followed by an empty digit string.
5876         Patch by Tor Lillqvist <tml@iki.fi>.
5877
5878 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5879
5880         Port obstack to the AS/400, where pointers are 16 bytes wide and
5881         you cannot cast an integer to a valid pointer.  This patch is
5882         currently waiting to be integrated into glibc; see
5883         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5884
5885         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5886         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5887         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5888         (struct obstack): temp member is now a union of a pointer and
5889         an integer, instead of an integer.  All integer uses changed.
5890         This does not affect the physical layout of struct obstack,
5891         except on hosts (like the AS/400) where the size or alignment of
5892         void * is greater than that of ptrdiff_t.
5893         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5894         __STDC__)]: Store temporary in pointer member of union, not
5895         integer member.
5896         * obstack.c: Include <stddef.h>, for offsetof.
5897         (struct fooalign): Remove; it doesn't need a name.
5898         (union fooround): Change double to long double, and add void *.
5899         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5900         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5901         not a macro.  Hence the values are always int; so remove all
5902         casts-to-int in uses.
5903
5904 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5905             Derek Price  <derek@ximbiot.com>
5906
5907         * alloca.c: Include <alloca.h>, to get our interface.
5908         * alloca_.h: Use __alloca on AIX, so that we don't have to
5909         include <alloca.h> first.  Use C89 prototype for alloca; this
5910         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5911         Use #elif for simplicity, since we can assume C89 now.
5912         Don't try to source the system alloca.h since it will not be found
5913         and to prevent recursively including its replacement.
5914         * fnmatch.c: Include <alloca.h> instead of opencoding.
5915         * regex.c: Likewise.
5916
5917 2004-05-16  Derek Price  <derek@ximbiot.com>
5918             Paul Eggert  <eggert@cs.ucla.edu>
5919
5920         getline cleanup.  This changes the getndelim2 API: both order of
5921         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5922         no delimiter).
5923
5924         * getline.c: Don't include stddef.h or stdio.h, since our
5925         interface does that.
5926         (getline): Always use getdelim, so that we don't have two
5927         copies of this code.
5928         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5929         if available.
5930         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5931         (GETNDELIM2_MAXIMUM): New macro.
5932         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5933         instead of the old practice of delim2==0.  All callers changed.
5934         Return -1 on overflow, instead of returning junk.
5935         Do not set *linesize unless allocation succeeds.
5936         * getndelim2.h: Do not include stddef.h; no longer needed, now
5937         that we include sys/types.h.
5938         * getnline.h: Likewise.
5939         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5940         (getndelim2): Reorder arguments.
5941         * getnline.c (getnline, getndelim):
5942         Don't discard the NMAX argument.
5943         (getnline): Invoke getndelim, to avoid code duplication.
5944         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5945         of (size_t) -1 by callers of the getnline family.
5946
5947 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5948
5949         * nanosleep.c (suspended): Change its type from int to
5950         sig_atomic_t volatile.
5951         (first_call): Make it private to rpl_nanosleep, and have it
5952         be zero initially as that's a bit faster.
5953         (my_usleep): Round up fractional times instead of truncating them,
5954         as this is the usual meaning for 'sleep'.
5955
5956         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5957         doesn't work.
5958         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5959         (ENOSYS): Define if not defined.
5960         (settime): Fall back on stime if it exists and settimeofday fails.
5961         But don't bother with fallbacks if a method fails with errno == EPERM.
5962
5963 2004-05-11  Jim Meyering  <jim@meyering.net>
5964
5965         Prior to this change, the save_cwd caller required read access to the
5966         current directory on most systems (ones with the fchdir function).
5967
5968         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5969         fails, try write-only, and finally, resort to using xgetcwd.
5970
5971 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5972
5973         * obstack.c, obstack.h: Import changes from libc.
5974
5975 2004-04-28  Bruno Haible  <bruno@clisp.org>
5976
5977         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5978         implicitly appends .exe to executables.
5979         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5980         accepts Windows pathnames.
5981         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5982         Cygwin like Windows, since it now accepts Windows pathnames.
5983         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5984         Cygwin like Windows, since it now accepts Windows pathnames.
5985         Reported by Derek Robert Price <derek@ximbiot.com>.
5986
5987 2004-04-20  Jim Meyering  <jim@meyering.net>
5988
5989         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5990
5991 2004-04-20  Jim Meyering  <jim@meyering.net>
5992             Bruno Haible  <bruno@clisp.org>
5993
5994         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5995         memory when realloc fails.
5996
5997 2004-04-18  Jim Meyering  <jim@meyering.net>
5998
5999         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6000         don't leak memory and do call END_UTMP_ENT.
6001
6002 2004-04-11  Paul Eggert  <eggert@twinsun.com>
6003
6004         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6005         (CHAR_BIT): Remove, since we assume C89.
6006         Include <stdint.h> if available, as per current Autoconf CVS advice.
6007
6008 2004-03-30  Paul Eggert  <eggert@twinsun.com>
6009
6010         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6011         not bool, to be more consistent with Unix conventions.
6012         Suggested by Bruno Haible.
6013
6014         Merge from coreutils.
6015
6016         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6017         New files.
6018
6019         * getdate.h: Include stdbool.h, and timespec.h instead of
6020         the usual <time.h> dance.
6021         (get_date): Change signature to support fractional time stamps.
6022         All callers changed.
6023         * getdate.y: Include "getdate.h" first, as we can now
6024         assume C89 and don't need to worry about 'const'.
6025         Similarly, include "unlocked-io.h" near start, not in middle.
6026         Include <limits.h>.
6027         (textint.value): Use long int rather than int.
6028         (textint.digits): Use size_t rather than int.
6029         (BILLION, LOG10_BILLION): New constants.
6030         (parser_control): New member rel_ns.  Members day_ordinal,
6031         time_zone, month, day, hour, minutes, rel_year, rel_month,
6032         rel_day, rel_hour, rel_minutes, rel_seconds
6033         are now long int, not int.  Member seconds is now struct timespec,
6034         not int.  New member timespec_seen.  Members dates_seen, days_seen,
6035         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6036         not int.
6037         (%union.intval): Now long int, not int.
6038         New member timespec.
6039         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6040         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6041         (spec): Now is a timespec or an item list.
6042         (timespec, items): New nonterminals.
6043         (time, rel, relunit, number, get_date):
6044         Add support for fractional seconds.
6045         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6046         (gmtime, localtime, mktime): Remove decls; not needed with C89.
6047         (to_hour): First arg is now long int, not int.
6048         (to_year): Returns long int, not int.
6049         Don't treat year -70 like 70.
6050         (tm_diff): Returns long int, not int.
6051         (lookup_word): Use bool instead of int when appropriate.
6052         (yylex): Use size_t for count, not int.
6053         Detect overflow when parsing large integer constants.
6054         Add support for fractions.
6055         (get_date): Make pointers 'const' if possible.
6056         Use more-portable code to detect integer overflow.
6057         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
6058         Don't use ctime; it's not reliable if the year has >4 digits.
6059
6060         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6061         This is for compatibility with BSD.
6062
6063         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6064         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6065         From coreutils' system.h.
6066
6067         * userspec.c: Don't include "posixver.h".
6068         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6069         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6070         compatible extension.  Simplify code by removing a boolean int
6071         that was always nonzero if a string was nonnull.
6072
6073 2004-03-30  Jim Meyering  <jim@meyering.net>
6074
6075         Merge from coreutils.
6076
6077         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6078
6079         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6080         an empty input stream.
6081
6082         * readtokens.c: Include <stdbool.h>.
6083         (readtoken): Use `size_t' rather than int/long.
6084         All callers adjusted.
6085         Use `bool' rather than `int' where appropriate.
6086         Use memset rather than an explicit loop.
6087         Use x2nrealloc rather than xrealloc.
6088         Allow the use of `\0' as a delimiter.
6089         (readtokens): Likewise.
6090         * readtokens.h (readtoken, readtokens): Update prototypes.
6091
6092 2004-03-30  Bruno Haible  <bruno@clisp.org>
6093
6094         * getloadavg.c (getloadavg): Don't assume setlocale returns
6095         nonnull.
6096
6097 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6098
6099         Merge changes to getloadavg.c from coreutils and Emacs.
6100
6101         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6102         Define to an expression, not to the empty string.
6103         Include cloexec.h and xalloc.h.
6104         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6105         Use set_cloexec_flag rather than rolling our own.
6106         * cloexec.c, cloexec.h: New files.
6107
6108 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6109
6110         * getopt.h: Sync with libc CVS.
6111
6112 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6113             Bruno Haible  <bruno@clisp.org>
6114
6115         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6116         not on all platforms that have <wchar.h>.
6117         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6118
6119 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6120
6121         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6122         Sync with libc CVS.
6123         * getopt_int.h: New file, also synced from libc.
6124
6125 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6126
6127         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6128         '#if' expressions.  Unlike the code it replaces, it does not
6129         depend on (defined _SC_PAGESIZE).  However, it does depend on
6130         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6131         first reported by Jason Andrade in
6132         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6133
6134 2004-01-18  Simon Josefsson  <jas@extundo.com>
6135
6136         * strdup.h: New file.
6137         * strdup.c: Include it.
6138         * path-concat.c: Include strdup.h. Drop strdup declaration.
6139         * userspec.c: Include strdup.h. Drop strdup declaration.
6140
6141 2004-02-06  Karl Berry  <karl@gnu.org>
6142
6143         * config.charset: update from gettext 0.14.1.
6144
6145 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6146
6147         Add comments and code, prompted by suggestions from Bruno Haible
6148         for sh-quote.
6149         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6150         describing the enum quoting_style values.
6151         * quotearg.c (quotearg_alloc): New function.
6152         (quotearg_buffer_restyled): Treat lone { and } as special.
6153         Treat = as special.  Work around bug with older shells
6154         that "see" a '\' that is really the 2nd byte of a multibyte char.
6155         Quote empty string with shell_quoting_style.
6156
6157 2004-02-03  Bruno Haible  <bruno@clisp.org>
6158
6159         * pipe.h: New file, from GNU gettext.
6160         * pipe.c: New file, from GNU gettext.
6161
6162 2004-01-27  Bruno Haible  <bruno@clisp.org>
6163
6164         * execute.h: New file, from GNU gettext.
6165         * execute.c: New file, from GNU gettext.
6166         * w32spawn.h: New file, from GNU gettext.
6167
6168 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6169
6170         Exit-status fix from coreutils.
6171
6172         Use exit_failure consistently in place of EXIT_FAILURE,
6173         so that program exit statuses are consistent on failure.
6174
6175         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6176         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6177         * argmatch.h: Comment fix to match the above.
6178         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6179         Now a macro referring to exit_failure, instead of a separate
6180         variable.  Include "exitfail.h" to get it.
6181         * xstrtol.h: Include "exitfail.h".
6182         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6183
6184         * long-options.c (parse_long_options): Use prototype
6185         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6186         for clarity.
6187
6188 2004-01-21  Jim Meyering  <jim@meyering.net>
6189
6190         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6191         so as not to conflict with a different-sized __mktime_internal
6192         function in GNU libc.
6193         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6194         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6195
6196 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6197
6198         Merge from diffutils.
6199
6200         * file-type.c (file_type): Add typed memory objects.
6201         * file-type.h (S_TYPEISTMO): New macro.
6202
6203         * c-stack.h (c_stack_action): Remove argv argument.
6204         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6205         (die): Don't calculate message unless segv_action returns.
6206         (get_stack_location, min_address_from_argv, max_address_from_argv,
6207         volatile stack_base, volatile_stack_size): Remove.
6208         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6209         that every segmentation violation is a stack overflow.  (Ouch!)
6210         See Debian bug 136249 (still outstanding) for more info about why
6211         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6212
6213 2003-11-30  Bruno Haible  <bruno@clisp.org>
6214
6215         Safer stack allocation.
6216         * setenv.c: Include allocsa.h.
6217         (alloca): Remove fallback definition.
6218         (freea): Remove macro.
6219         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6220         instead of freea.
6221
6222 2003-10-17  Bruno Haible  <bruno@clisp.org>
6223
6224         * binary-io.h: Avoid warnings on Cygwin.
6225
6226 2003-12-28  Bruno Haible  <bruno@clisp.org>
6227
6228         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6229         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6230
6231 2003-11-28  Bruno Haible  <bruno@clisp.org>
6232
6233         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6234
6235 2003-11-27  Bruno Haible  <bruno@clisp.org>
6236
6237         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6238
6239 2003-11-17  Bruno Haible  <bruno@clisp.org>
6240
6241         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6242
6243 2003-11-24  Bruno Haible  <bruno@clisp.org>
6244
6245         * xallocsa.h: New file, from GNU gettext.
6246         * xallocsa.c: New file, from GNU gettext.
6247
6248 2003-11-24  Bruno Haible  <bruno@clisp.org>
6249
6250         * allocsa.h: New file, from GNU gettext.
6251         * allocsa.c: New file, from GNU gettext.
6252
6253 2003-11-24  Bruno Haible  <bruno@clisp.org>
6254
6255         * eealloc.h: New file.
6256
6257 2004-01-15  Jim Meyering  <jim@meyering.net>
6258
6259         Merge from coreutils.
6260
6261         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6262         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6263         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6264
6265         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6266         optional configure-time default.
6267
6268         * version-etc.c (version_etc_copyright): Update copyright date.
6269
6270         * xreadlink.c (xreadlink): Correct outdated comment.
6271
6272 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6273
6274         Merge from coreutils.
6275
6276         * posixver.c: Include posixver.h.
6277
6278         * same.c: Include <stdbool.h>, <limits.h>.
6279         (_POSIX_NAME_MAX): Define if not defined.
6280         (MIN): New macro.
6281         (same_name): If file names are silently truncated, report
6282         that the file names are the same if they are the same after
6283         the silent truncation.
6284
6285         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6286         conversion function.
6287         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6288         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6289         longer needed.
6290
6291 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6292
6293         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6294         with like-named macro in fnmatch.c.
6295         (EXT): Use an internal constant instead.
6296
6297         Merge fnmatch patches from glibc.
6298         * fnmatch.c (mbsinit): Remove define.
6299         Add libc_hidden_ver (__fnmatch, fnmatch).
6300         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6301         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6302
6303 2003-12-14  Karl Berry  <karl@gnu.org>
6304
6305         * config.charset: update from gettext-runtime.
6306
6307 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6308
6309         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6310         Bug reported by Alfred M. Szmidt.
6311
6312 2003-11-29  Karl Berry  <karl@gnu.org>
6313
6314         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6315
6316 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6317             Bruno Haible  <bruno@clisp.org>
6318
6319         * printf-parse.h: Don't include sys/types.h.
6320         (ARG_NONE): New macro.
6321         (char_directive): Change type of *arg_index fields to size_t.
6322         * printf-parse.c: Don't include sys/types.h.
6323         (SSIZE_MAX): Remove macro.
6324         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6325         Remove unnecessary overflow check.
6326         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6327         fields.
6328
6329 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6330
6331         * alloca.c: Remove dependency on xalloc module.
6332         (xalloc_die): Remove.
6333         (memory_full) [!defined emacs]: New macro.
6334         [!defined emacs]: Don't include xalloc.h.
6335         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6336         address arithmetic overflows.  Change datatypes a bit to avoid
6337         unnecessary casts.
6338
6339 2003-11-22  Jim Meyering  <jim@meyering.net>
6340
6341         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6342
6343 2003-11-17  Bruno Haible  <bruno@clisp.org>
6344
6345         * vasnprintf.c (alloca): Remove fallback definition.
6346         (freea): Remove definition.
6347         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6348         Reported by Paul Eggert.
6349
6350 2003-11-17  Jim Meyering  <jim@meyering.net>
6351
6352         On systems without utime and without a utimes function capable of
6353         dealing with a NULL struct utimbuf* argument, this utime replacement
6354         could -- in unusual circumstances -- leak a file descriptor.
6355         * utime.c: Include <unistd.h> and <errno.h>.
6356         (utime_null): Be sure to close `fd' and to preserve errno.
6357         Reported by Geoff Collyer via Arnold Robbins.
6358
6359 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6360             Bruno Haible  <bruno@clisp.org>
6361
6362         Protect against address arithmetic overflow.
6363         * printf-args.h: Include stddef.h.
6364         (arguments): Change type of field 'count' to size_t.
6365         * printf-args.c (printf_fetchargs): Use size_t instead of
6366         'unsigned int' where appropriate.
6367         * printf-parse.h: Include sys/types.h.
6368         (char_directive): Change type of *arg_index fields to ssize_t.
6369         (char_directives): Change type of fields 'count', max_*_length to
6370         size_t.
6371         * printf-parse.c: Include sys/types.h and xsize.h.
6372         (SSIZE_MAX): Define fallback value.
6373         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6374         instead of 'int' where appropriate. Check a_allocated, d_allocated
6375         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6376         * vasnprintf.c: Include xsize.h.
6377         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6378         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6379         overflow. Avoid wraparound when converting a width or precision from
6380         decimal to binary.
6381
6382 2003-11-16  Bruno Haible  <bruno@clisp.org>
6383
6384         Update from GNU gettext.
6385         * printf-parse.c: Generalize to it can be compiled for wide strings.
6386         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6387         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6388         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6389         SNPRINTF): New macros.
6390         Don't include <alloca.h> if the file is used inside libintl.
6391         (local_wcslen): New function, for Solaris 2.5.1.
6392         (VASNPRINTF): Use it instead of wcslen.
6393
6394 2003-11-16  Bruno Haible  <bruno@clisp.org>
6395
6396         * xsize.h (xmax): New function.
6397         (xsum, xsum3, xsum4): Declare as "pure" functions.
6398
6399 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6400
6401         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6402         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6403         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6404         heuristic is just as accurate as far as we know, and it removes a
6405         dependency on size_max.m4 and ptrdiff_max.m4.
6406
6407 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6408
6409         * xstrtol.c (__xstrtol): Remove "break" immediately after
6410         "return", to pacify some unknown compiler.  Problem reported
6411         by Joerg Schilling.
6412
6413 2003-11-11  Bruno Haible  <bruno@clisp.org>
6414
6415         * xsize.h (SIZE_MAX): Remove fallback definition.
6416         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6417         defined.
6418
6419 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6420
6421         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6422         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6423         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6424         From Bruno Haible.
6425         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6426         not (size_t) -1, since it's defined here.
6427
6428 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6429
6430         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6431         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6432         Reject sizes of exactly SIZE_MAX bytes.
6433         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6434         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6435
6436 2003-11-05  Bruno Haible  <bruno@clisp.org>
6437
6438         * xsize.h: Include limits.h, to avoid a possible collision with
6439         SIZE_MAX defined in <limits.h> on Solaris.
6440
6441 2003-11-04  Bruno Haible  <bruno@clisp.org>
6442
6443         * xsize.h: New file.
6444         * linebreak.c: Include xsize.h.
6445         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6446         argument for overflow.
6447         Suggested by Paul Eggert.
6448
6449 2003-10-31  Bruno Haible  <bruno@clisp.org>
6450
6451         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6452         to avoid (extremely rare) race condition.
6453         Suggested by Paul Eggert.
6454
6455 2003-11-03  Jim Meyering  <jim@meyering.net>
6456
6457         * userspec.c: Include "userspec.h".
6458         * userspec.h: New file.
6459
6460 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6461
6462         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6463         * mountlist.c (SIZE_MAX): Define if not defined already.
6464         (read_filesystem_list): Set and use me_type_malloced.
6465         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6466         whatever the type happens to be), for brevity and consistency.
6467         Check for size calculation overflow on Alphas running OSF/1.
6468
6469 2003-10-31  Jim Meyering  <jim@meyering.net>
6470
6471         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6472
6473         * linebuffer.c: Include <string.h> for declaration of memset.
6474
6475 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6476             Bruno Haible  <bruno@clisp.org>
6477
6478         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6479         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6480
6481 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6482
6483         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6484         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6485         no longer needed.
6486         * quotearg.c (quotearg_n_options): Use it.
6487         * group-member.c: Include <stdbool.h>.
6488         (free_group_info): Arg is now const *; don't free arg.
6489         (get_group_info): Now returns bool and accepts struct group_info *,
6490         rather than returning a malloc'ed struct group_info *.
6491         All uses changed.  Check for overflow in internal size calculation.
6492
6493         * getusershell.c (readname): Simplify the code by using x2nrealloc
6494         rather than xmalloc/xrealloc.
6495         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6496         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6497         conformance bug: the old code used a pointer after freeing the
6498         storage that it addressed.
6499         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6500         rather than doing it by hand.
6501         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6502         the buffer preserved.  Use free and xmalloc instead.
6503         * quotearg.c (quotearg_n_options): Likewise.
6504         Use a simpler test for size overflow.  Don't use xalloc_oversized
6505         because unsigned int might be wider than size_t (!); this suggests
6506         that we should switch from unsigned int to size_t for slot numbers.
6507
6508 2003-10-27  Bruno Haible  <bruno@clisp.org>
6509
6510         * stdbool_.h: Better support for BeOS.
6511
6512 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6513
6514         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6515         to allocate the returned structure.  Do not allocate a subarray,
6516         as x2nrealloc will do that.
6517         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6518         instead of xnrealloc.
6519         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6520
6521 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6522
6523         * xalloc.h (xalloc_oversized): New static inline function, for
6524         callers that want to do their own size-overflow checking.  Include
6525         <stdbool.h>, since xalloc_oversized returns bool.
6526         * xalloc.c (array_size_overflow): Remove.  All callers changed
6527         to use xalloc_oversized.
6528
6529         Add two functions x2realloc, x2nrealloc, for programs that grow
6530         arrays dynamically by doubling their sizes.
6531         * xalloc.h (x2realloc, x2nrealloc): New decls.
6532         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6533         New functions.
6534
6535         Port to C99 semantics for 'inline' of external functions.
6536         Bug reported by Bruno Haible.
6537         * xmalloc.c (xnmalloc_inline): New static inline function,
6538         with the old contents of xnmalloc.
6539         (xnmalloc, xmalloc): Use it.
6540         (xnrealloc_inline): New static inline function,
6541         with the old contents of xnrealloc.
6542         (xnrealloc, xrealloc): Use it.
6543
6544         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6545
6546 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6547
6548         Fix several address-calculation bugs in the hash modules,
6549         plus some minor code cleanup.
6550
6551         * hash.h: Include <stdbool.h>, for bool.
6552         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6553         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6554         hash_get_n_entries, hash_get_max_bucket_length,
6555         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6556         hash_rehash): Use size_t rather than unsigned.
6557         * hash.c (struct hash_table, hash_get_n_buckets,
6558         hash_get_n_buckets_used, hash_get_n_entries,
6559         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6560         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6561         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6562         Likewise.
6563         (SIZE_MAX): Define if not defined.
6564         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6565         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6566         hash_print):
6567         Use const * when possible.
6568         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6569         (check_tuning): Fix bug: if tuning parameters were very close to
6570         0 or 1, rounding errors could have caused subscript violations.
6571         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6572         (hash_initialize): Add 'fail:' label
6573         to free table and return NULL, and use it to simplify code.
6574         Use calloc rather than clearing the storage ourself.
6575         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6576         buffer size calculations.
6577         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6578         Include <stddef.h>, for size_t.
6579         * hash-pjw.c (hash_pjw): Likewise.
6580         Switch to method described by Bruno Haible.
6581         Include <limits.h>, for CHAR_BIT.
6582         (SIZE_BITS): New macro.
6583
6584 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6585
6586         * getndelim2.c (getndelim2): When size calculation overflows,
6587         ceiling the allocation at NMAX bytes rather than silently
6588         discarding input bytes before NMAX is reached.  This makes
6589         a difference only if NMAX exceeds SIZE_MAX / 2.
6590
6591         * obstack.c: Merge from glibc.
6592         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6593         Add libc_hidden_def (_obstack_newchunk).
6594         (_obstack_free) [! defined _LIBC]: Remove.
6595         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6596         a clone of the function body.
6597         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6598         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6599
6600         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6601         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6602         arg to memcpy.
6603
6604         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6605         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6606         Don't use lvalue casts, as GCC plans to remove support for them
6607         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6608         was also present in the non-GCC version, indicating that this
6609         code had always been buggy and had never been widely used.
6610         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6611         Use the fast variant of each macro, rather than copying the
6612         definiens of the fast variant; that way, we'll be more likely to
6613         catch future bugs in the fast variants.
6614
6615 2003-10-20  Bruno Haible  <bruno@clisp.org>
6616
6617         * wait-process.h: New file, from GNU gettext.
6618         * wait-process.c: New file, from GNU gettext.
6619
6620 2003-10-19  Jim Meyering  <jim@meyering.net>
6621
6622         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6623
6624 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6625
6626         * getgroups.c: Include <errno.h>, <stdlib.h>.
6627         (getgroups): First arg is int, not size_t.
6628         Don't let 'free' mangle errno.
6629
6630 2003-10-16  Jim Meyering  <jim@meyering.net>
6631
6632         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6633
6634 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6635
6636         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6637         (SIZE_MAX): Remove.
6638         (new_exclude, add_exclude_file): Initial size no longer needs to
6639         be a power of 2.
6640         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6641         our own address arithmetic overflow checking.
6642
6643         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6644         (fnmatch): Do not alloca more than 2000 wide characters;
6645         instead, use malloc for large buffers.
6646         Check for address arithmetic overflow, and return -1
6647         with errno set to ENOMEM in that case.
6648         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6649         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6650         instead, return -1.  Check for address arithmetic overflow.
6651
6652 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6653
6654         Handle invalid suffixes and overflow independently, so that
6655         callers can treat them independently as needed.  Fix some bugs in
6656         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6657         suffix for a human-readable blocksize.  The major caller-visible
6658         change is the addition of a new
6659         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6660         that both overflow and suffix chars were found.
6661
6662         * human.c (humblock): Don't check separately for invalid suffix
6663         char; that is xstrtoumax's job (now that its bug is fixed).
6664         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6665         INTMAX_MAX]: New macros.
6666         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6667         TYPE_MAXIMUM): New macros.
6668         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6669         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6670         if overflow occurs, as it's what __strtol does and it's more useful
6671         in practice.
6672         (__xstrtol): If __strtol reports some error other than ERANGE,
6673         reflect it to the caller as LONGINT_INVALID.  If it reports
6674         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6675         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6676         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6677         value.
6678         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6679         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6680         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6681         [defined UINTMAX_MAX]: New macros.
6682
6683 2003-10-14  Bruno Haible  <bruno@clisp.org>
6684
6685         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6686         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6687         Also use volatile where needed.
6688
6689 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6690
6691         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6692         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6693         and define in terms of the other primitives.
6694         * xmalloc.c: Include stdbool.h; do not include exit.h.
6695         (SIZE_MAX): Define if not already defined.
6696         (array_size_overflow): New function.
6697         (xalloc_die): Abort instead of exiting if 'error' returns.
6698         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6699         (xmalloc, xrealloc): Use them.
6700         (xcalloc): Check for address arithmetic overflow.
6701         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6702         a bit faster than strcpy.
6703
6704 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6705
6706         Merge getpass from libc, plus a few fixes.
6707
6708         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6709         Include <stdbool.h>.
6710         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6711         __fsetlocking to empty.
6712         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6713         do include <bits/libc-lock.h>.
6714         Do not include <fcntl.h>; not needed.
6715         [_LIBC]: Include <wchar.h>.
6716         (NOTCANCEL_MODE): New macro.
6717         (flockfile, funlockfile) [_LIBC]: New macros.
6718         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6719         [!_LIBC]: New macros.
6720         (call_fclose): New function.
6721         (getpass): Use it.  Save tty stream separately; this simplifies the
6722         code and makes it more reliable if stdin happens to equal stdout.
6723         Invoke __fsetlocking on tty.
6724         Handle thread cancellation if needed.
6725         Namespace cleanup (use __tcgetattr, __getline).
6726         Use bool for Booleans.
6727         [USE_IN_LIBIO]: Handle wide streams.
6728         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6729         stream might go where.
6730
6731         * unlocked-io.h: Include <stdio.h>, so that the caller
6732         doesn't have to include <stdio.h> before us.
6733         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6734         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6735         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6736         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6737         if not declared, so that we can use getpass.c code from libc without
6738         rewriting it.
6739         (flockfile, ftrylockfile, funlockfile): New macros.
6740
6741 2003-10-06  Bruno Haible  <bruno@clisp.org>
6742
6743         * version-etc-2.h: Remove file.
6744         * version-etc-2.c: Remove file.
6745
6746 2003-09-25  Jim Meyering  <jim@meyering.net>
6747             Bruno Haible  <bruno@clisp.org>
6748
6749         This lets translators provide better translations for the
6750         "Written by ..." part of --version output.
6751         * version-etc.h: Include stdarg.h.
6752         (version_etc_copyright): Declare as readonly.
6753         (version_etc): Make this function variadic with a NULL-terminated list
6754         of author name strings.
6755         (version_etc_va): New declaration.
6756         * version-etc.c: Include stdarg.h, stdlib.h.
6757         (version_etc_copyright): Declare as readonly.
6758         (version_etc_va): New function. Provide a different translatable string
6759         for each possible number of authors < 10. Abbreviate when there are 10
6760         authors or more.
6761         (version_etc): Make this function variadic. Call version_etc_va.
6762         Suggestion from Gary V. Vaughan.
6763
6764         * long-options.h (parse_long_options): Change prototype: the authors
6765         string is moved to the end and becomes variadic.
6766         * long-options.c: Include stdarg.h.
6767         (parse_long_options): Make this function variadic, too.
6768         Call version_etc_va, not version_etc.
6769
6770 2003-10-06  Bruno Haible  <bruno@clisp.org>
6771
6772         * fatal-signal.h: New file, from GNU gettext.
6773         * fatal-signal.c: New file, from GNU gettext.
6774
6775 2003-10-04  Karl Berry  <karl@gnu.org>
6776
6777         * argp*: update from libc.
6778
6779 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6780
6781         * getpass.c (getpass): Use a no-op fseek when switching from input to
6782         output mode on the same stream.
6783
6784 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6785
6786         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6787         Fix arg typo in previous patch.
6788
6789 2003-09-28  Jim Meyering  <jim@meyering.net>
6790
6791         * error.c: Correct cpp indentation.
6792
6793 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6794
6795         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6796         Omit the special code that used __typeof__, since we worry that
6797         it could be more trouble than it's worth.  See:
6798         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6799         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6800
6801         * free.c: New file.
6802
6803 2003-09-26  Jim Meyering  <jim@meyering.net>
6804
6805         * error.c (error_tail): Move some declarations
6806         into inner scope where the local variables are used.
6807
6808 2003-09-26  Bruno Haible  <bruno@clisp.org>
6809
6810         * stpncpy.h (gnu_stpncpy): New declaration.
6811         (stpncpy): Define as alias for gnu_stpncpy.
6812         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6813
6814 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6815
6816         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6817         (error_tail): Do not loop, reallocating temporary buffer, since
6818         the output cannot contain more wide characters than the input
6819         contains bytes, the size must be big enough already.  This avoids
6820         one potential size overflow calculation.  Check for size overflow
6821         when calculating temporary buffer size.  Free temporary buffer
6822         when done, if it was allocated with malloc; this plugs a memory
6823         leak.  Remove casts from void * to pointers, that are no longer
6824         needed now that we're assuming C89 or better.
6825
6826         Merge error changes from glibc.
6827
6828         * error.c, error.h: Update copyright notice header to match glibc.
6829         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6830         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6831         Disable cancellation while printing error.
6832         * error.h: Prepend __ to parameter names.
6833
6834 2003-09-25  Karl Berry  <karl@gnu.org>
6835
6836         * argp-fmtstream.c, argp-help.c: update from libc.
6837
6838 2003-09-25  Bruno Haible  <bruno@clisp.org>
6839
6840         * version-etc-2.h: New file, from version-etc.h with modifications.
6841         * version-etc-2.c: New file, from version-etc.c with modifications.
6842
6843 2003-09-25  Simon Josefsson  <jas@extundo.com>
6844
6845         * xgetdomainname.h: New file.
6846         * xgetdomainname.c: New file.
6847
6848 2003-09-25  Simon Josefsson  <jas@extundo.com>
6849             Bruno Haible  <bruno@clisp.org>
6850
6851         * getdomainname.h: New file.
6852         * getdomainname.c: New file.
6853
6854 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6855
6856         * linebuffer.c (freebuffer): Don't free the argument, just
6857         the buffer associated with the argument.  Bug reported by
6858         Simon Josefsson.
6859
6860 2003-09-19  Karl Berry  <karl@gnu.org>
6861
6862         * argp.h: update from libc.
6863
6864 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6865
6866         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6867         input error, instead of returning NULL the next time we are called
6868         (and therefore losing track of errno).
6869
6870 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6871
6872         * getndelim2.c (getndelim2): Don't trash errno when a read
6873         fails, so that the caller gets the proper errno.
6874
6875         * readutmp.c (read_utmp): Likewise.
6876         Check for fstat error.  Close stream and free storage
6877         when failing.
6878
6879 2003-09-14  Bruno Haible  <bruno@clisp.org>
6880
6881         * fwriteerror.h: New file.
6882         * fwriteerror.c: New file.
6883
6884 2003-09-14  Jim Meyering  <jim@meyering.net>
6885
6886         * getloadavg.c: Correct cpp indentation.
6887         * strdup.c: Likewise.
6888         * vasnprintf.c: Likewise.
6889
6890 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6891
6892         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6893         * obstack.c [!defined _LIBC]: Likewise.
6894         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6895         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6896         * exitfail.c: Don't include stdlib.h; no longer needed.
6897
6898         More changes to assume C89 or better.
6899
6900         * error.c (error_tail): Assume vprintf.
6901
6902         * argmatch.c (getenv): Remove decl.
6903         * progreloc.c (get_full_program_name): Define via prototype.
6904         * setenv.c (clearenv): Likewise.
6905         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6906         needed.
6907         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6908         (malloc, memcpy): Remove decls.
6909         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6910         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6911         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6912         (memcpy): Remove macro.
6913         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6914         (__P): Remove.  All uses removed.
6915         (PTR): Remove.  All uses changed to void *.
6916         (CHAR_BIT, NULL): Remove.
6917         (spaces, zeros, memset_space, memset_zero)
6918         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6919         Remove.
6920         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6921         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6922         Define with prototype.
6923         Remove now-unnecessary prototype decl.
6924         (extra_args_spec): Assume ANSI C.  All uses changed.
6925         (extra_args_spec_iso): Remove.
6926         (my_strftime, emacs_strftimeu): Define via prototype.
6927         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6928         unconditionally.
6929         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6930         * strtoimax.c: Include <stdlib.h> unconditionally.
6931         (strtoul, strtol): Remove decls.
6932         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6933         LONG_MAX): Remove.
6934         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6935         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6936         (LOCALE_PARAM_PROTO): New macro.
6937         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6938         (INTERNAL (strtol), strtol): Define with a prototype.
6939         (PARAMS): Remove.  All uses removed.
6940         * tempname.c: Include <string.h> unconditionally.
6941         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6942         * xgethostname.c (main): Define with a prototype.
6943         * xmalloc.c: Include "xalloc.h" first, to check interface.
6944         Include <stdlib.h> unconditionally.
6945         (calloc, malloc, realloc, free): Remove decls.
6946         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6947         Include <stdlib.h> unconditionally.  Sort include file names.
6948         (strtod): Remove.
6949         (xstrtod): Define with a prototype.
6950         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6951         (strtol, strtoul): Remove decls.
6952
6953 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6954
6955         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6956         Include <stdlib.h>, <string.h> unconditionally.
6957         Remove now-unnecessary cast to char *.
6958         * strnlen.c: Include <string.h> unconditionally.
6959         * yesno.c (yesno): Define with a prototype.
6960
6961 2003-09-10  Bruno Haible  <bruno@clisp.org>
6962
6963         * strcspn.c: Include <string.h> unconditionally.
6964         * strpbrk.c: Include <string.h> unconditionally.
6965         * strstr.c: Include <string.h> unconditionally.
6966         * unicodeio.c: Include <string.h> unconditionally.
6967         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6968         * unsetenv.c: Likewise.
6969         * xreadlink.c: Include <stdlib.h> unconditionally.
6970         * yesno.c: Include <stdlib.h> unconditionally.
6971         (rpmatch): Add prototype.
6972
6973 2003-09-10  Jim Meyering  <jim@meyering.net>
6974
6975         * error.c: Correct indentation of cpp directives.
6976
6977 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6978
6979         More K&R removal.
6980
6981         * acosl.c (main): Use a prototype.
6982         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6983         tanl.c: Likewise.
6984
6985         * getloadavg.c (getloadavg, main): Define via prototypes.
6986
6987         * getopt.h (struct option.name): Assume C89, and use 'const'.
6988         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6989         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6990         with a prototype.
6991         * getopt.c (const): Remove macro.
6992         Include <string.h> unconditionally.
6993         (my_index): Remove; all uses changed to strchr.
6994         (strlen): Remove decl.
6995         (exchange): Remove forward decl; no longer needed.
6996         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6997         Define with prototype.
6998         * getopt1.c (const): Remove macro.
6999         (getopt_long, getopt_long_only, main): Define with prototype.
7000
7001         * getugroups.c: Include <string.h> unconditionally.
7002
7003         * getusershell.c: Include <stdlib.h> unconditionally.
7004         (getusershell, setusershell, endusershell, readname, main):
7005         Define with prototypes.
7006
7007         * group-member.c: Include group-member.h first.
7008         Include <stdlib.h> unconditionally.
7009
7010         * hard-locale.c: Include hard-locale.h first.
7011         Include <stdlib.h>, <string.h> unconditionally.
7012
7013         * hash.c (free, malloc): Remove decls.
7014         Include <stdlib.h> unconditionally.
7015
7016         * human.c: Include <stdlib.h>, <string.h> unconditionally.
7017         (getenv): Do not declare.
7018
7019         * idcache.c: Include <string.h> unconditionally.
7020
7021         * long-options.c: Include long-options.h first, to test interface.
7022         Include <stdlib.h> unconditionally.
7023
7024         * makepath.c: Include makepath.h first, to test interface.
7025         Include <stdlib.h> and <string.h> unconditionally.
7026
7027         * linebuffer.c: Include <stdlib.h>.
7028         (free): Remove decl.
7029
7030         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7031         rpl_malloc returns void *, not char *.
7032         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
7033
7034         * md5.h: Include <limits.h> unconditionally.
7035         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7036         (__P): Remove; all uses removed.
7037         * md5.c: Include "md5.h" first.
7038         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7039         md5_buffer, md5_process_bytes, md5_process_block):
7040         Define with prototypes.
7041         * sha.h (__P): Remove all uses.  (It wasn't defined??)
7042         * sha.c: Include "sha.h" first.
7043         Include <stdlib.h>, <string.h> unconditionally.
7044
7045         * memchr.c (__ptr_t): Remove; all uses changed to void *.
7046         * memcmp.c (__ptr_t): Likewise.
7047         * memrchr.c (__ptr_t): Likewise.
7048         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7049         Include <string.h> unconditionally.
7050         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7051         * memchr.c: Include <stdlib.h> unconditionally.
7052         * memchr.c (LONG_MAX): Remove.
7053         * memrchr.c (LONG_MAX): Likewise.
7054         * memchr.c (__memchr): Define via a prototype.
7055         * memrchr.c (__memrchr): Likewise.
7056         * memcmp.c (__P): Remove, and remove all uses.
7057         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7058         Remove forward decls; no longer needed.
7059         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7060         Use types required by C89 in prototype.
7061
7062         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7063         * savedir.c: Likewise.
7064         * mkdir.c (free): Remove decl.
7065         * rmdir.c (rmdir): Define with a prototype.
7066         * savedir.c: Include savedir.h first, to test interface.
7067
7068         * mktime.c (STDC_HEADERS): Remove.
7069         Include <stdlib.h>, <string.h> unconditionally.
7070
7071         * modechange.c: Include <stdlib.h> unconditionally.
7072         (malloc): Remove decl.
7073
7074         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7075         (free): Remove decl.
7076
7077         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7078         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7079         (This type really should be intptr_t, but that's a C99ism.)
7080         (_obstack_memcpy): Remove: all uses changed to memcpy.
7081         Include <string.h> unconditionally.
7082         (struct obstack): Assume __STDC__ for types of members
7083         chunkfun, freefun, extra_arg.
7084         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7085         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7086         obstack_begin, obstack_specify_allocation,
7087         obstack_specify_allocation_with_arg, obstack_chunkfun,
7088         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7089         Remove unprototyped decls and the macros that use them.
7090         * obstack.c (POINTER): Remove.  All uses changed to void *.
7091         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7092         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7093         (defined __STDC__ && __STDC__)]:
7094         Remove nonprototyped code.
7095         Include <stdlib.h> unconditionally.
7096         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7097         _obstack_allocated_p, _obstack_free, obstack_free,
7098         _obstack_memory_used, print_and_abort):
7099         Define using prototypes.
7100         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7101         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7102         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7103         obstack_next_free, obstack_object_size, obstack_room) [0]:
7104         Remove unused, unprototyped code.
7105
7106         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7107
7108         * physmem.c (physmem_total, physmem_available, main): Define
7109         with prototypes.
7110
7111         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7112         (main): Define with a prototype.
7113
7114         * posixver.c (getenv): Remove decl.
7115
7116         * putenv.c (malloc): Returns void *, not char *.
7117         Include <string.h> unconditionally.
7118         (strchr, memcpy, NULL): Do not define.
7119
7120         * readtokens.c: Include readtokens.h first, to test interface.
7121         Include <stdlib.h>, <string.h> unconditionally.
7122         (init_tokenbuffer): Define with a prototype.
7123
7124         * regex.c (PARAMS): Remove.  All uses removed.
7125         All uses of _RE_ARGS removed, too.
7126         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7127         unconditionally.
7128         (bzero): Assume memset exists.
7129         (memcmp, memcpy, NULL): Remove.
7130         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7131         char, or assignments to local vars of type signed char.
7132         (init_syntax_once, PREFIX(extract_number_and_incr),
7133         PREFIX(print_partial_compiled_pattern),
7134         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7135         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7136         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7137         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7138         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7139         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7140         wcs_compile_range, byte_compile_range, truncate_wchar,
7141         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7142         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7143         count_mbs_length, wcs_re_match_2_internal,
7144         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7145         PREFIX(alt_match_null_string_p),
7146         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7147         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7148         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7149         now-unnecessary declaration, if any.
7150         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7151         regcomp, regexec):
7152         Remove now-unnecessary casts among pointer types.
7153         * regex.h (_RE_ARGS): Remove.  All uses removed.
7154
7155         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7156         (free): Remove decl.
7157
7158         * rpmatch.c: Include <stdlib.h> unconditionally.
7159
7160         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7161         (free): Remove decl.
7162
7163         * save-cwd.c: Include <stdlib.h> unconditionally.
7164         * xgetcwd.c: Likewise.
7165
7166         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7167         (free): Remove decl.
7168
7169         * strchrnul.c (strchrnul): Define with a prototype.
7170         Fix bug: c_in was not converted to char before searching.
7171
7172         The following changes are not K&R related:
7173
7174         * group-member.h: Include <sys/types.h>, so that this file is
7175         self-contained.
7176         * makepath.h: Likewise.
7177
7178         * getusershell.c (readname, default_index, line_size, readname):
7179         Use size_t, not int, for sizes.
7180         (readname): If the size overflows, report an error instead of
7181         looping forever.
7182
7183 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7184
7185         * getndelim2.c: Assume stdlib.h per the C89 spec.
7186
7187 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7188
7189         Assume C89 or better; remove K&R cruft.
7190         A few of these changes were first proposed by Derek Robert Price
7191         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7192
7193         * addext.c: Include <string.h> unconditionally.
7194         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7195         Don't declare getenv or malloc.
7196
7197         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7198         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7199         (NULL): Remove.
7200         (find_stack_direction, alloca): Use prototypes.
7201
7202         * atexit.c (atexit): Define using a prototype.
7203
7204         * basename.c, dirname.c, stripslash.c:
7205         Include <string.h> unconditionally.
7206
7207         * bcopy.c: Include <stddef.h>.
7208         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7209
7210         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7211
7212         * error.h (error, error_at_line, error_print_progname)
7213         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7214         * error.c: Include error.h first, to check interface.
7215         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7216         (VA_START): Remove; all uses changeed to va_start.
7217         (exit, strerror): Remove decls.
7218         (error_print_progname): Prototype uncondionally.
7219         Don't include <errno.h>; no longer needed.
7220         (private_strerror): Remove.
7221         (error_tail): Always define.
7222         (error, error_at_line): Assume C89 or better; always use prototypes.
7223         * fatal.c: Include "fatal.h" first, to test interface.
7224         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7225         (VA_START): Remove; all uses changed to va_start.
7226         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7227         this case.
7228         (exit): Remove decl.
7229         (fatal): Prototype unconditionally.  Assume va_start works.
7230         Abort at end, to pacify gcc.
7231
7232         * euidaccess.c (main): Define with a prototype.
7233
7234         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7235
7236         * exitfail.c: Include <stdlib.h> unconditionally.
7237
7238         * fnmatch_.h (__P): Remove.  All uses changed to assume
7239         prototypes.
7240         * fnmatch.c: Include fnmatch.h first, to test interface.
7241         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7242         (getenv): Remove decl.
7243         (fnmatch): Define using a prototype.
7244         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7245         (FCT): Define using a prototype.
7246
7247         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7248
7249         * gethostname.c: Include <stddef.h>.
7250         (gethostname): Define with prototype.  Length is size_t, not int.
7251
7252 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7253
7254         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7255         getversion.c should have been removed then, but was accidentally
7256         preserved.
7257
7258         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7259         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7260
7261 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7262
7263         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7264         copy_tm_result.  Bug reported by Simon Josefsson in
7265         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7266
7267 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7268
7269         * time_r.c, time_r.h: New files.
7270
7271         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7272         __localtime_r.
7273         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7274         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7275
7276         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7277         __gmtime_r.
7278         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7279         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7280         Include <time_r.h>.
7281
7282         * timegm.c: Switch to glibc implementation, with the following changes:
7283         [defined HAVE_CONFIG_H]: Include <config.h>.
7284         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7285         (__mktime_internal) [!defined _LIBC]: New decl.
7286         (__gmtime_r) [!defined _LIBC]: New macro and function.
7287         (timegm): Use a prototype, since gnulib assumes C89.
7288         Do not bother declaring tmp to be const, as it's not really usefu.
7289         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7290         (timegm): Declare only if HAVE_DECL_TIMEGM.
7291
7292 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7293
7294         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7295         Bug reported by Lute Kamstra in
7296         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7297
7298         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7299         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7300         course with correspondingly smaller numbers for tomorrow and
7301         yesterday.  From Tadayoshi Funaba.  Originally installed into
7302         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7303         coreutils merge?).
7304
7305 2003-08-31  Simon Josefsson  <jas@extundo.com>
7306
7307         * timegm.h: New file.
7308         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7309
7310 2003-08-31  Karl Berry  <karl@gnu.org>
7311
7312         * argp.h: update from libc.
7313
7314 2003-08-28  Bruno Haible  <bruno@clisp.org>
7315
7316         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7317         warning on QNX, which defines O_BINARY to 000000.
7318
7319 2003-08-24  Bruno Haible  <bruno@clisp.org>
7320
7321         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7322         MSVC7 <stdio.h> is included later.
7323
7324 2003-08-20  Bruno Haible  <bruno@clisp.org>
7325
7326         * progname.h: New file, from GNU gettext.
7327         * progname.c: New file, from GNU gettext.
7328         * progreloc.c: New file, from GNU gettext.
7329
7330 2003-08-19  Bruno Haible  <bruno@clisp.org>
7331
7332         * xstrdup.c: Assume <string.h> exists.
7333
7334 2003-08-18  Jim Meyering  <jim@meyering.net>
7335
7336         * setenv.h: Indent nested cpp directive.
7337         * vasnprintf.c: Remove trailing blanks.
7338
7339 2003-08-17  Simon Josefsson  <jas@extundo.com>
7340             Bruno Haible  <bruno@clisp.org>
7341
7342         * xstrndup.h: New file.
7343         * xstrndup.c: New file.
7344
7345 2003-08-17  Bruno Haible  <bruno@clisp.org>
7346
7347         * strndup.h: New file.
7348
7349 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7350
7351         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7352         space, undoing this 2003-08-12 change:
7353         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7354
7355 2003-08-16  Jim Meyering  <jim@meyering.net>
7356
7357         Merge from coreutils.
7358         * xstrtoimax.c: #else #if -> #elif.
7359         * xstrtoumax.c: Likewise.
7360
7361 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7362
7363         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7364         rather than tab, after '#' in shell-script copyright notices.
7365         Suggested by Bruno Haible.
7366
7367 2003-08-15  Jim Meyering  <jim@meyering.net>
7368         and Paul Eggert  <eggert@twinsun.com>
7369
7370         Merge from coreutils.
7371         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7372         member but strut utmpx does not.  Needed for AIX 4.3.3.
7373         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7374
7375 2003-08-15  Jim Meyering  <jim@meyering.net>
7376
7377         Merge from coreutils.
7378         * xgethostname.c: Include <stdlib.h>.
7379         (xghostname): Don't exit for anything other than memory-related
7380         failure; just return NULL.
7381         * userspec.c: Include "posixver.h".
7382         (parse_user_spec): Accept `.' as a separator only
7383         in pre-POSIX-200112 mode.
7384         * strtoimax.c: Use #elif rather than #else #if.
7385         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7386         Remove function, now that we can rely on a working tzset function.
7387         [!_LIBC]: Ensure that the required autoconf test has been run.
7388         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7389         Use underlying_strftime for %r.
7390         * sha.c: Merge in some clean-up and optimization changes from glibc.
7391         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7392         Ensure that it is a multiple of 64.
7393         Rearrange loop exit tests so as to avoid performing an
7394         additional fread after encountering an error or EOF.
7395         * realloc.c: Update copyright date.
7396
7397 2003-08-14  Jim Meyering  <jim@meyering.net>
7398
7399         Merge from coreutils.
7400         * obstack.h: Whitespace changes.
7401         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7402         and xcalloc return values.
7403         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7404         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7405         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7406         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7407         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7408         error from mntctl.
7409         Use mntctl's return value to drive the entry-processing loop, since
7410         we can't rely on the value of the vmt_length member in the last
7411         entry.  On some systems doing so could result in exhausting
7412         virtual memory.  Based in part on a patch from Mike Jetzer.
7413
7414 2003-08-14  Jim Meyering  <jim@meyering.net>
7415         and Paul Eggert  <eggert@twinsun.com>
7416
7417         Merges from coreutils, plus other fixes.
7418         * physmem.c: Merge in portability changes from gcc/libiberty
7419         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7420         for credits and details.  Thanks to Kaveh Ghazi for helping
7421         to keep these files in sync.
7422         (ARRAY_SIZE): Define it.
7423         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7424         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7425         (memcasecmp): Don't assume size_t fits in unsigned int.
7426         Remove casts and duplicate code.
7427         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7428         (memcpy): Remove definition.
7429         Merge in some clean-up and optimization changes from glibc.
7430         [BLOCKSIZE]: Move definition to top of file.
7431         Ensure that it is a multiple of 64.
7432         Rearrange loop exit tests so as to avoid performing an
7433         additional fread after encountering an error or EOF.
7434         * md5.h (md5_uintptr): Define.
7435         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7436         return to the initial working directory.  Preserve errno
7437         for caller.
7438         * idcache.c: Include "xalloc.h".
7439         (xmalloc, xrealloc): Remove decls.
7440         (getuser): Remove casts no longer required in C89.
7441         * human.c: Include stdio.h, for sprintf.
7442         * group-member.c: Include "xalloc.h".
7443         (xmalloc, xrealloc): Remove decls.
7444         (get_group_info): Remove casts no longer required in C89.
7445         * getusershell.c (readname): Remove casts no longer required in C89.
7446         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7447         * getline.c: Whitespace fix, from coreutils.
7448
7449 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7450
7451         * exclude.c: Include <ctype.h>
7452         (IN_CTYPE_DOMAIN): New macro.
7453         (is_space): New fn.
7454         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7455         and empty lines.
7456
7457         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7458         Undo previous (whitespace-only) change.
7459
7460 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7461
7462         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7463         Normalize leading white space and remove trailing white space.
7464         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7465         notice, as per ../config/srclist-update.
7466
7467         Merge from coreutils.
7468         * euidaccess.h: New file.
7469         * euidaccess.c: Include it.
7470         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7471         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7472         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7473
7474 2003-08-11  Bruno Haible  <bruno@clisp.org>
7475
7476         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7477         (vasnprintf): Use it instead of wcslen.
7478
7479 2003-08-11  Bruno Haible  <bruno@clisp.org>
7480
7481         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7482         value to ensure that _Bool promotes to int. Use #define for _Bool when
7483         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7484
7485 2003-08-10  Karl Berry  <karl@gnu.org>
7486
7487         * regex.h: update from libc (whitespace fix).
7488
7489 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7490
7491         Merge some files from coreutils.  These changes were
7492         originally made by Jim Meyering.
7493         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7494         many older Unixes require this.
7495         * alloca.c (alloca): Remove cast to argument of free;
7496         no longer needed in C89.
7497         * alloca_.h, regex.h: Fix white space to match
7498         what GNU indent does.
7499
7500 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7501
7502         * bumpalloc.h: Remove.
7503
7504 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7505
7506         * getloadavg.c: Change copyright notice and spacing to conform to
7507         GNU coding style.
7508
7509         Merge from coreutils.
7510         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7511         From glibc.
7512         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7513         from Karl Berry, implemented by Jim Meyering.
7514         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7515         from Dmitry V. Levin.
7516         Remove anachronistic cast of xrealloc.
7517         * fnmatch_.h (__const): Remove.  Use 'const'.
7518         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7519         type. Otherwise, it wouldn't compile with at least /bin/cc on
7520         ymp-cray-unicos9.0.2.X.
7521         Combine two mostly-identical uses of alloca into one.
7522         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7523
7524 2003-08-04  Dave Love <d.love@dl.ac.uk>
7525
7526         [From Emacs.]
7527
7528         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7529         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7530         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7531         obsolete NLIST_NAME_UNION.
7532         [__GNU__]: Undef BSD and FSCALE.
7533         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7534
7535 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7536
7537         * stdbool_.h (_Bool): Make it signed char, instead of
7538         an enum type, so that it's guaranteed to promote to int.  See:
7539         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7540
7541 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7542
7543         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7544         (strerror): Don't assume that a printable int fits in 14 bytes.
7545
7546 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7547             Bruno Haible  <bruno@clisp.org>
7548
7549         * getline.h (getline, getdelim): Change return type to ssize_t.
7550         * getline.c (getline, getdelim): Likewise.
7551         Remove _GNU_SOURCE define; now it's defined in config.h through
7552         m4/getline.m4.
7553
7554 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7555
7556         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7557         over-parenthesization in macros.
7558
7559         Sync with coreutils.
7560
7561         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7562         required by C99.
7563
7564         Use `exit_failure' for xalloc and xmemcoll instead of their own
7565         private exit-failure variables.
7566         * xalloc.h (xalloc_exit_failure): Remove.
7567         * xmalloc.c: Likewise.  Include exitfail.h.
7568         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7569         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7570         * xmemcoll.c: Likewise.  Include exitfail.h.
7571         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7572
7573 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7574
7575         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7576         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7577         to test that it can stand by itself.  Include "exitfail.h".
7578         Clients should set exit_failure instead.
7579         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7580
7581 2003-07-18  Andreas Schwab  <schwab@suse.de>
7582
7583         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7584
7585 2003-07-18  Bruno Haible  <bruno@clisp.org>
7586
7587         * getndelim2.h: New file.
7588         * getndelim2.c: Make into a module of its own. Include config.h,
7589         getndelim2.h.
7590         (getndelim2): Make non-static. Change return type to ssize_t.
7591         * getline.h: Change argument names.
7592         * getline.c: Include getndelim2.h instead of getndelim2.c.
7593         * getnline.c: Include getndelim2.h.
7594
7595 2003-07-17  Bruno Haible  <bruno@clisp.org>
7596
7597         * Makefile.am: Remove file.
7598         * Makefile.in: Remove file.
7599
7600 2003-07-17  Bruno Haible  <bruno@clisp.org>
7601
7602         * getnline.h: New file.
7603         * getnline.c: New file.
7604         * getndelim2.c: New file, extracted from getline.c.
7605         (getndelim2): Renamed from getdelim2, with added nmax argument.
7606         * getline.c: Include getndelim2.c.
7607         (getdelim2): Moved out to getndelim2.c.
7608         (getline, getdelim): Update.
7609
7610 2003-07-15    <karl@gnu.org>
7611
7612         * vasnprintf.c: update from gettext.
7613
7614 2003-07-15  Jim Meyering  <jim@meyering.net>
7615
7616         * makepath.c (make_path): Enclose diagnostic in _(...).
7617
7618 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7619
7620         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7621         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7622         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7623         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7624         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7625         updated automatically by ../config/srclist-update.  This changes
7626         their license from LPGL to GPL.
7627
7628 2003-07-14  Jim Meyering  <jim@meyering.net>
7629
7630         Don't emit diagnostics.  Let callers do that.
7631         * save-cwd.c: Don't include "error.h".
7632         (save_cwd): Don't call error.  Ensure that errno is valid
7633         when returning nonzero.
7634
7635         * save-cwd.h (restore_cwd): Update prototype.
7636         * save-cwd.c (restore_cwd): Remove two parameters.
7637         Simplify.  Don't call error upon failure.  Let callers do that.
7638         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7639         when auditing is enabled.  But don't bother updating the #if.
7640
7641 2003-07-14  Simon Josefsson  <jas@extundo.com>
7642
7643         * mempcpy.h: New file.
7644         * mempcpy.c: New file.
7645
7646 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7647
7648         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7649         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7650         unicodeio.c, unicodeio.h, unlocked-io.h:
7651         Switch from LGPL to GPL.
7652
7653 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7654
7655         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7656         it breaks C++ compilation.
7657         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7658
7659 2003-07-10  Jim Meyering  <jim@meyering.net>
7660
7661         * vasnprintf.c: Remove trailing blanks.
7662         Make cpp indentation consistent.
7663
7664 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7665
7666         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7667         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7668         Switch from LGPL to GPL.
7669
7670 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7671
7672         * mktime.c: Fix some boundary cases and remove need for floating point.
7673
7674         Issue a compile-time diagnostic if time_t is floating point, or if
7675         two's complement arithmetic is not in effect, or if arithmetic
7676         right shift does not propagate the sign.  These assumptions were
7677         all in the original code but they weren't checked.
7678
7679         (TIME_T_MIDPOINT, verify): New macros.
7680         (__isleap): Remove; it has integer overflow problems.
7681         (leapyear): New function, without those problems.
7682         (ydhms_tm_diff): Remove; splitting into two parts.
7683         (ydhms_diff): New function, containing the arithmetic part of
7684         the old ydhms_tm_diff function.  Issue a compile-time
7685         diagnostic if we are not using C99 integer division.
7686         Avoid casts when possible.
7687         (guess_time_tm): New function, containing the checking part of
7688         the old ydhms_tm_diff function.  Return the new value, rather than
7689         the difference between it and the old.  Accept a new argument T
7690         so that *T specifies the old value.  Check for overflow in the result.
7691
7692         (__mktime_internal): Use a time_t offset, not a long int offset.
7693         This undoes the 2003-06-04 change, which is no longer needed now
7694         that we have better overflow checking.
7695         (localtime_offset): Likewise.
7696
7697         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7698         and long are 64-bit but int is only 32-bit.
7699         (ydhms_diff): Use long int to store year1 and yday1.
7700         Issue a compile-time diagnostic if long int is not wide enough.
7701
7702         (__mktime_internal): Use long int to store adjusted year and yday.
7703         Use plain C rather than preprocessor commands, if that doesn't
7704         affect efficiency.
7705         Check for overflow (and try to repair) after each probe
7706         rather than checking only at the very end.  This avoids some bugs
7707         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7708         does not equal GMT offset at maximum time).
7709         Use integer to check for overflow rather than floating point; this
7710         is more portable to non-IEEE hosts, and is a tad faster.
7711         When we detect that we are oscillating between two values,
7712         don't check whether tm_isdst has the requested value, since
7713         we already know the answer.  When tm_isdst has the wrong value,
7714         use a different heuristic to find the right one, based on the
7715         extreme values actually observed in practice in tz2003a,
7716         rather than the (overly optimistic) "previous 3 calendar quarters".
7717
7718         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7719         "T const" to accommodate glibc style.
7720         (check_result): Use less-confusing report format.  "long" -> "long int.
7721         (main): Likewise.
7722         Don't loop if the iteration overflows time_t.
7723         Allow a negative step in the iteration.
7724
7725 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7726
7727         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7728         having it depend on HAVE_SYS_TYPES_H.
7729
7730 2003-06-25  Bruno Haible  <bruno@clisp.org>
7731
7732         * readlink.c: New file.
7733
7734 2003-06-20  Bruno Haible  <bruno@clisp.org>
7735
7736         Assume C89, so PARAMS isn't needed.
7737         * unicodeio.h (PARAMS): Remove.
7738         * unicodeio.c: Don't use PARAMS.
7739
7740 2003-06-18  Jim Meyering  <jim@meyering.net>
7741
7742         Merge changes from coreutils.
7743         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7744         Remove explicit declarations of xmalloc and realloc.
7745         Include xalloc.h.
7746         (read_utmp): Remove anachronistic cast of xmalloc.
7747
7748 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7749
7750         Assume C89, so PARAMS isn't needed.
7751         * backupfile.h (PARAMS): Remove.  All uses removed.
7752         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7753         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7754         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7755         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7756         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7757         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7758         xstrtol.h: Likewise.
7759         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7760         same.h, strverscmp.h: Do not include config.h; no longer needed.
7761         Anyway, config.h should always be included before any other file.
7762
7763 2003-06-11  Simon Josefsson  <jas@extundo.com>
7764
7765         * sysexit_.h: New file.
7766
7767 2003-05-20  Derek Price  <derek@ximbiot.com>
7768
7769         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7770
7771 2003-06-10  Simon Josefsson  <jas@extundo.com>
7772
7773         * strchrnul.h: New file.
7774         * strchrnul.c: New file.
7775
7776 2003-06-10  Simon Josefsson <jas@extundo.com>
7777
7778         * argp.h: New file, from glibc.
7779         * argp-ba.c: New file, from glibc.
7780         * argp-eexst.c: New file, from glibc.
7781         * argp-fmtstream.c: New file, from glibc.
7782         * argp-fmtstream.h: New file, from glibc.
7783         * argp-fs-xinl.c: New file, from glibc.
7784         * argp-help.c: New file, from glibc.
7785         * argp-namefrob.h: New file, from glibc.
7786         * argp-parse.c: New file, from glibc.
7787         * argp-pv.c: New file, from glibc.
7788         * argp-pvh.c: New file, from glibc.
7789         * argp-xinl.c: New file, from glibc.
7790
7791 2003-06-07  Jim Meyering  <jim@meyering.net>
7792
7793         * readtokens.h: Put `Free Software Foundation, Inc.'
7794         in place of my name in the copyright comment.
7795         Remove definition and uses of __P.
7796
7797         From coreutils.
7798         * stat.c: Don't declare xmalloc explicitly.
7799         Instead, include "xalloc.h".
7800         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7801         xrealloc, and xcalloc return values.
7802         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7803         Improve comment.
7804         * xgetcwd.h: Remove definition/uses of PARAMS.
7805
7806 2003-06-06  Jim Meyering  <jim@meyering.net>
7807
7808         * stdbool_.h: Renamed from stdbool.h.in.
7809
7810 2003-06-06  Jim Meyering  <jim@meyering.net>
7811
7812         Merge from coreutils.
7813         * same.c: (same_name): Declare *_basename locals to be `const'.
7814         Consolidate declarations and initializations of *_base* locals.
7815
7816         Merge from coreutils.
7817         This avoids a core dump on systems without GNU putenv,
7818         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7819         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7820         (unsetenv): New static function, from GNU libc.
7821         (rpl_putenv): Use it.
7822
7823         * modechange.c: Remove trailing blanks.
7824
7825         Merge from coreutils.
7826         * fsusage.c: Remove declaration of statfs.
7827         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7828
7829         * posixtm.c: Include <stdbool.h> unconditionally.
7830
7831 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7832
7833         * mktime.c (__mktime_internal): When resolving a tm_isdst
7834         mismatch, look in future quarters as well as past.  This fixes a
7835         bug when processing fall-backwards gaps immediately after a long
7836         period of daylight-saving time.
7837
7838         * mktime.c: Assume freestanding C89 or better.
7839         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7840         (__P): Remove; not used.
7841         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7842         (mktime, not_equal_tm, print_tm, check_result,
7843         main): Use prototypes.  Use const * where appropriate.
7844         (main): Fix typo in testing code that uncovered by above changes.
7845         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7846
7847 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7848
7849         * mktime.c: Fix Debian bug 177940
7850         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7851         (localtime_offset): Now long int, not time_t, because we want it
7852         to be guaranteed to be signed.  All uses changed.
7853         (__mktime_internal): If overflow would occur when adding offset,
7854         don't add it.
7855
7856         Merge 'human' changes from coreutils.  Rewrite to support
7857         locale-specific notations like thousands separators.
7858         * human.c: Simplify authorship notice.
7859         Include human.h immediately after config.h.
7860         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7861         <limits.h>: Do not include, since human.h does.
7862         (SIZE_MAX, UINTMAX_MAX): New macros.
7863         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7864         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7865         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7866         (power_letter): Renamed from suffixes.
7867         (generate_suffix_backwards): Remove.
7868         (adjust_value): Now takes int style (because of human.h changes)
7869         and long double value (for greater precision on some platforms).
7870         (group_number): New function.
7871         (human_readable): Use it.  Use integer options, not enum.
7872         Put the options before the sizes in the arg list.
7873         Support all the new options.
7874         The old human_readable function has been removed;
7875         use inttostr.h instead.
7876         (human_readable, default_block_size, humblock):
7877         Use uintmax_t, not int, for block sizes.
7878         (human_readable_inexact, block_size_types): Remove.
7879         (block_size_opts): New constant.
7880         (human_options): Renamed from human_block_size, with new signature
7881         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7882         * human.h: Add copyright and authorship notice.
7883         Include <limits.h> and <stdbool.h> unconditionally.
7884         (PARAMS): Remove.  All uses removed.
7885         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7886         (enum human_inexact_style): Remove tag; now a nameless enum.
7887         (human_floor, human_ceiling, human_round_to_even): Now have
7888         values 2, 0, 1 rather than -1, 1, 0.
7889         (human_group_digits, human_suppress_point_zero, human_autoscale,
7890         human_base_1024, human_SI, human_B): New constants.
7891         (human_readable_inexact, human_block_size): Remove.
7892         (human_readable): Size args are now uintmax_t, not int.
7893         (human_options): New decl.
7894
7895         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7896         unnecessary now that we assume C89 or better.  This change
7897         imported from coreutils.
7898
7899         * mktime.c (__mktime_internal): Do not reject negative timestamps
7900         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7901         in the 2003-05-30 sync from glibc.
7902
7903         .h files should stand alone, but we shouldn't include <sys/types.h>
7904         if we can get away with just <stddef.h>.
7905
7906         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7907         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7908         rather than <sys/types.h>, as we merely need size_t.
7909         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7910         to get size_t.
7911         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7912         Include <stdio.h>, to get FILE.
7913         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7914         memcasecmp.h has included <stddef.h> and all we need is size_t.
7915         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7916         our interface, instead of including <sys/types.h>
7917
7918 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7919
7920         [from coreutils]
7921         Fix some minor time-related bugs with POSIX time arguments.
7922         Some valid time stamps were being rejected (notably -1, and
7923         time stamps before 1900 on 64-bit hosts).  And some invalid
7924         time stamps were being accepted, e.g. September 31.
7925
7926         * posixtm.h (posixtime): Return bool instead of time_t, so
7927         that we can return (time_t) -1 successfully.
7928         * posixtm.c: Likewise.
7929         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7930         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7931         (t): Remove static var.
7932         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7933         of static var.  All uses changed.
7934         (year): Do not reject years before 1900; they can occur with
7935         64-bit time_t.
7936         (posix_time_parse): Do not check for out-of-range components;
7937         that is now the caller's responsibility, since our checks were
7938         only approximations.
7939         (posixtime): Use mktime to check for out-of-range components,
7940         since it knows them exactly.
7941         If mktime returns (time_t) -1, check whether an error actually occurred
7942         by invoking localtime on -1.
7943         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7944         posixtime failures better.
7945         Improve the test data (in comments only).
7946
7947 2003-05-30    <karl@gnu.org>
7948
7949         * mktime.c: update from libc.
7950
7951 2003-05-30  Bruno Haible  <bruno@clisp.org>
7952
7953         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7954         * localcharset.h: Likewise.
7955         * localcharset.c: Likewise.
7956
7957 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7958
7959         Assume the headers required for C89 freestanding compilers.
7960         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7961         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7962         without checking for HAVE_LIMITS_H.
7963         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7964         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7965         to do that.
7966         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7967         * exclude.c: Include <stdbool.h> unconditionally.
7968         * tempname.c: Include <stddef.h> unconditionally.
7969         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7970         * modechange.c, rpmatch.c (NULL): Don't define, since
7971         <stddef.h> does that.
7972         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7973         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7974         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7975         * xstrtol.c: Likewise.
7976         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7977         * savedir.c: Include <stddef.h> instead of defining NULL.
7978
7979         * addext.c (addext): Use assignment rather than cast, to avoid
7980         warnings on some platforms.
7981
7982         * mktime.c (__mktime_internal): Do not reject negative timestamps
7983         arbitrarily.
7984
7985 2003-05-10  Bruno Haible  <bruno@clisp.org>
7986
7987         * linebreak.c (iconv_string_length): Don't return -1 just because the
7988         string is longer than 4 KB.
7989
7990 2003-05-12  Jim Meyering  <jim@meyering.net>
7991
7992         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7993         the space-padded-by-default conversion specifiers, %e, %k, %l.
7994
7995 2003-05-03  Bruno Haible  <bruno@clisp.org>
7996
7997         Upgrade to Unicode-4.0.
7998         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7999         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8000         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8001         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8002         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8003         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8004         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8005         Change width of U+E0100..U+E01EF from 1 to 0.
8006
8007 2003-04-25  Bruno Haible  <bruno@clisp.org>
8008
8009         * copy-file.c: Include <stddef.h>, for size_t.
8010
8011 2003-04-25  Jim Meyering  <jim@meyering.net>
8012
8013         * copy-file.c (copy_file_preserving): Declare buf_size to be
8014         of type size_t, not int.
8015
8016 2003-04-11  Jim Meyering  <jim@meyering.net>
8017
8018         Merge changes from Coreutils.
8019
8020         2003-03-22  Jim Meyering  <jim@meyering.net>
8021
8022         * strftime.c (widen): Cast alloca return value to proper type.
8023
8024         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
8025
8026         From GNU libc.
8027         * strftime.c (my_strftime): Handle very large width
8028         specifications for numeric values correctly.  Improve checks for
8029         overflow.
8030
8031         2003-01-19  Jim Meyering  <jim@meyering.net>
8032
8033         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8034         (nl_get_alt_digit) [! defined my_strftime]: Define.
8035         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8036         _nl_get_alt_digit and _nl_get_walt_digit.
8037
8038         * strftime.c (my_strftime): Merge in locale-related changes from libc.
8039         These changes have no effect outside of _LIBC.
8040
8041 2003-04-10  Bruno Haible  <bruno@clisp.org>
8042
8043         * findprog.h: New file, from GNU gettext.
8044         * findprog.c: New file, from GNU gettext.
8045
8046 2003-04-05  Jim Meyering  <jim@meyering.net>
8047
8048         Merge changes from Coreutils.
8049
8050         * exclude.h (PARAMS): Remove definition and uses.
8051         * exclude.c: Remove uses of `PARAMS'.
8052
8053         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8054         Add test-cases for DOS filenames. Declare program_name.
8055         (main): Set up program_name.  Patch by Rich Dawe.
8056
8057         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8058         error from mntctl.
8059         Use mntctl's return value to drive the entry-processing loop, since
8060         we can't rely on the value of the vmt_length member in the last
8061         entry.  On some systems doing so could result in exhausting
8062         virtual memory.  Based in part on a patch from Mike Jetzer.
8063
8064 2003-04-04  Bruno Haible  <bruno@clisp.org>
8065
8066         * linebreak.h: New file, from GNU gettext.
8067         * linebreak.c: New file, from GNU gettext with slight modifications.
8068         * lbrkprop.h: New file, from GNU gettext.
8069
8070 2003-04-03  Bruno Haible  <bruno@clisp.org>
8071
8072         * utf8-ucs4.h: New file, from GNU gettext.
8073         * utf16-ucs4.h: New file, from GNU gettext.
8074         * ucs4-utf8.h: New file, from GNU gettext.
8075         * ucs4-utf16.h: New file, from GNU gettext.
8076
8077 2003-04-02  Bruno Haible  <bruno@clisp.org>
8078
8079         * binary-io.h: New file, from GNU gettext.
8080
8081 2003-04-01  Bruno Haible  <bruno@clisp.org>
8082
8083         * pathname.h: New file, from GNU gettext.
8084         * concatpath.c: New file, from GNU gettext.
8085
8086 2003-03-30  Bruno Haible  <bruno@clisp.org>
8087
8088         * copy-file.c (copy_file_preserving): Don't set owner if the function
8089         chown() doesn't exist.
8090
8091 2003-03-28  Bruno Haible  <bruno@clisp.org>
8092
8093         * copy-file.h: New file, from GNU gettext.
8094         * copy-file.c: New file, from GNU gettext.
8095
8096 2003-03-18  Jim Meyering  <jim@meyering.net>
8097
8098         * quote.c (quote_n): Fix typo in comment.
8099
8100 2003-03-14  Jim Meyering  <jim@meyering.net>
8101
8102         Merge changes from Coreutils.
8103         * obstack.h (obstack_object_size): Declare temporary, __o,
8104         to be const, in order to avoid warnings.
8105         (obstack_room): Likewise.
8106         (obstack_empty_p): Likewise.
8107
8108 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8109
8110         Merge changes from Bison.
8111         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8112         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8113         when compiling Bison 1.875's `bitset bset = obstack_alloc
8114         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8115         * hash.c: Include <stdbool.h> unconditionally.
8116
8117 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8118
8119         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8120         Reported by Bruce Becker; see:
8121         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8122
8123 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8124             Bruno Haible  <bruno@clisp.org>
8125
8126         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8127         Reported by John Hughes, see
8128         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8129
8130 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8131
8132         * poll_.h: New file.
8133         * poll.c: New file.
8134
8135 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8136
8137         * mathl.h: New file.
8138         * acosl.c: New file.
8139         * asinl.c: New file.
8140         * atanl.c: New file.
8141         * ceill.c: New file.
8142         * cosl.c: New file.
8143         * expl.c: New file.
8144         * floorl.c: New file.
8145         * frexpl.c: New file.
8146         * ldexpl.c: New file.
8147         * logl.c: New file.
8148         * sincosl.c: New file.
8149         * sinl.c: New file.
8150         * sqrtl.c: New file.
8151         * tanl.c: New file.
8152         * trigl.c: New file.
8153         * trigl.h: New file.
8154
8155 2003-02-17  Bruno Haible  <bruno@clisp.org>
8156
8157         * mkdtemp.h: New file, from GNU gettext.
8158         * mkdtemp.c: New file, from GNU gettext.
8159
8160 2003-01-31  Bruno Haible  <bruno@clisp.org>
8161
8162         * rename.c: #undef rename before defining rpl_rename.
8163         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8164
8165 2003-01-30  Bruno Haible  <bruno@clisp.org>
8166
8167         * printf-args.h: New file, from GNU gettext.
8168         * printf-args.c: New file, from GNU gettext.
8169         * printf-parse.h: New file, from GNU gettext.
8170         * printf-parse.c: New file, from GNU gettext.
8171         * vasnprintf.h: New file, from GNU gettext.
8172         * vasnprintf.c: New file, from GNU gettext.
8173         * asnprintf.c: New file, from GNU gettext.
8174         * vasprintf.h: New file, from GNU gettext with modifications.
8175         * vasprintf.c: New file, from GNU gettext.
8176         * asprintf.c: New file, from GNU gettext.
8177
8178 2003-01-29  Bruno Haible  <bruno@clisp.org>
8179
8180         * stpncpy.h: New file, from GNU gettext with modifications.
8181         * stpncpy.c: New file, from GNU gettext with modifications.
8182
8183 2003-01-28  Bruno Haible  <bruno@clisp.org>
8184
8185         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8186         Paul Eggert.
8187         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8188         Paul Eggert.
8189
8190 2003-01-27  Bruno Haible  <bruno@clisp.org>
8191
8192         * xsetenv.h: New file, from GNU gettext.
8193         * xsetenv.c: New file, from GNU gettext.
8194
8195 2003-01-23  Bruno Haible  <bruno@clisp.org>
8196
8197         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8198
8199 2003-01-22  Bruno Haible  <bruno@clisp.org>
8200
8201         * exit.h: New file, from GNU gettext.
8202
8203 2003-01-11  Bruno Haible  <bruno@clisp.org>
8204
8205         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8206         * strcase.h (strcasecmp, strncasecmp): Likewise.
8207
8208 2003-01-14  Jim Meyering  <jim@meyering.net>
8209
8210         * same.c (same_name): Tweak a comment.
8211
8212 2003-01-11  Bruno Haible  <bruno@clisp.org>
8213
8214         * same.c (same_name): Reorder tests so as to avoid calling stat()
8215         when a string comparison is sufficient.
8216
8217 2003-01-11  Bruno Haible  <bruno@clisp.org>
8218
8219         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8220         'unsigned int'.
8221
8222 2003-01-11  Bruno Haible  <bruno@clisp.org>
8223
8224         * hash-pjw.c: Add comment about low quality of this function.
8225
8226 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8227
8228         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8229         to avoid collisions with libcurses and libreadline.
8230
8231         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8232         * getstr.h, getstr.c: Remove.
8233         * getline.c: Include "getline.h", to check interface.
8234         Move body of old getstr.c here: this defines MIN_CHUNK and
8235         declares getdelim2, which is renamed from getstr.
8236         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8237
8238         * linebuffer.c (readlinebuffer): Renamed from readline.
8239         All uses changed.
8240         * linebuffer.h: Likewise.
8241         (readline): Remove backward-compatibility macro.
8242
8243 2003-01-12  Jim Meyering  <jim@meyering.net>
8244
8245         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8246
8247 2003-01-10  Bruno Haible  <bruno@clisp.org>
8248
8249         * alloca_.h: New file.
8250         * getdate.y: Unconditionally include alloca.h.
8251         * makepath.c: Likewise.
8252         * setenv.c: Likewise.
8253         * userspec.c: Likewise.
8254
8255 2003-01-09  Bruno Haible  <bruno@clisp.org>
8256
8257         * stdbool.h.in: New file.
8258
8259 2003-01-08  Bruno Haible  <bruno@clisp.org>
8260
8261         * safe-read.c: Include specification header first, to ensure its
8262         selfcontainedness.
8263         * full-write.c: Likewise.
8264
8265 2003-01-08  Jim Meyering  <jim@meyering.net>
8266
8267         * full-write.c: Undefine and define-away `const' after inclusion
8268         of errno.h, not before.  Suggestion from Bruno Haible.
8269
8270 2003-01-07  Jim Meyering  <jim@meyering.net>
8271
8272         * full-write.c: Rework so that it may serve to define full_read, too.
8273         * full-read.c: Simply #define FULL_READ and include full-write.c.
8274
8275 2003-01-06  Jim Meyering  <jim@meyering.net>
8276
8277         * version-etc.c: Update year in translatable copyright string.
8278
8279 2002-12-25  Bruno Haible  <bruno@clisp.org>
8280
8281         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8282         * xstrtol.h: Likewise.
8283         * xstrtoimax.c: Likewise.
8284         * xstrtoumax.c: Likewise.
8285         * human.h: Likewise.
8286
8287         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8288         on systems that have <inttypes.h> but not <stdint.h>.
8289
8290 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8291
8292         * memcoll.c (memcoll): Fall back on a simple algorithm using
8293         memcmp if strcoll doesn't work.
8294
8295 2002-12-23  Bruno Haible  <bruno@clisp.org>
8296
8297         * localcharset.h: New file.
8298         * localcharset.c: Include it.
8299         * unicodeio.c: Likewise.
8300
8301 2002-12-22  Bruno Haible  <bruno@clisp.org>
8302
8303         * utime.c (utime_null): No need to call ftruncate if the file was
8304         nonempty.
8305
8306 2002-12-23  Bruno Haible  <bruno@clisp.org>
8307
8308         * memcoll.c (STRCOLL): New macro.
8309         (memcoll): Use it.
8310
8311 2002-12-22  Bruno Haible  <bruno@clisp.org>
8312
8313         * getstr.h (getstr): Define, to avoid clash with libcurses.
8314         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8315
8316 2002-12-22  Bruno Haible  <bruno@clisp.org>
8317
8318         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8319
8320 2002-12-23  Bruno Haible  <bruno@clisp.org>
8321
8322         * getline.h: Include <stddef.h>, for size_t.
8323
8324         * unicodeio.h: Include <stddef.h>, for size_t.
8325         * unicodeio.c: Don't include <stddef.h>.
8326
8327 2002-12-17  Bruno Haible  <bruno@clisp.org>
8328
8329         * canon-host.c (strdup): Remove unused declaration.
8330
8331         * fsusage.c: Include full_read.h.
8332         (get_fs_usage): Use full_read instead of safe_read.
8333
8334         * utime.c (utime_null): Use SAFE_READ_ERROR.
8335
8336 2002-12-11  Bruno Haible  <bruno@clisp.org>
8337
8338         * setenv.h: Rewritten to cope with systems that have setenv() but not
8339         unsetenv().
8340         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8341         modifications:
8342
8343         2002-12-11  Bruno Haible  <bruno@clisp.org>
8344
8345                 * setenv.c (alloca): Fall back to malloc.
8346                 (freea): New macro.
8347                 (setenv): Use freea() to free memory allocated with alloca().
8348
8349         2002-11-13  Bruno Haible  <bruno@clisp.org>
8350
8351                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8352                 function declarations.
8353                 * unsetenv.c (unsetenv): Likewise.
8354
8355         2002-03-04  Bruno Haible  <bruno@clisp.org>
8356
8357                 Portability to AIX 4.3.3.
8358                 * unsetenv.c: New file, extracted from setenv.c.
8359                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8360
8361         2001-12-20  Bruno Haible  <bruno@clisp.org>
8362
8363                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8364                 use malloc instead. For SunOS 4.
8365
8366         2001-12-11  Bruno Haible  <bruno@clisp.org>
8367
8368                 * setenv.c: Declare alloca.
8369                 (compar_fn_t): New typedef.
8370                 (KNOWN_VALUE, STORE_VALUE): Use it.
8371
8372         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8373         setenv.h.
8374
8375 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8376
8377         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8378         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8379         Choose values that are less likely to collide with system fnmatch
8380         options.
8381         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8382         defined (e.g., a pure POSIX system).
8383         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8384         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8385
8386 2002-12-06  Jim Meyering  <jim@meyering.net>
8387
8388         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8389
8390         Merge in changes from libc's misc/error.c, in preparation
8391         for the merge of gnulib's changes back into libc.
8392
8393         * error.c (_): Define only if not already defined.
8394         Move definition to follow all #include directives.
8395         Include unlocked-io.h only if !_LIBC.
8396         [_LIBC]: Include <libio/libioP.h>.
8397         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8398         (fflush): Tweak definition to use INTUSE.
8399         (putc): Define.
8400
8401 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8402
8403         * alloca.c [defined emacs]: Include "lisp.h".
8404         (xalloc_die) [defined emacs]: New macro.
8405         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8406         [! defined emacs]: Include <xalloc.h>.
8407         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8408         (pointer): Typedef to POINTER_TYPE *.
8409         (malloc): Remove decl; we now always use xmalloc.
8410         (alloca): Use old-style definition, since Emacs needs this.
8411         Check for arithmetic overflow when computing combined size.
8412
8413 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8414
8415         Do not generate unlocked-io.h automatically, since it's easier to
8416         maintain it by hand.
8417
8418         * unlocked-io.h: New file, from GNU diffutils,
8419         but with proper copyright notice and attribution.
8420         * gen-uio: Remove.
8421         * Makefile.am: Add copyright notice.
8422         (libfetish_a_SOURCES): Add unlocked-io.h.
8423         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8424         (DISTCLEANFILES, io_functions): Remove macros.
8425         (EXTRA_DIST): Remove gen_uio.
8426         (unlocked-io.h): Remove rule.
8427
8428 2002-12-04  Jim Meyering  <jim@meyering.net>
8429
8430         Reflect the fact that stat.c and lstat.c are no longer generated.
8431         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8432         (DISTCLEANFILES): Likewise.
8433         (EXTRA_DIST): Likewise.
8434         (all_local): Don't depend on stat.c or lstat.c.
8435         (stat.c, lstat.c): Remove rules.
8436         (EXTRA_DIST): Remove xstat.in.
8437
8438         * xstat.in: Remove file.  Contents moved into stat.c.
8439         * stat.c: New file.  Contents mostly from xstat.in.
8440         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8441         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8442
8443         * safe-read.c: Rework so that it may serve to define safe_write, too.
8444         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8445
8446 2002-12-03  Jim Meyering  <jim@meyering.net>
8447
8448         * safe-read.c, safe-write.c: Change variable names and comments, but
8449         not semantics, to minimize the differences between these two files.
8450         (safe_read): Change comment to mention SAFE_READ_ERROR.
8451
8452         * safe-read.c (IS_EINTR): Define.
8453         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8454
8455 2002-12-02  Bruno Haible  <bruno@clisp.org>
8456
8457         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8458         Define, taken from safe-read.c.
8459         (INT_MAX): Provide fallback.
8460         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8461         * safe-write.h (SAFE_WRITE_ERROR): Define.
8462
8463         * safe-read.c (EINTR): Remove definition.
8464         (safe_read): Don't use EINTR if it is absent.
8465
8466 2002-12-02  Jim Meyering  <jim@meyering.net>
8467
8468         * safe-read.c (EINTR): Define.
8469         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8470         (INT_MAX): Provide fallback.
8471         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8472
8473         * safe-read.h (SAFE_READ_ERROR): Define.
8474
8475 2002-12-01  Jim Meyering  <jim@meyering.net>
8476
8477         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8478         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8479
8480 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8481
8482         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8483         hash_rehash): Replace `if (limit <= value) abort ();' with
8484         `if (! (value < limit)) abort ();', for readability.
8485
8486 2002-11-26    <karl@gnu.org>
8487
8488         * strdup.c: copy from libc again, with jim's ok.
8489         * .cppi-disable: re-add strdup.c
8490
8491 2002-11-25    <karl@gnu.org>
8492
8493         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8494         instead of "strtol.c".
8495
8496 2002-11-25  Jim Meyering  <jim@meyering.net>
8497
8498         * mktime.c: Sync from libc, now that it has the latest fix.
8499
8500 2002-11-24    <karl@gnu.org>
8501
8502         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8503         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8504
8505 2002-11-24  Jim Meyering  <jim@meyering.net>
8506
8507         Update from coreutils:
8508
8509         * mktime.c: Merge in changes from libc.
8510
8511         Avoid a link-time failure on some Linux systems.
8512         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8513         (__mon_yday): Declare with the STATIC attribute.
8514         (__mktime_internal): Likewise.
8515         Based on a report from Greg Schafer.
8516
8517 2002-11-23  Jim Meyering  <jim@meyering.net>
8518
8519         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8520         Use `unsigned', not `int', as type of index.
8521
8522         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8523
8524         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8525
8526 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8527
8528         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8529         hint that one should use `if (! x) abort ();' rather than `assert
8530         (x);', and anyway it's one less thing to worry about configuring.
8531         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8532         hash_rehash, hash_insert): Use abort rather than assert.
8533
8534 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8535
8536         * quotearg.h: Allow multiple inclusion by surrounding with
8537         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8538         so that we can be included first.
8539         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8540         * quotearg.c: Include quotearg.h immediately after config.h.
8541         No need to include stddef.h or sys/types.h any more.
8542         Surround local include files with "", not "<>".
8543         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8544         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8545         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8546         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8547         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8548         (ISPRINT): Remove; no longer needed now that we assume C89.
8549
8550         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8551         Preserve errno.
8552
8553         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8554         quotearg_char): Use SIZE_MAX rather than
8555         (size_t) -1 when we are talking about "infinity".
8556
8557         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8558
8559 2002-11-22  Bruno Haible  <bruno@clisp.org>
8560
8561         * safe-read.h: Assume C89. Add comments.
8562         (safe_read): Change return type to size_t.
8563         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8564         counts > SSIZE_MAX correctly.
8565         * safe-write.h: New file.
8566         * safe-write.c: New file.
8567         * full-read.h: New file.
8568         * full-read.c: New file.
8569         * full-write.h: Assume C89. Add comments.
8570         * full-write.c: Include safe-write.h.
8571         (full_write): Rewritten to use safe_write.
8572         Suggested by Jim Meyering and Paul Eggert.
8573
8574 2002-11-21  Bruno Haible  <bruno@clisp.org>
8575
8576         Remove case insensitive option matching.
8577         * argmatch.h (argcasematch): Remove declaration.
8578         (ARGCASEMATCH): Remove macro.
8579         (__xargmatch_internal): Remove case_sensitive argument.
8580         (XARGMATCH): Update.
8581         (XARGCASEMATCH): Remove macro.
8582         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8583         case_sensitive argument.
8584         (argcasematch): Remove function.
8585         (__xargmatch_internal): Remove case_sensitive argument.
8586         (main): Use XARGMATCH instead of XARGCASEMATCH.
8587
8588         * xmalloc.c: Change compile-time error message. Add comment about
8589         required autoconf version.
8590
8591 2002-11-21  Jim Meyering  <jim@meyering.net>
8592
8593         * strdup.c (strdup): Tweak comment and initial #if/#include.
8594
8595         Merge in changes from the coreutils.
8596
8597         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8598         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8599         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8600         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8601         int.  Work more efficiently if X is the same width as uintmax_t.
8602         Do not compare X to -1, to avoid bogus compiler warning.
8603         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8604         Don't assume that f_frsize and f_bsize are the same type.
8605
8606         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8607         on FreeBSD.
8608
8609         * makepath.c (make_path): Restore umask *before* creating the final
8610         component.
8611         (make_path): Minor reformatting.
8612
8613         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8614         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8615
8616         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8617         ones.  At least on GNU/Linux systems, `auto' means something else.
8618         From Michael Stone.
8619
8620 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8621
8622         Merge argmatch cleanups from Bison.  Assume C89.
8623
8624         * argmatch.c: Include config.h here, not in argmatch.h.
8625         Include stdlib.h, for EXIT_FAILURE.
8626         Always include <string.h>, since we assume C89.
8627         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8628         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8629         Include <stddef.h> instead, since it's all we need for size_t.
8630         (PARAMS): Remove.  All uses removed.
8631         (ARRAY_CARDINALITY): Do not bother to #undef.
8632         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8633         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8634         Remove unnecessary parentheses.
8635         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8636         Insert necessary parentheses.
8637         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8638         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8639
8640 2002-11-19  Bruno Haible  <bruno@clisp.org>
8641
8642         * mbswidth.c: Include mbswidth.h right at the beginning.
8643         * mbswidth.h: Include <stddef.h>, for size_t.
8644
8645         * mbswidth.h (PARAMS): Remove macro.
8646         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8647         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8648
8649         * gcd.h (PARAMS): Remove macro.
8650         (gcd): Use ANSI C function declarations.
8651         * gcd.c (gcd): Likewise.
8652
8653 2002-11-15  Bruno Haible  <bruno@clisp.org>
8654
8655         * strcspn.c: Include <stddef.h>.
8656         (strcspn): Use ANSI C function declaration. Change return type to
8657         size_t. Use NULL.
8658         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8659         (strpbrk): Use NULL.
8660         * strpbrk.h (PARAMS): Remove macro.
8661         (strpbrk): Use ANSI C function declaration.
8662         * strstr.c: Don't include <sys/types.h>.
8663         * strstr.h (PARAMS): Remove macro.
8664         (strstr): Use ANSI C function declarations.
8665
8666 2002-11-06  Bruno Haible  <bruno@clisp.org>
8667
8668         * gcd.h (gcd): Change argument type to 'unsigned long'.
8669         * gcd.c (gcd): Likewise.
8670
8671 2002-11-05  Bruno Haible  <bruno@clisp.org>
8672
8673         * gcd.h: New file, from gettext-0.11.5.
8674         * gcd.c: New file, from gettext-0.11.5.
8675
8676 2002-11-05  Bruno Haible  <bruno@clisp.org>
8677
8678         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8679         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8680         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8681         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8682
8683         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8684         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8685
8686         * closeout.c: Include gettext.h instead of <libintl.h>.
8687         * human.c: Include gettext.h instead of <libintl.h>.
8688         * quotearg.c: Include gettext.h instead of <libintl.h>.
8689         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8690         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8691         * userspec.c: Include gettext.h instead of <libintl.h>.
8692         * version-etc.c: Include gettext.h instead of <libintl.h>.
8693         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8694         (textdomain): Remove definition.
8695         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8696
8697         * long-options.c: Remove include of <libintl.h> and definition of _.
8698         * same.c: Remove include of <libintl.h> and definition of _.
8699
8700 2002-11-04  Bruno Haible  <bruno@clisp.org>
8701
8702         * stpcpy.h: New file, from GNU gettext-0.11.5.
8703         * strcase.h: New file, from GNU gettext-0.11.5.
8704         * strpbrk.h: New file, from GNU gettext-0.11.5.
8705         * strstr.h: New file, from GNU gettext-0.11.5.
8706         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8707
8708 2002-05-09  Bruno Haible  <bruno@clisp.org>
8709
8710         * config.charset: Update for newest glibc. Add canonical names
8711         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8712
8713 2002-05-09  Bruno Haible  <bruno@clisp.org>
8714
8715         * localcharset.c (get_charset_aliases): Add more Windows specific
8716         aliases.
8717
8718 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8719
8720         * config.charset: A few additions for Solaris.
8721
8722 2001-12-05  Bruno Haible  <bruno@clisp.org>
8723
8724         * localcharset.c (locale_charset): Don't return an empty string.
8725
8726 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8727
8728         * config.charset: msdos in uk_UA uses CP1125.
8729
8730 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8731
8732         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8733         * localcharset.c (locale_charset): Declare as extern "C".
8734
8735 2002-02-15  Bruno Haible  <bruno@clisp.org>
8736
8737         * config.charset [msdosdjgpp]: For Russian, use CP866.
8738
8739 2002-02-11  Bruno Haible  <bruno@clisp.org>
8740
8741         * config.charset: Add support for NetBSD.
8742
8743 2002-09-25    <karl@gnu.org>
8744
8745         * strdup.c: copy from libc/string (via ../config/srclist*).
8746         * getopt*: copy from libc/posix.
8747         * gettext.h: copy from gettext.
8748         * .cppi-disable: add strdup.c, gettext.h.
8749
8750 2002-07-01  Jim Meyering  <meyering@lucent.com>
8751
8752         * c-stack.c: Include sys/time.h.
8753         From Volker Borchert.
8754
8755 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8756
8757         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8758         New macro.  Use it uniformly instead of
8759         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8760         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8761         reported by Vin Shelton.
8762
8763 2002-06-22  Jim Meyering  <meyering@lucent.com>
8764
8765         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8766         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8767
8768 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8769
8770         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8771         Do not assume SA_SIGINFO behavior.
8772         Bug reported by Jim Meyering on NetBSD 1.5.2.
8773
8774 2002-06-22  Jim Meyering  <meyering@lucent.com>
8775
8776         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8777
8778         * exitfail.c, exitfail.h: Likewise.
8779         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8780
8781         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8782         of fnmatch.h.
8783         (EXTRA_DIST): Add fnmatch_loop.c.
8784         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8785
8786         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8787         * fnmatch.c: Update from diffutils-2.8.2.
8788         * fnmatch_.h: New file.  From diffutils-2.8.2.
8789         * fnmatch.h: Remove file.
8790
8791 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8792
8793         * file-type.h: Report an error if neither S_ISREG nor
8794         S_IFREG is defined, instead of using a test specific to glibc
8795         2.2.  This should be safe, since POSIX requires S_ISREG and
8796         Unix Version 7 had S_IFREG.  We don't need to check for
8797         <sys/types.h> since we don't use any symbols that it defines.
8798
8799 2002-06-15  Jim Meyering  <meyering@lucent.com>
8800
8801         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8802         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8803         have been included before this file.
8804
8805 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8806
8807         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8808         so that each temporary file name is unique and valid in the first
8809         8 characters, for operation under DOS.
8810
8811 2002-06-15  Jim Meyering  <meyering@lucent.com>
8812
8813         Work even with DJGPP 2.03, which lacks support for symlinks.
8814         From Richard Dawe.
8815         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8816         is defined.
8817         * lchown.c (S_ISLNK): Likewise.
8818
8819 2002-06-14  Jim Meyering  <meyering@lucent.com>
8820
8821         * file-type.h: Use the version from diffutils-2.8.2.
8822         * file-type.c: Likewise.
8823
8824 2002-05-27  Jim Meyering  <meyering@lucent.com>
8825
8826         Fix a problem seen only on nonconforming systems whereby ls.c's
8827         use of localtime, and then of gettimeofday would cause trouble:
8828         the localtime call used to initialize rpl_gettimeofday's save
8829         mechanism would clobber ls's current local time information so
8830         that in any long listing the first file would always be listed
8831         with date 1970-01-01.  Analysis by Volker Borchert.
8832
8833         * gettimeofday.c (localtime): Undefine.
8834         (rpl_localtime): New function.
8835
8836 2002-05-22  Jim Meyering  <meyering@lucent.com>
8837
8838         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8839         * file-type.h: New file.
8840         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8841
8842 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8843
8844         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8845
8846 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8847
8848         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8849         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8850         of 127, since 64 is the largest conceivable number for ancient
8851         nonstandard hosts.
8852         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8853
8854 2002-04-28  Jim Meyering  <meyering@lucent.com>
8855
8856         * sig2str.c (WTERMSIG): Remove definition (unused).
8857
8858 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8859
8860         * sig2str.h, sig2str.c: New files.
8861         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8862
8863 2002-04-24  Jim Meyering  <meyering@lucent.com>
8864
8865         * gettext.h: New file, from Gettext.
8866         * Makefile.am (INCLUDES): Remove -I../intl.
8867         (libfetish_a_SOURCES): Add gettext.h.
8868
8869 2002-04-16  Jim Meyering  <meyering@lucent.com>
8870
8871         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8872         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8873         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8874
8875 2002-04-12  Jim Meyering  <meyering@lucent.com>
8876
8877         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8878
8879 2002-03-10  Jim Meyering  <meyering@lucent.com>
8880
8881         * makepath.c (make_path): Remove a comma from a diagnostic.
8882         Suggestion from Santiago Vila.
8883
8884 2002-03-08  Jim Meyering  <meyering@lucent.com>
8885
8886         * rename.c: Mention that this wrapper is needed also on
8887         mips-dec-ultrix4.4 systems.
8888
8889 2002-03-02  Jim Meyering  <meyering@lucent.com>
8890
8891         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8892         not HAVE_CLOCK_SETTIME.
8893
8894 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8895
8896         * nanosleep.h: Rename to....
8897         * timespec.h: New name for nanosleep.h.  All uses changed.
8898
8899         * gettime.c: New file.
8900         * settime.c: New file.
8901         * stime.c: Remove.
8902
8903         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8904         timespec.h.  Remove nanosleep.h.
8905
8906 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8907
8908         * acl.c, acl.h: New files.
8909         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8910
8911 2002-02-24  Jim Meyering  <meyering@lucent.com>
8912
8913         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8914         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8915         cause trouble.  Reported by Nelson Beebe.
8916
8917 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8918
8919         * path-concat.c (xpath_concat): Reorder code to pacify
8920         compilers that don't know that xalloc_die never returns.
8921
8922 2002-02-20  Jim Meyering  <meyering@lucent.com>
8923
8924         * getdate.c: Regenerate using bison-1.33.
8925
8926 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8927
8928         * posixver.c, posixver.h: New files.
8929         * Makefile.am (libfetish_a_SOURCES): Add them.
8930
8931 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8932             Bruno Haible  <bruno@clisp.org>
8933
8934         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8935         (fwrite_success_callback): New declaration.
8936         * unicodeio.c (unicode_to_mb): New function, extracted from
8937         print_unicode_char. Call failure callback instead of error.
8938         (fwrite_success_callback): New function.
8939         (exit_failure_callback): New function.
8940         (fallback_failure_callback): New function.
8941         (print_unicode_char): Call unicode_to_mb.
8942
8943 2002-01-26  Jim Meyering  <meyering@lucent.com>
8944
8945         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8946
8947 2002-01-22  Jim Meyering  <meyering@lucent.com>
8948
8949         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8950         Otherwise, some versions of automake would omit the rule that makes
8951         Makefile from Makefile.in.
8952
8953 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8954
8955         * xmemcoll.h, xmemcoll.c: New files.
8956         * Makefile.am (libfetish_a_SOURCES): Add them.
8957         * memcoll.c: Include errno.h, and declare errno if not defined.
8958         (memcoll): Set errno to zero if there is no error.
8959
8960         * quotearg.c (quotearg_buffer_restyled):
8961         Fix bug with quoting buffers containing NUL when backslashing escapes.
8962         This bug was exposed by the other changes in this patch.
8963         (quotearg_n_options): New arg ARGSIZE.
8964         All callers changed.
8965         (quoting_options_from_style): New function.
8966         (quotearg_n_style): Use it.
8967         (quotearg_n_style_mem): New function.
8968
8969         * quotearg.h (quotearg_n_style_mem): New function.
8970
8971 2002-01-16  Jim Meyering  <meyering@lucent.com>
8972
8973         * getdate.y: Add three semicolons, each just before a closing brace.
8974         Bison (as of version 1.31) no longer papers over that mistake.
8975
8976 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8977
8978         * backupfile.c (ISDIGIT): Comment fix.
8979         * getdate.y (ISDIGIT): Likewise.
8980         * posixtm.c (ISDIGIT, year): Likewise.
8981         * strverscmp.c (ISDIGIT): Likewise.
8982         * userspec.c (ISDIGIT): Likewise.
8983
8984 2002-01-05  Jim Meyering  <meyering@lucent.com>
8985
8986         * version-etc.c (version_etc_copyright): Update copyright year.
8987
8988 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8989
8990         * closeout.c (close_stdout_status): If ferror (stdout), do
8991         not silently exit merely because the output buffer happens to
8992         have nothing pending.
8993
8994 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8995
8996         See the big note in ../ChangeLog.
8997         * human.c (suffixes): Prefer K to k for 1024.
8998         (generate_suffix_backwards): New function.
8999         (human_readable_inexact): Use it.
9000         * xstrtol.c (__xstrtol): If there is no number but there
9001         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
9002         Accept 'K' as well as 'k'.
9003
9004 2001-12-15  Jim Meyering  <meyering@lucent.com>
9005
9006         * regex.h (__restrict_arr): Update from libc.
9007
9008         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9009         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
9010         (STREQ): Define.
9011
9012 2001-12-10  Jim Meyering  <meyering@lucent.com>
9013
9014         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9015         Instead, include "xalloc.h".
9016         (initbuffer): Don't cast xmalloc return value to char*.
9017         (readline): Reword comment.
9018         Don't cast xrealloc return value to char*
9019         Return NULL, not 0.
9020
9021 2001-12-09  Jim Meyering  <meyering@lucent.com>
9022
9023         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9024         `signed and unsigned type in conditional expression'.
9025         * posixtm.c (posix_time_parse): Likewise.
9026
9027         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9028
9029         * readtokens.c (readtoken): Declare an index to be of type unsigned
9030         to avoid a pedantic warning.
9031
9032         * getstr.c: Don't include assert.h.
9033         (getstr): Remove warning-evoking assertions.
9034         Return -1 if offset parameter is out of bounds.
9035         Change the type of a local from int to size_t.
9036
9037         * strftime.c (my_strftime_localtime_r): Include this function
9038         definition in the `#if ! HAVE_TM_GMTOFF' block.
9039
9040         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9041         Include xalloc.h instead.
9042
9043 2001-12-02  Jim Meyering  <meyering@lucent.com>
9044
9045         * tempname.c: Don't declare getenv, thus reverting the change of
9046         2001-11-18.  It's no longer necessary, now that stdlib.h is always
9047         included.
9048
9049         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9050         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
9051
9052 2001-11-30  Akim Demaille  <akim@epita.fr>
9053
9054         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9055         before being defined.
9056
9057 2001-11-27  Paul Eggert  <eggert@twinsun.com>
9058
9059         * quotearg.h (quotearg_n, quotearg_n_style):
9060         First arg is int, not unsigned.
9061         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9062         (SIZE_MAX, UINT_MAX): New macros.
9063         (quotearg_n_options): Abort if N is negative.
9064         Avoid overflow check on hosts where size_t is 64 bits and int
9065         is 32 bits, as overflow is impossible there.
9066         Fix off-by-one typo that caused unnecessary reallocation.
9067
9068 2001-11-27  Jim Meyering  <meyering@lucent.com>
9069
9070         * tempname.c: Merge with version from libc.
9071         * regex.c: Likewise.
9072
9073         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9074         for which STDC_HEADERS is 0, it was not included, resulting in a
9075         warning about an integer-to-pointer conversion problem with getenv.
9076         Reported by Volker Borchert.
9077
9078 2001-11-26  Jim Meyering  <meyering@lucent.com>
9079
9080         * gtod.h: Remove file.
9081         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9082         * gettimeofday.c: Don't include gtod.h.
9083         (GTOD_init): Remove function.
9084         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9085         Suggestion from Volker Borchert.
9086
9087 2001-11-23  Jim Meyering  <meyering@lucent.com>
9088
9089         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9090         * hash.c (struct hash_table): Define it here instead.
9091
9092 2001-11-22  Jim Meyering  <meyering@lucent.com>
9093
9094         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9095
9096 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9097
9098         * tempname.c (TMP_MAX): Remove; no longer needed.
9099         (TEMPORARIES): New macro.
9100         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9101         removes an artificial limitation (e.g. HP-UX 10.20, where
9102         TMP_MAX is 17576).
9103
9104 2001-11-18  Jim Meyering  <meyering@lucent.com>
9105
9106         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9107         on SunOS 4.
9108
9109         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9110         files will be created before anything else.
9111
9112 2001-11-17  Jim Meyering  <meyering@lucent.com>
9113
9114         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9115         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9116         rather than group writable.  Patch by Juan F. Codagnone.
9117
9118         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9119         Instead, include "xalloc.h".
9120
9121         * mountlist.c: Include unlocked-io.h after all system headers.
9122         Remove explicit declarations of xmalloc, xrealloc,
9123         and xstrdup.  Instead, include "xalloc.h".
9124
9125         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9126         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9127         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9128
9129         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9130         Reported by Padraig Brady.
9131
9132         * mkstemp.c: #undef mkstemp.
9133         Include config.h.
9134         (rpl_mkstemp): Rename from mkstemp.
9135         Protoize.
9136
9137 2001-11-16  Jim Meyering  <meyering@lucent.com>
9138
9139         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9140         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9141         determine the amount of total physical memory, use pstat_getstatic.
9142         HPUX-11 doesn't define _SC_PHYS_PAGES.
9143         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9144         If sysconf couldn't be used to determine the amount of available
9145         physical memory, use both pstat_getstatic and pstat_getdynamic.
9146         Based on a patch from Bob Proulx.
9147
9148 2001-11-05  Jim Meyering  <meyering@lucent.com>
9149
9150         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9151
9152 2001-11-03  Jim Meyering  <meyering@lucent.com>
9153
9154         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9155         in argmatch_to_argument call.
9156
9157         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9158         argument.
9159
9160         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9161         e.g., a fault due to an attempt to free a NULL pointer.
9162
9163 2001-11-01  Jim Meyering  <meyering@lucent.com>
9164
9165         * dirfd.c, dirfd.h: New files.
9166         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9167
9168         * hash.c (hash_print) [TESTING]: Clean up.
9169
9170 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9171
9172         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9173         to avoid a warning if -Wall.
9174
9175 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9176
9177         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9178
9179 2001-10-21  Jim Meyering  <meyering@lucent.com>
9180
9181         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9182         this code would end up calling gettext even in packages built
9183         with --disable-nls.
9184         * getopt.c (_): Likewise.
9185         * regex.c (_): Likewise.
9186
9187 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9188
9189         * error.c (strerror_r): Do not declare unless !_LIBC.
9190         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9191         Use strerror_r that is only a macro, even if it is not a function.
9192         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9193         (private_strerror): Use prototypes, not old-style function definition.
9194         (print_errno_message): New function.
9195         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9196         char*-flavored one.
9197         (error_tail, error, error_at_line): Use it.
9198
9199 2001-10-11  Jim Meyering  <meyering@lucent.com>
9200
9201         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9202         and quote_n (1, ... to avoid clobbering a buffer.
9203
9204 2001-10-05  Jim Meyering  <meyering@lucent.com>
9205
9206         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9207         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9208         * hash-pjw.h: New file.
9209
9210 2001-09-30  Jim Meyering  <meyering@lucent.com>
9211
9212         * mountlist.c [MOUNTED_GETFSSTAT]:
9213         Include <sys/ucred.h>, for Apple Darwin.
9214         Include sys/mount.h and sys/fs_types.h only if available.
9215         (FS_TYPE): Define.
9216         (read_filesystem_list): Use FS_TYPE.
9217
9218 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9219
9220         * exclude.c (excluded_filename): 0 -> false, since it's
9221         a boolean context.
9222
9223 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9224
9225         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9226         #defines strtoimax.  Also treat the other strto* functions
9227         like strtoimax.
9228
9229         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9230         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9231         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9232
9233 2001-09-26  Jim Meyering  <meyering@lucent.com>
9234
9235         Most macros in unlocked-io.h had the wrong number of arguments.
9236         * gen-uio: New script.
9237         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9238         * unlocked-io.hin: Remove file.
9239         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9240         rather than trying to embed it here.
9241         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9242         Reported by Padraig Brady.
9243
9244 2001-09-25  Volker Borchert  <bt@teknon.de>
9245
9246         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9247
9248 2001-09-23  Jim Meyering  <meyering@lucent.com>
9249
9250         * mountlist.c: Remove useless parentheses in #if directives.
9251         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9252         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9253
9254 2001-09-22  Jim Meyering  <meyering@lucent.com>
9255
9256         * localcharset.c: Update from latest gettext.
9257         * config.charset: Likewise.
9258
9259 2001-09-20  Jim Meyering  <meyering@lucent.com>
9260
9261         * xstrtol.c (strtoimax): Guard declaration with
9262         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9263         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9264         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9265         (strtoumax): Likewise, for completeness (it wasn't necessary).
9266
9267 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9268
9269         * strtoimax.c (HAVE_LONG_LONG):
9270         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9271         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9272         to work around bug in IBM C compiler.
9273
9274 2001-09-16  Jim Meyering  <meyering@lucent.com>
9275
9276         * mkdir.c: New file.
9277
9278 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9279
9280         * xgetcwd.c: Revert some of the previous change; intead,
9281         fix the HAVE_GETCWD_NULL code to behave more like the
9282         !HAVE_GETCWD_NULL code used to.
9283
9284         Include "xalloc.h".
9285         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9286         invoke xalloc_die.
9287
9288 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9289
9290         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9291         Use ssize_t, not int, to store result of readlink.
9292         Check for ssize_t overflow as well as size_t overflow,
9293         as POSIX says the result of readlink is implementation-defined
9294         when ssize_t overflows.
9295         Remove unnecessary cast to char*.
9296         Use free+malloc instead of realloc, as the storage doesn't need
9297         to be preserved and it's clearer and can be more efficient that way.
9298         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9299         * xreadlink.h (xreadlink): Update prototype.
9300
9301 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9302
9303         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9304         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9305         spotted by Jim Meyering.
9306
9307 2001-09-03  Jim Meyering  <meyering@lucent.com>
9308
9309         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9310
9311 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9312
9313         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9314         like the HAVE_GETCWD_NULL code.
9315         Include pathmax.h if not HAVE_GETCWD.
9316         Do not include xalloc.h.
9317         (INITIAL_BUFFER_SIZE): New symbol.
9318         Do not use xmalloc / xrealloc, since the caller is responsible for
9319         handling errors.  Preserve errno around `free' during failure.
9320         Do not overrun buffer when using getwd.
9321
9322 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9323
9324         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9325         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9326
9327 2001-09-02  Jim Meyering  <meyering@lucent.com>
9328
9329         * error.c: Update from GNU libc.
9330
9331 2001-09-01  Jim Meyering  <meyering@lucent.com>
9332
9333         * xreadlink.c: New file.
9334         * xreadlink.h: New file.
9335         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9336
9337         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9338         doesn't conflict with sparc Solaris 7's definition in
9339         /usr/include/sys/int_types.h.
9340
9341         * exclude.c: Use `""', not `<>' to #include non-system header files.
9342         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9343         and strncasecmp as r-values.  Unixware didn't have declarations.
9344
9345 2001-08-31  Jim Meyering  <meyering@lucent.com>
9346
9347         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9348         Use an initial, malloc'd, buffer of length 128 rather than
9349         a statically allocated one of length 1024.
9350
9351 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9352
9353         * xgetcwd.c: Don't include pathmax.h.
9354         Include stdlib.h and unistd.h if available.
9355         Include xalloc.h.
9356         (xmalloc, xstrdup, free): Remove decls.
9357         (xgetcwd): Don't assume sizes fit in unsigned.
9358         Check for overflow when computing sizes.
9359         Simplify reallocation code.
9360
9361 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9362
9363         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9364
9365         * strtoimax.c: Renamed from strtoxmax.c, removing the
9366         old strtoimax.c.
9367
9368         Also, make the following further changes to make this file's
9369         configuration more similar to that of strtol.c:
9370         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9371         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9372         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9373         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9374         changed to signed values.
9375
9376         And make the following changes as well:
9377         Fix copyright notice, as 1999 was missing.
9378         (verify): New macro.
9379         (strtoimax): Check sizes at compile-time, not run-time.
9380         Prefer strtol to strtoll if both work.
9381         (main): Remove; it was not that useful and was a pain to maintain.
9382
9383         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9384
9385 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9386
9387         * savedir.c (savedir): Remove size parameter, as POSIX says that
9388         a directory's st_size can have an arbitrary value, so the old
9389         usage could waste an arbitrary amount of memory.  All uses
9390         changed.
9391         * savedir.h: Update prototype.
9392
9393 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9394
9395         * xstrtol.c (strtoimax): New decl.
9396
9397 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9398
9399         * xstrtol.h: Add copyright notice.
9400         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9401         LONGINT_INVALID_SUFFIX_CHAR.
9402
9403 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9404
9405         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9406         tm to be declared.
9407
9408 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9409
9410         * hash.c: Remove '2001' from copyright notice.
9411
9412 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9413
9414         * full-write.h: New file.
9415         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9416         * full-write.c: Correct credits, as cccp.c no longer
9417         exists and anyway it was so heavily changed from the old cccp
9418         code as to be unrecognizable.  Include full-write.h.
9419         (full_write) Return size_t, with short writes meaning failure.
9420         All callers changed.  This fixes a bug with large buffers
9421         on 64-bit hosts.
9422         * utime.c: Include full-write.h.
9423
9424 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9425
9426         Merge 'exclude' changes from tar 1.13.22.
9427         This fixes one or two unlikely storage allocation overflow bugs,
9428         but doesn't change user-visible behavior otherwise.
9429
9430 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9431
9432         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9433         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9434         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9435         Include if available.
9436         (<xalloc.h>): Include
9437         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9438         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9439         collide with FNM macros.
9440         (struct patopts): New struct.
9441         (struct exclude): Use it, as exclude patterns now come with options.
9442         (new_exclude): Support above changes.
9443         (new_exclude, add_exclude_file):
9444         Initial size must now be a power of two to simplify overflow checking.
9445         (free_exclude, fnmatch_no_wildcards): New function.
9446         (excluded_filename): No longer requires options arg, as the options
9447         are determined by add_exclude.  Now returns bool, not int.
9448         (excluded_filename, add_exclude):
9449         Add support for the fancy new exclusion options.
9450         (add_exclude, add_exclude_file): Now takes int options arg.
9451         Check for arithmetic overflow when computing sizes.
9452         (add_exclude_file): xrealloc might modify errno, so don't
9453         realloc until after errno might be used.
9454
9455         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9456         New macros.
9457         (free_exclude): New decl.
9458         (add_exclude, add_exclude_file): Now takes int options arg.
9459         (excluded_filename): No longer requires options arg, as the options
9460         are determined by add_exclude.  Now returns bool, not int.
9461
9462 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9463
9464         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9465
9466 2001-08-27  Jim Meyering  <meyering@lucent.com>
9467
9468         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9469
9470         * version-etc.c (N_): Remove definition.
9471         Revert most of last change.
9472         Instead, simply don't mark the `Copyright...' string for translation.
9473         Based on advice from Paul Eggert.
9474
9475         * strtoxmax.c: Tweak comment.
9476
9477 2001-08-26  Jim Meyering  <meyering@lucent.com>
9478
9479         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9480         of copyright with `%s' so translators don't get an untranslated
9481         message in 2002.
9482         (COPYRIGHT_YEAR): Define.
9483         (version_etc): Use fprintf rather than fputs.
9484         Suggestion from Ulrich Drepper.
9485
9486         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9487
9488         * strtoll.c: New file, from GNU libc.
9489         * xstrtoimax.c: New file.
9490
9491         * xstrtol.h: Add xstrtoimax.
9492         * strtoumax.c: New file.  Simply include "strtoumax.c".
9493         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9494
9495         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9496         * strtoxmax.c: ... then renamed to this.
9497
9498 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9499
9500         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9501         Port to Solaris 8, where 'sed' requires a space after the 'r'
9502         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9503         Redirect output to $tmp just once.
9504
9505 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9506
9507         * addext.c (<errno.h>): Include.
9508         (errno): Declare if not defined.
9509         (addext): Work correctly when pathconf returns -1 and leaves
9510         errno alone because there is no limit.  Also, work even if
9511         pathconf returns a value greater than SIZE_MAX.
9512
9513 2001-08-12  Jim Meyering  <meyering@lucent.com>
9514
9515         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9516         Simply `return getcwd (NULL, 0);'.
9517         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9518         Use 1300 as initial value for length, not PATH_MAX.
9519
9520         * pathmax.h: Clean up cpp syntax.
9521
9522 2001-08-12  Jim Meyering  <meyering@lucent.com>
9523
9524         * gettimeofday.c: New file.
9525         * gtod.h: New file.
9526         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9527
9528 2001-08-04  Jim Meyering  <meyering@lucent.com>
9529
9530         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9531         to get in sync with glibc.
9532
9533 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9534
9535         The following changes are from gettext 0.10.39 as maintained by
9536         Bruno Haible.
9537
9538         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9539         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9540         with inverted sense.  All uses changed.
9541
9542         * mbswidth.c: Don't include <limits.h>.
9543         Include <stdlib.h> and <string.h> unconditionally.
9544         (iswcntrl, mbsinit, ISCNTRL): New macros.
9545         (mbsnwidth): Use K&R style function declarations.
9546         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9547         can optimize it when MB_CUR_MAX == 1.
9548         The width of control characters is zero, not 1.
9549
9550 2001-07-15  Jim Meyering  <meyering@lucent.com>
9551
9552         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9553         (BUILT_SOURCES): Add unlocked-io.h.
9554         (io_functions): Define.
9555         (unlocked-io.h): New rule.
9556         (DISTCLEANFILES): Add unlocked-io.h.
9557         (all-local): Depend on unlocked-io.h, to ensure it is created.
9558
9559         * unlocked-io.hin: New file
9560
9561         * regex.c: Update from glibc.
9562
9563 2001-07-05  Jim Meyering  <meyering@lucent.com>
9564
9565         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9566         recommendation.
9567         (libfetish_a_SOURCES): Put all .h files here instead.
9568         Remove a thus-exposed (better checks in automake) duplicate and
9569         two unnecessary .h files.
9570
9571 2001-06-11  Jim Meyering  <meyering@lucent.com>
9572
9573         * regex.c: Update from GNU libc.
9574
9575 2001-05-27  Jim Meyering  <meyering@lucent.com>
9576
9577         * readutmp.h (UT_TYPE): Define.
9578
9579 2001-05-24  Jim Meyering  <meyering@lucent.com>
9580
9581         * argmatch.c: Include "quote.h".
9582         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9583         quote function.  Reported by Göran Uddeborg.
9584
9585 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9586
9587         * dirname.c (dir_name): Compute append_dot using path, not newpath
9588         which is not yet declared.
9589
9590 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9591
9592         * Makefile.am (libfetish_a_SOURCES):
9593         Add strftime.c, since we now compile it on all hosts.
9594
9595         * strftime.c (my_strftime):
9596         Define to nstrftime if emacs, but only if my_strftime is not defined.
9597         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9598         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9599         Add one more extra argument: a nanoseconds value.
9600         All uses changed.
9601         (ns): New macro.
9602         (my_strftime function): Add %N format.
9603         (emacs_strftimeu): Renamed from emacs_strftime,
9604         with extra ut argument.
9605
9606 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9607
9608         dirname code cleanup.  base_name now behaves more compatibly
9609         with POSIX basename when given file names that have trailing
9610         slashes, and similarly for dir_name.  Add new primitives
9611         base_len and dir_len.  Put the directory-name-related decls
9612         into dirname.h.
9613
9614         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9615         * backupfile.c (base_name): Likewise.
9616         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9617         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9618         * makepath.c (strip_trailing_slashes): Likewise.
9619         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9620         Likewise.
9621         * rename.c (strip_trailing_slashes): Likewise.
9622         * same.c (base_name): Likewise.
9623         * stripslash.c (ISSLASH): Likewise.
9624
9625         * addext.c: Include <dirname.h> after size_t is defined.
9626         * backupfile.c: Likewise.
9627
9628         * addext.c (addext): Use base_len to trim redundant
9629         trailing slashes instead of doing it ourselves.
9630         But do not trim the last slash if it is not redundant.
9631
9632         * backupfile.c (find_backup_file_name,
9633         max_backup_version): Use base_len instead of rolling it ourselves.
9634         Handle the case of "" and (on DOS) "C:" correctly.
9635
9636         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9637         Include <string.h>, <dirname.h>.
9638         (base_name): Allow file names ending in slashes, other than names
9639         that are all slashes.  In this case, return the basename followed
9640         by the slashes.  This is more general, and can be used in places
9641         where the original base_name purposely had an assertion failure.
9642         (base_len): New function.
9643
9644         * dirname.c: Include <string.h> instead of <stdlib.h>.
9645         Do not include <assert.h>; no longer needed.
9646         Include xalloc.h.
9647         (memrchr): Remove decl.
9648         (dir_name_r): Remove.
9649         (dir_len): Renamed from dirlen.  All callers changed.
9650         Rewrite in terms of base_name, for simplicity and consistency.
9651         (dir_name): Never return NULL.  All callers changed.
9652         Do not include <stdlib.h> in test program; no longer needed.
9653         return 0; is fine for test program.
9654
9655         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9656         New macros.
9657         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9658
9659         * path-concat.c (path_concat): Use base_len to compute
9660         base length, not strlen; this means we cannot rely on memcpy
9661         to null-terminate.
9662
9663         * same.c (STREQ): Remove.
9664         (same_name): Handle the case where the basename ends in trailing '/'.
9665
9666         * stripslash.c (strip_trailing_slashes): Return nonzero if
9667         a slash was stripped.  Do not strip the last slash after a
9668         file system prefix.
9669
9670 2001-04-08  Jim Meyering  <meyering@lucent.com>
9671
9672         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9673         recomputed; that's necessary when the offset spans a DST transition.
9674         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9675
9676 2001-04-02  Jim Meyering  <meyering@lucent.com>
9677
9678         * regex.h, regex.c: Update from GNU libc.
9679
9680 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9681
9682         * version-etc.c (version_etc_copyright): Update to 2001.
9683
9684 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9685
9686         * tempname.c (uint64_t): Define to uintmax_t if
9687         not defined, and if UINT64_MAX is not defined.
9688         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9689         Reported by John David Anglin.
9690
9691 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9692
9693         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9694         alias if codeset is empty.
9695         * config.charset (BeOS): Use wildcard syntax.
9696
9697 2001-03-13  Jim Meyering  <meyering@lucent.com>
9698
9699         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9700         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9701         From Bruno Haible.
9702
9703 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9704
9705         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9706         Don't return NULL.
9707         * unicodeio.c (print_unicode_char): Simplify accordingly.
9708
9709 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9710
9711         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9712         support for DOS/DJGPP.
9713
9714 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9715
9716         * Makefile.am (libfetish_a_SOURCES):
9717         Add dup-safer.c, fopen-safer.c.
9718         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9719
9720         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9721
9722 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9723
9724         The mkstemp replacement is taken from glibc 2.2.2, with some
9725         portability fixes for use outside glibc, as follows:
9726
9727         * tempname.c (struct_stat64): New macro.
9728         (direxists, __gen_tempname): Use it.
9729         This avoids a portability problem with Solaris 8.
9730
9731         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9732         (<stddef.h>, <stdint.h>, <string.h>):
9733         Include only if STDC_HEADERS || _LIBC.
9734         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9735         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9736         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9737         (__set_errno): Define this macro if <errno.h> doesn't.
9738         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9739         Define these macros if <stdio.h> doesn't.
9740         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9741         Define these macros if <sys/stat.h>
9742         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9743         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9744         __xstat64): Define if not _LIBC.
9745         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9746         (__gen_tempname): Invoke gettimeofday only if
9747         HAVE_GETTIMEOFDAY || _LIBC;
9748         otherwise, fall back on plain "time".
9749         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9750
9751         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9752
9753         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9754
9755 2001-02-17  Jim Meyering  <meyering@lucent.com>
9756
9757         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9758         around included file name.
9759
9760         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9761
9762         * strftime.c: Update from GNU libc (the only changes were to comments).
9763
9764 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9765
9766         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9767
9768 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9769
9770         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9771         Remove workaround macros for hosts that have mbrtowc but not
9772         mbstate_t, as we now insist on proper declarations for both
9773         before using mbrtowc.
9774
9775 2001-02-17  Jim Meyering  <meyering@lucent.com>
9776
9777         * regex.c: Update from libc.
9778
9779 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9780
9781         * alloca.c (malloc): Undef before defining, since stdlib.h
9782         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9783         Reported by Mark Hounschell via Paul Eggert.
9784
9785 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9786
9787         * config.charset: Update for FreeBSD 4.2.
9788
9789 2001-01-26  Jim Meyering  <meyering@lucent.com>
9790
9791         * quotearg.c: Include stddef.h.
9792         * quote.c: Include stddef.h.
9793         Reported by Axel Kittenberger.
9794
9795         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9796         line in double quotes so that it evokes a better diagnostic.
9797         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9798         Reported by Axel Kittenberger.
9799
9800 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9801
9802         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9803         to avoid a warning.  Add back 'const' to inptr.
9804
9805 2001-01-16  Jim Meyering  <meyering@lucent.com>
9806
9807         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9808         From Bruno Haible.
9809
9810 2001-01-14  Jim Meyering  <meyering@lucent.com>
9811
9812         * rename.c: New file.  From Volker Borchert.
9813         Include stdlib.h, string.h or strings.h, and xalloc.h.
9814         Use strip_trailing_slashes rather than open-coding it.
9815
9816 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9817
9818         * strftime.c: Sync with glibc time/strftime.c 1.81.
9819
9820 2001-01-03  Jim Meyering  <meyering@lucent.com>
9821
9822         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9823         local `inptr' to avoid warning with some system declarations of iconv.
9824
9825 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9826
9827         * modechange.c: Do not assume that mode_t uses the
9828         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9829         the other-execute bit of FOO even if S_IXOTH != 1.
9830
9831         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9832         WOTH, XOTH, ALLM): New macros.
9833         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9834          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9835         Use them.
9836         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9837         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9838         (mode_compile):
9839         No need to use uintmax_t; unsigned long is long enough.
9840         Don't bother to get suffix since we don't use it.
9841
9842 2000-12-24  Jim Meyering  <meyering@lucent.com>
9843
9844         * hash.c (is_prime): Return explicit boolean values.
9845         (hash_get_first): Return NULL to appease Irix5.6's 89.
9846         Reported by Nelson Beebe.
9847
9848 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9849
9850         * localcharset.c (locale_charset): Add support for Win32.
9851
9852 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9853
9854         * physmem.h, physmem.c: New files.
9855
9856         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9857         (noinst_HEADERS): Add physmem.h.
9858
9859         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9860         't' for compatibility with Solaris 8 sort.
9861
9862 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9863
9864         * config.charset: Add support for BeOS.
9865
9866 2000-12-16  Jim Meyering  <meyering@lucent.com>
9867
9868         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9869         SHELLS_FILE to a file name that's useful on djgpp systems.
9870         Include stdlib.h.
9871         (ADDITIONAL_DEFAULT_SHELLS): Define.
9872         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9873         Based mostly on a patch from Prashant TR.
9874
9875 2000-12-16  Jim Meyering  <meyering@lucent.com>
9876
9877         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9878         N and M) would have treated it like `chown N:N FILE'.
9879
9880         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9881
9882 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9883
9884         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9885         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9886         to the list of canonical encodings. Rename EUC-CN to GB2312.
9887
9888 2000-12-08  Andreas Schwab  <schwab@suse.de>
9889
9890         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9891         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9892
9893 2000-12-07  Jim Meyering  <meyering@lucent.com>
9894
9895         * stripslash.c (ISSLASH): Define.
9896         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9897         From Prashant TR.
9898
9899         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9900         (dir_name_r): Declare this function as static.
9901         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9902         manifest itself on a name containing a mix of slashes and
9903         backslashes.
9904         Make this function work with names starting with a DOS-style
9905         drive letter and colon prefix.
9906         (dir_name): Append `.' if necessary.
9907         Based mostly on patches from Prashant TR and Eli Zaretskii.
9908
9909         * dirname.h (dir_name_r): Remove prototype.
9910
9911 2000-12-05  Jim Meyering  <meyering@lucent.com>
9912
9913         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9914
9915 2000-12-04  Jim Meyering  <meyering@lucent.com>
9916
9917         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9918         Also include memory.h, stdlib.h, unistd.h if appropriate.
9919         Reported by Andreas Jaeger (conflicting declaration of malloc).
9920
9921 2000-12-02  Jim Meyering  <meyering@lucent.com>
9922
9923         * closeout.h: Make idempotent, to avoid some obscure warnings.
9924
9925 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9926
9927         * memrchr.c: Include <config.h> before any system include file.
9928
9929 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9930
9931         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9932
9933 2000-11-26  Jim Meyering  <meyering@lucent.com>
9934
9935         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9936
9937 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9938
9939         * strftime.c (my_strftime): Do not invoke mbrlen with a
9940         size of (size_t) -1; it's not portable.
9941
9942 2000-11-17  Akim Demaille  <akim@epita.fr>
9943
9944         * obstack.h: Formatting changes.
9945         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9946         prevent type checking.
9947         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9948         cast the value to (void *): assigning a `foo *' to a `void *'
9949         variable is valid.
9950         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9951
9952 2000-11-17  Jim Meyering  <meyering@lucent.com>
9953
9954         * strstr.c: Update from GNU libc.
9955
9956 2000-11-16  Jim Meyering  <meyering@lucent.com>
9957
9958         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9959
9960 2000-11-11  Jim Meyering  <meyering@lucent.com>
9961
9962         * error.c: Add a couple #includes, merging from GNU libc version.
9963
9964 2000-11-10  Jim Meyering  <meyering@lucent.com>
9965
9966         * obstack.h: Update from GNU libc.
9967         * obstack.c: Likewise.
9968
9969 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9970
9971         * getusershell.c (setusershell): Use rewind rather than
9972         fseek/fseeko, to avoid configuration hassles with fseeko.
9973         Don't bother opening SHELLS_FILE if shellstream is NULL;
9974         it's not necessary.
9975
9976 2000-11-05  Jim Meyering  <meyering@lucent.com>
9977
9978         * makepath.h (make_dir): Declare.
9979         * makepath.c (make_dir): Remove `static' attribute.
9980         Tweak a comment.
9981
9982 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9983
9984         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9985         last one in a bucket, advance to the next bucket.
9986
9987 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9988
9989         * fnmatch.c: Do not comment out all the code if we are using
9990         the GNU C library, because in some cases we are replacing buggy
9991         code in the GNU C library itself.
9992
9993 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9994
9995         * error.h, getline.h, modechange.h:
9996         Remove "2000" from Copyright line, as the file hasn't been
9997         changed this year other than in the copyright notice.
9998
9999         * xalloc.h: Add "2000" to Copyright line, as this file
10000         was changed this year.
10001
10002 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10003
10004         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10005         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10006         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10007
10008 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
10009
10010         * regex.h (__restrict_arr): Move definition out of #ifndef block.
10011         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10012         doesn't define __restrict_arr.
10013
10014 2000-10-29  Jim Meyering  <meyering@lucent.com>
10015
10016         * xstat.in: Fix grammar in comment.
10017
10018 2000-10-28  Jim Meyering  <meyering@lucent.com>
10019
10020         * memchr.c: Update from libc.
10021         Adjust for portability:
10022         [HAVE_STDLIB_H]: Include stdlib.h.
10023         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10024         Undef __memchr, too.
10025         [!weak_alias]: Define __memchr to memchr.
10026
10027         * regex.c: Update from libc.
10028         * regex.h: Likewise.
10029         * getopt1.c: Likewise.
10030         * memcmp.c: Likewise.
10031
10032         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10033         Avoid using fseek, when possible -- it's broken by design.
10034         Patch by Ulrich Drepper.
10035
10036 2000-10-26  Jim Meyering  <meyering@lucent.com>
10037
10038         * strftime.c: Update from libc.
10039
10040 2000-10-25  Jim Meyering  <meyering@lucent.com>
10041
10042         * obstack.c: Update from libc.
10043
10044 2000-10-23  Jim Meyering  <meyering@lucent.com>
10045
10046         * hard-locale.c (hard_locale): Revert last change -- it was simply
10047         wrong.  That set_locale call must not have any side effects.
10048         From Paul Eggert.
10049
10050 2000-10-22  Jim Meyering  <meyering@lucent.com>
10051
10052         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10053         [CYCLIC]: Remove now-unused definition.
10054
10055         * save-cwd.c (O_DIRECTORY): Define, if needed.
10056         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10057         Suggestion from Ulrich Drepper.
10058
10059 2000-10-21  Jim Meyering  <meyering@lucent.com>
10060
10061         * dirname.c (dir_name_r): New function, factored out of dir_name.
10062         (dir_name): Use dir_name_r.
10063         * dirname.h (dir_name_r): Declare it.
10064
10065 2000-10-21  Jim Meyering  <meyering@lucent.com>
10066
10067         * dirname.c (memrchr): Declare if necessary.
10068         (dir_name): Remove the restriction that there be no
10069         trailing slashes.  Now, this code skips past them, effectively
10070         ignoring them.
10071         [TEST_DIRNAME] (main): New unit tests.
10072
10073         * memrchr.c: New file from GNU libc.
10074         Undef __memrchr, too.
10075         [!weak_alias]: Define __memrchr to memrchr.
10076         Guard weak_alias use with `#ifdef weak_alias'.
10077
10078 2000-10-17  Jim Meyering  <meyering@lucent.com>
10079
10080         * quote.h (PARAMS): Define and use.
10081         Reported by Akim Demaille.
10082
10083         * getopt.c: Update from libc.
10084
10085 2000-10-16  Jim Meyering  <meyering@lucent.com>
10086
10087         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10088         From Jan Fedak.
10089
10090 2000-09-25  Jim Meyering  <meyering@lucent.com>
10091
10092         * md5.h (rol): Define (from GnuPG).
10093
10094         * sha.c: Give credit (GnuPG) where due.
10095         (M): Use rol rather than open-coding it.
10096         Add a FIXME comment.
10097
10098 2000-09-21  Jim Meyering  <meyering@lucent.com>
10099
10100         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10101         Reported by Michael Stone.
10102
10103 2000-09-20  Jim Meyering  <meyering@lucent.com>
10104
10105         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10106         (noinst_HEADERS): Add sha.h.
10107         Based on code from Scott G. Miller and from GnuPG.
10108
10109 2000-09-15  Jim Meyering  <meyering@lucent.com>
10110
10111         * regex.c: Update from libc.
10112
10113 2000-09-10  Jim Meyering  <meyering@lucent.com>
10114
10115         * getopt.c (_getopt_internal): Update from glibc.
10116
10117 2000-09-09  Jim Meyering  <meyering@lucent.com>
10118
10119         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10120         think it should be used as a general replacement for isascii.
10121         * fnmatch.c: Likewise.
10122         * mbswidth.c: Likewise
10123         * regex.c: Likewise.
10124
10125         Don't use atoi.
10126         * userspec.c: Include sys/param.h and limits.h.
10127         Include xstrtol.h.
10128         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10129         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10130         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10131         UID, GID.  Check range.
10132
10133 2000-09-06  Jim Meyering  <meyering@lucent.com>
10134
10135         * getopt.c (_getopt_internal): Update from glibc.
10136
10137 2000-08-30  Jim Meyering  <meyering@lucent.com>
10138
10139         * strftime.c: Merge in changes from GNU libc.
10140
10141 2000-08-26  Jim Meyering  <meyering@lucent.com>
10142
10143         * closeout.c: Include "__fpending.h".
10144         (close_stdout_status): Return right away if there's nothing to flush.
10145
10146         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10147         * __fpending.c: New file.
10148         * __fpending.h: New file.
10149
10150 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10151
10152         Standardize on "memory exhausted" instead of "Memory exhausted"
10153         or "virtual memory exhausted".
10154         * obstack.c (print_and_abort): Use "memory exhausted", not
10155         "virtual memory exhausted".
10156         * same.c (same_name): Invoke xalloc_die instead of printing
10157         our own message.
10158         * userspec.c (parse_user_spec): Likewise.
10159         * bumpalloc.h: comment fix
10160         * same.c, userspec.c: Include xalloc.h.
10161
10162         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10163         not char *const and pointing to a constant array.
10164         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10165         (xrealloc): Comment fix.
10166
10167         * userspec.c (parse_user_spec):
10168         Don't translate a message until just before returning,
10169         to avoid unnecessary translation.
10170
10171 2000-08-07  Jim Meyering  <meyering@lucent.com>
10172
10173         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10174         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10175         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10176         getgroups.c, gethostname.c, getopt.h, group-member.c,
10177         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10178         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10179         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10180         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10181         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10182         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10183         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10184         yesno.c: Back out Copyright date changes for each file with no change
10185         this year.  This eases coordination with other programs using the same
10186         source code modules.  From Paul Eggert.
10187
10188 2000-08-03  Greg McGary  <greg@mcgary.org>
10189
10190         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10191         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10192         (EXTEND_BUFFER): Use them.
10193
10194 2000-08-01  Jim Meyering  <meyering@lucent.com>
10195
10196         * dirname.c (ISSLASH): Define.
10197         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10198         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10199         both `\' and `/' may be use as path separators.
10200         Based on a patch from Prashant TR.
10201
10202 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10203
10204         * quotearg.c (quotearg_n_options): Don't make the initial
10205         slot vector a constant, since it might get modified.
10206
10207 2000-07-31  Jim Meyering  <meyering@lucent.com>
10208
10209         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10210         * obstack.c (print_and_abort): Likewise.
10211
10212 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10213
10214         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10215         buffer, so that the caller can always quote one small
10216         component of a "memory exhausted" message in slot 0.
10217         From a suggestion by Jim Meyering.
10218
10219 2000-07-30  Jim Meyering  <meyering@lucent.com>
10220
10221         * makepath.c (make_path): Quote the other instance, too.
10222
10223         * quotearg.c (N_STATIC_SLOTVECS): Define.
10224         (STATIC_BUF_SIZE): Define.
10225         (quotearg_n_options): Use only statically allocated storage when
10226         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10227         than STATIC_BUF_SIZE.
10228
10229 2000-07-29  Jim Meyering  <meyering@lucent.com>
10230
10231         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10232         * dirname.c (dir_name): Likewise.
10233
10234         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10235
10236         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10237         (dir_name): Assert that there are no trailing slashes.
10238
10239 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10240
10241         * mbswidth.h (mbswidth): Add a flags argument.
10242         (mbswidth): New declaration.
10243         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10244         * mbswidth.c (mbswidth): Add a flags argument.
10245         (mbsnwidth): New function.
10246
10247 2000-07-24  Jim Meyering  <meyering@lucent.com>
10248
10249         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10250
10251 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10252
10253         * mbswidth.c (_XOPEN_SOURCE):
10254         Don't define; this causes problems on Solaris 7.
10255         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10256
10257 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10258
10259         * quotearg.c:
10260         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10261         so that mbstate_t is always defined.
10262
10263         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10264         be 1 in at least one GCC installation, and this configuration
10265         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10266         performance on hosts that have mbrtowc but have only unibyte
10267         locales, but I assume these hosts are rare.
10268
10269 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10270
10271         * quotearg.c: Streamline by invoking multibyte code only if needed.
10272         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10273         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10274         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10275         invoke multibyte primitives.
10276
10277 2000-07-23  Jim Meyering  <meyering@lucent.com>
10278
10279         * basename.c (base_name): Add an assertion.
10280
10281 2000-07-15  Bruno Haible  <clisp.cons.org>
10282
10283         * quotearg.c: When the system forces us to redefine mbstate_t,
10284         shadow its mbsinit function.
10285
10286 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10287
10288         * mbswidth.h: New file.
10289         * mbswidth.c: New file.
10290         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10291         (noinst_HEADERS): Add mbswidth.h.
10292
10293 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10294
10295         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10296         and IRIX 6.
10297
10298 2000-07-15  Jim Meyering  <meyering@lucent.com>
10299
10300         * makepath.c: Include quote.h.
10301         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10302         corresponding argument in a `quote (...)' call.
10303         Give better diagnostics.
10304
10305         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10306         (noinst_HEADERS): Add quote.h.
10307
10308         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10309         from tar's src/misc.c.
10310         * quote.h: New file.  Prototypes for same.
10311
10312 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10313
10314         From a suggestion by Bruno Haible.
10315         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10316         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10317         to decide whether to define the BeOS workaround macro;
10318         this adjusts to the change to AC_MBSTATE_T.
10319
10320 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10321
10322         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10323
10324         * quotearg.c (quoting_style_args, quoting_style_vals,
10325         quotearg_buffer_restyled): Add support for
10326         clocale_quoting_style.  Undo previous change to
10327         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10328         and "{RIGHT QUOTATION MARK}" msgids.
10329
10330 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10331
10332         The old behavior of quoting `like this' doesn't look good with
10333         newer, ISO-style fonts.  See:
10334         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10335
10336         Instead, quote "like this" by default.  Let the translator
10337         tailor the locale-specific quoting behavior by providing
10338         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10339
10340         * quotearg.c (N_): New macro.
10341         (gettext_default): New function.
10342         (quotearg_buffer_restyled): Use
10343         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10344         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10345
10346 2000-07-09  Jim Meyering  <meyering@lucent.com>
10347
10348         * Most files: Update copyright dates to include 2000.
10349
10350 2000-07-08  Jim Meyering  <meyering@lucent.com>
10351
10352         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10353         if not defined.
10354         (xgethostname): Remove now-unnecessary #ifdef.
10355         Move declaration of `err' into loop where it's used.
10356
10357 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10358
10359         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10360         by allocating a larger buffer. Test the gethostname return value for
10361         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10362         returns an error and ENAMETOOLONG isn't defined.
10363
10364 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10365         and Bruno Haible  <haible@clisp.cons.org>
10366
10367         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10368
10369 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10370
10371         * quotearg.c (struct quoting_options): Simplify quote_these_too
10372         dimension.
10373
10374 2000-07-03  Jim Meyering  <meyering@lucent.com>
10375
10376         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10377         Reported by Bruno Haible.
10378
10379 2000-07-04  Jim Meyering  <meyering@lucent.com>
10380
10381         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10382         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10383         lacks mbrtowc.
10384
10385 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10386         and Bruno Haible  <haible@clisp.cons.org>
10387
10388         * quotearg.c (mbrtowc):
10389         Assign to *pwc, and return 1 only if result is nonzero.
10390         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10391
10392 2000-07-03  Jim Meyering  <meyering@lucent.com>
10393
10394         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10395         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10396         From Bob Proulx.
10397
10398 2000-07-02  Jim Meyering  <meyering@lucent.com>
10399
10400         * quotearg.c (mbstate_t): Don't define here.
10401
10402 2000-07-02  Jim Meyering  <meyering@lucent.com>
10403
10404         * nanosleep.c (SIGCONT): Define if not already defined.
10405
10406 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10407
10408         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10409         per change in ../m4/ls-mntd-fs.m4.
10410         (read_filesystem_list): Ignore symbolic links.
10411
10412 2000-06-29  Jim Meyering  <meyering@lucent.com>
10413
10414         * same.c: Include <string.h> or <strings.h>, as appropriate,
10415         for declaration of strcmp.
10416
10417         * long-options.c: Include <stdlib.h>, for declaration of exit.
10418
10419         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10420         Avoid warning by casting result to `char *' to remove `const'.
10421
10422 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10423
10424         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10425
10426 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10427
10428         savedir now sets errno on failure and invokes xmalloc to get memory.
10429         Fix a couple of other minor bugs while we're at it.
10430
10431         * savedir.c (<unistd.h>): Do not include; there's no need.
10432         (NAMLEN): Remove macro.
10433         (malloc, realloc): Remove decls.
10434         (stpcpy): Likewise.
10435         ("xalloc.h"): Include.
10436         (NAME_SIZE_DEFAULT): New macro.
10437         (savedir): Use xmalloc / xrealloc to allocate memory.
10438         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10439         Skip "" directory entries.
10440         Use strlen to calculate directory entry length, since the old method
10441         is rarely used these days and isn't worth supporting.
10442         Don't use a pointer after freeing it.
10443         Check for integer overflow when calculating allocation size.
10444         Use memcpy to copy entries, instead of stpcpy.
10445         Set errno properly when returning NULL.
10446         Check for readdir error.
10447
10448 2000-06-26  Jim Meyering  <meyering@lucent.com>
10449
10450         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10451
10452 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10453
10454         * getusershell.c (xmalloc, xrealloc): Remove functions.
10455         Include xalloc.h.
10456         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10457
10458 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10459
10460         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10461
10462 2000-06-24  Jim Meyering  <meyering@lucent.com>
10463
10464         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10465
10466 2000-06-21  Jim Meyering  <meyering@lucent.com>
10467
10468         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10469
10470 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10471
10472         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10473         (mbrtowc, mbstate_t): Define substitutes if
10474         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10475         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10476         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10477
10478 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10479
10480         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10481         than 1024, return a memory chunk of least possible size, instead
10482         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10483         Use free/xmalloc instead of xrealloc to avoid copying for very long
10484         paths.
10485
10486 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10487
10488         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10489         address, not strdup.  Include <stdlib.h> and don't declare free().
10490
10491 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10492
10493         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10494         the empty string.
10495
10496 2000-06-21  Jim Meyering  <meyering@lucent.com>
10497
10498         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10499         (noinst_HEADERS): Add getstr.h.
10500
10501         * getline.c (getstr): Move into a separate file.
10502         * getstr.c (getstr): New file, extracted from getline.c, with
10503         the following changes: new parameter, delim2; both delim[12]
10504         parameters have type `int', not `char'.  The latter would lose
10505         with 8-bit delimiters.
10506         * getstr.h: New file.
10507
10508 2000-06-19  Jim Meyering  <meyering@lucent.com>
10509
10510         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10511
10512 2000-06-18  Jim Meyering  <meyering@lucent.com>
10513
10514         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10515         Besides, these days every porting target provides a mkdir function.
10516
10517         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10518         (this snippet comes from src/system.h).
10519
10520 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10521
10522         * human.c (adjust_value): New function.
10523         (human_readable_inexact): Apply rounding style even when
10524         printing approximate values.
10525
10526 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10527
10528         * human.c (human_readable_inexact): Allow an input block
10529         size that is not a multiple of the output block size, and vice versa.
10530         Reported by Piergiorgio Sartor.
10531
10532 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10533
10534         * getdate.y (get_date): Apply relative times after time
10535         zone indicator, not before.  Reported by Todd A. Jacobs.
10536
10537 2000-06-13  Jim Meyering  <meyering@lucent.com>
10538
10539         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10540
10541         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10542
10543 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10544
10545         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10546
10547 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10548
10549         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10550
10551 2000-06-04  Jim Meyering  <meyering@lucent.com>
10552
10553         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10554         SunOS 4.1.4 for which gid_t is an unsigned type.
10555
10556 2000-06-03  Jim Meyering  <meyering@lucent.com>
10557
10558         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10559
10560 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10561
10562         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10563         newer, don't install charset.alias.
10564         * config.charset: Change the Linux/glibc rules so they become empty
10565         on glibc-2.1 or newer.
10566
10567 2000-06-02  Jim Meyering  <meyering@lucent.com>
10568
10569         * mountlist.c: Back out last change.  Instead, do this...
10570         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10571         member using the same `ignore'-testing code.
10572         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10573         fs_type strings.
10574         From Mark D. Roth.
10575
10576 2000-05-29  Jim Meyering  <meyering@lucent.com>
10577
10578         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10579         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10580
10581 2000-05-22  Jim Meyering  <meyering@lucent.com>
10582
10583         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10584
10585 2000-05-18  Jim Meyering  <meyering@lucent.com>
10586
10587         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10588         back, too, since it may have been modified by allocate_entry.
10589         (hash_delete): Rewrite to use neither the assignment operator
10590         nor the comma operator in an if-expression.
10591
10592 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10593
10594         * closeout.c:
10595         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10596         Remove; no longer needed.
10597         "quotearg.h": Add include.
10598         (file_name): Do not bother to explicitly initialize to NULL; it's less
10599         efficient on some hosts.
10600         (close_stdout_status): Remove test as to whether stdout was already
10601         closed; it breaks for the case "echo x | sort >&-".
10602         Quote file name colons.
10603         Do not assume that _("write error") lacks format strings.
10604
10605 2000-05-15  Jim Meyering  <meyering@lucent.com>
10606
10607         * version-etc.c (version_etc_copyright): Update the copyright string
10608         used in all --version output.
10609
10610 2000-05-14  Jim Meyering  <meyering@lucent.com>
10611
10612         * closeout.c (close_stdout_set_file_name): New function.
10613         (close_stdout_status): Use new file-scoped global.
10614         Return right away if fstat says the stdout file descriptor is invalid.
10615         * closeout.h (close_stdout_set_file_name): Declare.
10616
10617 2000-05-10  Jim Meyering  <meyering@lucent.com>
10618
10619         * closeout.c [default_exit_status]: New file-scoped variable.
10620         (close_stdout_set_status): New function.
10621         * closeout.h (close_stdout_set_status): Declare.
10622
10623 2000-05-08  Jim Meyering  <meyering@lucent.com>
10624
10625         * long-options.c: Don't include closeout.h.
10626         (parse_long_options): Don't call close_stdout for --version.
10627
10628 2000-05-06  Jim Meyering  <meyering@lucent.com>
10629
10630         * strnlen.c: Undefine __strnlen and strnlen.
10631         [!weak_alias]: Define __strnlen to strnlen.
10632
10633         * atexit.c: New file, from libiberty.
10634
10635 2000-05-06  Jim Meyering  <meyering@lucent.com>
10636
10637         * closeout.c (close_stdout_status): Also check for errors on the
10638         stderr stream.
10639
10640 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10641
10642         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10643         instead of xmalloc, xrealloc, path_concat.
10644         (locale_charset): Treat empty environment variables as absent.
10645         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10646
10647 2000-05-04  Jim Meyering  <meyering@lucent.com>
10648
10649         * getopt.c: Update from glibc.
10650         * obstack.c: Likewise.
10651         * obstack.h: Likewise.
10652         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10653
10654         * regex.h: Likewise.
10655         * strndup.c: Likewise.
10656         * strnlen.c: New file, from glibc.
10657
10658 2000-05-01  Jim Meyering  <meyering@lucent.com>
10659
10660         * full-write.c (full_write): Remove `FIXME' part of comment.
10661
10662 2000-04-29  Jim Meyering  <meyering@lucent.com>
10663
10664         * path-concat.c: Declare strdup only if it's not defined.
10665         * canon-host.c: Likewise.
10666
10667 2000-04-28  Jim Meyering  <meyering@lucent.com>
10668
10669         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10670         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10671         included first, then limits.h is included by locale.h by libintl.h.
10672         From John David Anglin.
10673
10674 2000-04-25  Jim Meyering  <meyering@lucent.com>
10675
10676         * makepath.c (S_IRWXUGO): Define.
10677         (make_path): Always perform explicit chmod if MODE specifies any
10678         of the `special' permission bits.  Prompted by a bug report against
10679         install from Mate Wierdl and Joost van Baal.
10680
10681 2000-04-18  Jim Meyering  <meyering@lucent.com>
10682
10683         * README: New file.
10684
10685         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10686         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10687
10688 2000-04-17  Jim Meyering  <meyering@lucent.com>
10689
10690         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10691         the definition of it to rpl_strftime also defined-away the system's
10692         declaration.
10693
10694 2000-04-15  Jim Meyering  <meyering@lucent.com>
10695
10696         Use `C' to denote so-called `contiguous' files, the same way
10697         that tar does.
10698         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10699         (ftypelet): Use S_ISCTG.
10700         From Michael Deutschmann.
10701
10702 2000-04-14  Jim Meyering  <meyering@lucent.com>
10703
10704         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10705
10706 2000-04-08  Jim Meyering  <meyering@lucent.com>
10707
10708         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10709         names don't conflict.  Reported by Eli Zaretskii.
10710
10711 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10712
10713         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10714         bug.  Deal with the different error behavior of Irix iconv.
10715
10716 2000-04-07  Jim Meyering  <meyering@lucent.com>
10717
10718         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10719         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10720
10721 2000-04-05  Jim Meyering  <meyering@lucent.com>
10722
10723         Portability tweaks required for ultrix4.3.
10724         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10725         * readutmp.c: Include sys/types.h before sys/stat.h.
10726         * canon-host.c: Declare strdup.
10727         * path-concat.c: Likewise.
10728         From John David Anglin.
10729
10730 2000-04-04  Jim Meyering  <meyering@lucent.com>
10731
10732         Be more DOS 8.3-friendly.
10733         * ref-add.sin: Renamed from ref-add.sed.in.
10734         * ref-del.sin: Renamed from ref-del.sed.in.
10735         * Makefile.am: Reflect renaming.
10736         Reported by Eli Zaretskii.
10737
10738         Use a temporary file name that won't clash with `charset.alias'
10739         in the DOS 8.3 name space.
10740         * Makefile.am (charset_tmp): Define.
10741         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10742         (uninstall-local): Likewise.
10743         Reported by Eli Zaretskii.
10744
10745 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10746
10747         * time/strftime.c (my_strftime): Make sure we call the system
10748         strftime, not ourselves, when invoking the underlying strftime.
10749
10750 2000-03-24  Jim Meyering  <meyering@lucent.com>
10751
10752         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10753         (charset_alias): Define.
10754         (install-exec-local): Factor out common code.
10755         (uninstall-local): Split lines longer than 80.
10756         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10757         (SUFFIXES): Define.
10758         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10759         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10760
10761 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10762
10763         * config.charset: Output a line containing "Packages using this file".
10764         * ref-add.sed.in, ref-del.sed.in: New files.
10765         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10766         ref-del.sed): New rules.
10767
10768 2000-03-17  Jim Meyering  <meyering@lucent.com>
10769
10770         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10771         Otherwise, include <strings.h>
10772
10773 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10774
10775         * unicodeio.c (utf8_wctomb): New function.
10776         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10777         format instead of in UCS-4 with platform dependent endianness.
10778
10779 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10780
10781         * savedir.c (savedir): Work even if directory size is
10782         negative; this can happen with some screwy NFS configurations.
10783
10784 2000-03-06  Jim Meyering  <meyering@lucent.com>
10785
10786         * localcharset.c (get_charset_aliases): Don't try to free file_name
10787         if it's NULL (because we ran out of memory).  From Bruno Haible.
10788
10789 2000-03-05  Jim Meyering  <meyering@lucent.com>
10790
10791         * localcharset.c ("path-concat.h"): Include.
10792         (get_charset_aliases): Use path_concat instead of ANSI string
10793         concatenation.
10794
10795         * unicodeio.h (PARAMS): Define.
10796         Use it to guard prototype.
10797
10798 2000-03-04  Jim Meyering  <meyering@lucent.com>
10799
10800         * Makefile.am (install-exec-local): Create $(libdir) before installing
10801         into it.
10802         (uninstall-local): Uncomment this rule so `make distcheck' works
10803         once again.
10804
10805         * unicodeio.c (<errno.h>): Include it.
10806         (errno): Declare if not defined.
10807
10808         * localcharset.c: Add Bruno's comment justifying use of volatile.
10809
10810         * config.charset: New version, incorporating remarks from a linux
10811         i18n mailing list.  From Bruno Haible.
10812
10813 2000-03-02  Jim Meyering  <meyering@lucent.com>
10814
10815         * Makefile.am (EXTRA_DIST): Add config.charset.
10816
10817 2000-03-01  Jim Meyering  <meyering@lucent.com>
10818
10819         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10820         * unicodeio.c: Likewise.
10821
10822 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10823
10824         * config.charset: New file.
10825         * localcharset.c: New file.
10826         * unicodeio.h, unicodeio.c: New files.
10827         * Makefile.am (DEFS): Add -DLIBDIR=...
10828         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10829         (noinst_HEADERS): Add unicodeio.h.
10830         (all-local, install-exec-local, charset.alias): New targets.
10831
10832 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10833
10834         * quotearg.c (ALERT_CHAR): New macro.
10835         (quotearg_buffer_restyled): Use it.
10836
10837 2000-02-27  Jim Meyering  <meyering@lucent.com>
10838
10839         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10840         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10841
10842         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10843         not `#if STDC_HEADERS'.
10844         Declare malloc if needed.
10845
10846         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10847         now that autoconf always defines the HAVE_DECL_ symbols.
10848         * human.c: Likewise.
10849         * same.c: Likewise.
10850         * strtoumax.c: Likewise.
10851
10852         * backupfile.c: Arrange for cpp to fail if the configure-time
10853         declaration check was not run.
10854         * hash.c: Likewise.
10855         * human.c: Likewise.
10856         * same.c: Likewise.
10857         * strtoumax.c: Likewise.
10858
10859         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10860         then first look up the entire `.'-containing string as a login name.
10861
10862 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10863
10864         * getdate.y: Handle two-digit years with leading zeros correctly.
10865         (textint): New typedef.
10866         (parser_control): Member year changed from int to textint.
10867         All uses changed.
10868         (YYSTYPE): Removed; replaced by %union with int and textint members.
10869         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10870         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10871         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10872         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10873         (date, number, to_year): Use width of number in digits, not its value,
10874         to determine whether it's a 2-digit year, or a 2-digit time.
10875         (yylex): Store number of digits of numeric tokens.
10876         Reported by John Kendall.
10877
10878         (parser_control): Changed from struct parser_control to typedef (for
10879         consistency).  All uses changed.
10880
10881         (tID): Removed; not used.
10882         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10883
10884 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10885
10886         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10887         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10888
10889 2000-02-12  Jim Meyering  <meyering@lucent.com>
10890
10891         * userspec.c (ISDIGIT): Define it.
10892         (isdigit): Remove definition.
10893         (is_number): Use ISDIGIT, not isdigit.
10894         <libintl.h>: Include.
10895         (_ and N_): Define.
10896         (parse_user_spec): Mark translatable strings.
10897
10898 2000-02-10  Jim Meyering  <meyering@lucent.com>
10899
10900         With these changes, nanosleep.[ch] are finally enough like the other
10901         lib/* replacement files to compile on a few more losing systems.
10902
10903         * nanosleep.h: Don't include config.h.
10904         Remove prototype from declaration of nanosleep.
10905         (PARAMS): Remove now-unneeded definition.
10906         * nanosleep.c: #undef nanosleep.
10907         (rpl_nanosleep): Rename from nanosleep.
10908
10909 2000-02-03  Jim Meyering  <meyering@lucent.com>
10910
10911         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10912         rather than with `#if HAVE_UTMPNAME'.
10913
10914 2000-02-01  Jim Meyering  <meyering@lucent.com>
10915
10916         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10917
10918 2000-01-31  Jim Meyering  <meyering@lucent.com>
10919
10920         * nanosleep.h (nanosleep): Guard declaration with
10921         `#if ! HAVE_DECL_NANOSLEEP'.
10922         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10923         the declaration in that vendor's sys/timers.h.
10924         Reported by Christian Krackowizer.
10925
10926         * quotearg.c (ISASCII): Add #undef and move definition to follow
10927         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10928         (ISPRINT): Likewise.
10929         Reported by Tom Tromey.
10930
10931 2000-01-30  Jim Meyering  <meyering@lucent.com>
10932
10933         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10934         uses of ->ut_name.  The latter doesn't work with new Linux header files
10935         where only utmpx.ut_user is declared.
10936
10937         * readutmp.h (UT_USER): Define.
10938
10939 2000-01-23  Jim Meyering  <meyering@lucent.com>
10940
10941         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10942         obstack.c.
10943
10944 2000-01-22  Jim Meyering  <meyering@lucent.com>
10945
10946         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10947         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10948         Required for some AIX systems.  Reported by Christian Krackowizer.
10949         [TESTING] (main): New function.
10950
10951         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10952         * dirname.c (dir_name): Support for DOS-style file names with drive
10953         letters.
10954
10955         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10956
10957         * strverscmp.c (ISDIGIT): Define.
10958         (strverscmp): Use ISDIGIT, not isdigit.
10959
10960 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10961
10962         * nanosleep.c (nanosleep):
10963         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10964         POSIX.1 doesn't require SA_INTERRUPT and some systems
10965         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10966         it's been part of POSIX.1 since day 1 (in 1988).
10967
10968 2000-01-17  Jim Meyering  <meyering@lucent.com>
10969
10970         * interlock: Remove unused file.  Reported by François Pinard.
10971
10972 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10973
10974         * quotearg.c (quotearg_buffer_restyled): Do not quote
10975         alert, backslash, formfeed, and vertical tab unnecessarily in
10976         shell quoting style.
10977
10978
10979 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10980 Free Software Foundation, Inc.
10981 Copying and distribution of this file, with or without modification,
10982 are permitted provided the copyright notice and this notice are preserved.