Ensure temp file is closed before its directory is removed.
[pspp] / lib / ChangeLog
1 2006-10-06  Bruno Haible  <bruno@clisp.org>
2
3         * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
4         instead of fopen, fwriteerror.
5
6 2006-10-05  Bruno Haible  <bruno@clisp.org>
7
8         * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
9         fwriteerror_temp): New declarations.
10         * clean-temp.c (uintptr_t): Provide fallback definition.
11         (descriptors): New variable.
12         (cleanup): First, close the descriptors.
13         (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
14         fclose_temp, fwriteerror_temp): New functions.
15
16 2006-10-03  Bruno Haible
17
18         * gl_list.h (gl_sortedlist_search_from_to,
19         gl_sortedlist_indexof_from_to): New declarations.
20         (gl_list_implementation): New fields sortedlist_search_from_to,
21         sortedlist_indexof_from_to.
22         (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
23         inline functions.
24         * gl_list.c (gl_sortedlist_search_from_to,
25         gl_sortedlist_indexof_from_to): New functions.
26         * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
27         (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
28         (gl_array_sortedlist_search_from_to): New function.
29         (gl_array_list_implementation): Update.
30         * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
31         (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
32         (gl_carray_sortedlist_search_from_to): New function.
33         (gl_carray_list_implementation): Update.
34         * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
35         gl_linked_sortedlist_indexof_from_to): New functions.
36         * gl_linked_list.c (gl_linked_list_implementation): Update.
37         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
38         * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
39         gl_tree_sortedlist_indexof_from_to): New functions.
40         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
41         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
42         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
43         * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
44
45 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
46
47         Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
48         <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
49         * dirchownmod.c: Include lchown.h.
50         * lchown.c: Don't include files that lchown.h now includes.
51         Don't declare chown, since lchown.h now does that.
52         * lchown.h: Include errno.h, sys/types.h, unistd.h.
53         (lchown): Define to rpl_chown if lchown is declared but
54         does not exist.  Declare using a prototype if lchown is not
55         declared.  Add a copyright notice.
56         * mkstemp.h: Include <unistd.h>.
57         * openat.c: Include lchown.h.
58
59         * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
60         we now test for that separately.
61         * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
62         rather than O_NOFOLLOW, when testing whether it's possible to
63         avoid a race condition reliably.
64         * savewd.c (savewd_chdir): Likewise.
65
66         Remove macros that are no longer needed now that stdint.h is
67         reliable.
68         * fsusage.c (UINTMAX_MAX): Remove.
69         * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
70         * utimecmp.c (SIZE_MAX): Remove.
71
72 2006-10-03  Bruno Haible  <bruno@clisp.org>
73
74         * gl_list.h (gl_list_search_from, gl_list_search_from_to,
75         gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
76         (struct gl_list_implementation): Add fields search_from_to,
77         indexof_from_to. Remove fields search, indexof.
78         (gl_list_search): Use the search_from_to method.
79         (gl_list_search_from, gl_list_search_from_to): New functions.
80         (gl_list_indexof): Use the indexof_from_to method.
81         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
82         * gl_list.c (gl_list_search): Use the search_from_to method.
83         (gl_list_search_from, gl_list_search_from_to): New functions.
84         (gl_list_indexof): Use the indexof_from_to method.
85         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
86         * gl_array_list.c (gl_array_indexof_from_to): Renamed from
87         gl_array_indexof. Add start_index, end_index arguments.
88         (gl_array_search_from_to): Renamed from gl_array_search. Add
89         start_index, end_index arguments.
90         (gl_array_remove, gl_array_list_implementation): Update.
91         * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
92         gl_carray_indexof. Add start_index, end_index arguments.
93         (gl_carray_search_from_to): Renamed from gl_carray_search. Add
94         start_index, end_index arguments.
95         (gl_carray_remove, gl_carray_list_implementation): Update.
96         * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
97         gl_linked_search. Add start_index, end_index arguments.
98         (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
99         start_index, end_index arguments.
100         (gl_linked_remove): Update.
101         * gl_linked_list.c (gl_linked_list_implementation): Update.
102         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
103         * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
104         to 'size_t'.
105         * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
106         gl_tree_search. Add start_index, end_index arguments.
107         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
108         start_index, end_index arguments.
109         (gl_tree_remove): Update.
110         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
111         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
112         * gl_anytreehash_list1.h (compare_position_threshold): New function.
113         * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
114         gl_tree_search. Add start_index, end_index arguments.
115         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
116         start_index, end_index arguments.
117         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
118         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
119
120 2006-10-04  Bruno Haible  <bruno@clisp.org>
121
122         * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
123
124 2006-10-03  Bruno Haible  <bruno@clisp.org>
125
126         * gl_oset.h (gl_setelement_threshold_fn): New type.
127         (gl_oset_search_atleast): New declaration.
128         (struct gl_oset_implementation): Add field 'search_atleast'.
129         (gl_oset_search_atleast): New inline function.
130         * gl_oset.c (gl_oset_search_atleast): New function.
131         * gl_array_oset.c (gl_array_search_atleast): New function.
132         (gl_array_oset_implementation): Update.
133         * gl_anytree_oset.h (gl_tree_search_atleast): New function.
134         * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
135         * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
136
137 2006-10-04  Jim Meyering  <jim@meyering.net>
138
139         * fts.c (fts_open): Tiny comment change.
140
141 2006-10-03  Bruno Haible  <bruno@clisp.org>
142
143         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
144         from gl_avltreehash_list_implementation.
145
146 2006-10-03  Bruno Haible  <bruno@clisp.org>
147
148         * gl_oset.c (gl_oset_add): Fix return type.
149
150 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
151
152         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
153
154 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
155
156         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
157
158 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
159
160         Work around bug in Solaris 10 /proc file system:
161         /proc/self/fd/NNN/.. isn't the parent directory of
162         the directory whose file descriptor is NNN.  This needs to
163         be worked around at run time, not compile time, since a
164         program might be built on Solaris 8, where things work, and
165         run on Solaris 10.
166         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
167         to use the following interface instead:
168         (OPENAT_BUFFER_SIZE): New macro.
169         (openat_proc_name): New function.
170         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
171         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
172         Likewise.
173         * openat-proc.c: New file.
174
175 2006-09-29  Bruno Haible  <bruno@clisp.org>
176
177         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
178         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
179         argument. Set stdout_closed before testing for ferror, not after.
180         (fwriteerror, fwriteerror_no_ebadf): New functions.
181
182 2006-09-28  Bruno Haible  <bruno@clisp.org>
183
184         * strndup.h: Simplify the redefinition of strndup.
185         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
186
187 2006-09-28  Bruno Haible  <bruno@clisp.org>
188
189         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
190         * gl_linkedhash_list.c: Likewise.
191         * gl_rbtreehash_list.c: Likewise.
192
193 2006-09-28  Jim Meyering  <jim@meyering.net>
194
195         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
196         Include <unistd.h>.
197
198 2006-09-27  Jim Meyering  <jim@meyering.net>
199
200         This file could end up with a definition for a function
201         named __strndup, rather than rpl_strndup on a system with
202         incomplete weak_alias support.
203         * strndup.c (strndup): Rename from __strndup.
204         Remove #defines that used to map __strndup to strndup.
205         Don't use K&R prototypes.
206         Remove LIBC-related code, since this file is not sync'd with glibc.
207         * strndup.h: Revamp, accordingly.
208
209 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
210
211         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
212         getaddrinfo.
213
214         * __fpending.h: Don't include <stdio_ext.h> unless
215         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
216         it causes <stdio_ext.h> to cause a compile-time error.
217         Problem reported by Nelson H. F. Beebe.
218         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
219         of HAVE_DECL___PENDING.
220
221 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
222
223         * savewd.c: Include <signal.h>, for 'raise'.
224
225 2006-09-26  Eric Blake  <ebb9@byu.net>
226
227         * verror.c: Include <config.h> unconditionally.
228
229 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
230
231         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
232         (gl_linked_iterator_from_to): Initialize struct completely.
233         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
234         (gl_tree_iterator_from_to): Likewise
235         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
236         * gl_array_list.c [lint] (gl_array_iterator)
237         (gl_array_iterator_from_to): Likewise.
238         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
239         * gl_carray_list.c [lint] (gl_carray_iterator)
240         (gl_carray_iterator_from_to): Likewise.
241
242         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
243         * md4.c (md4_process_block): Remove unused variable.
244         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
245         parentheses for clarity.
246
247 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
248
249         Import this patch from libc:
250
251         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
252
253         * regex_internal.c (re_string_reconstruct): Handle
254         offset < pstr->valid_raw_len && pstr->offsets_needed case.
255         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
256         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
257         re_string_context_at.
258
259 2006-09-20  Bruno Haible  <bruno@clisp.org>
260
261         * mkdtemp.c: Import from libc.
262         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
263                 * sysdeps/posix/tempname.c (__gen_tempname): Change
264                 attempts_min into a macro.  Use preprocessor to decide how to
265                 initialize attempts [Coverity CID 67].
266         2001-11-27  Paul Eggert  <eggert@twinsun.com>
267                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
268                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
269
270 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
271
272         * mkstemp.h: New file, since some standard headers
273         #define mkstemp.
274         * mkstemp.c: Revamp to put the !_LIBC code together.
275         Include "mkstemp.h".
276         Make the _LIBC code resemble glibc original more,
277         e.g., use K&R style.
278         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
279         (mkstemp): Remove, since mkstemp.h does this for us.
280         * stdlib--.h: Include mkstemp.h.
281
282         Import this patch from libc:
283
284         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
285
286         * tempname.c (__gen_tempname): Change attempts_min
287         into a macro.  Use preprocessor to decide how to initialize
288         attempts [Coverity CID 67].
289
290 2006-09-18  Bruno Haible  <bruno@clisp.org>
291
292         * javaversion.c: Include configmake.h.
293
294 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
295
296         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
297         that prevented coreutils 6.1 from building.  Problem reported
298         by Petter Reinholdtsen.
299
300 2006-09-18  Jim Meyering  <jim@meyering.net>
301
302         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
303
304 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
305
306         * dirchownmod.c: Don't include fcntl.h; no longer needed.
307         (dirchownmod): New arg FD.  All callers changed.
308         Use FD rather than opening the directory ourself, as opening is
309         now the caller's responsibility.
310         * dirchownmod.h: Likewise.
311         * mkancesdirs.c: Include <sys/types.h>, for portability to older
312         hosts that require <sys/types.h> before <sys/stat.h>.  Include
313         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
314         (test_dir): Remove.
315         (mkancesdirs): Return length of prefix of FILE that has already
316         been made, or -2 if there is a child doing the work.  Redo
317         algorithm so that it is O(N) rather than O(N**2).  Optimize away
318         ".", and treat ".." specially since it might stray back into
319         already-created areas.  Use a subprocess if necessary.  New arg
320         WD; all users changed.  MAKE_DIR function should now return 1
321         if it creates a directory that is not readable.  Return -2 if
322         a child process is spun off.
323         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
324         Adjust signature to match code.
325         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
326         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
327         all users changed.
328         * savewd.c, savewd.h: New files.
329
330 2006-09-15  Jim Meyering  <jim@meyering.net>
331
332         * rename-dest-slash.c (has_trailing_slash): Use
333         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
334         (rpl_rename_dest_slash): Perform the cheaper trailing slash
335         test before testing whether SRC is a directory.
336         Suggestions from Bruno Haible.
337
338         Avoid a warning about an unused variable.
339         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
340         into the #ifdef block where it's used.
341
342         * rename-dest-slash.c: New file.
343
344 2006-09-14  Bruno Haible  <bruno@clisp.org>
345
346         * allocsa.c: Include <config.h> unconditionally.
347         * asnprintf.c: Likewise.
348         * asprintf.c: Likewise.
349         * c-strcasecmp.c: Likewise.
350         * c-strcasestr.c: Likewise.
351         * c-strncasecmp.c: Likewise.
352         * c-strstr.c: Likewise.
353         * classpath.c: Likewise.
354         * clean-temp.c: Likewise.
355         * concatpath.c: Likewise.
356         * copy-file.c: Likewise.
357         * csharpcomp.c: Likewise.
358         * csharpexec.c: Likewise.
359         * execute.c: Likewise.
360         * fatal-signal.c: Likewise.
361         * findprog.c: Likewise.
362         * fwriteerror.c: Likewise.
363         * gl_array_list.c: Likewise.
364         * gl_array_oset.c: Likewise.
365         * gl_avltree_list.c: Likewise.
366         * gl_avltree_oset.c: Likewise.
367         * gl_avltreehash_list.c: Likewise.
368         * gl_carray_list.c: Likewise.
369         * gl_linked_list.c: Likewise.
370         * gl_linkedhash_list.c: Likewise.
371         * gl_list.c: Likewise.
372         * gl_oset.c: Likewise.
373         * gl_rbtree_list.c: Likewise.
374         * gl_rbtree_oset.c: Likewise.
375         * gl_rbtreehash_list.c: Likewise.
376         * imaxabs.c: Likewise.
377         * imaxdiv.c: Likewise.
378         * javacomp.c: Likewise.
379         * javaexec.c: Likewise.
380         * javaversion.c: Likewise.
381         * linebreak.c: Likewise.
382         * localcharset.c: Likewise.
383         * lock.c: Likewise.
384         * mbchar.c: Likewise.
385         * mbswidth.c: Likewise.
386         * mkdtemp.c: Likewise.
387         * pipe.c: Likewise.
388         * printf-args.c: Likewise.
389         * printf-parse.c: Likewise.
390         * progname.c: Likewise.
391         * progreloc.c: Likewise.
392         * readlink.c: Likewise.
393         * sh-quote.c: Likewise.
394         * stpcpy.c: Likewise.
395         * stpncpy.c: Likewise.
396         * strcasecmp.c: Likewise.
397         * strcasestr.c: Likewise.
398         * strcspn.c: Likewise.
399         * striconv.c: Likewise.
400         * strncasecmp.c: Likewise.
401         * strnlen1.c: Likewise.
402         * strstr.c: Likewise.
403         * strtok_r.c: Likewise.
404         * tls.c: Likewise.
405         * tmpdir.c: Likewise.
406         * unicodeio.c: Likewise.
407         * unsetenv.c: Likewise.
408         * vasnprintf.c: Likewise.
409         * vasprintf.c: Likewise.
410         * wait-process.c: Likewise.
411         * xallocsa.c: Likewise.
412         * xsetenv.c: Likewise.
413         * xstriconv.c: Likewise.
414
415 2006-09-13  Eric Blake  <ebb9@byu.net>
416
417         * getopt.c: Fix typo in last commit.
418
419 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
420
421         * _fpending.c: Include <config.h> unconditionally, since we no
422         longer worry about uses that don't define HAVE_CONFIG_H.
423         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
424         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
425         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
426         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
427         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
428         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
429         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
430         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
431         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
432         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
433         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
434         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
435         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
436         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
437         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
438         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
439         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
440         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
441         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
442         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
443         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
444         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
445         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
446         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
447         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
448         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
449         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
450         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
451         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
452         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
453         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
454         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
455         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
456         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
457         Likewise.
458
459 2006-09-12  Jim Meyering  <jim@meyering.net>
460
461         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
462         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
463         Reported by Nelson H. F. Beebe.
464
465 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
466
467         * argp-help.c (argp_doc): Make sure NULL is not passed to
468         dgettext.
469
470 2006-09-10  Bruno Haible  <bruno@clisp.org>
471
472         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
473
474 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
475
476         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
477         program_invocation_name and program_invocation_short_name are
478         initialized.
479         * argp-namefrob.h: Move declarations of program_invocation_name
480         and program_invocation_short_name to argp.h, so they are visible
481         to user programs.
482         * argp.h: Likewise
483
484 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
485
486         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
487         convention.  Text proposed by Bruno Haible.
488         (struct argp_option): Document the use of N_() wrappers.
489
490         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
491         and translate the two parts separately, instead of feeding
492         the whole string to gettext.  This allows to exclude
493         '\v' from the strings visible to the translator by writing doc
494         strings as N_("..") "\v" N_("..").
495
496 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
497
498         * mktime.c (guess_time_tm): Fix bug where mktime
499         returned the maximum time_t value rather than (time_t) -1.
500         Problem originally reported by William Bardwell
501         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
502
503         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
504         Moved to here ...
505         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
506         ... from here.
507
508 2006-09-06  Bruno Haible  <bruno@clisp.org>
509
510         * striconv.h: New file.
511         * striconv.c: New file, merging iconvme.c with GNU gettext's
512         iconvstring.c.
513         * xstriconv.h: New file.
514         * xstriconv.c: New file.
515
516 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
517
518         * argz_.h: Sync from Libtool.
519
520         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
521                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
522
523         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
524
525 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
526
527         * trim.h: New file.
528         * trim.c: New file.
529
530 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
531
532         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
533         Problem reported by Ralf Wildenhues in
534         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
535
536         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
537         HAVE_STRUCT_STATFS_F_FSTYPENAME.
538
539 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
540
541         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
542         or stdbool.h, because they might not exist while configuring.
543
544         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
545         Don't include unistd.h or limits.h; not needed, since chdir-long.h
546         does that for us.
547         (O_DIRECTORY): Remove.
548
549 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
550
551         Work around a bug in both the Linux and SunOS 64-bit kernels:
552         nanosleep mishandles sleeps for longer than 2**31 seconds.
553         Problem reported by Frank v Waveren in
554         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
555         * nanosleep.c (BILLION): New constant.
556         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
557         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
558
559 2006-08-30  Jim Meyering  <jim@meyering.net>
560
561         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
562         the parameter.
563
564 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
565
566         * isapipe.c, isapipe.h: New files.
567
568 2006-08-29  Eric Blake  <ebb9@byu.net>
569
570         * error.c (error_at_line, print_errno_message): Match libc, after
571         resolution of upstream bug 3044.
572
573 2006-08-29  Bruno Haible  <bruno@clisp.org>
574
575         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
576
577 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
578
579         Sync from Libtool:
580
581         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
582
583         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
584         sharing with gnulib.  Report by Eric Blake.
585
586 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
587
588         * fcntl_.h: New file.
589         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
590         the fcntl module.
591         * dirchownmod.c: Likewise.
592         * fts.c: Likewise.
593
594         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
595         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
596         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
597         just before including <inttypes.h>, to avoid circular inclusion.
598
599 2006-08-28  Bruno Haible  <bruno@clisp.org>
600
601         * inttypes_.h (SCNX*): Remove definitions.
602         Reported by Eric Blake.
603
604 2006-08-26  Bruno Haible  <bruno@clisp.org>
605
606         * vasnprintf.c (EOVERFLOW): Remove definition.
607         (VASNPRINTF): Return a string of length > INT_MAX without failing.
608         * vasprintf.c: Include errno.h, limits.h.
609         (EOVERFLOW): New fallback definition.
610         (vasprintf): Test here whether the string length is > INT_MAX.
611         * vsnprintf.c: Include errno.h, limits.h.
612         (EOVERFLOW): New fallback definition.
613         (vsnprintf): Fix bug when generated string was too long for the buffer.
614         Test here whether the string length is > INT_MAX.
615
616 2006-08-26  Bruno Haible  <bruno@clisp.org>
617             Simon Josefsson  <jas@extundo.com>
618
619         BeOS portability.
620         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
621
622 2006-08-28  Bruno Haible  <bruno@clisp.org>
623
624         * c-strstr.h: New file, from GNU gettext.
625         * c-strstr.c: New file, from GNU gettext.
626
627 2006-08-26  Bruno Haible  <bruno@clisp.org>
628
629         * inttypes_.h: New file.
630         * inttypes.h: Remove file.
631         * stdint_.h: Include <inttypes.h> through its absolute filename.
632
633         * imaxabs.c: New file.
634
635         * imaxdiv.c: New file.
636
637 2006-08-22  Bruno Haible  <bruno@clisp.org>
638
639         * readutmp.h: Skip most definitions if neither <utmp.h> nor
640         <utmpx.h> exists.
641
642 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
643
644         BeOS portability.
645         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
646         Problem reported by Bruno Haible.
647
648 2006-08-21  Bruno Haible  <bruno@clisp.org>
649
650         BeOS portability.
651         * mbchar.h: Include <wctype.h> only if it exists.
652
653 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
654
655         * cycle-check.h: Include <stdint.h> unconditionally, since we
656         now assume the stdint module.  Do not include inttypes.h.
657         * fsusage.h: Likewise.
658         * getndelim2.c: Likewise.
659         * human.h: Likewise.
660         * inttostr.h: Likewise.
661         * obstack.c: Likewise.
662         * regex_internal.h: Likewise.
663         * tempname.c: Likewise.
664         * utimecmp.c: Likewise.
665         * xstrtol.h: Likewise.
666
667         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
668
669         * strtoimax.c: Adjust to macro name changes in Autoconf,
670         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
671         * xtime.h: Likewise.
672
673 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
674
675         * fchmodat.c: New file, from coreutils.  This was inadvertently
676         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
677
678 2006-08-18  Bruno Haible  <bruno@clisp.org>
679
680         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
681         (ME_DUMMY): Treat "kernfs" as a dummy.
682         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
683
684 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
685
686         Update from coreutils.
687
688         * __fpending.h: Add copyright notice.
689         * fprintftime.h: Likewise.
690         * savedir.c: Use (C) in copyright notice.
691         * savedir.h: Likewise.
692
693         2006-08-15  Jim Meyering  <jim@meyering.net>
694
695         * at-func.c: New file, with the logic of all emulated at-functions.
696         * openat-priv.h: Include <errno.h> and define ENOSYS,
697         in support of the EXPECTED_ERRNO macro.
698         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
699         Instead, define the appropriate symbols and include "at-func.c".
700         * mkdirat.c (mkdirat): Likewise.
701         * fchmodat.c (fchmodat): Likewise.
702         (ENOSYS): Remove definition.
703         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
704         Don't include "unistd--.h" -- it wasn't ever used.
705
706         2006-01-17  Jim Meyering  <jim@meyering.net>
707
708         Rewrite fts.c not to change the current working directory,
709         by using openat, fstatat, fdopendir, etc..
710
711         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
712         (HAVE_OPENAT_SUPPORT): Define.
713         [_LIBC] (fchdir): Don't undef or define; no longer used.
714         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
715         Now, this `function' always succeeds, and consumes its file descriptor
716         parameter -- so callers must not close such FDs.  Update callers.
717         (diropen_fd, opendirat, cwd_advance_fd): New functions.
718         (diropen): Add parameter, SP.  Adjust all callers.
719         Implement using diropen_fd, rather than open.
720         (fts_open): Initialize new member, fts_cwd_fd.
721         Remove fts_rft-setting code.
722         (fts_close): Close fts_cwd_fd, if necessary.
723         (__opendir2): Define in terms of opendir or opendirat,
724         depending on whether the FST_NOCHDIR flag is set.
725         (fts_build): Since fts_safe_changedir consumes its FD, and since
726         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
727         and close the dup'd file descriptor upon failure.
728         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
729         (fts_safe_changedir): Tweak semantics to reflect that this function
730         now calls cwd_advance_fd and hence consumes its FD argument.
731         * fts_.h [struct FTS] (fts_cwd_fd): New member.
732         [struct FTS] (fts_rft): Remove now-unused member.
733         [struct FTS] (fts_cycle.state): Improve comment.
734
735         * openat.c (openat_needs_fchdir): New function.
736         * openat.h (openat_needs_fchdir): Declare it.
737
738 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
739
740         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
741         Problem and fix reported by Pádraig Brady in
742         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
743
744 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
745
746         * memcoll.c (memcoll): Optimize for the common case where the
747         arguments are bytewise equal.
748
749 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
750
751         Change copyright notice from LGPL 2 to GPL 2, since that's the
752         standard form used in the gnulib repository.
753         * lock.c: LGPL -> GPL.
754         * lock.h: Likewise.
755         * strnlen1.c: Likewise.
756         * strnlen1.h: Likewise.
757         * tls.c: Likewise.
758         * tls.h: Likewise.
759         * tmpdir.c: Likewise.
760
761         * TODO: Remove; this belongs only in coreutils.
762
763 2006-08-14  Eric Blake  <ebb9@byu.net>
764
765         Import the following change from libc:
766
767         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
768
769         Upstream bug 2997.
770         * misc/error.c: Add space between program name and message if file
771         name is missing.
772
773 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
774
775         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
776         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
777
778         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
779         in wchar_t.  Problem reported by Eric Blake.
780
781         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
782         LEN is smaller than SIZE.  Suggested by Bruno Haible.
783         Also, help the compiler to keep LEN in a register.
784
785 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
786
787         * .cppi-disable: Add snprintf.h, socket_.h.
788         * snprintf.c: Include <errno.h> and <limits.h>.
789         (EOVERFLOW): Define if the system does not.
790         Do not include "minmax.h"; it wasn't used.
791         (snprintf): Don't assume size_t promotes to an unsigned type.
792         Fix bug when generated string was too long for the buffer: the
793         buffer's contents are supposed to be the initial prefix of the
794         output.  Don't assume vasnprintf returns EOVERFLOW if the size
795         exceeds INT_MAX; do the check ourselves.
796
797         Import the following changes from libc:
798
799         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
800
801         * posix/regex_internal.c (re_string_skip_chars): If no character has
802         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
803         to the byte which couldn't be converted.
804         (re_string_reconstruct): Don't clear valid_raw_len before calling
805         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
806         tip_context using re_string_context_at.
807
808         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
809
810         * posix/regex.h: g++ still cannot handled [restrict].
811
812         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
813
814         * posix/regex.h: Remove special handling for VMS.
815
816 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
817
818         Sync from coreutils.
819
820         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
821
822         * mountlist.c [ME_REMOTE]: Filter out cifs.
823         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
824
825 2006-08-08  Eric Blake  <ebb9@byu.net>
826
827         * verror.c (verror_at_line): Work around glibc bug 2997, so that
828         verror_at_line output complies with GNU Coding Standards even when
829         file is NULL.
830
831 2006-08-08  Eric Blake  <ebb9@byu.net>
832
833         * verror.h, verror.c: New files.
834
835 2006-08-07  Bruno Haible  <bruno@clisp.org>
836
837         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
838         versions of AIX.
839         Reported by Ralf Wildenhues.
840
841 2006-08-06  Eric Blake  <ebb9@byu.net>
842
843         * error.h: Fold in some upstream changes from glibc.
844         * error.c: Likewise.
845
846 2006-07-29  Bruno Haible  <bruno@clisp.org>
847
848         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
849
850 2006-07-29  Bruno Haible  <bruno@clisp.org>
851
852         * setenv.c: Undo unintended modification done on 2006-02-27.
853
854 2006-07-28  Eric Blake  <ebb9@byu.net>
855
856         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
857         macro expansion.
858
859 2006-07-28  Simon Josefsson  <jas@extundo.com>
860
861         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
862         #include's.
863
864 2006-07-28  Simon Josefsson  <jas@extundo.com>
865
866         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
867         #include's.
868
869 2006-07-28  Bruno Haible <bruno@clisp.org>
870
871         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
872
873 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
874
875         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
876         arpa/inet.h.
877
878 2006-07-28  Bruno Haible  <bruno@clisp.org>
879
880         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
881         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
882         fallbacks.
883         Avoids link error on FreeBSD 4.x.
884         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
885
886         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
887         encoding.
888         * mbswidth.c (iswcntrl): Likewise.
889
890 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
891
892         * modechange.c (mode_compile): Numeric modes now affect setuid and
893         setgid on directories only if they set these bits.
894         * modechange.h: Remove obsolete comment about masks.
895
896 2006-07-27  Bruno Haible  <bruno@clisp.org>
897
898         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
899         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
900         defined.
901
902 2006-07-26  Eric Blake  <ebb9@byu.net>
903
904         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
905         like mingw that lack mkstemp.
906         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
907         avoid compilation warning on mingw.
908
909 2006-07-25  Bruno Haible  <bruno@clisp.org>
910
911         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
912         <stdarg.h> or config.h.
913
914 2006-07-24  Bruno Haible  <bruno@clisp.org>
915
916         * clean-temp.h: New file, from GNU gettext.
917         * clean-temp.c: New file, from GNU gettext.
918
919 2006-07-24  Bruno Haible  <bruno@clisp.org>
920
921         * tmpdir.h: New file, from GNU gettext.
922         * tmpdir.c: New file, from GNU gettext.
923
924 2006-07-23  Bruno Haible  <bruno@clisp.org>
925
926         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
927         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
928         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
929         gl_linked_remove_at): Use it.
930
931 2006-07-23  Eric Blake  <ebb9@byu.net>
932
933         * tmpfile-safer.c: New file.
934         * stdio-safer.h (fopen_safer): Add prototype.
935         * stdio--.h (tmpfile): Make safer.
936
937 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
938
939         * close-stream.c, close-stream.h: New files.
940
941 2006-07-22  Bruno Haible  <bruno@clisp.org>
942
943         Merge from GNU gettext 0.15.
944
945         2005-07-05  Bruno Haible  <bruno@clisp.org>
946
947                 * printf-args.c (printf_fetchargs): Work around broken
948                 definition of wint_t on mingw.
949
950         2005-02-12  Bruno Haible  <bruno@clisp.org>
951
952                 * xallocsa.h: Add extern "C" for C++.
953
954         2006-05-17  Bruno Haible  <bruno@clisp.org>
955
956                 Cygwin portability.
957                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
958
959         2006-04-30  Bruno Haible  <bruno@clisp.org>
960
961                 * progreloc.c: Include <mach-o/dyld.h> if available.
962                 (find_executable): Use _NSGetExecutablePath when possible.
963
964         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
965
966                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
967                 function.
968
969         2005-12-29  Bruno Haible  <bruno@clisp.org>
970
971                 * progreloc.c (set_program_name_and_installdir): Fix
972                 compilation error.
973
974         2005-12-04  Bruno Haible  <bruno@clisp.org>
975
976                 Cygwin portability.
977                 * progreloc.c: Include <windows.h> also on Cygwin.
978                 (find_executable): Add support for Cygwin.
979                 (set_program_name_and_installdir): Handle also platforms with
980                 nonempty EXEEXT.
981
982         2006-07-11  Bruno Haible  <bruno@clisp.org>
983
984                 * javacomp.c: Fix a comment.
985                 Reported by Jim Meyering.
986
987         2006-04-30  Bruno Haible  <bruno@clisp.org>
988
989                 * javacomp.h (compile_java_class): Add source_version,
990                 target_version arguments.
991                 * javacomp.c: Rewritten to choose only a compiler that
992                 respects the specified source_version and target_version.
993
994         2006-06-27  Bruno Haible  <bruno@clisp.org>
995
996                 Assume correct S_ISDIR macro.
997                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
998
999         2006-07-22  Bruno Haible  <bruno@clisp.org>
1000
1001                 * javaversion.h: New file, from GNU gettext.
1002                 * javaversion.c: New file, from GNU gettext.
1003                 * javaversion.java: New file, from GNU gettext.
1004                 * javaversion.class: New file, from GNU gettext.
1005
1006         2006-05-17  Bruno Haible  <bruno@clisp.org>
1007
1008                 Cygwin portability.
1009                 * javaexec.c (execute_java_class): Test for jview program
1010                 also on Cygwin.
1011
1012         2006-04-09  Bruno Haible  <bruno@clisp.org>
1013
1014                 * fatal-signal.c: Don't include string.h.
1015                 (at_fatal_signal): Use a copying loop instead of memcpy.
1016
1017         2005-12-04  Bruno Haible  <bruno@clisp.org>
1018
1019                 * csharpexec.c: Add support for 'clix' launcher (untested).
1020                 (execute_csharp_using_sscli): New function.
1021                 (execute_csharp_program): Call it.
1022
1023         2006-06-21  Bruno Haible  <bruno@clisp.org>
1024
1025                 Avoid warnings from recent versions of mcs.
1026                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1027                 -o, -L, -r any more. Use options documented since mcs-1.0
1028                 instead. Similarly for -g.
1029
1030         2005-07-09  Bruno Haible  <bruno@clisp.org>
1031
1032                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1033                 add a .dll suffix.
1034                 Reported by Mark Junker <mjscod@gmx.de>.
1035
1036         2006-06-17  Bruno Haible  <bruno@clisp.org>
1037
1038                 * config.charset: Update for NetBSD 3.0.
1039
1040         2006-05-17  Bruno Haible  <bruno@clisp.org>
1041
1042                 Cygwin portability.
1043                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1044
1045         2006-05-16  Bruno Haible  <bruno@clisp.org>
1046
1047                 * localcharset.c [CYGWIN]: Include <windows.h>.
1048                 (get_charset_aliases): For Cygwin, return the same CPxxx
1049                 aliases list as under WIN32.
1050                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1051                 the environment variables. Fall back to GetACP().
1052
1053         2006-04-05  Bruno Haible  <bruno@clisp.org>
1054
1055                 * config.charset: Update Juan Manuel Guerrero's address.
1056
1057         2005-02-12  Bruno Haible  <bruno@clisp.org>
1058
1059                 * allocsa.h: Add extern "C" for C++.
1060
1061         2005-02-10  Bruno Haible  <bruno@clisp.org>
1062
1063                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1064                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1065
1066         2006-07-22  Bruno Haible  <bruno@clisp.org>
1067
1068                 * gettext.h: Update to GNU gettext-0.15.
1069
1070 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1071         and Simon Josefsson <jas@extundo.com>
1072
1073         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1074
1075         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1076
1077 2006-07-21  Eric Blake  <ebb9@byu.net>
1078
1079         * stdlib-safer.h: New file from coreutils, required by
1080         stdlib--.h.
1081
1082 2006-07-19  Derek R. Price  <derek@ximbiot.com>
1083
1084         * getaddrinfo.h: Don't define unimplemented AI_* flags.
1085         Reindent and repaginate.
1086
1087 2006-07-17  Bruno Haible  <bruno@clisp.org>
1088
1089         * gl_list.h: New file.
1090         * gl_list.c: New file.
1091         * gl_array_list.h: New file.
1092         * gl_array_list.c: New file.
1093         * gl_carray_list.h: New file.
1094         * gl_carray_list.c: New file.
1095         * gl_linked_list.h: New file.
1096         * gl_linked_list.c: New file.
1097         * gl_anylinked_list1.h: New file.
1098         * gl_anylinked_list2.h: New file.
1099         * gl_avltree_list.h: New file.
1100         * gl_avltree_list.c: New file.
1101         * gl_anyavltree_list1.h: New file.
1102         * gl_anyavltree_list2.h: New file.
1103         * gl_rbtree_list.h: New file.
1104         * gl_rbtree_list.c: New file.
1105         * gl_anyrbtree_list1.h: New file.
1106         * gl_anyrbtree_list2.h: New file.
1107         * gl_anytree_list1.h: New file.
1108         * gl_anytree_list2.h: New file.
1109         * gl_linkedhash_list.h: New file.
1110         * gl_linkedhash_list.c: New file.
1111         * gl_anyhash_list1.h: New file.
1112         * gl_anyhash_list2.h: New file.
1113         * gl_avltreehash_list.h: New file.
1114         * gl_avltreehash_list.c: New file.
1115         * gl_rbtreehash_list.h: New file.
1116         * gl_rbtreehash_list.c: New file.
1117         * gl_anytreehash_list1.h: New file.
1118         * gl_anytreehash_list2.h: New file.
1119
1120         * gl_oset.h: New file.
1121         * gl_oset.c: New file.
1122         * gl_array_oset.h: New file.
1123         * gl_array_oset.c: New file.
1124         * gl_avltree_oset.h: New file.
1125         * gl_avltree_oset.c: New file.
1126         * gl_rbtree_oset.h: New file.
1127         * gl_rbtree_oset.c: New file.
1128         * gl_anytree_oset.h: New file.
1129
1130 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1131
1132         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1133         New files.
1134         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1135         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1136         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
1137         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1138         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
1139         callers changed.  Revamp internals significantly, by not
1140         attempting to create directories that are temporarily more
1141         permissive than the final results.  Do not attempt to use
1142         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1143         This removes some race conditions, fixes some bugs, and simplifies
1144         things.  Use new dirchownmod function to do owner and mode changes.
1145         * mkdir-p.h: Likewise.
1146         * modechange.c (octal_to_mode): New function.
1147         (struct mode_change): New member mentioned.
1148         (make_node_op_equals): New arg mentioned.  All callers changed.
1149         (mode_compile): Keep track of which mode bits the user has explicitly
1150         mentioned.
1151         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1152         New arg PMODE_BITS, to keep track of which mode bits the user
1153         mentioned; it treats S_ISUID and S_ISGID speciall.
1154         All callers changed.
1155         * modechange.h: Likewise.
1156
1157 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1158
1159         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1160
1161 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1162
1163         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1164         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1165         macros into the GNU _D_EXACT_NAMLEN.
1166         * savedir.c:  Likewise.
1167         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1168
1169 2006-07-09  Jim Meyering  <jim@meyering.net>
1170
1171         * argp-pv.c: Remove a doubled word in a comment.
1172         * check-version.c (check_version): Likewise.
1173         * javacomp.c (compile_java_class): Likewise.
1174
1175 2006-07-08  Jim Meyering  <jim@meyering.net>
1176
1177         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1178
1179 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1180
1181         * getaddrinfo.c: Changes to compile under MSVC6: changed
1182         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1183         brackets.  Other minor changes to suppress some compiler
1184         warnings.
1185
1186 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1187
1188         * getloadavg.c: Use __VMS, not VMS.
1189         * getopt.c: Likewise.
1190         * getpagesize.h: Likewise.
1191         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1192         probably does not work.
1193
1194 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1195         and Paul Eggert  <eggert@cs.ucla.edu>
1196
1197         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1198         Don't worry about this obsolete case any more.
1199         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1200         directories.
1201         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1202         worry about this obsolete case any more.
1203         * fts.c: Likewise.
1204         * getcwd.c: Likewise.
1205         * glob.h: Likewise.
1206         * savedir.c: Likewise.
1207
1208 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1209
1210         * .cppi-disable: Add wcwidth.
1211         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1212         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1213         (ISGRAPH): Remove.  All uses changed to isgraph.
1214         (FOLD) [!defined _LIBC]: Remove special case.
1215         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1216         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1217         HAVE_ISBLANK.
1218         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1219
1220 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1221
1222         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1223
1224 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1225
1226         * memcasecmp.c: Include <limits.h>.
1227         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1228         * strtod.c (strtod): Don't assume isspace works on negative chars.
1229         Don't assume isdigit succeeds only on '0' through '9'.
1230
1231 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1232
1233         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1234         All uses of is_space replaced by isspace.
1235         * exit.h: Don't talk about STDC_HEADERS.
1236         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1237         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1238         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1239         replaced by isprint etc.
1240         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1241         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1242         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1243         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1244         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1245         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1246
1247 2006-07-05  Eric Blake  <ebb9@byu.net>
1248
1249         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1250         missing from netdb.h.
1251         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1252
1253 2006-06-27  Bruno Haible  <bruno@clisp.org>
1254
1255         Assume ANSI C header files and <ctype.h> functions.
1256         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1257         (mbsnwidth): Use isprint, iscntrl instead.
1258
1259 2006-07-03  Jim Meyering  <jim@meyering.net>
1260
1261         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1262         macro is used before the first cycle_check call.
1263
1264 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1265
1266         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1267         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1268         reported by Mark D. Baushke, one in
1269         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1270
1271         Merge from coreutils.
1272
1273         * .cppi-disable: Add stdint_.h.
1274         * .cvsignore: Add stdint.h.
1275
1276         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1277
1278         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1279         both double and long double versions.
1280         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1281         * xstrtold.c: New file.
1282         * xstrtod.h (xstrtold): New decl.
1283
1284         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1285
1286         * filemode.c (setst): Remove.
1287         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1288         (arguably) clearer, and the generated code is a bit smaller on my
1289         Debian GNU/Linux stable x86 host.
1290
1291         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1292
1293         * filemode.c: Include "filemode.h" first, to test the interface.
1294         Assume that filemode.h includes sys/types.h and sys/stat.h.
1295         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1296         (ftypelet): Reorder to put common cases first, for efficiency.
1297         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1298         to do 'M'.
1299         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1300         of 10, for compatibility with FreeBSD.  All callers changed.
1301         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1302         that can't be deduced solely from st_mode.  First arg is now a const
1303         pointer.
1304         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1305         (strmode): Renamed from mode_string.
1306         (filemodestring): New decl.
1307         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1308         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1309         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1310
1311         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1312
1313         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1314         fsusage.h now does that.  Include fsusage.h first, to test interface.
1315         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1316         at most one method (the old code could have generated decls that
1317         didn't conform to C89, not that this was ever exercised).
1318         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1319
1320         2006-03-19  Jim Meyering  <jim@meyering.net>
1321
1322         Work even in a chroot where d_ino values for entries in "/"
1323         don't match the stat.st_ino values for the same names.
1324         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1325         number, iterate through all entries again, using lstat instead.
1326         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1327         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1328
1329         * getcwd.c (__getcwd): Clarify a comment.
1330         Use memcpy in place of a call to strcpy.
1331
1332         2006-03-12  Jim Meyering  <jim@meyering.net>
1333
1334         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1335         that of the current directory (which we're about to chdir ".." out of),
1336         then save the dev-ino of the parent, instead.
1337
1338         * same-inode.h (SAME_INODE): New file/macro.
1339         * chdir-safer.c (SAME_INODE): Remove definition.
1340         Include "same-inode.h", instead.
1341         * same.c: Likewise.
1342         * cycle-check.h: Include "same-inode.h".
1343         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1344         * cycle-check.c (SAME_INODE): Remove definition.
1345         * root-dev-ino.h: Include "same-inode.h".
1346
1347         2006-03-11  Eric Blake  <ebb9@byu.net>
1348
1349         * same.c (same_name): s/base_name/last_component/
1350         * backupfile.c (check_extension, numbered_backup): Likewise.
1351         * filenamecat.c (file_name_concat): Likewise.
1352
1353         2006-03-11  Eric Blake  <ebb9@byu.net>,
1354                     Paul Eggert  <eggert@cs.ucla.edu>
1355
1356         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1357         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1358         drive prefix.
1359         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1360         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1361         (last_component): New method.
1362         * dirname.c (dir_len): Determine when drive letters need a
1363         subsequent slash.  Preserve // when it is special.
1364         (dir_name): Don't append dot when drive letter is absolute.
1365         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1366         * basename.c (base_name): New semantics - malloc the result.
1367         Preserve // when it is special.  Preserve relative files that look
1368         like drive letters.
1369         (base_len): Preserve // when it is special.
1370         (last_component): New method, similar to old base_name semantics.
1371         * stripslash.c (strip_trailing_slashes): Use last_component, not
1372         base_name.  Strip redundant slashes from ///.
1373
1374 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1375
1376         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1377         both are 64 bits, since this seems to be the tradition, and this
1378         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1379         we ever run into a host that prefers long long to long in this
1380         case, we'll need another configure-time test.  Problem reported by
1381         Jim Meyering.
1382
1383 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1384
1385         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1386         possible collision with system files.
1387         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1388         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1389         WCHAR_MIN and WCHAR_MAX in this case.
1390         (<stddef.h>): Do not include; no longer needed.
1391         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1392         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1393         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1394         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1395         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1396         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1397         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1398         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1399         !defined(__c99))]: Include in this case too, since it's harmless
1400         now.
1401         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1402         dangerous to do so.
1403         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1404         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1405         (_STDINT_MIN, _STDINT_MAX): New macros.
1406         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1407         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1408         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1409         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1410         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1411         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1412         macros, not typedefs; this simplifies things quite a bit.
1413         Use long int for all types narrower than int64_t.
1414         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1415         Define in terms of long long int or int64_t or long int,
1416         not int64_t or int32_t.  This saves some compile-time testing.
1417         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1418         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1419         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1420         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1421         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1422         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1423         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1424         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1425         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1426         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1427         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1428         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1429         undef any previous version and define our own version, for
1430         simplicity and consistency with the new macros for types.
1431         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1432         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1433         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1434         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1435         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1436         @WINT_T_SUFFIX@ to keep things simple here.
1437         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1438         Simplify by assuming typical 8/16/32/64 host, since we're
1439         already doing that elsewhere anyway.
1440         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1441         and assume long long int is 64 bits if available.  This
1442         speeds up 'configure'.
1443
1444 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1445
1446         * getaddrinfo.c: fixed typo
1447
1448 2006-06-29  Eric Blake  <ebb9@byu.net>
1449
1450         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1451         unused static function.
1452
1453 2006-06-29  Eric Blake  <ebb9@byu.net>
1454
1455         * stat_.h: New file.
1456
1457 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1458
1459         * strftime.c: Assume strftime() exists.
1460
1461 2006-06-28  Bruno Haible  <bruno@clisp.org>
1462
1463         * getaddrinfo.h: Fix POSIX URL.
1464         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1465         (use_win32_p): Make static.
1466         (getaddrinfo): Reject service name if it is empty or does not consist
1467         solely of decimal digits, or if its value is > 65535.
1468         (getnameinfo): Remove useless casts.
1469
1470 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1471
1472         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1473         Autoconf 2.60 says this stuff was obsolete.
1474
1475 2006-05-12  Bruno Haible  <bruno@clisp.org>
1476
1477         * mkdtemp.c [MINGW]: Include <io.h>.
1478         (mkdir): Define using _mkdir.
1479
1480 2006-06-28  Bruno Haible  <bruno@clisp.org>
1481
1482         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1483         declaration for wcwidth.
1484         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1485
1486 2006-06-28  Eric Blake  <ebb9@byu.net>
1487
1488         * xvasprintf.h: Fix comments.
1489
1490 2006-06-28  Eric Blake  <ebb9@byu.net>
1491
1492         * mbchar.h (wcwidth): Include wcwidth.h.
1493         * mbswidth.c (wcwidth): Move from here...
1494         * wcwidth.h: ...to this new file.
1495
1496 2006-06-28  Simon Josefsson  <jas@extundo.com>
1497
1498         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1499         functions there.  It will succeed on Windows XP, but on Windows
1500         2000 and (presumably) earlier, it will fail, and use the internal
1501         re-implementation.
1502         (use_win32_p): New function.
1503         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1504         Support AI_NUMERICSERV to disable getservbyname.
1505         (getnameinfo): New function, only supports
1506         NI_NUMERICHOST|NI_NUMERICSERV for now.
1507
1508         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1509         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1510         getnameinfo.
1511
1512 2006-06-27  Bruno Haible  <bruno@clisp.org>
1513
1514         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1515
1516 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1517
1518         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1519         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1520         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1521
1522 2006-06-26  Bruno Haible  <bruno@clisp.org>
1523
1524         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1525         WCHAR_MAX.
1526         Reported by Mark D. Baushke and Larry Jones.
1527
1528 2006-06-26  Bruno Haible  <bruno@clisp.org>
1529
1530         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1531         in pre-C99 mode.
1532         Suggested by Mark D. Baushke and Larry Jones.
1533
1534 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1535
1536         * stdint_.h: Treat BSD/OS like OpenBSD.
1537
1538 2006-06-23  Bruno Haible  <bruno@clisp.org>
1539
1540         * stdint_.h: Treat IRIX like OpenBSD.
1541
1542 2006-06-23  Bruno Haible  <bruno@clisp.org>
1543
1544         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1545         ISO C 99 Technical Corrigendum 1.
1546
1547 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1548
1549         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1550         Some compiler complained about some of them.  Problem reported by
1551         Larry Jones in
1552         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1553
1554 2006-06-21  Simon Josefsson  <jas@extundo.com>
1555
1556         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1557         variable.
1558
1559         * socket_.h: Don't define WINVER.
1560
1561         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1562         slightly modified to work in gnulib.
1563
1564 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1565
1566         * read-file.c (fread_file): Start with buffer allocation of
1567         0 bytes rather than 1 byte; this simplifies the code.
1568         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1569         code to free buffer and save/restore errno.
1570         (internal_read_file): Remove unused local.
1571
1572 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1573
1574         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1575         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1576         Problem reported by Denis Excoffier in
1577         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1578
1579 2006-06-19  Simon Josefsson  <jas@extundo.com>
1580
1581         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1582
1583 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1584
1585         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1586
1587 2006-06-17  Bruno Haible  <bruno@clisp.org>
1588
1589         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1590
1591 2006-06-17  Bruno Haible  <bruno@clisp.org>
1592
1593         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1594         problem on Solaris 2.5.1.
1595
1596 2006-06-16  Eric Blake  <ebb9@byu.net>
1597
1598         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1599         * unicodeio.c [!defined errno]: Likewise.
1600         * strtol.c [!defined errno]: Likewise.
1601         * strtod.c [!defined errno]: Likewise.
1602
1603 2006-06-15  Bruno Haible  <bruno@clisp.org>
1604
1605         * stdint_.h: Rewritten to be fully auto-configured.
1606         Fixes bug on HP-UX/IA64.
1607
1608 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1609
1610         * getdate.y (__attribute__): Don't define if already defined.
1611         Problem reported by Larry Jones.
1612         * utimens.c (__attribute__): Likewise.
1613
1614 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1615
1616         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1617         reported by Andreas Schwab.
1618
1619 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1620             Bruno Haible  <bruno@clisp.org>
1621
1622         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1623
1624 2006-05-26  Martin Lambers  <marlam@marlam.de>
1625
1626         * getpass.c: Updates the test for the native W32 API, and adds
1627         missing includes, thus fixing compilation warnings.
1628
1629 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1630
1631         * tempname.c (small_open, large_open): New macros.
1632         (__open, __open64) [!_LIBC]: Remove.
1633         (__gen_tempname): Use small_open and large_open instead of __open
1634         and __open64.  This fixes a portability bug on HP-UX 11.11i
1635         reported by Simon Wing-Tang in
1636         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1637
1638 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1639
1640         * exclude.c (exclude_fnmatch): New function.
1641         (excluded_file_name): Call exclude_fnmatch.
1642         * exclude.h (excluded_file_name): New prototype
1643
1644 2006-05-24  Bruno Haible  <bruno@clisp.org>
1645
1646         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1647         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1648         Reported by Thorsten Maerz <torte@netztorte.de> via
1649         Aaron Stone <aaron@serendipity.cx>.
1650
1651 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1652
1653         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1654         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1655         (my_usleep): Don't mishandle maximum value.
1656
1657 2006-05-19  Jim Meyering  <jim@meyering.net>
1658
1659         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1660
1661 2006-05-17  Bruno Haible  <bruno@clisp.org>
1662
1663         Cygwin portability.
1664         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1665
1666 2006-05-17  Bruno Haible  <bruno@clisp.org>
1667
1668         * stdint_.h: Fix recognition of Cygwin.
1669
1670 2006-05-11  Jim Meyering  <jim@meyering.net>
1671
1672         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1673
1674 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1675
1676         * crc.c (crc32_update): Remove unnecessary L suffix.
1677         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1678         unwanted sign propagation, e.g., on hosts with 64-bit int.
1679         There still are some problems with reeelly weird theoretical hosts
1680         (e.g., 33-bit int) but it's not worth worrying about now.
1681         * sha1.c (rol): Likewise.
1682         (K1, K2, K3, K4): Remove unnecessary L suffix.
1683
1684 2006-05-10  Bruno Haible  <bruno@clisp.org>
1685
1686         * des.c: Cast to avoid warnings.
1687
1688 2006-05-10  Simon Josefsson  <jas@extundo.com>
1689
1690         * md4.c: Typo fix, update copyright years.
1691         (K1, K2): Don't use L because it turn computations into 64-bit on
1692         64-bit platforms.
1693
1694 2006-05-09  Bruno Haible  <bruno@clisp.org>
1695
1696         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1697         (EOVERFLOW): Define fallback value.
1698         (xstrcat): New function.
1699         (xvasprintf): Recognize the special case of a string concatenation.
1700
1701 2006-05-01  Bruno Haible  <bruno@clisp.org>
1702
1703         * stdint_.h: Shorter URL.
1704         * inttypes.h: Likewise.
1705
1706 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1707
1708         * verify.h: Document the internals better.  Most of this change
1709         was written by Bruno Haible.
1710
1711 2006-04-29  Bruno Haible  <bruno@clisp.org>
1712
1713         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1714         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1715
1716 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1717
1718         * getdate.y (get_date): When adding relative date, start with the
1719         initial time, not with the result of the first mktime call.
1720
1721 2006-04-23  Bruno Haible  <bruno@clisp.org>
1722
1723         * copy-file.c: Include <unistd.h> unconditionally.
1724         * execute.c: Likewise.
1725         * fatal-signal.c: Likewise.
1726         * findprog.c: Likewise.
1727         * mkdtemp.c: Likewise.
1728         * pipe.h: Likewise.
1729         * pipe.c: Likewise.
1730         * wait-process.h: Likewise.
1731
1732 2006-04-23  Bruno Haible  <bruno@clisp.org>
1733
1734         * fwriteerror.c (fwriteerror): Call fclose also when an error
1735         condition was already detected.
1736         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1737
1738 2006-04-19  Derek Price  <derek@ximbiot.com>
1739             Eric Blake  <ebb9@byu.net>
1740
1741         * inttypes.h: Correct grammar in comment.
1742
1743 2006-04-18  Derek Price  <derek@ximbiot.com>
1744             Paul Eggert  <eggert@cs.ucla.edu>
1745
1746         * inttypes.h: New file.
1747         * strtoimax.c: Assume <inttypes.h>.
1748
1749 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1750
1751         * utimens.c (futimens): glibc futimesat messes up if /proc
1752         isn't mounted.  Problem reported by Kir Kolyshkin.
1753
1754 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1755
1756         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1757         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1758         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1759
1760 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1761
1762         Merge regex changes from libc, removing some of our
1763         POSIX-conformance changes that were rejected and redoing them in a
1764         less-intrusive way.
1765
1766         * regcomp.c (re_compile_internal, init_dfa):
1767         Length arg is now size_t, not Idx.  All uses changed.
1768         (peek_token): Forward decl now says internal_function.
1769         (__re_error_msgid, __re_error_msgid_idx):
1770         Now static rather than extern with attribute_hidden.
1771         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1772         For some reason libc prefers K&R style defns for external functions.
1773         (regerror) [!defined _LIBC]: Likewise.
1774         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1775         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1776         (build_range_exp, build_collating_symbol):
1777         Use K&R-style defn.
1778         (re_compile_fastmap): Use '\0' to memset, not 0.
1779         (utf8_sb_map): Make the calculations more obvious.
1780         (init_dfa, parse_bracket_exp, build_charclass_op):
1781         Call calloc and cast result, as glibc does.
1782         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1783         (build_range_exp, build_collating_symbol):
1784         Now internal functions.
1785
1786         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1787
1788         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1789         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1790         Don't depend on VMS; depend on __VMS instead, for POSIX
1791         namespace cleanness.
1792         (regoff_t): Define to ssize_t, not long int.
1793
1794         Remove the REG_ macros named below.  Instead, make the old names
1795         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1796         __USE_GNU_REGEX.
1797         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1798         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1799         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1800         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1801         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1802         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1803         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1804         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1805         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1806         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1807         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1808         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1809         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1810         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1811         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1812         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1813         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1814         (REG_NREGS):
1815         Remove.  All uses replaced by the old RE_* names.
1816         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1817         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1818         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1819         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1820         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1821         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1822         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1823         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1824         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1825         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1826         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1827         Don't bother having these macros be independent of each others'
1828         values, since they no longer exist in the POSIX name space.
1829
1830         Rename the following member names back to their old names,
1831         unless !__USE_GNU_REGEX.  All uses changed back.
1832         (buffer): Renamed from re_buffer.
1833         (allocated): Renamed from re_allocated.
1834         (used): Renamed from re_used.
1835         (syntax): Renamed from re_syntax.
1836         (fastmap): Renamed from re_fastmap.
1837         (translate): Renamed from re_translate.
1838         (can_be_null): Renamed from re_can_be_null.
1839         (regs_allocated): Renamed from re_regs_allocated.
1840         (fastmap_accurate): Renamed from re_fastmap_accurate.
1841         (no_sub): Renamed from re_no_sub.
1842         (not_bol): Renamed from re_not_bol.
1843         (not_eol): Renamed from re_not_eol.
1844         (newline_anchor): Renamed from re_newline_anchor.
1845         (num_regs): Renamed from rm_num_regs.
1846         (start): Renamed from rm_start.
1847         (end): Renamed from rm_end.
1848
1849         (free_state): Move up a bit.
1850
1851         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1852         #define to be empty.
1853         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1854         when that is what is intended.
1855         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1856         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1857         (MAX): New macro.
1858         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1859         All uses changed back to re_malloc, etc.  It's now the caller's
1860         responsibility to check for overflow; all callers changed.
1861         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1862         (re_x2nrealloc): Remove.
1863         (free_state): Remove decl.
1864
1865         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1866         (re_set_registers, re_exec):
1867         Use K&R-style defn.
1868
1869         2006-01-31  Roland McGrath  <roland@redhat.com>
1870
1871         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1872         Reported by Mike Frysinger <vapier@gentoo.org>.
1873
1874         2006-01-15  Andreas Jaeger  <aj@suse.de>
1875
1876         [BZ #1950]
1877         * regex_internal.c (re_string_reconstruct): Adjust for
1878         build_wcs_upper_buffer change.
1879         (build_wcs_upper_buffer): Change return type.
1880
1881         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1882
1883         * regex_internal.h: Include <stdint.h> if available.
1884
1885         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1886
1887         * regex_internal.h (SIZE_MAX): Provide a default definition.
1888
1889         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1890
1891         * regcomp.c: Adjust for changed secondary hash function.
1892
1893         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1894
1895         * regex.h: Pretty printing.
1896         Clean up namespace a bit.
1897
1898         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1899
1900         * regexec.c (update_cur_sifted_state, check_arrival,
1901         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1902
1903         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1904                     Ulrich Drepper  <drepper@redhat.com>
1905
1906         [BZ #1302]
1907         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1908         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1909
1910         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1911
1912         [BZ #281]
1913         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1914         * regcomp.c: Remove unnecessary uses of
1915         unsigned RE_TRANSLATE_TYPE.
1916         * regex_internal.h: Likewise.
1917         * regex_internal.c: Likewise.
1918         * regexec.c: Likewise.
1919         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1920
1921         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1922
1923         * regexec.c (find_recover_state): Remove unnecessary
1924         initialization.
1925         (transit_state_bkref): Make DFA a const pointer.
1926         (get_subexp): Likewise.
1927         (check_arrival): Likewise.
1928         (update_cur_sifted_state): Likewise.
1929         (re_search_internal): Likewise.
1930         (prune_impossible_nodes): Likewise.
1931         (acquire_init_state_context): Likewise.
1932         (proceed_next_node): Likewise.
1933         (set_regs): Likewise.
1934         (free_fail_stack_return): Likewise.
1935         (check_arrival_expand_ecl): Mark DFA parameter as const.
1936         (check_arrival_expand_ecl_sub): Likewise.
1937         (check_subexp_limits): Likewise.
1938         (sub_epsilon_src_nodes):  Likewise.
1939         (add_epsilon_src_nodes):  Likewise.
1940         (merge_state_array): Likewise.
1941         (update_regs): Likewise.
1942         (build_trtable): Likewise.
1943         (sift_states_backward): Mark MCTX parameter as const.
1944         (build_sifted_states): Likewise.
1945         (update_cur_sifted_state): Likewise.
1946         (sift_states_mkref): Likewise.
1947         (check_arrival_expand_ecl): Mark eclosure as const.
1948         (check_dst_limits_calc_pos_1): Likewise.
1949         * regex_internal.h (re_match_context_t): Make dfa a const
1950         pointer.
1951
1952         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1953
1954         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1955         (transit_state_sb): Likewise.
1956         (transit_state_mb): Likewise.
1957         (sift_states_iter_mb): Likewise.
1958         (check_arrival_add_next_nodes): Likewise.
1959         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1960         [_LIBC] (re_search_2_stub): Use mempcpy.
1961
1962         * regex_internal.c (re_string_reconstruct): Avoid calling
1963         mbrtowc for very simple UTF-8 case.
1964
1965         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1966         a pointer-to-const.
1967         (re_acquire_state_context): Likewise.
1968         * regex_internal.h: Adjust prototypes.
1969
1970         * regex.c: Prevent using C++ compilers.
1971
1972         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1973         (re_acquire_state_context): Likewise.
1974
1975 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1976             Bruno Haible  <bruno@clisp.org>
1977
1978         * stdint_.h: On OpenBSD, don't redefine types already included in
1979         <sys/types.h> and <inttypes.h>.
1980
1981 2006-03-24  Eric Blake  <ebb9@byu.net>
1982
1983         * time_r.c (copy_string_result): Remove, as it is no longer used.
1984
1985 2006-03-24  Simon Josefsson  <jas@extundo.com>
1986
1987         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1988         including some doc fixes.
1989         (base64_encode_alloc): Fix +1 bug on allocation failures.
1990
1991 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1992
1993         * base64.c (base64_encode): Do not read past end of array with
1994         unsanitized input on systems with CHAR_BIT > 8.
1995
1996 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1997
1998         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1999         Typedef to long int, not to off_, as POSIX will likely change
2000         in that direction.
2001
2002 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2003
2004         * argp-help.c (validate_uparams): Fix typo
2005         * argp-parse.c (argp_default_options): Consistently begin help
2006         messages with a lowercase letter.
2007
2008 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
2009
2010         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
2011         overrun buffers and shouldn't be used (much as gets shouldn't be
2012         used).
2013         * time_r.c (asctime_r, ctime_r): Likewise.
2014
2015 2006-03-08  Simon Josefsson  <jas@extundo.com>
2016
2017         * gc-gnulib.c (randomize): Don't open files called 'no', they
2018         signal that configure disabled the device.
2019
2020 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
2021
2022         * c-stack.c: Include unistd.h unconditionally, since we now assume
2023         the unistd module.
2024         * getlogin_r.c: Likewise.
2025         * getlogin_r.h: Likewise.
2026         * glob.c: Likewise.
2027         * pagealign_alloc.c: Likewise.
2028         * unistd_.h: Remove; no longer needed.
2029
2030 2006-03-07  Simon Josefsson  <jas@extundo.com>
2031
2032         * unistd_.h: New file.
2033
2034 2006-03-07  Simon Josefsson  <jas@extundo.com>
2035
2036         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2037
2038 2006-03-01  Simon Josefsson  <jas@extundo.com>
2039
2040         * readline.c: Fix typo, tiny patch from Stepan Kasal
2041         <kasal@ucw.cz>.
2042
2043 2006-02-28  Simon Josefsson  <jas@extundo.com>
2044
2045         * getopt.c: Protect #include of unistd.h, for MSVS.
2046
2047 2006-02-27  Simon Josefsson  <jas@extundo.com>
2048
2049         * base64.h: Indent #define's.  From Jim Meyering
2050         <jim@meyering.net>.
2051
2052 2006-02-27  Jim Meyering  <jim@meyering.net>
2053
2054         Revert the change of 2006-02-24, so these files can continue
2055         to be sync'd from gettext.
2056         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2057         of `config.h'.
2058
2059 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
2060
2061         * glob.c: Say "invalid" rather than "illegal" in comments.
2062
2063 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2064
2065         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2066
2067 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2068
2069         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2070         AT_FDCWD exceeds INT_MAX.
2071         * openat.h (AT_FDCWD): Likewise.
2072
2073 2006-02-14  Jim Meyering  <jim@meyering.net>
2074
2075         Sync from coreutils.
2076
2077         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2078         failure on deficient systems, and simplify gnulib lgpl dependencies.
2079         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2080         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2081
2082         * xalloc-die.c: Remove unused definition of N_.
2083
2084 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2085
2086         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2087
2088 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
2089
2090         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2091         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2092
2093 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2094
2095         * argp-namefrob.h: Restore changes accidentally lost during the
2096         "autoupdate" on 2005-12-12.
2097
2098 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
2099
2100         * fnmatch.c (L_): Renamed from L, to work around a bug in
2101         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2102         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2103         All uses changed.
2104
2105 2006-01-26  Simon Josefsson  <jas@extundo.com>
2106
2107         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2108         prototype is visible on mingw32.
2109
2110         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2111         for mingw32.
2112
2113         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2114         mingw32).
2115
2116 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2117
2118         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
2119         attempt to open for write; this always fails, at least on POSIX
2120         hosts.  This reinstates the 2006-01-09 change, which was
2121         inadvertently removed.
2122
2123 2006-01-26  Bruno Haible  <bruno@clisp.org>
2124             Paul Eggert  <eggert@cs.ucla.edu>
2125
2126         * stdbool_.h (_Bool)
2127         [(! (defined __cplusplus || defined __BEOS__)
2128           && !defined __GNUC__
2129           && !(defined __HP_cc || defined __xlc__
2130                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2131                || defined __sgi))]:
2132         #define to signed char in these cases too; this simplifies
2133         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2134         etc., separately) and makes it more conservative.
2135
2136 2006-01-21  Jim Meyering  <jim@meyering.net>
2137
2138         Sync from the stable (b5) branch of coreutils:
2139
2140         * fts.c (fts_children): Don't let close() clobber errno from
2141         failed fchdir().
2142
2143         * fts.c (fts_stat): When following a symlink-to-directory,
2144         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2145         a dangling symlink.  That can also happen at least for ELOOP.
2146         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2147         FYI, this bug predates the inclusion of fts.c in coreutils.
2148
2149         * fts.c (fts_open): Put new maxarglen declaration and uses
2150         in their own block, so pre-c99 compilers don't object.
2151
2152         Avoid the double-free (first in fts_read, second in fts_close) that
2153         would occur when an `active' directory is made inaccessible (e.g.,
2154         via chmod a-x) during a traversal.
2155         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2156         before returning.  Reproduce this failure by
2157         mkdir -p a/b; cd a; chmod a-x . b
2158         Reported by Stavros Passas.
2159
2160 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2161
2162         * argp-namefrob.h: Bugfix. Remove stray #
2163
2164 2006-01-25  Bruno Haible  <bruno@clisp.org>
2165
2166         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2167         warnings.
2168         Reported by Paul Eggert.
2169
2170 2006-01-25  Jim Meyering  <jim@meyering.net>
2171
2172         * fileblocks.c: Remove more useless parentheses.
2173         * readutmp.h: Likewise.
2174
2175 2006-01-24  Bruno Haible  <bruno@clisp.org>
2176
2177         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2178         has it.
2179         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2180         2005-11-26.
2181
2182         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2183         to avoid problems with the built-in _Bool type.
2184         Reported by Paul Eggert on 2005-11-26.
2185
2186 2006-01-24  Jim Meyering  <jim@meyering.net>
2187
2188         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2189
2190 2006-01-24  Simon Josefsson  <jas@extundo.com>
2191
2192         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2193         Bruno.
2194
2195 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2196
2197         Work around porting bugs reported by Dieter in
2198         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2199         * getopt.c (_NOPROTO): Remove; no longer needed.
2200         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2201         Include "getopt.h" first, to check interface.
2202         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2203         !HAVE_DECL_GETENV.
2204         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2205         (__strndup): Revert to K&R-style function dfns, the glibc style.
2206         * strnlen.c: Don't claim it's taken from glibc; it's not.
2207         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2208         Include strnlen.h first, to get prototype properly.
2209         (strnlen): Renamed from __strnlen.
2210         Remove weak alias.
2211
2212 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2213
2214         These changes imported from libc.
2215         * getopt.c: Use __fxprintf instead of inline stream orientation
2216         test and two separate function calls.
2217         * strndup.c (__strndup): Add libc_hidden_def.
2218
2219 2006-01-22  Bruno Haible  <bruno@clisp.org>
2220
2221         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2222         temporary buffer for sprintf, take into account the precision also
2223         for 'd', 'i', 'u', 'o', 'x', 'X'.
2224
2225 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2226
2227         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2228         to pacify gcc -Wswitch-default.
2229
2230 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2231
2232         * argp-help.c (usage_long_opt): Do not print DOC options.
2233         (__argp_base_name): Removed
2234         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2235         typo.
2236         (__argp_base_name): Provide macro definition or extern declaration
2237         depending on the configuration
2238
2239 2006-01-20  Simon Josefsson  <jas@extundo.com>
2240
2241         * inet_ntop.h: Unconditionally include sys/socket.h.
2242
2243 2006-01-19  Simon Josefsson  <jas@extundo.com>
2244
2245         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2246
2247 2006-01-12  Simon Josefsson  <jas@extundo.com>
2248
2249         * base64.c: Fix warning, reported by Bruno Haible
2250         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2251
2252 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2253
2254         Sync from coreutils.
2255         * md5.c: Fix commentary typos.
2256         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2257         * md5.h (__attribute__): Remove; unused.
2258         * sha1.c: Fix commentary to match md5 better.
2259         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2260         so that we don't need to worry about alignment.  All uses changed.
2261         This merges the 2005-10-28 md5 change into sha1.
2262
2263 2006-01-11  Jim Meyering  <jim@meyering.net>
2264
2265         Sync from coreutils.
2266         * md5.c (OP): Fix spacing.
2267
2268 2006-01-11  Simon Josefsson  <jas@extundo.com>
2269
2270         * stdint_.h (SIZE_MAX): Add missing (.
2271
2272 2006-01-10  Bruno Haible  <bruno@clisp.org>
2273
2274         * argp.h (__const): Remove macro. Use const instead.
2275         * argp-fmtstream.h (__const): Likewise.
2276         * glob_.h (__const): Remove macro.
2277         * glob-libc.h: Use const instead of __const.
2278
2279 2006-01-10  Jim Meyering  <jim@meyering.net>
2280
2281         Avoid the double-free (first in fts_read, second in fts_close) that
2282         would occur when an `active' directory is made inaccessible (e.g.,
2283         via chmod a-x) during a traversal.
2284         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2285         before returning.  Reproduce this failure by
2286         mkdir -p a/b; cd a; chmod a-x . b
2287         Reported by Stavros Passas.
2288
2289         Sync from coreutils.
2290         * sha1.c: Tweak grammar in a comment.
2291
2292 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2293
2294         * regex_internal.h (BITSET_WORD_BITS):
2295         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2296         preprocessor mishandles large unsigned values as if they were signed.
2297         Problem reported by Claudio Fontana in
2298         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2299
2300 2006-01-10  Simon Josefsson  <jas@extundo.com>
2301
2302         * socket_.h: New file.
2303
2304 2006-01-10  Bruno Haible  <bruno@clisp.org>
2305
2306         * localcharset.c: Update from GNU gettext.
2307
2308 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2309
2310         Sync from coreutils.
2311         * chdir-long.c (cdb_free): Don't bother trying to open directory
2312         for write access: POSIX says that must fail.
2313         * fts.c (diropen): Likewise.
2314         * save-cwd.c (save_cwd): Likewise.
2315         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2316         well, for minor improvements on hosts that lack O_DIRECTORY.
2317         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2318         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2319         Fall back on chown if open failed with EACCES.
2320
2321         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2322         Report an error at compile-time if only a 1-second nominal clock
2323         resolution is found.
2324
2325         * lchmod.h: New file.
2326         * mkdir-p.c: Include lchmod.h, lchown.h.
2327         (make_dir_parents): Use lchown rather than chown, and
2328         lchmod rather than chmod.
2329
2330         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2331         too.  Problem with "none" reported by Bob Proulx.  Problem with
2332         "proc" reported by n0dalus.
2333
2334         * mountlist.c: Include <limits.h>.
2335         (dev_from_mount_options)
2336         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2337         New function.  It no longer assumes "dev=" has the System V meaning
2338         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2339         (read_file_system_list)
2340         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2341         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2342         dev= in that case.
2343
2344         * posixtm.h (PDS_PRE_2000): New macro.
2345         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2346         All usages changed.  Reject dates outside the range 1969-1999 if
2347         PDS_PRE_2000 is used.
2348
2349 2006-01-09  Jim Meyering  <jim@meyering.net>
2350
2351         Sync from coreutils.
2352
2353         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2354
2355         * chdir-safer.h, chdir-safer.c: New files.
2356
2357         * modechange.c (mode_compile): Reject an invalid mode string
2358         that starts with an octal digit.  From Andreas Gruenbacher.
2359
2360         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2361         and dup to open_safer and dup_safer, respectively.
2362         (openat_permissive): Fix typo in comment.
2363
2364         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2365         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2366         (_): Remove; no longer needed.
2367         (openat): Renamed from rpl_openat; no need for rpl_openat
2368         since openat.h renames openat for us.
2369         Replace most of the body with a call to openat_permissive,
2370         to avoid duplicate code.
2371         Port to (probably hypothetical) environments were mode_t is
2372         wider than int.
2373         (openat_permissive): Require mode arg, so that we can check
2374         types better.  Put it just after flags.  Change cwd failure
2375         indicator from pointer-to-bool to pointer-to-errno-value.
2376         All callers changed.
2377         Invoke openat_save_fail and/or openat_restore_fail if
2378         cwd_errno is null, so that openat can call us.
2379         (openat_permissive, fdopendir, fstatat, unlinkat):
2380         Simplify errno handling to avoid some duplicate code,
2381         as it's OK to set errno on success.
2382         * openat.h: Revamp code so that function macros depend on
2383         __OPENAT_PREFIX only, not also on AT_FDCWD.
2384         (openat_ro): Remove.  Caller changed to use openat_permissive.
2385         (openat_permissive): Now a macro, if not a function.
2386         (openat_restore_fail, openat_save_fail): Now always functions,
2387         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2388
2389         * openat-priv.h: New file, defining macros used by mkdirat.c
2390         and openat.c.
2391         * mkdirat.c: Include openat-priv.h.
2392         Remove definitions of macros defined therein.
2393         * openat.c: Likewise.
2394
2395         * mkdirat.c (mkdirat): New file and function.
2396         * openat.h (mkdirat): Declare.
2397
2398         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2399
2400         * openat.h (openat_permissive): Declare.
2401         (openat_ro): Define.
2402
2403         * openat.c (EXPECTED_ERRNO): New macro.
2404         (openat_permissive): New function -- used in remove.c rewrite.
2405         (all functions): Set errno just before returning, only if there
2406         was an actual failure.
2407         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2408
2409         Emulate openat-family functions using Linux's procfs, if possible.
2410         Idea and some code based on Ulrich Drepper's glibc changes.
2411
2412         * openat.c: (BUILD_PROC_NAME): New macro.
2413         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2414         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2415         before falling back on save_cwd and restore_cwd.
2416         (fdopendir, fstatat, unlinkat): Likewise.
2417
2418         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2419         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2420
2421         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2422         as second argument to va_arg.  Otherwise, some versions of gcc
2423         warn that `if this code is reached, the program will abort'.
2424
2425 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2426
2427         Sync from coreutils.
2428
2429         Add POSIX ACL support
2430         * acl.h (copy_acl, set_acl): Add declarations.
2431         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2432         systems other than Linux.
2433         (chmod_or_fchmod): New function: use fchmod when possible,
2434         and chmod otherwise.
2435         (file_has_acl): Add a POSIX ACL implementation, with a
2436         Linux-specific subcase.
2437         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2438         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2439         acls are unsupported.
2440         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2441         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2442         are unsupported.
2443
2444 2006-01-09  Bruno Haible  <bruno@clisp.org>
2445
2446         * sysexit_.h (EX_OK): New macro.
2447         Suggested by Martin Lambers <marlam@marlam.de>.
2448
2449 2006-01-09  Bruno Haible  <bruno@clisp.org>
2450
2451         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2452         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2453         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2454         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2455
2456 2006-01-09  Bruno Haible  <bruno@clisp.org>
2457
2458         * stdint_.h (SIZE_MAX): Write the value without involving negative
2459         numbers.
2460
2461 2005-10-16  Bruno Haible  <bruno@clisp.org>
2462
2463         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2464         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2465
2466 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2467
2468         * strftime.c (tzname): Don't declare if it is already #defined.
2469         Problem reported for Mingw by Mark Junker.
2470
2471 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2472
2473         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2474         long int, not int, for nanosecond counts, so that people who are
2475         used to POSIX struct timespec won't be surprised.  Reported by Jim
2476         Meyering.
2477
2478 2005-12-16  Jim Meyering  <jim@meyering.net>
2479
2480         * fprintftime.c, fprintftime.h: New files.
2481
2482 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2483
2484         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2485         * argp-help.c (fill_in_uparams): Check if the constructed
2486         struct uparams is valid. Fall back to the default values if it is
2487         not.
2488
2489 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2490
2491         * argp-help.c (__argp_base_name): New function
2492         (__argp_short_program_name): Rewrite using __argp_base_name
2493         * argp-namefrob.h: Define program_invocation_name and
2494         program_invocation_short_name if requested
2495         (__argp_base_name): Add prototype
2496         * argp-parse.c (argp_def): Use gettext wrappers
2497         (argp_default_parser): Use __argp_base_name
2498         * argp-pin.c: New file. Defines program_invocation_name and
2499         program_invocation_short_name on systems that lack them.
2500
2501 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2502
2503         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2504         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2505         porting problem reported by Georg Schwarz in
2506         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2507
2508 2005-07-09  Bruno Haible  <bruno@clisp.org>
2509
2510         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2511         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2512         Reported by Mark Junker <mjscod@gmx.de>.
2513
2514 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2515
2516         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2517         (uintmax_t) [defined uintmax_t]: Do not declare.
2518         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2519         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2520         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2521         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2522         sake of portability to weird hosts that C allows (though we don't
2523         know of any practical examples).
2524
2525         * savedir.h (fdsavedir): New decl.
2526         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2527         contains most of the former guts of savedir.
2528         (savedir): Use savedirstream.
2529         Include "openat.h".
2530
2531 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2532
2533         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2534         coreutils no longer futzes with rounding modes.
2535
2536 2005-11-14  Jim Meyering  <jim@meyering.net>
2537
2538         * mkstemp-safer.c: Include <config.h>, required for possible
2539         replacement of mkstemp.
2540
2541 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2542
2543         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2544         business.
2545         (gethrxtime) [! (HAVE_NANOUPTIME
2546         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2547         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2548         our own approximation.
2549
2550 2005-11-10  Simon Josefsson  <jas@extundo.com>
2551
2552         * readline.c: Remove EOL.
2553
2554 2005-11-08  Eric Blake  <ebb9@byu.net>
2555
2556         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2557
2558 2005-11-08  Eric Blake  <ebb9@byu.net>
2559
2560         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2561
2562 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2563
2564         Fix porting problem reported by Theodoros V. Kalamatianos.
2565         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2566         Don't assume that futimes failing means we must fail.
2567
2568 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2569
2570         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2571         leave errno alone.  Problem reported by Dmitry V. Levin.
2572
2573 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2574
2575         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2576         errno alone.  Problem reported by Frederic Jolliton.
2577
2578 2005-10-28  Simon Josefsson  <jas@extundo.com>
2579
2580         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2581         "restrict" keywords, as per POSIX.  Protect the function
2582         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2583         Don't use K&R prototypes.  Check the sprintf return values.
2584         Re-define EAFNOSUPPORT if not present.  Indent.
2585
2586         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2587         suggested by Bruno Haible <bruno@clisp.org>.
2588
2589         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2590
2591         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2592
2593         * gc-libgcrypt.c: Add MD2 (which is not available through
2594         libgcrypt).
2595
2596         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2597
2598         * md2.h, md2.c: New files.
2599
2600 2005-10-24  Simon Josefsson  <jas@extundo.com>
2601
2602         * md4.h: Shrink buffer size, now that we changed the type.
2603
2604 2005-10-22  Simon Josefsson  <jas@extundo.com>
2605
2606         * arcfour.h, arcfour.c: Use fixed size indices in the
2607         arcfour_context struct (simplify test vector testing in GNU
2608         Shishi).
2609
2610 2005-10-22  Simon Josefsson  <jas@extundo.com>
2611
2612         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2613         suggested by Bruno Haible <bruno@clisp.org>.
2614
2615 2005-10-22  Simon Josefsson  <jas@extundo.com>
2616
2617         * crc.h: Include stddef.h, for size_t.
2618
2619 2005-10-21  Simon Josefsson  <jas@extundo.com>
2620
2621         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2622         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2623
2624 2005-10-21  Simon Josefsson  <jas@extundo.com>
2625
2626         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2627         block.
2628
2629 2005-10-21  Simon Josefsson  <jas@extundo.com>
2630
2631         * gc-gnulib.c: Support ARCTWO in CBC mode.
2632
2633 2005-10-21  Simon Josefsson  <jas@extundo.com>
2634
2635         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2636         <bruno@clisp.org>.
2637
2638         * hmac-sha1.c (hmac_sha1): Likewise.
2639
2640         * crc.c (crc32_update): Actually use crc parameter, suggested by
2641         Bruno Haible <bruno@clisp.org>.
2642
2643         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2644         <bruno@clisp.org>.
2645
2646 2005-10-21  Simon Josefsson  <jas@extundo.com>
2647
2648         * des.h, des.c: New files.
2649
2650         * gc-gnulib.c: Support DES.c
2651
2652 2005-10-21  Simon Josefsson  <jas@extundo.com>
2653
2654         * arctwo.h, arctwo.c: New files.
2655
2656         * gc-gnulib.c: Support ARCTWO.
2657
2658 2005-10-21  Simon Josefsson  <jas@extundo.com>
2659
2660         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2661
2662 2005-10-19  Simon Josefsson  <jas@extundo.com>
2663
2664         * gc-gnulib.c: Support ARCFOUR.
2665
2666 2005-10-19  Simon Josefsson  <jas@extundo.com>
2667
2668         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2669         support.
2670
2671         * gc.h: Add ECB enum type.
2672
2673         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2674
2675 2005-10-19  Simon Josefsson  <jas@extundo.com>
2676
2677         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2678
2679 2005-10-18  Simon Josefsson  <jas@extundo.com>
2680
2681         * md4.h, md4.c: New files, based on md5.?.
2682
2683 2005-10-17  Simon Josefsson  <jas@extundo.com>
2684
2685         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2686
2687         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2688
2689 2005-10-17  Simon Josefsson  <jas@extundo.com>
2690
2691         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2692
2693 2005-10-17  Simon Josefsson  <jas@extundo.com>
2694
2695         * gc.h, gc-libgcrypt.c: Add ciphers.
2696
2697 2005-10-17  Simon Josefsson  <jas@extundo.com>
2698
2699         * sha1.c: Use uint32_t instead of md5_uint32.t
2700
2701         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2702         md5.h.
2703
2704         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2705
2706         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2707
2708 2005-10-15  Simon Josefsson  <jas@extundo.com>
2709
2710         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2711
2712         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2713
2714 2005-10-14  Simon Josefsson  <jas@extundo.com>
2715
2716         * arcfour.h, arcfour.c: New files.
2717
2718 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2719
2720         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2721         include <wchar.h>; no longer needed.
2722
2723 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2724         and  Ulrich Drepper  <drepper@redhat.com>
2725
2726         Import from libc.
2727         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2728         instead of inline stream orientation test and two separate
2729         function calls.  Pay no attention to USE_IN_LIBIO.
2730
2731 2005-10-14  Roland McGrath  <roland@redhat.com>
2732
2733         Import from libc.  [BZ #1331]
2734         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2735         macro argument.
2736         Reported by Matej Vela <vela@debian.org>.
2737
2738 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2739
2740         * mkdir-p.c (make_dir_parents): Don't report an error if an
2741         intermediate directory is in a read-only file system.  Problem
2742         reported by Eric Blake.
2743
2744 2005-10-13  Simon Josefsson  <jas@extundo.com>
2745
2746         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2747         Move memory allocation outside of loop.
2748
2749 2005-10-12  Simon Josefsson  <jas@extundo.com>
2750
2751         * gc-pbkdf2-sha1.c: New file.
2752
2753         * gc.h: Add gc_pbkdf2_sha1 prototype.
2754
2755 2005-10-12  Simon Josefsson  <jas@extundo.com>
2756
2757         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2758         suggested by Bruno Haible <bruno@clisp.org>.
2759
2760 2005-10-12  Simon Josefsson  <jas@extundo.com>
2761
2762         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2763
2764         * gc-gnulib.c (gc_hmac_sha1): New function.
2765
2766 2005-10-12  Simon Josefsson  <jas@extundo.com>
2767
2768         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2769
2770 2005-10-12  Simon Josefsson  <jas@extundo.com>
2771
2772         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2773         GC_USE_HMAC_MD5, respectively.
2774
2775         * gc-libgcrypt.c (gc_md5): Fix assert call.
2776         (gc_md5): Fix typo.
2777
2778         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2779
2780         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2781
2782         * gc-gnulib.c (gc_hash_buffer): Ditto.
2783
2784 2005-10-11  Bruno Haible  <bruno@clisp.org>
2785
2786         * c-strcasestr.h: New file, from GNU gettext.
2787         * c-strcasestr.c: New file, from GNU gettext.
2788
2789 2005-10-11  Bruno Haible  <bruno@clisp.org>
2790
2791         * c-strcase.h: New file, from GNU gettext.
2792         * c-strcasecmp.c: New file, from GNU gettext.
2793         * c-strncasecmp.c: New file, from GNU gettext.
2794
2795 2005-10-11  Simon Josefsson  <jas@extundo.com>
2796
2797         * crc.h, crc.c: New files.
2798
2799         * gc.h (gc_hash_buffer): Add doc.
2800
2801 2005-10-08  Simon Josefsson  <jas@extundo.com>
2802
2803         * gc.h: Add gc_hash and gc_hash_buffer.
2804
2805         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2806
2807         * gc-libgcrypt.c (gc_hash_buffer): Add.
2808
2809 2005-10-11  Bruno Haible  <bruno@clisp.org>
2810
2811         * strcasecmp.c: Include limits.h.
2812         (strcasecmp): Avoid integer overflow on exotic platforms.
2813         * strncasecmp.c: Include limits.h.
2814         (strncasecmp): Avoid integer overflow on exotic platforms.
2815         Reported by Paul Eggert.
2816
2817 2005-10-06  Simon Josefsson  <jas@extundo.com>
2818
2819         * hmac-md5.c: New file.
2820
2821         * hmac.h: New file.
2822
2823 2005-10-06  Simon Josefsson  <jas@extundo.com>
2824
2825         * memxor.c (memxor): Avoid casts and warnings.
2826
2827 2005-10-05  Derek Price  <derek@ximbiot.com>
2828
2829         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2830
2831 2005-10-05  Simon Josefsson  <jas@extundo.com>
2832
2833         * memxor.c (memxor): Fix compiler error.
2834
2835         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2836         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2837
2838         * memxor.h, memxor.c: New files.
2839
2840         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2841         we assume all systems have it, suggested by Jim Meyering
2842         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2843         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2844         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2845         same reasons.
2846
2847 2005-10-04  Bruno Haible  <bruno@clisp.org>
2848
2849         * verify.h (verify_true): Provide alternative definition for C++.
2850
2851 2005-10-04  Simon Josefsson  <jas@extundo.com>
2852
2853         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2854         D. Baushke" <mdb@gnu.org>.
2855
2856 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2857
2858         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2859         (SSIZE_MAX): New macro, if not already defined.
2860         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2861         than 2 GiB.
2862
2863 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2864
2865         * exclude.c: Include verify.h.
2866         (verify): Remove.  All callers changed to use verify.h's version.
2867         * strtoimax.c: Likewise.
2868         * utimecmp.c: Likewis.e
2869
2870         Sync from coreutils.
2871         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2872         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2873         * .cvsignore: Add fts.h, search.h, t-fpending.
2874         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2875         bother returning ENOSYS if settimeofday or stime fails; just let
2876         them return whatever errno they want to return.
2877         * utimens.c: Include unistd.h, for dup2.
2878         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2879         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2880
2881 2005-10-02  Jim Meyering  <jim@meyering.net>
2882
2883         Sync from coreutils.
2884         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2885         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2886         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2887         Remove AT_FDCWD test.
2888         Do not consume the fd unless successful.
2889         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2890         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2891         block, so that we don't even try to compile it if settimeofday is
2892         available.  This works around a compilation failure on OSF1 V5.1,
2893         due to stime requiring a `long int*' while tv_sec is `int'.
2894
2895 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2896
2897         * getdelim.c (getdelim): Remove unused variables.
2898
2899 2005-10-01  Simon Josefsson  <jas@extundo.com>
2900
2901         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2902         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2903         AI_* and EAI_* definitions.  Protect function declarations.
2904
2905 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2906
2907         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2908         so that the code works even with ancient cpp.  Portability problem
2909         with GCC 2.7.2.1 reported by Thomas M.Ott.
2910
2911 2005-09-27  Jim Meyering  <jim@meyering.net>
2912
2913         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2914
2915         * intprops.h (signed_type_or_expr__): Define.
2916         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2917         for unsigned types.
2918
2919 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2920
2921         * verify.h (verify_expr): Remove, replacing with:
2922         (verify_true): New macro that returns true instead of void.
2923         (verify_type__): Remove.
2924         (verify): Use verify_true rather than verify_type__.
2925
2926 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2927
2928         * utimens.c (ENOSYS): Define if not already defined.
2929         (futimens): Support having a null PATH if the file descriptor
2930         is nonnegative.
2931
2932         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2933         Remove.
2934         (__attribute): Define to empty unless GCC 3.1 or later.
2935         This works around a core dump on OpenBSD 3.4, which has GCC
2936         2.95.3, which dumps core when given __attribute__(()).  It also
2937         simplifies other tests, since we really don't want to bother with
2938         worrying about which ancient version of GCC supported what.
2939         Original problem reported by Yoann Vandoorselaere, with part of
2940         the fix suggested by Derek Price.
2941
2942 2005-09-24  Jim Meyering  <jim@meyering.net>
2943
2944         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2945         so we can once again use a positive bitfield width of 1 -- now we
2946         don't have to explain why we were using a bitfield width of 2.
2947
2948 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2949
2950         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2951         Problem reported by Eric Blake.
2952         (getaddrinfo): Initialize se so that it's not garbage.
2953         Redo internal storage allocation so that it doesn't make unportable
2954         assumptions about alignment.
2955         Fix a memory leak.
2956
2957         * utimens.c (futimens): Use futimesat if available.
2958         Prefer it to futimes since it doesn't have the futimes bug.
2959
2960         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2961         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2962         Instead, declare a function that returns a pointer to an array,
2963         and use verify_type__ to declare the size of the array.
2964         Problem and germ of a solution reported by Bruno Haible.
2965         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2966         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2967
2968 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2969
2970         Sync from coreutils.
2971
2972         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2973         stat-time.h.
2974         * argmatch.h: Include verify.h
2975         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2976         (ARGMATCH_ASSERT): Remove; unused.
2977         * canonicalize.c: Assume STDC_HEADERS.
2978         * exclude.c: Include "strcase.h".
2979         * regex_internal.h [!defined _LIBC]: Likewise.
2980         * getusershell.c: Include stdio--.h rather than stdio.h
2981         and stdio-safer.h.
2982         (getusershell): Call fopen, not fopen_safer.
2983         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2984         Do not include unistd-safer.h.
2985         (save_cwd): Don't call fd_safer; no longer needed
2986         now that we include fcntl--.h.
2987
2988         * getdate.y (relative_time): New type.
2989         (RELATIVE_TIME_0): New constant.
2990         (parser_control): Use relative_time instead of doing it ourselves.
2991         (%union): Add new relative_time rel member.
2992         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2993         Now typeless.
2994         (relunit, relunit_snumber): Now of type rel.
2995         (zone, rel, relunit, get_date): Adjust to above changes.
2996
2997         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2998         Do not include unistd-safer.h.
2999         (getloadavg): Don't call fd_safer; no longer needed
3000         now that we include fcntl--.h.
3001
3002         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3003         (make_dir_parents): Treat ENOSYS like EEXIST.
3004
3005         Improve quality of diagnostics on restore_cwd failure.
3006         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
3007         (make_dir_parents): Last arg is now int * (for errno), not bool *.
3008         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3009         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3010         each time through the loop.  Do not diagnose restore_cwd failure;
3011         that is the caller's job (and perhaps the caller does not care).
3012
3013         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3014         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3015         If the file already exists but is not a directory, don't bother
3016         to try to make its parents.
3017         Close potential file descriptor leak if we can't chdir("/") (!).
3018         Don't always return true if chdir($PWD) fails; return true only
3019         if the requested action was done successfully (except for the
3020         chdir($PWD)).
3021         Don't log final directory unless we actually made it.
3022         Refactor to avoid duplicate code to fix up permissions.
3023         Don't attempt to fix up parent permissions if chdir($PWD) fails.
3024
3025         * strftime.c (my_strftime): Rewrite the previous change slightly,
3026         to make it a bit faster and (I hope) clearer.
3027         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3028         Fix bug in formats like %2N.
3029
3030         * verify.h: New file.
3031
3032 2005-09-22  Jim Meyering  <jim@meyering.net>
3033
3034         Sync from coreutils.
3035
3036         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3037
3038         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3039         the .tm_year member, since otherwise gcc-4.0 would now warn about
3040         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3041
3042         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3043         order to avoid an unsuppressible warning from gcc on 64-bit systems.
3044
3045         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3046         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3047         when run in a time zone for which daylight savings time is in effect
3048         for the starting date.
3049
3050         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3051         stop us from restricting permissions of just-created absolute-named
3052         directories.
3053         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3054         to restore initial working directory.
3055         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3056         to tell caller if/when we change the working directory and are
3057         unable to return to the initial one.
3058         * mkdir-p.h (make_dir_parents): Update prototype.
3059         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3060         `return false'.  This fixes a bug introduced on 2004-07-30.
3061
3062         * openat.c (fdopendir): Be sure to close the supplied
3063         file descriptor before returning.  This makes our replacement
3064         implementation a little closer to Solaris's, where fdopendir
3065         ties the file descriptor to the returned DIR* pointer.
3066         * openat.c (unlinkat): New function.
3067         * openat.h (unlinkat): Add prototype.
3068         * openat-die.c (openat_save_fail): Rename from openat_save_die.
3069         (openat_restore_fail): Rename from openat_restore_die.
3070         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3071
3072         Provide an alternative to exiting immediately upon save_cwd or
3073         restore_cwd failure.  Now, an application can arrange e.g.,
3074         to perform a longjump in that case.
3075         * openat.c: Include dirname.h.
3076         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3077         (rpl_openat, fdopendir, fstatat): Call openat_save_die
3078         and openat_restore_die rather than calling error directly.
3079         Don't include "error.h" or "exitfail.h"; they're no longer needed.
3080
3081         * openat-die.c (openat_save_die, openat_restore_die): New file.
3082         * openat.h (openat_save_die, openat_restore_die): Declare and define.
3083
3084         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3085         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3086                             int utc, int nanoseconds);
3087         Background:
3088         date should not have to allocate a megabyte of virtual memory to
3089         handle a format argument like +%1048575T.  When implemented with
3090         strftime, it must allocate such a buffer, use strftime to fill it
3091         in, print it, then free it.
3092         With fprintftime, it simply prints everything and exits.
3093         With no need for memory allocation, that's one fewer way to fail.
3094         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3095         optional field width, not before, so we accept %9:z, not %:9z.
3096         (my_strftime): Be sure to use L_('x') for literals.
3097
3098         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3099         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3100         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3101         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3102         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3103         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3104         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3105         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3106         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3107
3108         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3109         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3110         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3111         and don't include <sys/file.h>).
3112
3113 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
3114
3115         Sync from coreutils.
3116
3117         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3118         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3119         [!LDAV_DONE]: Avoid unused variable warning.
3120
3121 2005-09-21  Bruno Haible  <bruno@clisp.org>
3122
3123         * unicodeio.h (unicode_to_mb): New declaration.
3124
3125 2005-09-20  Derek Price  <derek@ximbiot.com>
3126
3127         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3128
3129 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3130
3131         Use a consistent style for including <config.h>.
3132         * __fpending.c, acl.c, argmatch.c,
3133         argp-help.c, argp-parse.c,
3134         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3135         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3136         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3137         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3138         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3139         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3140         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3141         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3142         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3143         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3144         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3145         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3146         modechange.c, mountlist.c, open-safer.c, physmem.c,
3147         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3148         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3149         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3150         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3151         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3152         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3153         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3154         userspec.c, utimecmp.c, version-etc-fsf.c,
3155         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3156         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3157         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3158         Standardize inclusion of config.h.
3159         * __fpending.h, dirfd.h, getdate.h, human.h,
3160         inttostr.h:  Removed inclusion of config.h from header files.
3161         * inttostr.c:  Adjusted in-tree users.
3162         * timespec.h: Remove superfluous warning to include config.h.
3163         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3164         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3165         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3166         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3167
3168 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3169
3170         * stat-time.h: New file.
3171         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3172         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3173         in a different way.
3174         (timespec_cmp): New function.
3175         * utimecmp.c: Include stat-time.h.
3176         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3177         members exist, not on the obsolescent ST_MTIM_NSEC.
3178         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3179
3180 2005-09-15  Derek Price  <derek@ximbiot.com>
3181             Paul Eggert  <eggert@cs.ucla.edu>
3182
3183         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3184         changes, consolidating in...
3185         * regex_internal.h: ...this file.
3186
3187 2005-09-15  Derek Price  <derek@ximbiot.com>
3188
3189         * regex_internal.h: Blank `pure' for GNUC < 3.
3190         * regex_internal.c: Ditto, using this...
3191         (__GNUC_PREREQ): ...new macro.
3192         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3193         (__GNUC_PREREQ): ...this new macro.
3194
3195         * strstr.h: Include string.h. Define strstr as a macro here.
3196
3197 2005-09-13  Derek Price  <derek@ximbiot.com>
3198
3199         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3200         failure.
3201         Reported by Jim Meyering  <jim@meyering.net>.
3202
3203 2005-09-13  Jim Meyering  <jim@meyering.net>
3204
3205         * canon-host.c: Filter through gnu indent and reword comments slightly.
3206         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3207
3208 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3209
3210         * base64.c: Typo.
3211         (base64_encode): Put b64str in initialized data section.
3212
3213 2005-09-12  Derek Price  <derek@ximbiot.com>
3214
3215         Return usable errors from canon-host.
3216         * canon-host.h: New file.
3217         * canon-host.c (canon_host): Wrap...
3218         (canon_host_r): ...this new function, which now relies exclusively on
3219         getaddrinfo.
3220         (ch_strerror): New function.
3221         (last_cherror): New global.
3222         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3223         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3224         void *.
3225         (freeaddrinfo): Free ai->ai_canonname when set.
3226
3227 2005-09-12  Derek Price  <derek@ximbiot.com>
3228             Paul Eggert  <eggert@cs.ucla.edu>
3229
3230         * glob-libc.h: Renamed from glob_.h.  The new version is
3231         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3232         protecting things that should be done only in gnulib contexts.
3233         * glob_.h: New file, containing only the glob things needed for
3234         gnulib.
3235         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3236         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3237         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3238         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3239         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3240         and to respect the namespace rules better.
3241
3242 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3243
3244         Merge glibc and coreutils changes into gnulib, plus a few
3245         extra fixes.
3246         * md5.c: Use #error rather than a string.
3247         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3248         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3249         (__attribute__): Define to empty for non recent-GCC.
3250         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3251         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3252         Renamed from their non-__ counterparts, with new macros replacing
3253         them if not _LIBC.  Add __THROW attribute.
3254         (rol): Remove.
3255         (struct md5_ctx): Align buffer if using GCC.
3256         * sha1.h (struct sha1_ctx): Likewise.
3257         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3258         The old name was backwards.
3259         (NOTSWAP): Remove; not used.
3260         (rol): New macro, moved here from md5.h.
3261         (sha1_process_block): Remove a FIXME that doesn't make sense.
3262
3263 2005-09-12  Derek Price  <derek@ximbiot.com>
3264
3265         * gai_strerror.c: Include config.h when available.  Include
3266         getaddrinfo.h before other headers to test interface.
3267         Reported by Larry Jones <lawrence.jones@ugs.com>.
3268
3269 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3270
3271         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3272         definitions, since that's the preferred style in glibc.
3273         Fix a minor spacing issue, and update copyright notice to match glibc's.
3274
3275 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3276
3277         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3278
3279 2005-09-06  Simon Josefsson  <jas@extundo.com>
3280
3281         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3282         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3283
3284 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3285
3286         Change bitset word type from unsigned int to unsigned long int,
3287         as this has better performance on typical 64-bit hosts.
3288         Port bitset code to hosts with unusual word sizes.
3289         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3290         (build_collating_symbol):
3291         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3292         argument is a bitset.  This is merely a style issue, but it makes
3293         it clearer that an entire array is expected.
3294         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3295         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3296         Port to the case where bitset_word is not the same as unsigned int.
3297         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3298         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3299         Likewise.
3300         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3301         (build_trtable, group_nodes_into_DFAstates):
3302         Likewise.
3303         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3304         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3305         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3306         * regexec.c (group_nodes_into_DFAstates): Likewise.
3307         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3308         * regcomp.c (optimize_subexps, lower_subexp):
3309         Work even if bitset_word has holes in its bitwise representation.
3310         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3311         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3312         Likewise.
3313         * regex_internal.c (re_string_reconstruct):
3314         Don't assume UCHAR_MAX == 255.
3315         * regex_internal.h (bitset_set_all): Likewise.
3316         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3317         All uses changed.
3318         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3319         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3320         All uses changed.
3321         (BITSET_WORD_MAX): New macro.
3322         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3323         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3324         (bitset_empty, bitset_copy):
3325         Prefer sizeof (bitset) to multiplying it out ourselves.
3326         (bitset_not_merge): Remove; unused.
3327         (bitset_contain): Return bool, not unsigned int with one bit on.
3328         All callers changed.
3329         * regexec.c (build_trtable): Don't assume bitset has no stricter
3330         alignment than re_node_set; do this by defining a new internal
3331         type struct dests_alloc and using it to allocate memory.
3332
3333 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3334
3335         Check for arithmetic overflow when calculating sizes, to prevent
3336         some buffer-overflow issues.  These patches are conservative, in the
3337         sense that when I couldn't determine whether an overflow was possible,
3338         I inserted a run-time check.
3339         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3340         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3341         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3342         (re_xnrealloc, re_x2nrealloc): New inline functions.
3343         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3344         (build_equiv_class, build_charclass): Check for arithmetic overflow
3345         in size expression calculations.
3346         * regex_internal.c (re_string_realloc_buffers):
3347         (build_wcs_upper_buffer, re_node_set_add_intersect):
3348         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3349         (re_dfa_add_node, register_state): Likewise.
3350         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3351         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3352         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3353         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3354
3355 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3356
3357         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3358         to avoid a collision with bits/local_lim.h in glibc.
3359         All uses changed.  Problem reported by Dmitry V. Levin in
3360         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3361
3362         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3363         bugs in int versus size_t comparisons.
3364         (re_string_context_at): Fix bug where the code assumed that
3365         Idx is signed.
3366
3367         Use bool where appropriate.
3368         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3369         All callers changed.
3370         (calc_eclosure_iter): Likewise, for ROOT arg.
3371         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3372         (build_charclass_op): Likewise, for NON_MATCH arg.
3373         * regex_internal.c (re_string_allocate, re_string_construct):
3374         (re_string_construct_common): Likewise, for ICASE arg.
3375         * regexec.c (re_search_2_stub, re_search_stub):
3376         Likewise, for RET_LEN arg.
3377         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3378         (set_regs): Likewise, for FL_BACKTRACK arg.
3379         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3380         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3381         (calc_eclosure_iter, parse_bracket_exp):
3382         Use bool for internal variables that are booleans.
3383         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3384         (set_regs, build_sifted_states, sift_states_bkref):
3385         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3386         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3387         (find_collation_sequence_value):
3388         Likewise.
3389         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3390         (re_node_set_compare):
3391         Return bool, not int. All callers changed.
3392         * regexec.c (check_halt_node_context, check_dst_limits):
3393         (build_trtable, check_node_accept): Likewise.
3394         * regex_internal.h: Include stdbool.h.
3395
3396         Fix bugs uncovered when converting to bool.
3397         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3398         failure instead of charging ahead blindly.
3399         * regex_internal.c (register_state): Likewise.
3400         * regexec.c (re_search_2_stub): Use simpler method than boolean
3401         for freeing internal storage.
3402         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3403         bitset pieces used as boolean, to avoid undefined behavior
3404         on hosts that do int overflow checking.
3405
3406 2005-08-31  Derek Price  <derek@ximbiot.com>
3407
3408         * getdelim.c (getdelim): Return EOF on EOF.
3409         Reported by Larry Jones <lawrence.jones@ugs.com>.
3410
3411 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3412
3413         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3414         lengths fit in regoff_t; this isn't true if regoff_t is the same
3415         width as size_t.
3416         * regex.c (re_search_internal): 5th arg is LAST_START
3417         (= START + RANGE) instead of RANGE.  This avoids overflow
3418         problems when regoff_t is the same width as size_t.
3419         All callers changed.
3420         (re_search_2_stub): Check for overflow when adding the
3421         sizes of the two strings.
3422         (re_search_stub): Check for overflow when adding START
3423         to RANGE; if it occurs, substitute the extreme value.
3424
3425 2005-08-31  Jim Meyering  <jim@meyering.net>
3426
3427         * regcomp.c (search_duplicated_node): Make first pointer arg
3428         a pointer-to-const.
3429         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3430         (register_state): Likewise.
3431         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3432         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3433         (group_nodes_into_DFAstates): Likewise.
3434
3435 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3436
3437         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3438         old glibc regex code mishandles strings longer than 2**31 bytes.
3439         This patch fixes this when the regex code is used in gnulib
3440         (i.e., outside glibc).
3441
3442         This patch should not affect the use of the regex code inside
3443         glibc.  No doubt this problem also needs to be handled for glibc
3444         as well, but the result will be an incompatible change to the
3445         glibc ABI, and the old ABI will have to be supported too.  That
3446         can be the the subject for another patch.
3447
3448         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3449         governing whether the rest of this patch is active.  By default,
3450         the macro is disabled and the patch has no effect.
3451         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3452         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3453         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3454         (re_match_2, re_set_registers): Use the new types.
3455         * regex_internal.h (Idx, re_hashval_t): New types.
3456         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3457         New macros.
3458         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3459         (re_string_context_at, bin_tree_t, re_dfastate_t):
3460         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3461         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3462         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3463         (re_string_char_size_at, re_string_wchar_at):
3464         (re_string_elem_size_at):
3465         Use the new types and macros to port to 64-bit hosts.
3466         Use unsigned types for internal values, so that the code
3467         mostly works even for arrays larger than SSIZE_MAX.
3468         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3469         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3470         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3471         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3472         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3473         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3474         (calc_inveclosure, parse_dup_op, build_range_exp):
3475         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3476         (fetch_number, create_token_tree, mark_opt_subexp):
3477         Likewise.
3478         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3479         (create_cd_newstate, re_string_allocate, re_string_construct):
3480         (re_string_realloc_buffers, build_wcs_upper_buffer):
3481         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3482         (re_string_reconstruct, re_string_peek_byte_case):
3483         (re_string_fetch_byte_case, re_string_context_at):
3484         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3485         (re_node_set_init_copy, re_node_set_add_intersect):
3486         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3487         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3488         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3489         (re_acquire_state, re_acquire_state_context, register_state):
3490         Likewise.
3491         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3492         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3493         (re_search_internal, re_search_2_stub, re_search_stub)
3494         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3495         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3496         (update_cur_sifted_state, check_dst_limits):
3497         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3498         (check_subexp_limits, sift_states_bkref, merge_state_array):
3499         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3500         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3501         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3502         (expand_bkref_cache, check_node_accept_bytes):
3503         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3504         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3505         (acquire_init_state_context, check_halt_node_context):
3506         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3507         (sift_states_backward, clean_state_log_if_needed):
3508         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3509         (find_recover_state, transit_state_sb, transit_state_mb):
3510         (transit_state_bkref, build_trtable, match_ctx_clean):
3511         Likewise.
3512         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3513         to work around an assumption that REG_MISSING is negative.
3514
3515         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3516         (seek_collating_symbol_entry) [defined _LIBC]:
3517         (lookup_collation_sequence_value) [defined _LIBC]:
3518         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3519         Use prototypes rather than old-style function definitions.
3520         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3521         (transit_state_sb) [0]:
3522         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3523
3524         * regexec.c (re_search_internal): Simplify update of rm_so and
3525         rm_eo.
3526
3527         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3528         (optimize_subexps, lower_subexp):
3529         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3530         since the signed shift might overflow.  Use 1u<<31 instead.
3531         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3532         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3533         Likewise.
3534
3535         * regcomp.c (optimize_subexps, lower_subexp):
3536         Use CHAR_BIT rather than 8, for clarity.
3537         * regexec.c (check_dst_limits_calc_pos_1):
3538         (check_subexp_matching_top): Likewise.
3539         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3540         have to worry about portability issues when shifting it left.
3541         Remove no-longer-needed test for table_size > 0.
3542         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3543         in a word, as the resulting behavior is undefined.
3544         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3545         in one case, a <= should have been an <, and in another case the
3546         whole test was missing.
3547         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3548         the standard name CHAR_BIT.
3549         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3550         this is not true on one's complement and signed-magnitude hosts.
3551
3552         * regex_internal.h (re_sub_match_top_t): Remove unused member
3553         next_last_offset.
3554         (struct re_dfa_t): Remove unused member states_alloc.
3555         * regcomp.c (init_dfa): Don't initialize unused members.
3556
3557 2005-08-31  Bruno Haible  <bruno@clisp.org>
3558
3559         * strstr.c: Include <stddef.h>, for NULL.
3560         * strcasestr.c: Likewise.
3561         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3562
3563 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3564
3565         * iconvme.h: Add prototype for iconv_alloc.
3566
3567 2005-08-29  Simon Josefsson  <jas@extundo.com>
3568
3569         * iconvme.c: Fix errno.
3570
3571 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3572
3573         * iconvme.c: Split iconv_string into iconv_alloc.
3574
3575 2005-08-27  Jim Meyering  <jim@meyering.net>
3576
3577         * fopen-safer.c: Merge minor changes from coreutils.
3578         * dup-safer.c: Likewise.
3579         * fd-safer.c: Likewise.
3580
3581         Merge from coreutils.
3582         * stdio--.h: New file.
3583         * stdlib--.h: New file.
3584         * mkstemp-safer.c: New file.
3585
3586         GNU tar needs these.
3587         * pipe-safer.c: New file.
3588         * creat-safer.c: New file.
3589         * fcntl--.h (creat): Define to creat_safer.
3590         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3591         * unistd--.h (pipe): Define to pipe_safer.
3592         * unistd-safer.h: Declare pipe_safer.
3593
3594 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3595
3596         * regex_internal.h: Remove all references to
3597         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3598         or better.
3599         (bitset_not, bitset_merge, bitset_not_merge):
3600         (bitset_mask, re_string_allocate, re_string_construct):
3601         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3602         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3603         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3604         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3605         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3606         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3607         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3608         (re_acquire_state_context):
3609         Remove unnecessary forward decls.
3610         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3611         Put __attribute at function definition,
3612         now that the function decl has been removed.
3613         * regex_internal.c (re_string_peek_byte_case):
3614         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3615         Likewise.
3616
3617 2005-08-26  Simon Josefsson  <jas@extundo.com>
3618
3619         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3620         Haible <bruno@clisp.org>.
3621
3622 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3623
3624         * regexec.c (set_regs): Don't alloca with an unbounded size.
3625
3626         alloca modernization/simplification for regex.
3627         * regex.c: Remove portability cruft for alloca.  This no longer
3628         needs to be at the start of the file, and can be moved into
3629         regex_internal.h and simplified.
3630         * regex_internal.h: Include <alloca.h>.
3631         (__libc_use_alloca) [!defined _LIBC]: New macro.
3632         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3633         now works outside glibc.
3634
3635 2005-08-24  Simon Josefsson  <jas@extundo.com>
3636
3637         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3638         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3639         GLIBC specific code.
3640
3641 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3642
3643         Make regex safe for g++.  This fixes one real bug (an "err"
3644         that should have been "*err").  g++ problem reported by
3645         Sam Steingold.
3646         * regex_internal.h (re_calloc): New macro, consistent with
3647         re_malloc etc.  All callers of calloc changed to use re_calloc.
3648         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3649         not int.  All callers changed.
3650         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3651         just use an array of size MB_LEN_MAX.
3652         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3653         (find_recover_state): Change "err" to "*err"; this fixes what
3654         appears to be a real bug.
3655         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3656         versus int.
3657
3658 2005-08-25  Jim Meyering  <jim@meyering.net>
3659
3660         * open-safer.c: Include <config.h>.
3661         Otherwise, we'd lose LARGEFILE support in any file using
3662         e.g. "fcntl--.h"
3663
3664 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3665
3666         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3667         * regex.h (regerror): Likewise.
3668
3669         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3670         requires this.  (The code never needed it.)
3671
3672         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3673         All uses of recently-renamed identifiers changed to use the new,
3674         POSIX-compliant names.  The code will build and run just fine
3675         without these changes, but it's better to eat our own dog food
3676         and use the standard-conforming names.
3677
3678         * regex.h: Fix a multitude of POSIX name space violations.
3679         These changes have an effect only for programs that define
3680         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3681         do not change anything for programs compiled in the normal way.
3682         Also, there is no effect on the ABI.
3683
3684         (_REGEX_SOURCE): New macro.
3685         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3686         defined and _GNU_SOURCE is not; this fixes a name space violation.
3687
3688         Rename the following macros to obey POSIX requirements.
3689         The old names are still visible as macros if _REGEX_SOURCE is defined.
3690         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3691         RE_BACKSLASH_ESCAPE_IN_LISTS.
3692         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3693         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3694         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3695         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3696         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3697         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3698         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3699         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3700         (REG_INTERVALS): renamed from RE_INTERVALS.
3701         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3702         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3703         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3704         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3705         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3706         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3707         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3708         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3709         RE_UNMATCHED_RIGHT_PAREN_ORD.
3710         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3711         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3712         (REG_DEBUG): renamed from RE_DEBUG.
3713         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3714         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3715         unusual, since we can't clash with the POSIX REG_ICASE.
3716         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3717         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3718         (REG_NO_SUB): renamed from RE_NO_SUB.
3719         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3720         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3721         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3722         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3723         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3724         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3725         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3726         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3727         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3728         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3729         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3730         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3731         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3732         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3733         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3734         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3735         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3736         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3737         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3738         (REG_FIXED): Renamed from REGS_FIXED.
3739         (REG_NREGS): Renamed from RE_NREGS.
3740
3741         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3742         of other REG_* macros, since POSIX says the user is allowed to
3743         #undef these macros selectively.
3744
3745         (reg_errcode_t): Update comment stating what other tables need
3746         to be consistent.
3747
3748         Rename the following enum values to obey POSIX requirements.
3749         The old names are still visible as macros.
3750         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3751         is not defined, since GNU is supposed to be a superset of POSIX as
3752         much as possible, and since we want reg_errcode_t to be a signed
3753         type for implementation consistency.
3754         (_REG_NOERROR): Renamed from REG_NOERROR.
3755         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3756         (_REG_BADPAT): Renamed from REG_BADPAT.
3757         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3758         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3759         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3760         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3761         (_REG_EBRACK): Renamed from REG_EBRACK.
3762         (_REG_EPAREN): Renamed from REG_EPAREN.
3763         (_REG_EBRACE): Renamed from REG_EBRACE.
3764         (_REG_BADBR): Renamed from REG_BADBR.
3765         (_REG_ERANGE): Renamed from REG_ERANGE.
3766         (_REG_ESPACE): Renamed from REG_ESPACE.
3767         (_REG_BADRPT): Renamed from REG_BADRPT.
3768         (_REG_EEND): Renamed from REG_EEND.
3769         (_REG_ESIZE): Renamed from REG_ESIZE.
3770         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3771         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3772         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3773         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3774         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3775
3776         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3777         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3778         changed.  But support the old name if the new one is not defined
3779         and if _REGEX_SOURCE.
3780
3781         Change the following member names in struct re_pattern_buffer.
3782         The old names are still supported if !_REGEX_SOURCE.
3783         The new names are always supported, regardless of _REGEX_SOURCE.
3784         (re_buffer): Renamed from buffer.
3785         (re_allocated): Renamed from allocated.
3786         (re_used): Renamed from used.
3787         (re_syntax): Renamed from syntax.
3788         (re_fastmap): Renamed from fastmap.
3789         (re_translate): Renamed from translate.
3790         (re_can_be_null): Renamed from can_be_null.
3791         (re_regs_allocated): Renamed from regs_allocated.
3792         (re_fastmap_accurate): Renamed from fastmap_accurate.
3793         (re_no_sub): Renamed from no_sub.
3794         (re_not_bol): Renamed from not_bol.
3795         (re_not_eol): Renamed from not_eol.
3796         (re_newline_anchor): Renamed from newline_anchor.
3797
3798         Change the following member names in struct re_registers.
3799         The old names are still supported if !_REGEX_SOURCE.
3800         The new names are always supported, regardless of _REGEX_SOURCE.
3801         (rm_num_regs): Renamed from num_regs.
3802         (rm_start): Renamed from start.
3803         (rm_end): Renamed from end.
3804
3805         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3806         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3807         Prepend __ to parameter names.
3808
3809         Undo yesterday's changes.
3810
3811 2005-08-24  Jim Meyering  <jim@meyering.net>
3812
3813         Sync from coreutils.
3814         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3815
3816 2005-08-21  Bruno Haible  <bruno@clisp.org>
3817
3818         * lock.h: Add multiple inclusion guard.
3819         * tls.h: Add multiple inclusion guard.
3820
3821 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3822
3823         * regex.h (REG_NOSYS)
3824         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3825         Define, since POSIX requires it as of 2001.
3826         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3827         New private symbol, used to keep the enum signed in all cases.
3828         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3829         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3830
3831         * regex_internal.c (re_string_skip_chars, register_state):
3832         (calc_state_hash):
3833         Remove forward decls; no longer needed now that we use prototypes.
3834         * regexec.c (acquire_init_state_context, check_halt_node_context):
3835         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3836         (clean_state_log_if_needed): Likewise.
3837
3838 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3839
3840         Fix problems reported by Sam Steingold in
3841         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3842         * regexec.c (sift_states_bkref): Fix portability bug: the code
3843         assumed that reg_errcode_t is a signed type, which is not
3844         necessarily true if _XOPEN_SOURCE is not defined.
3845         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3846         some compilers warn about it otherwise.
3847
3848 2005-08-20  Jim Meyering  <jim@meyering.net>
3849
3850         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3851         of unused local, dfa.
3852
3853 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3854
3855         * regcomp.c (create_initial_state): Remove duplicate decl.
3856         (init_word_char, create_initial_state, duplicate_node_closure):
3857         (fetch_token, peek_token_bracket, build_range_exp):
3858         (build_collating_symbol): Remove forward decls; no longer needed
3859         now that we use prototypes.
3860
3861         * regcomp.c:
3862         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3863         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3864         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3865         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3866         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3867         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3868         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3869         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3870         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3871         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3872         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3873         (build_charclass, build_charclass_op, fetch_number, create_tree):
3874         (create_token_tree, mark_opt_subexp, duplicate_tree):
3875         Use prototypes rather than old-style definitions.
3876
3877         * regex_internal.c:
3878         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3879         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3880         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3881         (re_string_reconstruct, re_string_peek_byte_case):
3882         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3883         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3884         (re_node_set_init_copy, re_node_set_add_intersect):
3885         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3886         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3887         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3888         (re_acquire_state, re_acquire_state_context, register_state):
3889         (create_ci_newstate, create_cd_newstate, free_state):
3890         Likewise.
3891         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3892         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3893         (re_search_internal, prune_impossible_nodes):
3894         (acquire_init_state_context, check_matching, static):
3895         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3896         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3897         (update_regs, sift_states_backward, build_sifted_states):
3898         (clean_state_log_if_needed, merge_state_array):
3899         (update_cur_sifted_state, add_epsilon_src_nodes):
3900         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3901         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3902         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3903         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3904         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3905         (check_arrival, check_arrival_add_next_nodes):
3906         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3907         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3908         (check_node_accept_bytes, check_node_accept, extend_buffers):
3909         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3910         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3911         (sift_ctx_init):
3912         Likewise.
3913
3914         * regex_internal.h:
3915         (re_string_allocate, re_string_construct, re_string_reconstruct):
3916         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3917         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3918         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3919         (re_string_context_at, re_string_peek_byte_case):
3920         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3921         is defined, since we now use prototypes always.
3922
3923         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3924         C89 or better.  All uses removed.
3925
3926 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3927
3928         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3929         [defined lint]: Suppress bogus uninitialized-variable warnings.
3930
3931         * regcomp.c (duplicate_node): Return new index, not an error code,
3932         and let the caller return REG_ESPACE if out of space.  This
3933         removes an uninitialied-variable warning with GCC 4.0.1, and also
3934         avoids taking the address of a local variable.  All callers
3935         changed.
3936
3937 2005-08-19  Jim Meyering  <jim@meyering.net>
3938
3939         * regexec.c (proceed_next_node): Redo local variables to
3940         avoid GCC shadowing warnings.
3941
3942 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3943
3944         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3945         (re_node_set_insert_last, re_dfa_add_node):
3946         Rename local variables to avoid GCC shadowing warnings.
3947
3948 2005-08-18  Bruno Haible  <bruno@clisp.org>
3949
3950         * strstr.c (strstr): Fix return value in multibyte case.
3951         * strcasestr.c (strcasestr): Likewise.
3952
3953 2005-08-17  Jim Meyering  <jim@meyering.net>
3954
3955         Make the %s format (seconds since the epoch) work for a negative
3956         number and when used with a zero-padded field width, e.g. %015s.
3957
3958         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3959         label so that it precedes the code to set `digits'.  Otherwise,
3960         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3961         print `00-22'.  Now, it prints `-0022', as it should.
3962
3963 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3964
3965         * regex.h: Remove useless space-before-tab.  From coreutils.
3966
3967 2005-08-17  Bruno Haible  <bruno@clisp.org>
3968
3969         * strcasestr.h: New file.
3970         * strcasestr.c: New file.
3971
3972 2005-08-17  Bruno Haible  <bruno@clisp.org>
3973
3974         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3975         * strstr.c: Completely rewritten, with multibyte locale support.
3976
3977 2005-08-17  Bruno Haible  <bruno@clisp.org>
3978
3979         * strcasecmp.c: Use mbuiter.h.
3980
3981 2005-08-17  Bruno Haible  <bruno@clisp.org>
3982
3983         * mbuiter.h: New file.
3984
3985 2005-08-16  Bruno Haible  <bruno@clisp.org>
3986
3987         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3988         (mbi_init): Update.
3989         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3990         NUL byte, not after it.
3991
3992 2005-08-16  Bruno Haible  <bruno@clisp.org>
3993
3994         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3995         the valid ones. Makes the comparison operations transitive:
3996         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3997         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3998
3999 2005-08-16  Bruno Haible  <bruno@clisp.org>
4000
4001         * strcase.h (strcasecmp): Add note in comments.
4002         * strncasecmp.c: Use code from strcasecmp.c.
4003         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4004         (strcasecmp): Work correctly in multibyte locales.
4005
4006 2005-08-16  Bruno Haible  <bruno@clisp.org>
4007
4008         * strnlen1.h: New file.
4009         * strnlen1.c: New file.
4010
4011 2005-08-16  Bruno Haible  <bruno@clisp.org>
4012
4013         * mbfile.h: New file.
4014
4015 2005-08-16  Bruno Haible  <bruno@clisp.org>
4016
4017         * mbiter.h: New file.
4018
4019 2005-08-16  Bruno Haible  <bruno@clisp.org>
4020
4021         * mbchar.h: New file.
4022         * mbchar.c: New file.
4023
4024 2005-08-16  Bruno Haible  <bruno@clisp.org>
4025
4026         * tls.h: New file, from GNU gettext.
4027         * tls.c: New file, from GNU gettext.
4028
4029 2005-08-15  Bruno Haible  <bruno@clisp.org>
4030
4031         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4032         is defined.
4033
4034 2005-08-14  Jim Meyering  <jim@meyering.net>
4035
4036         Sync from coreutils.
4037
4038         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4039         Use the hash-table-based cycle-detection code not just when
4040         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4041         Reported by James Youngman in
4042         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4043         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4044         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4045         This lets us compile with -DFTS_DEBUG, once again.
4046         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4047         * fts.c (fd_safer): Remove decl.
4048         Include fcntl--.h rather than unistd-safer.h
4049         (fts_safe_changedir): Don't call fd_safer; no longer needed
4050         now that we include fcntl--.h.
4051
4052 2005-08-11  Simon Josefsson  <jas@extundo.com>
4053
4054         * readline.h, readline.c: New file.
4055
4056 2005-08-11  Bruno Haible  <bruno@clisp.org>
4057
4058         * strnlen.h (strnlen): Change parameter name to match comment.
4059
4060 2005-08-10  Simon Josefsson  <jas@extundo.com>
4061
4062         * strndup.c: Use strnlen.h.
4063
4064         * strnlen.h: New file.
4065
4066 2005-08-02  Simon Josefsson  <jas@extundo.com>
4067
4068         * getline.h, getline.c: Rewrite.
4069
4070         * getdelim.h, getdelim.c: New files, ported from glibc.
4071
4072 2005-07-31  Bruno Haible  <bruno@clisp.org>
4073
4074         * lock.h (gl_lock_initializer): New macro.
4075         (gl_lock_define_initialized): Use it.
4076         (gl_rwlock_initializer): New macro.
4077         (gl_rwlock_define_initialized): Use it.
4078         (gl_recursive_lock_initializer): New macro.
4079         (gl_recursive_lock_define_initialized): Use it.
4080
4081 2005-07-26  Bruno Haible  <bruno@clisp.org>
4082
4083         * lock.h: Update from GNU gettext.
4084         * lock.c: Update from GNU gettext.
4085
4086 2005-07-18  Bruno Haible  <bruno@clisp.org>
4087
4088         * lock.h (gl_once_t): New type.
4089         (gl_once_define, gl_once): New macros.
4090         * lock.c (fresh_once): New variable.
4091         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4092         functions.
4093
4094 2005-07-18  Simon Josefsson  <jas@extundo.com>
4095
4096         * check-version.c (check_version): Accept identical versions too.
4097
4098 2005-07-18  Bruno Haible  <bruno@clisp.org>
4099
4100         * lock.h: New file, from GNU gettext.
4101         * lock.c: New file, from GNU gettext.
4102
4103 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
4104
4105         * quotearg.c: Add translator comment suggested by Bruno Haible,
4106         with a minor change.
4107
4108 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4109
4110         * version-etc-fsf.c (version_etc_copyright): Parameterize the
4111         copyright symbol and the year.
4112         * version-etc.c (COPYRIGHT_YEAR): New constant.
4113         (version_etc_va): Use parameterized copyright notice.
4114         Reword to conform to the current GNU coding standards.
4115
4116 2005-07-11  Simon Josefsson  <jas@extundo.com>
4117
4118         * size_max.h: New file.
4119
4120 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4121
4122         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4123         block of defines.
4124
4125 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
4126        and  Paul Eggert  <eggert@cs.ucla.edu>
4127
4128         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4129         in wint_t, not wchar_t.  Remove now-unnecessary cast.
4130
4131 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4132
4133         * regex.c, regex.h: Sync from libc.
4134         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4135         New files, synced from libc, except that regex_internal.h
4136         currently has a small porting fix.
4137
4138 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
4139
4140         Remove the dependency of the strftime module on the tzset module.
4141         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4142         Copy the input structure, to work around some of the bug with
4143         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
4144         Solaris releases, you should also use the tzset module, but we won't
4145         require it as a dependency any more since we don't want LGPLed code
4146         to depend on GPLed code.
4147
4148 2005-07-02  Jim Meyering  <jim@meyering.net>
4149
4150         * backupfile.c (backup_args): Change a `0' to NULL.
4151
4152 2005-07-01  Jim Meyering  <jim@meyering.net>
4153
4154         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4155         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4156         * save-cwd.c, tempname.c:
4157         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4158         and don't include <sys/file.h>).
4159
4160 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4161
4162         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4163         declares only 'struct timespec;' (!).
4164
4165 2005-06-29  Jim Meyering  <jim@meyering.net>
4166
4167         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4168         type name.  Use the variable name instead.
4169         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4170
4171 2005-06-28  Simon Josefsson  <jas@extundo.com>
4172
4173         * check-version.h, check-version.c: New files.
4174
4175 2005-06-28  Simon Josefsson  <jas@extundo.com>
4176
4177         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4178         collision with global variable.  Better indentation.  Don't
4179         increment buffer pointer beyond buffer end.  Based on comments
4180         from Paul Eggert <eggert@cs.ucla.edu>.
4181
4182         * base64.h: Indent.
4183
4184 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4185
4186         * canon-host.c (canon-host): Append trailing "," to 0 in
4187         initializer of struct addrinfo, as an indication that we don't
4188         care how many members the structure has.
4189
4190 2005-06-24  Derek Price  <derek@ximbiot.com>
4191         and Bruno Haible  <bruno@clisp.org>
4192
4193         Remove stat module & update lstat.
4194         * stat.c: Remove this file...
4195         (slash_aware_lstat): ...moving this content and its support...
4196         * lstat.c (rpl_lstat): ...into here.
4197         * lstat.h: New file.
4198
4199 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4200
4201         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4202         (ranged_convert): Don't save conversion in a temporary struct.
4203         This causes a warning with GCC 4.0.0, and anyway in the typical
4204         case it's not worth the extra 100 bytes or so of code.
4205         (ranged_convert, __mktime_internal): When calling a function via a
4206         pointer P, use P () rather than (*P) (), as we now assume C89 or
4207         better.
4208
4209 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4210
4211         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4212         "who -r" failed to give output.  Problem reported by Tim Waugh.
4213
4214         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4215         (xcalloc): Use it to avoid needless tests.
4216         Problem reported by Jim Meyering.
4217
4218 2005-06-16  Jim Meyering  <jim@meyering.net>
4219
4220         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4221         when either N or S is zero.
4222
4223 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4224
4225         * argp.h (__option_is_short): Check upper limit of
4226         __key. Isprint() requires its argument to have the value
4227         of an unsigned char or EOF.
4228
4229 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4230
4231         * fnmatch.c (fnmatch): If there is an encoding error in a
4232         multibyte string or pattern, fall back on unibyte matching.
4233         Problem reported by James Youngman.
4234
4235 2005-06-08  Bruno Haible  <bruno@clisp.org>
4236
4237         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4238         warning on mingw.
4239
4240 2005-06-08  Bruno Haible  <bruno@clisp.org>
4241
4242         * csharpcomp.h: New file, from GNU gettext.
4243         * csharpcomp.c: New file, from GNU gettext.
4244         * csharpcomp.sh.in: New file, from GNU gettext.
4245
4246 2005-06-07  Derek Price  <derek@ximbiot.com>
4247
4248         Sync from CVS.
4249         * glob_.h: Indent nested #ifdef.
4250
4251 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4252
4253         Sync from coreutils.
4254         Use "file name" when talking about file names, instead of "filename"
4255         or "path", as per the GNU coding standards.
4256         * mkdir-p.c: Renamed from makepath.c.
4257         (make_dir_parents): Renamed from make_path.  All callers changed.
4258         * mkdir-p.h: Likewise.  All includers changed.
4259         * filenamecat.c: Renamed from path-concat.c.
4260         (file_name_concat): Renamed from path_concat.  All callers changed.
4261         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4262         * filenamecat.h: Likewise.  All includers changed.
4263         * acl.c: Don't use "path" or "filename" to mean "file name"
4264         in comments or local variable names.
4265         * basename.c: Likewise.
4266         * canonicalize.c, canonicalize.h: Likewise.
4267         * dirname.c, dirname.h: Likewise.
4268         * euidaccess.c: Likewise.
4269         * exclude.c: Likewise
4270         * fnmatch_.h, fnmatch_loop.c: Likewise.
4271         * fsusage.c, fsuage.h: Likewise.
4272         * fts.c, fts_.h: Likewise.
4273         * getcwd.c: Likewise.
4274         * getloadavg.c: Likewise.
4275         * mkstemp.c: Likewise.
4276         * mountlist.c, mountlist.h: Likewise.
4277         * openat.c, openat.h: Likewise.
4278         * readlink-stub.c: Likewise.
4279         * readutmp.c, readutmp.h: Likewise.
4280         * rename.c: Likewise.
4281         * rmdir.c: Likewise.
4282         * same.c: Likewise.
4283         * savedir.c: Likewise.
4284         * stripslash.c: Likewise.
4285         * tempname.c: Likewise.
4286         * xreadlink.c: Likewise.
4287         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4288         All uses changed.
4289         * exclude.h: Likewise.
4290
4291         * euidaccess.c (getuid, getgid, getuid, getegid)
4292         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4293         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4294         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4295         * pathmax.h: Include <limits.h> unconditionally, since other
4296         files have been getting away with it for years (MORE/BSD 4.3
4297         is extinct now).
4298         * userspec.c (getpwnam, getgrnam, getgrgid)
4299         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4300
4301         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4302         Define to 256, not 255, as per modern POSIX.
4303
4304 2005-06-01  Bruno Haible  <bruno@clisp.org>
4305
4306         * csharpexec.h: New file, from GNU gettext.
4307         * csharpexec.c: New file, from GNU gettext.
4308         * csharpexec.sh.in: New file, from GNU gettext.
4309
4310 2005-05-31  Derek Price  <derek@ximbiot.com>
4311             Paul Eggert  <eggert@cs.ucla.edu>
4312
4313         Sync from cvs.
4314         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4315
4316 2005-05-29  Derek Price  <derek@ximbiot.com>
4317             Paul Eggert  <eggert@cs.ucla.edu>
4318
4319         * glob_.h, glob.c: New files.
4320
4321 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4322
4323         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4324
4325         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4326         the configuration hassle isn't worth it.
4327         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4328         (LONGEST_MODIFIER, PRIuMAX): Remove.
4329
4330 2005-05-27  Bruno Haible  <bruno@clisp.org>
4331
4332         * getlogin_r.h: Remove second include of <stddef.h>.
4333
4334 2005-05-25  Bruno Haible  <bruno@clisp.org>
4335             Derek Price  <derek@ximbiot.com>
4336
4337         * getlogin_r.h: Simplify API documentation.
4338
4339 2005-05-25  Derek Price  <derek@ximbiot.com>
4340             Paul Eggert  <eggert@cs.ucla.edu>
4341
4342         * getlogin_r.c, getlogin_r.h: New files.
4343
4344 2005-05-22  Bruno Haible  <bruno@clisp.org>
4345
4346         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4347         Also include <sys/param.h> if it defines MIN, MAX.
4348         Based on a patch by Derek Price <derek@ximbiot.com>.
4349
4350 2005-05-22  Bruno Haible  <bruno@clisp.org>
4351
4352         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4353         (INT64_MIN): Fix definition.
4354         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4355
4356         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4357         NEED_SIGNED_INT_TYPES.
4358
4359         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4360         HAVE_SYSTEM_INTTYPES.
4361
4362 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4363
4364         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4365         so that unistd-safer.h (GPL'ed code) need not be included.
4366
4367 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4368
4369         New fts module.
4370         * fts.c: Don't include "cycle-check.h" or "hash.h".
4371         (setup_dir, free_dir): New functions.
4372         (enter_dir, leave_dir): Define trivial
4373         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4374         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4375         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4376         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4377         Move to fts-cycle.c.
4378         (fts_open): Use setup_dir.
4379         (fts_close): Use free_dir.
4380         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4381         This adds a label and some gotos, but the alternatives were messier.
4382         Check for memory allocation failure when entering a dir.
4383         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4384         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4385         (FTS): New member fts_cycle, that is a union that contains the
4386         old active_dir_ht and cycle_state.  All uses changed to mention
4387         fts_cycle.ht and fts_cycle.state.
4388         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4389         fts.c, with the following changes:
4390         (setup_dir, free_dir): New functions.
4391         (enter_dir): Now returns bool.  Return true if successful, false
4392         if memory exhausted.  All callers changed.
4393         Do not bother partly cleaning up on
4394         memory allocation failure; that is free_dir's job.
4395         However, free ad if hash_insert fails, to avoid memory leak.
4396         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4397         fts->fts_options to see which union member to use.
4398
4399 2005-05-20  Jim Meyering  <jim@meyering.net>
4400
4401         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4402         Now a macro, to pacify GCC.
4403
4404 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4405
4406         * chown.c (rpl_chown): Return -1 on failure.
4407
4408 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4409
4410         * canonicalize.c: Include canonicalize.h first, to test interface.
4411         Include <stddef.h> unconditionally, since we assume C89 now.
4412         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4413         * fts.c: Include fts_.h first, to check interface.
4414         Do not include intprops.h; no longer needed.
4415         Include cycle-check.h and hash.h, since fts_.h no longer does.
4416         Remove unnecessary casts of closedir to void.
4417         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4418         decide whether to decrement nlinks.
4419         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4420         (FTS): Use struct hash_table * instead of Hash_table, so that
4421         we no longer need to include hash.h here.
4422
4423 2005-05-17  Jim Meyering  <jim@meyering.net>
4424
4425         * fts.c, fts_.h: New files, from coreutils.
4426
4427 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4428
4429         Sync from coreutils.
4430         * unlinkdir.c, unlinkdir.h: New files.
4431         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4432         regex.h, unlocked-io.h, xtime.h:
4433         White space changes only.
4434         * makepath.c (make_path): Port to hosts where leading "//" is special.
4435         * yesno.c: Include getline.h, not ctype.h.
4436         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4437         Use getline to remove arbitrary restriction on response length.
4438
4439 2005-05-13  Bruno Haible  <bruno@clisp.org>
4440
4441         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4442         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4443         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4444         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4445         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4446         Add support for 64-bit integers in the MSVC compiler.
4447
4448 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4449
4450         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4451         Change the initial comment to refer to GPL, not LGPL.
4452         gnulib-tool will change it to LGPL as needed.
4453
4454         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4455         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4456         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4457         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4458         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4459         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4460         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4461         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4462         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4463         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4464         concatpath.c, config.charset, copy-file.c, copy-file.h,
4465         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4466         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4467         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4468         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4469         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4470         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4471         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4472         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4473         full-read.c, full-read.h, full-write.c, full-write.h,
4474         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4475         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4476         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4477         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4478         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4479         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4480         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4481         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4482         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4483         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4484         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4485         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4486         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4487         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4488         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4489         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4490         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4491         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4492         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4493         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4494         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4495         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4496         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4497         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4498         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4499         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4500         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4501         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4502         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4503         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4504         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4505         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4506         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4507         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4508         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4509         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4510         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4511         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4512         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4513         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4514         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4515         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4516         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4517         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4518         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4519         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4520         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4521         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4522         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4523         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4524         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4525         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4526         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4527         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4528         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4529         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4530         Update FSF postal mail address.
4531
4532 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4533
4534         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4535         specified in ai_socktype. Fix invalid ai_protocol
4536         check. ai_protocol is usually set to 0 or depending on
4537         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4538         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4539         ai_socktype / ai_protocol in the returned addrinfo structure.
4540
4541 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4542             Bruno Haible  <bruno@clisp.org>
4543
4544         * inet_ntop.h: New file.
4545         * inet_ntop.c: New file, from glibc with modifications.
4546
4547 2005-05-08  Jim Meyering  <jim@meyering.net>
4548
4549         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4550
4551 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         Merge from coreutils.  Among other things,
4554         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4555         * fd-safer.c: New file.
4556         * fcntl-safer.h, open-safer.c: Remove.
4557         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4558         * dup-safer.c: Include unistd-safer.h first.
4559         Don't include errno.h.
4560         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4561         * file-type.h: Don't assume invoker included sys/stat.h first.
4562         * file-type.c: Rely on file-type.h change.
4563         * getloadavg.c: Include unistd-safer.h.
4564         (getloadavg): Use safer open.
4565         * getusershell.c: Include "stdio-safer.h".
4566         (getusershell): Use safer fopen.
4567         * long-options.c (long_options): Use NULL rather than 0.
4568         * modechange.h (mode_free): Remove; all callers changed to invoke
4569         'free'.
4570         * modechange.c: Likewise.
4571         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4572         (MODE_DONE): New constant.
4573         (struct mode_change): Remove 'next' member.
4574         (make_node_op_equals): New function; like the old one of the
4575         same name, except it allocates an array.
4576         (mode_compile, mode_create_from_ref): Use it.
4577         (mode_compile): Allocate result as an array, not a linked list.
4578         Parse octal string ourself, so that we catch mistakes like "+0".
4579         (mode_adjust): Arg is an array, not a linked list.
4580         * modechange.c: Include stat-macros.h, xalloc.h.
4581         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4582         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4583         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4584         Remove.  This is now stat-macros.h's job.
4585         (talloc): Remove.  All callers replaced by xalloc, so that
4586         our invokers don't have to worry about reporting memory failures.
4587         (make_node_op_equals): Remove.
4588         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4589         New constants.
4590         (struct mode_change): Moved here from modechange.h.
4591         (mode_append_entry): Remove.
4592         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4593         apps to have incorrect behavior.  Use simpler algorithm for head
4594         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4595         Detect more invalid usages rather than having somewhat-random behavior.
4596         Don't insert an "a=" action, as that leads to incorrect behavior.
4597         (mode_compile, mode_create_from_ref): Return NULL on error instead
4598         of an enum, since now there's only one way to have an error.  All
4599         callers changed.
4600         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4601         at the correct time.  Simplify calculation of "+u" and its ilk.
4602         Don't mishandle "+X".
4603         (mode_free): Remove "register" and localize decls.
4604         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4605         (struct mode_change): Move to modechange.c; callers don't
4606         need to see this stuff.
4607         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4608         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4609         (mode_change, mode_adjust): Reflect the new signatures noted above.
4610         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4611         that might redefine system include files.
4612         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4613         (my_usleep): Use NULL rather than (void *) 0.
4614         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4615         Use siginterrupt to specify that system calls should be interrupted.
4616         (rpl_nanosleep): Move initialization of suspended closer to call of
4617         my_usleep.
4618         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4619         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4620         (desirable_utmp_entry): New function.
4621         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4622         using x2nrealloc, to simplify logic.
4623         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4624         size calculation.  Do not assume utmp file is a regular file.
4625         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4626         (READ_UTMP_CHECK_PIDS): New constant.
4627         * save-cwd.c: Include unistd-safer.h.
4628         (save_cwd): Use fd_safer.
4629         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4630         [!_LIBC] Include "stat-macros.h" instead.
4631         * unistd-safer.h (fd_safer): New decl.
4632
4633 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4634
4635         * byteswap_.h: New file.
4636
4637 2005-04-25  Albert Chin  <china@thewrittenword.com>
4638
4639         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4640         Toolkit C bug.
4641
4642 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4643
4644         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4645         that "UTC +1 second" continues to work.  Problem reported
4646         by Dmitry V. Levin.
4647         (relunit_snumber): New rule.
4648         (relunit): Use it.
4649
4650 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4651
4652         * getdate.y (universal_time_zone_table): New constant.
4653         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4654         universal_time_zone_table.
4655         (lookup_zone): Prefer universal_time_zone_table to
4656         local_time_zone_table, so that "GMT" time stamps are allowed in
4657         London during the summer.  Problem reported by Ian Abbott.
4658
4659 2005-04-12  Jim Meyering  <jim@meyering.net>
4660
4661         * human.c (humblock): Set *options even when returning due to
4662         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4663         warning from gcc-4.
4664
4665 2005-04-09  Jim Meyering  <jim@meyering.net>
4666
4667         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4668         -Wuninitialized: initialize tm0.tm_year.
4669
4670 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4671
4672         * getdate.y (parser_control): rels_seen is now a boolean, not a
4673         count, since there's no maximum.  All uses changed.
4674         Add member dsts_seen.
4675         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4676         not being INT_MAX.
4677         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4678         Use pc_rels_seen to decide whther a date is absolute.
4679
4680         * getdate.y (number): Don't overwrite year.
4681         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4682         check.
4683
4684 2005-04-02  Simon Josefsson  <jas@extundo.com>
4685
4686         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4687         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4688
4689 2005-03-27  Jim Meyering  <jim@meyering.net>
4690
4691         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4692
4693 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4694
4695         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4696         "one's complement" -> "ones' complement" in comment, as per Knuth.
4697         "value of type" -> "type or expression" in comment.
4698         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4699
4700 2005-03-26  Jim Meyering  <jim@meyering.net>
4701
4702         Comment nits.
4703         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4704         Correct typos: s/or/of/.
4705
4706 2005-03-23  Jim Meyering  <jim@meyering.net>
4707
4708         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4709
4710 2005-03-21  Jim Meyering  <jim@meyering.net>
4711
4712         Changes imported from coreutils.
4713
4714         * cycle-check.c: Don't include xalloc.h.
4715
4716         * path-concat.c: Don't include assert.h.
4717         (path_concat): Remove assertion that would have triggered
4718         for ABASE starting with more than one slash.
4719         Reported by Andreas Schwab.
4720
4721         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4722         properly when ABASE is an absolute file name.
4723         Correct the description of this function.
4724         Include <assert.h>.
4725         Add an assertion and a test driver.
4726         This fixes a bug introduced on 2004-07-02.
4727         Andreas Schwab reported the resulting failure of cp --parents:
4728         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4729
4730 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4731
4732         * strftime.c (my_strftime): If the underlying strftime returns 0
4733         (which shouldn't happen), generate nothing instead of returning 0
4734         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4735
4736 2005-03-16  Bruno Haible  <bruno@clisp.org>
4737
4738         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4739
4740 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4741
4742         * strftime.c (my_strftime): Prepend space to format so that we can
4743         reliably distinguish strftime failure from empty output on POSIX
4744         hosts.
4745
4746 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4747
4748         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4749         (iconv_string): Don't guess a size-zero buffer, as that might cause
4750         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4751         result would be 'too large', where 'too large' is (heuristically)
4752         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4753         overflow concerns.  This will prevent some unwanted malloc failures
4754         when the inputs are very large.
4755
4756 2005-03-15  Bruno Haible  <bruno@clisp.org>
4757
4758         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4759         'negate'.
4760
4761         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4762         variable.
4763
4764         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4765
4766 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4767
4768         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4769         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4770         intprops.h.
4771         * strtol.c: Likewise.
4772
4773 2005-03-14  Simon Josefsson  <jas@extundo.com>
4774
4775         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4776         <fx@gnu.org>.
4777
4778 2005-03-14  Jim Meyering  <jim@meyering.net>
4779
4780         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4781         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4782         to be nonzero so that we (and caller) can detect the difference
4783         between a valid zero-length expansion and an error return, even
4784         when the underlying strftime fails before writing anything into
4785         that location.
4786
4787 2005-03-10  Jim Meyering  <jim@meyering.net>
4788
4789         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4790         so that this module works on systems without fchdir.
4791
4792 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4793
4794         Factor int-properties macros into a single file, except for
4795         glibc-related files.
4796         * intprops.h: New file.
4797         * getloadavg.c: Include it instead of limits.h.
4798         (INT_STRLEN_BOUND): Remove.
4799         * human.c: Include intprops.h.
4800         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4801         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4802         * inttostr.h: Include intprops.h instead of limits.h.
4803         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4804         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4805         for consistency with intprops.h.
4806         (time_t_is_integer, twos_complement_arithmetic): Use them.
4807         * sig2str.h: Include <signal.h>, intprops.h.
4808         (INT_STRLEN_BOUND): Remove.
4809         * strftime.c (TYPE_SIGNED): Remove.
4810         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4811         * strtol.c: Adjust comments to match intprops.h.
4812         * userspec.c: Include intprops.h.
4813         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4814         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4815         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4816         instead of rolling our own expressions.
4817         * xstrtol.c: Include xstrtol.h first, to test interface.
4818
4819         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4820         instead of int.
4821         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4822         the right thing even if adding 1900 would overflow.  Similarly
4823         for tm_mon + 1 and tm_yday + 1.
4824         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4825         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4826         (DO_SIGNED_NUMBER): New macro.
4827         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4828
4829 2005-03-07  Bruno Haible  <bruno@clisp.org>
4830
4831         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4832
4833 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4834             Bruno Haible  <bruno@clisp.org>
4835
4836         * pagealign_alloc.h: New file.
4837         * pagealign_alloc.c: New file.
4838
4839 2005-01-28  Bruno Haible  <bruno@clisp.org>
4840
4841         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4842         stpncpy.c uses it.
4843
4844 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4845
4846         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4847         The workaround isn't strictly needed for POSIX conformance, and
4848         it's too much of a pain to configure and maintain.  We'll ask
4849         people to fix their kernels instead.
4850         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4851         (NANOSLEEP_BUG_WORKAROUND): Remove.
4852         (xnanosleep): Remove the workaround.
4853
4854 2005-02-12  Bruno Haible  <bruno@clisp.org>
4855
4856         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4857
4858 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4859
4860         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4861         * timespec.h (gettime): Return void, since it always
4862         succeeds now.  All uses changed.
4863         * gettime.c (gettime) Likewise.
4864         [HAVE_NANOTIME]: Prefer nanotime.
4865         Assume gettimeofday succeeds, as POSIX requires.
4866         Assime time () succeeds, since other code already does.
4867         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4868         (timespec_subtract): Remove.
4869         (NANOSLEEP_BUG_WORKAROUND): New constant.
4870         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4871         things considerably.  Use it only on GNU/Linux hosts, since the
4872         workaround shouldn't be needed elsewhere.
4873
4874 2005-02-24  Bruno Haible  <bruno@clisp.org>
4875
4876         * gettext.h: Update from GNU gettext 0.14.2.
4877
4878 2005-02-24  Bruno Haible  <bruno@clisp.org>
4879
4880         * localcharset.c: Update from GNU gettext 0.14.2.
4881         * config.charset: Update from GNU gettext 0.14.2.
4882
4883 2005-02-22  Simon Josefsson  <jas@extundo.com>
4884
4885         * iconvme.h, iconvme.c: New files, from libc.
4886
4887 2005-02-20  Neil Conway  <neilc@samurai.com>
4888
4889         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4890         returned by OSX/Darwin if the specified buffer is not large
4891         enough for the hostname.
4892
4893 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4894
4895         * memrchr.h: New file.
4896         * chdir-long.c: Include it.
4897         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4898         Don't bother including stddef.h.
4899
4900 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4901
4902         * argp-help.c (__argp_help): Create a fake struct argp_state and
4903         pass it to _help, otherwise the latter coredumps trying to
4904         dereference state.root_argp.
4905
4906 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4907
4908         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4909         inclusion.
4910         Include <sys/types.h>, for dev_t.
4911         (ME_DUMMY, ME_REMOTE): Move from here....
4912         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4913         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4914         Dmitry V. Levin.
4915         Include mountlist.h first, to test the interface.
4916
4917 2005-01-29  Bruno Haible  <bruno@clisp.org>
4918
4919         * progname.c (program_name): Initialize.
4920         Needed when linking statically on MacOS X.
4921
4922 2005-01-28  Bruno Haible  <bruno@clisp.org>
4923
4924         * javacomp.sh.in: New file, from GNU gettext.
4925         * javacomp.h: New file, from GNU gettext.
4926         * javacomp.c: New file, from GNU gettext.
4927
4928 2005-01-26  Bruno Haible  <bruno@clisp.org>
4929
4930         * javaexec.sh.in: New file, from GNU gettext.
4931         * javaexec.h: New file, from GNU gettext.
4932         * javaexec.c: New file, from GNU gettext.
4933
4934 2005-01-26  Simon Josefsson  <jas@extundo.com>
4935
4936         * gai_strerror.c: Use GPL in header.
4937
4938 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4939
4940         * argp-help.c (hol_entry_help): Avoid using non-constant
4941         initializers for struct pentry_state.
4942         (__argp_error): Check return value of __asprintf
4943         (__argp_failure): Translate error message
4944
4945         * argp-parse.c: Removed braces around the expansion of N_()
4946
4947 2005-01-21  Jim Meyering  <jim@meyering.net>
4948
4949         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4950         same value as for Solaris 9.
4951
4952         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4953         component length.  This included changing the parameter to be
4954         of type `char *' rather than `char const *'.
4955         * chdir-long.h (chdir_long): Update prototype.
4956
4957         * openat.c (fdopendir, fstatat): New functions.
4958         * openat.h: Include headers required for use of DIR and struct stat.
4959         [AT_SYMLINK_NOFOLLOW]: Define.
4960         (fdopendir, fstatat): Add prototypes.
4961
4962 2005-01-21  Bruno Haible  <bruno@clisp.org>
4963
4964         * classpath.h: New file, from GNU gettext.
4965         * classpath.c: New file, from GNU gettext.
4966
4967 2005-01-20  Simon Josefsson  <jas@extundo.com>
4968
4969         * version-etc-fsf.c: New file, with version_etc_copyright.
4970         * version-etc.c: Remove version_etc_copyright.
4971         * version-etc.h (version_etc_copyright): Use [] instead of * in
4972         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4973
4974 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4975
4976         * save-cwd.c (save_cwd): Remove code to support the case
4977         where fchdir is missing or flaky.
4978
4979 2005-01-20  Simon Josefsson  <jas@extundo.com>
4980
4981         * base64.h (isbase64): Add.
4982
4983         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4984         using a unsigned prototype, don't inline.
4985         (base64_decode): Use it.
4986
4987 2005-01-19  Bruno Haible  <bruno@clisp.org>
4988
4989         * sh-quote.h: New file, from GNU gettext.
4990         * sh-quote.c: New file, from GNU gettext.
4991
4992 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4993
4994         Merge changes from coreutils, as described below in several
4995         changelogs dated today.
4996
4997         * save-cwd.c: Include "save-cwd.h" before other include files.
4998         (O_DIRECTORY): Remove; not needed here, since "." must be
4999         a directory.  All uses removed.
5000         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
5001         universal on Suns, and we also need to test for IRIX.
5002         Revamp code to use 'if' rather than '#if'.
5003         Avoid unnecessary comparison of cwd->desc to 0.
5004
5005         * utimens.c (futimens): Robustify the previous patch, by checking
5006         for known valid error numbers rather than observed invalid ones.
5007
5008 2005-01-18  Jim Meyering  <jim@meyering.net>
5009
5010         * version-etc.c (version_etc_copyright): Update copyright date.
5011
5012         * utimens.c (futimens): Account for the fact that futimes
5013         can also fail with errno == ENOSYS or errno == ENOENT.
5014         Patch from Dmitry V. Levin.
5015
5016         Change the name of the robust chdir function from chdir to chdir_long.
5017         * save-cwd.c: Include chdir-long.h rather than chdir.h.
5018         (restore_cwd): Use chdir_long, not chdir.
5019         * chdir-long.c: Renamed from chdir.c.
5020         * chdir-long.h: Renamed from chdir.h.
5021         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5022         Hurd.
5023
5024 2005-01-18  Bob Proulx  <bob@proulx.com>
5025
5026         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5027         offsetof() macro construct to avoid compile failure with native HP-UX
5028         11.0 ANSI C compiler.
5029
5030 2005-01-06  Bruno Haible  <bruno@clisp.org>
5031
5032         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5033         because stpncpy.m4 takes care of it.
5034
5035 2004-01-24  Bruno Haible  <bruno@clisp.org>
5036
5037         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5038
5039 2003-10-09  Bruno Haible  <bruno@clisp.org>
5040
5041         * progreloc.c: Include xalloc.h instead of xmalloc.h.
5042
5043 2005-01-06  Bruno Haible  <bruno@clisp.org>
5044
5045         * fwriteerror.h (fwriteerror): Change specification to include fclose.
5046         * fwriteerror.c: Include <stdbool.h>.
5047         (fwriteerror): At the end, close the file stream. Record whether
5048         stdout was already closed.
5049
5050 2004-05-27  Bruno Haible  <bruno@clisp.org>
5051
5052         * execute.c (environ): Declare if needed.
5053         * pipe.c (environ): Likewise.
5054         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5055
5056 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
5057
5058         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5059         definitions to be after all include files, to avoid collisions.
5060         Problem reported by Bob Proulx.
5061
5062 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
5063
5064         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5065         not needed.  This removes a dependency on the gettext module.
5066         [defined _LIBC]: Do not include <libintl.h>; not needed.
5067
5068 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
5069
5070         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5071         HAVE_DECL_STRTOLD.
5072
5073 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
5074
5075         * argp-parse.c: Include <stddef.h>.
5076         (alignof, alignto): New macros.
5077         (parser_init): Don't assume that void * is aligned sufficiently
5078         for struct option.
5079
5080         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5081         need to extend the stack.
5082         (YYINITDEPTH): New macro, so that the initial stack isn't overly
5083         large.
5084
5085 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5086
5087         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5088
5089 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
5090
5091         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5092         Remove now-obsolete comment about AIX.
5093         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5094         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5095         (YYMAXDEPTH): New macro.
5096
5097 2004-12-18  Bruno Haible  <bruno@clisp.org>
5098
5099         * fatal-signal.c (fatal_signals): Make non-const.
5100         (init_fatal_signals): New function.
5101         (uninstall_handlers, install_handlers): Ignore signals that were set to
5102         SIG_IGN.
5103         (at_fatal_signal): Call init_fatal_signals.
5104         (init_fatal_signal_set): Likewise. Ignore signals that were set to
5105         SIG_IGN.
5106         Reported by Paul Eggert.
5107
5108 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
5109
5110         * getdate.y (textint): New member "negative".
5111         (time_zone_hhmm): New function.
5112         Expect 14 shift-reduce conflicts, not 13.
5113         (o_colon_minutes): New rule.
5114         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5115         (yylex): Set the "negative" member of signed numbers.
5116
5117 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
5118
5119         Changes imported from coreutils.
5120         * hard-locale.c: Assume <locale.h> exists.
5121         Include "strdup.h".
5122         (GLIBC_VERSION): New macro.
5123         (hard_locale): Assume setlocale exists.
5124         Rewrite to avoid #ifdef.
5125         Use strdup rather than malloc + strcpy.
5126         * human.c: Assume <locale.h> exists.
5127         (human_readable): Assume localeconv exists.
5128
5129 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5130
5131         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5132         convert T2, not T.  (Imported from libc.)
5133
5134 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5135
5136         * getcwd.c (is_ENAMETOOLONG): New macro.
5137         (__getcwd.c): Don't restore errno; glibc doesn't.
5138         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5139         first, falling back to our code only if its results look suspicious.
5140         Ensure that the resulting buffer is only as large as necessary.
5141
5142         * readutmp.c: Include readutmp.h first.
5143         Include <errno.h>, since readutmp.h no longer does that.
5144         * readutmp.h: Don't include <errno.h>,
5145         <sys/param.h>, <time.h>; not needed to establish interface.
5146         (errno): Remove decl.
5147         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5148         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5149         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5150
5151 2004-11-28  Simon Josefsson  <jas@extundo.com>
5152
5153         * base64.h, base64.c: New file.
5154
5155 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5158
5159 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5160
5161         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5162         HP's ANSI C compiler.
5163         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5164         Declaring int functions causes warnings on some modern systems and
5165         shouldn't be needed to compile on ancient ones.
5166         * same.c (MIN) [defined MIN]: Don't define, since it's already
5167         defined.
5168
5169         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5170         with the following changes.
5171         (__set_errno): Parenthesize properly.
5172         Include <stdbool.h>.
5173         (MIN, MAX, MATCHING_INO): New macros.
5174         (__getcwd): Define with prototype, not K&R form.
5175         Use heuristics to allocate default buffer on stack if possible.
5176         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5177         behavior, and to avoid the PATH_MAX limit when computing
5178         ../../../../...
5179         Use MATCHING_INO to compare inode number to file.
5180         Check for arithmetic overflow in size calculations.
5181         Fix bug in reallocation of dot array that caused getcwd to fail
5182         on directories nested deeper than 75.
5183         Be more careful about saving errno on error.
5184         Do not use realloc; use only free+malloc, as this is a bit
5185         more flexible and avoids a needless copy operation.
5186         Do not inspect st_dev and st_ino for symbolic links; POSIX
5187         doesn't specify the latter.
5188         Check for closedir errors.
5189         Avoid needless casts.
5190         Use "#ifdef weak_alias" around weak_alias, to be like other
5191         glibc code.
5192         The following changes to getcwd.c have effect only when used in
5193         gnulib; they have no effect inside glibc proper.
5194         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5195         as alloca isn't used.
5196         (alloca, __alloca): Likewise.
5197         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5198         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5199         unconditionally, as gnulib assumes C89 or better.
5200         Do not include <sys/param.h>.
5201         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5202         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5203         better.
5204         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5205         Include <dirent.h> in a way that is compatible with modern Autoconf.
5206         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5207         New macros, if not already defined.
5208         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5209         Use "_LIBC", not "defined _LIBC", for consistency.
5210         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5211         a mempcpy module.
5212         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5213         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5214         * xgetcwd.c: David MacKenzie's old code was removed, so give
5215         credit only to Jim Meyering and adjust the copyright dates.
5216         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5217         <stdlib.h>, <unistd.h>, "pathmax.h".
5218         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5219         (INITIAL_BUFFER_SIZE): Remove.
5220         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5221
5222 2004-11-23  Jim Meyering  <jim@meyering.net>
5223
5224         * getopt_.h: Remove trailing blanks.
5225
5226 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5227
5228         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5229         (futimens): New function, which uses futimes if available.
5230         (futimens, utimens): Support timespec==NULL, with same semantics
5231         as utime and utimens.
5232         * utimens.h (futimens): New decl.
5233
5234 2004-11-23  Jim Meyering  <jim@meyering.net>
5235
5236         * __fpending.c: Add comment.
5237
5238 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5239
5240         * getopt_.h: Re-addition of __getopt_argv_const caused
5241         redefinition warnings. To avoid them, include the defines
5242         in `#if !defined __need_getopt ... #endif'. The only place
5243         where __getopt_argv_const is used is in definitions
5244         of getopt_long and getopt_long_only below, which are as well
5245         protected by `#ifndef __need_getopt'.
5246         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5247         __need_getopt after including <stdio.h> and <unistd.h> These
5248         headers might have defined it.
5249
5250 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5251
5252         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5253         New macros.
5254         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5255         optopt): Use them instead of invoking ## directly; otherwise, the
5256         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5257
5258 2004-11-19  Bruno Haible  <bruno@clisp.org>
5259
5260         * strtok_r.c: Move comments from here...
5261         * strtok_r.h: ... to here.
5262
5263 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5264
5265         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5266         might fail.  Problem reported by Yoann Vandoorselaere.
5267         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5268         that mishandle size_t overflow.
5269
5270 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5271
5272         * canon-host.c: Include "strdup.h".
5273         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5274         Use strdup instead of malloc/strcpy to duplicate strings.
5275
5276         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5277         (human_space_before_unit): New constant.
5278         * human.c (human_readable): Support it.
5279
5280         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5281         (xgetcwd): Set errno correctly when failing.
5282         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5283         the failure is actually due to a PATH_MAX problem.
5284
5285         Further getopt changes to make it more likely that glibc will
5286         buy the changes back.
5287         * getopt.c (POSIXLY_CORRECT): New constant.
5288         (getopt): Use it, so to preserve glibc semantic
5289         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5290         when compiling for libc.
5291         * getopt_.h (__getopt_argv_const): Bring it back.
5292         (getopt_long, getopt_long_only): Use it.
5293
5294         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5295         New arg POSIXLY_CORRECT.  All callers changed.
5296         (getopt): Argv is now char * const *, as per standard.
5297         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5298         not char *__getopt_argv_const *.
5299         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5300         _getopt_long_only_r): Likewise.
5301         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5302         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5303         _getopt_long_r, _getopt_long_only_r): Likewise.
5304         * getopt_.h (__getopt_argv_const): Remove.
5305         (getopt): Argv is now char * const *, as per standard.
5306
5307         * getdate.y (tORDINAL): New token.
5308         (day, relunit): Allow it for relative times.
5309         (relative_time_table): Use tORDINAL for ordinals.
5310
5311 2004-11-15  Jim Meyering  <jim@meyering.net>
5312
5313         * closeout.c: Include "__fpending.h" once again.
5314         Include <stdbool.h>.
5315         (close_stdout): Don't fail just because stdout was closed initially,
5316         since some programs don't write to stdout in the normal course of
5317         operation (other than --version and --help), and we don't want this
5318         function to make e.g. `touch file >&-' fail.
5319         But do fail if it was closed and someone has tried to write to it.
5320         E.g., `printf foo >&-' must fail.
5321
5322 2004-11-11  Simon Josefsson  <jas@extundo.com>
5323
5324         * strtok_r.h, strtok_r.c: New file.
5325
5326 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5327
5328         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5329         we can stop lying to compilers about the constness of argv when we
5330         are compiled outside glibc.
5331         (getopt, getopt_long, getopt_long_only): Use it.
5332         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5333         getopt): Likewise.
5334         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5335         _getopt_long_only_r): Likewise.
5336         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5337         _getopt_long_only_r): Likewise.
5338
5339         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5340         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5341         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5342         the other external symbols.
5343         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5344         declaration, since the above renaming now works around collisions.
5345
5346 2004-11-11  Jim Meyering  <jim@meyering.net>
5347
5348         * linebreak.c: Remove trailing blanks.
5349         * alloca_.h: Likewise.
5350         * acosl.c: Likewise.
5351         * euidaccess.c: Likewise.
5352         * allocsa.h: Likewise.
5353
5354 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5355
5356         * mktime.c (SHR): New macro, which is a portable
5357         substitute for >> that should work even on Crays.
5358         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5359         Problem reported by Mark D. Baushke in
5360         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5361         * getdate.y (SHR): Likewise.
5362         (tm_diff): Use it.
5363         * strftime.c (SHR): Likewise.
5364         (tm_diff): Use it.
5365         * quotearg.c (struct quoting_options): Use unsigned int for
5366         quote_these_too, so that right shifts are well defined.  All uses
5367         changed.
5368
5369 2004-11-10  Simon Josefsson  <jas@extundo.com>
5370
5371         * getaddrinfo.h, getaddrinfo.c: New files.
5372
5373 2004-11-10  Jim Meyering  <jim@meyering.net>
5374
5375         Ensure that no close failure goes unreported.
5376         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5377         return early when it seems there's nothing to flush.
5378         Don't include __fpending.h.
5379
5380 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5381
5382         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5383
5384 2004-11-05  Bruno Haible  <bruno@clisp.org>
5385
5386         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5387         Reported by Mark D. Baushke <mdb@cvshome.org>.
5388
5389 2004-11-04  Bruno Haible  <bruno@clisp.org>
5390
5391         2004-09-11  Bruno Haible  <bruno@clisp.org>
5392                 * allocsa.valgrind: New file.
5393         2004-02-06  Bruno Haible  <bruno@clisp.org>
5394                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5395                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5396                 Reported by Christopher Seip <chris.seip@hp.com>.
5397
5398 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5399
5400         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5401         with errno == ERANGE if the buffer is too small.
5402         Problem reported by Mark D. Baushke.
5403
5404 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5405
5406         * xreadlink.c (MAXSIZE): New macro.
5407         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5408         size does not exceed MAXSIZE.  Avoid cast.
5409         As suggested by Mark D. Baushke in
5410         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5411         if readlink fails with buffer size just under MAXSIZE, try again
5412         with MAXSIZE.
5413
5414 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5415         and  Paul Eggert  <eggert@cs.ucla.edu>
5416
5417         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5418         (get_date): Overparenthesize to avoid GCC warning.
5419
5420 2004-11-02  Bruno Haible  <bruno@clisp.org>
5421
5422         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5423         function returns void.
5424
5425 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5426
5427         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5428         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5429         already declared.
5430
5431 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5432
5433         * getdate.y: Add support for TZ="foo" within a date string.
5434         Fix some bugs near time_t boundaries.  Reject dates with
5435         out-of-range components, e.g., "Sept 31".
5436         Include <stdlib.h>, "setenv.h", "xalloc.h".
5437         (ISDIGIT_LOCALE): Remove; unused.
5438         Note that the TZ and time functions used here are not reentrant.
5439         (mktime_ok, get_tz): New functions.
5440         (TZBUFSIZE): New constant.
5441         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5442         This requires that we sometimes generate our own TZ="XXX..." setting.
5443
5444 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5445
5446         * mktime.c (not_equal_tm): Remove redundant check.
5447
5448 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5449
5450         * getdate.y: Use Bison 1.875 features, and some minor
5451         code cleanups.  This change does not affect semantics.
5452         Don't include <stdlib.h>; no longer needed.
5453         Don't include unlocked-io.h; only the "#if TEST" code uses
5454         stdio, and performance isn't crucial there.
5455         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5456         Bison 1.875 features as described below.
5457         All uses of "PC." replaced by "pc->".
5458         (YYSTYPE): Add a forward declaration.
5459         (yylex, yyerror): Use full prototypes in forward decls.
5460         Use "%pure-parser" rather than obsolescent "%pure_parser".
5461         Use %parse-param and %lex-param instead of obsolescent
5462         YYPARSE_PARAM and YYLEX_PARAM.
5463         (meridian_table, month_and_day_table, time_units_table,
5464         relative_time_table, time_zone_table, military_table,
5465         lookup_zone, lookup_word, get_date):
5466         Use NULL instead of 0 where appropriate.
5467         (to_hour): Avoid abort (), to avoid a dependency on
5468         stdlib.h.
5469         (yyerror, yylex): Now accepts parser_control * arg.
5470         (main) [TEST]: Use '\0' rather than 0 for char.
5471
5472 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5473
5474         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5475         It's now the caller's responsibility to handle the case where
5476         !HAVE_GETPAGESIZE && !defined getpagesize.
5477
5478         * mktime.c (leapyear): Arg is long int, not int.
5479
5480 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5481
5482         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5483
5484 2004-10-12  Simon Josefsson  <jas@extundo.com>
5485
5486         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5487         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5488         to real functions.
5489
5490 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5491
5492         * vsnprintf.h: New file.
5493         * vsnprintf.c: New file.
5494
5495 2004-10-07  Bruno Haible  <bruno@clisp.org>
5496
5497         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5498         into the provided buffer.
5499
5500 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5501
5502         * diacrit.c, diacrit.h: Add GPL notice.
5503
5504         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5505         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5506         * logl.c (logl): Keep the code as similar to glibc as possible.
5507         This avoids a potential constant-folding bug.
5508
5509 2004-10-05  Bruno Haible  <bruno@clisp.org>
5510
5511         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5512
5513 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5514
5515         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5516         * xmalloc.c (xmemdup): Likewise.
5517         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5518         XFREE): Remove these long-obsolescent macros.
5519         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5520         * xstrdup.c: Remove.
5521
5522         * regex.c (re_comp): Cast gettext return value to char *,
5523         Problem reported by Martin Neitzel via Mark D. Baushke.
5524
5525 2004-10-04  Simon Josefsson  <jas@extundo.com>
5526
5527         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5528         '#ifdef USE_UNLOCKED_IO'.
5529
5530 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5531
5532         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5533         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5534         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5535         regex.c, sha1.c, version-etc.c, yesno.c:
5536         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5537         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5538         the includer's responsibility.
5539
5540         Sync from coreutils.
5541
5542         * modechange.c (mode_compile): Don't decrement a pointer that
5543         points to the start of a string, as the C Standard says the
5544         resulting behavior is undefined.
5545
5546         * backupfile.h (enum backuptype): Rename none -> no_backups,
5547         simple -> simple_backups, numbered_existing ->
5548         numbered_existing_backups, numbered -> numbered_backups
5549         to avoid shadowing problems.  All uses changed.
5550         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5551         * backupfile.c (check_extension, numbered_backup):
5552         Rename locals to avoid shadowing 'basename'.
5553         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5554         once.
5555
5556         * .cppi-disable: Add getopt_.h, getopt_int.h.
5557         * .cvsignore: Add getopt.h.
5558
5559 2004-10-04  Simon Josefsson  <jas@extundo.com>
5560
5561         * memmem.h: New file.
5562         * memmem.c: New file, taken from glibc.
5563
5564 2004-10-02  Jim Meyering  <jim@meyering.net>
5565
5566         * dirfd.h, getpagesize.h: Add copyright notice.
5567
5568 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5569
5570         * snprintf.c: Remove comments as to why each header is needed.
5571
5572 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5573
5574         * strsep.h: New file.
5575         * strsep.c: New file.
5576
5577 2004-10-01  Simon Josefsson  <jas@extundo.com>
5578
5579         * snprintf.c (snprintf): Handle size==0.
5580
5581 2004-10-01  Simon Josefsson  <jas@extundo.com>
5582             Bruno Haible  <bruno@clisp.org>
5583
5584         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5585         (snprintf): Declare 'args'.
5586
5587 2004-09-30  Simon Josefsson  <jas@extundo.com>
5588
5589         * snprintf.h, snprintf.c: New files.
5590
5591 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5592
5593         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5594         (hol_entry_help): Never translate an empty string.
5595         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5596         * argp.h (OPTION_NO_TRANS): New option.
5597
5598 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5599
5600         * xvasprintf.c: Include xalloc.h.
5601         (xvasprintf): Use xalloc_die, not xmalloc_die.
5602
5603 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5604
5605         * dummy.c: Change copyright notice to FSF, and license to GPL.
5606
5607 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5608
5609         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5610         Problem reported by Bruno Haible in:
5611         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5612
5613 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5614
5615         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5616         in case some system header has #define'd it.  Problem reported by
5617         Soeren D. Schulze in
5618         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5619
5620 2004-09-08  Bruno Haible  <bruno@clisp.org>
5621
5622         * stdint_.h: New file, taken from GNU clisp.
5623
5624 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5625
5626         * xvasprintf.h: New file.
5627         * xvasprintf.c: New file.
5628         * xasprintf.c: New file.
5629
5630 2004-09-08  Bruno Haible  <bruno@clisp.org>
5631
5632         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5633         is > INT_MAX.
5634         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5635
5636 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5637
5638         Import from coreutils.
5639         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5640         strings on unbounded length.  alloca's performance benefits aren't
5641         that important here.
5642         (V_STRDUP): Remove.
5643         (parse_with_separator): New function, with most of the internals
5644         of the old parse_user_spec.  Allow user to omit both user and group,
5645         for compatibility with FreeBSD.
5646         Clone only the user name, not the entire spec.
5647         Do not set *uid, *gid unless entirely successful.
5648         Avoid memory leak in some failing cases.
5649         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5650         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5651         (parse_user_spec): Rewrite to use parse_with_separator.
5652
5653 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5654
5655         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5656         its complicated substitute.
5657         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5658         and program_invocation_name.
5659         (__argp_basename) [!_LIBC]: Remove; the only use was
5660         replaced by its body.
5661         (__argp_short_program_name): Change condition from
5662         !defined __argp_short_program_name to
5663         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5664         to match argp-namefrob.h.
5665         (__argp_failure): Don't assume strerror_r returns char *.
5666         * argp-parse.c (N_): Define unconditionally.
5667         (argp_default_options): Fill out initializers with 0 to avoid
5668         gcc warnings.
5669
5670 2004-08-12  Simon Josefsson  <jas@extundo.com>
5671
5672         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5673         * getopt_.h: Renamed from getopt.h.
5674
5675 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5676
5677         Merge from coreutils.
5678
5679         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5680         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5681         for Reliant Unix 5.43.
5682
5683         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5684         (union fooround): Use uintmax_t, not long int.
5685         The rest is a merge from libc:
5686         [defined _LIBC]: Include <shlib-compat.h>.
5687         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5688
5689         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5690
5691         * strverscmp.c: Convert to UTF-8.
5692
5693 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5694
5695         * obstack.h (obstack_empty_p):
5696         Don't assume that chunk->contents is suitably aligned.
5697         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5698         Likewise. Problem reported by Benno in
5699         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5700
5701         * chown.c (rpl_chown): Work even if the file is writeable but not
5702         readable.  This could be improved further but it'd take some work.
5703
5704 2004-08-08  Simon Josefsson  <jas@extundo.com>
5705
5706         * xgethostname.c: Don't include error.h (not used).
5707
5708         * getpass.h: Add.
5709         * getpass.c: Include getpass.h first.
5710
5711 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5712
5713         * xalloc-die.c: New files.
5714         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5715         All uses removed.
5716         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5717         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5718         (_, N_, xalloc_die): Move to xalloc-die.c.
5719         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5720         so that we needn't mess with xalloc_msg_memory_exhausted.
5721
5722         * sha1.h: Renamed from sha.h.
5723         (SHA1_H): Renamed from _SHA_H.
5724         (sha1_ctx): Renamed from sha_ctx.
5725         (sha1_init_ctx): Renamed from sha_init_ctx.
5726         (sha1_process_block): Renamed from sha_process_block.
5727         (sha1_process_bytes): Renamed from sha_process_bytes.
5728         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5729         (sha1_read_ctx): Renamed from sha_read_ctx.
5730         (sha1_stream): Renamed from sha_stream.
5731         (sha1_buffer): Renamed from sha_buffer.
5732         * sha1.c: Likewise; renamed from sha.c.
5733         Do not include <sys/types.h>.
5734         Include <stddef.h> rather than <stdlib.h>.
5735
5736 2004-08-08  Bruno Haible  <bruno@clisp.org>
5737
5738         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5739         FILESYSTEM_PREFIX_LEN.
5740         * progreloc.c: Likewise.
5741         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5742
5743 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5744
5745         Merge from tar.
5746         * argp-help.c (make_hol, hol_append): Don't assume that
5747         SIZE_MAX is a valid preprocessor constant.
5748         (__argp_basename): Change from "#ifndef _LIBC"
5749         to "#ifndef __argp_short_program_name", so that
5750         we don't compile these functions for tar.
5751
5752         More merges from coreutils.
5753         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5754         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5755         yesno.h: New files.
5756         * addext.c: Remove; no longer needed.
5757         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5758         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5759         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5760         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5761         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5762         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5763         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5764         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5765         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5766         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5767         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5768         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5769         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5770         Import changes from coreutils.
5771
5772 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5773
5774         Merge from coreutils.
5775
5776         * .gdb-history: Remove; this doesn't belong here.
5777
5778         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5779         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5780         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5781
5782         * dirname.h: Include <stdbool.h>.
5783         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5784         for consistency with POSIX terminology.  All uses changed.
5785         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5786         (strip_trailing_slashes): Use bool for booleans.
5787         * stripslash.c (strip_trailing_slashes): Likewise.
5788
5789         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5790         sometimes returns a positive errno value even when it succeeds.
5791         (print_errno_message) [!LIBC]: Fall back on strerror if
5792         __strerror_r fails.
5793
5794         * path-concat.c (mempcpy): Don't define if a system header defines it.
5795         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5796         (longest_relative_suffix): New function.
5797         (path_concat): Use it.  Assume first argument is not NULL.
5798         Port to DOS.  Omit redundant separators.
5799         Report an error instead of returning NULL.
5800         Use mempcpy instead of memcpy.
5801         (xpath_concat): Remove: not declared or used.
5802
5803         * same.h: Include <stdbool.h>
5804         (same_name): Return bool, not int.
5805         * same.c (same_name): Likewise.
5806         (errno): Don't declare; we assume C89 or better now.
5807
5808         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5809         if not already defined.
5810
5811         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5812         * dup-safer.c (errno): Likewise.
5813
5814 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5815
5816         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5817         working.
5818
5819 2004-08-03  Simon Josefsson  <jas@extundo.com>
5820
5821         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5822         * progname.h: Don't include stdbool.h.
5823
5824 2004-08-02  Simon Josefsson  <jas@extundo.com>
5825
5826         * getsubopt.h: New file, with comments from Bruno Haible.
5827         * getsubopt.c: New file, from glibc, but slightly modified based on
5828         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5829
5830 2004-08-01  Simon Josefsson  <jas@extundo.com>
5831
5832         * xgetdomainname.c: Include stdlib.h, for free().
5833
5834 2004-07-16  Simon Josefsson  <jas@extundo.com>
5835
5836         * dummy.c: New file.
5837
5838 2004-07-16  Bruno Haible  <bruno@clisp.org>
5839
5840         * backupfile.h: Add extern "C" for C++.
5841         * closeout.h: Likewise.
5842         * copy-file.h: Likewise.
5843         * findprog.h: Likewise.
5844         * full-write.h: Likewise.
5845         * pathname.h: Likewise.
5846         * progname.h: Likewise.
5847         * stpcpy.h: Likewise.
5848         * stpncpy.h: Likewise.
5849         * strcase.h: Likewise.
5850         * strstr.h: Likewise.
5851         * xalloc.h: Likewise.
5852
5853         * mbswidth.h: Add extern "C" for C++.
5854         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5855
5856 2004-07-09  Simon Josefsson  <jas@extundo.com>
5857
5858         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5859         failed without this.)
5860
5861 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5862
5863         * fchown-stub.c: New file.
5864
5865 2004-06-24  Jim Meyering  <jim@meyering.net>
5866
5867         * obstack.h (obstack_base): Cast to (void *), per documentation.
5868
5869 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5870
5871         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5872
5873 2004-06-01  Jim Meyering  <jim@meyering.net>
5874
5875         * calloc.c: New file.
5876
5877 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5878
5879         * getdate.y (yylex): Allow space between sign and number.
5880         Problem reported by Dan Jacobson.
5881
5882 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5883         and  Jim Meyering  <jim@meyering.net>
5884
5885         Merge from coreutils CVS.
5886
5887         * stat-macros.h: New file, with contents from file-type.h
5888         and coreutils' system.h.
5889         * file-type.c: Include "stat-macros.h".
5890         * file-type.h (file_type): Move all macro definitions to new file,
5891         stat-macros.h.
5892
5893         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5894         Wrap old code with this conditional.
5895         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5896         function that does not dereference symlinks.
5897         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5898
5899         * xreadlink.c: Include xreadlink.h first, to catch .h file
5900         dependency problems.
5901         (xreadlink): Accept new arg SIZE, for efficiency.
5902         All decls and uses changed.
5903         * xreadlink.h: Include <stddef.h>, for size_t.
5904
5905         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5906         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5907
5908         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5909
5910 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5911
5912         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5913         macros to be defined.
5914         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5915         the allocator returns NULL because the requested size is zero.
5916
5917 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5918
5919         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5920         var.  Add comment explaining why libc still defines it.  This
5921         merges the following patch from glibc:
5922         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5923
5924 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5925
5926         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5927         present in glibc since revision 1.1 of this file.
5928         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5929         obstack_alignment_mask, obstack_alloc, obstack_base,
5930         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5931         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5932         obstack_grow0, obstack_init, obstack_int_grow,
5933         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5934         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5935         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5936         nonexistent functions.
5937
5938 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5939             Paul Eggert  <eggert@cs.ucla.edu>
5940
5941         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5942
5943 2004-05-14  Bruno Haible  <bruno@clisp.org>
5944
5945         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5946         that consists of a '.' followed by an empty digit string.
5947         Patch by Tor Lillqvist <tml@iki.fi>.
5948
5949 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5950
5951         Port obstack to the AS/400, where pointers are 16 bytes wide and
5952         you cannot cast an integer to a valid pointer.  This patch is
5953         currently waiting to be integrated into glibc; see
5954         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5955
5956         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5957         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5958         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5959         (struct obstack): temp member is now a union of a pointer and
5960         an integer, instead of an integer.  All integer uses changed.
5961         This does not affect the physical layout of struct obstack,
5962         except on hosts (like the AS/400) where the size or alignment of
5963         void * is greater than that of ptrdiff_t.
5964         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5965         __STDC__)]: Store temporary in pointer member of union, not
5966         integer member.
5967         * obstack.c: Include <stddef.h>, for offsetof.
5968         (struct fooalign): Remove; it doesn't need a name.
5969         (union fooround): Change double to long double, and add void *.
5970         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5971         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5972         not a macro.  Hence the values are always int; so remove all
5973         casts-to-int in uses.
5974
5975 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5976             Derek Price  <derek@ximbiot.com>
5977
5978         * alloca.c: Include <alloca.h>, to get our interface.
5979         * alloca_.h: Use __alloca on AIX, so that we don't have to
5980         include <alloca.h> first.  Use C89 prototype for alloca; this
5981         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5982         Use #elif for simplicity, since we can assume C89 now.
5983         Don't try to source the system alloca.h since it will not be found
5984         and to prevent recursively including its replacement.
5985         * fnmatch.c: Include <alloca.h> instead of opencoding.
5986         * regex.c: Likewise.
5987
5988 2004-05-16  Derek Price  <derek@ximbiot.com>
5989             Paul Eggert  <eggert@cs.ucla.edu>
5990
5991         getline cleanup.  This changes the getndelim2 API: both order of
5992         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5993         no delimiter).
5994
5995         * getline.c: Don't include stddef.h or stdio.h, since our
5996         interface does that.
5997         (getline): Always use getdelim, so that we don't have two
5998         copies of this code.
5999         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6000         if available.
6001         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6002         (GETNDELIM2_MAXIMUM): New macro.
6003         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
6004         instead of the old practice of delim2==0.  All callers changed.
6005         Return -1 on overflow, instead of returning junk.
6006         Do not set *linesize unless allocation succeeds.
6007         * getndelim2.h: Do not include stddef.h; no longer needed, now
6008         that we include sys/types.h.
6009         * getnline.h: Likewise.
6010         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6011         (getndelim2): Reorder arguments.
6012         * getnline.c (getnline, getndelim):
6013         Don't discard the NMAX argument.
6014         (getnline): Invoke getndelim, to avoid code duplication.
6015         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6016         of (size_t) -1 by callers of the getnline family.
6017
6018 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
6019
6020         * nanosleep.c (suspended): Change its type from int to
6021         sig_atomic_t volatile.
6022         (first_call): Make it private to rpl_nanosleep, and have it
6023         be zero initially as that's a bit faster.
6024         (my_usleep): Round up fractional times instead of truncating them,
6025         as this is the usual meaning for 'sleep'.
6026
6027         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6028         doesn't work.
6029         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6030         (ENOSYS): Define if not defined.
6031         (settime): Fall back on stime if it exists and settimeofday fails.
6032         But don't bother with fallbacks if a method fails with errno == EPERM.
6033
6034 2004-05-11  Jim Meyering  <jim@meyering.net>
6035
6036         Prior to this change, the save_cwd caller required read access to the
6037         current directory on most systems (ones with the fchdir function).
6038
6039         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6040         fails, try write-only, and finally, resort to using xgetcwd.
6041
6042 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
6043
6044         * obstack.c, obstack.h: Import changes from libc.
6045
6046 2004-04-28  Bruno Haible  <bruno@clisp.org>
6047
6048         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6049         implicitly appends .exe to executables.
6050         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6051         accepts Windows pathnames.
6052         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6053         Cygwin like Windows, since it now accepts Windows pathnames.
6054         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6055         Cygwin like Windows, since it now accepts Windows pathnames.
6056         Reported by Derek Robert Price <derek@ximbiot.com>.
6057
6058 2004-04-20  Jim Meyering  <jim@meyering.net>
6059
6060         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6061
6062 2004-04-20  Jim Meyering  <jim@meyering.net>
6063             Bruno Haible  <bruno@clisp.org>
6064
6065         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6066         memory when realloc fails.
6067
6068 2004-04-18  Jim Meyering  <jim@meyering.net>
6069
6070         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6071         don't leak memory and do call END_UTMP_ENT.
6072
6073 2004-04-11  Paul Eggert  <eggert@twinsun.com>
6074
6075         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6076         (CHAR_BIT): Remove, since we assume C89.
6077         Include <stdint.h> if available, as per current Autoconf CVS advice.
6078
6079 2004-03-30  Paul Eggert  <eggert@twinsun.com>
6080
6081         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6082         not bool, to be more consistent with Unix conventions.
6083         Suggested by Bruno Haible.
6084
6085         Merge from coreutils.
6086
6087         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6088         New files.
6089
6090         * getdate.h: Include stdbool.h, and timespec.h instead of
6091         the usual <time.h> dance.
6092         (get_date): Change signature to support fractional time stamps.
6093         All callers changed.
6094         * getdate.y: Include "getdate.h" first, as we can now
6095         assume C89 and don't need to worry about 'const'.
6096         Similarly, include "unlocked-io.h" near start, not in middle.
6097         Include <limits.h>.
6098         (textint.value): Use long int rather than int.
6099         (textint.digits): Use size_t rather than int.
6100         (BILLION, LOG10_BILLION): New constants.
6101         (parser_control): New member rel_ns.  Members day_ordinal,
6102         time_zone, month, day, hour, minutes, rel_year, rel_month,
6103         rel_day, rel_hour, rel_minutes, rel_seconds
6104         are now long int, not int.  Member seconds is now struct timespec,
6105         not int.  New member timespec_seen.  Members dates_seen, days_seen,
6106         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6107         not int.
6108         (%union.intval): Now long int, not int.
6109         New member timespec.
6110         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6111         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6112         (spec): Now is a timespec or an item list.
6113         (timespec, items): New nonterminals.
6114         (time, rel, relunit, number, get_date):
6115         Add support for fractional seconds.
6116         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6117         (gmtime, localtime, mktime): Remove decls; not needed with C89.
6118         (to_hour): First arg is now long int, not int.
6119         (to_year): Returns long int, not int.
6120         Don't treat year -70 like 70.
6121         (tm_diff): Returns long int, not int.
6122         (lookup_word): Use bool instead of int when appropriate.
6123         (yylex): Use size_t for count, not int.
6124         Detect overflow when parsing large integer constants.
6125         Add support for fractions.
6126         (get_date): Make pointers 'const' if possible.
6127         Use more-portable code to detect integer overflow.
6128         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
6129         Don't use ctime; it's not reliable if the year has >4 digits.
6130
6131         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6132         This is for compatibility with BSD.
6133
6134         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6135         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6136         From coreutils' system.h.
6137
6138         * userspec.c: Don't include "posixver.h".
6139         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6140         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6141         compatible extension.  Simplify code by removing a boolean int
6142         that was always nonzero if a string was nonnull.
6143
6144 2004-03-30  Jim Meyering  <jim@meyering.net>
6145
6146         Merge from coreutils.
6147
6148         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6149
6150         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6151         an empty input stream.
6152
6153         * readtokens.c: Include <stdbool.h>.
6154         (readtoken): Use `size_t' rather than int/long.
6155         All callers adjusted.
6156         Use `bool' rather than `int' where appropriate.
6157         Use memset rather than an explicit loop.
6158         Use x2nrealloc rather than xrealloc.
6159         Allow the use of `\0' as a delimiter.
6160         (readtokens): Likewise.
6161         * readtokens.h (readtoken, readtokens): Update prototypes.
6162
6163 2004-03-30  Bruno Haible  <bruno@clisp.org>
6164
6165         * getloadavg.c (getloadavg): Don't assume setlocale returns
6166         nonnull.
6167
6168 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6169
6170         Merge changes to getloadavg.c from coreutils and Emacs.
6171
6172         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6173         Define to an expression, not to the empty string.
6174         Include cloexec.h and xalloc.h.
6175         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6176         Use set_cloexec_flag rather than rolling our own.
6177         * cloexec.c, cloexec.h: New files.
6178
6179 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6180
6181         * getopt.h: Sync with libc CVS.
6182
6183 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6184             Bruno Haible  <bruno@clisp.org>
6185
6186         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6187         not on all platforms that have <wchar.h>.
6188         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6189
6190 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6191
6192         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6193         Sync with libc CVS.
6194         * getopt_int.h: New file, also synced from libc.
6195
6196 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6197
6198         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6199         '#if' expressions.  Unlike the code it replaces, it does not
6200         depend on (defined _SC_PAGESIZE).  However, it does depend on
6201         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6202         first reported by Jason Andrade in
6203         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6204
6205 2004-01-18  Simon Josefsson  <jas@extundo.com>
6206
6207         * strdup.h: New file.
6208         * strdup.c: Include it.
6209         * path-concat.c: Include strdup.h. Drop strdup declaration.
6210         * userspec.c: Include strdup.h. Drop strdup declaration.
6211
6212 2004-02-06  Karl Berry  <karl@gnu.org>
6213
6214         * config.charset: update from gettext 0.14.1.
6215
6216 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6217
6218         Add comments and code, prompted by suggestions from Bruno Haible
6219         for sh-quote.
6220         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6221         describing the enum quoting_style values.
6222         * quotearg.c (quotearg_alloc): New function.
6223         (quotearg_buffer_restyled): Treat lone { and } as special.
6224         Treat = as special.  Work around bug with older shells
6225         that "see" a '\' that is really the 2nd byte of a multibyte char.
6226         Quote empty string with shell_quoting_style.
6227
6228 2004-02-03  Bruno Haible  <bruno@clisp.org>
6229
6230         * pipe.h: New file, from GNU gettext.
6231         * pipe.c: New file, from GNU gettext.
6232
6233 2004-01-27  Bruno Haible  <bruno@clisp.org>
6234
6235         * execute.h: New file, from GNU gettext.
6236         * execute.c: New file, from GNU gettext.
6237         * w32spawn.h: New file, from GNU gettext.
6238
6239 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6240
6241         Exit-status fix from coreutils.
6242
6243         Use exit_failure consistently in place of EXIT_FAILURE,
6244         so that program exit statuses are consistent on failure.
6245
6246         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6247         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6248         * argmatch.h: Comment fix to match the above.
6249         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6250         Now a macro referring to exit_failure, instead of a separate
6251         variable.  Include "exitfail.h" to get it.
6252         * xstrtol.h: Include "exitfail.h".
6253         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6254
6255         * long-options.c (parse_long_options): Use prototype
6256         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6257         for clarity.
6258
6259 2004-01-21  Jim Meyering  <jim@meyering.net>
6260
6261         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6262         so as not to conflict with a different-sized __mktime_internal
6263         function in GNU libc.
6264         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6265         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6266
6267 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6268
6269         Merge from diffutils.
6270
6271         * file-type.c (file_type): Add typed memory objects.
6272         * file-type.h (S_TYPEISTMO): New macro.
6273
6274         * c-stack.h (c_stack_action): Remove argv argument.
6275         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6276         (die): Don't calculate message unless segv_action returns.
6277         (get_stack_location, min_address_from_argv, max_address_from_argv,
6278         volatile stack_base, volatile_stack_size): Remove.
6279         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6280         that every segmentation violation is a stack overflow.  (Ouch!)
6281         See Debian bug 136249 (still outstanding) for more info about why
6282         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6283
6284 2003-11-30  Bruno Haible  <bruno@clisp.org>
6285
6286         Safer stack allocation.
6287         * setenv.c: Include allocsa.h.
6288         (alloca): Remove fallback definition.
6289         (freea): Remove macro.
6290         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6291         instead of freea.
6292
6293 2003-10-17  Bruno Haible  <bruno@clisp.org>
6294
6295         * binary-io.h: Avoid warnings on Cygwin.
6296
6297 2003-12-28  Bruno Haible  <bruno@clisp.org>
6298
6299         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6300         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6301
6302 2003-11-28  Bruno Haible  <bruno@clisp.org>
6303
6304         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6305
6306 2003-11-27  Bruno Haible  <bruno@clisp.org>
6307
6308         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6309
6310 2003-11-17  Bruno Haible  <bruno@clisp.org>
6311
6312         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6313
6314 2003-11-24  Bruno Haible  <bruno@clisp.org>
6315
6316         * xallocsa.h: New file, from GNU gettext.
6317         * xallocsa.c: New file, from GNU gettext.
6318
6319 2003-11-24  Bruno Haible  <bruno@clisp.org>
6320
6321         * allocsa.h: New file, from GNU gettext.
6322         * allocsa.c: New file, from GNU gettext.
6323
6324 2003-11-24  Bruno Haible  <bruno@clisp.org>
6325
6326         * eealloc.h: New file.
6327
6328 2004-01-15  Jim Meyering  <jim@meyering.net>
6329
6330         Merge from coreutils.
6331
6332         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6333         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6334         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6335
6336         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6337         optional configure-time default.
6338
6339         * version-etc.c (version_etc_copyright): Update copyright date.
6340
6341         * xreadlink.c (xreadlink): Correct outdated comment.
6342
6343 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6344
6345         Merge from coreutils.
6346
6347         * posixver.c: Include posixver.h.
6348
6349         * same.c: Include <stdbool.h>, <limits.h>.
6350         (_POSIX_NAME_MAX): Define if not defined.
6351         (MIN): New macro.
6352         (same_name): If file names are silently truncated, report
6353         that the file names are the same if they are the same after
6354         the silent truncation.
6355
6356         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6357         conversion function.
6358         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6359         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6360         longer needed.
6361
6362 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6363
6364         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6365         with like-named macro in fnmatch.c.
6366         (EXT): Use an internal constant instead.
6367
6368         Merge fnmatch patches from glibc.
6369         * fnmatch.c (mbsinit): Remove define.
6370         Add libc_hidden_ver (__fnmatch, fnmatch).
6371         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6372         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6373
6374 2003-12-14  Karl Berry  <karl@gnu.org>
6375
6376         * config.charset: update from gettext-runtime.
6377
6378 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6379
6380         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6381         Bug reported by Alfred M. Szmidt.
6382
6383 2003-11-29  Karl Berry  <karl@gnu.org>
6384
6385         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6386
6387 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6388             Bruno Haible  <bruno@clisp.org>
6389
6390         * printf-parse.h: Don't include sys/types.h.
6391         (ARG_NONE): New macro.
6392         (char_directive): Change type of *arg_index fields to size_t.
6393         * printf-parse.c: Don't include sys/types.h.
6394         (SSIZE_MAX): Remove macro.
6395         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6396         Remove unnecessary overflow check.
6397         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6398         fields.
6399
6400 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6401
6402         * alloca.c: Remove dependency on xalloc module.
6403         (xalloc_die): Remove.
6404         (memory_full) [!defined emacs]: New macro.
6405         [!defined emacs]: Don't include xalloc.h.
6406         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6407         address arithmetic overflows.  Change datatypes a bit to avoid
6408         unnecessary casts.
6409
6410 2003-11-22  Jim Meyering  <jim@meyering.net>
6411
6412         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6413
6414 2003-11-17  Bruno Haible  <bruno@clisp.org>
6415
6416         * vasnprintf.c (alloca): Remove fallback definition.
6417         (freea): Remove definition.
6418         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6419         Reported by Paul Eggert.
6420
6421 2003-11-17  Jim Meyering  <jim@meyering.net>
6422
6423         On systems without utime and without a utimes function capable of
6424         dealing with a NULL struct utimbuf* argument, this utime replacement
6425         could -- in unusual circumstances -- leak a file descriptor.
6426         * utime.c: Include <unistd.h> and <errno.h>.
6427         (utime_null): Be sure to close `fd' and to preserve errno.
6428         Reported by Geoff Collyer via Arnold Robbins.
6429
6430 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6431             Bruno Haible  <bruno@clisp.org>
6432
6433         Protect against address arithmetic overflow.
6434         * printf-args.h: Include stddef.h.
6435         (arguments): Change type of field 'count' to size_t.
6436         * printf-args.c (printf_fetchargs): Use size_t instead of
6437         'unsigned int' where appropriate.
6438         * printf-parse.h: Include sys/types.h.
6439         (char_directive): Change type of *arg_index fields to ssize_t.
6440         (char_directives): Change type of fields 'count', max_*_length to
6441         size_t.
6442         * printf-parse.c: Include sys/types.h and xsize.h.
6443         (SSIZE_MAX): Define fallback value.
6444         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6445         instead of 'int' where appropriate. Check a_allocated, d_allocated
6446         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6447         * vasnprintf.c: Include xsize.h.
6448         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6449         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6450         overflow. Avoid wraparound when converting a width or precision from
6451         decimal to binary.
6452
6453 2003-11-16  Bruno Haible  <bruno@clisp.org>
6454
6455         Update from GNU gettext.
6456         * printf-parse.c: Generalize to it can be compiled for wide strings.
6457         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6458         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6459         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6460         SNPRINTF): New macros.
6461         Don't include <alloca.h> if the file is used inside libintl.
6462         (local_wcslen): New function, for Solaris 2.5.1.
6463         (VASNPRINTF): Use it instead of wcslen.
6464
6465 2003-11-16  Bruno Haible  <bruno@clisp.org>
6466
6467         * xsize.h (xmax): New function.
6468         (xsum, xsum3, xsum4): Declare as "pure" functions.
6469
6470 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6471
6472         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6473         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6474         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6475         heuristic is just as accurate as far as we know, and it removes a
6476         dependency on size_max.m4 and ptrdiff_max.m4.
6477
6478 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6479
6480         * xstrtol.c (__xstrtol): Remove "break" immediately after
6481         "return", to pacify some unknown compiler.  Problem reported
6482         by Joerg Schilling.
6483
6484 2003-11-11  Bruno Haible  <bruno@clisp.org>
6485
6486         * xsize.h (SIZE_MAX): Remove fallback definition.
6487         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6488         defined.
6489
6490 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6491
6492         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6493         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6494         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6495         From Bruno Haible.
6496         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6497         not (size_t) -1, since it's defined here.
6498
6499 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6500
6501         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6502         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6503         Reject sizes of exactly SIZE_MAX bytes.
6504         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6505         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6506
6507 2003-11-05  Bruno Haible  <bruno@clisp.org>
6508
6509         * xsize.h: Include limits.h, to avoid a possible collision with
6510         SIZE_MAX defined in <limits.h> on Solaris.
6511
6512 2003-11-04  Bruno Haible  <bruno@clisp.org>
6513
6514         * xsize.h: New file.
6515         * linebreak.c: Include xsize.h.
6516         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6517         argument for overflow.
6518         Suggested by Paul Eggert.
6519
6520 2003-10-31  Bruno Haible  <bruno@clisp.org>
6521
6522         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6523         to avoid (extremely rare) race condition.
6524         Suggested by Paul Eggert.
6525
6526 2003-11-03  Jim Meyering  <jim@meyering.net>
6527
6528         * userspec.c: Include "userspec.h".
6529         * userspec.h: New file.
6530
6531 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6532
6533         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6534         * mountlist.c (SIZE_MAX): Define if not defined already.
6535         (read_filesystem_list): Set and use me_type_malloced.
6536         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6537         whatever the type happens to be), for brevity and consistency.
6538         Check for size calculation overflow on Alphas running OSF/1.
6539
6540 2003-10-31  Jim Meyering  <jim@meyering.net>
6541
6542         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6543
6544         * linebuffer.c: Include <string.h> for declaration of memset.
6545
6546 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6547             Bruno Haible  <bruno@clisp.org>
6548
6549         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6550         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6551
6552 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6553
6554         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6555         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6556         no longer needed.
6557         * quotearg.c (quotearg_n_options): Use it.
6558         * group-member.c: Include <stdbool.h>.
6559         (free_group_info): Arg is now const *; don't free arg.
6560         (get_group_info): Now returns bool and accepts struct group_info *,
6561         rather than returning a malloc'ed struct group_info *.
6562         All uses changed.  Check for overflow in internal size calculation.
6563
6564         * getusershell.c (readname): Simplify the code by using x2nrealloc
6565         rather than xmalloc/xrealloc.
6566         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6567         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6568         conformance bug: the old code used a pointer after freeing the
6569         storage that it addressed.
6570         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6571         rather than doing it by hand.
6572         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6573         the buffer preserved.  Use free and xmalloc instead.
6574         * quotearg.c (quotearg_n_options): Likewise.
6575         Use a simpler test for size overflow.  Don't use xalloc_oversized
6576         because unsigned int might be wider than size_t (!); this suggests
6577         that we should switch from unsigned int to size_t for slot numbers.
6578
6579 2003-10-27  Bruno Haible  <bruno@clisp.org>
6580
6581         * stdbool_.h: Better support for BeOS.
6582
6583 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6584
6585         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6586         to allocate the returned structure.  Do not allocate a subarray,
6587         as x2nrealloc will do that.
6588         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6589         instead of xnrealloc.
6590         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6591
6592 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6593
6594         * xalloc.h (xalloc_oversized): New static inline function, for
6595         callers that want to do their own size-overflow checking.  Include
6596         <stdbool.h>, since xalloc_oversized returns bool.
6597         * xalloc.c (array_size_overflow): Remove.  All callers changed
6598         to use xalloc_oversized.
6599
6600         Add two functions x2realloc, x2nrealloc, for programs that grow
6601         arrays dynamically by doubling their sizes.
6602         * xalloc.h (x2realloc, x2nrealloc): New decls.
6603         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6604         New functions.
6605
6606         Port to C99 semantics for 'inline' of external functions.
6607         Bug reported by Bruno Haible.
6608         * xmalloc.c (xnmalloc_inline): New static inline function,
6609         with the old contents of xnmalloc.
6610         (xnmalloc, xmalloc): Use it.
6611         (xnrealloc_inline): New static inline function,
6612         with the old contents of xnrealloc.
6613         (xnrealloc, xrealloc): Use it.
6614
6615         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6616
6617 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6618
6619         Fix several address-calculation bugs in the hash modules,
6620         plus some minor code cleanup.
6621
6622         * hash.h: Include <stdbool.h>, for bool.
6623         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6624         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6625         hash_get_n_entries, hash_get_max_bucket_length,
6626         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6627         hash_rehash): Use size_t rather than unsigned.
6628         * hash.c (struct hash_table, hash_get_n_buckets,
6629         hash_get_n_buckets_used, hash_get_n_entries,
6630         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6631         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6632         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6633         Likewise.
6634         (SIZE_MAX): Define if not defined.
6635         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6636         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6637         hash_print):
6638         Use const * when possible.
6639         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6640         (check_tuning): Fix bug: if tuning parameters were very close to
6641         0 or 1, rounding errors could have caused subscript violations.
6642         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6643         (hash_initialize): Add 'fail:' label
6644         to free table and return NULL, and use it to simplify code.
6645         Use calloc rather than clearing the storage ourself.
6646         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6647         buffer size calculations.
6648         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6649         Include <stddef.h>, for size_t.
6650         * hash-pjw.c (hash_pjw): Likewise.
6651         Switch to method described by Bruno Haible.
6652         Include <limits.h>, for CHAR_BIT.
6653         (SIZE_BITS): New macro.
6654
6655 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6656
6657         * getndelim2.c (getndelim2): When size calculation overflows,
6658         ceiling the allocation at NMAX bytes rather than silently
6659         discarding input bytes before NMAX is reached.  This makes
6660         a difference only if NMAX exceeds SIZE_MAX / 2.
6661
6662         * obstack.c: Merge from glibc.
6663         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6664         Add libc_hidden_def (_obstack_newchunk).
6665         (_obstack_free) [! defined _LIBC]: Remove.
6666         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6667         a clone of the function body.
6668         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6669         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6670
6671         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6672         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6673         arg to memcpy.
6674
6675         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6676         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6677         Don't use lvalue casts, as GCC plans to remove support for them
6678         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6679         was also present in the non-GCC version, indicating that this
6680         code had always been buggy and had never been widely used.
6681         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6682         Use the fast variant of each macro, rather than copying the
6683         definiens of the fast variant; that way, we'll be more likely to
6684         catch future bugs in the fast variants.
6685
6686 2003-10-20  Bruno Haible  <bruno@clisp.org>
6687
6688         * wait-process.h: New file, from GNU gettext.
6689         * wait-process.c: New file, from GNU gettext.
6690
6691 2003-10-19  Jim Meyering  <jim@meyering.net>
6692
6693         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6694
6695 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6696
6697         * getgroups.c: Include <errno.h>, <stdlib.h>.
6698         (getgroups): First arg is int, not size_t.
6699         Don't let 'free' mangle errno.
6700
6701 2003-10-16  Jim Meyering  <jim@meyering.net>
6702
6703         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6704
6705 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6706
6707         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6708         (SIZE_MAX): Remove.
6709         (new_exclude, add_exclude_file): Initial size no longer needs to
6710         be a power of 2.
6711         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6712         our own address arithmetic overflow checking.
6713
6714         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6715         (fnmatch): Do not alloca more than 2000 wide characters;
6716         instead, use malloc for large buffers.
6717         Check for address arithmetic overflow, and return -1
6718         with errno set to ENOMEM in that case.
6719         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6720         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6721         instead, return -1.  Check for address arithmetic overflow.
6722
6723 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6724
6725         Handle invalid suffixes and overflow independently, so that
6726         callers can treat them independently as needed.  Fix some bugs in
6727         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6728         suffix for a human-readable blocksize.  The major caller-visible
6729         change is the addition of a new
6730         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6731         that both overflow and suffix chars were found.
6732
6733         * human.c (humblock): Don't check separately for invalid suffix
6734         char; that is xstrtoumax's job (now that its bug is fixed).
6735         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6736         INTMAX_MAX]: New macros.
6737         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6738         TYPE_MAXIMUM): New macros.
6739         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6740         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6741         if overflow occurs, as it's what __strtol does and it's more useful
6742         in practice.
6743         (__xstrtol): If __strtol reports some error other than ERANGE,
6744         reflect it to the caller as LONGINT_INVALID.  If it reports
6745         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6746         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6747         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6748         value.
6749         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6750         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6751         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6752         [defined UINTMAX_MAX]: New macros.
6753
6754 2003-10-14  Bruno Haible  <bruno@clisp.org>
6755
6756         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6757         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6758         Also use volatile where needed.
6759
6760 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6761
6762         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6763         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6764         and define in terms of the other primitives.
6765         * xmalloc.c: Include stdbool.h; do not include exit.h.
6766         (SIZE_MAX): Define if not already defined.
6767         (array_size_overflow): New function.
6768         (xalloc_die): Abort instead of exiting if 'error' returns.
6769         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6770         (xmalloc, xrealloc): Use them.
6771         (xcalloc): Check for address arithmetic overflow.
6772         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6773         a bit faster than strcpy.
6774
6775 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6776
6777         Merge getpass from libc, plus a few fixes.
6778
6779         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6780         Include <stdbool.h>.
6781         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6782         __fsetlocking to empty.
6783         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6784         do include <bits/libc-lock.h>.
6785         Do not include <fcntl.h>; not needed.
6786         [_LIBC]: Include <wchar.h>.
6787         (NOTCANCEL_MODE): New macro.
6788         (flockfile, funlockfile) [_LIBC]: New macros.
6789         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6790         [!_LIBC]: New macros.
6791         (call_fclose): New function.
6792         (getpass): Use it.  Save tty stream separately; this simplifies the
6793         code and makes it more reliable if stdin happens to equal stdout.
6794         Invoke __fsetlocking on tty.
6795         Handle thread cancellation if needed.
6796         Namespace cleanup (use __tcgetattr, __getline).
6797         Use bool for Booleans.
6798         [USE_IN_LIBIO]: Handle wide streams.
6799         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6800         stream might go where.
6801
6802         * unlocked-io.h: Include <stdio.h>, so that the caller
6803         doesn't have to include <stdio.h> before us.
6804         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6805         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6806         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6807         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6808         if not declared, so that we can use getpass.c code from libc without
6809         rewriting it.
6810         (flockfile, ftrylockfile, funlockfile): New macros.
6811
6812 2003-10-06  Bruno Haible  <bruno@clisp.org>
6813
6814         * version-etc-2.h: Remove file.
6815         * version-etc-2.c: Remove file.
6816
6817 2003-09-25  Jim Meyering  <jim@meyering.net>
6818             Bruno Haible  <bruno@clisp.org>
6819
6820         This lets translators provide better translations for the
6821         "Written by ..." part of --version output.
6822         * version-etc.h: Include stdarg.h.
6823         (version_etc_copyright): Declare as readonly.
6824         (version_etc): Make this function variadic with a NULL-terminated list
6825         of author name strings.
6826         (version_etc_va): New declaration.
6827         * version-etc.c: Include stdarg.h, stdlib.h.
6828         (version_etc_copyright): Declare as readonly.
6829         (version_etc_va): New function. Provide a different translatable string
6830         for each possible number of authors < 10. Abbreviate when there are 10
6831         authors or more.
6832         (version_etc): Make this function variadic. Call version_etc_va.
6833         Suggestion from Gary V. Vaughan.
6834
6835         * long-options.h (parse_long_options): Change prototype: the authors
6836         string is moved to the end and becomes variadic.
6837         * long-options.c: Include stdarg.h.
6838         (parse_long_options): Make this function variadic, too.
6839         Call version_etc_va, not version_etc.
6840
6841 2003-10-06  Bruno Haible  <bruno@clisp.org>
6842
6843         * fatal-signal.h: New file, from GNU gettext.
6844         * fatal-signal.c: New file, from GNU gettext.
6845
6846 2003-10-04  Karl Berry  <karl@gnu.org>
6847
6848         * argp*: update from libc.
6849
6850 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6851
6852         * getpass.c (getpass): Use a no-op fseek when switching from input to
6853         output mode on the same stream.
6854
6855 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6856
6857         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6858         Fix arg typo in previous patch.
6859
6860 2003-09-28  Jim Meyering  <jim@meyering.net>
6861
6862         * error.c: Correct cpp indentation.
6863
6864 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6865
6866         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6867         Omit the special code that used __typeof__, since we worry that
6868         it could be more trouble than it's worth.  See:
6869         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6870         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6871
6872         * free.c: New file.
6873
6874 2003-09-26  Jim Meyering  <jim@meyering.net>
6875
6876         * error.c (error_tail): Move some declarations
6877         into inner scope where the local variables are used.
6878
6879 2003-09-26  Bruno Haible  <bruno@clisp.org>
6880
6881         * stpncpy.h (gnu_stpncpy): New declaration.
6882         (stpncpy): Define as alias for gnu_stpncpy.
6883         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6884
6885 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6886
6887         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6888         (error_tail): Do not loop, reallocating temporary buffer, since
6889         the output cannot contain more wide characters than the input
6890         contains bytes, the size must be big enough already.  This avoids
6891         one potential size overflow calculation.  Check for size overflow
6892         when calculating temporary buffer size.  Free temporary buffer
6893         when done, if it was allocated with malloc; this plugs a memory
6894         leak.  Remove casts from void * to pointers, that are no longer
6895         needed now that we're assuming C89 or better.
6896
6897         Merge error changes from glibc.
6898
6899         * error.c, error.h: Update copyright notice header to match glibc.
6900         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6901         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6902         Disable cancellation while printing error.
6903         * error.h: Prepend __ to parameter names.
6904
6905 2003-09-25  Karl Berry  <karl@gnu.org>
6906
6907         * argp-fmtstream.c, argp-help.c: update from libc.
6908
6909 2003-09-25  Bruno Haible  <bruno@clisp.org>
6910
6911         * version-etc-2.h: New file, from version-etc.h with modifications.
6912         * version-etc-2.c: New file, from version-etc.c with modifications.
6913
6914 2003-09-25  Simon Josefsson  <jas@extundo.com>
6915
6916         * xgetdomainname.h: New file.
6917         * xgetdomainname.c: New file.
6918
6919 2003-09-25  Simon Josefsson  <jas@extundo.com>
6920             Bruno Haible  <bruno@clisp.org>
6921
6922         * getdomainname.h: New file.
6923         * getdomainname.c: New file.
6924
6925 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6926
6927         * linebuffer.c (freebuffer): Don't free the argument, just
6928         the buffer associated with the argument.  Bug reported by
6929         Simon Josefsson.
6930
6931 2003-09-19  Karl Berry  <karl@gnu.org>
6932
6933         * argp.h: update from libc.
6934
6935 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6936
6937         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6938         input error, instead of returning NULL the next time we are called
6939         (and therefore losing track of errno).
6940
6941 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6942
6943         * getndelim2.c (getndelim2): Don't trash errno when a read
6944         fails, so that the caller gets the proper errno.
6945
6946         * readutmp.c (read_utmp): Likewise.
6947         Check for fstat error.  Close stream and free storage
6948         when failing.
6949
6950 2003-09-14  Bruno Haible  <bruno@clisp.org>
6951
6952         * fwriteerror.h: New file.
6953         * fwriteerror.c: New file.
6954
6955 2003-09-14  Jim Meyering  <jim@meyering.net>
6956
6957         * getloadavg.c: Correct cpp indentation.
6958         * strdup.c: Likewise.
6959         * vasnprintf.c: Likewise.
6960
6961 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6962
6963         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6964         * obstack.c [!defined _LIBC]: Likewise.
6965         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6966         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6967         * exitfail.c: Don't include stdlib.h; no longer needed.
6968
6969         More changes to assume C89 or better.
6970
6971         * error.c (error_tail): Assume vprintf.
6972
6973         * argmatch.c (getenv): Remove decl.
6974         * progreloc.c (get_full_program_name): Define via prototype.
6975         * setenv.c (clearenv): Likewise.
6976         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6977         needed.
6978         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6979         (malloc, memcpy): Remove decls.
6980         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6981         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6982         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6983         (memcpy): Remove macro.
6984         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6985         (__P): Remove.  All uses removed.
6986         (PTR): Remove.  All uses changed to void *.
6987         (CHAR_BIT, NULL): Remove.
6988         (spaces, zeros, memset_space, memset_zero)
6989         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6990         Remove.
6991         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6992         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6993         Define with prototype.
6994         Remove now-unnecessary prototype decl.
6995         (extra_args_spec): Assume ANSI C.  All uses changed.
6996         (extra_args_spec_iso): Remove.
6997         (my_strftime, emacs_strftimeu): Define via prototype.
6998         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6999         unconditionally.
7000         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7001         * strtoimax.c: Include <stdlib.h> unconditionally.
7002         (strtoul, strtol): Remove decls.
7003         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7004         LONG_MAX): Remove.
7005         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7006         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
7007         (LOCALE_PARAM_PROTO): New macro.
7008         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7009         (INTERNAL (strtol), strtol): Define with a prototype.
7010         (PARAMS): Remove.  All uses removed.
7011         * tempname.c: Include <string.h> unconditionally.
7012         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7013         * xgethostname.c (main): Define with a prototype.
7014         * xmalloc.c: Include "xalloc.h" first, to check interface.
7015         Include <stdlib.h> unconditionally.
7016         (calloc, malloc, realloc, free): Remove decls.
7017         * xstrtod.c: Include "xstrtod.h" first, to check interface.
7018         Include <stdlib.h> unconditionally.  Sort include file names.
7019         (strtod): Remove.
7020         (xstrtod): Define with a prototype.
7021         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7022         (strtol, strtoul): Remove decls.
7023
7024 2003-09-11  Paul Eggert  <eggert@twinsun.com>
7025
7026         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7027         Include <stdlib.h>, <string.h> unconditionally.
7028         Remove now-unnecessary cast to char *.
7029         * strnlen.c: Include <string.h> unconditionally.
7030         * yesno.c (yesno): Define with a prototype.
7031
7032 2003-09-10  Bruno Haible  <bruno@clisp.org>
7033
7034         * strcspn.c: Include <string.h> unconditionally.
7035         * strpbrk.c: Include <string.h> unconditionally.
7036         * strstr.c: Include <string.h> unconditionally.
7037         * unicodeio.c: Include <string.h> unconditionally.
7038         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7039         * unsetenv.c: Likewise.
7040         * xreadlink.c: Include <stdlib.h> unconditionally.
7041         * yesno.c: Include <stdlib.h> unconditionally.
7042         (rpmatch): Add prototype.
7043
7044 2003-09-10  Jim Meyering  <jim@meyering.net>
7045
7046         * error.c: Correct indentation of cpp directives.
7047
7048 2003-09-09  Paul Eggert  <eggert@twinsun.com>
7049
7050         More K&R removal.
7051
7052         * acosl.c (main): Use a prototype.
7053         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7054         tanl.c: Likewise.
7055
7056         * getloadavg.c (getloadavg, main): Define via prototypes.
7057
7058         * getopt.h (struct option.name): Assume C89, and use 'const'.
7059         (getopt, etopt_long, getopt_long_only, _getopt_internal)
7060         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7061         with a prototype.
7062         * getopt.c (const): Remove macro.
7063         Include <string.h> unconditionally.
7064         (my_index): Remove; all uses changed to strchr.
7065         (strlen): Remove decl.
7066         (exchange): Remove forward decl; no longer needed.
7067         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7068         Define with prototype.
7069         * getopt1.c (const): Remove macro.
7070         (getopt_long, getopt_long_only, main): Define with prototype.
7071
7072         * getugroups.c: Include <string.h> unconditionally.
7073
7074         * getusershell.c: Include <stdlib.h> unconditionally.
7075         (getusershell, setusershell, endusershell, readname, main):
7076         Define with prototypes.
7077
7078         * group-member.c: Include group-member.h first.
7079         Include <stdlib.h> unconditionally.
7080
7081         * hard-locale.c: Include hard-locale.h first.
7082         Include <stdlib.h>, <string.h> unconditionally.
7083
7084         * hash.c (free, malloc): Remove decls.
7085         Include <stdlib.h> unconditionally.
7086
7087         * human.c: Include <stdlib.h>, <string.h> unconditionally.
7088         (getenv): Do not declare.
7089
7090         * idcache.c: Include <string.h> unconditionally.
7091
7092         * long-options.c: Include long-options.h first, to test interface.
7093         Include <stdlib.h> unconditionally.
7094
7095         * makepath.c: Include makepath.h first, to test interface.
7096         Include <stdlib.h> and <string.h> unconditionally.
7097
7098         * linebuffer.c: Include <stdlib.h>.
7099         (free): Remove decl.
7100
7101         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7102         rpl_malloc returns void *, not char *.
7103         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
7104
7105         * md5.h: Include <limits.h> unconditionally.
7106         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7107         (__P): Remove; all uses removed.
7108         * md5.c: Include "md5.h" first.
7109         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7110         md5_buffer, md5_process_bytes, md5_process_block):
7111         Define with prototypes.
7112         * sha.h (__P): Remove all uses.  (It wasn't defined??)
7113         * sha.c: Include "sha.h" first.
7114         Include <stdlib.h>, <string.h> unconditionally.
7115
7116         * memchr.c (__ptr_t): Remove; all uses changed to void *.
7117         * memcmp.c (__ptr_t): Likewise.
7118         * memrchr.c (__ptr_t): Likewise.
7119         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7120         Include <string.h> unconditionally.
7121         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7122         * memchr.c: Include <stdlib.h> unconditionally.
7123         * memchr.c (LONG_MAX): Remove.
7124         * memrchr.c (LONG_MAX): Likewise.
7125         * memchr.c (__memchr): Define via a prototype.
7126         * memrchr.c (__memrchr): Likewise.
7127         * memcmp.c (__P): Remove, and remove all uses.
7128         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7129         Remove forward decls; no longer needed.
7130         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7131         Use types required by C89 in prototype.
7132
7133         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7134         * savedir.c: Likewise.
7135         * mkdir.c (free): Remove decl.
7136         * rmdir.c (rmdir): Define with a prototype.
7137         * savedir.c: Include savedir.h first, to test interface.
7138
7139         * mktime.c (STDC_HEADERS): Remove.
7140         Include <stdlib.h>, <string.h> unconditionally.
7141
7142         * modechange.c: Include <stdlib.h> unconditionally.
7143         (malloc): Remove decl.
7144
7145         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7146         (free): Remove decl.
7147
7148         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7149         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7150         (This type really should be intptr_t, but that's a C99ism.)
7151         (_obstack_memcpy): Remove: all uses changed to memcpy.
7152         Include <string.h> unconditionally.
7153         (struct obstack): Assume __STDC__ for types of members
7154         chunkfun, freefun, extra_arg.
7155         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7156         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7157         obstack_begin, obstack_specify_allocation,
7158         obstack_specify_allocation_with_arg, obstack_chunkfun,
7159         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7160         Remove unprototyped decls and the macros that use them.
7161         * obstack.c (POINTER): Remove.  All uses changed to void *.
7162         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7163         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7164         (defined __STDC__ && __STDC__)]:
7165         Remove nonprototyped code.
7166         Include <stdlib.h> unconditionally.
7167         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7168         _obstack_allocated_p, _obstack_free, obstack_free,
7169         _obstack_memory_used, print_and_abort):
7170         Define using prototypes.
7171         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7172         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7173         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7174         obstack_next_free, obstack_object_size, obstack_room) [0]:
7175         Remove unused, unprototyped code.
7176
7177         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7178
7179         * physmem.c (physmem_total, physmem_available, main): Define
7180         with prototypes.
7181
7182         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7183         (main): Define with a prototype.
7184
7185         * posixver.c (getenv): Remove decl.
7186
7187         * putenv.c (malloc): Returns void *, not char *.
7188         Include <string.h> unconditionally.
7189         (strchr, memcpy, NULL): Do not define.
7190
7191         * readtokens.c: Include readtokens.h first, to test interface.
7192         Include <stdlib.h>, <string.h> unconditionally.
7193         (init_tokenbuffer): Define with a prototype.
7194
7195         * regex.c (PARAMS): Remove.  All uses removed.
7196         All uses of _RE_ARGS removed, too.
7197         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7198         unconditionally.
7199         (bzero): Assume memset exists.
7200         (memcmp, memcpy, NULL): Remove.
7201         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7202         char, or assignments to local vars of type signed char.
7203         (init_syntax_once, PREFIX(extract_number_and_incr),
7204         PREFIX(print_partial_compiled_pattern),
7205         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7206         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7207         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7208         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7209         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7210         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7211         wcs_compile_range, byte_compile_range, truncate_wchar,
7212         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7213         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7214         count_mbs_length, wcs_re_match_2_internal,
7215         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7216         PREFIX(alt_match_null_string_p),
7217         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7218         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7219         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7220         now-unnecessary declaration, if any.
7221         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7222         regcomp, regexec):
7223         Remove now-unnecessary casts among pointer types.
7224         * regex.h (_RE_ARGS): Remove.  All uses removed.
7225
7226         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7227         (free): Remove decl.
7228
7229         * rpmatch.c: Include <stdlib.h> unconditionally.
7230
7231         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7232         (free): Remove decl.
7233
7234         * save-cwd.c: Include <stdlib.h> unconditionally.
7235         * xgetcwd.c: Likewise.
7236
7237         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7238         (free): Remove decl.
7239
7240         * strchrnul.c (strchrnul): Define with a prototype.
7241         Fix bug: c_in was not converted to char before searching.
7242
7243         The following changes are not K&R related:
7244
7245         * group-member.h: Include <sys/types.h>, so that this file is
7246         self-contained.
7247         * makepath.h: Likewise.
7248
7249         * getusershell.c (readname, default_index, line_size, readname):
7250         Use size_t, not int, for sizes.
7251         (readname): If the size overflows, report an error instead of
7252         looping forever.
7253
7254 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7255
7256         * getndelim2.c: Assume stdlib.h per the C89 spec.
7257
7258 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7259
7260         Assume C89 or better; remove K&R cruft.
7261         A few of these changes were first proposed by Derek Robert Price
7262         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7263
7264         * addext.c: Include <string.h> unconditionally.
7265         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7266         Don't declare getenv or malloc.
7267
7268         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7269         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7270         (NULL): Remove.
7271         (find_stack_direction, alloca): Use prototypes.
7272
7273         * atexit.c (atexit): Define using a prototype.
7274
7275         * basename.c, dirname.c, stripslash.c:
7276         Include <string.h> unconditionally.
7277
7278         * bcopy.c: Include <stddef.h>.
7279         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7280
7281         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7282
7283         * error.h (error, error_at_line, error_print_progname)
7284         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7285         * error.c: Include error.h first, to check interface.
7286         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7287         (VA_START): Remove; all uses changeed to va_start.
7288         (exit, strerror): Remove decls.
7289         (error_print_progname): Prototype uncondionally.
7290         Don't include <errno.h>; no longer needed.
7291         (private_strerror): Remove.
7292         (error_tail): Always define.
7293         (error, error_at_line): Assume C89 or better; always use prototypes.
7294         * fatal.c: Include "fatal.h" first, to test interface.
7295         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7296         (VA_START): Remove; all uses changed to va_start.
7297         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7298         this case.
7299         (exit): Remove decl.
7300         (fatal): Prototype unconditionally.  Assume va_start works.
7301         Abort at end, to pacify gcc.
7302
7303         * euidaccess.c (main): Define with a prototype.
7304
7305         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7306
7307         * exitfail.c: Include <stdlib.h> unconditionally.
7308
7309         * fnmatch_.h (__P): Remove.  All uses changed to assume
7310         prototypes.
7311         * fnmatch.c: Include fnmatch.h first, to test interface.
7312         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7313         (getenv): Remove decl.
7314         (fnmatch): Define using a prototype.
7315         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7316         (FCT): Define using a prototype.
7317
7318         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7319
7320         * gethostname.c: Include <stddef.h>.
7321         (gethostname): Define with prototype.  Length is size_t, not int.
7322
7323 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7324
7325         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7326         getversion.c should have been removed then, but was accidentally
7327         preserved.
7328
7329         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7330         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7331
7332 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7333
7334         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7335         copy_tm_result.  Bug reported by Simon Josefsson in
7336         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7337
7338 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7339
7340         * time_r.c, time_r.h: New files.
7341
7342         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7343         __localtime_r.
7344         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7345         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7346
7347         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7348         __gmtime_r.
7349         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7350         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7351         Include <time_r.h>.
7352
7353         * timegm.c: Switch to glibc implementation, with the following changes:
7354         [defined HAVE_CONFIG_H]: Include <config.h>.
7355         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7356         (__mktime_internal) [!defined _LIBC]: New decl.
7357         (__gmtime_r) [!defined _LIBC]: New macro and function.
7358         (timegm): Use a prototype, since gnulib assumes C89.
7359         Do not bother declaring tmp to be const, as it's not really usefu.
7360         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7361         (timegm): Declare only if HAVE_DECL_TIMEGM.
7362
7363 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7364
7365         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7366         Bug reported by Lute Kamstra in
7367         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7368
7369         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7370         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7371         course with correspondingly smaller numbers for tomorrow and
7372         yesterday.  From Tadayoshi Funaba.  Originally installed into
7373         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7374         coreutils merge?).
7375
7376 2003-08-31  Simon Josefsson  <jas@extundo.com>
7377
7378         * timegm.h: New file.
7379         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7380
7381 2003-08-31  Karl Berry  <karl@gnu.org>
7382
7383         * argp.h: update from libc.
7384
7385 2003-08-28  Bruno Haible  <bruno@clisp.org>
7386
7387         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7388         warning on QNX, which defines O_BINARY to 000000.
7389
7390 2003-08-24  Bruno Haible  <bruno@clisp.org>
7391
7392         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7393         MSVC7 <stdio.h> is included later.
7394
7395 2003-08-20  Bruno Haible  <bruno@clisp.org>
7396
7397         * progname.h: New file, from GNU gettext.
7398         * progname.c: New file, from GNU gettext.
7399         * progreloc.c: New file, from GNU gettext.
7400
7401 2003-08-19  Bruno Haible  <bruno@clisp.org>
7402
7403         * xstrdup.c: Assume <string.h> exists.
7404
7405 2003-08-18  Jim Meyering  <jim@meyering.net>
7406
7407         * setenv.h: Indent nested cpp directive.
7408         * vasnprintf.c: Remove trailing blanks.
7409
7410 2003-08-17  Simon Josefsson  <jas@extundo.com>
7411             Bruno Haible  <bruno@clisp.org>
7412
7413         * xstrndup.h: New file.
7414         * xstrndup.c: New file.
7415
7416 2003-08-17  Bruno Haible  <bruno@clisp.org>
7417
7418         * strndup.h: New file.
7419
7420 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7421
7422         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7423         space, undoing this 2003-08-12 change:
7424         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7425
7426 2003-08-16  Jim Meyering  <jim@meyering.net>
7427
7428         Merge from coreutils.
7429         * xstrtoimax.c: #else #if -> #elif.
7430         * xstrtoumax.c: Likewise.
7431
7432 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7433
7434         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7435         rather than tab, after '#' in shell-script copyright notices.
7436         Suggested by Bruno Haible.
7437
7438 2003-08-15  Jim Meyering  <jim@meyering.net>
7439         and Paul Eggert  <eggert@twinsun.com>
7440
7441         Merge from coreutils.
7442         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7443         member but strut utmpx does not.  Needed for AIX 4.3.3.
7444         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7445
7446 2003-08-15  Jim Meyering  <jim@meyering.net>
7447
7448         Merge from coreutils.
7449         * xgethostname.c: Include <stdlib.h>.
7450         (xghostname): Don't exit for anything other than memory-related
7451         failure; just return NULL.
7452         * userspec.c: Include "posixver.h".
7453         (parse_user_spec): Accept `.' as a separator only
7454         in pre-POSIX-200112 mode.
7455         * strtoimax.c: Use #elif rather than #else #if.
7456         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7457         Remove function, now that we can rely on a working tzset function.
7458         [!_LIBC]: Ensure that the required autoconf test has been run.
7459         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7460         Use underlying_strftime for %r.
7461         * sha.c: Merge in some clean-up and optimization changes from glibc.
7462         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7463         Ensure that it is a multiple of 64.
7464         Rearrange loop exit tests so as to avoid performing an
7465         additional fread after encountering an error or EOF.
7466         * realloc.c: Update copyright date.
7467
7468 2003-08-14  Jim Meyering  <jim@meyering.net>
7469
7470         Merge from coreutils.
7471         * obstack.h: Whitespace changes.
7472         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7473         and xcalloc return values.
7474         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7475         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7476         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7477         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7478         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7479         error from mntctl.
7480         Use mntctl's return value to drive the entry-processing loop, since
7481         we can't rely on the value of the vmt_length member in the last
7482         entry.  On some systems doing so could result in exhausting
7483         virtual memory.  Based in part on a patch from Mike Jetzer.
7484
7485 2003-08-14  Jim Meyering  <jim@meyering.net>
7486         and Paul Eggert  <eggert@twinsun.com>
7487
7488         Merges from coreutils, plus other fixes.
7489         * physmem.c: Merge in portability changes from gcc/libiberty
7490         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7491         for credits and details.  Thanks to Kaveh Ghazi for helping
7492         to keep these files in sync.
7493         (ARRAY_SIZE): Define it.
7494         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7495         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7496         (memcasecmp): Don't assume size_t fits in unsigned int.
7497         Remove casts and duplicate code.
7498         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7499         (memcpy): Remove definition.
7500         Merge in some clean-up and optimization changes from glibc.
7501         [BLOCKSIZE]: Move definition to top of file.
7502         Ensure that it is a multiple of 64.
7503         Rearrange loop exit tests so as to avoid performing an
7504         additional fread after encountering an error or EOF.
7505         * md5.h (md5_uintptr): Define.
7506         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7507         return to the initial working directory.  Preserve errno
7508         for caller.
7509         * idcache.c: Include "xalloc.h".
7510         (xmalloc, xrealloc): Remove decls.
7511         (getuser): Remove casts no longer required in C89.
7512         * human.c: Include stdio.h, for sprintf.
7513         * group-member.c: Include "xalloc.h".
7514         (xmalloc, xrealloc): Remove decls.
7515         (get_group_info): Remove casts no longer required in C89.
7516         * getusershell.c (readname): Remove casts no longer required in C89.
7517         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7518         * getline.c: Whitespace fix, from coreutils.
7519
7520 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7521
7522         * exclude.c: Include <ctype.h>
7523         (IN_CTYPE_DOMAIN): New macro.
7524         (is_space): New fn.
7525         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7526         and empty lines.
7527
7528         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7529         Undo previous (whitespace-only) change.
7530
7531 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7532
7533         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7534         Normalize leading white space and remove trailing white space.
7535         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7536         notice, as per ../config/srclist-update.
7537
7538         Merge from coreutils.
7539         * euidaccess.h: New file.
7540         * euidaccess.c: Include it.
7541         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7542         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7543         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7544
7545 2003-08-11  Bruno Haible  <bruno@clisp.org>
7546
7547         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7548         (vasnprintf): Use it instead of wcslen.
7549
7550 2003-08-11  Bruno Haible  <bruno@clisp.org>
7551
7552         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7553         value to ensure that _Bool promotes to int. Use #define for _Bool when
7554         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7555
7556 2003-08-10  Karl Berry  <karl@gnu.org>
7557
7558         * regex.h: update from libc (whitespace fix).
7559
7560 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7561
7562         Merge some files from coreutils.  These changes were
7563         originally made by Jim Meyering.
7564         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7565         many older Unixes require this.
7566         * alloca.c (alloca): Remove cast to argument of free;
7567         no longer needed in C89.
7568         * alloca_.h, regex.h: Fix white space to match
7569         what GNU indent does.
7570
7571 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7572
7573         * bumpalloc.h: Remove.
7574
7575 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7576
7577         * getloadavg.c: Change copyright notice and spacing to conform to
7578         GNU coding style.
7579
7580         Merge from coreutils.
7581         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7582         From glibc.
7583         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7584         from Karl Berry, implemented by Jim Meyering.
7585         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7586         from Dmitry V. Levin.
7587         Remove anachronistic cast of xrealloc.
7588         * fnmatch_.h (__const): Remove.  Use 'const'.
7589         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7590         type. Otherwise, it wouldn't compile with at least /bin/cc on
7591         ymp-cray-unicos9.0.2.X.
7592         Combine two mostly-identical uses of alloca into one.
7593         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7594
7595 2003-08-04  Dave Love <d.love@dl.ac.uk>
7596
7597         [From Emacs.]
7598
7599         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7600         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7601         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7602         obsolete NLIST_NAME_UNION.
7603         [__GNU__]: Undef BSD and FSCALE.
7604         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7605
7606 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7607
7608         * stdbool_.h (_Bool): Make it signed char, instead of
7609         an enum type, so that it's guaranteed to promote to int.  See:
7610         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7611
7612 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7613
7614         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7615         (strerror): Don't assume that a printable int fits in 14 bytes.
7616
7617 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7618             Bruno Haible  <bruno@clisp.org>
7619
7620         * getline.h (getline, getdelim): Change return type to ssize_t.
7621         * getline.c (getline, getdelim): Likewise.
7622         Remove _GNU_SOURCE define; now it's defined in config.h through
7623         m4/getline.m4.
7624
7625 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7626
7627         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7628         over-parenthesization in macros.
7629
7630         Sync with coreutils.
7631
7632         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7633         required by C99.
7634
7635         Use `exit_failure' for xalloc and xmemcoll instead of their own
7636         private exit-failure variables.
7637         * xalloc.h (xalloc_exit_failure): Remove.
7638         * xmalloc.c: Likewise.  Include exitfail.h.
7639         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7640         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7641         * xmemcoll.c: Likewise.  Include exitfail.h.
7642         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7643
7644 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7645
7646         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7647         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7648         to test that it can stand by itself.  Include "exitfail.h".
7649         Clients should set exit_failure instead.
7650         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7651
7652 2003-07-18  Andreas Schwab  <schwab@suse.de>
7653
7654         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7655
7656 2003-07-18  Bruno Haible  <bruno@clisp.org>
7657
7658         * getndelim2.h: New file.
7659         * getndelim2.c: Make into a module of its own. Include config.h,
7660         getndelim2.h.
7661         (getndelim2): Make non-static. Change return type to ssize_t.
7662         * getline.h: Change argument names.
7663         * getline.c: Include getndelim2.h instead of getndelim2.c.
7664         * getnline.c: Include getndelim2.h.
7665
7666 2003-07-17  Bruno Haible  <bruno@clisp.org>
7667
7668         * Makefile.am: Remove file.
7669         * Makefile.in: Remove file.
7670
7671 2003-07-17  Bruno Haible  <bruno@clisp.org>
7672
7673         * getnline.h: New file.
7674         * getnline.c: New file.
7675         * getndelim2.c: New file, extracted from getline.c.
7676         (getndelim2): Renamed from getdelim2, with added nmax argument.
7677         * getline.c: Include getndelim2.c.
7678         (getdelim2): Moved out to getndelim2.c.
7679         (getline, getdelim): Update.
7680
7681 2003-07-15    <karl@gnu.org>
7682
7683         * vasnprintf.c: update from gettext.
7684
7685 2003-07-15  Jim Meyering  <jim@meyering.net>
7686
7687         * makepath.c (make_path): Enclose diagnostic in _(...).
7688
7689 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7690
7691         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7692         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7693         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7694         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7695         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7696         updated automatically by ../config/srclist-update.  This changes
7697         their license from LPGL to GPL.
7698
7699 2003-07-14  Jim Meyering  <jim@meyering.net>
7700
7701         Don't emit diagnostics.  Let callers do that.
7702         * save-cwd.c: Don't include "error.h".
7703         (save_cwd): Don't call error.  Ensure that errno is valid
7704         when returning nonzero.
7705
7706         * save-cwd.h (restore_cwd): Update prototype.
7707         * save-cwd.c (restore_cwd): Remove two parameters.
7708         Simplify.  Don't call error upon failure.  Let callers do that.
7709         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7710         when auditing is enabled.  But don't bother updating the #if.
7711
7712 2003-07-14  Simon Josefsson  <jas@extundo.com>
7713
7714         * mempcpy.h: New file.
7715         * mempcpy.c: New file.
7716
7717 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7718
7719         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7720         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7721         unicodeio.c, unicodeio.h, unlocked-io.h:
7722         Switch from LGPL to GPL.
7723
7724 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7725
7726         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7727         it breaks C++ compilation.
7728         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7729
7730 2003-07-10  Jim Meyering  <jim@meyering.net>
7731
7732         * vasnprintf.c: Remove trailing blanks.
7733         Make cpp indentation consistent.
7734
7735 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7736
7737         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7738         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7739         Switch from LGPL to GPL.
7740
7741 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7742
7743         * mktime.c: Fix some boundary cases and remove need for floating point.
7744
7745         Issue a compile-time diagnostic if time_t is floating point, or if
7746         two's complement arithmetic is not in effect, or if arithmetic
7747         right shift does not propagate the sign.  These assumptions were
7748         all in the original code but they weren't checked.
7749
7750         (TIME_T_MIDPOINT, verify): New macros.
7751         (__isleap): Remove; it has integer overflow problems.
7752         (leapyear): New function, without those problems.
7753         (ydhms_tm_diff): Remove; splitting into two parts.
7754         (ydhms_diff): New function, containing the arithmetic part of
7755         the old ydhms_tm_diff function.  Issue a compile-time
7756         diagnostic if we are not using C99 integer division.
7757         Avoid casts when possible.
7758         (guess_time_tm): New function, containing the checking part of
7759         the old ydhms_tm_diff function.  Return the new value, rather than
7760         the difference between it and the old.  Accept a new argument T
7761         so that *T specifies the old value.  Check for overflow in the result.
7762
7763         (__mktime_internal): Use a time_t offset, not a long int offset.
7764         This undoes the 2003-06-04 change, which is no longer needed now
7765         that we have better overflow checking.
7766         (localtime_offset): Likewise.
7767
7768         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7769         and long are 64-bit but int is only 32-bit.
7770         (ydhms_diff): Use long int to store year1 and yday1.
7771         Issue a compile-time diagnostic if long int is not wide enough.
7772
7773         (__mktime_internal): Use long int to store adjusted year and yday.
7774         Use plain C rather than preprocessor commands, if that doesn't
7775         affect efficiency.
7776         Check for overflow (and try to repair) after each probe
7777         rather than checking only at the very end.  This avoids some bugs
7778         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7779         does not equal GMT offset at maximum time).
7780         Use integer to check for overflow rather than floating point; this
7781         is more portable to non-IEEE hosts, and is a tad faster.
7782         When we detect that we are oscillating between two values,
7783         don't check whether tm_isdst has the requested value, since
7784         we already know the answer.  When tm_isdst has the wrong value,
7785         use a different heuristic to find the right one, based on the
7786         extreme values actually observed in practice in tz2003a,
7787         rather than the (overly optimistic) "previous 3 calendar quarters".
7788
7789         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7790         "T const" to accommodate glibc style.
7791         (check_result): Use less-confusing report format.  "long" -> "long int.
7792         (main): Likewise.
7793         Don't loop if the iteration overflows time_t.
7794         Allow a negative step in the iteration.
7795
7796 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7797
7798         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7799         having it depend on HAVE_SYS_TYPES_H.
7800
7801 2003-06-25  Bruno Haible  <bruno@clisp.org>
7802
7803         * readlink.c: New file.
7804
7805 2003-06-20  Bruno Haible  <bruno@clisp.org>
7806
7807         Assume C89, so PARAMS isn't needed.
7808         * unicodeio.h (PARAMS): Remove.
7809         * unicodeio.c: Don't use PARAMS.
7810
7811 2003-06-18  Jim Meyering  <jim@meyering.net>
7812
7813         Merge changes from coreutils.
7814         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7815         Remove explicit declarations of xmalloc and realloc.
7816         Include xalloc.h.
7817         (read_utmp): Remove anachronistic cast of xmalloc.
7818
7819 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7820
7821         Assume C89, so PARAMS isn't needed.
7822         * backupfile.h (PARAMS): Remove.  All uses removed.
7823         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7824         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7825         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7826         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7827         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7828         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7829         xstrtol.h: Likewise.
7830         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7831         same.h, strverscmp.h: Do not include config.h; no longer needed.
7832         Anyway, config.h should always be included before any other file.
7833
7834 2003-06-11  Simon Josefsson  <jas@extundo.com>
7835
7836         * sysexit_.h: New file.
7837
7838 2003-05-20  Derek Price  <derek@ximbiot.com>
7839
7840         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7841
7842 2003-06-10  Simon Josefsson  <jas@extundo.com>
7843
7844         * strchrnul.h: New file.
7845         * strchrnul.c: New file.
7846
7847 2003-06-10  Simon Josefsson <jas@extundo.com>
7848
7849         * argp.h: New file, from glibc.
7850         * argp-ba.c: New file, from glibc.
7851         * argp-eexst.c: New file, from glibc.
7852         * argp-fmtstream.c: New file, from glibc.
7853         * argp-fmtstream.h: New file, from glibc.
7854         * argp-fs-xinl.c: New file, from glibc.
7855         * argp-help.c: New file, from glibc.
7856         * argp-namefrob.h: New file, from glibc.
7857         * argp-parse.c: New file, from glibc.
7858         * argp-pv.c: New file, from glibc.
7859         * argp-pvh.c: New file, from glibc.
7860         * argp-xinl.c: New file, from glibc.
7861
7862 2003-06-07  Jim Meyering  <jim@meyering.net>
7863
7864         * readtokens.h: Put `Free Software Foundation, Inc.'
7865         in place of my name in the copyright comment.
7866         Remove definition and uses of __P.
7867
7868         From coreutils.
7869         * stat.c: Don't declare xmalloc explicitly.
7870         Instead, include "xalloc.h".
7871         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7872         xrealloc, and xcalloc return values.
7873         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7874         Improve comment.
7875         * xgetcwd.h: Remove definition/uses of PARAMS.
7876
7877 2003-06-06  Jim Meyering  <jim@meyering.net>
7878
7879         * stdbool_.h: Renamed from stdbool.h.in.
7880
7881 2003-06-06  Jim Meyering  <jim@meyering.net>
7882
7883         Merge from coreutils.
7884         * same.c: (same_name): Declare *_basename locals to be `const'.
7885         Consolidate declarations and initializations of *_base* locals.
7886
7887         Merge from coreutils.
7888         This avoids a core dump on systems without GNU putenv,
7889         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7890         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7891         (unsetenv): New static function, from GNU libc.
7892         (rpl_putenv): Use it.
7893
7894         * modechange.c: Remove trailing blanks.
7895
7896         Merge from coreutils.
7897         * fsusage.c: Remove declaration of statfs.
7898         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7899
7900         * posixtm.c: Include <stdbool.h> unconditionally.
7901
7902 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7903
7904         * mktime.c (__mktime_internal): When resolving a tm_isdst
7905         mismatch, look in future quarters as well as past.  This fixes a
7906         bug when processing fall-backwards gaps immediately after a long
7907         period of daylight-saving time.
7908
7909         * mktime.c: Assume freestanding C89 or better.
7910         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7911         (__P): Remove; not used.
7912         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7913         (mktime, not_equal_tm, print_tm, check_result,
7914         main): Use prototypes.  Use const * where appropriate.
7915         (main): Fix typo in testing code that uncovered by above changes.
7916         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7917
7918 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7919
7920         * mktime.c: Fix Debian bug 177940
7921         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7922         (localtime_offset): Now long int, not time_t, because we want it
7923         to be guaranteed to be signed.  All uses changed.
7924         (__mktime_internal): If overflow would occur when adding offset,
7925         don't add it.
7926
7927         Merge 'human' changes from coreutils.  Rewrite to support
7928         locale-specific notations like thousands separators.
7929         * human.c: Simplify authorship notice.
7930         Include human.h immediately after config.h.
7931         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7932         <limits.h>: Do not include, since human.h does.
7933         (SIZE_MAX, UINTMAX_MAX): New macros.
7934         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7935         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7936         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7937         (power_letter): Renamed from suffixes.
7938         (generate_suffix_backwards): Remove.
7939         (adjust_value): Now takes int style (because of human.h changes)
7940         and long double value (for greater precision on some platforms).
7941         (group_number): New function.
7942         (human_readable): Use it.  Use integer options, not enum.
7943         Put the options before the sizes in the arg list.
7944         Support all the new options.
7945         The old human_readable function has been removed;
7946         use inttostr.h instead.
7947         (human_readable, default_block_size, humblock):
7948         Use uintmax_t, not int, for block sizes.
7949         (human_readable_inexact, block_size_types): Remove.
7950         (block_size_opts): New constant.
7951         (human_options): Renamed from human_block_size, with new signature
7952         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7953         * human.h: Add copyright and authorship notice.
7954         Include <limits.h> and <stdbool.h> unconditionally.
7955         (PARAMS): Remove.  All uses removed.
7956         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7957         (enum human_inexact_style): Remove tag; now a nameless enum.
7958         (human_floor, human_ceiling, human_round_to_even): Now have
7959         values 2, 0, 1 rather than -1, 1, 0.
7960         (human_group_digits, human_suppress_point_zero, human_autoscale,
7961         human_base_1024, human_SI, human_B): New constants.
7962         (human_readable_inexact, human_block_size): Remove.
7963         (human_readable): Size args are now uintmax_t, not int.
7964         (human_options): New decl.
7965
7966         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7967         unnecessary now that we assume C89 or better.  This change
7968         imported from coreutils.
7969
7970         * mktime.c (__mktime_internal): Do not reject negative timestamps
7971         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7972         in the 2003-05-30 sync from glibc.
7973
7974         .h files should stand alone, but we shouldn't include <sys/types.h>
7975         if we can get away with just <stddef.h>.
7976
7977         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7978         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7979         rather than <sys/types.h>, as we merely need size_t.
7980         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7981         to get size_t.
7982         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7983         Include <stdio.h>, to get FILE.
7984         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7985         memcasecmp.h has included <stddef.h> and all we need is size_t.
7986         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7987         our interface, instead of including <sys/types.h>
7988
7989 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7990
7991         [from coreutils]
7992         Fix some minor time-related bugs with POSIX time arguments.
7993         Some valid time stamps were being rejected (notably -1, and
7994         time stamps before 1900 on 64-bit hosts).  And some invalid
7995         time stamps were being accepted, e.g. September 31.
7996
7997         * posixtm.h (posixtime): Return bool instead of time_t, so
7998         that we can return (time_t) -1 successfully.
7999         * posixtm.c: Likewise.
8000         [HAVE_STDBOOL_H]: Include <stdbool.h>.
8001         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8002         (t): Remove static var.
8003         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8004         of static var.  All uses changed.
8005         (year): Do not reject years before 1900; they can occur with
8006         64-bit time_t.
8007         (posix_time_parse): Do not check for out-of-range components;
8008         that is now the caller's responsibility, since our checks were
8009         only approximations.
8010         (posixtime): Use mktime to check for out-of-range components,
8011         since it knows them exactly.
8012         If mktime returns (time_t) -1, check whether an error actually occurred
8013         by invoking localtime on -1.
8014         (main) [TEST_POSIXTIME]: Check for input data errors, and report
8015         posixtime failures better.
8016         Improve the test data (in comments only).
8017
8018 2003-05-30    <karl@gnu.org>
8019
8020         * mktime.c: update from libc.
8021
8022 2003-05-30  Bruno Haible  <bruno@clisp.org>
8023
8024         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8025         * localcharset.h: Likewise.
8026         * localcharset.c: Likewise.
8027
8028 2003-05-28  Paul Eggert  <eggert@twinsun.com>
8029
8030         Assume the headers required for C89 freestanding compilers.
8031         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8032         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8033         without checking for HAVE_LIMITS_H.
8034         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8035         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8036         to do that.
8037         * fatal.c: Include <stdarg.h> without checking for __STDC__.
8038         * exclude.c: Include <stdbool.h> unconditionally.
8039         * tempname.c: Include <stddef.h> unconditionally.
8040         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8041         * modechange.c, rpmatch.c (NULL): Don't define, since
8042         <stddef.h> does that.
8043         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8044         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8045         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8046         * xstrtol.c: Likewise.
8047         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8048         * savedir.c: Include <stddef.h> instead of defining NULL.
8049
8050         * addext.c (addext): Use assignment rather than cast, to avoid
8051         warnings on some platforms.
8052
8053         * mktime.c (__mktime_internal): Do not reject negative timestamps
8054         arbitrarily.
8055
8056 2003-05-10  Bruno Haible  <bruno@clisp.org>
8057
8058         * linebreak.c (iconv_string_length): Don't return -1 just because the
8059         string is longer than 4 KB.
8060
8061 2003-05-12  Jim Meyering  <jim@meyering.net>
8062
8063         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8064         the space-padded-by-default conversion specifiers, %e, %k, %l.
8065
8066 2003-05-03  Bruno Haible  <bruno@clisp.org>
8067
8068         Upgrade to Unicode-4.0.
8069         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8070         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8071         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8072         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8073         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8074         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8075         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8076         Change width of U+E0100..U+E01EF from 1 to 0.
8077
8078 2003-04-25  Bruno Haible  <bruno@clisp.org>
8079
8080         * copy-file.c: Include <stddef.h>, for size_t.
8081
8082 2003-04-25  Jim Meyering  <jim@meyering.net>
8083
8084         * copy-file.c (copy_file_preserving): Declare buf_size to be
8085         of type size_t, not int.
8086
8087 2003-04-11  Jim Meyering  <jim@meyering.net>
8088
8089         Merge changes from Coreutils.
8090
8091         2003-03-22  Jim Meyering  <jim@meyering.net>
8092
8093         * strftime.c (widen): Cast alloca return value to proper type.
8094
8095         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
8096
8097         From GNU libc.
8098         * strftime.c (my_strftime): Handle very large width
8099         specifications for numeric values correctly.  Improve checks for
8100         overflow.
8101
8102         2003-01-19  Jim Meyering  <jim@meyering.net>
8103
8104         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8105         (nl_get_alt_digit) [! defined my_strftime]: Define.
8106         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8107         _nl_get_alt_digit and _nl_get_walt_digit.
8108
8109         * strftime.c (my_strftime): Merge in locale-related changes from libc.
8110         These changes have no effect outside of _LIBC.
8111
8112 2003-04-10  Bruno Haible  <bruno@clisp.org>
8113
8114         * findprog.h: New file, from GNU gettext.
8115         * findprog.c: New file, from GNU gettext.
8116
8117 2003-04-05  Jim Meyering  <jim@meyering.net>
8118
8119         Merge changes from Coreutils.
8120
8121         * exclude.h (PARAMS): Remove definition and uses.
8122         * exclude.c: Remove uses of `PARAMS'.
8123
8124         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8125         Add test-cases for DOS filenames. Declare program_name.
8126         (main): Set up program_name.  Patch by Rich Dawe.
8127
8128         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8129         error from mntctl.
8130         Use mntctl's return value to drive the entry-processing loop, since
8131         we can't rely on the value of the vmt_length member in the last
8132         entry.  On some systems doing so could result in exhausting
8133         virtual memory.  Based in part on a patch from Mike Jetzer.
8134
8135 2003-04-04  Bruno Haible  <bruno@clisp.org>
8136
8137         * linebreak.h: New file, from GNU gettext.
8138         * linebreak.c: New file, from GNU gettext with slight modifications.
8139         * lbrkprop.h: New file, from GNU gettext.
8140
8141 2003-04-03  Bruno Haible  <bruno@clisp.org>
8142
8143         * utf8-ucs4.h: New file, from GNU gettext.
8144         * utf16-ucs4.h: New file, from GNU gettext.
8145         * ucs4-utf8.h: New file, from GNU gettext.
8146         * ucs4-utf16.h: New file, from GNU gettext.
8147
8148 2003-04-02  Bruno Haible  <bruno@clisp.org>
8149
8150         * binary-io.h: New file, from GNU gettext.
8151
8152 2003-04-01  Bruno Haible  <bruno@clisp.org>
8153
8154         * pathname.h: New file, from GNU gettext.
8155         * concatpath.c: New file, from GNU gettext.
8156
8157 2003-03-30  Bruno Haible  <bruno@clisp.org>
8158
8159         * copy-file.c (copy_file_preserving): Don't set owner if the function
8160         chown() doesn't exist.
8161
8162 2003-03-28  Bruno Haible  <bruno@clisp.org>
8163
8164         * copy-file.h: New file, from GNU gettext.
8165         * copy-file.c: New file, from GNU gettext.
8166
8167 2003-03-18  Jim Meyering  <jim@meyering.net>
8168
8169         * quote.c (quote_n): Fix typo in comment.
8170
8171 2003-03-14  Jim Meyering  <jim@meyering.net>
8172
8173         Merge changes from Coreutils.
8174         * obstack.h (obstack_object_size): Declare temporary, __o,
8175         to be const, in order to avoid warnings.
8176         (obstack_room): Likewise.
8177         (obstack_empty_p): Likewise.
8178
8179 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8180
8181         Merge changes from Bison.
8182         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8183         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8184         when compiling Bison 1.875's `bitset bset = obstack_alloc
8185         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8186         * hash.c: Include <stdbool.h> unconditionally.
8187
8188 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8189
8190         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8191         Reported by Bruce Becker; see:
8192         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8193
8194 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8195             Bruno Haible  <bruno@clisp.org>
8196
8197         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8198         Reported by John Hughes, see
8199         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8200
8201 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8202
8203         * poll_.h: New file.
8204         * poll.c: New file.
8205
8206 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8207
8208         * mathl.h: New file.
8209         * acosl.c: New file.
8210         * asinl.c: New file.
8211         * atanl.c: New file.
8212         * ceill.c: New file.
8213         * cosl.c: New file.
8214         * expl.c: New file.
8215         * floorl.c: New file.
8216         * frexpl.c: New file.
8217         * ldexpl.c: New file.
8218         * logl.c: New file.
8219         * sincosl.c: New file.
8220         * sinl.c: New file.
8221         * sqrtl.c: New file.
8222         * tanl.c: New file.
8223         * trigl.c: New file.
8224         * trigl.h: New file.
8225
8226 2003-02-17  Bruno Haible  <bruno@clisp.org>
8227
8228         * mkdtemp.h: New file, from GNU gettext.
8229         * mkdtemp.c: New file, from GNU gettext.
8230
8231 2003-01-31  Bruno Haible  <bruno@clisp.org>
8232
8233         * rename.c: #undef rename before defining rpl_rename.
8234         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8235
8236 2003-01-30  Bruno Haible  <bruno@clisp.org>
8237
8238         * printf-args.h: New file, from GNU gettext.
8239         * printf-args.c: New file, from GNU gettext.
8240         * printf-parse.h: New file, from GNU gettext.
8241         * printf-parse.c: New file, from GNU gettext.
8242         * vasnprintf.h: New file, from GNU gettext.
8243         * vasnprintf.c: New file, from GNU gettext.
8244         * asnprintf.c: New file, from GNU gettext.
8245         * vasprintf.h: New file, from GNU gettext with modifications.
8246         * vasprintf.c: New file, from GNU gettext.
8247         * asprintf.c: New file, from GNU gettext.
8248
8249 2003-01-29  Bruno Haible  <bruno@clisp.org>
8250
8251         * stpncpy.h: New file, from GNU gettext with modifications.
8252         * stpncpy.c: New file, from GNU gettext with modifications.
8253
8254 2003-01-28  Bruno Haible  <bruno@clisp.org>
8255
8256         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8257         Paul Eggert.
8258         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8259         Paul Eggert.
8260
8261 2003-01-27  Bruno Haible  <bruno@clisp.org>
8262
8263         * xsetenv.h: New file, from GNU gettext.
8264         * xsetenv.c: New file, from GNU gettext.
8265
8266 2003-01-23  Bruno Haible  <bruno@clisp.org>
8267
8268         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8269
8270 2003-01-22  Bruno Haible  <bruno@clisp.org>
8271
8272         * exit.h: New file, from GNU gettext.
8273
8274 2003-01-11  Bruno Haible  <bruno@clisp.org>
8275
8276         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8277         * strcase.h (strcasecmp, strncasecmp): Likewise.
8278
8279 2003-01-14  Jim Meyering  <jim@meyering.net>
8280
8281         * same.c (same_name): Tweak a comment.
8282
8283 2003-01-11  Bruno Haible  <bruno@clisp.org>
8284
8285         * same.c (same_name): Reorder tests so as to avoid calling stat()
8286         when a string comparison is sufficient.
8287
8288 2003-01-11  Bruno Haible  <bruno@clisp.org>
8289
8290         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8291         'unsigned int'.
8292
8293 2003-01-11  Bruno Haible  <bruno@clisp.org>
8294
8295         * hash-pjw.c: Add comment about low quality of this function.
8296
8297 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8298
8299         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8300         to avoid collisions with libcurses and libreadline.
8301
8302         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8303         * getstr.h, getstr.c: Remove.
8304         * getline.c: Include "getline.h", to check interface.
8305         Move body of old getstr.c here: this defines MIN_CHUNK and
8306         declares getdelim2, which is renamed from getstr.
8307         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8308
8309         * linebuffer.c (readlinebuffer): Renamed from readline.
8310         All uses changed.
8311         * linebuffer.h: Likewise.
8312         (readline): Remove backward-compatibility macro.
8313
8314 2003-01-12  Jim Meyering  <jim@meyering.net>
8315
8316         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8317
8318 2003-01-10  Bruno Haible  <bruno@clisp.org>
8319
8320         * alloca_.h: New file.
8321         * getdate.y: Unconditionally include alloca.h.
8322         * makepath.c: Likewise.
8323         * setenv.c: Likewise.
8324         * userspec.c: Likewise.
8325
8326 2003-01-09  Bruno Haible  <bruno@clisp.org>
8327
8328         * stdbool.h.in: New file.
8329
8330 2003-01-08  Bruno Haible  <bruno@clisp.org>
8331
8332         * safe-read.c: Include specification header first, to ensure its
8333         selfcontainedness.
8334         * full-write.c: Likewise.
8335
8336 2003-01-08  Jim Meyering  <jim@meyering.net>
8337
8338         * full-write.c: Undefine and define-away `const' after inclusion
8339         of errno.h, not before.  Suggestion from Bruno Haible.
8340
8341 2003-01-07  Jim Meyering  <jim@meyering.net>
8342
8343         * full-write.c: Rework so that it may serve to define full_read, too.
8344         * full-read.c: Simply #define FULL_READ and include full-write.c.
8345
8346 2003-01-06  Jim Meyering  <jim@meyering.net>
8347
8348         * version-etc.c: Update year in translatable copyright string.
8349
8350 2002-12-25  Bruno Haible  <bruno@clisp.org>
8351
8352         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8353         * xstrtol.h: Likewise.
8354         * xstrtoimax.c: Likewise.
8355         * xstrtoumax.c: Likewise.
8356         * human.h: Likewise.
8357
8358         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8359         on systems that have <inttypes.h> but not <stdint.h>.
8360
8361 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8362
8363         * memcoll.c (memcoll): Fall back on a simple algorithm using
8364         memcmp if strcoll doesn't work.
8365
8366 2002-12-23  Bruno Haible  <bruno@clisp.org>
8367
8368         * localcharset.h: New file.
8369         * localcharset.c: Include it.
8370         * unicodeio.c: Likewise.
8371
8372 2002-12-22  Bruno Haible  <bruno@clisp.org>
8373
8374         * utime.c (utime_null): No need to call ftruncate if the file was
8375         nonempty.
8376
8377 2002-12-23  Bruno Haible  <bruno@clisp.org>
8378
8379         * memcoll.c (STRCOLL): New macro.
8380         (memcoll): Use it.
8381
8382 2002-12-22  Bruno Haible  <bruno@clisp.org>
8383
8384         * getstr.h (getstr): Define, to avoid clash with libcurses.
8385         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8386
8387 2002-12-22  Bruno Haible  <bruno@clisp.org>
8388
8389         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8390
8391 2002-12-23  Bruno Haible  <bruno@clisp.org>
8392
8393         * getline.h: Include <stddef.h>, for size_t.
8394
8395         * unicodeio.h: Include <stddef.h>, for size_t.
8396         * unicodeio.c: Don't include <stddef.h>.
8397
8398 2002-12-17  Bruno Haible  <bruno@clisp.org>
8399
8400         * canon-host.c (strdup): Remove unused declaration.
8401
8402         * fsusage.c: Include full_read.h.
8403         (get_fs_usage): Use full_read instead of safe_read.
8404
8405         * utime.c (utime_null): Use SAFE_READ_ERROR.
8406
8407 2002-12-11  Bruno Haible  <bruno@clisp.org>
8408
8409         * setenv.h: Rewritten to cope with systems that have setenv() but not
8410         unsetenv().
8411         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8412         modifications:
8413
8414         2002-12-11  Bruno Haible  <bruno@clisp.org>
8415
8416                 * setenv.c (alloca): Fall back to malloc.
8417                 (freea): New macro.
8418                 (setenv): Use freea() to free memory allocated with alloca().
8419
8420         2002-11-13  Bruno Haible  <bruno@clisp.org>
8421
8422                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8423                 function declarations.
8424                 * unsetenv.c (unsetenv): Likewise.
8425
8426         2002-03-04  Bruno Haible  <bruno@clisp.org>
8427
8428                 Portability to AIX 4.3.3.
8429                 * unsetenv.c: New file, extracted from setenv.c.
8430                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8431
8432         2001-12-20  Bruno Haible  <bruno@clisp.org>
8433
8434                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8435                 use malloc instead. For SunOS 4.
8436
8437         2001-12-11  Bruno Haible  <bruno@clisp.org>
8438
8439                 * setenv.c: Declare alloca.
8440                 (compar_fn_t): New typedef.
8441                 (KNOWN_VALUE, STORE_VALUE): Use it.
8442
8443         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8444         setenv.h.
8445
8446 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8447
8448         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8449         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8450         Choose values that are less likely to collide with system fnmatch
8451         options.
8452         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8453         defined (e.g., a pure POSIX system).
8454         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8455         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8456
8457 2002-12-06  Jim Meyering  <jim@meyering.net>
8458
8459         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8460
8461         Merge in changes from libc's misc/error.c, in preparation
8462         for the merge of gnulib's changes back into libc.
8463
8464         * error.c (_): Define only if not already defined.
8465         Move definition to follow all #include directives.
8466         Include unlocked-io.h only if !_LIBC.
8467         [_LIBC]: Include <libio/libioP.h>.
8468         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8469         (fflush): Tweak definition to use INTUSE.
8470         (putc): Define.
8471
8472 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8473
8474         * alloca.c [defined emacs]: Include "lisp.h".
8475         (xalloc_die) [defined emacs]: New macro.
8476         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8477         [! defined emacs]: Include <xalloc.h>.
8478         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8479         (pointer): Typedef to POINTER_TYPE *.
8480         (malloc): Remove decl; we now always use xmalloc.
8481         (alloca): Use old-style definition, since Emacs needs this.
8482         Check for arithmetic overflow when computing combined size.
8483
8484 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8485
8486         Do not generate unlocked-io.h automatically, since it's easier to
8487         maintain it by hand.
8488
8489         * unlocked-io.h: New file, from GNU diffutils,
8490         but with proper copyright notice and attribution.
8491         * gen-uio: Remove.
8492         * Makefile.am: Add copyright notice.
8493         (libfetish_a_SOURCES): Add unlocked-io.h.
8494         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8495         (DISTCLEANFILES, io_functions): Remove macros.
8496         (EXTRA_DIST): Remove gen_uio.
8497         (unlocked-io.h): Remove rule.
8498
8499 2002-12-04  Jim Meyering  <jim@meyering.net>
8500
8501         Reflect the fact that stat.c and lstat.c are no longer generated.
8502         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8503         (DISTCLEANFILES): Likewise.
8504         (EXTRA_DIST): Likewise.
8505         (all_local): Don't depend on stat.c or lstat.c.
8506         (stat.c, lstat.c): Remove rules.
8507         (EXTRA_DIST): Remove xstat.in.
8508
8509         * xstat.in: Remove file.  Contents moved into stat.c.
8510         * stat.c: New file.  Contents mostly from xstat.in.
8511         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8512         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8513
8514         * safe-read.c: Rework so that it may serve to define safe_write, too.
8515         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8516
8517 2002-12-03  Jim Meyering  <jim@meyering.net>
8518
8519         * safe-read.c, safe-write.c: Change variable names and comments, but
8520         not semantics, to minimize the differences between these two files.
8521         (safe_read): Change comment to mention SAFE_READ_ERROR.
8522
8523         * safe-read.c (IS_EINTR): Define.
8524         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8525
8526 2002-12-02  Bruno Haible  <bruno@clisp.org>
8527
8528         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8529         Define, taken from safe-read.c.
8530         (INT_MAX): Provide fallback.
8531         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8532         * safe-write.h (SAFE_WRITE_ERROR): Define.
8533
8534         * safe-read.c (EINTR): Remove definition.
8535         (safe_read): Don't use EINTR if it is absent.
8536
8537 2002-12-02  Jim Meyering  <jim@meyering.net>
8538
8539         * safe-read.c (EINTR): Define.
8540         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8541         (INT_MAX): Provide fallback.
8542         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8543
8544         * safe-read.h (SAFE_READ_ERROR): Define.
8545
8546 2002-12-01  Jim Meyering  <jim@meyering.net>
8547
8548         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8549         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8550
8551 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8552
8553         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8554         hash_rehash): Replace `if (limit <= value) abort ();' with
8555         `if (! (value < limit)) abort ();', for readability.
8556
8557 2002-11-26    <karl@gnu.org>
8558
8559         * strdup.c: copy from libc again, with jim's ok.
8560         * .cppi-disable: re-add strdup.c
8561
8562 2002-11-25    <karl@gnu.org>
8563
8564         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8565         instead of "strtol.c".
8566
8567 2002-11-25  Jim Meyering  <jim@meyering.net>
8568
8569         * mktime.c: Sync from libc, now that it has the latest fix.
8570
8571 2002-11-24    <karl@gnu.org>
8572
8573         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8574         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8575
8576 2002-11-24  Jim Meyering  <jim@meyering.net>
8577
8578         Update from coreutils:
8579
8580         * mktime.c: Merge in changes from libc.
8581
8582         Avoid a link-time failure on some Linux systems.
8583         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8584         (__mon_yday): Declare with the STATIC attribute.
8585         (__mktime_internal): Likewise.
8586         Based on a report from Greg Schafer.
8587
8588 2002-11-23  Jim Meyering  <jim@meyering.net>
8589
8590         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8591         Use `unsigned', not `int', as type of index.
8592
8593         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8594
8595         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8596
8597 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8598
8599         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8600         hint that one should use `if (! x) abort ();' rather than `assert
8601         (x);', and anyway it's one less thing to worry about configuring.
8602         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8603         hash_rehash, hash_insert): Use abort rather than assert.
8604
8605 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8606
8607         * quotearg.h: Allow multiple inclusion by surrounding with
8608         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8609         so that we can be included first.
8610         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8611         * quotearg.c: Include quotearg.h immediately after config.h.
8612         No need to include stddef.h or sys/types.h any more.
8613         Surround local include files with "", not "<>".
8614         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8615         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8616         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8617         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8618         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8619         (ISPRINT): Remove; no longer needed now that we assume C89.
8620
8621         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8622         Preserve errno.
8623
8624         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8625         quotearg_char): Use SIZE_MAX rather than
8626         (size_t) -1 when we are talking about "infinity".
8627
8628         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8629
8630 2002-11-22  Bruno Haible  <bruno@clisp.org>
8631
8632         * safe-read.h: Assume C89. Add comments.
8633         (safe_read): Change return type to size_t.
8634         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8635         counts > SSIZE_MAX correctly.
8636         * safe-write.h: New file.
8637         * safe-write.c: New file.
8638         * full-read.h: New file.
8639         * full-read.c: New file.
8640         * full-write.h: Assume C89. Add comments.
8641         * full-write.c: Include safe-write.h.
8642         (full_write): Rewritten to use safe_write.
8643         Suggested by Jim Meyering and Paul Eggert.
8644
8645 2002-11-21  Bruno Haible  <bruno@clisp.org>
8646
8647         Remove case insensitive option matching.
8648         * argmatch.h (argcasematch): Remove declaration.
8649         (ARGCASEMATCH): Remove macro.
8650         (__xargmatch_internal): Remove case_sensitive argument.
8651         (XARGMATCH): Update.
8652         (XARGCASEMATCH): Remove macro.
8653         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8654         case_sensitive argument.
8655         (argcasematch): Remove function.
8656         (__xargmatch_internal): Remove case_sensitive argument.
8657         (main): Use XARGMATCH instead of XARGCASEMATCH.
8658
8659         * xmalloc.c: Change compile-time error message. Add comment about
8660         required autoconf version.
8661
8662 2002-11-21  Jim Meyering  <jim@meyering.net>
8663
8664         * strdup.c (strdup): Tweak comment and initial #if/#include.
8665
8666         Merge in changes from the coreutils.
8667
8668         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8669         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8670         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8671         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8672         int.  Work more efficiently if X is the same width as uintmax_t.
8673         Do not compare X to -1, to avoid bogus compiler warning.
8674         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8675         Don't assume that f_frsize and f_bsize are the same type.
8676
8677         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8678         on FreeBSD.
8679
8680         * makepath.c (make_path): Restore umask *before* creating the final
8681         component.
8682         (make_path): Minor reformatting.
8683
8684         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8685         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8686
8687         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8688         ones.  At least on GNU/Linux systems, `auto' means something else.
8689         From Michael Stone.
8690
8691 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8692
8693         Merge argmatch cleanups from Bison.  Assume C89.
8694
8695         * argmatch.c: Include config.h here, not in argmatch.h.
8696         Include stdlib.h, for EXIT_FAILURE.
8697         Always include <string.h>, since we assume C89.
8698         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8699         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8700         Include <stddef.h> instead, since it's all we need for size_t.
8701         (PARAMS): Remove.  All uses removed.
8702         (ARRAY_CARDINALITY): Do not bother to #undef.
8703         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8704         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8705         Remove unnecessary parentheses.
8706         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8707         Insert necessary parentheses.
8708         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8709         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8710
8711 2002-11-19  Bruno Haible  <bruno@clisp.org>
8712
8713         * mbswidth.c: Include mbswidth.h right at the beginning.
8714         * mbswidth.h: Include <stddef.h>, for size_t.
8715
8716         * mbswidth.h (PARAMS): Remove macro.
8717         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8718         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8719
8720         * gcd.h (PARAMS): Remove macro.
8721         (gcd): Use ANSI C function declarations.
8722         * gcd.c (gcd): Likewise.
8723
8724 2002-11-15  Bruno Haible  <bruno@clisp.org>
8725
8726         * strcspn.c: Include <stddef.h>.
8727         (strcspn): Use ANSI C function declaration. Change return type to
8728         size_t. Use NULL.
8729         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8730         (strpbrk): Use NULL.
8731         * strpbrk.h (PARAMS): Remove macro.
8732         (strpbrk): Use ANSI C function declaration.
8733         * strstr.c: Don't include <sys/types.h>.
8734         * strstr.h (PARAMS): Remove macro.
8735         (strstr): Use ANSI C function declarations.
8736
8737 2002-11-06  Bruno Haible  <bruno@clisp.org>
8738
8739         * gcd.h (gcd): Change argument type to 'unsigned long'.
8740         * gcd.c (gcd): Likewise.
8741
8742 2002-11-05  Bruno Haible  <bruno@clisp.org>
8743
8744         * gcd.h: New file, from gettext-0.11.5.
8745         * gcd.c: New file, from gettext-0.11.5.
8746
8747 2002-11-05  Bruno Haible  <bruno@clisp.org>
8748
8749         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8750         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8751         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8752         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8753
8754         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8755         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8756
8757         * closeout.c: Include gettext.h instead of <libintl.h>.
8758         * human.c: Include gettext.h instead of <libintl.h>.
8759         * quotearg.c: Include gettext.h instead of <libintl.h>.
8760         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8761         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8762         * userspec.c: Include gettext.h instead of <libintl.h>.
8763         * version-etc.c: Include gettext.h instead of <libintl.h>.
8764         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8765         (textdomain): Remove definition.
8766         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8767
8768         * long-options.c: Remove include of <libintl.h> and definition of _.
8769         * same.c: Remove include of <libintl.h> and definition of _.
8770
8771 2002-11-04  Bruno Haible  <bruno@clisp.org>
8772
8773         * stpcpy.h: New file, from GNU gettext-0.11.5.
8774         * strcase.h: New file, from GNU gettext-0.11.5.
8775         * strpbrk.h: New file, from GNU gettext-0.11.5.
8776         * strstr.h: New file, from GNU gettext-0.11.5.
8777         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8778
8779 2002-05-09  Bruno Haible  <bruno@clisp.org>
8780
8781         * config.charset: Update for newest glibc. Add canonical names
8782         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8783
8784 2002-05-09  Bruno Haible  <bruno@clisp.org>
8785
8786         * localcharset.c (get_charset_aliases): Add more Windows specific
8787         aliases.
8788
8789 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8790
8791         * config.charset: A few additions for Solaris.
8792
8793 2001-12-05  Bruno Haible  <bruno@clisp.org>
8794
8795         * localcharset.c (locale_charset): Don't return an empty string.
8796
8797 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8798
8799         * config.charset: msdos in uk_UA uses CP1125.
8800
8801 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8802
8803         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8804         * localcharset.c (locale_charset): Declare as extern "C".
8805
8806 2002-02-15  Bruno Haible  <bruno@clisp.org>
8807
8808         * config.charset [msdosdjgpp]: For Russian, use CP866.
8809
8810 2002-02-11  Bruno Haible  <bruno@clisp.org>
8811
8812         * config.charset: Add support for NetBSD.
8813
8814 2002-09-25    <karl@gnu.org>
8815
8816         * strdup.c: copy from libc/string (via ../config/srclist*).
8817         * getopt*: copy from libc/posix.
8818         * gettext.h: copy from gettext.
8819         * .cppi-disable: add strdup.c, gettext.h.
8820
8821 2002-07-01  Jim Meyering  <meyering@lucent.com>
8822
8823         * c-stack.c: Include sys/time.h.
8824         From Volker Borchert.
8825
8826 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8827
8828         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8829         New macro.  Use it uniformly instead of
8830         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8831         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8832         reported by Vin Shelton.
8833
8834 2002-06-22  Jim Meyering  <meyering@lucent.com>
8835
8836         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8837         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8838
8839 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8840
8841         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8842         Do not assume SA_SIGINFO behavior.
8843         Bug reported by Jim Meyering on NetBSD 1.5.2.
8844
8845 2002-06-22  Jim Meyering  <meyering@lucent.com>
8846
8847         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8848
8849         * exitfail.c, exitfail.h: Likewise.
8850         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8851
8852         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8853         of fnmatch.h.
8854         (EXTRA_DIST): Add fnmatch_loop.c.
8855         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8856
8857         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8858         * fnmatch.c: Update from diffutils-2.8.2.
8859         * fnmatch_.h: New file.  From diffutils-2.8.2.
8860         * fnmatch.h: Remove file.
8861
8862 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8863
8864         * file-type.h: Report an error if neither S_ISREG nor
8865         S_IFREG is defined, instead of using a test specific to glibc
8866         2.2.  This should be safe, since POSIX requires S_ISREG and
8867         Unix Version 7 had S_IFREG.  We don't need to check for
8868         <sys/types.h> since we don't use any symbols that it defines.
8869
8870 2002-06-15  Jim Meyering  <meyering@lucent.com>
8871
8872         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8873         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8874         have been included before this file.
8875
8876 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8877
8878         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8879         so that each temporary file name is unique and valid in the first
8880         8 characters, for operation under DOS.
8881
8882 2002-06-15  Jim Meyering  <meyering@lucent.com>
8883
8884         Work even with DJGPP 2.03, which lacks support for symlinks.
8885         From Richard Dawe.
8886         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8887         is defined.
8888         * lchown.c (S_ISLNK): Likewise.
8889
8890 2002-06-14  Jim Meyering  <meyering@lucent.com>
8891
8892         * file-type.h: Use the version from diffutils-2.8.2.
8893         * file-type.c: Likewise.
8894
8895 2002-05-27  Jim Meyering  <meyering@lucent.com>
8896
8897         Fix a problem seen only on nonconforming systems whereby ls.c's
8898         use of localtime, and then of gettimeofday would cause trouble:
8899         the localtime call used to initialize rpl_gettimeofday's save
8900         mechanism would clobber ls's current local time information so
8901         that in any long listing the first file would always be listed
8902         with date 1970-01-01.  Analysis by Volker Borchert.
8903
8904         * gettimeofday.c (localtime): Undefine.
8905         (rpl_localtime): New function.
8906
8907 2002-05-22  Jim Meyering  <meyering@lucent.com>
8908
8909         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8910         * file-type.h: New file.
8911         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8912
8913 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8914
8915         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8916
8917 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8918
8919         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8920         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8921         of 127, since 64 is the largest conceivable number for ancient
8922         nonstandard hosts.
8923         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8924
8925 2002-04-28  Jim Meyering  <meyering@lucent.com>
8926
8927         * sig2str.c (WTERMSIG): Remove definition (unused).
8928
8929 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8930
8931         * sig2str.h, sig2str.c: New files.
8932         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8933
8934 2002-04-24  Jim Meyering  <meyering@lucent.com>
8935
8936         * gettext.h: New file, from Gettext.
8937         * Makefile.am (INCLUDES): Remove -I../intl.
8938         (libfetish_a_SOURCES): Add gettext.h.
8939
8940 2002-04-16  Jim Meyering  <meyering@lucent.com>
8941
8942         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8943         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8944         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8945
8946 2002-04-12  Jim Meyering  <meyering@lucent.com>
8947
8948         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8949
8950 2002-03-10  Jim Meyering  <meyering@lucent.com>
8951
8952         * makepath.c (make_path): Remove a comma from a diagnostic.
8953         Suggestion from Santiago Vila.
8954
8955 2002-03-08  Jim Meyering  <meyering@lucent.com>
8956
8957         * rename.c: Mention that this wrapper is needed also on
8958         mips-dec-ultrix4.4 systems.
8959
8960 2002-03-02  Jim Meyering  <meyering@lucent.com>
8961
8962         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8963         not HAVE_CLOCK_SETTIME.
8964
8965 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8966
8967         * nanosleep.h: Rename to....
8968         * timespec.h: New name for nanosleep.h.  All uses changed.
8969
8970         * gettime.c: New file.
8971         * settime.c: New file.
8972         * stime.c: Remove.
8973
8974         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8975         timespec.h.  Remove nanosleep.h.
8976
8977 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8978
8979         * acl.c, acl.h: New files.
8980         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8981
8982 2002-02-24  Jim Meyering  <meyering@lucent.com>
8983
8984         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8985         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8986         cause trouble.  Reported by Nelson Beebe.
8987
8988 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8989
8990         * path-concat.c (xpath_concat): Reorder code to pacify
8991         compilers that don't know that xalloc_die never returns.
8992
8993 2002-02-20  Jim Meyering  <meyering@lucent.com>
8994
8995         * getdate.c: Regenerate using bison-1.33.
8996
8997 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8998
8999         * posixver.c, posixver.h: New files.
9000         * Makefile.am (libfetish_a_SOURCES): Add them.
9001
9002 2002-02-02  Paul Eggert  <eggert@twinsun.com>
9003             Bruno Haible  <bruno@clisp.org>
9004
9005         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9006         (fwrite_success_callback): New declaration.
9007         * unicodeio.c (unicode_to_mb): New function, extracted from
9008         print_unicode_char. Call failure callback instead of error.
9009         (fwrite_success_callback): New function.
9010         (exit_failure_callback): New function.
9011         (fallback_failure_callback): New function.
9012         (print_unicode_char): Call unicode_to_mb.
9013
9014 2002-01-26  Jim Meyering  <meyering@lucent.com>
9015
9016         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9017
9018 2002-01-22  Jim Meyering  <meyering@lucent.com>
9019
9020         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9021         Otherwise, some versions of automake would omit the rule that makes
9022         Makefile from Makefile.in.
9023
9024 2001-01-21  Paul Eggert  <eggert@twinsun.com>
9025
9026         * xmemcoll.h, xmemcoll.c: New files.
9027         * Makefile.am (libfetish_a_SOURCES): Add them.
9028         * memcoll.c: Include errno.h, and declare errno if not defined.
9029         (memcoll): Set errno to zero if there is no error.
9030
9031         * quotearg.c (quotearg_buffer_restyled):
9032         Fix bug with quoting buffers containing NUL when backslashing escapes.
9033         This bug was exposed by the other changes in this patch.
9034         (quotearg_n_options): New arg ARGSIZE.
9035         All callers changed.
9036         (quoting_options_from_style): New function.
9037         (quotearg_n_style): Use it.
9038         (quotearg_n_style_mem): New function.
9039
9040         * quotearg.h (quotearg_n_style_mem): New function.
9041
9042 2002-01-16  Jim Meyering  <meyering@lucent.com>
9043
9044         * getdate.y: Add three semicolons, each just before a closing brace.
9045         Bison (as of version 1.31) no longer papers over that mistake.
9046
9047 2002-02-14  Paul Eggert  <eggert@twinsun.com>
9048
9049         * backupfile.c (ISDIGIT): Comment fix.
9050         * getdate.y (ISDIGIT): Likewise.
9051         * posixtm.c (ISDIGIT, year): Likewise.
9052         * strverscmp.c (ISDIGIT): Likewise.
9053         * userspec.c (ISDIGIT): Likewise.
9054
9055 2002-01-05  Jim Meyering  <meyering@lucent.com>
9056
9057         * version-etc.c (version_etc_copyright): Update copyright year.
9058
9059 2001-01-19  Paul Eggert  <eggert@twinsun.com>
9060
9061         * closeout.c (close_stdout_status): If ferror (stdout), do
9062         not silently exit merely because the output buffer happens to
9063         have nothing pending.
9064
9065 2001-12-18  Paul Eggert  <eggert@twinsun.com>
9066
9067         See the big note in ../ChangeLog.
9068         * human.c (suffixes): Prefer K to k for 1024.
9069         (generate_suffix_backwards): New function.
9070         (human_readable_inexact): Use it.
9071         * xstrtol.c (__xstrtol): If there is no number but there
9072         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
9073         Accept 'K' as well as 'k'.
9074
9075 2001-12-15  Jim Meyering  <meyering@lucent.com>
9076
9077         * regex.h (__restrict_arr): Update from libc.
9078
9079         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9080         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
9081         (STREQ): Define.
9082
9083 2001-12-10  Jim Meyering  <meyering@lucent.com>
9084
9085         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9086         Instead, include "xalloc.h".
9087         (initbuffer): Don't cast xmalloc return value to char*.
9088         (readline): Reword comment.
9089         Don't cast xrealloc return value to char*
9090         Return NULL, not 0.
9091
9092 2001-12-09  Jim Meyering  <meyering@lucent.com>
9093
9094         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9095         `signed and unsigned type in conditional expression'.
9096         * posixtm.c (posix_time_parse): Likewise.
9097
9098         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9099
9100         * readtokens.c (readtoken): Declare an index to be of type unsigned
9101         to avoid a pedantic warning.
9102
9103         * getstr.c: Don't include assert.h.
9104         (getstr): Remove warning-evoking assertions.
9105         Return -1 if offset parameter is out of bounds.
9106         Change the type of a local from int to size_t.
9107
9108         * strftime.c (my_strftime_localtime_r): Include this function
9109         definition in the `#if ! HAVE_TM_GMTOFF' block.
9110
9111         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9112         Include xalloc.h instead.
9113
9114 2001-12-02  Jim Meyering  <meyering@lucent.com>
9115
9116         * tempname.c: Don't declare getenv, thus reverting the change of
9117         2001-11-18.  It's no longer necessary, now that stdlib.h is always
9118         included.
9119
9120         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9121         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
9122
9123 2001-11-30  Akim Demaille  <akim@epita.fr>
9124
9125         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9126         before being defined.
9127
9128 2001-11-27  Paul Eggert  <eggert@twinsun.com>
9129
9130         * quotearg.h (quotearg_n, quotearg_n_style):
9131         First arg is int, not unsigned.
9132         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9133         (SIZE_MAX, UINT_MAX): New macros.
9134         (quotearg_n_options): Abort if N is negative.
9135         Avoid overflow check on hosts where size_t is 64 bits and int
9136         is 32 bits, as overflow is impossible there.
9137         Fix off-by-one typo that caused unnecessary reallocation.
9138
9139 2001-11-27  Jim Meyering  <meyering@lucent.com>
9140
9141         * tempname.c: Merge with version from libc.
9142         * regex.c: Likewise.
9143
9144         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9145         for which STDC_HEADERS is 0, it was not included, resulting in a
9146         warning about an integer-to-pointer conversion problem with getenv.
9147         Reported by Volker Borchert.
9148
9149 2001-11-26  Jim Meyering  <meyering@lucent.com>
9150
9151         * gtod.h: Remove file.
9152         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9153         * gettimeofday.c: Don't include gtod.h.
9154         (GTOD_init): Remove function.
9155         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9156         Suggestion from Volker Borchert.
9157
9158 2001-11-23  Jim Meyering  <meyering@lucent.com>
9159
9160         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9161         * hash.c (struct hash_table): Define it here instead.
9162
9163 2001-11-22  Jim Meyering  <meyering@lucent.com>
9164
9165         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9166
9167 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9168
9169         * tempname.c (TMP_MAX): Remove; no longer needed.
9170         (TEMPORARIES): New macro.
9171         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9172         removes an artificial limitation (e.g. HP-UX 10.20, where
9173         TMP_MAX is 17576).
9174
9175 2001-11-18  Jim Meyering  <meyering@lucent.com>
9176
9177         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9178         on SunOS 4.
9179
9180         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9181         files will be created before anything else.
9182
9183 2001-11-17  Jim Meyering  <meyering@lucent.com>
9184
9185         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9186         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9187         rather than group writable.  Patch by Juan F. Codagnone.
9188
9189         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9190         Instead, include "xalloc.h".
9191
9192         * mountlist.c: Include unlocked-io.h after all system headers.
9193         Remove explicit declarations of xmalloc, xrealloc,
9194         and xstrdup.  Instead, include "xalloc.h".
9195
9196         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9197         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9198         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9199
9200         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9201         Reported by Padraig Brady.
9202
9203         * mkstemp.c: #undef mkstemp.
9204         Include config.h.
9205         (rpl_mkstemp): Rename from mkstemp.
9206         Protoize.
9207
9208 2001-11-16  Jim Meyering  <meyering@lucent.com>
9209
9210         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9211         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9212         determine the amount of total physical memory, use pstat_getstatic.
9213         HPUX-11 doesn't define _SC_PHYS_PAGES.
9214         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9215         If sysconf couldn't be used to determine the amount of available
9216         physical memory, use both pstat_getstatic and pstat_getdynamic.
9217         Based on a patch from Bob Proulx.
9218
9219 2001-11-05  Jim Meyering  <meyering@lucent.com>
9220
9221         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9222
9223 2001-11-03  Jim Meyering  <meyering@lucent.com>
9224
9225         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9226         in argmatch_to_argument call.
9227
9228         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9229         argument.
9230
9231         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9232         e.g., a fault due to an attempt to free a NULL pointer.
9233
9234 2001-11-01  Jim Meyering  <meyering@lucent.com>
9235
9236         * dirfd.c, dirfd.h: New files.
9237         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9238
9239         * hash.c (hash_print) [TESTING]: Clean up.
9240
9241 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9242
9243         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9244         to avoid a warning if -Wall.
9245
9246 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9247
9248         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9249
9250 2001-10-21  Jim Meyering  <meyering@lucent.com>
9251
9252         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9253         this code would end up calling gettext even in packages built
9254         with --disable-nls.
9255         * getopt.c (_): Likewise.
9256         * regex.c (_): Likewise.
9257
9258 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9259
9260         * error.c (strerror_r): Do not declare unless !_LIBC.
9261         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9262         Use strerror_r that is only a macro, even if it is not a function.
9263         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9264         (private_strerror): Use prototypes, not old-style function definition.
9265         (print_errno_message): New function.
9266         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9267         char*-flavored one.
9268         (error_tail, error, error_at_line): Use it.
9269
9270 2001-10-11  Jim Meyering  <meyering@lucent.com>
9271
9272         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9273         and quote_n (1, ... to avoid clobbering a buffer.
9274
9275 2001-10-05  Jim Meyering  <meyering@lucent.com>
9276
9277         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9278         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9279         * hash-pjw.h: New file.
9280
9281 2001-09-30  Jim Meyering  <meyering@lucent.com>
9282
9283         * mountlist.c [MOUNTED_GETFSSTAT]:
9284         Include <sys/ucred.h>, for Apple Darwin.
9285         Include sys/mount.h and sys/fs_types.h only if available.
9286         (FS_TYPE): Define.
9287         (read_filesystem_list): Use FS_TYPE.
9288
9289 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9290
9291         * exclude.c (excluded_filename): 0 -> false, since it's
9292         a boolean context.
9293
9294 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9295
9296         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9297         #defines strtoimax.  Also treat the other strto* functions
9298         like strtoimax.
9299
9300         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9301         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9302         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9303
9304 2001-09-26  Jim Meyering  <meyering@lucent.com>
9305
9306         Most macros in unlocked-io.h had the wrong number of arguments.
9307         * gen-uio: New script.
9308         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9309         * unlocked-io.hin: Remove file.
9310         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9311         rather than trying to embed it here.
9312         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9313         Reported by Padraig Brady.
9314
9315 2001-09-25  Volker Borchert  <bt@teknon.de>
9316
9317         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9318
9319 2001-09-23  Jim Meyering  <meyering@lucent.com>
9320
9321         * mountlist.c: Remove useless parentheses in #if directives.
9322         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9323         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9324
9325 2001-09-22  Jim Meyering  <meyering@lucent.com>
9326
9327         * localcharset.c: Update from latest gettext.
9328         * config.charset: Likewise.
9329
9330 2001-09-20  Jim Meyering  <meyering@lucent.com>
9331
9332         * xstrtol.c (strtoimax): Guard declaration with
9333         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9334         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9335         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9336         (strtoumax): Likewise, for completeness (it wasn't necessary).
9337
9338 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9339
9340         * strtoimax.c (HAVE_LONG_LONG):
9341         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9342         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9343         to work around bug in IBM C compiler.
9344
9345 2001-09-16  Jim Meyering  <meyering@lucent.com>
9346
9347         * mkdir.c: New file.
9348
9349 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9350
9351         * xgetcwd.c: Revert some of the previous change; intead,
9352         fix the HAVE_GETCWD_NULL code to behave more like the
9353         !HAVE_GETCWD_NULL code used to.
9354
9355         Include "xalloc.h".
9356         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9357         invoke xalloc_die.
9358
9359 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9360
9361         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9362         Use ssize_t, not int, to store result of readlink.
9363         Check for ssize_t overflow as well as size_t overflow,
9364         as POSIX says the result of readlink is implementation-defined
9365         when ssize_t overflows.
9366         Remove unnecessary cast to char*.
9367         Use free+malloc instead of realloc, as the storage doesn't need
9368         to be preserved and it's clearer and can be more efficient that way.
9369         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9370         * xreadlink.h (xreadlink): Update prototype.
9371
9372 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9373
9374         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9375         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9376         spotted by Jim Meyering.
9377
9378 2001-09-03  Jim Meyering  <meyering@lucent.com>
9379
9380         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9381
9382 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9383
9384         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9385         like the HAVE_GETCWD_NULL code.
9386         Include pathmax.h if not HAVE_GETCWD.
9387         Do not include xalloc.h.
9388         (INITIAL_BUFFER_SIZE): New symbol.
9389         Do not use xmalloc / xrealloc, since the caller is responsible for
9390         handling errors.  Preserve errno around `free' during failure.
9391         Do not overrun buffer when using getwd.
9392
9393 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9394
9395         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9396         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9397
9398 2001-09-02  Jim Meyering  <meyering@lucent.com>
9399
9400         * error.c: Update from GNU libc.
9401
9402 2001-09-01  Jim Meyering  <meyering@lucent.com>
9403
9404         * xreadlink.c: New file.
9405         * xreadlink.h: New file.
9406         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9407
9408         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9409         doesn't conflict with sparc Solaris 7's definition in
9410         /usr/include/sys/int_types.h.
9411
9412         * exclude.c: Use `""', not `<>' to #include non-system header files.
9413         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9414         and strncasecmp as r-values.  Unixware didn't have declarations.
9415
9416 2001-08-31  Jim Meyering  <meyering@lucent.com>
9417
9418         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9419         Use an initial, malloc'd, buffer of length 128 rather than
9420         a statically allocated one of length 1024.
9421
9422 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9423
9424         * xgetcwd.c: Don't include pathmax.h.
9425         Include stdlib.h and unistd.h if available.
9426         Include xalloc.h.
9427         (xmalloc, xstrdup, free): Remove decls.
9428         (xgetcwd): Don't assume sizes fit in unsigned.
9429         Check for overflow when computing sizes.
9430         Simplify reallocation code.
9431
9432 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9433
9434         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9435
9436         * strtoimax.c: Renamed from strtoxmax.c, removing the
9437         old strtoimax.c.
9438
9439         Also, make the following further changes to make this file's
9440         configuration more similar to that of strtol.c:
9441         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9442         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9443         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9444         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9445         changed to signed values.
9446
9447         And make the following changes as well:
9448         Fix copyright notice, as 1999 was missing.
9449         (verify): New macro.
9450         (strtoimax): Check sizes at compile-time, not run-time.
9451         Prefer strtol to strtoll if both work.
9452         (main): Remove; it was not that useful and was a pain to maintain.
9453
9454         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9455
9456 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9457
9458         * savedir.c (savedir): Remove size parameter, as POSIX says that
9459         a directory's st_size can have an arbitrary value, so the old
9460         usage could waste an arbitrary amount of memory.  All uses
9461         changed.
9462         * savedir.h: Update prototype.
9463
9464 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9465
9466         * xstrtol.c (strtoimax): New decl.
9467
9468 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9469
9470         * xstrtol.h: Add copyright notice.
9471         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9472         LONGINT_INVALID_SUFFIX_CHAR.
9473
9474 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9475
9476         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9477         tm to be declared.
9478
9479 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9480
9481         * hash.c: Remove '2001' from copyright notice.
9482
9483 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9484
9485         * full-write.h: New file.
9486         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9487         * full-write.c: Correct credits, as cccp.c no longer
9488         exists and anyway it was so heavily changed from the old cccp
9489         code as to be unrecognizable.  Include full-write.h.
9490         (full_write) Return size_t, with short writes meaning failure.
9491         All callers changed.  This fixes a bug with large buffers
9492         on 64-bit hosts.
9493         * utime.c: Include full-write.h.
9494
9495 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9496
9497         Merge 'exclude' changes from tar 1.13.22.
9498         This fixes one or two unlikely storage allocation overflow bugs,
9499         but doesn't change user-visible behavior otherwise.
9500
9501 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9502
9503         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9504         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9505         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9506         Include if available.
9507         (<xalloc.h>): Include
9508         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9509         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9510         collide with FNM macros.
9511         (struct patopts): New struct.
9512         (struct exclude): Use it, as exclude patterns now come with options.
9513         (new_exclude): Support above changes.
9514         (new_exclude, add_exclude_file):
9515         Initial size must now be a power of two to simplify overflow checking.
9516         (free_exclude, fnmatch_no_wildcards): New function.
9517         (excluded_filename): No longer requires options arg, as the options
9518         are determined by add_exclude.  Now returns bool, not int.
9519         (excluded_filename, add_exclude):
9520         Add support for the fancy new exclusion options.
9521         (add_exclude, add_exclude_file): Now takes int options arg.
9522         Check for arithmetic overflow when computing sizes.
9523         (add_exclude_file): xrealloc might modify errno, so don't
9524         realloc until after errno might be used.
9525
9526         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9527         New macros.
9528         (free_exclude): New decl.
9529         (add_exclude, add_exclude_file): Now takes int options arg.
9530         (excluded_filename): No longer requires options arg, as the options
9531         are determined by add_exclude.  Now returns bool, not int.
9532
9533 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9534
9535         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9536
9537 2001-08-27  Jim Meyering  <meyering@lucent.com>
9538
9539         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9540
9541         * version-etc.c (N_): Remove definition.
9542         Revert most of last change.
9543         Instead, simply don't mark the `Copyright...' string for translation.
9544         Based on advice from Paul Eggert.
9545
9546         * strtoxmax.c: Tweak comment.
9547
9548 2001-08-26  Jim Meyering  <meyering@lucent.com>
9549
9550         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9551         of copyright with `%s' so translators don't get an untranslated
9552         message in 2002.
9553         (COPYRIGHT_YEAR): Define.
9554         (version_etc): Use fprintf rather than fputs.
9555         Suggestion from Ulrich Drepper.
9556
9557         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9558
9559         * strtoll.c: New file, from GNU libc.
9560         * xstrtoimax.c: New file.
9561
9562         * xstrtol.h: Add xstrtoimax.
9563         * strtoumax.c: New file.  Simply include "strtoumax.c".
9564         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9565
9566         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9567         * strtoxmax.c: ... then renamed to this.
9568
9569 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9570
9571         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9572         Port to Solaris 8, where 'sed' requires a space after the 'r'
9573         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9574         Redirect output to $tmp just once.
9575
9576 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9577
9578         * addext.c (<errno.h>): Include.
9579         (errno): Declare if not defined.
9580         (addext): Work correctly when pathconf returns -1 and leaves
9581         errno alone because there is no limit.  Also, work even if
9582         pathconf returns a value greater than SIZE_MAX.
9583
9584 2001-08-12  Jim Meyering  <meyering@lucent.com>
9585
9586         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9587         Simply `return getcwd (NULL, 0);'.
9588         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9589         Use 1300 as initial value for length, not PATH_MAX.
9590
9591         * pathmax.h: Clean up cpp syntax.
9592
9593 2001-08-12  Jim Meyering  <meyering@lucent.com>
9594
9595         * gettimeofday.c: New file.
9596         * gtod.h: New file.
9597         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9598
9599 2001-08-04  Jim Meyering  <meyering@lucent.com>
9600
9601         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9602         to get in sync with glibc.
9603
9604 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9605
9606         The following changes are from gettext 0.10.39 as maintained by
9607         Bruno Haible.
9608
9609         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9610         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9611         with inverted sense.  All uses changed.
9612
9613         * mbswidth.c: Don't include <limits.h>.
9614         Include <stdlib.h> and <string.h> unconditionally.
9615         (iswcntrl, mbsinit, ISCNTRL): New macros.
9616         (mbsnwidth): Use K&R style function declarations.
9617         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9618         can optimize it when MB_CUR_MAX == 1.
9619         The width of control characters is zero, not 1.
9620
9621 2001-07-15  Jim Meyering  <meyering@lucent.com>
9622
9623         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9624         (BUILT_SOURCES): Add unlocked-io.h.
9625         (io_functions): Define.
9626         (unlocked-io.h): New rule.
9627         (DISTCLEANFILES): Add unlocked-io.h.
9628         (all-local): Depend on unlocked-io.h, to ensure it is created.
9629
9630         * unlocked-io.hin: New file
9631
9632         * regex.c: Update from glibc.
9633
9634 2001-07-05  Jim Meyering  <meyering@lucent.com>
9635
9636         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9637         recommendation.
9638         (libfetish_a_SOURCES): Put all .h files here instead.
9639         Remove a thus-exposed (better checks in automake) duplicate and
9640         two unnecessary .h files.
9641
9642 2001-06-11  Jim Meyering  <meyering@lucent.com>
9643
9644         * regex.c: Update from GNU libc.
9645
9646 2001-05-27  Jim Meyering  <meyering@lucent.com>
9647
9648         * readutmp.h (UT_TYPE): Define.
9649
9650 2001-05-24  Jim Meyering  <meyering@lucent.com>
9651
9652         * argmatch.c: Include "quote.h".
9653         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9654         quote function.  Reported by Göran Uddeborg.
9655
9656 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9657
9658         * dirname.c (dir_name): Compute append_dot using path, not newpath
9659         which is not yet declared.
9660
9661 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9662
9663         * Makefile.am (libfetish_a_SOURCES):
9664         Add strftime.c, since we now compile it on all hosts.
9665
9666         * strftime.c (my_strftime):
9667         Define to nstrftime if emacs, but only if my_strftime is not defined.
9668         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9669         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9670         Add one more extra argument: a nanoseconds value.
9671         All uses changed.
9672         (ns): New macro.
9673         (my_strftime function): Add %N format.
9674         (emacs_strftimeu): Renamed from emacs_strftime,
9675         with extra ut argument.
9676
9677 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9678
9679         dirname code cleanup.  base_name now behaves more compatibly
9680         with POSIX basename when given file names that have trailing
9681         slashes, and similarly for dir_name.  Add new primitives
9682         base_len and dir_len.  Put the directory-name-related decls
9683         into dirname.h.
9684
9685         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9686         * backupfile.c (base_name): Likewise.
9687         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9688         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9689         * makepath.c (strip_trailing_slashes): Likewise.
9690         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9691         Likewise.
9692         * rename.c (strip_trailing_slashes): Likewise.
9693         * same.c (base_name): Likewise.
9694         * stripslash.c (ISSLASH): Likewise.
9695
9696         * addext.c: Include <dirname.h> after size_t is defined.
9697         * backupfile.c: Likewise.
9698
9699         * addext.c (addext): Use base_len to trim redundant
9700         trailing slashes instead of doing it ourselves.
9701         But do not trim the last slash if it is not redundant.
9702
9703         * backupfile.c (find_backup_file_name,
9704         max_backup_version): Use base_len instead of rolling it ourselves.
9705         Handle the case of "" and (on DOS) "C:" correctly.
9706
9707         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9708         Include <string.h>, <dirname.h>.
9709         (base_name): Allow file names ending in slashes, other than names
9710         that are all slashes.  In this case, return the basename followed
9711         by the slashes.  This is more general, and can be used in places
9712         where the original base_name purposely had an assertion failure.
9713         (base_len): New function.
9714
9715         * dirname.c: Include <string.h> instead of <stdlib.h>.
9716         Do not include <assert.h>; no longer needed.
9717         Include xalloc.h.
9718         (memrchr): Remove decl.
9719         (dir_name_r): Remove.
9720         (dir_len): Renamed from dirlen.  All callers changed.
9721         Rewrite in terms of base_name, for simplicity and consistency.
9722         (dir_name): Never return NULL.  All callers changed.
9723         Do not include <stdlib.h> in test program; no longer needed.
9724         return 0; is fine for test program.
9725
9726         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9727         New macros.
9728         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9729
9730         * path-concat.c (path_concat): Use base_len to compute
9731         base length, not strlen; this means we cannot rely on memcpy
9732         to null-terminate.
9733
9734         * same.c (STREQ): Remove.
9735         (same_name): Handle the case where the basename ends in trailing '/'.
9736
9737         * stripslash.c (strip_trailing_slashes): Return nonzero if
9738         a slash was stripped.  Do not strip the last slash after a
9739         file system prefix.
9740
9741 2001-04-08  Jim Meyering  <meyering@lucent.com>
9742
9743         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9744         recomputed; that's necessary when the offset spans a DST transition.
9745         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9746
9747 2001-04-02  Jim Meyering  <meyering@lucent.com>
9748
9749         * regex.h, regex.c: Update from GNU libc.
9750
9751 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9752
9753         * version-etc.c (version_etc_copyright): Update to 2001.
9754
9755 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9756
9757         * tempname.c (uint64_t): Define to uintmax_t if
9758         not defined, and if UINT64_MAX is not defined.
9759         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9760         Reported by John David Anglin.
9761
9762 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9763
9764         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9765         alias if codeset is empty.
9766         * config.charset (BeOS): Use wildcard syntax.
9767
9768 2001-03-13  Jim Meyering  <meyering@lucent.com>
9769
9770         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9771         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9772         From Bruno Haible.
9773
9774 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9775
9776         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9777         Don't return NULL.
9778         * unicodeio.c (print_unicode_char): Simplify accordingly.
9779
9780 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9781
9782         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9783         support for DOS/DJGPP.
9784
9785 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9786
9787         * Makefile.am (libfetish_a_SOURCES):
9788         Add dup-safer.c, fopen-safer.c.
9789         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9790
9791         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9792
9793 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9794
9795         The mkstemp replacement is taken from glibc 2.2.2, with some
9796         portability fixes for use outside glibc, as follows:
9797
9798         * tempname.c (struct_stat64): New macro.
9799         (direxists, __gen_tempname): Use it.
9800         This avoids a portability problem with Solaris 8.
9801
9802         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9803         (<stddef.h>, <stdint.h>, <string.h>):
9804         Include only if STDC_HEADERS || _LIBC.
9805         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9806         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9807         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9808         (__set_errno): Define this macro if <errno.h> doesn't.
9809         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9810         Define these macros if <stdio.h> doesn't.
9811         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9812         Define these macros if <sys/stat.h>
9813         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9814         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9815         __xstat64): Define if not _LIBC.
9816         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9817         (__gen_tempname): Invoke gettimeofday only if
9818         HAVE_GETTIMEOFDAY || _LIBC;
9819         otherwise, fall back on plain "time".
9820         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9821
9822         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9823
9824         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9825
9826 2001-02-17  Jim Meyering  <meyering@lucent.com>
9827
9828         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9829         around included file name.
9830
9831         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9832
9833         * strftime.c: Update from GNU libc (the only changes were to comments).
9834
9835 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9836
9837         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9838
9839 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9840
9841         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9842         Remove workaround macros for hosts that have mbrtowc but not
9843         mbstate_t, as we now insist on proper declarations for both
9844         before using mbrtowc.
9845
9846 2001-02-17  Jim Meyering  <meyering@lucent.com>
9847
9848         * regex.c: Update from libc.
9849
9850 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9851
9852         * alloca.c (malloc): Undef before defining, since stdlib.h
9853         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9854         Reported by Mark Hounschell via Paul Eggert.
9855
9856 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9857
9858         * config.charset: Update for FreeBSD 4.2.
9859
9860 2001-01-26  Jim Meyering  <meyering@lucent.com>
9861
9862         * quotearg.c: Include stddef.h.
9863         * quote.c: Include stddef.h.
9864         Reported by Axel Kittenberger.
9865
9866         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9867         line in double quotes so that it evokes a better diagnostic.
9868         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9869         Reported by Axel Kittenberger.
9870
9871 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9872
9873         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9874         to avoid a warning.  Add back 'const' to inptr.
9875
9876 2001-01-16  Jim Meyering  <meyering@lucent.com>
9877
9878         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9879         From Bruno Haible.
9880
9881 2001-01-14  Jim Meyering  <meyering@lucent.com>
9882
9883         * rename.c: New file.  From Volker Borchert.
9884         Include stdlib.h, string.h or strings.h, and xalloc.h.
9885         Use strip_trailing_slashes rather than open-coding it.
9886
9887 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9888
9889         * strftime.c: Sync with glibc time/strftime.c 1.81.
9890
9891 2001-01-03  Jim Meyering  <meyering@lucent.com>
9892
9893         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9894         local `inptr' to avoid warning with some system declarations of iconv.
9895
9896 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9897
9898         * modechange.c: Do not assume that mode_t uses the
9899         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9900         the other-execute bit of FOO even if S_IXOTH != 1.
9901
9902         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9903         WOTH, XOTH, ALLM): New macros.
9904         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9905          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9906         Use them.
9907         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9908         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9909         (mode_compile):
9910         No need to use uintmax_t; unsigned long is long enough.
9911         Don't bother to get suffix since we don't use it.
9912
9913 2000-12-24  Jim Meyering  <meyering@lucent.com>
9914
9915         * hash.c (is_prime): Return explicit boolean values.
9916         (hash_get_first): Return NULL to appease Irix5.6's 89.
9917         Reported by Nelson Beebe.
9918
9919 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9920
9921         * localcharset.c (locale_charset): Add support for Win32.
9922
9923 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9924
9925         * physmem.h, physmem.c: New files.
9926
9927         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9928         (noinst_HEADERS): Add physmem.h.
9929
9930         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9931         't' for compatibility with Solaris 8 sort.
9932
9933 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9934
9935         * config.charset: Add support for BeOS.
9936
9937 2000-12-16  Jim Meyering  <meyering@lucent.com>
9938
9939         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9940         SHELLS_FILE to a file name that's useful on djgpp systems.
9941         Include stdlib.h.
9942         (ADDITIONAL_DEFAULT_SHELLS): Define.
9943         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9944         Based mostly on a patch from Prashant TR.
9945
9946 2000-12-16  Jim Meyering  <meyering@lucent.com>
9947
9948         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9949         N and M) would have treated it like `chown N:N FILE'.
9950
9951         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9952
9953 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9954
9955         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9956         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9957         to the list of canonical encodings. Rename EUC-CN to GB2312.
9958
9959 2000-12-08  Andreas Schwab  <schwab@suse.de>
9960
9961         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9962         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9963
9964 2000-12-07  Jim Meyering  <meyering@lucent.com>
9965
9966         * stripslash.c (ISSLASH): Define.
9967         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9968         From Prashant TR.
9969
9970         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9971         (dir_name_r): Declare this function as static.
9972         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9973         manifest itself on a name containing a mix of slashes and
9974         backslashes.
9975         Make this function work with names starting with a DOS-style
9976         drive letter and colon prefix.
9977         (dir_name): Append `.' if necessary.
9978         Based mostly on patches from Prashant TR and Eli Zaretskii.
9979
9980         * dirname.h (dir_name_r): Remove prototype.
9981
9982 2000-12-05  Jim Meyering  <meyering@lucent.com>
9983
9984         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9985
9986 2000-12-04  Jim Meyering  <meyering@lucent.com>
9987
9988         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9989         Also include memory.h, stdlib.h, unistd.h if appropriate.
9990         Reported by Andreas Jaeger (conflicting declaration of malloc).
9991
9992 2000-12-02  Jim Meyering  <meyering@lucent.com>
9993
9994         * closeout.h: Make idempotent, to avoid some obscure warnings.
9995
9996 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9997
9998         * memrchr.c: Include <config.h> before any system include file.
9999
10000 2000-11-29  Paul Eggert  <eggert@twinsun.com>
10001
10002         * dirname.c (dir_name_r): Fix typo: int -> size_t.
10003
10004 2000-11-26  Jim Meyering  <meyering@lucent.com>
10005
10006         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
10007
10008 2000-11-22  Paul Eggert  <eggert@twinsun.com>
10009
10010         * strftime.c (my_strftime): Do not invoke mbrlen with a
10011         size of (size_t) -1; it's not portable.
10012
10013 2000-11-17  Akim Demaille  <akim@epita.fr>
10014
10015         * obstack.h: Formatting changes.
10016         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10017         prevent type checking.
10018         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10019         cast the value to (void *): assigning a `foo *' to a `void *'
10020         variable is valid.
10021         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10022
10023 2000-11-17  Jim Meyering  <meyering@lucent.com>
10024
10025         * strstr.c: Update from GNU libc.
10026
10027 2000-11-16  Jim Meyering  <meyering@lucent.com>
10028
10029         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10030
10031 2000-11-11  Jim Meyering  <meyering@lucent.com>
10032
10033         * error.c: Add a couple #includes, merging from GNU libc version.
10034
10035 2000-11-10  Jim Meyering  <meyering@lucent.com>
10036
10037         * obstack.h: Update from GNU libc.
10038         * obstack.c: Likewise.
10039
10040 2000-11-06  Paul Eggert  <eggert@twinsun.com>
10041
10042         * getusershell.c (setusershell): Use rewind rather than
10043         fseek/fseeko, to avoid configuration hassles with fseeko.
10044         Don't bother opening SHELLS_FILE if shellstream is NULL;
10045         it's not necessary.
10046
10047 2000-11-05  Jim Meyering  <meyering@lucent.com>
10048
10049         * makepath.h (make_dir): Declare.
10050         * makepath.c (make_dir): Remove `static' attribute.
10051         Tweak a comment.
10052
10053 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
10054
10055         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
10056         last one in a bucket, advance to the next bucket.
10057
10058 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
10059
10060         * fnmatch.c: Do not comment out all the code if we are using
10061         the GNU C library, because in some cases we are replacing buggy
10062         code in the GNU C library itself.
10063
10064 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10065
10066         * error.h, getline.h, modechange.h:
10067         Remove "2000" from Copyright line, as the file hasn't been
10068         changed this year other than in the copyright notice.
10069
10070         * xalloc.h: Add "2000" to Copyright line, as this file
10071         was changed this year.
10072
10073 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10074
10075         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10076         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10077         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10078
10079 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
10080
10081         * regex.h (__restrict_arr): Move definition out of #ifndef block.
10082         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10083         doesn't define __restrict_arr.
10084
10085 2000-10-29  Jim Meyering  <meyering@lucent.com>
10086
10087         * xstat.in: Fix grammar in comment.
10088
10089 2000-10-28  Jim Meyering  <meyering@lucent.com>
10090
10091         * memchr.c: Update from libc.
10092         Adjust for portability:
10093         [HAVE_STDLIB_H]: Include stdlib.h.
10094         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10095         Undef __memchr, too.
10096         [!weak_alias]: Define __memchr to memchr.
10097
10098         * regex.c: Update from libc.
10099         * regex.h: Likewise.
10100         * getopt1.c: Likewise.
10101         * memcmp.c: Likewise.
10102
10103         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10104         Avoid using fseek, when possible -- it's broken by design.
10105         Patch by Ulrich Drepper.
10106
10107 2000-10-26  Jim Meyering  <meyering@lucent.com>
10108
10109         * strftime.c: Update from libc.
10110
10111 2000-10-25  Jim Meyering  <meyering@lucent.com>
10112
10113         * obstack.c: Update from libc.
10114
10115 2000-10-23  Jim Meyering  <meyering@lucent.com>
10116
10117         * hard-locale.c (hard_locale): Revert last change -- it was simply
10118         wrong.  That set_locale call must not have any side effects.
10119         From Paul Eggert.
10120
10121 2000-10-22  Jim Meyering  <meyering@lucent.com>
10122
10123         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10124         [CYCLIC]: Remove now-unused definition.
10125
10126         * save-cwd.c (O_DIRECTORY): Define, if needed.
10127         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10128         Suggestion from Ulrich Drepper.
10129
10130 2000-10-21  Jim Meyering  <meyering@lucent.com>
10131
10132         * dirname.c (dir_name_r): New function, factored out of dir_name.
10133         (dir_name): Use dir_name_r.
10134         * dirname.h (dir_name_r): Declare it.
10135
10136 2000-10-21  Jim Meyering  <meyering@lucent.com>
10137
10138         * dirname.c (memrchr): Declare if necessary.
10139         (dir_name): Remove the restriction that there be no
10140         trailing slashes.  Now, this code skips past them, effectively
10141         ignoring them.
10142         [TEST_DIRNAME] (main): New unit tests.
10143
10144         * memrchr.c: New file from GNU libc.
10145         Undef __memrchr, too.
10146         [!weak_alias]: Define __memrchr to memrchr.
10147         Guard weak_alias use with `#ifdef weak_alias'.
10148
10149 2000-10-17  Jim Meyering  <meyering@lucent.com>
10150
10151         * quote.h (PARAMS): Define and use.
10152         Reported by Akim Demaille.
10153
10154         * getopt.c: Update from libc.
10155
10156 2000-10-16  Jim Meyering  <meyering@lucent.com>
10157
10158         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10159         From Jan Fedak.
10160
10161 2000-09-25  Jim Meyering  <meyering@lucent.com>
10162
10163         * md5.h (rol): Define (from GnuPG).
10164
10165         * sha.c: Give credit (GnuPG) where due.
10166         (M): Use rol rather than open-coding it.
10167         Add a FIXME comment.
10168
10169 2000-09-21  Jim Meyering  <meyering@lucent.com>
10170
10171         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10172         Reported by Michael Stone.
10173
10174 2000-09-20  Jim Meyering  <meyering@lucent.com>
10175
10176         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10177         (noinst_HEADERS): Add sha.h.
10178         Based on code from Scott G. Miller and from GnuPG.
10179
10180 2000-09-15  Jim Meyering  <meyering@lucent.com>
10181
10182         * regex.c: Update from libc.
10183
10184 2000-09-10  Jim Meyering  <meyering@lucent.com>
10185
10186         * getopt.c (_getopt_internal): Update from glibc.
10187
10188 2000-09-09  Jim Meyering  <meyering@lucent.com>
10189
10190         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10191         think it should be used as a general replacement for isascii.
10192         * fnmatch.c: Likewise.
10193         * mbswidth.c: Likewise
10194         * regex.c: Likewise.
10195
10196         Don't use atoi.
10197         * userspec.c: Include sys/param.h and limits.h.
10198         Include xstrtol.h.
10199         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10200         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10201         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10202         UID, GID.  Check range.
10203
10204 2000-09-06  Jim Meyering  <meyering@lucent.com>
10205
10206         * getopt.c (_getopt_internal): Update from glibc.
10207
10208 2000-08-30  Jim Meyering  <meyering@lucent.com>
10209
10210         * strftime.c: Merge in changes from GNU libc.
10211
10212 2000-08-26  Jim Meyering  <meyering@lucent.com>
10213
10214         * closeout.c: Include "__fpending.h".
10215         (close_stdout_status): Return right away if there's nothing to flush.
10216
10217         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10218         * __fpending.c: New file.
10219         * __fpending.h: New file.
10220
10221 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10222
10223         Standardize on "memory exhausted" instead of "Memory exhausted"
10224         or "virtual memory exhausted".
10225         * obstack.c (print_and_abort): Use "memory exhausted", not
10226         "virtual memory exhausted".
10227         * same.c (same_name): Invoke xalloc_die instead of printing
10228         our own message.
10229         * userspec.c (parse_user_spec): Likewise.
10230         * bumpalloc.h: comment fix
10231         * same.c, userspec.c: Include xalloc.h.
10232
10233         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10234         not char *const and pointing to a constant array.
10235         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10236         (xrealloc): Comment fix.
10237
10238         * userspec.c (parse_user_spec):
10239         Don't translate a message until just before returning,
10240         to avoid unnecessary translation.
10241
10242 2000-08-07  Jim Meyering  <meyering@lucent.com>
10243
10244         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10245         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10246         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10247         getgroups.c, gethostname.c, getopt.h, group-member.c,
10248         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10249         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10250         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10251         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10252         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10253         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10254         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10255         yesno.c: Back out Copyright date changes for each file with no change
10256         this year.  This eases coordination with other programs using the same
10257         source code modules.  From Paul Eggert.
10258
10259 2000-08-03  Greg McGary  <greg@mcgary.org>
10260
10261         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10262         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10263         (EXTEND_BUFFER): Use them.
10264
10265 2000-08-01  Jim Meyering  <meyering@lucent.com>
10266
10267         * dirname.c (ISSLASH): Define.
10268         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10269         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10270         both `\' and `/' may be use as path separators.
10271         Based on a patch from Prashant TR.
10272
10273 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10274
10275         * quotearg.c (quotearg_n_options): Don't make the initial
10276         slot vector a constant, since it might get modified.
10277
10278 2000-07-31  Jim Meyering  <meyering@lucent.com>
10279
10280         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10281         * obstack.c (print_and_abort): Likewise.
10282
10283 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10284
10285         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10286         buffer, so that the caller can always quote one small
10287         component of a "memory exhausted" message in slot 0.
10288         From a suggestion by Jim Meyering.
10289
10290 2000-07-30  Jim Meyering  <meyering@lucent.com>
10291
10292         * makepath.c (make_path): Quote the other instance, too.
10293
10294         * quotearg.c (N_STATIC_SLOTVECS): Define.
10295         (STATIC_BUF_SIZE): Define.
10296         (quotearg_n_options): Use only statically allocated storage when
10297         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10298         than STATIC_BUF_SIZE.
10299
10300 2000-07-29  Jim Meyering  <meyering@lucent.com>
10301
10302         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10303         * dirname.c (dir_name): Likewise.
10304
10305         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10306
10307         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10308         (dir_name): Assert that there are no trailing slashes.
10309
10310 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10311
10312         * mbswidth.h (mbswidth): Add a flags argument.
10313         (mbswidth): New declaration.
10314         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10315         * mbswidth.c (mbswidth): Add a flags argument.
10316         (mbsnwidth): New function.
10317
10318 2000-07-24  Jim Meyering  <meyering@lucent.com>
10319
10320         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10321
10322 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10323
10324         * mbswidth.c (_XOPEN_SOURCE):
10325         Don't define; this causes problems on Solaris 7.
10326         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10327
10328 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10329
10330         * quotearg.c:
10331         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10332         so that mbstate_t is always defined.
10333
10334         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10335         be 1 in at least one GCC installation, and this configuration
10336         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10337         performance on hosts that have mbrtowc but have only unibyte
10338         locales, but I assume these hosts are rare.
10339
10340 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10341
10342         * quotearg.c: Streamline by invoking multibyte code only if needed.
10343         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10344         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10345         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10346         invoke multibyte primitives.
10347
10348 2000-07-23  Jim Meyering  <meyering@lucent.com>
10349
10350         * basename.c (base_name): Add an assertion.
10351
10352 2000-07-15  Bruno Haible  <clisp.cons.org>
10353
10354         * quotearg.c: When the system forces us to redefine mbstate_t,
10355         shadow its mbsinit function.
10356
10357 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10358
10359         * mbswidth.h: New file.
10360         * mbswidth.c: New file.
10361         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10362         (noinst_HEADERS): Add mbswidth.h.
10363
10364 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10365
10366         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10367         and IRIX 6.
10368
10369 2000-07-15  Jim Meyering  <meyering@lucent.com>
10370
10371         * makepath.c: Include quote.h.
10372         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10373         corresponding argument in a `quote (...)' call.
10374         Give better diagnostics.
10375
10376         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10377         (noinst_HEADERS): Add quote.h.
10378
10379         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10380         from tar's src/misc.c.
10381         * quote.h: New file.  Prototypes for same.
10382
10383 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10384
10385         From a suggestion by Bruno Haible.
10386         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10387         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10388         to decide whether to define the BeOS workaround macro;
10389         this adjusts to the change to AC_MBSTATE_T.
10390
10391 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10392
10393         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10394
10395         * quotearg.c (quoting_style_args, quoting_style_vals,
10396         quotearg_buffer_restyled): Add support for
10397         clocale_quoting_style.  Undo previous change to
10398         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10399         and "{RIGHT QUOTATION MARK}" msgids.
10400
10401 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10402
10403         The old behavior of quoting `like this' doesn't look good with
10404         newer, ISO-style fonts.  See:
10405         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10406
10407         Instead, quote "like this" by default.  Let the translator
10408         tailor the locale-specific quoting behavior by providing
10409         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10410
10411         * quotearg.c (N_): New macro.
10412         (gettext_default): New function.
10413         (quotearg_buffer_restyled): Use
10414         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10415         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10416
10417 2000-07-09  Jim Meyering  <meyering@lucent.com>
10418
10419         * Most files: Update copyright dates to include 2000.
10420
10421 2000-07-08  Jim Meyering  <meyering@lucent.com>
10422
10423         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10424         if not defined.
10425         (xgethostname): Remove now-unnecessary #ifdef.
10426         Move declaration of `err' into loop where it's used.
10427
10428 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10429
10430         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10431         by allocating a larger buffer. Test the gethostname return value for
10432         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10433         returns an error and ENAMETOOLONG isn't defined.
10434
10435 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10436         and Bruno Haible  <haible@clisp.cons.org>
10437
10438         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10439
10440 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10441
10442         * quotearg.c (struct quoting_options): Simplify quote_these_too
10443         dimension.
10444
10445 2000-07-03  Jim Meyering  <meyering@lucent.com>
10446
10447         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10448         Reported by Bruno Haible.
10449
10450 2000-07-04  Jim Meyering  <meyering@lucent.com>
10451
10452         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10453         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10454         lacks mbrtowc.
10455
10456 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10457         and Bruno Haible  <haible@clisp.cons.org>
10458
10459         * quotearg.c (mbrtowc):
10460         Assign to *pwc, and return 1 only if result is nonzero.
10461         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10462
10463 2000-07-03  Jim Meyering  <meyering@lucent.com>
10464
10465         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10466         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10467         From Bob Proulx.
10468
10469 2000-07-02  Jim Meyering  <meyering@lucent.com>
10470
10471         * quotearg.c (mbstate_t): Don't define here.
10472
10473 2000-07-02  Jim Meyering  <meyering@lucent.com>
10474
10475         * nanosleep.c (SIGCONT): Define if not already defined.
10476
10477 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10478
10479         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10480         per change in ../m4/ls-mntd-fs.m4.
10481         (read_filesystem_list): Ignore symbolic links.
10482
10483 2000-06-29  Jim Meyering  <meyering@lucent.com>
10484
10485         * same.c: Include <string.h> or <strings.h>, as appropriate,
10486         for declaration of strcmp.
10487
10488         * long-options.c: Include <stdlib.h>, for declaration of exit.
10489
10490         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10491         Avoid warning by casting result to `char *' to remove `const'.
10492
10493 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10494
10495         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10496
10497 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10498
10499         savedir now sets errno on failure and invokes xmalloc to get memory.
10500         Fix a couple of other minor bugs while we're at it.
10501
10502         * savedir.c (<unistd.h>): Do not include; there's no need.
10503         (NAMLEN): Remove macro.
10504         (malloc, realloc): Remove decls.
10505         (stpcpy): Likewise.
10506         ("xalloc.h"): Include.
10507         (NAME_SIZE_DEFAULT): New macro.
10508         (savedir): Use xmalloc / xrealloc to allocate memory.
10509         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10510         Skip "" directory entries.
10511         Use strlen to calculate directory entry length, since the old method
10512         is rarely used these days and isn't worth supporting.
10513         Don't use a pointer after freeing it.
10514         Check for integer overflow when calculating allocation size.
10515         Use memcpy to copy entries, instead of stpcpy.
10516         Set errno properly when returning NULL.
10517         Check for readdir error.
10518
10519 2000-06-26  Jim Meyering  <meyering@lucent.com>
10520
10521         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10522
10523 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10524
10525         * getusershell.c (xmalloc, xrealloc): Remove functions.
10526         Include xalloc.h.
10527         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10528
10529 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10530
10531         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10532
10533 2000-06-24  Jim Meyering  <meyering@lucent.com>
10534
10535         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10536
10537 2000-06-21  Jim Meyering  <meyering@lucent.com>
10538
10539         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10540
10541 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10542
10543         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10544         (mbrtowc, mbstate_t): Define substitutes if
10545         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10546         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10547         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10548
10549 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10550
10551         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10552         than 1024, return a memory chunk of least possible size, instead
10553         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10554         Use free/xmalloc instead of xrealloc to avoid copying for very long
10555         paths.
10556
10557 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10558
10559         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10560         address, not strdup.  Include <stdlib.h> and don't declare free().
10561
10562 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10563
10564         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10565         the empty string.
10566
10567 2000-06-21  Jim Meyering  <meyering@lucent.com>
10568
10569         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10570         (noinst_HEADERS): Add getstr.h.
10571
10572         * getline.c (getstr): Move into a separate file.
10573         * getstr.c (getstr): New file, extracted from getline.c, with
10574         the following changes: new parameter, delim2; both delim[12]
10575         parameters have type `int', not `char'.  The latter would lose
10576         with 8-bit delimiters.
10577         * getstr.h: New file.
10578
10579 2000-06-19  Jim Meyering  <meyering@lucent.com>
10580
10581         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10582
10583 2000-06-18  Jim Meyering  <meyering@lucent.com>
10584
10585         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10586         Besides, these days every porting target provides a mkdir function.
10587
10588         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10589         (this snippet comes from src/system.h).
10590
10591 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10592
10593         * human.c (adjust_value): New function.
10594         (human_readable_inexact): Apply rounding style even when
10595         printing approximate values.
10596
10597 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10598
10599         * human.c (human_readable_inexact): Allow an input block
10600         size that is not a multiple of the output block size, and vice versa.
10601         Reported by Piergiorgio Sartor.
10602
10603 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10604
10605         * getdate.y (get_date): Apply relative times after time
10606         zone indicator, not before.  Reported by Todd A. Jacobs.
10607
10608 2000-06-13  Jim Meyering  <meyering@lucent.com>
10609
10610         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10611
10612         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10613
10614 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10615
10616         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10617
10618 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10619
10620         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10621
10622 2000-06-04  Jim Meyering  <meyering@lucent.com>
10623
10624         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10625         SunOS 4.1.4 for which gid_t is an unsigned type.
10626
10627 2000-06-03  Jim Meyering  <meyering@lucent.com>
10628
10629         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10630
10631 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10632
10633         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10634         newer, don't install charset.alias.
10635         * config.charset: Change the Linux/glibc rules so they become empty
10636         on glibc-2.1 or newer.
10637
10638 2000-06-02  Jim Meyering  <meyering@lucent.com>
10639
10640         * mountlist.c: Back out last change.  Instead, do this...
10641         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10642         member using the same `ignore'-testing code.
10643         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10644         fs_type strings.
10645         From Mark D. Roth.
10646
10647 2000-05-29  Jim Meyering  <meyering@lucent.com>
10648
10649         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10650         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10651
10652 2000-05-22  Jim Meyering  <meyering@lucent.com>
10653
10654         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10655
10656 2000-05-18  Jim Meyering  <meyering@lucent.com>
10657
10658         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10659         back, too, since it may have been modified by allocate_entry.
10660         (hash_delete): Rewrite to use neither the assignment operator
10661         nor the comma operator in an if-expression.
10662
10663 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10664
10665         * closeout.c:
10666         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10667         Remove; no longer needed.
10668         "quotearg.h": Add include.
10669         (file_name): Do not bother to explicitly initialize to NULL; it's less
10670         efficient on some hosts.
10671         (close_stdout_status): Remove test as to whether stdout was already
10672         closed; it breaks for the case "echo x | sort >&-".
10673         Quote file name colons.
10674         Do not assume that _("write error") lacks format strings.
10675
10676 2000-05-15  Jim Meyering  <meyering@lucent.com>
10677
10678         * version-etc.c (version_etc_copyright): Update the copyright string
10679         used in all --version output.
10680
10681 2000-05-14  Jim Meyering  <meyering@lucent.com>
10682
10683         * closeout.c (close_stdout_set_file_name): New function.
10684         (close_stdout_status): Use new file-scoped global.
10685         Return right away if fstat says the stdout file descriptor is invalid.
10686         * closeout.h (close_stdout_set_file_name): Declare.
10687
10688 2000-05-10  Jim Meyering  <meyering@lucent.com>
10689
10690         * closeout.c [default_exit_status]: New file-scoped variable.
10691         (close_stdout_set_status): New function.
10692         * closeout.h (close_stdout_set_status): Declare.
10693
10694 2000-05-08  Jim Meyering  <meyering@lucent.com>
10695
10696         * long-options.c: Don't include closeout.h.
10697         (parse_long_options): Don't call close_stdout for --version.
10698
10699 2000-05-06  Jim Meyering  <meyering@lucent.com>
10700
10701         * strnlen.c: Undefine __strnlen and strnlen.
10702         [!weak_alias]: Define __strnlen to strnlen.
10703
10704         * atexit.c: New file, from libiberty.
10705
10706 2000-05-06  Jim Meyering  <meyering@lucent.com>
10707
10708         * closeout.c (close_stdout_status): Also check for errors on the
10709         stderr stream.
10710
10711 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10712
10713         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10714         instead of xmalloc, xrealloc, path_concat.
10715         (locale_charset): Treat empty environment variables as absent.
10716         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10717
10718 2000-05-04  Jim Meyering  <meyering@lucent.com>
10719
10720         * getopt.c: Update from glibc.
10721         * obstack.c: Likewise.
10722         * obstack.h: Likewise.
10723         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10724
10725         * regex.h: Likewise.
10726         * strndup.c: Likewise.
10727         * strnlen.c: New file, from glibc.
10728
10729 2000-05-01  Jim Meyering  <meyering@lucent.com>
10730
10731         * full-write.c (full_write): Remove `FIXME' part of comment.
10732
10733 2000-04-29  Jim Meyering  <meyering@lucent.com>
10734
10735         * path-concat.c: Declare strdup only if it's not defined.
10736         * canon-host.c: Likewise.
10737
10738 2000-04-28  Jim Meyering  <meyering@lucent.com>
10739
10740         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10741         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10742         included first, then limits.h is included by locale.h by libintl.h.
10743         From John David Anglin.
10744
10745 2000-04-25  Jim Meyering  <meyering@lucent.com>
10746
10747         * makepath.c (S_IRWXUGO): Define.
10748         (make_path): Always perform explicit chmod if MODE specifies any
10749         of the `special' permission bits.  Prompted by a bug report against
10750         install from Mate Wierdl and Joost van Baal.
10751
10752 2000-04-18  Jim Meyering  <meyering@lucent.com>
10753
10754         * README: New file.
10755
10756         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10757         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10758
10759 2000-04-17  Jim Meyering  <meyering@lucent.com>
10760
10761         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10762         the definition of it to rpl_strftime also defined-away the system's
10763         declaration.
10764
10765 2000-04-15  Jim Meyering  <meyering@lucent.com>
10766
10767         Use `C' to denote so-called `contiguous' files, the same way
10768         that tar does.
10769         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10770         (ftypelet): Use S_ISCTG.
10771         From Michael Deutschmann.
10772
10773 2000-04-14  Jim Meyering  <meyering@lucent.com>
10774
10775         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10776
10777 2000-04-08  Jim Meyering  <meyering@lucent.com>
10778
10779         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10780         names don't conflict.  Reported by Eli Zaretskii.
10781
10782 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10783
10784         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10785         bug.  Deal with the different error behavior of Irix iconv.
10786
10787 2000-04-07  Jim Meyering  <meyering@lucent.com>
10788
10789         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10790         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10791
10792 2000-04-05  Jim Meyering  <meyering@lucent.com>
10793
10794         Portability tweaks required for ultrix4.3.
10795         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10796         * readutmp.c: Include sys/types.h before sys/stat.h.
10797         * canon-host.c: Declare strdup.
10798         * path-concat.c: Likewise.
10799         From John David Anglin.
10800
10801 2000-04-04  Jim Meyering  <meyering@lucent.com>
10802
10803         Be more DOS 8.3-friendly.
10804         * ref-add.sin: Renamed from ref-add.sed.in.
10805         * ref-del.sin: Renamed from ref-del.sed.in.
10806         * Makefile.am: Reflect renaming.
10807         Reported by Eli Zaretskii.
10808
10809         Use a temporary file name that won't clash with `charset.alias'
10810         in the DOS 8.3 name space.
10811         * Makefile.am (charset_tmp): Define.
10812         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10813         (uninstall-local): Likewise.
10814         Reported by Eli Zaretskii.
10815
10816 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10817
10818         * time/strftime.c (my_strftime): Make sure we call the system
10819         strftime, not ourselves, when invoking the underlying strftime.
10820
10821 2000-03-24  Jim Meyering  <meyering@lucent.com>
10822
10823         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10824         (charset_alias): Define.
10825         (install-exec-local): Factor out common code.
10826         (uninstall-local): Split lines longer than 80.
10827         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10828         (SUFFIXES): Define.
10829         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10830         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10831
10832 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10833
10834         * config.charset: Output a line containing "Packages using this file".
10835         * ref-add.sed.in, ref-del.sed.in: New files.
10836         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10837         ref-del.sed): New rules.
10838
10839 2000-03-17  Jim Meyering  <meyering@lucent.com>
10840
10841         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10842         Otherwise, include <strings.h>
10843
10844 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10845
10846         * unicodeio.c (utf8_wctomb): New function.
10847         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10848         format instead of in UCS-4 with platform dependent endianness.
10849
10850 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10851
10852         * savedir.c (savedir): Work even if directory size is
10853         negative; this can happen with some screwy NFS configurations.
10854
10855 2000-03-06  Jim Meyering  <meyering@lucent.com>
10856
10857         * localcharset.c (get_charset_aliases): Don't try to free file_name
10858         if it's NULL (because we ran out of memory).  From Bruno Haible.
10859
10860 2000-03-05  Jim Meyering  <meyering@lucent.com>
10861
10862         * localcharset.c ("path-concat.h"): Include.
10863         (get_charset_aliases): Use path_concat instead of ANSI string
10864         concatenation.
10865
10866         * unicodeio.h (PARAMS): Define.
10867         Use it to guard prototype.
10868
10869 2000-03-04  Jim Meyering  <meyering@lucent.com>
10870
10871         * Makefile.am (install-exec-local): Create $(libdir) before installing
10872         into it.
10873         (uninstall-local): Uncomment this rule so `make distcheck' works
10874         once again.
10875
10876         * unicodeio.c (<errno.h>): Include it.
10877         (errno): Declare if not defined.
10878
10879         * localcharset.c: Add Bruno's comment justifying use of volatile.
10880
10881         * config.charset: New version, incorporating remarks from a linux
10882         i18n mailing list.  From Bruno Haible.
10883
10884 2000-03-02  Jim Meyering  <meyering@lucent.com>
10885
10886         * Makefile.am (EXTRA_DIST): Add config.charset.
10887
10888 2000-03-01  Jim Meyering  <meyering@lucent.com>
10889
10890         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10891         * unicodeio.c: Likewise.
10892
10893 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10894
10895         * config.charset: New file.
10896         * localcharset.c: New file.
10897         * unicodeio.h, unicodeio.c: New files.
10898         * Makefile.am (DEFS): Add -DLIBDIR=...
10899         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10900         (noinst_HEADERS): Add unicodeio.h.
10901         (all-local, install-exec-local, charset.alias): New targets.
10902
10903 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10904
10905         * quotearg.c (ALERT_CHAR): New macro.
10906         (quotearg_buffer_restyled): Use it.
10907
10908 2000-02-27  Jim Meyering  <meyering@lucent.com>
10909
10910         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10911         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10912
10913         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10914         not `#if STDC_HEADERS'.
10915         Declare malloc if needed.
10916
10917         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10918         now that autoconf always defines the HAVE_DECL_ symbols.
10919         * human.c: Likewise.
10920         * same.c: Likewise.
10921         * strtoumax.c: Likewise.
10922
10923         * backupfile.c: Arrange for cpp to fail if the configure-time
10924         declaration check was not run.
10925         * hash.c: Likewise.
10926         * human.c: Likewise.
10927         * same.c: Likewise.
10928         * strtoumax.c: Likewise.
10929
10930         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10931         then first look up the entire `.'-containing string as a login name.
10932
10933 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10934
10935         * getdate.y: Handle two-digit years with leading zeros correctly.
10936         (textint): New typedef.
10937         (parser_control): Member year changed from int to textint.
10938         All uses changed.
10939         (YYSTYPE): Removed; replaced by %union with int and textint members.
10940         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10941         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10942         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10943         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10944         (date, number, to_year): Use width of number in digits, not its value,
10945         to determine whether it's a 2-digit year, or a 2-digit time.
10946         (yylex): Store number of digits of numeric tokens.
10947         Reported by John Kendall.
10948
10949         (parser_control): Changed from struct parser_control to typedef (for
10950         consistency).  All uses changed.
10951
10952         (tID): Removed; not used.
10953         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10954
10955 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10956
10957         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10958         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10959
10960 2000-02-12  Jim Meyering  <meyering@lucent.com>
10961
10962         * userspec.c (ISDIGIT): Define it.
10963         (isdigit): Remove definition.
10964         (is_number): Use ISDIGIT, not isdigit.
10965         <libintl.h>: Include.
10966         (_ and N_): Define.
10967         (parse_user_spec): Mark translatable strings.
10968
10969 2000-02-10  Jim Meyering  <meyering@lucent.com>
10970
10971         With these changes, nanosleep.[ch] are finally enough like the other
10972         lib/* replacement files to compile on a few more losing systems.
10973
10974         * nanosleep.h: Don't include config.h.
10975         Remove prototype from declaration of nanosleep.
10976         (PARAMS): Remove now-unneeded definition.
10977         * nanosleep.c: #undef nanosleep.
10978         (rpl_nanosleep): Rename from nanosleep.
10979
10980 2000-02-03  Jim Meyering  <meyering@lucent.com>
10981
10982         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10983         rather than with `#if HAVE_UTMPNAME'.
10984
10985 2000-02-01  Jim Meyering  <meyering@lucent.com>
10986
10987         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10988
10989 2000-01-31  Jim Meyering  <meyering@lucent.com>
10990
10991         * nanosleep.h (nanosleep): Guard declaration with
10992         `#if ! HAVE_DECL_NANOSLEEP'.
10993         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10994         the declaration in that vendor's sys/timers.h.
10995         Reported by Christian Krackowizer.
10996
10997         * quotearg.c (ISASCII): Add #undef and move definition to follow
10998         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10999         (ISPRINT): Likewise.
11000         Reported by Tom Tromey.
11001
11002 2000-01-30  Jim Meyering  <meyering@lucent.com>
11003
11004         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11005         uses of ->ut_name.  The latter doesn't work with new Linux header files
11006         where only utmpx.ut_user is declared.
11007
11008         * readutmp.h (UT_USER): Define.
11009
11010 2000-01-23  Jim Meyering  <meyering@lucent.com>
11011
11012         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11013         obstack.c.
11014
11015 2000-01-22  Jim Meyering  <meyering@lucent.com>
11016
11017         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11018         [! HAVE_DECL_STRTOULL]: Declare strtoull.
11019         Required for some AIX systems.  Reported by Christian Krackowizer.
11020         [TESTING] (main): New function.
11021
11022         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
11023         * dirname.c (dir_name): Support for DOS-style file names with drive
11024         letters.
11025
11026         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11027
11028         * strverscmp.c (ISDIGIT): Define.
11029         (strverscmp): Use ISDIGIT, not isdigit.
11030
11031 2000-01-17  Paul Eggert  <eggert@twinsun.com>
11032
11033         * nanosleep.c (nanosleep):
11034         Don't use SA_INTERRUPT to decide whether to call sigaction, as
11035         POSIX.1 doesn't require SA_INTERRUPT and some systems
11036         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
11037         it's been part of POSIX.1 since day 1 (in 1988).
11038
11039 2000-01-17  Jim Meyering  <meyering@lucent.com>
11040
11041         * interlock: Remove unused file.  Reported by François Pinard.
11042
11043 2000-01-16  Paul Eggert  <eggert@twinsun.com>
11044
11045         * quotearg.c (quotearg_buffer_restyled): Do not quote
11046         alert, backslash, formfeed, and vertical tab unnecessarily in
11047         shell quoting style.
11048
11049
11050 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11051 Free Software Foundation, Inc.
11052 Copying and distribution of this file, with or without modification,
11053 are permitted provided the copyright notice and this notice are preserved.