cd9787bae02e98d32998d561ecd8789406077bcd
[gnulib.git] / lib / ChangeLog
1 2006-10-09  Jim Meyering  <jim@meyering.net>
2
3         * lchown.c: Include <sys/stat.h> before "stat-macros.h".
4         Patch from Bruno Haible.
5
6 2006-10-08  Paul Eggert  <eggert@cs.ucla.edu>
7
8         Don't include <config.h> twice; this doesn't work in some cases,
9         e.g., when config.h has "#define intmax_t long long int" and
10         we include <config.h>, <inttypes.h>, <config.h> in that order.
11         Problem reported by Matthew Woehlke in:
12         http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00073.html
13         * fprintftime.c: Don't include config.h or fprintftime.h.
14         * fts-cycle.c: Don't include config.h.
15         * strftime.c: Include fprintftime.h if FPRINTFTIME is defined.
16         * xstrtoimax.c: Remove copyright notice since it's short tnow.
17         Don't include config.h or xstrtol.h.  Define STRTOL_T_MINIMUM
18         and STRTOL_T_MAXIMUM unconditionally, since we now assume gnulib
19         inttypes.h.
20         * xstrtoumax.c: Likewise.
21         * xstrtol.c: Include config.h and xstrtol.h after defining
22         __strtol and the like, so that this module is more like its siblings.
23         (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [! defined STRTOL_T_MINIMUM]:
24         Remove; no longer needed now that we assume gnulib inttypes.h.
25
26 2006-10-07  Bruno Haible  <bruno@clisp.org>
27
28         * gl_sublist.h: New file.
29         * gl_sublist.c: New file.
30
31 2006-10-06  Paul Eggert  <eggert@cs.ucla.edu>
32
33         * mkancesdirs.c (mkancesdirs): Pass to MAKE_DIR both the full file
34         name (relative to the original working directory) and the file
35         name component (relative to the temporary working directory).  All
36         callers changed.
37         * mkancesdirs.h (mkancesdirs): Adjust prototype to match.
38         * mkdir-p.c (make_dir_parents): Likewise.
39         * mkdir-p.h (make_dir_parents): Likewise.
40
41 2006-10-06  Eric Blake  <ebb9@byu.net>
42
43         * clean-temp.h (close_stream_temp): New declaration.
44         * clean-temp.c (includes): Pull in headers according to what
45         other modules are in use.
46         (close_stream_temp) [GNULIB_CLOSE_STREAM]: New function.
47
48 2006-10-06  Bruno Haible  <bruno@clisp.org>
49
50         * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
51         cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
52         int.
53         * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
54         cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
55         Return an error indicator.
56         Suggested by Eric Blake.
57
58 2006-10-06  Bruno Haible  <bruno@clisp.org>
59
60         * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
61         Reported by Eric Blake.
62
63 2006-10-06  Bruno Haible  <bruno@clisp.org>
64         and Paul Eggert  <eggert@cs.ucla.edu>
65
66         * closeout.c (close_stdout): Also close stderr.
67         * closeout.h: Update comment.
68
69 2006-10-06  Bruno Haible  <bruno@clisp.org>
70
71         * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
72         instead of fopen, fwriteerror.
73
74 2006-10-05  Bruno Haible  <bruno@clisp.org>
75
76         * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
77         fwriteerror_temp): New declarations.
78         * clean-temp.c (uintptr_t): Provide fallback definition.
79         (descriptors): New variable.
80         (cleanup): First, close the descriptors.
81         (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
82         fclose_temp, fwriteerror_temp): New functions.
83
84 2006-10-03  Bruno Haible
85
86         * gl_list.h (gl_sortedlist_search_from_to,
87         gl_sortedlist_indexof_from_to): New declarations.
88         (gl_list_implementation): New fields sortedlist_search_from_to,
89         sortedlist_indexof_from_to.
90         (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
91         inline functions.
92         * gl_list.c (gl_sortedlist_search_from_to,
93         gl_sortedlist_indexof_from_to): New functions.
94         * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
95         (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
96         (gl_array_sortedlist_search_from_to): New function.
97         (gl_array_list_implementation): Update.
98         * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
99         (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
100         (gl_carray_sortedlist_search_from_to): New function.
101         (gl_carray_list_implementation): Update.
102         * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
103         gl_linked_sortedlist_indexof_from_to): New functions.
104         * gl_linked_list.c (gl_linked_list_implementation): Update.
105         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
106         * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
107         gl_tree_sortedlist_indexof_from_to): New functions.
108         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
109         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
110         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
111         * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
112
113 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
114
115         Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
116         <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
117         * dirchownmod.c: Include lchown.h.
118         * lchown.c: Don't include files that lchown.h now includes.
119         Don't declare chown, since lchown.h now does that.
120         * lchown.h: Include errno.h, sys/types.h, unistd.h.
121         (lchown): Define to rpl_chown if lchown is declared but
122         does not exist.  Declare using a prototype if lchown is not
123         declared.  Add a copyright notice.
124         * mkstemp.h: Include <unistd.h>.
125         * openat.c: Include lchown.h.
126
127         * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
128         we now test for that separately.
129         * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
130         rather than O_NOFOLLOW, when testing whether it's possible to
131         avoid a race condition reliably.
132         * savewd.c (savewd_chdir): Likewise.
133
134         Remove macros that are no longer needed now that stdint.h is
135         reliable.
136         * fsusage.c (UINTMAX_MAX): Remove.
137         * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
138         * utimecmp.c (SIZE_MAX): Remove.
139
140 2006-10-03  Bruno Haible  <bruno@clisp.org>
141
142         * gl_list.h (gl_list_search_from, gl_list_search_from_to,
143         gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
144         (struct gl_list_implementation): Add fields search_from_to,
145         indexof_from_to. Remove fields search, indexof.
146         (gl_list_search): Use the search_from_to method.
147         (gl_list_search_from, gl_list_search_from_to): New functions.
148         (gl_list_indexof): Use the indexof_from_to method.
149         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
150         * gl_list.c (gl_list_search): Use the search_from_to method.
151         (gl_list_search_from, gl_list_search_from_to): New functions.
152         (gl_list_indexof): Use the indexof_from_to method.
153         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
154         * gl_array_list.c (gl_array_indexof_from_to): Renamed from
155         gl_array_indexof. Add start_index, end_index arguments.
156         (gl_array_search_from_to): Renamed from gl_array_search. Add
157         start_index, end_index arguments.
158         (gl_array_remove, gl_array_list_implementation): Update.
159         * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
160         gl_carray_indexof. Add start_index, end_index arguments.
161         (gl_carray_search_from_to): Renamed from gl_carray_search. Add
162         start_index, end_index arguments.
163         (gl_carray_remove, gl_carray_list_implementation): Update.
164         * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
165         gl_linked_search. Add start_index, end_index arguments.
166         (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
167         start_index, end_index arguments.
168         (gl_linked_remove): Update.
169         * gl_linked_list.c (gl_linked_list_implementation): Update.
170         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
171         * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
172         to 'size_t'.
173         * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
174         gl_tree_search. Add start_index, end_index arguments.
175         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
176         start_index, end_index arguments.
177         (gl_tree_remove): Update.
178         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
179         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
180         * gl_anytreehash_list1.h (compare_position_threshold): New function.
181         * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
182         gl_tree_search. Add start_index, end_index arguments.
183         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
184         start_index, end_index arguments.
185         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
186         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
187
188 2006-10-04  Bruno Haible  <bruno@clisp.org>
189
190         * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
191
192 2006-10-03  Bruno Haible  <bruno@clisp.org>
193
194         * gl_oset.h (gl_setelement_threshold_fn): New type.
195         (gl_oset_search_atleast): New declaration.
196         (struct gl_oset_implementation): Add field 'search_atleast'.
197         (gl_oset_search_atleast): New inline function.
198         * gl_oset.c (gl_oset_search_atleast): New function.
199         * gl_array_oset.c (gl_array_search_atleast): New function.
200         (gl_array_oset_implementation): Update.
201         * gl_anytree_oset.h (gl_tree_search_atleast): New function.
202         * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
203         * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
204
205 2006-10-04  Jim Meyering  <jim@meyering.net>
206
207         * fts.c (fts_open): Tiny comment change.
208
209 2006-10-03  Bruno Haible  <bruno@clisp.org>
210
211         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
212         from gl_avltreehash_list_implementation.
213
214 2006-10-03  Bruno Haible  <bruno@clisp.org>
215
216         * gl_oset.c (gl_oset_add): Fix return type.
217
218 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
219
220         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
221
222 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
223
224         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
225
226 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
227
228         Work around bug in Solaris 10 /proc file system:
229         /proc/self/fd/NNN/.. isn't the parent directory of
230         the directory whose file descriptor is NNN.  This needs to
231         be worked around at run time, not compile time, since a
232         program might be built on Solaris 8, where things work, and
233         run on Solaris 10.
234         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
235         to use the following interface instead:
236         (OPENAT_BUFFER_SIZE): New macro.
237         (openat_proc_name): New function.
238         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
239         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
240         Likewise.
241         * openat-proc.c: New file.
242
243 2006-09-29  Bruno Haible  <bruno@clisp.org>
244
245         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
246         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
247         argument. Set stdout_closed before testing for ferror, not after.
248         (fwriteerror, fwriteerror_no_ebadf): New functions.
249
250 2006-09-28  Paolo Bonzini  <bonzini@gnu.org>
251
252         * poll.c (rpl_poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK.
253
254 2006-09-28  Bruno Haible  <bruno@clisp.org>
255
256         * strndup.h: Simplify the redefinition of strndup.
257         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
258
259 2006-09-28  Bruno Haible  <bruno@clisp.org>
260
261         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
262         * gl_linkedhash_list.c: Likewise.
263         * gl_rbtreehash_list.c: Likewise.
264
265 2006-09-28  Jim Meyering  <jim@meyering.net>
266
267         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
268         Include <unistd.h>.
269
270 2006-09-27  Jim Meyering  <jim@meyering.net>
271
272         This file could end up with a definition for a function
273         named __strndup, rather than rpl_strndup on a system with
274         incomplete weak_alias support.
275         * strndup.c (strndup): Rename from __strndup.
276         Remove #defines that used to map __strndup to strndup.
277         Don't use K&R prototypes.
278         Remove LIBC-related code, since this file is not sync'd with glibc.
279         * strndup.h: Revamp, accordingly.
280
281 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
282
283         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
284         getaddrinfo.
285
286         * __fpending.h: Don't include <stdio_ext.h> unless
287         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
288         it causes <stdio_ext.h> to cause a compile-time error.
289         Problem reported by Nelson H. F. Beebe.
290         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
291         of HAVE_DECL___PENDING.
292
293 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
294
295         * savewd.c: Include <signal.h>, for 'raise'.
296
297 2006-09-26  Eric Blake  <ebb9@byu.net>
298
299         * verror.c: Include <config.h> unconditionally.
300
301 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
302
303         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
304         (gl_linked_iterator_from_to): Initialize struct completely.
305         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
306         (gl_tree_iterator_from_to): Likewise
307         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
308         * gl_array_list.c [lint] (gl_array_iterator)
309         (gl_array_iterator_from_to): Likewise.
310         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
311         * gl_carray_list.c [lint] (gl_carray_iterator)
312         (gl_carray_iterator_from_to): Likewise.
313
314         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
315         * md4.c (md4_process_block): Remove unused variable.
316         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
317         parentheses for clarity.
318
319 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
320
321         Import this patch from libc:
322
323         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
324
325         * regex_internal.c (re_string_reconstruct): Handle
326         offset < pstr->valid_raw_len && pstr->offsets_needed case.
327         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
328         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
329         re_string_context_at.
330
331 2006-09-20  Bruno Haible  <bruno@clisp.org>
332
333         * mkdtemp.c: Import from libc.
334         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
335                 * sysdeps/posix/tempname.c (__gen_tempname): Change
336                 attempts_min into a macro.  Use preprocessor to decide how to
337                 initialize attempts [Coverity CID 67].
338         2001-11-27  Paul Eggert  <eggert@twinsun.com>
339                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
340                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
341
342 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
343
344         * mkstemp.h: New file, since some standard headers
345         #define mkstemp.
346         * mkstemp.c: Revamp to put the !_LIBC code together.
347         Include "mkstemp.h".
348         Make the _LIBC code resemble glibc original more,
349         e.g., use K&R style.
350         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
351         (mkstemp): Remove, since mkstemp.h does this for us.
352         * stdlib--.h: Include mkstemp.h.
353
354         Import this patch from libc:
355
356         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
357
358         * tempname.c (__gen_tempname): Change attempts_min
359         into a macro.  Use preprocessor to decide how to initialize
360         attempts [Coverity CID 67].
361
362 2006-09-18  Bruno Haible  <bruno@clisp.org>
363
364         * javaversion.c: Include configmake.h.
365
366 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
367
368         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
369         that prevented coreutils 6.1 from building.  Problem reported
370         by Petter Reinholdtsen.
371
372 2006-09-18  Jim Meyering  <jim@meyering.net>
373
374         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
375
376 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
377
378         * dirchownmod.c: Don't include fcntl.h; no longer needed.
379         (dirchownmod): New arg FD.  All callers changed.
380         Use FD rather than opening the directory ourself, as opening is
381         now the caller's responsibility.
382         * dirchownmod.h: Likewise.
383         * mkancesdirs.c: Include <sys/types.h>, for portability to older
384         hosts that require <sys/types.h> before <sys/stat.h>.  Include
385         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
386         (test_dir): Remove.
387         (mkancesdirs): Return length of prefix of FILE that has already
388         been made, or -2 if there is a child doing the work.  Redo
389         algorithm so that it is O(N) rather than O(N**2).  Optimize away
390         ".", and treat ".." specially since it might stray back into
391         already-created areas.  Use a subprocess if necessary.  New arg
392         WD; all users changed.  MAKE_DIR function should now return 1
393         if it creates a directory that is not readable.  Return -2 if
394         a child process is spun off.
395         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
396         Adjust signature to match code.
397         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
398         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
399         all users changed.
400         * savewd.c, savewd.h: New files.
401
402 2006-09-15  Jim Meyering  <jim@meyering.net>
403
404         * rename-dest-slash.c (has_trailing_slash): Use
405         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
406         (rpl_rename_dest_slash): Perform the cheaper trailing slash
407         test before testing whether SRC is a directory.
408         Suggestions from Bruno Haible.
409
410         Avoid a warning about an unused variable.
411         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
412         into the #ifdef block where it's used.
413
414         * rename-dest-slash.c: New file.
415
416 2006-09-14  Bruno Haible  <bruno@clisp.org>
417
418         * allocsa.c: Include <config.h> unconditionally.
419         * asnprintf.c: Likewise.
420         * asprintf.c: Likewise.
421         * c-strcasecmp.c: Likewise.
422         * c-strcasestr.c: Likewise.
423         * c-strncasecmp.c: Likewise.
424         * c-strstr.c: Likewise.
425         * classpath.c: Likewise.
426         * clean-temp.c: Likewise.
427         * concatpath.c: Likewise.
428         * copy-file.c: Likewise.
429         * csharpcomp.c: Likewise.
430         * csharpexec.c: Likewise.
431         * execute.c: Likewise.
432         * fatal-signal.c: Likewise.
433         * findprog.c: Likewise.
434         * fwriteerror.c: Likewise.
435         * gl_array_list.c: Likewise.
436         * gl_array_oset.c: Likewise.
437         * gl_avltree_list.c: Likewise.
438         * gl_avltree_oset.c: Likewise.
439         * gl_avltreehash_list.c: Likewise.
440         * gl_carray_list.c: Likewise.
441         * gl_linked_list.c: Likewise.
442         * gl_linkedhash_list.c: Likewise.
443         * gl_list.c: Likewise.
444         * gl_oset.c: Likewise.
445         * gl_rbtree_list.c: Likewise.
446         * gl_rbtree_oset.c: Likewise.
447         * gl_rbtreehash_list.c: Likewise.
448         * imaxabs.c: Likewise.
449         * imaxdiv.c: Likewise.
450         * javacomp.c: Likewise.
451         * javaexec.c: Likewise.
452         * javaversion.c: Likewise.
453         * linebreak.c: Likewise.
454         * localcharset.c: Likewise.
455         * lock.c: Likewise.
456         * mbchar.c: Likewise.
457         * mbswidth.c: Likewise.
458         * mkdtemp.c: Likewise.
459         * pipe.c: Likewise.
460         * printf-args.c: Likewise.
461         * printf-parse.c: Likewise.
462         * progname.c: Likewise.
463         * progreloc.c: Likewise.
464         * readlink.c: Likewise.
465         * sh-quote.c: Likewise.
466         * stpcpy.c: Likewise.
467         * stpncpy.c: Likewise.
468         * strcasecmp.c: Likewise.
469         * strcasestr.c: Likewise.
470         * strcspn.c: Likewise.
471         * striconv.c: Likewise.
472         * strncasecmp.c: Likewise.
473         * strnlen1.c: Likewise.
474         * strstr.c: Likewise.
475         * strtok_r.c: Likewise.
476         * tls.c: Likewise.
477         * tmpdir.c: Likewise.
478         * unicodeio.c: Likewise.
479         * unsetenv.c: Likewise.
480         * vasnprintf.c: Likewise.
481         * vasprintf.c: Likewise.
482         * wait-process.c: Likewise.
483         * xallocsa.c: Likewise.
484         * xsetenv.c: Likewise.
485         * xstriconv.c: Likewise.
486
487 2006-09-13  Eric Blake  <ebb9@byu.net>
488
489         * getopt.c: Fix typo in last commit.
490
491 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
492
493         * _fpending.c: Include <config.h> unconditionally, since we no
494         longer worry about uses that don't define HAVE_CONFIG_H.
495         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
496         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
497         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
498         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
499         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
500         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
501         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
502         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
503         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
504         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
505         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
506         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
507         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
508         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
509         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
510         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
511         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
512         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
513         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
514         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
515         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
516         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
517         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
518         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
519         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
520         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
521         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
522         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
523         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
524         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
525         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
526         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
527         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
528         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
529         Likewise.
530
531 2006-09-12  Jim Meyering  <jim@meyering.net>
532
533         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
534         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
535         Reported by Nelson H. F. Beebe.
536
537 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
538
539         * argp-help.c (argp_doc): Make sure NULL is not passed to
540         dgettext.
541
542 2006-09-10  Bruno Haible  <bruno@clisp.org>
543
544         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
545
546 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
547
548         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
549         program_invocation_name and program_invocation_short_name are
550         initialized.
551         * argp-namefrob.h: Move declarations of program_invocation_name
552         and program_invocation_short_name to argp.h, so they are visible
553         to user programs.
554         * argp.h: Likewise
555
556 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
557
558         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
559         convention.  Text proposed by Bruno Haible.
560         (struct argp_option): Document the use of N_() wrappers.
561
562         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
563         and translate the two parts separately, instead of feeding
564         the whole string to gettext.  This allows to exclude
565         '\v' from the strings visible to the translator by writing doc
566         strings as N_("..") "\v" N_("..").
567
568 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
569
570         * mktime.c (guess_time_tm): Fix bug where mktime
571         returned the maximum time_t value rather than (time_t) -1.
572         Problem originally reported by William Bardwell
573         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
574
575         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
576         Moved to here ...
577         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
578         ... from here.
579
580 2006-09-06  Bruno Haible  <bruno@clisp.org>
581
582         * striconv.h: New file.
583         * striconv.c: New file, merging iconvme.c with GNU gettext's
584         iconvstring.c.
585         * xstriconv.h: New file.
586         * xstriconv.c: New file.
587
588 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
589
590         * argz_.h: Sync from Libtool.
591
592         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
593                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
594
595         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
596
597 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
598
599         * trim.h: New file.
600         * trim.c: New file.
601
602 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
603
604         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
605         Problem reported by Ralf Wildenhues in
606         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
607
608         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
609         HAVE_STRUCT_STATFS_F_FSTYPENAME.
610
611 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
612
613         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
614         or stdbool.h, because they might not exist while configuring.
615
616         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
617         Don't include unistd.h or limits.h; not needed, since chdir-long.h
618         does that for us.
619         (O_DIRECTORY): Remove.
620
621 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
622
623         Work around a bug in both the Linux and SunOS 64-bit kernels:
624         nanosleep mishandles sleeps for longer than 2**31 seconds.
625         Problem reported by Frank v Waveren in
626         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
627         * nanosleep.c (BILLION): New constant.
628         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
629         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
630
631 2006-08-30  Jim Meyering  <jim@meyering.net>
632
633         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
634         the parameter.
635
636 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
637
638         * isapipe.c, isapipe.h: New files.
639
640 2006-08-29  Eric Blake  <ebb9@byu.net>
641
642         * error.c (error_at_line, print_errno_message): Match libc, after
643         resolution of upstream bug 3044.
644
645 2006-08-29  Bruno Haible  <bruno@clisp.org>
646
647         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
648
649 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
650
651         Sync from Libtool:
652
653         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
654
655         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
656         sharing with gnulib.  Report by Eric Blake.
657
658 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
659
660         * fcntl_.h: New file.
661         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
662         the fcntl module.
663         * dirchownmod.c: Likewise.
664         * fts.c: Likewise.
665
666         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
667         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
668         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
669         just before including <inttypes.h>, to avoid circular inclusion.
670
671 2006-08-28  Bruno Haible  <bruno@clisp.org>
672
673         * inttypes_.h (SCNX*): Remove definitions.
674         Reported by Eric Blake.
675
676 2006-08-26  Bruno Haible  <bruno@clisp.org>
677
678         * vasnprintf.c (EOVERFLOW): Remove definition.
679         (VASNPRINTF): Return a string of length > INT_MAX without failing.
680         * vasprintf.c: Include errno.h, limits.h.
681         (EOVERFLOW): New fallback definition.
682         (vasprintf): Test here whether the string length is > INT_MAX.
683         * vsnprintf.c: Include errno.h, limits.h.
684         (EOVERFLOW): New fallback definition.
685         (vsnprintf): Fix bug when generated string was too long for the buffer.
686         Test here whether the string length is > INT_MAX.
687
688 2006-08-26  Bruno Haible  <bruno@clisp.org>
689             Simon Josefsson  <jas@extundo.com>
690
691         BeOS portability.
692         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
693
694 2006-08-28  Bruno Haible  <bruno@clisp.org>
695
696         * c-strstr.h: New file, from GNU gettext.
697         * c-strstr.c: New file, from GNU gettext.
698
699 2006-08-26  Bruno Haible  <bruno@clisp.org>
700
701         * inttypes_.h: New file.
702         * inttypes.h: Remove file.
703         * stdint_.h: Include <inttypes.h> through its absolute filename.
704
705         * imaxabs.c: New file.
706
707         * imaxdiv.c: New file.
708
709 2006-08-22  Bruno Haible  <bruno@clisp.org>
710
711         * readutmp.h: Skip most definitions if neither <utmp.h> nor
712         <utmpx.h> exists.
713
714 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
715
716         BeOS portability.
717         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
718         Problem reported by Bruno Haible.
719
720 2006-08-21  Bruno Haible  <bruno@clisp.org>
721
722         BeOS portability.
723         * mbchar.h: Include <wctype.h> only if it exists.
724
725 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
726
727         * cycle-check.h: Include <stdint.h> unconditionally, since we
728         now assume the stdint module.  Do not include inttypes.h.
729         * fsusage.h: Likewise.
730         * getndelim2.c: Likewise.
731         * human.h: Likewise.
732         * inttostr.h: Likewise.
733         * obstack.c: Likewise.
734         * regex_internal.h: Likewise.
735         * tempname.c: Likewise.
736         * utimecmp.c: Likewise.
737         * xstrtol.h: Likewise.
738
739         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
740
741         * strtoimax.c: Adjust to macro name changes in Autoconf,
742         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
743         * xtime.h: Likewise.
744
745 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
746
747         * fchmodat.c: New file, from coreutils.  This was inadvertently
748         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
749
750 2006-08-18  Bruno Haible  <bruno@clisp.org>
751
752         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
753         (ME_DUMMY): Treat "kernfs" as a dummy.
754         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
755
756 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
757
758         Update from coreutils.
759
760         * __fpending.h: Add copyright notice.
761         * fprintftime.h: Likewise.
762         * savedir.c: Use (C) in copyright notice.
763         * savedir.h: Likewise.
764
765         2006-08-15  Jim Meyering  <jim@meyering.net>
766
767         * at-func.c: New file, with the logic of all emulated at-functions.
768         * openat-priv.h: Include <errno.h> and define ENOSYS,
769         in support of the EXPECTED_ERRNO macro.
770         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
771         Instead, define the appropriate symbols and include "at-func.c".
772         * mkdirat.c (mkdirat): Likewise.
773         * fchmodat.c (fchmodat): Likewise.
774         (ENOSYS): Remove definition.
775         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
776         Don't include "unistd--.h" -- it wasn't ever used.
777
778         2006-01-17  Jim Meyering  <jim@meyering.net>
779
780         Rewrite fts.c not to change the current working directory,
781         by using openat, fstatat, fdopendir, etc..
782
783         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
784         (HAVE_OPENAT_SUPPORT): Define.
785         [_LIBC] (fchdir): Don't undef or define; no longer used.
786         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
787         Now, this `function' always succeeds, and consumes its file descriptor
788         parameter -- so callers must not close such FDs.  Update callers.
789         (diropen_fd, opendirat, cwd_advance_fd): New functions.
790         (diropen): Add parameter, SP.  Adjust all callers.
791         Implement using diropen_fd, rather than open.
792         (fts_open): Initialize new member, fts_cwd_fd.
793         Remove fts_rft-setting code.
794         (fts_close): Close fts_cwd_fd, if necessary.
795         (__opendir2): Define in terms of opendir or opendirat,
796         depending on whether the FST_NOCHDIR flag is set.
797         (fts_build): Since fts_safe_changedir consumes its FD, and since
798         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
799         and close the dup'd file descriptor upon failure.
800         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
801         (fts_safe_changedir): Tweak semantics to reflect that this function
802         now calls cwd_advance_fd and hence consumes its FD argument.
803         * fts_.h [struct FTS] (fts_cwd_fd): New member.
804         [struct FTS] (fts_rft): Remove now-unused member.
805         [struct FTS] (fts_cycle.state): Improve comment.
806
807         * openat.c (openat_needs_fchdir): New function.
808         * openat.h (openat_needs_fchdir): Declare it.
809
810 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
811
812         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
813         Problem and fix reported by Pádraig Brady in
814         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
815
816 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
817
818         * memcoll.c (memcoll): Optimize for the common case where the
819         arguments are bytewise equal.
820
821 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
822
823         Change copyright notice from LGPL 2 to GPL 2, since that's the
824         standard form used in the gnulib repository.
825         * lock.c: LGPL -> GPL.
826         * lock.h: Likewise.
827         * strnlen1.c: Likewise.
828         * strnlen1.h: Likewise.
829         * tls.c: Likewise.
830         * tls.h: Likewise.
831         * tmpdir.c: Likewise.
832
833         * TODO: Remove; this belongs only in coreutils.
834
835 2006-08-14  Eric Blake  <ebb9@byu.net>
836
837         Import the following change from libc:
838
839         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
840
841         Upstream bug 2997.
842         * misc/error.c: Add space between program name and message if file
843         name is missing.
844
845 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
846
847         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
848         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
849
850         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
851         in wchar_t.  Problem reported by Eric Blake.
852
853         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
854         LEN is smaller than SIZE.  Suggested by Bruno Haible.
855         Also, help the compiler to keep LEN in a register.
856
857 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
858
859         * .cppi-disable: Add snprintf.h, socket_.h.
860         * snprintf.c: Include <errno.h> and <limits.h>.
861         (EOVERFLOW): Define if the system does not.
862         Do not include "minmax.h"; it wasn't used.
863         (snprintf): Don't assume size_t promotes to an unsigned type.
864         Fix bug when generated string was too long for the buffer: the
865         buffer's contents are supposed to be the initial prefix of the
866         output.  Don't assume vasnprintf returns EOVERFLOW if the size
867         exceeds INT_MAX; do the check ourselves.
868
869         Import the following changes from libc:
870
871         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
872
873         * posix/regex_internal.c (re_string_skip_chars): If no character has
874         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
875         to the byte which couldn't be converted.
876         (re_string_reconstruct): Don't clear valid_raw_len before calling
877         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
878         tip_context using re_string_context_at.
879
880         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
881
882         * posix/regex.h: g++ still cannot handled [restrict].
883
884         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
885
886         * posix/regex.h: Remove special handling for VMS.
887
888 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
889
890         Sync from coreutils.
891
892         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
893
894         * mountlist.c [ME_REMOTE]: Filter out cifs.
895         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
896
897 2006-08-08  Eric Blake  <ebb9@byu.net>
898
899         * verror.c (verror_at_line): Work around glibc bug 2997, so that
900         verror_at_line output complies with GNU Coding Standards even when
901         file is NULL.
902
903 2006-08-08  Eric Blake  <ebb9@byu.net>
904
905         * verror.h, verror.c: New files.
906
907 2006-08-07  Bruno Haible  <bruno@clisp.org>
908
909         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
910         versions of AIX.
911         Reported by Ralf Wildenhues.
912
913 2006-08-06  Eric Blake  <ebb9@byu.net>
914
915         * error.h: Fold in some upstream changes from glibc.
916         * error.c: Likewise.
917
918 2006-07-29  Bruno Haible  <bruno@clisp.org>
919
920         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
921
922 2006-07-29  Bruno Haible  <bruno@clisp.org>
923
924         * setenv.c: Undo unintended modification done on 2006-02-27.
925
926 2006-07-28  Eric Blake  <ebb9@byu.net>
927
928         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
929         macro expansion.
930
931 2006-07-28  Simon Josefsson  <jas@extundo.com>
932
933         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
934         #include's.
935
936 2006-07-28  Simon Josefsson  <jas@extundo.com>
937
938         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
939         #include's.
940
941 2006-07-28  Bruno Haible <bruno@clisp.org>
942
943         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
944
945 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
946
947         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
948         arpa/inet.h.
949
950 2006-07-28  Bruno Haible  <bruno@clisp.org>
951
952         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
953         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
954         fallbacks.
955         Avoids link error on FreeBSD 4.x.
956         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
957
958         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
959         encoding.
960         * mbswidth.c (iswcntrl): Likewise.
961
962 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
963
964         * modechange.c (mode_compile): Numeric modes now affect setuid and
965         setgid on directories only if they set these bits.
966         * modechange.h: Remove obsolete comment about masks.
967
968 2006-07-27  Bruno Haible  <bruno@clisp.org>
969
970         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
971         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
972         defined.
973
974 2006-07-26  Eric Blake  <ebb9@byu.net>
975
976         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
977         like mingw that lack mkstemp.
978         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
979         avoid compilation warning on mingw.
980
981 2006-07-25  Bruno Haible  <bruno@clisp.org>
982
983         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
984         <stdarg.h> or config.h.
985
986 2006-07-24  Bruno Haible  <bruno@clisp.org>
987
988         * clean-temp.h: New file, from GNU gettext.
989         * clean-temp.c: New file, from GNU gettext.
990
991 2006-07-24  Bruno Haible  <bruno@clisp.org>
992
993         * tmpdir.h: New file, from GNU gettext.
994         * tmpdir.c: New file, from GNU gettext.
995
996 2006-07-23  Bruno Haible  <bruno@clisp.org>
997
998         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
999         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
1000         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
1001         gl_linked_remove_at): Use it.
1002
1003 2006-07-23  Eric Blake  <ebb9@byu.net>
1004
1005         * tmpfile-safer.c: New file.
1006         * stdio-safer.h (fopen_safer): Add prototype.
1007         * stdio--.h (tmpfile): Make safer.
1008
1009 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
1010
1011         * close-stream.c, close-stream.h: New files.
1012
1013 2006-07-22  Bruno Haible  <bruno@clisp.org>
1014
1015         Merge from GNU gettext 0.15.
1016
1017         2005-07-05  Bruno Haible  <bruno@clisp.org>
1018
1019                 * printf-args.c (printf_fetchargs): Work around broken
1020                 definition of wint_t on mingw.
1021
1022         2005-02-12  Bruno Haible  <bruno@clisp.org>
1023
1024                 * xallocsa.h: Add extern "C" for C++.
1025
1026         2006-05-17  Bruno Haible  <bruno@clisp.org>
1027
1028                 Cygwin portability.
1029                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
1030
1031         2006-04-30  Bruno Haible  <bruno@clisp.org>
1032
1033                 * progreloc.c: Include <mach-o/dyld.h> if available.
1034                 (find_executable): Use _NSGetExecutablePath when possible.
1035
1036         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
1037
1038                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
1039                 function.
1040
1041         2005-12-29  Bruno Haible  <bruno@clisp.org>
1042
1043                 * progreloc.c (set_program_name_and_installdir): Fix
1044                 compilation error.
1045
1046         2005-12-04  Bruno Haible  <bruno@clisp.org>
1047
1048                 Cygwin portability.
1049                 * progreloc.c: Include <windows.h> also on Cygwin.
1050                 (find_executable): Add support for Cygwin.
1051                 (set_program_name_and_installdir): Handle also platforms with
1052                 nonempty EXEEXT.
1053
1054         2006-07-11  Bruno Haible  <bruno@clisp.org>
1055
1056                 * javacomp.c: Fix a comment.
1057                 Reported by Jim Meyering.
1058
1059         2006-04-30  Bruno Haible  <bruno@clisp.org>
1060
1061                 * javacomp.h (compile_java_class): Add source_version,
1062                 target_version arguments.
1063                 * javacomp.c: Rewritten to choose only a compiler that
1064                 respects the specified source_version and target_version.
1065
1066         2006-06-27  Bruno Haible  <bruno@clisp.org>
1067
1068                 Assume correct S_ISDIR macro.
1069                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1070
1071         2006-07-22  Bruno Haible  <bruno@clisp.org>
1072
1073                 * javaversion.h: New file, from GNU gettext.
1074                 * javaversion.c: New file, from GNU gettext.
1075                 * javaversion.java: New file, from GNU gettext.
1076                 * javaversion.class: New file, from GNU gettext.
1077
1078         2006-05-17  Bruno Haible  <bruno@clisp.org>
1079
1080                 Cygwin portability.
1081                 * javaexec.c (execute_java_class): Test for jview program
1082                 also on Cygwin.
1083
1084         2006-04-09  Bruno Haible  <bruno@clisp.org>
1085
1086                 * fatal-signal.c: Don't include string.h.
1087                 (at_fatal_signal): Use a copying loop instead of memcpy.
1088
1089         2005-12-04  Bruno Haible  <bruno@clisp.org>
1090
1091                 * csharpexec.c: Add support for 'clix' launcher (untested).
1092                 (execute_csharp_using_sscli): New function.
1093                 (execute_csharp_program): Call it.
1094
1095         2006-06-21  Bruno Haible  <bruno@clisp.org>
1096
1097                 Avoid warnings from recent versions of mcs.
1098                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1099                 -o, -L, -r any more. Use options documented since mcs-1.0
1100                 instead. Similarly for -g.
1101
1102         2005-07-09  Bruno Haible  <bruno@clisp.org>
1103
1104                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1105                 add a .dll suffix.
1106                 Reported by Mark Junker <mjscod@gmx.de>.
1107
1108         2006-06-17  Bruno Haible  <bruno@clisp.org>
1109
1110                 * config.charset: Update for NetBSD 3.0.
1111
1112         2006-05-17  Bruno Haible  <bruno@clisp.org>
1113
1114                 Cygwin portability.
1115                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1116
1117         2006-05-16  Bruno Haible  <bruno@clisp.org>
1118
1119                 * localcharset.c [CYGWIN]: Include <windows.h>.
1120                 (get_charset_aliases): For Cygwin, return the same CPxxx
1121                 aliases list as under WIN32.
1122                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1123                 the environment variables. Fall back to GetACP().
1124
1125         2006-04-05  Bruno Haible  <bruno@clisp.org>
1126
1127                 * config.charset: Update Juan Manuel Guerrero's address.
1128
1129         2005-02-12  Bruno Haible  <bruno@clisp.org>
1130
1131                 * allocsa.h: Add extern "C" for C++.
1132
1133         2005-02-10  Bruno Haible  <bruno@clisp.org>
1134
1135                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1136                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1137
1138         2006-07-22  Bruno Haible  <bruno@clisp.org>
1139
1140                 * gettext.h: Update to GNU gettext-0.15.
1141
1142 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1143         and Simon Josefsson <jas@extundo.com>
1144
1145         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1146
1147         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1148
1149 2006-07-21  Eric Blake  <ebb9@byu.net>
1150
1151         * stdlib-safer.h: New file from coreutils, required by
1152         stdlib--.h.
1153
1154 2006-07-19  Derek R. Price  <derek@ximbiot.com>
1155
1156         * getaddrinfo.h: Don't define unimplemented AI_* flags.
1157         Reindent and repaginate.
1158
1159 2006-07-17  Bruno Haible  <bruno@clisp.org>
1160
1161         * gl_list.h: New file.
1162         * gl_list.c: New file.
1163         * gl_array_list.h: New file.
1164         * gl_array_list.c: New file.
1165         * gl_carray_list.h: New file.
1166         * gl_carray_list.c: New file.
1167         * gl_linked_list.h: New file.
1168         * gl_linked_list.c: New file.
1169         * gl_anylinked_list1.h: New file.
1170         * gl_anylinked_list2.h: New file.
1171         * gl_avltree_list.h: New file.
1172         * gl_avltree_list.c: New file.
1173         * gl_anyavltree_list1.h: New file.
1174         * gl_anyavltree_list2.h: New file.
1175         * gl_rbtree_list.h: New file.
1176         * gl_rbtree_list.c: New file.
1177         * gl_anyrbtree_list1.h: New file.
1178         * gl_anyrbtree_list2.h: New file.
1179         * gl_anytree_list1.h: New file.
1180         * gl_anytree_list2.h: New file.
1181         * gl_linkedhash_list.h: New file.
1182         * gl_linkedhash_list.c: New file.
1183         * gl_anyhash_list1.h: New file.
1184         * gl_anyhash_list2.h: New file.
1185         * gl_avltreehash_list.h: New file.
1186         * gl_avltreehash_list.c: New file.
1187         * gl_rbtreehash_list.h: New file.
1188         * gl_rbtreehash_list.c: New file.
1189         * gl_anytreehash_list1.h: New file.
1190         * gl_anytreehash_list2.h: New file.
1191
1192         * gl_oset.h: New file.
1193         * gl_oset.c: New file.
1194         * gl_array_oset.h: New file.
1195         * gl_array_oset.c: New file.
1196         * gl_avltree_oset.h: New file.
1197         * gl_avltree_oset.c: New file.
1198         * gl_rbtree_oset.h: New file.
1199         * gl_rbtree_oset.c: New file.
1200         * gl_anytree_oset.h: New file.
1201
1202 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1203
1204         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1205         New files.
1206         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1207         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1208         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
1209         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1210         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
1211         callers changed.  Revamp internals significantly, by not
1212         attempting to create directories that are temporarily more
1213         permissive than the final results.  Do not attempt to use
1214         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1215         This removes some race conditions, fixes some bugs, and simplifies
1216         things.  Use new dirchownmod function to do owner and mode changes.
1217         * mkdir-p.h: Likewise.
1218         * modechange.c (octal_to_mode): New function.
1219         (struct mode_change): New member mentioned.
1220         (make_node_op_equals): New arg mentioned.  All callers changed.
1221         (mode_compile): Keep track of which mode bits the user has explicitly
1222         mentioned.
1223         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1224         New arg PMODE_BITS, to keep track of which mode bits the user
1225         mentioned; it treats S_ISUID and S_ISGID speciall.
1226         All callers changed.
1227         * modechange.h: Likewise.
1228
1229 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1230
1231         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1232
1233 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1234
1235         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1236         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1237         macros into the GNU _D_EXACT_NAMLEN.
1238         * savedir.c:  Likewise.
1239         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1240
1241 2006-07-09  Jim Meyering  <jim@meyering.net>
1242
1243         * argp-pv.c: Remove a doubled word in a comment.
1244         * check-version.c (check_version): Likewise.
1245         * javacomp.c (compile_java_class): Likewise.
1246
1247 2006-07-08  Jim Meyering  <jim@meyering.net>
1248
1249         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1250
1251 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1252
1253         * getaddrinfo.c: Changes to compile under MSVC6: changed
1254         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1255         brackets.  Other minor changes to suppress some compiler
1256         warnings.
1257
1258 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1259
1260         * getloadavg.c: Use __VMS, not VMS.
1261         * getopt.c: Likewise.
1262         * getpagesize.h: Likewise.
1263         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1264         probably does not work.
1265
1266 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1267         and Paul Eggert  <eggert@cs.ucla.edu>
1268
1269         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1270         Don't worry about this obsolete case any more.
1271         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1272         directories.
1273         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1274         worry about this obsolete case any more.
1275         * fts.c: Likewise.
1276         * getcwd.c: Likewise.
1277         * glob.h: Likewise.
1278         * savedir.c: Likewise.
1279
1280 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1281
1282         * .cppi-disable: Add wcwidth.
1283         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1284         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1285         (ISGRAPH): Remove.  All uses changed to isgraph.
1286         (FOLD) [!defined _LIBC]: Remove special case.
1287         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1288         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1289         HAVE_ISBLANK.
1290         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1291
1292 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1293
1294         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1295
1296 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1297
1298         * memcasecmp.c: Include <limits.h>.
1299         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1300         * strtod.c (strtod): Don't assume isspace works on negative chars.
1301         Don't assume isdigit succeeds only on '0' through '9'.
1302
1303 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1304
1305         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1306         All uses of is_space replaced by isspace.
1307         * exit.h: Don't talk about STDC_HEADERS.
1308         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1309         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1310         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1311         replaced by isprint etc.
1312         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1313         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1314         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1315         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1316         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1317         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1318
1319 2006-07-05  Eric Blake  <ebb9@byu.net>
1320
1321         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1322         missing from netdb.h.
1323         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1324
1325 2006-06-27  Bruno Haible  <bruno@clisp.org>
1326
1327         Assume ANSI C header files and <ctype.h> functions.
1328         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1329         (mbsnwidth): Use isprint, iscntrl instead.
1330
1331 2006-07-03  Jim Meyering  <jim@meyering.net>
1332
1333         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1334         macro is used before the first cycle_check call.
1335
1336 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1337
1338         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1339         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1340         reported by Mark D. Baushke, one in
1341         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1342
1343         Merge from coreutils.
1344
1345         * .cppi-disable: Add stdint_.h.
1346         * .cvsignore: Add stdint.h.
1347
1348         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1349
1350         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1351         both double and long double versions.
1352         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1353         * xstrtold.c: New file.
1354         * xstrtod.h (xstrtold): New decl.
1355
1356         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1357
1358         * filemode.c (setst): Remove.
1359         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1360         (arguably) clearer, and the generated code is a bit smaller on my
1361         Debian GNU/Linux stable x86 host.
1362
1363         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1364
1365         * filemode.c: Include "filemode.h" first, to test the interface.
1366         Assume that filemode.h includes sys/types.h and sys/stat.h.
1367         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1368         (ftypelet): Reorder to put common cases first, for efficiency.
1369         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1370         to do 'M'.
1371         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1372         of 10, for compatibility with FreeBSD.  All callers changed.
1373         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1374         that can't be deduced solely from st_mode.  First arg is now a const
1375         pointer.
1376         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1377         (strmode): Renamed from mode_string.
1378         (filemodestring): New decl.
1379         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1380         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1381         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1382
1383         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1384
1385         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1386         fsusage.h now does that.  Include fsusage.h first, to test interface.
1387         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1388         at most one method (the old code could have generated decls that
1389         didn't conform to C89, not that this was ever exercised).
1390         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1391
1392         2006-03-19  Jim Meyering  <jim@meyering.net>
1393
1394         Work even in a chroot where d_ino values for entries in "/"
1395         don't match the stat.st_ino values for the same names.
1396         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1397         number, iterate through all entries again, using lstat instead.
1398         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1399         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1400
1401         * getcwd.c (__getcwd): Clarify a comment.
1402         Use memcpy in place of a call to strcpy.
1403
1404         2006-03-12  Jim Meyering  <jim@meyering.net>
1405
1406         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1407         that of the current directory (which we're about to chdir ".." out of),
1408         then save the dev-ino of the parent, instead.
1409
1410         * same-inode.h (SAME_INODE): New file/macro.
1411         * chdir-safer.c (SAME_INODE): Remove definition.
1412         Include "same-inode.h", instead.
1413         * same.c: Likewise.
1414         * cycle-check.h: Include "same-inode.h".
1415         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1416         * cycle-check.c (SAME_INODE): Remove definition.
1417         * root-dev-ino.h: Include "same-inode.h".
1418
1419         2006-03-11  Eric Blake  <ebb9@byu.net>
1420
1421         * same.c (same_name): s/base_name/last_component/
1422         * backupfile.c (check_extension, numbered_backup): Likewise.
1423         * filenamecat.c (file_name_concat): Likewise.
1424
1425         2006-03-11  Eric Blake  <ebb9@byu.net>,
1426                     Paul Eggert  <eggert@cs.ucla.edu>
1427
1428         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1429         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1430         drive prefix.
1431         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1432         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1433         (last_component): New method.
1434         * dirname.c (dir_len): Determine when drive letters need a
1435         subsequent slash.  Preserve // when it is special.
1436         (dir_name): Don't append dot when drive letter is absolute.
1437         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1438         * basename.c (base_name): New semantics - malloc the result.
1439         Preserve // when it is special.  Preserve relative files that look
1440         like drive letters.
1441         (base_len): Preserve // when it is special.
1442         (last_component): New method, similar to old base_name semantics.
1443         * stripslash.c (strip_trailing_slashes): Use last_component, not
1444         base_name.  Strip redundant slashes from ///.
1445
1446 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1447
1448         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1449         both are 64 bits, since this seems to be the tradition, and this
1450         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1451         we ever run into a host that prefers long long to long in this
1452         case, we'll need another configure-time test.  Problem reported by
1453         Jim Meyering.
1454
1455 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1456
1457         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1458         possible collision with system files.
1459         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1460         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1461         WCHAR_MIN and WCHAR_MAX in this case.
1462         (<stddef.h>): Do not include; no longer needed.
1463         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1464         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1465         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1466         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1467         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1468         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1469         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1470         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1471         !defined(__c99))]: Include in this case too, since it's harmless
1472         now.
1473         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1474         dangerous to do so.
1475         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1476         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1477         (_STDINT_MIN, _STDINT_MAX): New macros.
1478         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1479         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1480         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1481         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1482         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1483         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1484         macros, not typedefs; this simplifies things quite a bit.
1485         Use long int for all types narrower than int64_t.
1486         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1487         Define in terms of long long int or int64_t or long int,
1488         not int64_t or int32_t.  This saves some compile-time testing.
1489         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1490         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1491         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1492         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1493         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1494         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1495         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1496         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1497         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1498         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1499         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1500         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1501         undef any previous version and define our own version, for
1502         simplicity and consistency with the new macros for types.
1503         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1504         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1505         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1506         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1507         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1508         @WINT_T_SUFFIX@ to keep things simple here.
1509         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1510         Simplify by assuming typical 8/16/32/64 host, since we're
1511         already doing that elsewhere anyway.
1512         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1513         and assume long long int is 64 bits if available.  This
1514         speeds up 'configure'.
1515
1516 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1517
1518         * getaddrinfo.c: fixed typo
1519
1520 2006-06-29  Eric Blake  <ebb9@byu.net>
1521
1522         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1523         unused static function.
1524
1525 2006-06-29  Eric Blake  <ebb9@byu.net>
1526
1527         * stat_.h: New file.
1528
1529 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1530
1531         * strftime.c: Assume strftime() exists.
1532
1533 2006-06-28  Bruno Haible  <bruno@clisp.org>
1534
1535         * getaddrinfo.h: Fix POSIX URL.
1536         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1537         (use_win32_p): Make static.
1538         (getaddrinfo): Reject service name if it is empty or does not consist
1539         solely of decimal digits, or if its value is > 65535.
1540         (getnameinfo): Remove useless casts.
1541
1542 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1543
1544         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1545         Autoconf 2.60 says this stuff was obsolete.
1546
1547 2006-05-12  Bruno Haible  <bruno@clisp.org>
1548
1549         * mkdtemp.c [MINGW]: Include <io.h>.
1550         (mkdir): Define using _mkdir.
1551
1552 2006-06-28  Bruno Haible  <bruno@clisp.org>
1553
1554         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1555         declaration for wcwidth.
1556         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1557
1558 2006-06-28  Eric Blake  <ebb9@byu.net>
1559
1560         * xvasprintf.h: Fix comments.
1561
1562 2006-06-28  Eric Blake  <ebb9@byu.net>
1563
1564         * mbchar.h (wcwidth): Include wcwidth.h.
1565         * mbswidth.c (wcwidth): Move from here...
1566         * wcwidth.h: ...to this new file.
1567
1568 2006-06-28  Simon Josefsson  <jas@extundo.com>
1569
1570         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1571         functions there.  It will succeed on Windows XP, but on Windows
1572         2000 and (presumably) earlier, it will fail, and use the internal
1573         re-implementation.
1574         (use_win32_p): New function.
1575         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1576         Support AI_NUMERICSERV to disable getservbyname.
1577         (getnameinfo): New function, only supports
1578         NI_NUMERICHOST|NI_NUMERICSERV for now.
1579
1580         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1581         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1582         getnameinfo.
1583
1584 2006-06-27  Bruno Haible  <bruno@clisp.org>
1585
1586         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1587
1588 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1589
1590         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1591         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1592         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1593
1594 2006-06-26  Bruno Haible  <bruno@clisp.org>
1595
1596         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1597         WCHAR_MAX.
1598         Reported by Mark D. Baushke and Larry Jones.
1599
1600 2006-06-26  Bruno Haible  <bruno@clisp.org>
1601
1602         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1603         in pre-C99 mode.
1604         Suggested by Mark D. Baushke and Larry Jones.
1605
1606 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1607
1608         * stdint_.h: Treat BSD/OS like OpenBSD.
1609
1610 2006-06-23  Bruno Haible  <bruno@clisp.org>
1611
1612         * stdint_.h: Treat IRIX like OpenBSD.
1613
1614 2006-06-23  Bruno Haible  <bruno@clisp.org>
1615
1616         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1617         ISO C 99 Technical Corrigendum 1.
1618
1619 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1620
1621         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1622         Some compiler complained about some of them.  Problem reported by
1623         Larry Jones in
1624         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1625
1626 2006-06-21  Simon Josefsson  <jas@extundo.com>
1627
1628         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1629         variable.
1630
1631         * socket_.h: Don't define WINVER.
1632
1633         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1634         slightly modified to work in gnulib.
1635
1636 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1637
1638         * read-file.c (fread_file): Start with buffer allocation of
1639         0 bytes rather than 1 byte; this simplifies the code.
1640         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1641         code to free buffer and save/restore errno.
1642         (internal_read_file): Remove unused local.
1643
1644 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1645
1646         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1647         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1648         Problem reported by Denis Excoffier in
1649         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1650
1651 2006-06-19  Simon Josefsson  <jas@extundo.com>
1652
1653         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1654
1655 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1656
1657         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1658
1659 2006-06-17  Bruno Haible  <bruno@clisp.org>
1660
1661         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1662
1663 2006-06-17  Bruno Haible  <bruno@clisp.org>
1664
1665         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1666         problem on Solaris 2.5.1.
1667
1668 2006-06-16  Eric Blake  <ebb9@byu.net>
1669
1670         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1671         * unicodeio.c [!defined errno]: Likewise.
1672         * strtol.c [!defined errno]: Likewise.
1673         * strtod.c [!defined errno]: Likewise.
1674
1675 2006-06-15  Bruno Haible  <bruno@clisp.org>
1676
1677         * stdint_.h: Rewritten to be fully auto-configured.
1678         Fixes bug on HP-UX/IA64.
1679
1680 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1681
1682         * getdate.y (__attribute__): Don't define if already defined.
1683         Problem reported by Larry Jones.
1684         * utimens.c (__attribute__): Likewise.
1685
1686 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1687
1688         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1689         reported by Andreas Schwab.
1690
1691 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1692             Bruno Haible  <bruno@clisp.org>
1693
1694         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1695
1696 2006-05-26  Martin Lambers  <marlam@marlam.de>
1697
1698         * getpass.c: Updates the test for the native W32 API, and adds
1699         missing includes, thus fixing compilation warnings.
1700
1701 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1702
1703         * tempname.c (small_open, large_open): New macros.
1704         (__open, __open64) [!_LIBC]: Remove.
1705         (__gen_tempname): Use small_open and large_open instead of __open
1706         and __open64.  This fixes a portability bug on HP-UX 11.11i
1707         reported by Simon Wing-Tang in
1708         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1709
1710 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1711
1712         * exclude.c (exclude_fnmatch): New function.
1713         (excluded_file_name): Call exclude_fnmatch.
1714         * exclude.h (excluded_file_name): New prototype
1715
1716 2006-05-24  Bruno Haible  <bruno@clisp.org>
1717
1718         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1719         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1720         Reported by Thorsten Maerz <torte@netztorte.de> via
1721         Aaron Stone <aaron@serendipity.cx>.
1722
1723 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1724
1725         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1726         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1727         (my_usleep): Don't mishandle maximum value.
1728
1729 2006-05-19  Jim Meyering  <jim@meyering.net>
1730
1731         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1732
1733 2006-05-17  Bruno Haible  <bruno@clisp.org>
1734
1735         Cygwin portability.
1736         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1737
1738 2006-05-17  Bruno Haible  <bruno@clisp.org>
1739
1740         * stdint_.h: Fix recognition of Cygwin.
1741
1742 2006-05-11  Jim Meyering  <jim@meyering.net>
1743
1744         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1745
1746 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1747
1748         * crc.c (crc32_update): Remove unnecessary L suffix.
1749         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1750         unwanted sign propagation, e.g., on hosts with 64-bit int.
1751         There still are some problems with reeelly weird theoretical hosts
1752         (e.g., 33-bit int) but it's not worth worrying about now.
1753         * sha1.c (rol): Likewise.
1754         (K1, K2, K3, K4): Remove unnecessary L suffix.
1755
1756 2006-05-10  Bruno Haible  <bruno@clisp.org>
1757
1758         * des.c: Cast to avoid warnings.
1759
1760 2006-05-10  Simon Josefsson  <jas@extundo.com>
1761
1762         * md4.c: Typo fix, update copyright years.
1763         (K1, K2): Don't use L because it turn computations into 64-bit on
1764         64-bit platforms.
1765
1766 2006-05-09  Bruno Haible  <bruno@clisp.org>
1767
1768         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1769         (EOVERFLOW): Define fallback value.
1770         (xstrcat): New function.
1771         (xvasprintf): Recognize the special case of a string concatenation.
1772
1773 2006-05-01  Bruno Haible  <bruno@clisp.org>
1774
1775         * stdint_.h: Shorter URL.
1776         * inttypes.h: Likewise.
1777
1778 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1779
1780         * verify.h: Document the internals better.  Most of this change
1781         was written by Bruno Haible.
1782
1783 2006-04-29  Bruno Haible  <bruno@clisp.org>
1784
1785         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1786         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1787
1788 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1789
1790         * getdate.y (get_date): When adding relative date, start with the
1791         initial time, not with the result of the first mktime call.
1792
1793 2006-04-23  Bruno Haible  <bruno@clisp.org>
1794
1795         * copy-file.c: Include <unistd.h> unconditionally.
1796         * execute.c: Likewise.
1797         * fatal-signal.c: Likewise.
1798         * findprog.c: Likewise.
1799         * mkdtemp.c: Likewise.
1800         * pipe.h: Likewise.
1801         * pipe.c: Likewise.
1802         * wait-process.h: Likewise.
1803
1804 2006-04-23  Bruno Haible  <bruno@clisp.org>
1805
1806         * fwriteerror.c (fwriteerror): Call fclose also when an error
1807         condition was already detected.
1808         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1809
1810 2006-04-19  Derek Price  <derek@ximbiot.com>
1811             Eric Blake  <ebb9@byu.net>
1812
1813         * inttypes.h: Correct grammar in comment.
1814
1815 2006-04-18  Derek Price  <derek@ximbiot.com>
1816             Paul Eggert  <eggert@cs.ucla.edu>
1817
1818         * inttypes.h: New file.
1819         * strtoimax.c: Assume <inttypes.h>.
1820
1821 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1822
1823         * utimens.c (futimens): glibc futimesat messes up if /proc
1824         isn't mounted.  Problem reported by Kir Kolyshkin.
1825
1826 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1827
1828         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1829         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1830         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1831
1832 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1833
1834         Merge regex changes from libc, removing some of our
1835         POSIX-conformance changes that were rejected and redoing them in a
1836         less-intrusive way.
1837
1838         * regcomp.c (re_compile_internal, init_dfa):
1839         Length arg is now size_t, not Idx.  All uses changed.
1840         (peek_token): Forward decl now says internal_function.
1841         (__re_error_msgid, __re_error_msgid_idx):
1842         Now static rather than extern with attribute_hidden.
1843         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1844         For some reason libc prefers K&R style defns for external functions.
1845         (regerror) [!defined _LIBC]: Likewise.
1846         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1847         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1848         (build_range_exp, build_collating_symbol):
1849         Use K&R-style defn.
1850         (re_compile_fastmap): Use '\0' to memset, not 0.
1851         (utf8_sb_map): Make the calculations more obvious.
1852         (init_dfa, parse_bracket_exp, build_charclass_op):
1853         Call calloc and cast result, as glibc does.
1854         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1855         (build_range_exp, build_collating_symbol):
1856         Now internal functions.
1857
1858         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1859
1860         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1861         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1862         Don't depend on VMS; depend on __VMS instead, for POSIX
1863         namespace cleanness.
1864         (regoff_t): Define to ssize_t, not long int.
1865
1866         Remove the REG_ macros named below.  Instead, make the old names
1867         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1868         __USE_GNU_REGEX.
1869         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1870         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1871         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1872         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1873         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1874         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1875         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1876         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1877         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1878         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1879         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1880         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1881         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1882         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1883         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1884         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1885         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1886         (REG_NREGS):
1887         Remove.  All uses replaced by the old RE_* names.
1888         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1889         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1890         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1891         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1892         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1893         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1894         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1895         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1896         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1897         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1898         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1899         Don't bother having these macros be independent of each others'
1900         values, since they no longer exist in the POSIX name space.
1901
1902         Rename the following member names back to their old names,
1903         unless !__USE_GNU_REGEX.  All uses changed back.
1904         (buffer): Renamed from re_buffer.
1905         (allocated): Renamed from re_allocated.
1906         (used): Renamed from re_used.
1907         (syntax): Renamed from re_syntax.
1908         (fastmap): Renamed from re_fastmap.
1909         (translate): Renamed from re_translate.
1910         (can_be_null): Renamed from re_can_be_null.
1911         (regs_allocated): Renamed from re_regs_allocated.
1912         (fastmap_accurate): Renamed from re_fastmap_accurate.
1913         (no_sub): Renamed from re_no_sub.
1914         (not_bol): Renamed from re_not_bol.
1915         (not_eol): Renamed from re_not_eol.
1916         (newline_anchor): Renamed from re_newline_anchor.
1917         (num_regs): Renamed from rm_num_regs.
1918         (start): Renamed from rm_start.
1919         (end): Renamed from rm_end.
1920
1921         (free_state): Move up a bit.
1922
1923         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1924         #define to be empty.
1925         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1926         when that is what is intended.
1927         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1928         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1929         (MAX): New macro.
1930         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1931         All uses changed back to re_malloc, etc.  It's now the caller's
1932         responsibility to check for overflow; all callers changed.
1933         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1934         (re_x2nrealloc): Remove.
1935         (free_state): Remove decl.
1936
1937         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1938         (re_set_registers, re_exec):
1939         Use K&R-style defn.
1940
1941         2006-01-31  Roland McGrath  <roland@redhat.com>
1942
1943         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1944         Reported by Mike Frysinger <vapier@gentoo.org>.
1945
1946         2006-01-15  Andreas Jaeger  <aj@suse.de>
1947
1948         [BZ #1950]
1949         * regex_internal.c (re_string_reconstruct): Adjust for
1950         build_wcs_upper_buffer change.
1951         (build_wcs_upper_buffer): Change return type.
1952
1953         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1954
1955         * regex_internal.h: Include <stdint.h> if available.
1956
1957         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1958
1959         * regex_internal.h (SIZE_MAX): Provide a default definition.
1960
1961         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1962
1963         * regcomp.c: Adjust for changed secondary hash function.
1964
1965         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1966
1967         * regex.h: Pretty printing.
1968         Clean up namespace a bit.
1969
1970         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1971
1972         * regexec.c (update_cur_sifted_state, check_arrival,
1973         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1974
1975         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1976                     Ulrich Drepper  <drepper@redhat.com>
1977
1978         [BZ #1302]
1979         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1980         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1981
1982         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1983
1984         [BZ #281]
1985         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1986         * regcomp.c: Remove unnecessary uses of
1987         unsigned RE_TRANSLATE_TYPE.
1988         * regex_internal.h: Likewise.
1989         * regex_internal.c: Likewise.
1990         * regexec.c: Likewise.
1991         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1992
1993         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1994
1995         * regexec.c (find_recover_state): Remove unnecessary
1996         initialization.
1997         (transit_state_bkref): Make DFA a const pointer.
1998         (get_subexp): Likewise.
1999         (check_arrival): Likewise.
2000         (update_cur_sifted_state): Likewise.
2001         (re_search_internal): Likewise.
2002         (prune_impossible_nodes): Likewise.
2003         (acquire_init_state_context): Likewise.
2004         (proceed_next_node): Likewise.
2005         (set_regs): Likewise.
2006         (free_fail_stack_return): Likewise.
2007         (check_arrival_expand_ecl): Mark DFA parameter as const.
2008         (check_arrival_expand_ecl_sub): Likewise.
2009         (check_subexp_limits): Likewise.
2010         (sub_epsilon_src_nodes):  Likewise.
2011         (add_epsilon_src_nodes):  Likewise.
2012         (merge_state_array): Likewise.
2013         (update_regs): Likewise.
2014         (build_trtable): Likewise.
2015         (sift_states_backward): Mark MCTX parameter as const.
2016         (build_sifted_states): Likewise.
2017         (update_cur_sifted_state): Likewise.
2018         (sift_states_mkref): Likewise.
2019         (check_arrival_expand_ecl): Mark eclosure as const.
2020         (check_dst_limits_calc_pos_1): Likewise.
2021         * regex_internal.h (re_match_context_t): Make dfa a const
2022         pointer.
2023
2024         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
2025
2026         * regexec.c (merge_state_with_log): Define dfa as const pointer.
2027         (transit_state_sb): Likewise.
2028         (transit_state_mb): Likewise.
2029         (sift_states_iter_mb): Likewise.
2030         (check_arrival_add_next_nodes): Likewise.
2031         (check_node_accept_bytes): Change first parameter to pointer-to-const.
2032         [_LIBC] (re_search_2_stub): Use mempcpy.
2033
2034         * regex_internal.c (re_string_reconstruct): Avoid calling
2035         mbrtowc for very simple UTF-8 case.
2036
2037         * regex_internal.c (re_acquire_state): Make DFA pointer arg
2038         a pointer-to-const.
2039         (re_acquire_state_context): Likewise.
2040         * regex_internal.h: Adjust prototypes.
2041
2042         * regex.c: Prevent using C++ compilers.
2043
2044         * regex_internal.c (re_acquire_state): Minor code rearrangement.
2045         (re_acquire_state_context): Likewise.
2046
2047 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
2048             Bruno Haible  <bruno@clisp.org>
2049
2050         * stdint_.h: On OpenBSD, don't redefine types already included in
2051         <sys/types.h> and <inttypes.h>.
2052
2053 2006-03-24  Eric Blake  <ebb9@byu.net>
2054
2055         * time_r.c (copy_string_result): Remove, as it is no longer used.
2056
2057 2006-03-24  Simon Josefsson  <jas@extundo.com>
2058
2059         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2060         including some doc fixes.
2061         (base64_encode_alloc): Fix +1 bug on allocation failures.
2062
2063 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2064
2065         * base64.c (base64_encode): Do not read past end of array with
2066         unsanitized input on systems with CHAR_BIT > 8.
2067
2068 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
2069
2070         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2071         Typedef to long int, not to off_, as POSIX will likely change
2072         in that direction.
2073
2074 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2075
2076         * argp-help.c (validate_uparams): Fix typo
2077         * argp-parse.c (argp_default_options): Consistently begin help
2078         messages with a lowercase letter.
2079
2080 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
2081
2082         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
2083         overrun buffers and shouldn't be used (much as gets shouldn't be
2084         used).
2085         * time_r.c (asctime_r, ctime_r): Likewise.
2086
2087 2006-03-08  Simon Josefsson  <jas@extundo.com>
2088
2089         * gc-gnulib.c (randomize): Don't open files called 'no', they
2090         signal that configure disabled the device.
2091
2092 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
2093
2094         * c-stack.c: Include unistd.h unconditionally, since we now assume
2095         the unistd module.
2096         * getlogin_r.c: Likewise.
2097         * getlogin_r.h: Likewise.
2098         * glob.c: Likewise.
2099         * pagealign_alloc.c: Likewise.
2100         * unistd_.h: Remove; no longer needed.
2101
2102 2006-03-07  Simon Josefsson  <jas@extundo.com>
2103
2104         * unistd_.h: New file.
2105
2106 2006-03-07  Simon Josefsson  <jas@extundo.com>
2107
2108         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2109
2110 2006-03-01  Simon Josefsson  <jas@extundo.com>
2111
2112         * readline.c: Fix typo, tiny patch from Stepan Kasal
2113         <kasal@ucw.cz>.
2114
2115 2006-02-28  Simon Josefsson  <jas@extundo.com>
2116
2117         * getopt.c: Protect #include of unistd.h, for MSVS.
2118
2119 2006-02-27  Simon Josefsson  <jas@extundo.com>
2120
2121         * base64.h: Indent #define's.  From Jim Meyering
2122         <jim@meyering.net>.
2123
2124 2006-02-27  Jim Meyering  <jim@meyering.net>
2125
2126         Revert the change of 2006-02-24, so these files can continue
2127         to be sync'd from gettext.
2128         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2129         of `config.h'.
2130
2131 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
2132
2133         * glob.c: Say "invalid" rather than "illegal" in comments.
2134
2135 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2136
2137         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2138
2139 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2140
2141         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2142         AT_FDCWD exceeds INT_MAX.
2143         * openat.h (AT_FDCWD): Likewise.
2144
2145 2006-02-14  Jim Meyering  <jim@meyering.net>
2146
2147         Sync from coreutils.
2148
2149         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2150         failure on deficient systems, and simplify gnulib lgpl dependencies.
2151         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2152         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2153
2154         * xalloc-die.c: Remove unused definition of N_.
2155
2156 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2157
2158         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2159
2160 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
2161
2162         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2163         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2164
2165 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2166
2167         * argp-namefrob.h: Restore changes accidentally lost during the
2168         "autoupdate" on 2005-12-12.
2169
2170 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
2171
2172         * fnmatch.c (L_): Renamed from L, to work around a bug in
2173         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2174         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2175         All uses changed.
2176
2177 2006-01-26  Simon Josefsson  <jas@extundo.com>
2178
2179         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2180         prototype is visible on mingw32.
2181
2182         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2183         for mingw32.
2184
2185         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2186         mingw32).
2187
2188 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2189
2190         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
2191         attempt to open for write; this always fails, at least on POSIX
2192         hosts.  This reinstates the 2006-01-09 change, which was
2193         inadvertently removed.
2194
2195 2006-01-26  Bruno Haible  <bruno@clisp.org>
2196             Paul Eggert  <eggert@cs.ucla.edu>
2197
2198         * stdbool_.h (_Bool)
2199         [(! (defined __cplusplus || defined __BEOS__)
2200           && !defined __GNUC__
2201           && !(defined __HP_cc || defined __xlc__
2202                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2203                || defined __sgi))]:
2204         #define to signed char in these cases too; this simplifies
2205         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2206         etc., separately) and makes it more conservative.
2207
2208 2006-01-21  Jim Meyering  <jim@meyering.net>
2209
2210         Sync from the stable (b5) branch of coreutils:
2211
2212         * fts.c (fts_children): Don't let close() clobber errno from
2213         failed fchdir().
2214
2215         * fts.c (fts_stat): When following a symlink-to-directory,
2216         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2217         a dangling symlink.  That can also happen at least for ELOOP.
2218         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2219         FYI, this bug predates the inclusion of fts.c in coreutils.
2220
2221         * fts.c (fts_open): Put new maxarglen declaration and uses
2222         in their own block, so pre-c99 compilers don't object.
2223
2224         Avoid the double-free (first in fts_read, second in fts_close) that
2225         would occur when an `active' directory is made inaccessible (e.g.,
2226         via chmod a-x) during a traversal.
2227         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2228         before returning.  Reproduce this failure by
2229         mkdir -p a/b; cd a; chmod a-x . b
2230         Reported by Stavros Passas.
2231
2232 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2233
2234         * argp-namefrob.h: Bugfix. Remove stray #
2235
2236 2006-01-25  Bruno Haible  <bruno@clisp.org>
2237
2238         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2239         warnings.
2240         Reported by Paul Eggert.
2241
2242 2006-01-25  Jim Meyering  <jim@meyering.net>
2243
2244         * fileblocks.c: Remove more useless parentheses.
2245         * readutmp.h: Likewise.
2246
2247 2006-01-24  Bruno Haible  <bruno@clisp.org>
2248
2249         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2250         has it.
2251         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2252         2005-11-26.
2253
2254         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2255         to avoid problems with the built-in _Bool type.
2256         Reported by Paul Eggert on 2005-11-26.
2257
2258 2006-01-24  Jim Meyering  <jim@meyering.net>
2259
2260         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2261
2262 2006-01-24  Simon Josefsson  <jas@extundo.com>
2263
2264         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2265         Bruno.
2266
2267 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2268
2269         Work around porting bugs reported by Dieter in
2270         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2271         * getopt.c (_NOPROTO): Remove; no longer needed.
2272         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2273         Include "getopt.h" first, to check interface.
2274         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2275         !HAVE_DECL_GETENV.
2276         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2277         (__strndup): Revert to K&R-style function dfns, the glibc style.
2278         * strnlen.c: Don't claim it's taken from glibc; it's not.
2279         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2280         Include strnlen.h first, to get prototype properly.
2281         (strnlen): Renamed from __strnlen.
2282         Remove weak alias.
2283
2284 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2285
2286         These changes imported from libc.
2287         * getopt.c: Use __fxprintf instead of inline stream orientation
2288         test and two separate function calls.
2289         * strndup.c (__strndup): Add libc_hidden_def.
2290
2291 2006-01-22  Bruno Haible  <bruno@clisp.org>
2292
2293         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2294         temporary buffer for sprintf, take into account the precision also
2295         for 'd', 'i', 'u', 'o', 'x', 'X'.
2296
2297 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2298
2299         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2300         to pacify gcc -Wswitch-default.
2301
2302 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2303
2304         * argp-help.c (usage_long_opt): Do not print DOC options.
2305         (__argp_base_name): Removed
2306         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2307         typo.
2308         (__argp_base_name): Provide macro definition or extern declaration
2309         depending on the configuration
2310
2311 2006-01-20  Simon Josefsson  <jas@extundo.com>
2312
2313         * inet_ntop.h: Unconditionally include sys/socket.h.
2314
2315 2006-01-19  Simon Josefsson  <jas@extundo.com>
2316
2317         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2318
2319 2006-01-12  Simon Josefsson  <jas@extundo.com>
2320
2321         * base64.c: Fix warning, reported by Bruno Haible
2322         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2323
2324 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2325
2326         Sync from coreutils.
2327         * md5.c: Fix commentary typos.
2328         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2329         * md5.h (__attribute__): Remove; unused.
2330         * sha1.c: Fix commentary to match md5 better.
2331         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2332         so that we don't need to worry about alignment.  All uses changed.
2333         This merges the 2005-10-28 md5 change into sha1.
2334
2335 2006-01-11  Jim Meyering  <jim@meyering.net>
2336
2337         Sync from coreutils.
2338         * md5.c (OP): Fix spacing.
2339
2340 2006-01-11  Simon Josefsson  <jas@extundo.com>
2341
2342         * stdint_.h (SIZE_MAX): Add missing (.
2343
2344 2006-01-10  Bruno Haible  <bruno@clisp.org>
2345
2346         * argp.h (__const): Remove macro. Use const instead.
2347         * argp-fmtstream.h (__const): Likewise.
2348         * glob_.h (__const): Remove macro.
2349         * glob-libc.h: Use const instead of __const.
2350
2351 2006-01-10  Jim Meyering  <jim@meyering.net>
2352
2353         Avoid the double-free (first in fts_read, second in fts_close) that
2354         would occur when an `active' directory is made inaccessible (e.g.,
2355         via chmod a-x) during a traversal.
2356         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2357         before returning.  Reproduce this failure by
2358         mkdir -p a/b; cd a; chmod a-x . b
2359         Reported by Stavros Passas.
2360
2361         Sync from coreutils.
2362         * sha1.c: Tweak grammar in a comment.
2363
2364 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2365
2366         * regex_internal.h (BITSET_WORD_BITS):
2367         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2368         preprocessor mishandles large unsigned values as if they were signed.
2369         Problem reported by Claudio Fontana in
2370         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2371
2372 2006-01-10  Simon Josefsson  <jas@extundo.com>
2373
2374         * socket_.h: New file.
2375
2376 2006-01-10  Bruno Haible  <bruno@clisp.org>
2377
2378         * localcharset.c: Update from GNU gettext.
2379
2380 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2381
2382         Sync from coreutils.
2383         * chdir-long.c (cdb_free): Don't bother trying to open directory
2384         for write access: POSIX says that must fail.
2385         * fts.c (diropen): Likewise.
2386         * save-cwd.c (save_cwd): Likewise.
2387         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2388         well, for minor improvements on hosts that lack O_DIRECTORY.
2389         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2390         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2391         Fall back on chown if open failed with EACCES.
2392
2393         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2394         Report an error at compile-time if only a 1-second nominal clock
2395         resolution is found.
2396
2397         * lchmod.h: New file.
2398         * mkdir-p.c: Include lchmod.h, lchown.h.
2399         (make_dir_parents): Use lchown rather than chown, and
2400         lchmod rather than chmod.
2401
2402         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2403         too.  Problem with "none" reported by Bob Proulx.  Problem with
2404         "proc" reported by n0dalus.
2405
2406         * mountlist.c: Include <limits.h>.
2407         (dev_from_mount_options)
2408         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2409         New function.  It no longer assumes "dev=" has the System V meaning
2410         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2411         (read_file_system_list)
2412         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2413         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2414         dev= in that case.
2415
2416         * posixtm.h (PDS_PRE_2000): New macro.
2417         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2418         All usages changed.  Reject dates outside the range 1969-1999 if
2419         PDS_PRE_2000 is used.
2420
2421 2006-01-09  Jim Meyering  <jim@meyering.net>
2422
2423         Sync from coreutils.
2424
2425         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2426
2427         * chdir-safer.h, chdir-safer.c: New files.
2428
2429         * modechange.c (mode_compile): Reject an invalid mode string
2430         that starts with an octal digit.  From Andreas Gruenbacher.
2431
2432         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2433         and dup to open_safer and dup_safer, respectively.
2434         (openat_permissive): Fix typo in comment.
2435
2436         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2437         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2438         (_): Remove; no longer needed.
2439         (openat): Renamed from rpl_openat; no need for rpl_openat
2440         since openat.h renames openat for us.
2441         Replace most of the body with a call to openat_permissive,
2442         to avoid duplicate code.
2443         Port to (probably hypothetical) environments were mode_t is
2444         wider than int.
2445         (openat_permissive): Require mode arg, so that we can check
2446         types better.  Put it just after flags.  Change cwd failure
2447         indicator from pointer-to-bool to pointer-to-errno-value.
2448         All callers changed.
2449         Invoke openat_save_fail and/or openat_restore_fail if
2450         cwd_errno is null, so that openat can call us.
2451         (openat_permissive, fdopendir, fstatat, unlinkat):
2452         Simplify errno handling to avoid some duplicate code,
2453         as it's OK to set errno on success.
2454         * openat.h: Revamp code so that function macros depend on
2455         __OPENAT_PREFIX only, not also on AT_FDCWD.
2456         (openat_ro): Remove.  Caller changed to use openat_permissive.
2457         (openat_permissive): Now a macro, if not a function.
2458         (openat_restore_fail, openat_save_fail): Now always functions,
2459         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2460
2461         * openat-priv.h: New file, defining macros used by mkdirat.c
2462         and openat.c.
2463         * mkdirat.c: Include openat-priv.h.
2464         Remove definitions of macros defined therein.
2465         * openat.c: Likewise.
2466
2467         * mkdirat.c (mkdirat): New file and function.
2468         * openat.h (mkdirat): Declare.
2469
2470         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2471
2472         * openat.h (openat_permissive): Declare.
2473         (openat_ro): Define.
2474
2475         * openat.c (EXPECTED_ERRNO): New macro.
2476         (openat_permissive): New function -- used in remove.c rewrite.
2477         (all functions): Set errno just before returning, only if there
2478         was an actual failure.
2479         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2480
2481         Emulate openat-family functions using Linux's procfs, if possible.
2482         Idea and some code based on Ulrich Drepper's glibc changes.
2483
2484         * openat.c: (BUILD_PROC_NAME): New macro.
2485         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2486         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2487         before falling back on save_cwd and restore_cwd.
2488         (fdopendir, fstatat, unlinkat): Likewise.
2489
2490         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2491         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2492
2493         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2494         as second argument to va_arg.  Otherwise, some versions of gcc
2495         warn that `if this code is reached, the program will abort'.
2496
2497 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2498
2499         Sync from coreutils.
2500
2501         Add POSIX ACL support
2502         * acl.h (copy_acl, set_acl): Add declarations.
2503         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2504         systems other than Linux.
2505         (chmod_or_fchmod): New function: use fchmod when possible,
2506         and chmod otherwise.
2507         (file_has_acl): Add a POSIX ACL implementation, with a
2508         Linux-specific subcase.
2509         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2510         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2511         acls are unsupported.
2512         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2513         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2514         are unsupported.
2515
2516 2006-01-09  Bruno Haible  <bruno@clisp.org>
2517
2518         * sysexit_.h (EX_OK): New macro.
2519         Suggested by Martin Lambers <marlam@marlam.de>.
2520
2521 2006-01-09  Bruno Haible  <bruno@clisp.org>
2522
2523         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2524         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2525         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2526         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2527
2528 2006-01-09  Bruno Haible  <bruno@clisp.org>
2529
2530         * stdint_.h (SIZE_MAX): Write the value without involving negative
2531         numbers.
2532
2533 2005-10-16  Bruno Haible  <bruno@clisp.org>
2534
2535         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2536         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2537
2538 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2539
2540         * strftime.c (tzname): Don't declare if it is already #defined.
2541         Problem reported for Mingw by Mark Junker.
2542
2543 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2544
2545         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2546         long int, not int, for nanosecond counts, so that people who are
2547         used to POSIX struct timespec won't be surprised.  Reported by Jim
2548         Meyering.
2549
2550 2005-12-16  Jim Meyering  <jim@meyering.net>
2551
2552         * fprintftime.c, fprintftime.h: New files.
2553
2554 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2555
2556         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2557         * argp-help.c (fill_in_uparams): Check if the constructed
2558         struct uparams is valid. Fall back to the default values if it is
2559         not.
2560
2561 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2562
2563         * argp-help.c (__argp_base_name): New function
2564         (__argp_short_program_name): Rewrite using __argp_base_name
2565         * argp-namefrob.h: Define program_invocation_name and
2566         program_invocation_short_name if requested
2567         (__argp_base_name): Add prototype
2568         * argp-parse.c (argp_def): Use gettext wrappers
2569         (argp_default_parser): Use __argp_base_name
2570         * argp-pin.c: New file. Defines program_invocation_name and
2571         program_invocation_short_name on systems that lack them.
2572
2573 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2574
2575         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2576         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2577         porting problem reported by Georg Schwarz in
2578         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2579
2580 2005-07-09  Bruno Haible  <bruno@clisp.org>
2581
2582         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2583         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2584         Reported by Mark Junker <mjscod@gmx.de>.
2585
2586 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2587
2588         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2589         (uintmax_t) [defined uintmax_t]: Do not declare.
2590         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2591         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2592         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2593         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2594         sake of portability to weird hosts that C allows (though we don't
2595         know of any practical examples).
2596
2597         * savedir.h (fdsavedir): New decl.
2598         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2599         contains most of the former guts of savedir.
2600         (savedir): Use savedirstream.
2601         Include "openat.h".
2602
2603 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2604
2605         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2606         coreutils no longer futzes with rounding modes.
2607
2608 2005-11-14  Jim Meyering  <jim@meyering.net>
2609
2610         * mkstemp-safer.c: Include <config.h>, required for possible
2611         replacement of mkstemp.
2612
2613 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2614
2615         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2616         business.
2617         (gethrxtime) [! (HAVE_NANOUPTIME
2618         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2619         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2620         our own approximation.
2621
2622 2005-11-10  Simon Josefsson  <jas@extundo.com>
2623
2624         * readline.c: Remove EOL.
2625
2626 2005-11-08  Eric Blake  <ebb9@byu.net>
2627
2628         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2629
2630 2005-11-08  Eric Blake  <ebb9@byu.net>
2631
2632         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2633
2634 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2635
2636         Fix porting problem reported by Theodoros V. Kalamatianos.
2637         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2638         Don't assume that futimes failing means we must fail.
2639
2640 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2641
2642         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2643         leave errno alone.  Problem reported by Dmitry V. Levin.
2644
2645 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2646
2647         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2648         errno alone.  Problem reported by Frederic Jolliton.
2649
2650 2005-10-28  Simon Josefsson  <jas@extundo.com>
2651
2652         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2653         "restrict" keywords, as per POSIX.  Protect the function
2654         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2655         Don't use K&R prototypes.  Check the sprintf return values.
2656         Re-define EAFNOSUPPORT if not present.  Indent.
2657
2658         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2659         suggested by Bruno Haible <bruno@clisp.org>.
2660
2661         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2662
2663         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2664
2665         * gc-libgcrypt.c: Add MD2 (which is not available through
2666         libgcrypt).
2667
2668         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2669
2670         * md2.h, md2.c: New files.
2671
2672 2005-10-24  Simon Josefsson  <jas@extundo.com>
2673
2674         * md4.h: Shrink buffer size, now that we changed the type.
2675
2676 2005-10-22  Simon Josefsson  <jas@extundo.com>
2677
2678         * arcfour.h, arcfour.c: Use fixed size indices in the
2679         arcfour_context struct (simplify test vector testing in GNU
2680         Shishi).
2681
2682 2005-10-22  Simon Josefsson  <jas@extundo.com>
2683
2684         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2685         suggested by Bruno Haible <bruno@clisp.org>.
2686
2687 2005-10-22  Simon Josefsson  <jas@extundo.com>
2688
2689         * crc.h: Include stddef.h, for size_t.
2690
2691 2005-10-21  Simon Josefsson  <jas@extundo.com>
2692
2693         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2694         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2695
2696 2005-10-21  Simon Josefsson  <jas@extundo.com>
2697
2698         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2699         block.
2700
2701 2005-10-21  Simon Josefsson  <jas@extundo.com>
2702
2703         * gc-gnulib.c: Support ARCTWO in CBC mode.
2704
2705 2005-10-21  Simon Josefsson  <jas@extundo.com>
2706
2707         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2708         <bruno@clisp.org>.
2709
2710         * hmac-sha1.c (hmac_sha1): Likewise.
2711
2712         * crc.c (crc32_update): Actually use crc parameter, suggested by
2713         Bruno Haible <bruno@clisp.org>.
2714
2715         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2716         <bruno@clisp.org>.
2717
2718 2005-10-21  Simon Josefsson  <jas@extundo.com>
2719
2720         * des.h, des.c: New files.
2721
2722         * gc-gnulib.c: Support DES.c
2723
2724 2005-10-21  Simon Josefsson  <jas@extundo.com>
2725
2726         * arctwo.h, arctwo.c: New files.
2727
2728         * gc-gnulib.c: Support ARCTWO.
2729
2730 2005-10-21  Simon Josefsson  <jas@extundo.com>
2731
2732         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2733
2734 2005-10-19  Simon Josefsson  <jas@extundo.com>
2735
2736         * gc-gnulib.c: Support ARCFOUR.
2737
2738 2005-10-19  Simon Josefsson  <jas@extundo.com>
2739
2740         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2741         support.
2742
2743         * gc.h: Add ECB enum type.
2744
2745         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2746
2747 2005-10-19  Simon Josefsson  <jas@extundo.com>
2748
2749         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2750
2751 2005-10-18  Simon Josefsson  <jas@extundo.com>
2752
2753         * md4.h, md4.c: New files, based on md5.?.
2754
2755 2005-10-17  Simon Josefsson  <jas@extundo.com>
2756
2757         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2758
2759         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2760
2761 2005-10-17  Simon Josefsson  <jas@extundo.com>
2762
2763         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2764
2765 2005-10-17  Simon Josefsson  <jas@extundo.com>
2766
2767         * gc.h, gc-libgcrypt.c: Add ciphers.
2768
2769 2005-10-17  Simon Josefsson  <jas@extundo.com>
2770
2771         * sha1.c: Use uint32_t instead of md5_uint32.t
2772
2773         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2774         md5.h.
2775
2776         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2777
2778         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2779
2780 2005-10-15  Simon Josefsson  <jas@extundo.com>
2781
2782         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2783
2784         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2785
2786 2005-10-14  Simon Josefsson  <jas@extundo.com>
2787
2788         * arcfour.h, arcfour.c: New files.
2789
2790 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2791
2792         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2793         include <wchar.h>; no longer needed.
2794
2795 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2796         and  Ulrich Drepper  <drepper@redhat.com>
2797
2798         Import from libc.
2799         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2800         instead of inline stream orientation test and two separate
2801         function calls.  Pay no attention to USE_IN_LIBIO.
2802
2803 2005-10-14  Roland McGrath  <roland@redhat.com>
2804
2805         Import from libc.  [BZ #1331]
2806         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2807         macro argument.
2808         Reported by Matej Vela <vela@debian.org>.
2809
2810 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2811
2812         * mkdir-p.c (make_dir_parents): Don't report an error if an
2813         intermediate directory is in a read-only file system.  Problem
2814         reported by Eric Blake.
2815
2816 2005-10-13  Simon Josefsson  <jas@extundo.com>
2817
2818         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2819         Move memory allocation outside of loop.
2820
2821 2005-10-12  Simon Josefsson  <jas@extundo.com>
2822
2823         * gc-pbkdf2-sha1.c: New file.
2824
2825         * gc.h: Add gc_pbkdf2_sha1 prototype.
2826
2827 2005-10-12  Simon Josefsson  <jas@extundo.com>
2828
2829         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2830         suggested by Bruno Haible <bruno@clisp.org>.
2831
2832 2005-10-12  Simon Josefsson  <jas@extundo.com>
2833
2834         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2835
2836         * gc-gnulib.c (gc_hmac_sha1): New function.
2837
2838 2005-10-12  Simon Josefsson  <jas@extundo.com>
2839
2840         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2841
2842 2005-10-12  Simon Josefsson  <jas@extundo.com>
2843
2844         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2845         GC_USE_HMAC_MD5, respectively.
2846
2847         * gc-libgcrypt.c (gc_md5): Fix assert call.
2848         (gc_md5): Fix typo.
2849
2850         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2851
2852         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2853
2854         * gc-gnulib.c (gc_hash_buffer): Ditto.
2855
2856 2005-10-11  Bruno Haible  <bruno@clisp.org>
2857
2858         * c-strcasestr.h: New file, from GNU gettext.
2859         * c-strcasestr.c: New file, from GNU gettext.
2860
2861 2005-10-11  Bruno Haible  <bruno@clisp.org>
2862
2863         * c-strcase.h: New file, from GNU gettext.
2864         * c-strcasecmp.c: New file, from GNU gettext.
2865         * c-strncasecmp.c: New file, from GNU gettext.
2866
2867 2005-10-11  Simon Josefsson  <jas@extundo.com>
2868
2869         * crc.h, crc.c: New files.
2870
2871         * gc.h (gc_hash_buffer): Add doc.
2872
2873 2005-10-08  Simon Josefsson  <jas@extundo.com>
2874
2875         * gc.h: Add gc_hash and gc_hash_buffer.
2876
2877         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2878
2879         * gc-libgcrypt.c (gc_hash_buffer): Add.
2880
2881 2005-10-11  Bruno Haible  <bruno@clisp.org>
2882
2883         * strcasecmp.c: Include limits.h.
2884         (strcasecmp): Avoid integer overflow on exotic platforms.
2885         * strncasecmp.c: Include limits.h.
2886         (strncasecmp): Avoid integer overflow on exotic platforms.
2887         Reported by Paul Eggert.
2888
2889 2005-10-06  Simon Josefsson  <jas@extundo.com>
2890
2891         * hmac-md5.c: New file.
2892
2893         * hmac.h: New file.
2894
2895 2005-10-06  Simon Josefsson  <jas@extundo.com>
2896
2897         * memxor.c (memxor): Avoid casts and warnings.
2898
2899 2005-10-05  Derek Price  <derek@ximbiot.com>
2900
2901         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2902
2903 2005-10-05  Simon Josefsson  <jas@extundo.com>
2904
2905         * memxor.c (memxor): Fix compiler error.
2906
2907         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2908         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2909
2910         * memxor.h, memxor.c: New files.
2911
2912         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2913         we assume all systems have it, suggested by Jim Meyering
2914         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2915         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2916         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2917         same reasons.
2918
2919 2005-10-04  Bruno Haible  <bruno@clisp.org>
2920
2921         * verify.h (verify_true): Provide alternative definition for C++.
2922
2923 2005-10-04  Simon Josefsson  <jas@extundo.com>
2924
2925         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2926         D. Baushke" <mdb@gnu.org>.
2927
2928 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2929
2930         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2931         (SSIZE_MAX): New macro, if not already defined.
2932         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2933         than 2 GiB.
2934
2935 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2936
2937         * exclude.c: Include verify.h.
2938         (verify): Remove.  All callers changed to use verify.h's version.
2939         * strtoimax.c: Likewise.
2940         * utimecmp.c: Likewis.e
2941
2942         Sync from coreutils.
2943         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2944         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2945         * .cvsignore: Add fts.h, search.h, t-fpending.
2946         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2947         bother returning ENOSYS if settimeofday or stime fails; just let
2948         them return whatever errno they want to return.
2949         * utimens.c: Include unistd.h, for dup2.
2950         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2951         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2952
2953 2005-10-02  Jim Meyering  <jim@meyering.net>
2954
2955         Sync from coreutils.
2956         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2957         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2958         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2959         Remove AT_FDCWD test.
2960         Do not consume the fd unless successful.
2961         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2962         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2963         block, so that we don't even try to compile it if settimeofday is
2964         available.  This works around a compilation failure on OSF1 V5.1,
2965         due to stime requiring a `long int*' while tv_sec is `int'.
2966
2967 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2968
2969         * getdelim.c (getdelim): Remove unused variables.
2970
2971 2005-10-01  Simon Josefsson  <jas@extundo.com>
2972
2973         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2974         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2975         AI_* and EAI_* definitions.  Protect function declarations.
2976
2977 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2978
2979         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2980         so that the code works even with ancient cpp.  Portability problem
2981         with GCC 2.7.2.1 reported by Thomas M.Ott.
2982
2983 2005-09-27  Jim Meyering  <jim@meyering.net>
2984
2985         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2986
2987         * intprops.h (signed_type_or_expr__): Define.
2988         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2989         for unsigned types.
2990
2991 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2992
2993         * verify.h (verify_expr): Remove, replacing with:
2994         (verify_true): New macro that returns true instead of void.
2995         (verify_type__): Remove.
2996         (verify): Use verify_true rather than verify_type__.
2997
2998 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2999
3000         * utimens.c (ENOSYS): Define if not already defined.
3001         (futimens): Support having a null PATH if the file descriptor
3002         is nonnegative.
3003
3004         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
3005         Remove.
3006         (__attribute): Define to empty unless GCC 3.1 or later.
3007         This works around a core dump on OpenBSD 3.4, which has GCC
3008         2.95.3, which dumps core when given __attribute__(()).  It also
3009         simplifies other tests, since we really don't want to bother with
3010         worrying about which ancient version of GCC supported what.
3011         Original problem reported by Yoann Vandoorselaere, with part of
3012         the fix suggested by Derek Price.
3013
3014 2005-09-24  Jim Meyering  <jim@meyering.net>
3015
3016         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
3017         so we can once again use a positive bitfield width of 1 -- now we
3018         don't have to explain why we were using a bitfield width of 2.
3019
3020 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
3021
3022         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
3023         Problem reported by Eric Blake.
3024         (getaddrinfo): Initialize se so that it's not garbage.
3025         Redo internal storage allocation so that it doesn't make unportable
3026         assumptions about alignment.
3027         Fix a memory leak.
3028
3029         * utimens.c (futimens): Use futimesat if available.
3030         Prefer it to futimes since it doesn't have the futimes bug.
3031
3032         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
3033         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
3034         Instead, declare a function that returns a pointer to an array,
3035         and use verify_type__ to declare the size of the array.
3036         Problem and germ of a solution reported by Bruno Haible.
3037         (verify_type__): Use 2, not 1, for bitfield size, to avoid
3038         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
3039
3040 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
3041
3042         Sync from coreutils.
3043
3044         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3045         stat-time.h.
3046         * argmatch.h: Include verify.h
3047         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3048         (ARGMATCH_ASSERT): Remove; unused.
3049         * canonicalize.c: Assume STDC_HEADERS.
3050         * exclude.c: Include "strcase.h".
3051         * regex_internal.h [!defined _LIBC]: Likewise.
3052         * getusershell.c: Include stdio--.h rather than stdio.h
3053         and stdio-safer.h.
3054         (getusershell): Call fopen, not fopen_safer.
3055         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3056         Do not include unistd-safer.h.
3057         (save_cwd): Don't call fd_safer; no longer needed
3058         now that we include fcntl--.h.
3059
3060         * getdate.y (relative_time): New type.
3061         (RELATIVE_TIME_0): New constant.
3062         (parser_control): Use relative_time instead of doing it ourselves.
3063         (%union): Add new relative_time rel member.
3064         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3065         Now typeless.
3066         (relunit, relunit_snumber): Now of type rel.
3067         (zone, rel, relunit, get_date): Adjust to above changes.
3068
3069         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3070         Do not include unistd-safer.h.
3071         (getloadavg): Don't call fd_safer; no longer needed
3072         now that we include fcntl--.h.
3073
3074         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3075         (make_dir_parents): Treat ENOSYS like EEXIST.
3076
3077         Improve quality of diagnostics on restore_cwd failure.
3078         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
3079         (make_dir_parents): Last arg is now int * (for errno), not bool *.
3080         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3081         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3082         each time through the loop.  Do not diagnose restore_cwd failure;
3083         that is the caller's job (and perhaps the caller does not care).
3084
3085         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3086         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3087         If the file already exists but is not a directory, don't bother
3088         to try to make its parents.
3089         Close potential file descriptor leak if we can't chdir("/") (!).
3090         Don't always return true if chdir($PWD) fails; return true only
3091         if the requested action was done successfully (except for the
3092         chdir($PWD)).
3093         Don't log final directory unless we actually made it.
3094         Refactor to avoid duplicate code to fix up permissions.
3095         Don't attempt to fix up parent permissions if chdir($PWD) fails.
3096
3097         * strftime.c (my_strftime): Rewrite the previous change slightly,
3098         to make it a bit faster and (I hope) clearer.
3099         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3100         Fix bug in formats like %2N.
3101
3102         * verify.h: New file.
3103
3104 2005-09-22  Jim Meyering  <jim@meyering.net>
3105
3106         Sync from coreutils.
3107
3108         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3109
3110         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3111         the .tm_year member, since otherwise gcc-4.0 would now warn about
3112         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3113
3114         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3115         order to avoid an unsuppressible warning from gcc on 64-bit systems.
3116
3117         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3118         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3119         when run in a time zone for which daylight savings time is in effect
3120         for the starting date.
3121
3122         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3123         stop us from restricting permissions of just-created absolute-named
3124         directories.
3125         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3126         to restore initial working directory.
3127         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3128         to tell caller if/when we change the working directory and are
3129         unable to return to the initial one.
3130         * mkdir-p.h (make_dir_parents): Update prototype.
3131         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3132         `return false'.  This fixes a bug introduced on 2004-07-30.
3133
3134         * openat.c (fdopendir): Be sure to close the supplied
3135         file descriptor before returning.  This makes our replacement
3136         implementation a little closer to Solaris's, where fdopendir
3137         ties the file descriptor to the returned DIR* pointer.
3138         * openat.c (unlinkat): New function.
3139         * openat.h (unlinkat): Add prototype.
3140         * openat-die.c (openat_save_fail): Rename from openat_save_die.
3141         (openat_restore_fail): Rename from openat_restore_die.
3142         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3143
3144         Provide an alternative to exiting immediately upon save_cwd or
3145         restore_cwd failure.  Now, an application can arrange e.g.,
3146         to perform a longjump in that case.
3147         * openat.c: Include dirname.h.
3148         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3149         (rpl_openat, fdopendir, fstatat): Call openat_save_die
3150         and openat_restore_die rather than calling error directly.
3151         Don't include "error.h" or "exitfail.h"; they're no longer needed.
3152
3153         * openat-die.c (openat_save_die, openat_restore_die): New file.
3154         * openat.h (openat_save_die, openat_restore_die): Declare and define.
3155
3156         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3157         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3158                             int utc, int nanoseconds);
3159         Background:
3160         date should not have to allocate a megabyte of virtual memory to
3161         handle a format argument like +%1048575T.  When implemented with
3162         strftime, it must allocate such a buffer, use strftime to fill it
3163         in, print it, then free it.
3164         With fprintftime, it simply prints everything and exits.
3165         With no need for memory allocation, that's one fewer way to fail.
3166         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3167         optional field width, not before, so we accept %9:z, not %:9z.
3168         (my_strftime): Be sure to use L_('x') for literals.
3169
3170         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3171         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3172         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3173         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3174         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3175         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3176         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3177         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3178         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3179
3180         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3181         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3182         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3183         and don't include <sys/file.h>).
3184
3185 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
3186
3187         Sync from coreutils.
3188
3189         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3190         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3191         [!LDAV_DONE]: Avoid unused variable warning.
3192
3193 2005-09-21  Bruno Haible  <bruno@clisp.org>
3194
3195         * unicodeio.h (unicode_to_mb): New declaration.
3196
3197 2005-09-20  Derek Price  <derek@ximbiot.com>
3198
3199         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3200
3201 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3202
3203         Use a consistent style for including <config.h>.
3204         * __fpending.c, acl.c, argmatch.c,
3205         argp-help.c, argp-parse.c,
3206         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3207         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3208         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3209         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3210         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3211         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3212         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3213         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3214         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3215         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3216         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3217         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3218         modechange.c, mountlist.c, open-safer.c, physmem.c,
3219         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3220         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3221         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3222         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3223         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3224         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3225         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3226         userspec.c, utimecmp.c, version-etc-fsf.c,
3227         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3228         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3229         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3230         Standardize inclusion of config.h.
3231         * __fpending.h, dirfd.h, getdate.h, human.h,
3232         inttostr.h:  Removed inclusion of config.h from header files.
3233         * inttostr.c:  Adjusted in-tree users.
3234         * timespec.h: Remove superfluous warning to include config.h.
3235         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3236         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3237         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3238         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3239
3240 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3241
3242         * stat-time.h: New file.
3243         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3244         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3245         in a different way.
3246         (timespec_cmp): New function.
3247         * utimecmp.c: Include stat-time.h.
3248         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3249         members exist, not on the obsolescent ST_MTIM_NSEC.
3250         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3251
3252 2005-09-15  Derek Price  <derek@ximbiot.com>
3253             Paul Eggert  <eggert@cs.ucla.edu>
3254
3255         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3256         changes, consolidating in...
3257         * regex_internal.h: ...this file.
3258
3259 2005-09-15  Derek Price  <derek@ximbiot.com>
3260
3261         * regex_internal.h: Blank `pure' for GNUC < 3.
3262         * regex_internal.c: Ditto, using this...
3263         (__GNUC_PREREQ): ...new macro.
3264         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3265         (__GNUC_PREREQ): ...this new macro.
3266
3267         * strstr.h: Include string.h. Define strstr as a macro here.
3268
3269 2005-09-13  Derek Price  <derek@ximbiot.com>
3270
3271         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3272         failure.
3273         Reported by Jim Meyering  <jim@meyering.net>.
3274
3275 2005-09-13  Jim Meyering  <jim@meyering.net>
3276
3277         * canon-host.c: Filter through gnu indent and reword comments slightly.
3278         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3279
3280 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3281
3282         * base64.c: Typo.
3283         (base64_encode): Put b64str in initialized data section.
3284
3285 2005-09-12  Derek Price  <derek@ximbiot.com>
3286
3287         Return usable errors from canon-host.
3288         * canon-host.h: New file.
3289         * canon-host.c (canon_host): Wrap...
3290         (canon_host_r): ...this new function, which now relies exclusively on
3291         getaddrinfo.
3292         (ch_strerror): New function.
3293         (last_cherror): New global.
3294         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3295         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3296         void *.
3297         (freeaddrinfo): Free ai->ai_canonname when set.
3298
3299 2005-09-12  Derek Price  <derek@ximbiot.com>
3300             Paul Eggert  <eggert@cs.ucla.edu>
3301
3302         * glob-libc.h: Renamed from glob_.h.  The new version is
3303         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3304         protecting things that should be done only in gnulib contexts.
3305         * glob_.h: New file, containing only the glob things needed for
3306         gnulib.
3307         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3308         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3309         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3310         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3311         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3312         and to respect the namespace rules better.
3313
3314 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3315
3316         Merge glibc and coreutils changes into gnulib, plus a few
3317         extra fixes.
3318         * md5.c: Use #error rather than a string.
3319         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3320         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3321         (__attribute__): Define to empty for non recent-GCC.
3322         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3323         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3324         Renamed from their non-__ counterparts, with new macros replacing
3325         them if not _LIBC.  Add __THROW attribute.
3326         (rol): Remove.
3327         (struct md5_ctx): Align buffer if using GCC.
3328         * sha1.h (struct sha1_ctx): Likewise.
3329         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3330         The old name was backwards.
3331         (NOTSWAP): Remove; not used.
3332         (rol): New macro, moved here from md5.h.
3333         (sha1_process_block): Remove a FIXME that doesn't make sense.
3334
3335 2005-09-12  Derek Price  <derek@ximbiot.com>
3336
3337         * gai_strerror.c: Include config.h when available.  Include
3338         getaddrinfo.h before other headers to test interface.
3339         Reported by Larry Jones <lawrence.jones@ugs.com>.
3340
3341 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3342
3343         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3344         definitions, since that's the preferred style in glibc.
3345         Fix a minor spacing issue, and update copyright notice to match glibc's.
3346
3347 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3348
3349         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3350
3351 2005-09-06  Simon Josefsson  <jas@extundo.com>
3352
3353         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3354         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3355
3356 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3357
3358         Change bitset word type from unsigned int to unsigned long int,
3359         as this has better performance on typical 64-bit hosts.
3360         Port bitset code to hosts with unusual word sizes.
3361         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3362         (build_collating_symbol):
3363         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3364         argument is a bitset.  This is merely a style issue, but it makes
3365         it clearer that an entire array is expected.
3366         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3367         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3368         Port to the case where bitset_word is not the same as unsigned int.
3369         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3370         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3371         Likewise.
3372         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3373         (build_trtable, group_nodes_into_DFAstates):
3374         Likewise.
3375         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3376         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3377         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3378         * regexec.c (group_nodes_into_DFAstates): Likewise.
3379         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3380         * regcomp.c (optimize_subexps, lower_subexp):
3381         Work even if bitset_word has holes in its bitwise representation.
3382         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3383         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3384         Likewise.
3385         * regex_internal.c (re_string_reconstruct):
3386         Don't assume UCHAR_MAX == 255.
3387         * regex_internal.h (bitset_set_all): Likewise.
3388         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3389         All uses changed.
3390         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3391         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3392         All uses changed.
3393         (BITSET_WORD_MAX): New macro.
3394         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3395         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3396         (bitset_empty, bitset_copy):
3397         Prefer sizeof (bitset) to multiplying it out ourselves.
3398         (bitset_not_merge): Remove; unused.
3399         (bitset_contain): Return bool, not unsigned int with one bit on.
3400         All callers changed.
3401         * regexec.c (build_trtable): Don't assume bitset has no stricter
3402         alignment than re_node_set; do this by defining a new internal
3403         type struct dests_alloc and using it to allocate memory.
3404
3405 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3406
3407         Check for arithmetic overflow when calculating sizes, to prevent
3408         some buffer-overflow issues.  These patches are conservative, in the
3409         sense that when I couldn't determine whether an overflow was possible,
3410         I inserted a run-time check.
3411         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3412         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3413         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3414         (re_xnrealloc, re_x2nrealloc): New inline functions.
3415         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3416         (build_equiv_class, build_charclass): Check for arithmetic overflow
3417         in size expression calculations.
3418         * regex_internal.c (re_string_realloc_buffers):
3419         (build_wcs_upper_buffer, re_node_set_add_intersect):
3420         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3421         (re_dfa_add_node, register_state): Likewise.
3422         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3423         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3424         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3425         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3426
3427 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3428
3429         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3430         to avoid a collision with bits/local_lim.h in glibc.
3431         All uses changed.  Problem reported by Dmitry V. Levin in
3432         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3433
3434         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3435         bugs in int versus size_t comparisons.
3436         (re_string_context_at): Fix bug where the code assumed that
3437         Idx is signed.
3438
3439         Use bool where appropriate.
3440         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3441         All callers changed.
3442         (calc_eclosure_iter): Likewise, for ROOT arg.
3443         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3444         (build_charclass_op): Likewise, for NON_MATCH arg.
3445         * regex_internal.c (re_string_allocate, re_string_construct):
3446         (re_string_construct_common): Likewise, for ICASE arg.
3447         * regexec.c (re_search_2_stub, re_search_stub):
3448         Likewise, for RET_LEN arg.
3449         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3450         (set_regs): Likewise, for FL_BACKTRACK arg.
3451         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3452         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3453         (calc_eclosure_iter, parse_bracket_exp):
3454         Use bool for internal variables that are booleans.
3455         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3456         (set_regs, build_sifted_states, sift_states_bkref):
3457         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3458         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3459         (find_collation_sequence_value):
3460         Likewise.
3461         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3462         (re_node_set_compare):
3463         Return bool, not int. All callers changed.
3464         * regexec.c (check_halt_node_context, check_dst_limits):
3465         (build_trtable, check_node_accept): Likewise.
3466         * regex_internal.h: Include stdbool.h.
3467
3468         Fix bugs uncovered when converting to bool.
3469         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3470         failure instead of charging ahead blindly.
3471         * regex_internal.c (register_state): Likewise.
3472         * regexec.c (re_search_2_stub): Use simpler method than boolean
3473         for freeing internal storage.
3474         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3475         bitset pieces used as boolean, to avoid undefined behavior
3476         on hosts that do int overflow checking.
3477
3478 2005-08-31  Derek Price  <derek@ximbiot.com>
3479
3480         * getdelim.c (getdelim): Return EOF on EOF.
3481         Reported by Larry Jones <lawrence.jones@ugs.com>.
3482
3483 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3484
3485         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3486         lengths fit in regoff_t; this isn't true if regoff_t is the same
3487         width as size_t.
3488         * regex.c (re_search_internal): 5th arg is LAST_START
3489         (= START + RANGE) instead of RANGE.  This avoids overflow
3490         problems when regoff_t is the same width as size_t.
3491         All callers changed.
3492         (re_search_2_stub): Check for overflow when adding the
3493         sizes of the two strings.
3494         (re_search_stub): Check for overflow when adding START
3495         to RANGE; if it occurs, substitute the extreme value.
3496
3497 2005-08-31  Jim Meyering  <jim@meyering.net>
3498
3499         * regcomp.c (search_duplicated_node): Make first pointer arg
3500         a pointer-to-const.
3501         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3502         (register_state): Likewise.
3503         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3504         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3505         (group_nodes_into_DFAstates): Likewise.
3506
3507 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3508
3509         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3510         old glibc regex code mishandles strings longer than 2**31 bytes.
3511         This patch fixes this when the regex code is used in gnulib
3512         (i.e., outside glibc).
3513
3514         This patch should not affect the use of the regex code inside
3515         glibc.  No doubt this problem also needs to be handled for glibc
3516         as well, but the result will be an incompatible change to the
3517         glibc ABI, and the old ABI will have to be supported too.  That
3518         can be the the subject for another patch.
3519
3520         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3521         governing whether the rest of this patch is active.  By default,
3522         the macro is disabled and the patch has no effect.
3523         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3524         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3525         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3526         (re_match_2, re_set_registers): Use the new types.
3527         * regex_internal.h (Idx, re_hashval_t): New types.
3528         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3529         New macros.
3530         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3531         (re_string_context_at, bin_tree_t, re_dfastate_t):
3532         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3533         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3534         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3535         (re_string_char_size_at, re_string_wchar_at):
3536         (re_string_elem_size_at):
3537         Use the new types and macros to port to 64-bit hosts.
3538         Use unsigned types for internal values, so that the code
3539         mostly works even for arrays larger than SSIZE_MAX.
3540         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3541         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3542         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3543         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3544         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3545         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3546         (calc_inveclosure, parse_dup_op, build_range_exp):
3547         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3548         (fetch_number, create_token_tree, mark_opt_subexp):
3549         Likewise.
3550         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3551         (create_cd_newstate, re_string_allocate, re_string_construct):
3552         (re_string_realloc_buffers, build_wcs_upper_buffer):
3553         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3554         (re_string_reconstruct, re_string_peek_byte_case):
3555         (re_string_fetch_byte_case, re_string_context_at):
3556         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3557         (re_node_set_init_copy, re_node_set_add_intersect):
3558         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3559         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3560         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3561         (re_acquire_state, re_acquire_state_context, register_state):
3562         Likewise.
3563         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3564         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3565         (re_search_internal, re_search_2_stub, re_search_stub)
3566         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3567         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3568         (update_cur_sifted_state, check_dst_limits):
3569         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3570         (check_subexp_limits, sift_states_bkref, merge_state_array):
3571         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3572         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3573         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3574         (expand_bkref_cache, check_node_accept_bytes):
3575         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3576         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3577         (acquire_init_state_context, check_halt_node_context):
3578         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3579         (sift_states_backward, clean_state_log_if_needed):
3580         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3581         (find_recover_state, transit_state_sb, transit_state_mb):
3582         (transit_state_bkref, build_trtable, match_ctx_clean):
3583         Likewise.
3584         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3585         to work around an assumption that REG_MISSING is negative.
3586
3587         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3588         (seek_collating_symbol_entry) [defined _LIBC]:
3589         (lookup_collation_sequence_value) [defined _LIBC]:
3590         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3591         Use prototypes rather than old-style function definitions.
3592         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3593         (transit_state_sb) [0]:
3594         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3595
3596         * regexec.c (re_search_internal): Simplify update of rm_so and
3597         rm_eo.
3598
3599         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3600         (optimize_subexps, lower_subexp):
3601         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3602         since the signed shift might overflow.  Use 1u<<31 instead.
3603         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3604         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3605         Likewise.
3606
3607         * regcomp.c (optimize_subexps, lower_subexp):
3608         Use CHAR_BIT rather than 8, for clarity.
3609         * regexec.c (check_dst_limits_calc_pos_1):
3610         (check_subexp_matching_top): Likewise.
3611         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3612         have to worry about portability issues when shifting it left.
3613         Remove no-longer-needed test for table_size > 0.
3614         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3615         in a word, as the resulting behavior is undefined.
3616         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3617         in one case, a <= should have been an <, and in another case the
3618         whole test was missing.
3619         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3620         the standard name CHAR_BIT.
3621         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3622         this is not true on one's complement and signed-magnitude hosts.
3623
3624         * regex_internal.h (re_sub_match_top_t): Remove unused member
3625         next_last_offset.
3626         (struct re_dfa_t): Remove unused member states_alloc.
3627         * regcomp.c (init_dfa): Don't initialize unused members.
3628
3629 2005-08-31  Bruno Haible  <bruno@clisp.org>
3630
3631         * strstr.c: Include <stddef.h>, for NULL.
3632         * strcasestr.c: Likewise.
3633         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3634
3635 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3636
3637         * iconvme.h: Add prototype for iconv_alloc.
3638
3639 2005-08-29  Simon Josefsson  <jas@extundo.com>
3640
3641         * iconvme.c: Fix errno.
3642
3643 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3644
3645         * iconvme.c: Split iconv_string into iconv_alloc.
3646
3647 2005-08-27  Jim Meyering  <jim@meyering.net>
3648
3649         * fopen-safer.c: Merge minor changes from coreutils.
3650         * dup-safer.c: Likewise.
3651         * fd-safer.c: Likewise.
3652
3653         Merge from coreutils.
3654         * stdio--.h: New file.
3655         * stdlib--.h: New file.
3656         * mkstemp-safer.c: New file.
3657
3658         GNU tar needs these.
3659         * pipe-safer.c: New file.
3660         * creat-safer.c: New file.
3661         * fcntl--.h (creat): Define to creat_safer.
3662         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3663         * unistd--.h (pipe): Define to pipe_safer.
3664         * unistd-safer.h: Declare pipe_safer.
3665
3666 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3667
3668         * regex_internal.h: Remove all references to
3669         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3670         or better.
3671         (bitset_not, bitset_merge, bitset_not_merge):
3672         (bitset_mask, re_string_allocate, re_string_construct):
3673         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3674         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3675         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3676         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3677         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3678         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3679         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3680         (re_acquire_state_context):
3681         Remove unnecessary forward decls.
3682         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3683         Put __attribute at function definition,
3684         now that the function decl has been removed.
3685         * regex_internal.c (re_string_peek_byte_case):
3686         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3687         Likewise.
3688
3689 2005-08-26  Simon Josefsson  <jas@extundo.com>
3690
3691         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3692         Haible <bruno@clisp.org>.
3693
3694 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3695
3696         * regexec.c (set_regs): Don't alloca with an unbounded size.
3697
3698         alloca modernization/simplification for regex.
3699         * regex.c: Remove portability cruft for alloca.  This no longer
3700         needs to be at the start of the file, and can be moved into
3701         regex_internal.h and simplified.
3702         * regex_internal.h: Include <alloca.h>.
3703         (__libc_use_alloca) [!defined _LIBC]: New macro.
3704         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3705         now works outside glibc.
3706
3707 2005-08-24  Simon Josefsson  <jas@extundo.com>
3708
3709         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3710         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3711         GLIBC specific code.
3712
3713 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3714
3715         Make regex safe for g++.  This fixes one real bug (an "err"
3716         that should have been "*err").  g++ problem reported by
3717         Sam Steingold.
3718         * regex_internal.h (re_calloc): New macro, consistent with
3719         re_malloc etc.  All callers of calloc changed to use re_calloc.
3720         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3721         not int.  All callers changed.
3722         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3723         just use an array of size MB_LEN_MAX.
3724         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3725         (find_recover_state): Change "err" to "*err"; this fixes what
3726         appears to be a real bug.
3727         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3728         versus int.
3729
3730 2005-08-25  Jim Meyering  <jim@meyering.net>
3731
3732         * open-safer.c: Include <config.h>.
3733         Otherwise, we'd lose LARGEFILE support in any file using
3734         e.g. "fcntl--.h"
3735
3736 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3737
3738         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3739         * regex.h (regerror): Likewise.
3740
3741         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3742         requires this.  (The code never needed it.)
3743
3744         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3745         All uses of recently-renamed identifiers changed to use the new,
3746         POSIX-compliant names.  The code will build and run just fine
3747         without these changes, but it's better to eat our own dog food
3748         and use the standard-conforming names.
3749
3750         * regex.h: Fix a multitude of POSIX name space violations.
3751         These changes have an effect only for programs that define
3752         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3753         do not change anything for programs compiled in the normal way.
3754         Also, there is no effect on the ABI.
3755
3756         (_REGEX_SOURCE): New macro.
3757         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3758         defined and _GNU_SOURCE is not; this fixes a name space violation.
3759
3760         Rename the following macros to obey POSIX requirements.
3761         The old names are still visible as macros if _REGEX_SOURCE is defined.
3762         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3763         RE_BACKSLASH_ESCAPE_IN_LISTS.
3764         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3765         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3766         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3767         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3768         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3769         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3770         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3771         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3772         (REG_INTERVALS): renamed from RE_INTERVALS.
3773         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3774         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3775         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3776         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3777         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3778         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3779         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3780         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3781         RE_UNMATCHED_RIGHT_PAREN_ORD.
3782         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3783         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3784         (REG_DEBUG): renamed from RE_DEBUG.
3785         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3786         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3787         unusual, since we can't clash with the POSIX REG_ICASE.
3788         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3789         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3790         (REG_NO_SUB): renamed from RE_NO_SUB.
3791         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3792         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3793         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3794         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3795         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3796         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3797         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3798         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3799         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3800         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3801         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3802         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3803         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3804         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3805         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3806         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3807         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3808         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3809         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3810         (REG_FIXED): Renamed from REGS_FIXED.
3811         (REG_NREGS): Renamed from RE_NREGS.
3812
3813         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3814         of other REG_* macros, since POSIX says the user is allowed to
3815         #undef these macros selectively.
3816
3817         (reg_errcode_t): Update comment stating what other tables need
3818         to be consistent.
3819
3820         Rename the following enum values to obey POSIX requirements.
3821         The old names are still visible as macros.
3822         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3823         is not defined, since GNU is supposed to be a superset of POSIX as
3824         much as possible, and since we want reg_errcode_t to be a signed
3825         type for implementation consistency.
3826         (_REG_NOERROR): Renamed from REG_NOERROR.
3827         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3828         (_REG_BADPAT): Renamed from REG_BADPAT.
3829         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3830         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3831         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3832         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3833         (_REG_EBRACK): Renamed from REG_EBRACK.
3834         (_REG_EPAREN): Renamed from REG_EPAREN.
3835         (_REG_EBRACE): Renamed from REG_EBRACE.
3836         (_REG_BADBR): Renamed from REG_BADBR.
3837         (_REG_ERANGE): Renamed from REG_ERANGE.
3838         (_REG_ESPACE): Renamed from REG_ESPACE.
3839         (_REG_BADRPT): Renamed from REG_BADRPT.
3840         (_REG_EEND): Renamed from REG_EEND.
3841         (_REG_ESIZE): Renamed from REG_ESIZE.
3842         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3843         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3844         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3845         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3846         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3847
3848         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3849         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3850         changed.  But support the old name if the new one is not defined
3851         and if _REGEX_SOURCE.
3852
3853         Change the following member names in struct re_pattern_buffer.
3854         The old names are still supported if !_REGEX_SOURCE.
3855         The new names are always supported, regardless of _REGEX_SOURCE.
3856         (re_buffer): Renamed from buffer.
3857         (re_allocated): Renamed from allocated.
3858         (re_used): Renamed from used.
3859         (re_syntax): Renamed from syntax.
3860         (re_fastmap): Renamed from fastmap.
3861         (re_translate): Renamed from translate.
3862         (re_can_be_null): Renamed from can_be_null.
3863         (re_regs_allocated): Renamed from regs_allocated.
3864         (re_fastmap_accurate): Renamed from fastmap_accurate.
3865         (re_no_sub): Renamed from no_sub.
3866         (re_not_bol): Renamed from not_bol.
3867         (re_not_eol): Renamed from not_eol.
3868         (re_newline_anchor): Renamed from newline_anchor.
3869
3870         Change the following member names in struct re_registers.
3871         The old names are still supported if !_REGEX_SOURCE.
3872         The new names are always supported, regardless of _REGEX_SOURCE.
3873         (rm_num_regs): Renamed from num_regs.
3874         (rm_start): Renamed from start.
3875         (rm_end): Renamed from end.
3876
3877         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3878         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3879         Prepend __ to parameter names.
3880
3881         Undo yesterday's changes.
3882
3883 2005-08-24  Jim Meyering  <jim@meyering.net>
3884
3885         Sync from coreutils.
3886         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3887
3888 2005-08-21  Bruno Haible  <bruno@clisp.org>
3889
3890         * lock.h: Add multiple inclusion guard.
3891         * tls.h: Add multiple inclusion guard.
3892
3893 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3894
3895         * regex.h (REG_NOSYS)
3896         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3897         Define, since POSIX requires it as of 2001.
3898         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3899         New private symbol, used to keep the enum signed in all cases.
3900         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3901         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3902
3903         * regex_internal.c (re_string_skip_chars, register_state):
3904         (calc_state_hash):
3905         Remove forward decls; no longer needed now that we use prototypes.
3906         * regexec.c (acquire_init_state_context, check_halt_node_context):
3907         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3908         (clean_state_log_if_needed): Likewise.
3909
3910 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3911
3912         Fix problems reported by Sam Steingold in
3913         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3914         * regexec.c (sift_states_bkref): Fix portability bug: the code
3915         assumed that reg_errcode_t is a signed type, which is not
3916         necessarily true if _XOPEN_SOURCE is not defined.
3917         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3918         some compilers warn about it otherwise.
3919
3920 2005-08-20  Jim Meyering  <jim@meyering.net>
3921
3922         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3923         of unused local, dfa.
3924
3925 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3926
3927         * regcomp.c (create_initial_state): Remove duplicate decl.
3928         (init_word_char, create_initial_state, duplicate_node_closure):
3929         (fetch_token, peek_token_bracket, build_range_exp):
3930         (build_collating_symbol): Remove forward decls; no longer needed
3931         now that we use prototypes.
3932
3933         * regcomp.c:
3934         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3935         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3936         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3937         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3938         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3939         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3940         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3941         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3942         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3943         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3944         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3945         (build_charclass, build_charclass_op, fetch_number, create_tree):
3946         (create_token_tree, mark_opt_subexp, duplicate_tree):
3947         Use prototypes rather than old-style definitions.
3948
3949         * regex_internal.c:
3950         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3951         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3952         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3953         (re_string_reconstruct, re_string_peek_byte_case):
3954         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3955         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3956         (re_node_set_init_copy, re_node_set_add_intersect):
3957         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3958         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3959         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3960         (re_acquire_state, re_acquire_state_context, register_state):
3961         (create_ci_newstate, create_cd_newstate, free_state):
3962         Likewise.
3963         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3964         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3965         (re_search_internal, prune_impossible_nodes):
3966         (acquire_init_state_context, check_matching, static):
3967         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3968         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3969         (update_regs, sift_states_backward, build_sifted_states):
3970         (clean_state_log_if_needed, merge_state_array):
3971         (update_cur_sifted_state, add_epsilon_src_nodes):
3972         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3973         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3974         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3975         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3976         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3977         (check_arrival, check_arrival_add_next_nodes):
3978         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3979         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3980         (check_node_accept_bytes, check_node_accept, extend_buffers):
3981         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3982         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3983         (sift_ctx_init):
3984         Likewise.
3985
3986         * regex_internal.h:
3987         (re_string_allocate, re_string_construct, re_string_reconstruct):
3988         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3989         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3990         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3991         (re_string_context_at, re_string_peek_byte_case):
3992         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3993         is defined, since we now use prototypes always.
3994
3995         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3996         C89 or better.  All uses removed.
3997
3998 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3999
4000         * regex_internal.c (re_acquire_state, re_acquire_state_context)
4001         [defined lint]: Suppress bogus uninitialized-variable warnings.
4002
4003         * regcomp.c (duplicate_node): Return new index, not an error code,
4004         and let the caller return REG_ESPACE if out of space.  This
4005         removes an uninitialied-variable warning with GCC 4.0.1, and also
4006         avoids taking the address of a local variable.  All callers
4007         changed.
4008
4009 2005-08-19  Jim Meyering  <jim@meyering.net>
4010
4011         * regexec.c (proceed_next_node): Redo local variables to
4012         avoid GCC shadowing warnings.
4013
4014 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4015
4016         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
4017         (re_node_set_insert_last, re_dfa_add_node):
4018         Rename local variables to avoid GCC shadowing warnings.
4019
4020 2005-08-18  Bruno Haible  <bruno@clisp.org>
4021
4022         * strstr.c (strstr): Fix return value in multibyte case.
4023         * strcasestr.c (strcasestr): Likewise.
4024
4025 2005-08-17  Jim Meyering  <jim@meyering.net>
4026
4027         Make the %s format (seconds since the epoch) work for a negative
4028         number and when used with a zero-padded field width, e.g. %015s.
4029
4030         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
4031         label so that it precedes the code to set `digits'.  Otherwise,
4032         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
4033         print `00-22'.  Now, it prints `-0022', as it should.
4034
4035 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4036
4037         * regex.h: Remove useless space-before-tab.  From coreutils.
4038
4039 2005-08-17  Bruno Haible  <bruno@clisp.org>
4040
4041         * strcasestr.h: New file.
4042         * strcasestr.c: New file.
4043
4044 2005-08-17  Bruno Haible  <bruno@clisp.org>
4045
4046         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4047         * strstr.c: Completely rewritten, with multibyte locale support.
4048
4049 2005-08-17  Bruno Haible  <bruno@clisp.org>
4050
4051         * strcasecmp.c: Use mbuiter.h.
4052
4053 2005-08-17  Bruno Haible  <bruno@clisp.org>
4054
4055         * mbuiter.h: New file.
4056
4057 2005-08-16  Bruno Haible  <bruno@clisp.org>
4058
4059         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4060         (mbi_init): Update.
4061         (mbi_avail, mbi_advance): Let the iteration end before the terminating
4062         NUL byte, not after it.
4063
4064 2005-08-16  Bruno Haible  <bruno@clisp.org>
4065
4066         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4067         the valid ones. Makes the comparison operations transitive:
4068         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4069         * strcasecmp.c (strcasecmp): Use mb_casecmp.
4070
4071 2005-08-16  Bruno Haible  <bruno@clisp.org>
4072
4073         * strcase.h (strcasecmp): Add note in comments.
4074         * strncasecmp.c: Use code from strcasecmp.c.
4075         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4076         (strcasecmp): Work correctly in multibyte locales.
4077
4078 2005-08-16  Bruno Haible  <bruno@clisp.org>
4079
4080         * strnlen1.h: New file.
4081         * strnlen1.c: New file.
4082
4083 2005-08-16  Bruno Haible  <bruno@clisp.org>
4084
4085         * mbfile.h: New file.
4086
4087 2005-08-16  Bruno Haible  <bruno@clisp.org>
4088
4089         * mbiter.h: New file.
4090
4091 2005-08-16  Bruno Haible  <bruno@clisp.org>
4092
4093         * mbchar.h: New file.
4094         * mbchar.c: New file.
4095
4096 2005-08-16  Bruno Haible  <bruno@clisp.org>
4097
4098         * tls.h: New file, from GNU gettext.
4099         * tls.c: New file, from GNU gettext.
4100
4101 2005-08-15  Bruno Haible  <bruno@clisp.org>
4102
4103         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4104         is defined.
4105
4106 2005-08-14  Jim Meyering  <jim@meyering.net>
4107
4108         Sync from coreutils.
4109
4110         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4111         Use the hash-table-based cycle-detection code not just when
4112         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4113         Reported by James Youngman in
4114         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4115         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4116         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4117         This lets us compile with -DFTS_DEBUG, once again.
4118         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4119         * fts.c (fd_safer): Remove decl.
4120         Include fcntl--.h rather than unistd-safer.h
4121         (fts_safe_changedir): Don't call fd_safer; no longer needed
4122         now that we include fcntl--.h.
4123
4124 2005-08-11  Simon Josefsson  <jas@extundo.com>
4125
4126         * readline.h, readline.c: New file.
4127
4128 2005-08-11  Bruno Haible  <bruno@clisp.org>
4129
4130         * strnlen.h (strnlen): Change parameter name to match comment.
4131
4132 2005-08-10  Simon Josefsson  <jas@extundo.com>
4133
4134         * strndup.c: Use strnlen.h.
4135
4136         * strnlen.h: New file.
4137
4138 2005-08-02  Simon Josefsson  <jas@extundo.com>
4139
4140         * getline.h, getline.c: Rewrite.
4141
4142         * getdelim.h, getdelim.c: New files, ported from glibc.
4143
4144 2005-07-31  Bruno Haible  <bruno@clisp.org>
4145
4146         * lock.h (gl_lock_initializer): New macro.
4147         (gl_lock_define_initialized): Use it.
4148         (gl_rwlock_initializer): New macro.
4149         (gl_rwlock_define_initialized): Use it.
4150         (gl_recursive_lock_initializer): New macro.
4151         (gl_recursive_lock_define_initialized): Use it.
4152
4153 2005-07-26  Bruno Haible  <bruno@clisp.org>
4154
4155         * lock.h: Update from GNU gettext.
4156         * lock.c: Update from GNU gettext.
4157
4158 2005-07-18  Bruno Haible  <bruno@clisp.org>
4159
4160         * lock.h (gl_once_t): New type.
4161         (gl_once_define, gl_once): New macros.
4162         * lock.c (fresh_once): New variable.
4163         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4164         functions.
4165
4166 2005-07-18  Simon Josefsson  <jas@extundo.com>
4167
4168         * check-version.c (check_version): Accept identical versions too.
4169
4170 2005-07-18  Bruno Haible  <bruno@clisp.org>
4171
4172         * lock.h: New file, from GNU gettext.
4173         * lock.c: New file, from GNU gettext.
4174
4175 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
4176
4177         * quotearg.c: Add translator comment suggested by Bruno Haible,
4178         with a minor change.
4179
4180 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4181
4182         * version-etc-fsf.c (version_etc_copyright): Parameterize the
4183         copyright symbol and the year.
4184         * version-etc.c (COPYRIGHT_YEAR): New constant.
4185         (version_etc_va): Use parameterized copyright notice.
4186         Reword to conform to the current GNU coding standards.
4187
4188 2005-07-11  Simon Josefsson  <jas@extundo.com>
4189
4190         * size_max.h: New file.
4191
4192 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4193
4194         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4195         block of defines.
4196
4197 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
4198        and  Paul Eggert  <eggert@cs.ucla.edu>
4199
4200         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4201         in wint_t, not wchar_t.  Remove now-unnecessary cast.
4202
4203 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4204
4205         * regex.c, regex.h: Sync from libc.
4206         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4207         New files, synced from libc, except that regex_internal.h
4208         currently has a small porting fix.
4209
4210 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
4211
4212         Remove the dependency of the strftime module on the tzset module.
4213         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4214         Copy the input structure, to work around some of the bug with
4215         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
4216         Solaris releases, you should also use the tzset module, but we won't
4217         require it as a dependency any more since we don't want LGPLed code
4218         to depend on GPLed code.
4219
4220 2005-07-02  Jim Meyering  <jim@meyering.net>
4221
4222         * backupfile.c (backup_args): Change a `0' to NULL.
4223
4224 2005-07-01  Jim Meyering  <jim@meyering.net>
4225
4226         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4227         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4228         * save-cwd.c, tempname.c:
4229         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4230         and don't include <sys/file.h>).
4231
4232 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4233
4234         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4235         declares only 'struct timespec;' (!).
4236
4237 2005-06-29  Jim Meyering  <jim@meyering.net>
4238
4239         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4240         type name.  Use the variable name instead.
4241         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4242
4243 2005-06-28  Simon Josefsson  <jas@extundo.com>
4244
4245         * check-version.h, check-version.c: New files.
4246
4247 2005-06-28  Simon Josefsson  <jas@extundo.com>
4248
4249         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4250         collision with global variable.  Better indentation.  Don't
4251         increment buffer pointer beyond buffer end.  Based on comments
4252         from Paul Eggert <eggert@cs.ucla.edu>.
4253
4254         * base64.h: Indent.
4255
4256 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4257
4258         * canon-host.c (canon-host): Append trailing "," to 0 in
4259         initializer of struct addrinfo, as an indication that we don't
4260         care how many members the structure has.
4261
4262 2005-06-24  Derek Price  <derek@ximbiot.com>
4263         and Bruno Haible  <bruno@clisp.org>
4264
4265         Remove stat module & update lstat.
4266         * stat.c: Remove this file...
4267         (slash_aware_lstat): ...moving this content and its support...
4268         * lstat.c (rpl_lstat): ...into here.
4269         * lstat.h: New file.
4270
4271 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4272
4273         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4274         (ranged_convert): Don't save conversion in a temporary struct.
4275         This causes a warning with GCC 4.0.0, and anyway in the typical
4276         case it's not worth the extra 100 bytes or so of code.
4277         (ranged_convert, __mktime_internal): When calling a function via a
4278         pointer P, use P () rather than (*P) (), as we now assume C89 or
4279         better.
4280
4281 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4282
4283         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4284         "who -r" failed to give output.  Problem reported by Tim Waugh.
4285
4286         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4287         (xcalloc): Use it to avoid needless tests.
4288         Problem reported by Jim Meyering.
4289
4290 2005-06-16  Jim Meyering  <jim@meyering.net>
4291
4292         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4293         when either N or S is zero.
4294
4295 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4296
4297         * argp.h (__option_is_short): Check upper limit of
4298         __key. Isprint() requires its argument to have the value
4299         of an unsigned char or EOF.
4300
4301 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4302
4303         * fnmatch.c (fnmatch): If there is an encoding error in a
4304         multibyte string or pattern, fall back on unibyte matching.
4305         Problem reported by James Youngman.
4306
4307 2005-06-08  Bruno Haible  <bruno@clisp.org>
4308
4309         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4310         warning on mingw.
4311
4312 2005-06-08  Bruno Haible  <bruno@clisp.org>
4313
4314         * csharpcomp.h: New file, from GNU gettext.
4315         * csharpcomp.c: New file, from GNU gettext.
4316         * csharpcomp.sh.in: New file, from GNU gettext.
4317
4318 2005-06-07  Derek Price  <derek@ximbiot.com>
4319
4320         Sync from CVS.
4321         * glob_.h: Indent nested #ifdef.
4322
4323 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4324
4325         Sync from coreutils.
4326         Use "file name" when talking about file names, instead of "filename"
4327         or "path", as per the GNU coding standards.
4328         * mkdir-p.c: Renamed from makepath.c.
4329         (make_dir_parents): Renamed from make_path.  All callers changed.
4330         * mkdir-p.h: Likewise.  All includers changed.
4331         * filenamecat.c: Renamed from path-concat.c.
4332         (file_name_concat): Renamed from path_concat.  All callers changed.
4333         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4334         * filenamecat.h: Likewise.  All includers changed.
4335         * acl.c: Don't use "path" or "filename" to mean "file name"
4336         in comments or local variable names.
4337         * basename.c: Likewise.
4338         * canonicalize.c, canonicalize.h: Likewise.
4339         * dirname.c, dirname.h: Likewise.
4340         * euidaccess.c: Likewise.
4341         * exclude.c: Likewise
4342         * fnmatch_.h, fnmatch_loop.c: Likewise.
4343         * fsusage.c, fsuage.h: Likewise.
4344         * fts.c, fts_.h: Likewise.
4345         * getcwd.c: Likewise.
4346         * getloadavg.c: Likewise.
4347         * mkstemp.c: Likewise.
4348         * mountlist.c, mountlist.h: Likewise.
4349         * openat.c, openat.h: Likewise.
4350         * readlink-stub.c: Likewise.
4351         * readutmp.c, readutmp.h: Likewise.
4352         * rename.c: Likewise.
4353         * rmdir.c: Likewise.
4354         * same.c: Likewise.
4355         * savedir.c: Likewise.
4356         * stripslash.c: Likewise.
4357         * tempname.c: Likewise.
4358         * xreadlink.c: Likewise.
4359         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4360         All uses changed.
4361         * exclude.h: Likewise.
4362
4363         * euidaccess.c (getuid, getgid, getuid, getegid)
4364         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4365         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4366         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4367         * pathmax.h: Include <limits.h> unconditionally, since other
4368         files have been getting away with it for years (MORE/BSD 4.3
4369         is extinct now).
4370         * userspec.c (getpwnam, getgrnam, getgrgid)
4371         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4372
4373         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4374         Define to 256, not 255, as per modern POSIX.
4375
4376 2005-06-01  Bruno Haible  <bruno@clisp.org>
4377
4378         * csharpexec.h: New file, from GNU gettext.
4379         * csharpexec.c: New file, from GNU gettext.
4380         * csharpexec.sh.in: New file, from GNU gettext.
4381
4382 2005-05-31  Derek Price  <derek@ximbiot.com>
4383             Paul Eggert  <eggert@cs.ucla.edu>
4384
4385         Sync from cvs.
4386         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4387
4388 2005-05-29  Derek Price  <derek@ximbiot.com>
4389             Paul Eggert  <eggert@cs.ucla.edu>
4390
4391         * glob_.h, glob.c: New files.
4392
4393 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4394
4395         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4396
4397         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4398         the configuration hassle isn't worth it.
4399         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4400         (LONGEST_MODIFIER, PRIuMAX): Remove.
4401
4402 2005-05-27  Bruno Haible  <bruno@clisp.org>
4403
4404         * getlogin_r.h: Remove second include of <stddef.h>.
4405
4406 2005-05-25  Bruno Haible  <bruno@clisp.org>
4407             Derek Price  <derek@ximbiot.com>
4408
4409         * getlogin_r.h: Simplify API documentation.
4410
4411 2005-05-25  Derek Price  <derek@ximbiot.com>
4412             Paul Eggert  <eggert@cs.ucla.edu>
4413
4414         * getlogin_r.c, getlogin_r.h: New files.
4415
4416 2005-05-22  Bruno Haible  <bruno@clisp.org>
4417
4418         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4419         Also include <sys/param.h> if it defines MIN, MAX.
4420         Based on a patch by Derek Price <derek@ximbiot.com>.
4421
4422 2005-05-22  Bruno Haible  <bruno@clisp.org>
4423
4424         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4425         (INT64_MIN): Fix definition.
4426         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4427
4428         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4429         NEED_SIGNED_INT_TYPES.
4430
4431         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4432         HAVE_SYSTEM_INTTYPES.
4433
4434 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4435
4436         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4437         so that unistd-safer.h (GPL'ed code) need not be included.
4438
4439 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4440
4441         New fts module.
4442         * fts.c: Don't include "cycle-check.h" or "hash.h".
4443         (setup_dir, free_dir): New functions.
4444         (enter_dir, leave_dir): Define trivial
4445         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4446         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4447         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4448         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4449         Move to fts-cycle.c.
4450         (fts_open): Use setup_dir.
4451         (fts_close): Use free_dir.
4452         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4453         This adds a label and some gotos, but the alternatives were messier.
4454         Check for memory allocation failure when entering a dir.
4455         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4456         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4457         (FTS): New member fts_cycle, that is a union that contains the
4458         old active_dir_ht and cycle_state.  All uses changed to mention
4459         fts_cycle.ht and fts_cycle.state.
4460         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4461         fts.c, with the following changes:
4462         (setup_dir, free_dir): New functions.
4463         (enter_dir): Now returns bool.  Return true if successful, false
4464         if memory exhausted.  All callers changed.
4465         Do not bother partly cleaning up on
4466         memory allocation failure; that is free_dir's job.
4467         However, free ad if hash_insert fails, to avoid memory leak.
4468         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4469         fts->fts_options to see which union member to use.
4470
4471 2005-05-20  Jim Meyering  <jim@meyering.net>
4472
4473         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4474         Now a macro, to pacify GCC.
4475
4476 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4477
4478         * chown.c (rpl_chown): Return -1 on failure.
4479
4480 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4481
4482         * canonicalize.c: Include canonicalize.h first, to test interface.
4483         Include <stddef.h> unconditionally, since we assume C89 now.
4484         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4485         * fts.c: Include fts_.h first, to check interface.
4486         Do not include intprops.h; no longer needed.
4487         Include cycle-check.h and hash.h, since fts_.h no longer does.
4488         Remove unnecessary casts of closedir to void.
4489         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4490         decide whether to decrement nlinks.
4491         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4492         (FTS): Use struct hash_table * instead of Hash_table, so that
4493         we no longer need to include hash.h here.
4494
4495 2005-05-17  Jim Meyering  <jim@meyering.net>
4496
4497         * fts.c, fts_.h: New files, from coreutils.
4498
4499 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4500
4501         Sync from coreutils.
4502         * unlinkdir.c, unlinkdir.h: New files.
4503         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4504         regex.h, unlocked-io.h, xtime.h:
4505         White space changes only.
4506         * makepath.c (make_path): Port to hosts where leading "//" is special.
4507         * yesno.c: Include getline.h, not ctype.h.
4508         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4509         Use getline to remove arbitrary restriction on response length.
4510
4511 2005-05-13  Bruno Haible  <bruno@clisp.org>
4512
4513         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4514         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4515         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4516         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4517         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4518         Add support for 64-bit integers in the MSVC compiler.
4519
4520 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4521
4522         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4523         Change the initial comment to refer to GPL, not LGPL.
4524         gnulib-tool will change it to LGPL as needed.
4525
4526         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4527         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4528         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4529         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4530         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4531         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4532         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4533         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4534         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4535         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4536         concatpath.c, config.charset, copy-file.c, copy-file.h,
4537         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4538         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4539         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4540         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4541         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4542         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4543         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4544         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4545         full-read.c, full-read.h, full-write.c, full-write.h,
4546         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4547         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4548         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4549         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4550         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4551         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4552         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4553         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4554         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4555         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4556         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4557         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4558         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4559         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4560         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4561         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4562         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4563         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4564         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4565         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4566         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4567         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4568         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4569         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4570         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4571         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4572         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4573         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4574         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4575         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4576         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4577         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4578         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4579         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4580         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4581         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4582         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4583         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4584         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4585         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4586         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4587         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4588         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4589         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4590         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4591         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4592         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4593         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4594         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4595         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4596         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4597         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4598         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4599         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4600         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4601         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4602         Update FSF postal mail address.
4603
4604 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4605
4606         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4607         specified in ai_socktype. Fix invalid ai_protocol
4608         check. ai_protocol is usually set to 0 or depending on
4609         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4610         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4611         ai_socktype / ai_protocol in the returned addrinfo structure.
4612
4613 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4614             Bruno Haible  <bruno@clisp.org>
4615
4616         * inet_ntop.h: New file.
4617         * inet_ntop.c: New file, from glibc with modifications.
4618
4619 2005-05-08  Jim Meyering  <jim@meyering.net>
4620
4621         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4622
4623 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4624
4625         Merge from coreutils.  Among other things,
4626         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4627         * fd-safer.c: New file.
4628         * fcntl-safer.h, open-safer.c: Remove.
4629         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4630         * dup-safer.c: Include unistd-safer.h first.
4631         Don't include errno.h.
4632         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4633         * file-type.h: Don't assume invoker included sys/stat.h first.
4634         * file-type.c: Rely on file-type.h change.
4635         * getloadavg.c: Include unistd-safer.h.
4636         (getloadavg): Use safer open.
4637         * getusershell.c: Include "stdio-safer.h".
4638         (getusershell): Use safer fopen.
4639         * long-options.c (long_options): Use NULL rather than 0.
4640         * modechange.h (mode_free): Remove; all callers changed to invoke
4641         'free'.
4642         * modechange.c: Likewise.
4643         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4644         (MODE_DONE): New constant.
4645         (struct mode_change): Remove 'next' member.
4646         (make_node_op_equals): New function; like the old one of the
4647         same name, except it allocates an array.
4648         (mode_compile, mode_create_from_ref): Use it.
4649         (mode_compile): Allocate result as an array, not a linked list.
4650         Parse octal string ourself, so that we catch mistakes like "+0".
4651         (mode_adjust): Arg is an array, not a linked list.
4652         * modechange.c: Include stat-macros.h, xalloc.h.
4653         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4654         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4655         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4656         Remove.  This is now stat-macros.h's job.
4657         (talloc): Remove.  All callers replaced by xalloc, so that
4658         our invokers don't have to worry about reporting memory failures.
4659         (make_node_op_equals): Remove.
4660         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4661         New constants.
4662         (struct mode_change): Moved here from modechange.h.
4663         (mode_append_entry): Remove.
4664         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4665         apps to have incorrect behavior.  Use simpler algorithm for head
4666         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4667         Detect more invalid usages rather than having somewhat-random behavior.
4668         Don't insert an "a=" action, as that leads to incorrect behavior.
4669         (mode_compile, mode_create_from_ref): Return NULL on error instead
4670         of an enum, since now there's only one way to have an error.  All
4671         callers changed.
4672         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4673         at the correct time.  Simplify calculation of "+u" and its ilk.
4674         Don't mishandle "+X".
4675         (mode_free): Remove "register" and localize decls.
4676         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4677         (struct mode_change): Move to modechange.c; callers don't
4678         need to see this stuff.
4679         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4680         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4681         (mode_change, mode_adjust): Reflect the new signatures noted above.
4682         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4683         that might redefine system include files.
4684         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4685         (my_usleep): Use NULL rather than (void *) 0.
4686         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4687         Use siginterrupt to specify that system calls should be interrupted.
4688         (rpl_nanosleep): Move initialization of suspended closer to call of
4689         my_usleep.
4690         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4691         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4692         (desirable_utmp_entry): New function.
4693         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4694         using x2nrealloc, to simplify logic.
4695         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4696         size calculation.  Do not assume utmp file is a regular file.
4697         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4698         (READ_UTMP_CHECK_PIDS): New constant.
4699         * save-cwd.c: Include unistd-safer.h.
4700         (save_cwd): Use fd_safer.
4701         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4702         [!_LIBC] Include "stat-macros.h" instead.
4703         * unistd-safer.h (fd_safer): New decl.
4704
4705 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4706
4707         * byteswap_.h: New file.
4708
4709 2005-04-25  Albert Chin  <china@thewrittenword.com>
4710
4711         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4712         Toolkit C bug.
4713
4714 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4715
4716         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4717         that "UTC +1 second" continues to work.  Problem reported
4718         by Dmitry V. Levin.
4719         (relunit_snumber): New rule.
4720         (relunit): Use it.
4721
4722 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4723
4724         * getdate.y (universal_time_zone_table): New constant.
4725         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4726         universal_time_zone_table.
4727         (lookup_zone): Prefer universal_time_zone_table to
4728         local_time_zone_table, so that "GMT" time stamps are allowed in
4729         London during the summer.  Problem reported by Ian Abbott.
4730
4731 2005-04-12  Jim Meyering  <jim@meyering.net>
4732
4733         * human.c (humblock): Set *options even when returning due to
4734         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4735         warning from gcc-4.
4736
4737 2005-04-09  Jim Meyering  <jim@meyering.net>
4738
4739         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4740         -Wuninitialized: initialize tm0.tm_year.
4741
4742 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4743
4744         * getdate.y (parser_control): rels_seen is now a boolean, not a
4745         count, since there's no maximum.  All uses changed.
4746         Add member dsts_seen.
4747         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4748         not being INT_MAX.
4749         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4750         Use pc_rels_seen to decide whther a date is absolute.
4751
4752         * getdate.y (number): Don't overwrite year.
4753         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4754         check.
4755
4756 2005-04-02  Simon Josefsson  <jas@extundo.com>
4757
4758         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4759         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4760
4761 2005-03-27  Jim Meyering  <jim@meyering.net>
4762
4763         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4764
4765 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4766
4767         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4768         "one's complement" -> "ones' complement" in comment, as per Knuth.
4769         "value of type" -> "type or expression" in comment.
4770         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4771
4772 2005-03-26  Jim Meyering  <jim@meyering.net>
4773
4774         Comment nits.
4775         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4776         Correct typos: s/or/of/.
4777
4778 2005-03-23  Jim Meyering  <jim@meyering.net>
4779
4780         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4781
4782 2005-03-21  Jim Meyering  <jim@meyering.net>
4783
4784         Changes imported from coreutils.
4785
4786         * cycle-check.c: Don't include xalloc.h.
4787
4788         * path-concat.c: Don't include assert.h.
4789         (path_concat): Remove assertion that would have triggered
4790         for ABASE starting with more than one slash.
4791         Reported by Andreas Schwab.
4792
4793         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4794         properly when ABASE is an absolute file name.
4795         Correct the description of this function.
4796         Include <assert.h>.
4797         Add an assertion and a test driver.
4798         This fixes a bug introduced on 2004-07-02.
4799         Andreas Schwab reported the resulting failure of cp --parents:
4800         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4801
4802 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4803
4804         * strftime.c (my_strftime): If the underlying strftime returns 0
4805         (which shouldn't happen), generate nothing instead of returning 0
4806         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4807
4808 2005-03-16  Bruno Haible  <bruno@clisp.org>
4809
4810         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4811
4812 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4813
4814         * strftime.c (my_strftime): Prepend space to format so that we can
4815         reliably distinguish strftime failure from empty output on POSIX
4816         hosts.
4817
4818 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4819
4820         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4821         (iconv_string): Don't guess a size-zero buffer, as that might cause
4822         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4823         result would be 'too large', where 'too large' is (heuristically)
4824         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4825         overflow concerns.  This will prevent some unwanted malloc failures
4826         when the inputs are very large.
4827
4828 2005-03-15  Bruno Haible  <bruno@clisp.org>
4829
4830         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4831         'negate'.
4832
4833         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4834         variable.
4835
4836         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4837
4838 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4839
4840         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4841         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4842         intprops.h.
4843         * strtol.c: Likewise.
4844
4845 2005-03-14  Simon Josefsson  <jas@extundo.com>
4846
4847         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4848         <fx@gnu.org>.
4849
4850 2005-03-14  Jim Meyering  <jim@meyering.net>
4851
4852         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4853         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4854         to be nonzero so that we (and caller) can detect the difference
4855         between a valid zero-length expansion and an error return, even
4856         when the underlying strftime fails before writing anything into
4857         that location.
4858
4859 2005-03-10  Jim Meyering  <jim@meyering.net>
4860
4861         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4862         so that this module works on systems without fchdir.
4863
4864 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4865
4866         Factor int-properties macros into a single file, except for
4867         glibc-related files.
4868         * intprops.h: New file.
4869         * getloadavg.c: Include it instead of limits.h.
4870         (INT_STRLEN_BOUND): Remove.
4871         * human.c: Include intprops.h.
4872         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4873         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4874         * inttostr.h: Include intprops.h instead of limits.h.
4875         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4876         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4877         for consistency with intprops.h.
4878         (time_t_is_integer, twos_complement_arithmetic): Use them.
4879         * sig2str.h: Include <signal.h>, intprops.h.
4880         (INT_STRLEN_BOUND): Remove.
4881         * strftime.c (TYPE_SIGNED): Remove.
4882         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4883         * strtol.c: Adjust comments to match intprops.h.
4884         * userspec.c: Include intprops.h.
4885         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4886         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4887         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4888         instead of rolling our own expressions.
4889         * xstrtol.c: Include xstrtol.h first, to test interface.
4890
4891         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4892         instead of int.
4893         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4894         the right thing even if adding 1900 would overflow.  Similarly
4895         for tm_mon + 1 and tm_yday + 1.
4896         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4897         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4898         (DO_SIGNED_NUMBER): New macro.
4899         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4900
4901 2005-03-07  Bruno Haible  <bruno@clisp.org>
4902
4903         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4904
4905 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4906             Bruno Haible  <bruno@clisp.org>
4907
4908         * pagealign_alloc.h: New file.
4909         * pagealign_alloc.c: New file.
4910
4911 2005-01-28  Bruno Haible  <bruno@clisp.org>
4912
4913         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4914         stpncpy.c uses it.
4915
4916 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4917
4918         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4919         The workaround isn't strictly needed for POSIX conformance, and
4920         it's too much of a pain to configure and maintain.  We'll ask
4921         people to fix their kernels instead.
4922         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4923         (NANOSLEEP_BUG_WORKAROUND): Remove.
4924         (xnanosleep): Remove the workaround.
4925
4926 2005-02-12  Bruno Haible  <bruno@clisp.org>
4927
4928         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4929
4930 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4931
4932         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4933         * timespec.h (gettime): Return void, since it always
4934         succeeds now.  All uses changed.
4935         * gettime.c (gettime) Likewise.
4936         [HAVE_NANOTIME]: Prefer nanotime.
4937         Assume gettimeofday succeeds, as POSIX requires.
4938         Assime time () succeeds, since other code already does.
4939         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4940         (timespec_subtract): Remove.
4941         (NANOSLEEP_BUG_WORKAROUND): New constant.
4942         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4943         things considerably.  Use it only on GNU/Linux hosts, since the
4944         workaround shouldn't be needed elsewhere.
4945
4946 2005-02-24  Bruno Haible  <bruno@clisp.org>
4947
4948         * gettext.h: Update from GNU gettext 0.14.2.
4949
4950 2005-02-24  Bruno Haible  <bruno@clisp.org>
4951
4952         * localcharset.c: Update from GNU gettext 0.14.2.
4953         * config.charset: Update from GNU gettext 0.14.2.
4954
4955 2005-02-22  Simon Josefsson  <jas@extundo.com>
4956
4957         * iconvme.h, iconvme.c: New files, from libc.
4958
4959 2005-02-20  Neil Conway  <neilc@samurai.com>
4960
4961         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4962         returned by OSX/Darwin if the specified buffer is not large
4963         enough for the hostname.
4964
4965 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4966
4967         * memrchr.h: New file.
4968         * chdir-long.c: Include it.
4969         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4970         Don't bother including stddef.h.
4971
4972 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4973
4974         * argp-help.c (__argp_help): Create a fake struct argp_state and
4975         pass it to _help, otherwise the latter coredumps trying to
4976         dereference state.root_argp.
4977
4978 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4979
4980         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4981         inclusion.
4982         Include <sys/types.h>, for dev_t.
4983         (ME_DUMMY, ME_REMOTE): Move from here....
4984         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4985         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4986         Dmitry V. Levin.
4987         Include mountlist.h first, to test the interface.
4988
4989 2005-01-29  Bruno Haible  <bruno@clisp.org>
4990
4991         * progname.c (program_name): Initialize.
4992         Needed when linking statically on MacOS X.
4993
4994 2005-01-28  Bruno Haible  <bruno@clisp.org>
4995
4996         * javacomp.sh.in: New file, from GNU gettext.
4997         * javacomp.h: New file, from GNU gettext.
4998         * javacomp.c: New file, from GNU gettext.
4999
5000 2005-01-26  Bruno Haible  <bruno@clisp.org>
5001
5002         * javaexec.sh.in: New file, from GNU gettext.
5003         * javaexec.h: New file, from GNU gettext.
5004         * javaexec.c: New file, from GNU gettext.
5005
5006 2005-01-26  Simon Josefsson  <jas@extundo.com>
5007
5008         * gai_strerror.c: Use GPL in header.
5009
5010 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5011
5012         * argp-help.c (hol_entry_help): Avoid using non-constant
5013         initializers for struct pentry_state.
5014         (__argp_error): Check return value of __asprintf
5015         (__argp_failure): Translate error message
5016
5017         * argp-parse.c: Removed braces around the expansion of N_()
5018
5019 2005-01-21  Jim Meyering  <jim@meyering.net>
5020
5021         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
5022         same value as for Solaris 9.
5023
5024         * chdir-long.c (chdir_long): Rewrite to remove limitation on
5025         component length.  This included changing the parameter to be
5026         of type `char *' rather than `char const *'.
5027         * chdir-long.h (chdir_long): Update prototype.
5028
5029         * openat.c (fdopendir, fstatat): New functions.
5030         * openat.h: Include headers required for use of DIR and struct stat.
5031         [AT_SYMLINK_NOFOLLOW]: Define.
5032         (fdopendir, fstatat): Add prototypes.
5033
5034 2005-01-21  Bruno Haible  <bruno@clisp.org>
5035
5036         * classpath.h: New file, from GNU gettext.
5037         * classpath.c: New file, from GNU gettext.
5038
5039 2005-01-20  Simon Josefsson  <jas@extundo.com>
5040
5041         * version-etc-fsf.c: New file, with version_etc_copyright.
5042         * version-etc.c: Remove version_etc_copyright.
5043         * version-etc.h (version_etc_copyright): Use [] instead of * in
5044         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5045
5046 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
5047
5048         * save-cwd.c (save_cwd): Remove code to support the case
5049         where fchdir is missing or flaky.
5050
5051 2005-01-20  Simon Josefsson  <jas@extundo.com>
5052
5053         * base64.h (isbase64): Add.
5054
5055         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5056         using a unsigned prototype, don't inline.
5057         (base64_decode): Use it.
5058
5059 2005-01-19  Bruno Haible  <bruno@clisp.org>
5060
5061         * sh-quote.h: New file, from GNU gettext.
5062         * sh-quote.c: New file, from GNU gettext.
5063
5064 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
5065
5066         Merge changes from coreutils, as described below in several
5067         changelogs dated today.
5068
5069         * save-cwd.c: Include "save-cwd.h" before other include files.
5070         (O_DIRECTORY): Remove; not needed here, since "." must be
5071         a directory.  All uses removed.
5072         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
5073         universal on Suns, and we also need to test for IRIX.
5074         Revamp code to use 'if' rather than '#if'.
5075         Avoid unnecessary comparison of cwd->desc to 0.
5076
5077         * utimens.c (futimens): Robustify the previous patch, by checking
5078         for known valid error numbers rather than observed invalid ones.
5079
5080 2005-01-18  Jim Meyering  <jim@meyering.net>
5081
5082         * version-etc.c (version_etc_copyright): Update copyright date.
5083
5084         * utimens.c (futimens): Account for the fact that futimes
5085         can also fail with errno == ENOSYS or errno == ENOENT.
5086         Patch from Dmitry V. Levin.
5087
5088         Change the name of the robust chdir function from chdir to chdir_long.
5089         * save-cwd.c: Include chdir-long.h rather than chdir.h.
5090         (restore_cwd): Use chdir_long, not chdir.
5091         * chdir-long.c: Renamed from chdir.c.
5092         * chdir-long.h: Renamed from chdir.h.
5093         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5094         Hurd.
5095
5096 2005-01-18  Bob Proulx  <bob@proulx.com>
5097
5098         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5099         offsetof() macro construct to avoid compile failure with native HP-UX
5100         11.0 ANSI C compiler.
5101
5102 2005-01-06  Bruno Haible  <bruno@clisp.org>
5103
5104         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5105         because stpncpy.m4 takes care of it.
5106
5107 2004-01-24  Bruno Haible  <bruno@clisp.org>
5108
5109         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5110
5111 2003-10-09  Bruno Haible  <bruno@clisp.org>
5112
5113         * progreloc.c: Include xalloc.h instead of xmalloc.h.
5114
5115 2005-01-06  Bruno Haible  <bruno@clisp.org>
5116
5117         * fwriteerror.h (fwriteerror): Change specification to include fclose.
5118         * fwriteerror.c: Include <stdbool.h>.
5119         (fwriteerror): At the end, close the file stream. Record whether
5120         stdout was already closed.
5121
5122 2004-05-27  Bruno Haible  <bruno@clisp.org>
5123
5124         * execute.c (environ): Declare if needed.
5125         * pipe.c (environ): Likewise.
5126         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5127
5128 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
5129
5130         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5131         definitions to be after all include files, to avoid collisions.
5132         Problem reported by Bob Proulx.
5133
5134 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
5135
5136         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5137         not needed.  This removes a dependency on the gettext module.
5138         [defined _LIBC]: Do not include <libintl.h>; not needed.
5139
5140 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
5141
5142         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5143         HAVE_DECL_STRTOLD.
5144
5145 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
5146
5147         * argp-parse.c: Include <stddef.h>.
5148         (alignof, alignto): New macros.
5149         (parser_init): Don't assume that void * is aligned sufficiently
5150         for struct option.
5151
5152         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5153         need to extend the stack.
5154         (YYINITDEPTH): New macro, so that the initial stack isn't overly
5155         large.
5156
5157 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5158
5159         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5160
5161 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
5162
5163         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5164         Remove now-obsolete comment about AIX.
5165         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5166         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5167         (YYMAXDEPTH): New macro.
5168
5169 2004-12-18  Bruno Haible  <bruno@clisp.org>
5170
5171         * fatal-signal.c (fatal_signals): Make non-const.
5172         (init_fatal_signals): New function.
5173         (uninstall_handlers, install_handlers): Ignore signals that were set to
5174         SIG_IGN.
5175         (at_fatal_signal): Call init_fatal_signals.
5176         (init_fatal_signal_set): Likewise. Ignore signals that were set to
5177         SIG_IGN.
5178         Reported by Paul Eggert.
5179
5180 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
5181
5182         * getdate.y (textint): New member "negative".
5183         (time_zone_hhmm): New function.
5184         Expect 14 shift-reduce conflicts, not 13.
5185         (o_colon_minutes): New rule.
5186         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5187         (yylex): Set the "negative" member of signed numbers.
5188
5189 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
5190
5191         Changes imported from coreutils.
5192         * hard-locale.c: Assume <locale.h> exists.
5193         Include "strdup.h".
5194         (GLIBC_VERSION): New macro.
5195         (hard_locale): Assume setlocale exists.
5196         Rewrite to avoid #ifdef.
5197         Use strdup rather than malloc + strcpy.
5198         * human.c: Assume <locale.h> exists.
5199         (human_readable): Assume localeconv exists.
5200
5201 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5202
5203         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5204         convert T2, not T.  (Imported from libc.)
5205
5206 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5207
5208         * getcwd.c (is_ENAMETOOLONG): New macro.
5209         (__getcwd.c): Don't restore errno; glibc doesn't.
5210         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5211         first, falling back to our code only if its results look suspicious.
5212         Ensure that the resulting buffer is only as large as necessary.
5213
5214         * readutmp.c: Include readutmp.h first.
5215         Include <errno.h>, since readutmp.h no longer does that.
5216         * readutmp.h: Don't include <errno.h>,
5217         <sys/param.h>, <time.h>; not needed to establish interface.
5218         (errno): Remove decl.
5219         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5220         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5221         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5222
5223 2004-11-28  Simon Josefsson  <jas@extundo.com>
5224
5225         * base64.h, base64.c: New file.
5226
5227 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5228
5229         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5230
5231 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5232
5233         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5234         HP's ANSI C compiler.
5235         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5236         Declaring int functions causes warnings on some modern systems and
5237         shouldn't be needed to compile on ancient ones.
5238         * same.c (MIN) [defined MIN]: Don't define, since it's already
5239         defined.
5240
5241         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5242         with the following changes.
5243         (__set_errno): Parenthesize properly.
5244         Include <stdbool.h>.
5245         (MIN, MAX, MATCHING_INO): New macros.
5246         (__getcwd): Define with prototype, not K&R form.
5247         Use heuristics to allocate default buffer on stack if possible.
5248         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5249         behavior, and to avoid the PATH_MAX limit when computing
5250         ../../../../...
5251         Use MATCHING_INO to compare inode number to file.
5252         Check for arithmetic overflow in size calculations.
5253         Fix bug in reallocation of dot array that caused getcwd to fail
5254         on directories nested deeper than 75.
5255         Be more careful about saving errno on error.
5256         Do not use realloc; use only free+malloc, as this is a bit
5257         more flexible and avoids a needless copy operation.
5258         Do not inspect st_dev and st_ino for symbolic links; POSIX
5259         doesn't specify the latter.
5260         Check for closedir errors.
5261         Avoid needless casts.
5262         Use "#ifdef weak_alias" around weak_alias, to be like other
5263         glibc code.
5264         The following changes to getcwd.c have effect only when used in
5265         gnulib; they have no effect inside glibc proper.
5266         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5267         as alloca isn't used.
5268         (alloca, __alloca): Likewise.
5269         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5270         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5271         unconditionally, as gnulib assumes C89 or better.
5272         Do not include <sys/param.h>.
5273         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5274         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5275         better.
5276         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5277         Include <dirent.h> in a way that is compatible with modern Autoconf.
5278         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5279         New macros, if not already defined.
5280         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5281         Use "_LIBC", not "defined _LIBC", for consistency.
5282         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5283         a mempcpy module.
5284         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5285         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5286         * xgetcwd.c: David MacKenzie's old code was removed, so give
5287         credit only to Jim Meyering and adjust the copyright dates.
5288         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5289         <stdlib.h>, <unistd.h>, "pathmax.h".
5290         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5291         (INITIAL_BUFFER_SIZE): Remove.
5292         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5293
5294 2004-11-23  Jim Meyering  <jim@meyering.net>
5295
5296         * getopt_.h: Remove trailing blanks.
5297
5298 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5299
5300         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5301         (futimens): New function, which uses futimes if available.
5302         (futimens, utimens): Support timespec==NULL, with same semantics
5303         as utime and utimens.
5304         * utimens.h (futimens): New decl.
5305
5306 2004-11-23  Jim Meyering  <jim@meyering.net>
5307
5308         * __fpending.c: Add comment.
5309
5310 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5311
5312         * getopt_.h: Re-addition of __getopt_argv_const caused
5313         redefinition warnings. To avoid them, include the defines
5314         in `#if !defined __need_getopt ... #endif'. The only place
5315         where __getopt_argv_const is used is in definitions
5316         of getopt_long and getopt_long_only below, which are as well
5317         protected by `#ifndef __need_getopt'.
5318         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5319         __need_getopt after including <stdio.h> and <unistd.h> These
5320         headers might have defined it.
5321
5322 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5323
5324         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5325         New macros.
5326         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5327         optopt): Use them instead of invoking ## directly; otherwise, the
5328         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5329
5330 2004-11-19  Bruno Haible  <bruno@clisp.org>
5331
5332         * strtok_r.c: Move comments from here...
5333         * strtok_r.h: ... to here.
5334
5335 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5336
5337         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5338         might fail.  Problem reported by Yoann Vandoorselaere.
5339         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5340         that mishandle size_t overflow.
5341
5342 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5343
5344         * canon-host.c: Include "strdup.h".
5345         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5346         Use strdup instead of malloc/strcpy to duplicate strings.
5347
5348         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5349         (human_space_before_unit): New constant.
5350         * human.c (human_readable): Support it.
5351
5352         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5353         (xgetcwd): Set errno correctly when failing.
5354         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5355         the failure is actually due to a PATH_MAX problem.
5356
5357         Further getopt changes to make it more likely that glibc will
5358         buy the changes back.
5359         * getopt.c (POSIXLY_CORRECT): New constant.
5360         (getopt): Use it, so to preserve glibc semantic
5361         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5362         when compiling for libc.
5363         * getopt_.h (__getopt_argv_const): Bring it back.
5364         (getopt_long, getopt_long_only): Use it.
5365
5366         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5367         New arg POSIXLY_CORRECT.  All callers changed.
5368         (getopt): Argv is now char * const *, as per standard.
5369         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5370         not char *__getopt_argv_const *.
5371         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5372         _getopt_long_only_r): Likewise.
5373         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5374         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5375         _getopt_long_r, _getopt_long_only_r): Likewise.
5376         * getopt_.h (__getopt_argv_const): Remove.
5377         (getopt): Argv is now char * const *, as per standard.
5378
5379         * getdate.y (tORDINAL): New token.
5380         (day, relunit): Allow it for relative times.
5381         (relative_time_table): Use tORDINAL for ordinals.
5382
5383 2004-11-15  Jim Meyering  <jim@meyering.net>
5384
5385         * closeout.c: Include "__fpending.h" once again.
5386         Include <stdbool.h>.
5387         (close_stdout): Don't fail just because stdout was closed initially,
5388         since some programs don't write to stdout in the normal course of
5389         operation (other than --version and --help), and we don't want this
5390         function to make e.g. `touch file >&-' fail.
5391         But do fail if it was closed and someone has tried to write to it.
5392         E.g., `printf foo >&-' must fail.
5393
5394 2004-11-11  Simon Josefsson  <jas@extundo.com>
5395
5396         * strtok_r.h, strtok_r.c: New file.
5397
5398 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5399
5400         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5401         we can stop lying to compilers about the constness of argv when we
5402         are compiled outside glibc.
5403         (getopt, getopt_long, getopt_long_only): Use it.
5404         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5405         getopt): Likewise.
5406         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5407         _getopt_long_only_r): Likewise.
5408         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5409         _getopt_long_only_r): Likewise.
5410
5411         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5412         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5413         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5414         the other external symbols.
5415         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5416         declaration, since the above renaming now works around collisions.
5417
5418 2004-11-11  Jim Meyering  <jim@meyering.net>
5419
5420         * linebreak.c: Remove trailing blanks.
5421         * alloca_.h: Likewise.
5422         * acosl.c: Likewise.
5423         * euidaccess.c: Likewise.
5424         * allocsa.h: Likewise.
5425
5426 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5427
5428         * mktime.c (SHR): New macro, which is a portable
5429         substitute for >> that should work even on Crays.
5430         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5431         Problem reported by Mark D. Baushke in
5432         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5433         * getdate.y (SHR): Likewise.
5434         (tm_diff): Use it.
5435         * strftime.c (SHR): Likewise.
5436         (tm_diff): Use it.
5437         * quotearg.c (struct quoting_options): Use unsigned int for
5438         quote_these_too, so that right shifts are well defined.  All uses
5439         changed.
5440
5441 2004-11-10  Simon Josefsson  <jas@extundo.com>
5442
5443         * getaddrinfo.h, getaddrinfo.c: New files.
5444
5445 2004-11-10  Jim Meyering  <jim@meyering.net>
5446
5447         Ensure that no close failure goes unreported.
5448         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5449         return early when it seems there's nothing to flush.
5450         Don't include __fpending.h.
5451
5452 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5453
5454         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5455
5456 2004-11-05  Bruno Haible  <bruno@clisp.org>
5457
5458         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5459         Reported by Mark D. Baushke <mdb@cvshome.org>.
5460
5461 2004-11-04  Bruno Haible  <bruno@clisp.org>
5462
5463         2004-09-11  Bruno Haible  <bruno@clisp.org>
5464                 * allocsa.valgrind: New file.
5465         2004-02-06  Bruno Haible  <bruno@clisp.org>
5466                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5467                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5468                 Reported by Christopher Seip <chris.seip@hp.com>.
5469
5470 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5471
5472         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5473         with errno == ERANGE if the buffer is too small.
5474         Problem reported by Mark D. Baushke.
5475
5476 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5477
5478         * xreadlink.c (MAXSIZE): New macro.
5479         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5480         size does not exceed MAXSIZE.  Avoid cast.
5481         As suggested by Mark D. Baushke in
5482         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5483         if readlink fails with buffer size just under MAXSIZE, try again
5484         with MAXSIZE.
5485
5486 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5487         and  Paul Eggert  <eggert@cs.ucla.edu>
5488
5489         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5490         (get_date): Overparenthesize to avoid GCC warning.
5491
5492 2004-11-02  Bruno Haible  <bruno@clisp.org>
5493
5494         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5495         function returns void.
5496
5497 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5498
5499         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5500         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5501         already declared.
5502
5503 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5504
5505         * getdate.y: Add support for TZ="foo" within a date string.
5506         Fix some bugs near time_t boundaries.  Reject dates with
5507         out-of-range components, e.g., "Sept 31".
5508         Include <stdlib.h>, "setenv.h", "xalloc.h".
5509         (ISDIGIT_LOCALE): Remove; unused.
5510         Note that the TZ and time functions used here are not reentrant.
5511         (mktime_ok, get_tz): New functions.
5512         (TZBUFSIZE): New constant.
5513         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5514         This requires that we sometimes generate our own TZ="XXX..." setting.
5515
5516 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5517
5518         * mktime.c (not_equal_tm): Remove redundant check.
5519
5520 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5521
5522         * getdate.y: Use Bison 1.875 features, and some minor
5523         code cleanups.  This change does not affect semantics.
5524         Don't include <stdlib.h>; no longer needed.
5525         Don't include unlocked-io.h; only the "#if TEST" code uses
5526         stdio, and performance isn't crucial there.
5527         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5528         Bison 1.875 features as described below.
5529         All uses of "PC." replaced by "pc->".
5530         (YYSTYPE): Add a forward declaration.
5531         (yylex, yyerror): Use full prototypes in forward decls.
5532         Use "%pure-parser" rather than obsolescent "%pure_parser".
5533         Use %parse-param and %lex-param instead of obsolescent
5534         YYPARSE_PARAM and YYLEX_PARAM.
5535         (meridian_table, month_and_day_table, time_units_table,
5536         relative_time_table, time_zone_table, military_table,
5537         lookup_zone, lookup_word, get_date):
5538         Use NULL instead of 0 where appropriate.
5539         (to_hour): Avoid abort (), to avoid a dependency on
5540         stdlib.h.
5541         (yyerror, yylex): Now accepts parser_control * arg.
5542         (main) [TEST]: Use '\0' rather than 0 for char.
5543
5544 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5545
5546         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5547         It's now the caller's responsibility to handle the case where
5548         !HAVE_GETPAGESIZE && !defined getpagesize.
5549
5550         * mktime.c (leapyear): Arg is long int, not int.
5551
5552 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5553
5554         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5555
5556 2004-10-12  Simon Josefsson  <jas@extundo.com>
5557
5558         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5559         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5560         to real functions.
5561
5562 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5563
5564         * vsnprintf.h: New file.
5565         * vsnprintf.c: New file.
5566
5567 2004-10-07  Bruno Haible  <bruno@clisp.org>
5568
5569         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5570         into the provided buffer.
5571
5572 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5573
5574         * diacrit.c, diacrit.h: Add GPL notice.
5575
5576         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5577         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5578         * logl.c (logl): Keep the code as similar to glibc as possible.
5579         This avoids a potential constant-folding bug.
5580
5581 2004-10-05  Bruno Haible  <bruno@clisp.org>
5582
5583         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5584
5585 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5586
5587         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5588         * xmalloc.c (xmemdup): Likewise.
5589         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5590         XFREE): Remove these long-obsolescent macros.
5591         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5592         * xstrdup.c: Remove.
5593
5594         * regex.c (re_comp): Cast gettext return value to char *,
5595         Problem reported by Martin Neitzel via Mark D. Baushke.
5596
5597 2004-10-04  Simon Josefsson  <jas@extundo.com>
5598
5599         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5600         '#ifdef USE_UNLOCKED_IO'.
5601
5602 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5603
5604         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5605         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5606         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5607         regex.c, sha1.c, version-etc.c, yesno.c:
5608         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5609         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5610         the includer's responsibility.
5611
5612         Sync from coreutils.
5613
5614         * modechange.c (mode_compile): Don't decrement a pointer that
5615         points to the start of a string, as the C Standard says the
5616         resulting behavior is undefined.
5617
5618         * backupfile.h (enum backuptype): Rename none -> no_backups,
5619         simple -> simple_backups, numbered_existing ->
5620         numbered_existing_backups, numbered -> numbered_backups
5621         to avoid shadowing problems.  All uses changed.
5622         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5623         * backupfile.c (check_extension, numbered_backup):
5624         Rename locals to avoid shadowing 'basename'.
5625         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5626         once.
5627
5628         * .cppi-disable: Add getopt_.h, getopt_int.h.
5629         * .cvsignore: Add getopt.h.
5630
5631 2004-10-04  Simon Josefsson  <jas@extundo.com>
5632
5633         * memmem.h: New file.
5634         * memmem.c: New file, taken from glibc.
5635
5636 2004-10-02  Jim Meyering  <jim@meyering.net>
5637
5638         * dirfd.h, getpagesize.h: Add copyright notice.
5639
5640 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5641
5642         * snprintf.c: Remove comments as to why each header is needed.
5643
5644 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5645
5646         * strsep.h: New file.
5647         * strsep.c: New file.
5648
5649 2004-10-01  Simon Josefsson  <jas@extundo.com>
5650
5651         * snprintf.c (snprintf): Handle size==0.
5652
5653 2004-10-01  Simon Josefsson  <jas@extundo.com>
5654             Bruno Haible  <bruno@clisp.org>
5655
5656         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5657         (snprintf): Declare 'args'.
5658
5659 2004-09-30  Simon Josefsson  <jas@extundo.com>
5660
5661         * snprintf.h, snprintf.c: New files.
5662
5663 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5664
5665         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5666         (hol_entry_help): Never translate an empty string.
5667         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5668         * argp.h (OPTION_NO_TRANS): New option.
5669
5670 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5671
5672         * xvasprintf.c: Include xalloc.h.
5673         (xvasprintf): Use xalloc_die, not xmalloc_die.
5674
5675 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5676
5677         * dummy.c: Change copyright notice to FSF, and license to GPL.
5678
5679 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5680
5681         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5682         Problem reported by Bruno Haible in:
5683         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5684
5685 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5686
5687         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5688         in case some system header has #define'd it.  Problem reported by
5689         Soeren D. Schulze in
5690         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5691
5692 2004-09-08  Bruno Haible  <bruno@clisp.org>
5693
5694         * stdint_.h: New file, taken from GNU clisp.
5695
5696 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5697
5698         * xvasprintf.h: New file.
5699         * xvasprintf.c: New file.
5700         * xasprintf.c: New file.
5701
5702 2004-09-08  Bruno Haible  <bruno@clisp.org>
5703
5704         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5705         is > INT_MAX.
5706         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5707
5708 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5709
5710         Import from coreutils.
5711         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5712         strings on unbounded length.  alloca's performance benefits aren't
5713         that important here.
5714         (V_STRDUP): Remove.
5715         (parse_with_separator): New function, with most of the internals
5716         of the old parse_user_spec.  Allow user to omit both user and group,
5717         for compatibility with FreeBSD.
5718         Clone only the user name, not the entire spec.
5719         Do not set *uid, *gid unless entirely successful.
5720         Avoid memory leak in some failing cases.
5721         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5722         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5723         (parse_user_spec): Rewrite to use parse_with_separator.
5724
5725 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5726
5727         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5728         its complicated substitute.
5729         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5730         and program_invocation_name.
5731         (__argp_basename) [!_LIBC]: Remove; the only use was
5732         replaced by its body.
5733         (__argp_short_program_name): Change condition from
5734         !defined __argp_short_program_name to
5735         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5736         to match argp-namefrob.h.
5737         (__argp_failure): Don't assume strerror_r returns char *.
5738         * argp-parse.c (N_): Define unconditionally.
5739         (argp_default_options): Fill out initializers with 0 to avoid
5740         gcc warnings.
5741
5742 2004-08-12  Simon Josefsson  <jas@extundo.com>
5743
5744         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5745         * getopt_.h: Renamed from getopt.h.
5746
5747 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5748
5749         Merge from coreutils.
5750
5751         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5752         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5753         for Reliant Unix 5.43.
5754
5755         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5756         (union fooround): Use uintmax_t, not long int.
5757         The rest is a merge from libc:
5758         [defined _LIBC]: Include <shlib-compat.h>.
5759         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5760
5761         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5762
5763         * strverscmp.c: Convert to UTF-8.
5764
5765 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5766
5767         * obstack.h (obstack_empty_p):
5768         Don't assume that chunk->contents is suitably aligned.
5769         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5770         Likewise. Problem reported by Benno in
5771         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5772
5773         * chown.c (rpl_chown): Work even if the file is writeable but not
5774         readable.  This could be improved further but it'd take some work.
5775
5776 2004-08-08  Simon Josefsson  <jas@extundo.com>
5777
5778         * xgethostname.c: Don't include error.h (not used).
5779
5780         * getpass.h: Add.
5781         * getpass.c: Include getpass.h first.
5782
5783 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5784
5785         * xalloc-die.c: New files.
5786         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5787         All uses removed.
5788         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5789         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5790         (_, N_, xalloc_die): Move to xalloc-die.c.
5791         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5792         so that we needn't mess with xalloc_msg_memory_exhausted.
5793
5794         * sha1.h: Renamed from sha.h.
5795         (SHA1_H): Renamed from _SHA_H.
5796         (sha1_ctx): Renamed from sha_ctx.
5797         (sha1_init_ctx): Renamed from sha_init_ctx.
5798         (sha1_process_block): Renamed from sha_process_block.
5799         (sha1_process_bytes): Renamed from sha_process_bytes.
5800         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5801         (sha1_read_ctx): Renamed from sha_read_ctx.
5802         (sha1_stream): Renamed from sha_stream.
5803         (sha1_buffer): Renamed from sha_buffer.
5804         * sha1.c: Likewise; renamed from sha.c.
5805         Do not include <sys/types.h>.
5806         Include <stddef.h> rather than <stdlib.h>.
5807
5808 2004-08-08  Bruno Haible  <bruno@clisp.org>
5809
5810         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5811         FILESYSTEM_PREFIX_LEN.
5812         * progreloc.c: Likewise.
5813         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5814
5815 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5816
5817         Merge from tar.
5818         * argp-help.c (make_hol, hol_append): Don't assume that
5819         SIZE_MAX is a valid preprocessor constant.
5820         (__argp_basename): Change from "#ifndef _LIBC"
5821         to "#ifndef __argp_short_program_name", so that
5822         we don't compile these functions for tar.
5823
5824         More merges from coreutils.
5825         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5826         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5827         yesno.h: New files.
5828         * addext.c: Remove; no longer needed.
5829         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5830         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5831         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5832         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5833         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5834         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5835         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5836         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5837         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5838         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5839         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5840         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5841         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5842         Import changes from coreutils.
5843
5844 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5845
5846         Merge from coreutils.
5847
5848         * .gdb-history: Remove; this doesn't belong here.
5849
5850         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5851         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5852         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5853
5854         * dirname.h: Include <stdbool.h>.
5855         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5856         for consistency with POSIX terminology.  All uses changed.
5857         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5858         (strip_trailing_slashes): Use bool for booleans.
5859         * stripslash.c (strip_trailing_slashes): Likewise.
5860
5861         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5862         sometimes returns a positive errno value even when it succeeds.
5863         (print_errno_message) [!LIBC]: Fall back on strerror if
5864         __strerror_r fails.
5865
5866         * path-concat.c (mempcpy): Don't define if a system header defines it.
5867         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5868         (longest_relative_suffix): New function.
5869         (path_concat): Use it.  Assume first argument is not NULL.
5870         Port to DOS.  Omit redundant separators.
5871         Report an error instead of returning NULL.
5872         Use mempcpy instead of memcpy.
5873         (xpath_concat): Remove: not declared or used.
5874
5875         * same.h: Include <stdbool.h>
5876         (same_name): Return bool, not int.
5877         * same.c (same_name): Likewise.
5878         (errno): Don't declare; we assume C89 or better now.
5879
5880         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5881         if not already defined.
5882
5883         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5884         * dup-safer.c (errno): Likewise.
5885
5886 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5887
5888         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5889         working.
5890
5891 2004-08-03  Simon Josefsson  <jas@extundo.com>
5892
5893         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5894         * progname.h: Don't include stdbool.h.
5895
5896 2004-08-02  Simon Josefsson  <jas@extundo.com>
5897
5898         * getsubopt.h: New file, with comments from Bruno Haible.
5899         * getsubopt.c: New file, from glibc, but slightly modified based on
5900         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5901
5902 2004-08-01  Simon Josefsson  <jas@extundo.com>
5903
5904         * xgetdomainname.c: Include stdlib.h, for free().
5905
5906 2004-07-16  Simon Josefsson  <jas@extundo.com>
5907
5908         * dummy.c: New file.
5909
5910 2004-07-16  Bruno Haible  <bruno@clisp.org>
5911
5912         * backupfile.h: Add extern "C" for C++.
5913         * closeout.h: Likewise.
5914         * copy-file.h: Likewise.
5915         * findprog.h: Likewise.
5916         * full-write.h: Likewise.
5917         * pathname.h: Likewise.
5918         * progname.h: Likewise.
5919         * stpcpy.h: Likewise.
5920         * stpncpy.h: Likewise.
5921         * strcase.h: Likewise.
5922         * strstr.h: Likewise.
5923         * xalloc.h: Likewise.
5924
5925         * mbswidth.h: Add extern "C" for C++.
5926         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5927
5928 2004-07-09  Simon Josefsson  <jas@extundo.com>
5929
5930         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5931         failed without this.)
5932
5933 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5934
5935         * fchown-stub.c: New file.
5936
5937 2004-06-24  Jim Meyering  <jim@meyering.net>
5938
5939         * obstack.h (obstack_base): Cast to (void *), per documentation.
5940
5941 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5942
5943         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5944
5945 2004-06-01  Jim Meyering  <jim@meyering.net>
5946
5947         * calloc.c: New file.
5948
5949 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5950
5951         * getdate.y (yylex): Allow space between sign and number.
5952         Problem reported by Dan Jacobson.
5953
5954 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5955         and  Jim Meyering  <jim@meyering.net>
5956
5957         Merge from coreutils CVS.
5958
5959         * stat-macros.h: New file, with contents from file-type.h
5960         and coreutils' system.h.
5961         * file-type.c: Include "stat-macros.h".
5962         * file-type.h (file_type): Move all macro definitions to new file,
5963         stat-macros.h.
5964
5965         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5966         Wrap old code with this conditional.
5967         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5968         function that does not dereference symlinks.
5969         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5970
5971         * xreadlink.c: Include xreadlink.h first, to catch .h file
5972         dependency problems.
5973         (xreadlink): Accept new arg SIZE, for efficiency.
5974         All decls and uses changed.
5975         * xreadlink.h: Include <stddef.h>, for size_t.
5976
5977         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5978         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5979
5980         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5981
5982 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5983
5984         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5985         macros to be defined.
5986         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5987         the allocator returns NULL because the requested size is zero.
5988
5989 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5990
5991         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5992         var.  Add comment explaining why libc still defines it.  This
5993         merges the following patch from glibc:
5994         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5995
5996 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5997
5998         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5999         present in glibc since revision 1.1 of this file.
6000         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
6001         obstack_alignment_mask, obstack_alloc, obstack_base,
6002         obstack_blank, obstack_blank_fast, obstack_chunk_size,
6003         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
6004         obstack_grow0, obstack_init, obstack_int_grow,
6005         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
6006         obstack_next_free, obstack_object_size, obstack_ptr_grow,
6007         obstack_ptr_grow_fast, obstack_room): Remove declarations of
6008         nonexistent functions.
6009
6010 2004-05-17  Derek R. Price  <derek@ximbiot.com>
6011             Paul Eggert  <eggert@cs.ucla.edu>
6012
6013         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
6014
6015 2004-05-14  Bruno Haible  <bruno@clisp.org>
6016
6017         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
6018         that consists of a '.' followed by an empty digit string.
6019         Patch by Tor Lillqvist <tml@iki.fi>.
6020
6021 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
6022
6023         Port obstack to the AS/400, where pointers are 16 bytes wide and
6024         you cannot cast an integer to a valid pointer.  This patch is
6025         currently waiting to be integrated into glibc; see
6026         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
6027
6028         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
6029         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
6030         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
6031         (struct obstack): temp member is now a union of a pointer and
6032         an integer, instead of an integer.  All integer uses changed.
6033         This does not affect the physical layout of struct obstack,
6034         except on hosts (like the AS/400) where the size or alignment of
6035         void * is greater than that of ptrdiff_t.
6036         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
6037         __STDC__)]: Store temporary in pointer member of union, not
6038         integer member.
6039         * obstack.c: Include <stddef.h>, for offsetof.
6040         (struct fooalign): Remove; it doesn't need a name.
6041         (union fooround): Change double to long double, and add void *.
6042         (DEFAULT_ALIGNMENT): Use offsetof to compute.
6043         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6044         not a macro.  Hence the values are always int; so remove all
6045         casts-to-int in uses.
6046
6047 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
6048             Derek Price  <derek@ximbiot.com>
6049
6050         * alloca.c: Include <alloca.h>, to get our interface.
6051         * alloca_.h: Use __alloca on AIX, so that we don't have to
6052         include <alloca.h> first.  Use C89 prototype for alloca; this
6053         requires including <stddef.h> for size_t.  Use extern "C" if C++.
6054         Use #elif for simplicity, since we can assume C89 now.
6055         Don't try to source the system alloca.h since it will not be found
6056         and to prevent recursively including its replacement.
6057         * fnmatch.c: Include <alloca.h> instead of opencoding.
6058         * regex.c: Likewise.
6059
6060 2004-05-16  Derek Price  <derek@ximbiot.com>
6061             Paul Eggert  <eggert@cs.ucla.edu>
6062
6063         getline cleanup.  This changes the getndelim2 API: both order of
6064         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6065         no delimiter).
6066
6067         * getline.c: Don't include stddef.h or stdio.h, since our
6068         interface does that.
6069         (getline): Always use getdelim, so that we don't have two
6070         copies of this code.
6071         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6072         if available.
6073         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6074         (GETNDELIM2_MAXIMUM): New macro.
6075         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
6076         instead of the old practice of delim2==0.  All callers changed.
6077         Return -1 on overflow, instead of returning junk.
6078         Do not set *linesize unless allocation succeeds.
6079         * getndelim2.h: Do not include stddef.h; no longer needed, now
6080         that we include sys/types.h.
6081         * getnline.h: Likewise.
6082         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6083         (getndelim2): Reorder arguments.
6084         * getnline.c (getnline, getndelim):
6085         Don't discard the NMAX argument.
6086         (getnline): Invoke getndelim, to avoid code duplication.
6087         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6088         of (size_t) -1 by callers of the getnline family.
6089
6090 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
6091
6092         * nanosleep.c (suspended): Change its type from int to
6093         sig_atomic_t volatile.
6094         (first_call): Make it private to rpl_nanosleep, and have it
6095         be zero initially as that's a bit faster.
6096         (my_usleep): Round up fractional times instead of truncating them,
6097         as this is the usual meaning for 'sleep'.
6098
6099         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6100         doesn't work.
6101         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6102         (ENOSYS): Define if not defined.
6103         (settime): Fall back on stime if it exists and settimeofday fails.
6104         But don't bother with fallbacks if a method fails with errno == EPERM.
6105
6106 2004-05-11  Jim Meyering  <jim@meyering.net>
6107
6108         Prior to this change, the save_cwd caller required read access to the
6109         current directory on most systems (ones with the fchdir function).
6110
6111         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6112         fails, try write-only, and finally, resort to using xgetcwd.
6113
6114 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
6115
6116         * obstack.c, obstack.h: Import changes from libc.
6117
6118 2004-04-28  Bruno Haible  <bruno@clisp.org>
6119
6120         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6121         implicitly appends .exe to executables.
6122         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6123         accepts Windows pathnames.
6124         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6125         Cygwin like Windows, since it now accepts Windows pathnames.
6126         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6127         Cygwin like Windows, since it now accepts Windows pathnames.
6128         Reported by Derek Robert Price <derek@ximbiot.com>.
6129
6130 2004-04-20  Jim Meyering  <jim@meyering.net>
6131
6132         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6133
6134 2004-04-20  Jim Meyering  <jim@meyering.net>
6135             Bruno Haible  <bruno@clisp.org>
6136
6137         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6138         memory when realloc fails.
6139
6140 2004-04-18  Jim Meyering  <jim@meyering.net>
6141
6142         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6143         don't leak memory and do call END_UTMP_ENT.
6144
6145 2004-04-11  Paul Eggert  <eggert@twinsun.com>
6146
6147         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6148         (CHAR_BIT): Remove, since we assume C89.
6149         Include <stdint.h> if available, as per current Autoconf CVS advice.
6150
6151 2004-03-30  Paul Eggert  <eggert@twinsun.com>
6152
6153         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6154         not bool, to be more consistent with Unix conventions.
6155         Suggested by Bruno Haible.
6156
6157         Merge from coreutils.
6158
6159         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6160         New files.
6161
6162         * getdate.h: Include stdbool.h, and timespec.h instead of
6163         the usual <time.h> dance.
6164         (get_date): Change signature to support fractional time stamps.
6165         All callers changed.
6166         * getdate.y: Include "getdate.h" first, as we can now
6167         assume C89 and don't need to worry about 'const'.
6168         Similarly, include "unlocked-io.h" near start, not in middle.
6169         Include <limits.h>.
6170         (textint.value): Use long int rather than int.
6171         (textint.digits): Use size_t rather than int.
6172         (BILLION, LOG10_BILLION): New constants.
6173         (parser_control): New member rel_ns.  Members day_ordinal,
6174         time_zone, month, day, hour, minutes, rel_year, rel_month,
6175         rel_day, rel_hour, rel_minutes, rel_seconds
6176         are now long int, not int.  Member seconds is now struct timespec,
6177         not int.  New member timespec_seen.  Members dates_seen, days_seen,
6178         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6179         not int.
6180         (%union.intval): Now long int, not int.
6181         New member timespec.
6182         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6183         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6184         (spec): Now is a timespec or an item list.
6185         (timespec, items): New nonterminals.
6186         (time, rel, relunit, number, get_date):
6187         Add support for fractional seconds.
6188         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6189         (gmtime, localtime, mktime): Remove decls; not needed with C89.
6190         (to_hour): First arg is now long int, not int.
6191         (to_year): Returns long int, not int.
6192         Don't treat year -70 like 70.
6193         (tm_diff): Returns long int, not int.
6194         (lookup_word): Use bool instead of int when appropriate.
6195         (yylex): Use size_t for count, not int.
6196         Detect overflow when parsing large integer constants.
6197         Add support for fractions.
6198         (get_date): Make pointers 'const' if possible.
6199         Use more-portable code to detect integer overflow.
6200         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
6201         Don't use ctime; it's not reliable if the year has >4 digits.
6202
6203         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6204         This is for compatibility with BSD.
6205
6206         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6207         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6208         From coreutils' system.h.
6209
6210         * userspec.c: Don't include "posixver.h".
6211         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6212         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6213         compatible extension.  Simplify code by removing a boolean int
6214         that was always nonzero if a string was nonnull.
6215
6216 2004-03-30  Jim Meyering  <jim@meyering.net>
6217
6218         Merge from coreutils.
6219
6220         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6221
6222         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6223         an empty input stream.
6224
6225         * readtokens.c: Include <stdbool.h>.
6226         (readtoken): Use `size_t' rather than int/long.
6227         All callers adjusted.
6228         Use `bool' rather than `int' where appropriate.
6229         Use memset rather than an explicit loop.
6230         Use x2nrealloc rather than xrealloc.
6231         Allow the use of `\0' as a delimiter.
6232         (readtokens): Likewise.
6233         * readtokens.h (readtoken, readtokens): Update prototypes.
6234
6235 2004-03-30  Bruno Haible  <bruno@clisp.org>
6236
6237         * getloadavg.c (getloadavg): Don't assume setlocale returns
6238         nonnull.
6239
6240 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6241
6242         Merge changes to getloadavg.c from coreutils and Emacs.
6243
6244         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6245         Define to an expression, not to the empty string.
6246         Include cloexec.h and xalloc.h.
6247         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6248         Use set_cloexec_flag rather than rolling our own.
6249         * cloexec.c, cloexec.h: New files.
6250
6251 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6252
6253         * getopt.h: Sync with libc CVS.
6254
6255 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6256             Bruno Haible  <bruno@clisp.org>
6257
6258         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6259         not on all platforms that have <wchar.h>.
6260         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6261
6262 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6263
6264         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6265         Sync with libc CVS.
6266         * getopt_int.h: New file, also synced from libc.
6267
6268 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6269
6270         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6271         '#if' expressions.  Unlike the code it replaces, it does not
6272         depend on (defined _SC_PAGESIZE).  However, it does depend on
6273         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6274         first reported by Jason Andrade in
6275         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6276
6277 2004-01-18  Simon Josefsson  <jas@extundo.com>
6278
6279         * strdup.h: New file.
6280         * strdup.c: Include it.
6281         * path-concat.c: Include strdup.h. Drop strdup declaration.
6282         * userspec.c: Include strdup.h. Drop strdup declaration.
6283
6284 2004-02-06  Karl Berry  <karl@gnu.org>
6285
6286         * config.charset: update from gettext 0.14.1.
6287
6288 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6289
6290         Add comments and code, prompted by suggestions from Bruno Haible
6291         for sh-quote.
6292         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6293         describing the enum quoting_style values.
6294         * quotearg.c (quotearg_alloc): New function.
6295         (quotearg_buffer_restyled): Treat lone { and } as special.
6296         Treat = as special.  Work around bug with older shells
6297         that "see" a '\' that is really the 2nd byte of a multibyte char.
6298         Quote empty string with shell_quoting_style.
6299
6300 2004-02-03  Bruno Haible  <bruno@clisp.org>
6301
6302         * pipe.h: New file, from GNU gettext.
6303         * pipe.c: New file, from GNU gettext.
6304
6305 2004-01-27  Bruno Haible  <bruno@clisp.org>
6306
6307         * execute.h: New file, from GNU gettext.
6308         * execute.c: New file, from GNU gettext.
6309         * w32spawn.h: New file, from GNU gettext.
6310
6311 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6312
6313         Exit-status fix from coreutils.
6314
6315         Use exit_failure consistently in place of EXIT_FAILURE,
6316         so that program exit statuses are consistent on failure.
6317
6318         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6319         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6320         * argmatch.h: Comment fix to match the above.
6321         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6322         Now a macro referring to exit_failure, instead of a separate
6323         variable.  Include "exitfail.h" to get it.
6324         * xstrtol.h: Include "exitfail.h".
6325         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6326
6327         * long-options.c (parse_long_options): Use prototype
6328         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6329         for clarity.
6330
6331 2004-01-21  Jim Meyering  <jim@meyering.net>
6332
6333         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6334         so as not to conflict with a different-sized __mktime_internal
6335         function in GNU libc.
6336         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6337         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6338
6339 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6340
6341         Merge from diffutils.
6342
6343         * file-type.c (file_type): Add typed memory objects.
6344         * file-type.h (S_TYPEISTMO): New macro.
6345
6346         * c-stack.h (c_stack_action): Remove argv argument.
6347         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6348         (die): Don't calculate message unless segv_action returns.
6349         (get_stack_location, min_address_from_argv, max_address_from_argv,
6350         volatile stack_base, volatile_stack_size): Remove.
6351         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6352         that every segmentation violation is a stack overflow.  (Ouch!)
6353         See Debian bug 136249 (still outstanding) for more info about why
6354         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6355
6356 2003-11-30  Bruno Haible  <bruno@clisp.org>
6357
6358         Safer stack allocation.
6359         * setenv.c: Include allocsa.h.
6360         (alloca): Remove fallback definition.
6361         (freea): Remove macro.
6362         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6363         instead of freea.
6364
6365 2003-10-17  Bruno Haible  <bruno@clisp.org>
6366
6367         * binary-io.h: Avoid warnings on Cygwin.
6368
6369 2003-12-28  Bruno Haible  <bruno@clisp.org>
6370
6371         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6372         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6373
6374 2003-11-28  Bruno Haible  <bruno@clisp.org>
6375
6376         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6377
6378 2003-11-27  Bruno Haible  <bruno@clisp.org>
6379
6380         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6381
6382 2003-11-17  Bruno Haible  <bruno@clisp.org>
6383
6384         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6385
6386 2003-11-24  Bruno Haible  <bruno@clisp.org>
6387
6388         * xallocsa.h: New file, from GNU gettext.
6389         * xallocsa.c: New file, from GNU gettext.
6390
6391 2003-11-24  Bruno Haible  <bruno@clisp.org>
6392
6393         * allocsa.h: New file, from GNU gettext.
6394         * allocsa.c: New file, from GNU gettext.
6395
6396 2003-11-24  Bruno Haible  <bruno@clisp.org>
6397
6398         * eealloc.h: New file.
6399
6400 2004-01-15  Jim Meyering  <jim@meyering.net>
6401
6402         Merge from coreutils.
6403
6404         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6405         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6406         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6407
6408         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6409         optional configure-time default.
6410
6411         * version-etc.c (version_etc_copyright): Update copyright date.
6412
6413         * xreadlink.c (xreadlink): Correct outdated comment.
6414
6415 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6416
6417         Merge from coreutils.
6418
6419         * posixver.c: Include posixver.h.
6420
6421         * same.c: Include <stdbool.h>, <limits.h>.
6422         (_POSIX_NAME_MAX): Define if not defined.
6423         (MIN): New macro.
6424         (same_name): If file names are silently truncated, report
6425         that the file names are the same if they are the same after
6426         the silent truncation.
6427
6428         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6429         conversion function.
6430         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6431         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6432         longer needed.
6433
6434 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6435
6436         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6437         with like-named macro in fnmatch.c.
6438         (EXT): Use an internal constant instead.
6439
6440         Merge fnmatch patches from glibc.
6441         * fnmatch.c (mbsinit): Remove define.
6442         Add libc_hidden_ver (__fnmatch, fnmatch).
6443         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6444         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6445
6446 2003-12-14  Karl Berry  <karl@gnu.org>
6447
6448         * config.charset: update from gettext-runtime.
6449
6450 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6451
6452         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6453         Bug reported by Alfred M. Szmidt.
6454
6455 2003-11-29  Karl Berry  <karl@gnu.org>
6456
6457         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6458
6459 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6460             Bruno Haible  <bruno@clisp.org>
6461
6462         * printf-parse.h: Don't include sys/types.h.
6463         (ARG_NONE): New macro.
6464         (char_directive): Change type of *arg_index fields to size_t.
6465         * printf-parse.c: Don't include sys/types.h.
6466         (SSIZE_MAX): Remove macro.
6467         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6468         Remove unnecessary overflow check.
6469         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6470         fields.
6471
6472 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6473
6474         * alloca.c: Remove dependency on xalloc module.
6475         (xalloc_die): Remove.
6476         (memory_full) [!defined emacs]: New macro.
6477         [!defined emacs]: Don't include xalloc.h.
6478         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6479         address arithmetic overflows.  Change datatypes a bit to avoid
6480         unnecessary casts.
6481
6482 2003-11-22  Jim Meyering  <jim@meyering.net>
6483
6484         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6485
6486 2003-11-17  Bruno Haible  <bruno@clisp.org>
6487
6488         * vasnprintf.c (alloca): Remove fallback definition.
6489         (freea): Remove definition.
6490         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6491         Reported by Paul Eggert.
6492
6493 2003-11-17  Jim Meyering  <jim@meyering.net>
6494
6495         On systems without utime and without a utimes function capable of
6496         dealing with a NULL struct utimbuf* argument, this utime replacement
6497         could -- in unusual circumstances -- leak a file descriptor.
6498         * utime.c: Include <unistd.h> and <errno.h>.
6499         (utime_null): Be sure to close `fd' and to preserve errno.
6500         Reported by Geoff Collyer via Arnold Robbins.
6501
6502 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6503             Bruno Haible  <bruno@clisp.org>
6504
6505         Protect against address arithmetic overflow.
6506         * printf-args.h: Include stddef.h.
6507         (arguments): Change type of field 'count' to size_t.
6508         * printf-args.c (printf_fetchargs): Use size_t instead of
6509         'unsigned int' where appropriate.
6510         * printf-parse.h: Include sys/types.h.
6511         (char_directive): Change type of *arg_index fields to ssize_t.
6512         (char_directives): Change type of fields 'count', max_*_length to
6513         size_t.
6514         * printf-parse.c: Include sys/types.h and xsize.h.
6515         (SSIZE_MAX): Define fallback value.
6516         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6517         instead of 'int' where appropriate. Check a_allocated, d_allocated
6518         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6519         * vasnprintf.c: Include xsize.h.
6520         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6521         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6522         overflow. Avoid wraparound when converting a width or precision from
6523         decimal to binary.
6524
6525 2003-11-16  Bruno Haible  <bruno@clisp.org>
6526
6527         Update from GNU gettext.
6528         * printf-parse.c: Generalize to it can be compiled for wide strings.
6529         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6530         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6531         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6532         SNPRINTF): New macros.
6533         Don't include <alloca.h> if the file is used inside libintl.
6534         (local_wcslen): New function, for Solaris 2.5.1.
6535         (VASNPRINTF): Use it instead of wcslen.
6536
6537 2003-11-16  Bruno Haible  <bruno@clisp.org>
6538
6539         * xsize.h (xmax): New function.
6540         (xsum, xsum3, xsum4): Declare as "pure" functions.
6541
6542 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6543
6544         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6545         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6546         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6547         heuristic is just as accurate as far as we know, and it removes a
6548         dependency on size_max.m4 and ptrdiff_max.m4.
6549
6550 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6551
6552         * xstrtol.c (__xstrtol): Remove "break" immediately after
6553         "return", to pacify some unknown compiler.  Problem reported
6554         by Joerg Schilling.
6555
6556 2003-11-11  Bruno Haible  <bruno@clisp.org>
6557
6558         * xsize.h (SIZE_MAX): Remove fallback definition.
6559         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6560         defined.
6561
6562 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6563
6564         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6565         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6566         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6567         From Bruno Haible.
6568         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6569         not (size_t) -1, since it's defined here.
6570
6571 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6572
6573         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6574         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6575         Reject sizes of exactly SIZE_MAX bytes.
6576         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6577         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6578
6579 2003-11-05  Bruno Haible  <bruno@clisp.org>
6580
6581         * xsize.h: Include limits.h, to avoid a possible collision with
6582         SIZE_MAX defined in <limits.h> on Solaris.
6583
6584 2003-11-04  Bruno Haible  <bruno@clisp.org>
6585
6586         * xsize.h: New file.
6587         * linebreak.c: Include xsize.h.
6588         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6589         argument for overflow.
6590         Suggested by Paul Eggert.
6591
6592 2003-10-31  Bruno Haible  <bruno@clisp.org>
6593
6594         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6595         to avoid (extremely rare) race condition.
6596         Suggested by Paul Eggert.
6597
6598 2003-11-03  Jim Meyering  <jim@meyering.net>
6599
6600         * userspec.c: Include "userspec.h".
6601         * userspec.h: New file.
6602
6603 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6604
6605         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6606         * mountlist.c (SIZE_MAX): Define if not defined already.
6607         (read_filesystem_list): Set and use me_type_malloced.
6608         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6609         whatever the type happens to be), for brevity and consistency.
6610         Check for size calculation overflow on Alphas running OSF/1.
6611
6612 2003-10-31  Jim Meyering  <jim@meyering.net>
6613
6614         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6615
6616         * linebuffer.c: Include <string.h> for declaration of memset.
6617
6618 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6619             Bruno Haible  <bruno@clisp.org>
6620
6621         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6622         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6623
6624 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6625
6626         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6627         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6628         no longer needed.
6629         * quotearg.c (quotearg_n_options): Use it.
6630         * group-member.c: Include <stdbool.h>.
6631         (free_group_info): Arg is now const *; don't free arg.
6632         (get_group_info): Now returns bool and accepts struct group_info *,
6633         rather than returning a malloc'ed struct group_info *.
6634         All uses changed.  Check for overflow in internal size calculation.
6635
6636         * getusershell.c (readname): Simplify the code by using x2nrealloc
6637         rather than xmalloc/xrealloc.
6638         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6639         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6640         conformance bug: the old code used a pointer after freeing the
6641         storage that it addressed.
6642         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6643         rather than doing it by hand.
6644         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6645         the buffer preserved.  Use free and xmalloc instead.
6646         * quotearg.c (quotearg_n_options): Likewise.
6647         Use a simpler test for size overflow.  Don't use xalloc_oversized
6648         because unsigned int might be wider than size_t (!); this suggests
6649         that we should switch from unsigned int to size_t for slot numbers.
6650
6651 2003-10-27  Bruno Haible  <bruno@clisp.org>
6652
6653         * stdbool_.h: Better support for BeOS.
6654
6655 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6656
6657         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6658         to allocate the returned structure.  Do not allocate a subarray,
6659         as x2nrealloc will do that.
6660         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6661         instead of xnrealloc.
6662         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6663
6664 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6665
6666         * xalloc.h (xalloc_oversized): New static inline function, for
6667         callers that want to do their own size-overflow checking.  Include
6668         <stdbool.h>, since xalloc_oversized returns bool.
6669         * xalloc.c (array_size_overflow): Remove.  All callers changed
6670         to use xalloc_oversized.
6671
6672         Add two functions x2realloc, x2nrealloc, for programs that grow
6673         arrays dynamically by doubling their sizes.
6674         * xalloc.h (x2realloc, x2nrealloc): New decls.
6675         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6676         New functions.
6677
6678         Port to C99 semantics for 'inline' of external functions.
6679         Bug reported by Bruno Haible.
6680         * xmalloc.c (xnmalloc_inline): New static inline function,
6681         with the old contents of xnmalloc.
6682         (xnmalloc, xmalloc): Use it.
6683         (xnrealloc_inline): New static inline function,
6684         with the old contents of xnrealloc.
6685         (xnrealloc, xrealloc): Use it.
6686
6687         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6688
6689 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6690
6691         Fix several address-calculation bugs in the hash modules,
6692         plus some minor code cleanup.
6693
6694         * hash.h: Include <stdbool.h>, for bool.
6695         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6696         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6697         hash_get_n_entries, hash_get_max_bucket_length,
6698         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6699         hash_rehash): Use size_t rather than unsigned.
6700         * hash.c (struct hash_table, hash_get_n_buckets,
6701         hash_get_n_buckets_used, hash_get_n_entries,
6702         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6703         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6704         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6705         Likewise.
6706         (SIZE_MAX): Define if not defined.
6707         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6708         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6709         hash_print):
6710         Use const * when possible.
6711         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6712         (check_tuning): Fix bug: if tuning parameters were very close to
6713         0 or 1, rounding errors could have caused subscript violations.
6714         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6715         (hash_initialize): Add 'fail:' label
6716         to free table and return NULL, and use it to simplify code.
6717         Use calloc rather than clearing the storage ourself.
6718         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6719         buffer size calculations.
6720         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6721         Include <stddef.h>, for size_t.
6722         * hash-pjw.c (hash_pjw): Likewise.
6723         Switch to method described by Bruno Haible.
6724         Include <limits.h>, for CHAR_BIT.
6725         (SIZE_BITS): New macro.
6726
6727 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6728
6729         * getndelim2.c (getndelim2): When size calculation overflows,
6730         ceiling the allocation at NMAX bytes rather than silently
6731         discarding input bytes before NMAX is reached.  This makes
6732         a difference only if NMAX exceeds SIZE_MAX / 2.
6733
6734         * obstack.c: Merge from glibc.
6735         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6736         Add libc_hidden_def (_obstack_newchunk).
6737         (_obstack_free) [! defined _LIBC]: Remove.
6738         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6739         a clone of the function body.
6740         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6741         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6742
6743         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6744         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6745         arg to memcpy.
6746
6747         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6748         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6749         Don't use lvalue casts, as GCC plans to remove support for them
6750         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6751         was also present in the non-GCC version, indicating that this
6752         code had always been buggy and had never been widely used.
6753         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6754         Use the fast variant of each macro, rather than copying the
6755         definiens of the fast variant; that way, we'll be more likely to
6756         catch future bugs in the fast variants.
6757
6758 2003-10-20  Bruno Haible  <bruno@clisp.org>
6759
6760         * wait-process.h: New file, from GNU gettext.
6761         * wait-process.c: New file, from GNU gettext.
6762
6763 2003-10-19  Jim Meyering  <jim@meyering.net>
6764
6765         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6766
6767 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6768
6769         * getgroups.c: Include <errno.h>, <stdlib.h>.
6770         (getgroups): First arg is int, not size_t.
6771         Don't let 'free' mangle errno.
6772
6773 2003-10-16  Jim Meyering  <jim@meyering.net>
6774
6775         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6776
6777 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6778
6779         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6780         (SIZE_MAX): Remove.
6781         (new_exclude, add_exclude_file): Initial size no longer needs to
6782         be a power of 2.
6783         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6784         our own address arithmetic overflow checking.
6785
6786         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6787         (fnmatch): Do not alloca more than 2000 wide characters;
6788         instead, use malloc for large buffers.
6789         Check for address arithmetic overflow, and return -1
6790         with errno set to ENOMEM in that case.
6791         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6792         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6793         instead, return -1.  Check for address arithmetic overflow.
6794
6795 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6796
6797         Handle invalid suffixes and overflow independently, so that
6798         callers can treat them independently as needed.  Fix some bugs in
6799         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6800         suffix for a human-readable blocksize.  The major caller-visible
6801         change is the addition of a new
6802         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6803         that both overflow and suffix chars were found.
6804
6805         * human.c (humblock): Don't check separately for invalid suffix
6806         char; that is xstrtoumax's job (now that its bug is fixed).
6807         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6808         INTMAX_MAX]: New macros.
6809         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6810         TYPE_MAXIMUM): New macros.
6811         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6812         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6813         if overflow occurs, as it's what __strtol does and it's more useful
6814         in practice.
6815         (__xstrtol): If __strtol reports some error other than ERANGE,
6816         reflect it to the caller as LONGINT_INVALID.  If it reports
6817         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6818         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6819         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6820         value.
6821         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6822         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6823         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6824         [defined UINTMAX_MAX]: New macros.
6825
6826 2003-10-14  Bruno Haible  <bruno@clisp.org>
6827
6828         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6829         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6830         Also use volatile where needed.
6831
6832 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6833
6834         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6835         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6836         and define in terms of the other primitives.
6837         * xmalloc.c: Include stdbool.h; do not include exit.h.
6838         (SIZE_MAX): Define if not already defined.
6839         (array_size_overflow): New function.
6840         (xalloc_die): Abort instead of exiting if 'error' returns.
6841         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6842         (xmalloc, xrealloc): Use them.
6843         (xcalloc): Check for address arithmetic overflow.
6844         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6845         a bit faster than strcpy.
6846
6847 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6848
6849         Merge getpass from libc, plus a few fixes.
6850
6851         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6852         Include <stdbool.h>.
6853         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6854         __fsetlocking to empty.
6855         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6856         do include <bits/libc-lock.h>.
6857         Do not include <fcntl.h>; not needed.
6858         [_LIBC]: Include <wchar.h>.
6859         (NOTCANCEL_MODE): New macro.
6860         (flockfile, funlockfile) [_LIBC]: New macros.
6861         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6862         [!_LIBC]: New macros.
6863         (call_fclose): New function.
6864         (getpass): Use it.  Save tty stream separately; this simplifies the
6865         code and makes it more reliable if stdin happens to equal stdout.
6866         Invoke __fsetlocking on tty.
6867         Handle thread cancellation if needed.
6868         Namespace cleanup (use __tcgetattr, __getline).
6869         Use bool for Booleans.
6870         [USE_IN_LIBIO]: Handle wide streams.
6871         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6872         stream might go where.
6873
6874         * unlocked-io.h: Include <stdio.h>, so that the caller
6875         doesn't have to include <stdio.h> before us.
6876         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6877         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6878         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6879         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6880         if not declared, so that we can use getpass.c code from libc without
6881         rewriting it.
6882         (flockfile, ftrylockfile, funlockfile): New macros.
6883
6884 2003-10-06  Bruno Haible  <bruno@clisp.org>
6885
6886         * version-etc-2.h: Remove file.
6887         * version-etc-2.c: Remove file.
6888
6889 2003-09-25  Jim Meyering  <jim@meyering.net>
6890             Bruno Haible  <bruno@clisp.org>
6891
6892         This lets translators provide better translations for the
6893         "Written by ..." part of --version output.
6894         * version-etc.h: Include stdarg.h.
6895         (version_etc_copyright): Declare as readonly.
6896         (version_etc): Make this function variadic with a NULL-terminated list
6897         of author name strings.
6898         (version_etc_va): New declaration.
6899         * version-etc.c: Include stdarg.h, stdlib.h.
6900         (version_etc_copyright): Declare as readonly.
6901         (version_etc_va): New function. Provide a different translatable string
6902         for each possible number of authors < 10. Abbreviate when there are 10
6903         authors or more.
6904         (version_etc): Make this function variadic. Call version_etc_va.
6905         Suggestion from Gary V. Vaughan.
6906
6907         * long-options.h (parse_long_options): Change prototype: the authors
6908         string is moved to the end and becomes variadic.
6909         * long-options.c: Include stdarg.h.
6910         (parse_long_options): Make this function variadic, too.
6911         Call version_etc_va, not version_etc.
6912
6913 2003-10-06  Bruno Haible  <bruno@clisp.org>
6914
6915         * fatal-signal.h: New file, from GNU gettext.
6916         * fatal-signal.c: New file, from GNU gettext.
6917
6918 2003-10-04  Karl Berry  <karl@gnu.org>
6919
6920         * argp*: update from libc.
6921
6922 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6923
6924         * getpass.c (getpass): Use a no-op fseek when switching from input to
6925         output mode on the same stream.
6926
6927 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6928
6929         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6930         Fix arg typo in previous patch.
6931
6932 2003-09-28  Jim Meyering  <jim@meyering.net>
6933
6934         * error.c: Correct cpp indentation.
6935
6936 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6937
6938         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6939         Omit the special code that used __typeof__, since we worry that
6940         it could be more trouble than it's worth.  See:
6941         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6942         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6943
6944         * free.c: New file.
6945
6946 2003-09-26  Jim Meyering  <jim@meyering.net>
6947
6948         * error.c (error_tail): Move some declarations
6949         into inner scope where the local variables are used.
6950
6951 2003-09-26  Bruno Haible  <bruno@clisp.org>
6952
6953         * stpncpy.h (gnu_stpncpy): New declaration.
6954         (stpncpy): Define as alias for gnu_stpncpy.
6955         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6956
6957 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6958
6959         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6960         (error_tail): Do not loop, reallocating temporary buffer, since
6961         the output cannot contain more wide characters than the input
6962         contains bytes, the size must be big enough already.  This avoids
6963         one potential size overflow calculation.  Check for size overflow
6964         when calculating temporary buffer size.  Free temporary buffer
6965         when done, if it was allocated with malloc; this plugs a memory
6966         leak.  Remove casts from void * to pointers, that are no longer
6967         needed now that we're assuming C89 or better.
6968
6969         Merge error changes from glibc.
6970
6971         * error.c, error.h: Update copyright notice header to match glibc.
6972         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6973         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6974         Disable cancellation while printing error.
6975         * error.h: Prepend __ to parameter names.
6976
6977 2003-09-25  Karl Berry  <karl@gnu.org>
6978
6979         * argp-fmtstream.c, argp-help.c: update from libc.
6980
6981 2003-09-25  Bruno Haible  <bruno@clisp.org>
6982
6983         * version-etc-2.h: New file, from version-etc.h with modifications.
6984         * version-etc-2.c: New file, from version-etc.c with modifications.
6985
6986 2003-09-25  Simon Josefsson  <jas@extundo.com>
6987
6988         * xgetdomainname.h: New file.
6989         * xgetdomainname.c: New file.
6990
6991 2003-09-25  Simon Josefsson  <jas@extundo.com>
6992             Bruno Haible  <bruno@clisp.org>
6993
6994         * getdomainname.h: New file.
6995         * getdomainname.c: New file.
6996
6997 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6998
6999         * linebuffer.c (freebuffer): Don't free the argument, just
7000         the buffer associated with the argument.  Bug reported by
7001         Simon Josefsson.
7002
7003 2003-09-19  Karl Berry  <karl@gnu.org>
7004
7005         * argp.h: update from libc.
7006
7007 2003-09-16  Paul Eggert  <eggert@twinsun.com>
7008
7009         * linebuffer.c (readlinebuffer): Return NULL immediately upon
7010         input error, instead of returning NULL the next time we are called
7011         (and therefore losing track of errno).
7012
7013 2003-09-15  Paul Eggert  <eggert@twinsun.com>
7014
7015         * getndelim2.c (getndelim2): Don't trash errno when a read
7016         fails, so that the caller gets the proper errno.
7017
7018         * readutmp.c (read_utmp): Likewise.
7019         Check for fstat error.  Close stream and free storage
7020         when failing.
7021
7022 2003-09-14  Bruno Haible  <bruno@clisp.org>
7023
7024         * fwriteerror.h: New file.
7025         * fwriteerror.c: New file.
7026
7027 2003-09-14  Jim Meyering  <jim@meyering.net>
7028
7029         * getloadavg.c: Correct cpp indentation.
7030         * strdup.c: Likewise.
7031         * vasnprintf.c: Likewise.
7032
7033 2003-09-12  Paul Eggert  <eggert@twinsun.com>
7034
7035         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
7036         * obstack.c [!defined _LIBC]: Likewise.
7037         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
7038         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
7039         * exitfail.c: Don't include stdlib.h; no longer needed.
7040
7041         More changes to assume C89 or better.
7042
7043         * error.c (error_tail): Assume vprintf.
7044
7045         * argmatch.c (getenv): Remove decl.
7046         * progreloc.c (get_full_program_name): Define via prototype.
7047         * setenv.c (clearenv): Likewise.
7048         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7049         needed.
7050         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7051         (malloc, memcpy): Remove decls.
7052         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7053         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7054         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7055         (memcpy): Remove macro.
7056         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7057         (__P): Remove.  All uses removed.
7058         (PTR): Remove.  All uses changed to void *.
7059         (CHAR_BIT, NULL): Remove.
7060         (spaces, zeros, memset_space, memset_zero)
7061         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7062         Remove.
7063         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7064         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7065         Define with prototype.
7066         Remove now-unnecessary prototype decl.
7067         (extra_args_spec): Assume ANSI C.  All uses changed.
7068         (extra_args_spec_iso): Remove.
7069         (my_strftime, emacs_strftimeu): Define via prototype.
7070         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7071         unconditionally.
7072         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7073         * strtoimax.c: Include <stdlib.h> unconditionally.
7074         (strtoul, strtol): Remove decls.
7075         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7076         LONG_MAX): Remove.
7077         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7078         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
7079         (LOCALE_PARAM_PROTO): New macro.
7080         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7081         (INTERNAL (strtol), strtol): Define with a prototype.
7082         (PARAMS): Remove.  All uses removed.
7083         * tempname.c: Include <string.h> unconditionally.
7084         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7085         * xgethostname.c (main): Define with a prototype.
7086         * xmalloc.c: Include "xalloc.h" first, to check interface.
7087         Include <stdlib.h> unconditionally.
7088         (calloc, malloc, realloc, free): Remove decls.
7089         * xstrtod.c: Include "xstrtod.h" first, to check interface.
7090         Include <stdlib.h> unconditionally.  Sort include file names.
7091         (strtod): Remove.
7092         (xstrtod): Define with a prototype.
7093         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7094         (strtol, strtoul): Remove decls.
7095
7096 2003-09-11  Paul Eggert  <eggert@twinsun.com>
7097
7098         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7099         Include <stdlib.h>, <string.h> unconditionally.
7100         Remove now-unnecessary cast to char *.
7101         * strnlen.c: Include <string.h> unconditionally.
7102         * yesno.c (yesno): Define with a prototype.
7103
7104 2003-09-10  Bruno Haible  <bruno@clisp.org>
7105
7106         * strcspn.c: Include <string.h> unconditionally.
7107         * strpbrk.c: Include <string.h> unconditionally.
7108         * strstr.c: Include <string.h> unconditionally.
7109         * unicodeio.c: Include <string.h> unconditionally.
7110         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7111         * unsetenv.c: Likewise.
7112         * xreadlink.c: Include <stdlib.h> unconditionally.
7113         * yesno.c: Include <stdlib.h> unconditionally.
7114         (rpmatch): Add prototype.
7115
7116 2003-09-10  Jim Meyering  <jim@meyering.net>
7117
7118         * error.c: Correct indentation of cpp directives.
7119
7120 2003-09-09  Paul Eggert  <eggert@twinsun.com>
7121
7122         More K&R removal.
7123
7124         * acosl.c (main): Use a prototype.
7125         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7126         tanl.c: Likewise.
7127
7128         * getloadavg.c (getloadavg, main): Define via prototypes.
7129
7130         * getopt.h (struct option.name): Assume C89, and use 'const'.
7131         (getopt, etopt_long, getopt_long_only, _getopt_internal)
7132         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7133         with a prototype.
7134         * getopt.c (const): Remove macro.
7135         Include <string.h> unconditionally.
7136         (my_index): Remove; all uses changed to strchr.
7137         (strlen): Remove decl.
7138         (exchange): Remove forward decl; no longer needed.
7139         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7140         Define with prototype.
7141         * getopt1.c (const): Remove macro.
7142         (getopt_long, getopt_long_only, main): Define with prototype.
7143
7144         * getugroups.c: Include <string.h> unconditionally.
7145
7146         * getusershell.c: Include <stdlib.h> unconditionally.
7147         (getusershell, setusershell, endusershell, readname, main):
7148         Define with prototypes.
7149
7150         * group-member.c: Include group-member.h first.
7151         Include <stdlib.h> unconditionally.
7152
7153         * hard-locale.c: Include hard-locale.h first.
7154         Include <stdlib.h>, <string.h> unconditionally.
7155
7156         * hash.c (free, malloc): Remove decls.
7157         Include <stdlib.h> unconditionally.
7158
7159         * human.c: Include <stdlib.h>, <string.h> unconditionally.
7160         (getenv): Do not declare.
7161
7162         * idcache.c: Include <string.h> unconditionally.
7163
7164         * long-options.c: Include long-options.h first, to test interface.
7165         Include <stdlib.h> unconditionally.
7166
7167         * makepath.c: Include makepath.h first, to test interface.
7168         Include <stdlib.h> and <string.h> unconditionally.
7169
7170         * linebuffer.c: Include <stdlib.h>.
7171         (free): Remove decl.
7172
7173         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7174         rpl_malloc returns void *, not char *.
7175         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
7176
7177         * md5.h: Include <limits.h> unconditionally.
7178         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7179         (__P): Remove; all uses removed.
7180         * md5.c: Include "md5.h" first.
7181         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7182         md5_buffer, md5_process_bytes, md5_process_block):
7183         Define with prototypes.
7184         * sha.h (__P): Remove all uses.  (It wasn't defined??)
7185         * sha.c: Include "sha.h" first.
7186         Include <stdlib.h>, <string.h> unconditionally.
7187
7188         * memchr.c (__ptr_t): Remove; all uses changed to void *.
7189         * memcmp.c (__ptr_t): Likewise.
7190         * memrchr.c (__ptr_t): Likewise.
7191         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7192         Include <string.h> unconditionally.
7193         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7194         * memchr.c: Include <stdlib.h> unconditionally.
7195         * memchr.c (LONG_MAX): Remove.
7196         * memrchr.c (LONG_MAX): Likewise.
7197         * memchr.c (__memchr): Define via a prototype.
7198         * memrchr.c (__memrchr): Likewise.
7199         * memcmp.c (__P): Remove, and remove all uses.
7200         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7201         Remove forward decls; no longer needed.
7202         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7203         Use types required by C89 in prototype.
7204
7205         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7206         * savedir.c: Likewise.
7207         * mkdir.c (free): Remove decl.
7208         * rmdir.c (rmdir): Define with a prototype.
7209         * savedir.c: Include savedir.h first, to test interface.
7210
7211         * mktime.c (STDC_HEADERS): Remove.
7212         Include <stdlib.h>, <string.h> unconditionally.
7213
7214         * modechange.c: Include <stdlib.h> unconditionally.
7215         (malloc): Remove decl.
7216
7217         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7218         (free): Remove decl.
7219
7220         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7221         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7222         (This type really should be intptr_t, but that's a C99ism.)
7223         (_obstack_memcpy): Remove: all uses changed to memcpy.
7224         Include <string.h> unconditionally.
7225         (struct obstack): Assume __STDC__ for types of members
7226         chunkfun, freefun, extra_arg.
7227         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7228         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7229         obstack_begin, obstack_specify_allocation,
7230         obstack_specify_allocation_with_arg, obstack_chunkfun,
7231         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7232         Remove unprototyped decls and the macros that use them.
7233         * obstack.c (POINTER): Remove.  All uses changed to void *.
7234         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7235         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7236         (defined __STDC__ && __STDC__)]:
7237         Remove nonprototyped code.
7238         Include <stdlib.h> unconditionally.
7239         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7240         _obstack_allocated_p, _obstack_free, obstack_free,
7241         _obstack_memory_used, print_and_abort):
7242         Define using prototypes.
7243         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7244         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7245         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7246         obstack_next_free, obstack_object_size, obstack_room) [0]:
7247         Remove unused, unprototyped code.
7248
7249         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7250
7251         * physmem.c (physmem_total, physmem_available, main): Define
7252         with prototypes.
7253
7254         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7255         (main): Define with a prototype.
7256
7257         * posixver.c (getenv): Remove decl.
7258
7259         * putenv.c (malloc): Returns void *, not char *.
7260         Include <string.h> unconditionally.
7261         (strchr, memcpy, NULL): Do not define.
7262
7263         * readtokens.c: Include readtokens.h first, to test interface.
7264         Include <stdlib.h>, <string.h> unconditionally.
7265         (init_tokenbuffer): Define with a prototype.
7266
7267         * regex.c (PARAMS): Remove.  All uses removed.
7268         All uses of _RE_ARGS removed, too.
7269         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7270         unconditionally.
7271         (bzero): Assume memset exists.
7272         (memcmp, memcpy, NULL): Remove.
7273         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7274         char, or assignments to local vars of type signed char.
7275         (init_syntax_once, PREFIX(extract_number_and_incr),
7276         PREFIX(print_partial_compiled_pattern),
7277         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7278         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7279         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7280         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7281         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7282         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7283         wcs_compile_range, byte_compile_range, truncate_wchar,
7284         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7285         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7286         count_mbs_length, wcs_re_match_2_internal,
7287         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7288         PREFIX(alt_match_null_string_p),
7289         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7290         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7291         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7292         now-unnecessary declaration, if any.
7293         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7294         regcomp, regexec):
7295         Remove now-unnecessary casts among pointer types.
7296         * regex.h (_RE_ARGS): Remove.  All uses removed.
7297
7298         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7299         (free): Remove decl.
7300
7301         * rpmatch.c: Include <stdlib.h> unconditionally.
7302
7303         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7304         (free): Remove decl.
7305
7306         * save-cwd.c: Include <stdlib.h> unconditionally.
7307         * xgetcwd.c: Likewise.
7308
7309         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7310         (free): Remove decl.
7311
7312         * strchrnul.c (strchrnul): Define with a prototype.
7313         Fix bug: c_in was not converted to char before searching.
7314
7315         The following changes are not K&R related:
7316
7317         * group-member.h: Include <sys/types.h>, so that this file is
7318         self-contained.
7319         * makepath.h: Likewise.
7320
7321         * getusershell.c (readname, default_index, line_size, readname):
7322         Use size_t, not int, for sizes.
7323         (readname): If the size overflows, report an error instead of
7324         looping forever.
7325
7326 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7327
7328         * getndelim2.c: Assume stdlib.h per the C89 spec.
7329
7330 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7331
7332         Assume C89 or better; remove K&R cruft.
7333         A few of these changes were first proposed by Derek Robert Price
7334         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7335
7336         * addext.c: Include <string.h> unconditionally.
7337         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7338         Don't declare getenv or malloc.
7339
7340         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7341         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7342         (NULL): Remove.
7343         (find_stack_direction, alloca): Use prototypes.
7344
7345         * atexit.c (atexit): Define using a prototype.
7346
7347         * basename.c, dirname.c, stripslash.c:
7348         Include <string.h> unconditionally.
7349
7350         * bcopy.c: Include <stddef.h>.
7351         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7352
7353         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7354
7355         * error.h (error, error_at_line, error_print_progname)
7356         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7357         * error.c: Include error.h first, to check interface.
7358         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7359         (VA_START): Remove; all uses changeed to va_start.
7360         (exit, strerror): Remove decls.
7361         (error_print_progname): Prototype uncondionally.
7362         Don't include <errno.h>; no longer needed.
7363         (private_strerror): Remove.
7364         (error_tail): Always define.
7365         (error, error_at_line): Assume C89 or better; always use prototypes.
7366         * fatal.c: Include "fatal.h" first, to test interface.
7367         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7368         (VA_START): Remove; all uses changed to va_start.
7369         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7370         this case.
7371         (exit): Remove decl.
7372         (fatal): Prototype unconditionally.  Assume va_start works.
7373         Abort at end, to pacify gcc.
7374
7375         * euidaccess.c (main): Define with a prototype.
7376
7377         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7378
7379         * exitfail.c: Include <stdlib.h> unconditionally.
7380
7381         * fnmatch_.h (__P): Remove.  All uses changed to assume
7382         prototypes.
7383         * fnmatch.c: Include fnmatch.h first, to test interface.
7384         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7385         (getenv): Remove decl.
7386         (fnmatch): Define using a prototype.
7387         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7388         (FCT): Define using a prototype.
7389
7390         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7391
7392         * gethostname.c: Include <stddef.h>.
7393         (gethostname): Define with prototype.  Length is size_t, not int.
7394
7395 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7396
7397         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7398         getversion.c should have been removed then, but was accidentally
7399         preserved.
7400
7401         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7402         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7403
7404 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7405
7406         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7407         copy_tm_result.  Bug reported by Simon Josefsson in
7408         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7409
7410 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7411
7412         * time_r.c, time_r.h: New files.
7413
7414         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7415         __localtime_r.
7416         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7417         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7418
7419         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7420         __gmtime_r.
7421         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7422         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7423         Include <time_r.h>.
7424
7425         * timegm.c: Switch to glibc implementation, with the following changes:
7426         [defined HAVE_CONFIG_H]: Include <config.h>.
7427         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7428         (__mktime_internal) [!defined _LIBC]: New decl.
7429         (__gmtime_r) [!defined _LIBC]: New macro and function.
7430         (timegm): Use a prototype, since gnulib assumes C89.
7431         Do not bother declaring tmp to be const, as it's not really usefu.
7432         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7433         (timegm): Declare only if HAVE_DECL_TIMEGM.
7434
7435 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7436
7437         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7438         Bug reported by Lute Kamstra in
7439         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7440
7441         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7442         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7443         course with correspondingly smaller numbers for tomorrow and
7444         yesterday.  From Tadayoshi Funaba.  Originally installed into
7445         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7446         coreutils merge?).
7447
7448 2003-08-31  Simon Josefsson  <jas@extundo.com>
7449
7450         * timegm.h: New file.
7451         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7452
7453 2003-08-31  Karl Berry  <karl@gnu.org>
7454
7455         * argp.h: update from libc.
7456
7457 2003-08-28  Bruno Haible  <bruno@clisp.org>
7458
7459         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7460         warning on QNX, which defines O_BINARY to 000000.
7461
7462 2003-08-24  Bruno Haible  <bruno@clisp.org>
7463
7464         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7465         MSVC7 <stdio.h> is included later.
7466
7467 2003-08-20  Bruno Haible  <bruno@clisp.org>
7468
7469         * progname.h: New file, from GNU gettext.
7470         * progname.c: New file, from GNU gettext.
7471         * progreloc.c: New file, from GNU gettext.
7472
7473 2003-08-19  Bruno Haible  <bruno@clisp.org>
7474
7475         * xstrdup.c: Assume <string.h> exists.
7476
7477 2003-08-18  Jim Meyering  <jim@meyering.net>
7478
7479         * setenv.h: Indent nested cpp directive.
7480         * vasnprintf.c: Remove trailing blanks.
7481
7482 2003-08-17  Simon Josefsson  <jas@extundo.com>
7483             Bruno Haible  <bruno@clisp.org>
7484
7485         * xstrndup.h: New file.
7486         * xstrndup.c: New file.
7487
7488 2003-08-17  Bruno Haible  <bruno@clisp.org>
7489
7490         * strndup.h: New file.
7491
7492 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7493
7494         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7495         space, undoing this 2003-08-12 change:
7496         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7497
7498 2003-08-16  Jim Meyering  <jim@meyering.net>
7499
7500         Merge from coreutils.
7501         * xstrtoimax.c: #else #if -> #elif.
7502         * xstrtoumax.c: Likewise.
7503
7504 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7505
7506         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7507         rather than tab, after '#' in shell-script copyright notices.
7508         Suggested by Bruno Haible.
7509
7510 2003-08-15  Jim Meyering  <jim@meyering.net>
7511         and Paul Eggert  <eggert@twinsun.com>
7512
7513         Merge from coreutils.
7514         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7515         member but strut utmpx does not.  Needed for AIX 4.3.3.
7516         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7517
7518 2003-08-15  Jim Meyering  <jim@meyering.net>
7519
7520         Merge from coreutils.
7521         * xgethostname.c: Include <stdlib.h>.
7522         (xghostname): Don't exit for anything other than memory-related
7523         failure; just return NULL.
7524         * userspec.c: Include "posixver.h".
7525         (parse_user_spec): Accept `.' as a separator only
7526         in pre-POSIX-200112 mode.
7527         * strtoimax.c: Use #elif rather than #else #if.
7528         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7529         Remove function, now that we can rely on a working tzset function.
7530         [!_LIBC]: Ensure that the required autoconf test has been run.
7531         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7532         Use underlying_strftime for %r.
7533         * sha.c: Merge in some clean-up and optimization changes from glibc.
7534         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7535         Ensure that it is a multiple of 64.
7536         Rearrange loop exit tests so as to avoid performing an
7537         additional fread after encountering an error or EOF.
7538         * realloc.c: Update copyright date.
7539
7540 2003-08-14  Jim Meyering  <jim@meyering.net>
7541
7542         Merge from coreutils.
7543         * obstack.h: Whitespace changes.
7544         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7545         and xcalloc return values.
7546         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7547         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7548         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7549         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7550         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7551         error from mntctl.
7552         Use mntctl's return value to drive the entry-processing loop, since
7553         we can't rely on the value of the vmt_length member in the last
7554         entry.  On some systems doing so could result in exhausting
7555         virtual memory.  Based in part on a patch from Mike Jetzer.
7556
7557 2003-08-14  Jim Meyering  <jim@meyering.net>
7558         and Paul Eggert  <eggert@twinsun.com>
7559
7560         Merges from coreutils, plus other fixes.
7561         * physmem.c: Merge in portability changes from gcc/libiberty
7562         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7563         for credits and details.  Thanks to Kaveh Ghazi for helping
7564         to keep these files in sync.
7565         (ARRAY_SIZE): Define it.
7566         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7567         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7568         (memcasecmp): Don't assume size_t fits in unsigned int.
7569         Remove casts and duplicate code.
7570         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7571         (memcpy): Remove definition.
7572         Merge in some clean-up and optimization changes from glibc.
7573         [BLOCKSIZE]: Move definition to top of file.
7574         Ensure that it is a multiple of 64.
7575         Rearrange loop exit tests so as to avoid performing an
7576         additional fread after encountering an error or EOF.
7577         * md5.h (md5_uintptr): Define.
7578         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7579         return to the initial working directory.  Preserve errno
7580         for caller.
7581         * idcache.c: Include "xalloc.h".
7582         (xmalloc, xrealloc): Remove decls.
7583         (getuser): Remove casts no longer required in C89.
7584         * human.c: Include stdio.h, for sprintf.
7585         * group-member.c: Include "xalloc.h".
7586         (xmalloc, xrealloc): Remove decls.
7587         (get_group_info): Remove casts no longer required in C89.
7588         * getusershell.c (readname): Remove casts no longer required in C89.
7589         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7590         * getline.c: Whitespace fix, from coreutils.
7591
7592 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7593
7594         * exclude.c: Include <ctype.h>
7595         (IN_CTYPE_DOMAIN): New macro.
7596         (is_space): New fn.
7597         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7598         and empty lines.
7599
7600         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7601         Undo previous (whitespace-only) change.
7602
7603 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7604
7605         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7606         Normalize leading white space and remove trailing white space.
7607         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7608         notice, as per ../config/srclist-update.
7609
7610         Merge from coreutils.
7611         * euidaccess.h: New file.
7612         * euidaccess.c: Include it.
7613         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7614         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7615         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7616
7617 2003-08-11  Bruno Haible  <bruno@clisp.org>
7618
7619         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7620         (vasnprintf): Use it instead of wcslen.
7621
7622 2003-08-11  Bruno Haible  <bruno@clisp.org>
7623
7624         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7625         value to ensure that _Bool promotes to int. Use #define for _Bool when
7626         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7627
7628 2003-08-10  Karl Berry  <karl@gnu.org>
7629
7630         * regex.h: update from libc (whitespace fix).
7631
7632 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7633
7634         Merge some files from coreutils.  These changes were
7635         originally made by Jim Meyering.
7636         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7637         many older Unixes require this.
7638         * alloca.c (alloca): Remove cast to argument of free;
7639         no longer needed in C89.
7640         * alloca_.h, regex.h: Fix white space to match
7641         what GNU indent does.
7642
7643 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7644
7645         * bumpalloc.h: Remove.
7646
7647 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7648
7649         * getloadavg.c: Change copyright notice and spacing to conform to
7650         GNU coding style.
7651
7652         Merge from coreutils.
7653         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7654         From glibc.
7655         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7656         from Karl Berry, implemented by Jim Meyering.
7657         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7658         from Dmitry V. Levin.
7659         Remove anachronistic cast of xrealloc.
7660         * fnmatch_.h (__const): Remove.  Use 'const'.
7661         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7662         type. Otherwise, it wouldn't compile with at least /bin/cc on
7663         ymp-cray-unicos9.0.2.X.
7664         Combine two mostly-identical uses of alloca into one.
7665         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7666
7667 2003-08-04  Dave Love <d.love@dl.ac.uk>
7668
7669         [From Emacs.]
7670
7671         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7672         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7673         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7674         obsolete NLIST_NAME_UNION.
7675         [__GNU__]: Undef BSD and FSCALE.
7676         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7677
7678 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7679
7680         * stdbool_.h (_Bool): Make it signed char, instead of
7681         an enum type, so that it's guaranteed to promote to int.  See:
7682         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7683
7684 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7685
7686         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7687         (strerror): Don't assume that a printable int fits in 14 bytes.
7688
7689 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7690             Bruno Haible  <bruno@clisp.org>
7691
7692         * getline.h (getline, getdelim): Change return type to ssize_t.
7693         * getline.c (getline, getdelim): Likewise.
7694         Remove _GNU_SOURCE define; now it's defined in config.h through
7695         m4/getline.m4.
7696
7697 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7698
7699         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7700         over-parenthesization in macros.
7701
7702         Sync with coreutils.
7703
7704         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7705         required by C99.
7706
7707         Use `exit_failure' for xalloc and xmemcoll instead of their own
7708         private exit-failure variables.
7709         * xalloc.h (xalloc_exit_failure): Remove.
7710         * xmalloc.c: Likewise.  Include exitfail.h.
7711         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7712         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7713         * xmemcoll.c: Likewise.  Include exitfail.h.
7714         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7715
7716 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7717
7718         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7719         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7720         to test that it can stand by itself.  Include "exitfail.h".
7721         Clients should set exit_failure instead.
7722         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7723
7724 2003-07-18  Andreas Schwab  <schwab@suse.de>
7725
7726         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7727
7728 2003-07-18  Bruno Haible  <bruno@clisp.org>
7729
7730         * getndelim2.h: New file.
7731         * getndelim2.c: Make into a module of its own. Include config.h,
7732         getndelim2.h.
7733         (getndelim2): Make non-static. Change return type to ssize_t.
7734         * getline.h: Change argument names.
7735         * getline.c: Include getndelim2.h instead of getndelim2.c.
7736         * getnline.c: Include getndelim2.h.
7737
7738 2003-07-17  Bruno Haible  <bruno@clisp.org>
7739
7740         * Makefile.am: Remove file.
7741         * Makefile.in: Remove file.
7742
7743 2003-07-17  Bruno Haible  <bruno@clisp.org>
7744
7745         * getnline.h: New file.
7746         * getnline.c: New file.
7747         * getndelim2.c: New file, extracted from getline.c.
7748         (getndelim2): Renamed from getdelim2, with added nmax argument.
7749         * getline.c: Include getndelim2.c.
7750         (getdelim2): Moved out to getndelim2.c.
7751         (getline, getdelim): Update.
7752
7753 2003-07-15    <karl@gnu.org>
7754
7755         * vasnprintf.c: update from gettext.
7756
7757 2003-07-15  Jim Meyering  <jim@meyering.net>
7758
7759         * makepath.c (make_path): Enclose diagnostic in _(...).
7760
7761 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7762
7763         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7764         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7765         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7766         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7767         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7768         updated automatically by ../config/srclist-update.  This changes
7769         their license from LPGL to GPL.
7770
7771 2003-07-14  Jim Meyering  <jim@meyering.net>
7772
7773         Don't emit diagnostics.  Let callers do that.
7774         * save-cwd.c: Don't include "error.h".
7775         (save_cwd): Don't call error.  Ensure that errno is valid
7776         when returning nonzero.
7777
7778         * save-cwd.h (restore_cwd): Update prototype.
7779         * save-cwd.c (restore_cwd): Remove two parameters.
7780         Simplify.  Don't call error upon failure.  Let callers do that.
7781         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7782         when auditing is enabled.  But don't bother updating the #if.
7783
7784 2003-07-14  Simon Josefsson  <jas@extundo.com>
7785
7786         * mempcpy.h: New file.
7787         * mempcpy.c: New file.
7788
7789 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7790
7791         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7792         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7793         unicodeio.c, unicodeio.h, unlocked-io.h:
7794         Switch from LGPL to GPL.
7795
7796 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7797
7798         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7799         it breaks C++ compilation.
7800         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7801
7802 2003-07-10  Jim Meyering  <jim@meyering.net>
7803
7804         * vasnprintf.c: Remove trailing blanks.
7805         Make cpp indentation consistent.
7806
7807 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7808
7809         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7810         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7811         Switch from LGPL to GPL.
7812
7813 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7814
7815         * mktime.c: Fix some boundary cases and remove need for floating point.
7816
7817         Issue a compile-time diagnostic if time_t is floating point, or if
7818         two's complement arithmetic is not in effect, or if arithmetic
7819         right shift does not propagate the sign.  These assumptions were
7820         all in the original code but they weren't checked.
7821
7822         (TIME_T_MIDPOINT, verify): New macros.
7823         (__isleap): Remove; it has integer overflow problems.
7824         (leapyear): New function, without those problems.
7825         (ydhms_tm_diff): Remove; splitting into two parts.
7826         (ydhms_diff): New function, containing the arithmetic part of
7827         the old ydhms_tm_diff function.  Issue a compile-time
7828         diagnostic if we are not using C99 integer division.
7829         Avoid casts when possible.
7830         (guess_time_tm): New function, containing the checking part of
7831         the old ydhms_tm_diff function.  Return the new value, rather than
7832         the difference between it and the old.  Accept a new argument T
7833         so that *T specifies the old value.  Check for overflow in the result.
7834
7835         (__mktime_internal): Use a time_t offset, not a long int offset.
7836         This undoes the 2003-06-04 change, which is no longer needed now
7837         that we have better overflow checking.
7838         (localtime_offset): Likewise.
7839
7840         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7841         and long are 64-bit but int is only 32-bit.
7842         (ydhms_diff): Use long int to store year1 and yday1.
7843         Issue a compile-time diagnostic if long int is not wide enough.
7844
7845         (__mktime_internal): Use long int to store adjusted year and yday.
7846         Use plain C rather than preprocessor commands, if that doesn't
7847         affect efficiency.
7848         Check for overflow (and try to repair) after each probe
7849         rather than checking only at the very end.  This avoids some bugs
7850         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7851         does not equal GMT offset at maximum time).
7852         Use integer to check for overflow rather than floating point; this
7853         is more portable to non-IEEE hosts, and is a tad faster.
7854         When we detect that we are oscillating between two values,
7855         don't check whether tm_isdst has the requested value, since
7856         we already know the answer.  When tm_isdst has the wrong value,
7857         use a different heuristic to find the right one, based on the
7858         extreme values actually observed in practice in tz2003a,
7859         rather than the (overly optimistic) "previous 3 calendar quarters".
7860
7861         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7862         "T const" to accommodate glibc style.
7863         (check_result): Use less-confusing report format.  "long" -> "long int.
7864         (main): Likewise.
7865         Don't loop if the iteration overflows time_t.
7866         Allow a negative step in the iteration.
7867
7868 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7869
7870         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7871         having it depend on HAVE_SYS_TYPES_H.
7872
7873 2003-06-25  Bruno Haible  <bruno@clisp.org>
7874
7875         * readlink.c: New file.
7876
7877 2003-06-20  Bruno Haible  <bruno@clisp.org>
7878
7879         Assume C89, so PARAMS isn't needed.
7880         * unicodeio.h (PARAMS): Remove.
7881         * unicodeio.c: Don't use PARAMS.
7882
7883 2003-06-18  Jim Meyering  <jim@meyering.net>
7884
7885         Merge changes from coreutils.
7886         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7887         Remove explicit declarations of xmalloc and realloc.
7888         Include xalloc.h.
7889         (read_utmp): Remove anachronistic cast of xmalloc.
7890
7891 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7892
7893         Assume C89, so PARAMS isn't needed.
7894         * backupfile.h (PARAMS): Remove.  All uses removed.
7895         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7896         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7897         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7898         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7899         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7900         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7901         xstrtol.h: Likewise.
7902         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7903         same.h, strverscmp.h: Do not include config.h; no longer needed.
7904         Anyway, config.h should always be included before any other file.
7905
7906 2003-06-11  Simon Josefsson  <jas@extundo.com>
7907
7908         * sysexit_.h: New file.
7909
7910 2003-05-20  Derek Price  <derek@ximbiot.com>
7911
7912         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7913
7914 2003-06-10  Simon Josefsson  <jas@extundo.com>
7915
7916         * strchrnul.h: New file.
7917         * strchrnul.c: New file.
7918
7919 2003-06-10  Simon Josefsson <jas@extundo.com>
7920
7921         * argp.h: New file, from glibc.
7922         * argp-ba.c: New file, from glibc.
7923         * argp-eexst.c: New file, from glibc.
7924         * argp-fmtstream.c: New file, from glibc.
7925         * argp-fmtstream.h: New file, from glibc.
7926         * argp-fs-xinl.c: New file, from glibc.
7927         * argp-help.c: New file, from glibc.
7928         * argp-namefrob.h: New file, from glibc.
7929         * argp-parse.c: New file, from glibc.
7930         * argp-pv.c: New file, from glibc.
7931         * argp-pvh.c: New file, from glibc.
7932         * argp-xinl.c: New file, from glibc.
7933
7934 2003-06-07  Jim Meyering  <jim@meyering.net>
7935
7936         * readtokens.h: Put `Free Software Foundation, Inc.'
7937         in place of my name in the copyright comment.
7938         Remove definition and uses of __P.
7939
7940         From coreutils.
7941         * stat.c: Don't declare xmalloc explicitly.
7942         Instead, include "xalloc.h".
7943         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7944         xrealloc, and xcalloc return values.
7945         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7946         Improve comment.
7947         * xgetcwd.h: Remove definition/uses of PARAMS.
7948
7949 2003-06-06  Jim Meyering  <jim@meyering.net>
7950
7951         * stdbool_.h: Renamed from stdbool.h.in.
7952
7953 2003-06-06  Jim Meyering  <jim@meyering.net>
7954
7955         Merge from coreutils.
7956         * same.c: (same_name): Declare *_basename locals to be `const'.
7957         Consolidate declarations and initializations of *_base* locals.
7958
7959         Merge from coreutils.
7960         This avoids a core dump on systems without GNU putenv,
7961         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7962         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7963         (unsetenv): New static function, from GNU libc.
7964         (rpl_putenv): Use it.
7965
7966         * modechange.c: Remove trailing blanks.
7967
7968         Merge from coreutils.
7969         * fsusage.c: Remove declaration of statfs.
7970         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7971
7972         * posixtm.c: Include <stdbool.h> unconditionally.
7973
7974 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7975
7976         * mktime.c (__mktime_internal): When resolving a tm_isdst
7977         mismatch, look in future quarters as well as past.  This fixes a
7978         bug when processing fall-backwards gaps immediately after a long
7979         period of daylight-saving time.
7980
7981         * mktime.c: Assume freestanding C89 or better.
7982         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7983         (__P): Remove; not used.
7984         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7985         (mktime, not_equal_tm, print_tm, check_result,
7986         main): Use prototypes.  Use const * where appropriate.
7987         (main): Fix typo in testing code that uncovered by above changes.
7988         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7989
7990 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7991
7992         * mktime.c: Fix Debian bug 177940
7993         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7994         (localtime_offset): Now long int, not time_t, because we want it
7995         to be guaranteed to be signed.  All uses changed.
7996         (__mktime_internal): If overflow would occur when adding offset,
7997         don't add it.
7998
7999         Merge 'human' changes from coreutils.  Rewrite to support
8000         locale-specific notations like thousands separators.
8001         * human.c: Simplify authorship notice.
8002         Include human.h immediately after config.h.
8003         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
8004         <limits.h>: Do not include, since human.h does.
8005         (SIZE_MAX, UINTMAX_MAX): New macros.
8006         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
8007         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
8008         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
8009         (power_letter): Renamed from suffixes.
8010         (generate_suffix_backwards): Remove.
8011         (adjust_value): Now takes int style (because of human.h changes)
8012         and long double value (for greater precision on some platforms).
8013         (group_number): New function.
8014         (human_readable): Use it.  Use integer options, not enum.
8015         Put the options before the sizes in the arg list.
8016         Support all the new options.
8017         The old human_readable function has been removed;
8018         use inttostr.h instead.
8019         (human_readable, default_block_size, humblock):
8020         Use uintmax_t, not int, for block sizes.
8021         (human_readable_inexact, block_size_types): Remove.
8022         (block_size_opts): New constant.
8023         (human_options): Renamed from human_block_size, with new signature
8024         that allows block sizes up to UINTMAX_MAX.  All callers changed.
8025         * human.h: Add copyright and authorship notice.
8026         Include <limits.h> and <stdbool.h> unconditionally.
8027         (PARAMS): Remove.  All uses removed.
8028         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
8029         (enum human_inexact_style): Remove tag; now a nameless enum.
8030         (human_floor, human_ceiling, human_round_to_even): Now have
8031         values 2, 0, 1 rather than -1, 1, 0.
8032         (human_group_digits, human_suppress_point_zero, human_autoscale,
8033         human_base_1024, human_SI, human_B): New constants.
8034         (human_readable_inexact, human_block_size): Remove.
8035         (human_readable): Size args are now uintmax_t, not int.
8036         (human_options): New decl.
8037
8038         * exclude.c: (new_exclude, add_exclude): Remove casts that are
8039         unnecessary now that we assume C89 or better.  This change
8040         imported from coreutils.
8041
8042         * mktime.c (__mktime_internal): Do not reject negative timestamps
8043         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
8044         in the 2003-05-30 sync from glibc.
8045
8046         .h files should stand alone, but we shouldn't include <sys/types.h>
8047         if we can get away with just <stddef.h>.
8048
8049         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8050         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8051         rather than <sys/types.h>, as we merely need size_t.
8052         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8053         to get size_t.
8054         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8055         Include <stdio.h>, to get FILE.
8056         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8057         memcasecmp.h has included <stddef.h> and all we need is size_t.
8058         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8059         our interface, instead of including <sys/types.h>
8060
8061 2003-06-02  Paul Eggert  <eggert@twinsun.com>
8062
8063         [from coreutils]
8064         Fix some minor time-related bugs with POSIX time arguments.
8065         Some valid time stamps were being rejected (notably -1, and
8066         time stamps before 1900 on 64-bit hosts).  And some invalid
8067         time stamps were being accepted, e.g. September 31.
8068
8069         * posixtm.h (posixtime): Return bool instead of time_t, so
8070         that we can return (time_t) -1 successfully.
8071         * posixtm.c: Likewise.
8072         [HAVE_STDBOOL_H]: Include <stdbool.h>.
8073         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8074         (t): Remove static var.
8075         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8076         of static var.  All uses changed.
8077         (year): Do not reject years before 1900; they can occur with
8078         64-bit time_t.
8079         (posix_time_parse): Do not check for out-of-range components;
8080         that is now the caller's responsibility, since our checks were
8081         only approximations.
8082         (posixtime): Use mktime to check for out-of-range components,
8083         since it knows them exactly.
8084         If mktime returns (time_t) -1, check whether an error actually occurred
8085         by invoking localtime on -1.
8086         (main) [TEST_POSIXTIME]: Check for input data errors, and report
8087         posixtime failures better.
8088         Improve the test data (in comments only).
8089
8090 2003-05-30    <karl@gnu.org>
8091
8092         * mktime.c: update from libc.
8093
8094 2003-05-30  Bruno Haible  <bruno@clisp.org>
8095
8096         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8097         * localcharset.h: Likewise.
8098         * localcharset.c: Likewise.
8099
8100 2003-05-28  Paul Eggert  <eggert@twinsun.com>
8101
8102         Assume the headers required for C89 freestanding compilers.
8103         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8104         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8105         without checking for HAVE_LIMITS_H.
8106         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8107         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8108         to do that.
8109         * fatal.c: Include <stdarg.h> without checking for __STDC__.
8110         * exclude.c: Include <stdbool.h> unconditionally.
8111         * tempname.c: Include <stddef.h> unconditionally.
8112         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8113         * modechange.c, rpmatch.c (NULL): Don't define, since
8114         <stddef.h> does that.
8115         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8116         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8117         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8118         * xstrtol.c: Likewise.
8119         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8120         * savedir.c: Include <stddef.h> instead of defining NULL.
8121
8122         * addext.c (addext): Use assignment rather than cast, to avoid
8123         warnings on some platforms.
8124
8125         * mktime.c (__mktime_internal): Do not reject negative timestamps
8126         arbitrarily.
8127
8128 2003-05-10  Bruno Haible  <bruno@clisp.org>
8129
8130         * linebreak.c (iconv_string_length): Don't return -1 just because the
8131         string is longer than 4 KB.
8132
8133 2003-05-12  Jim Meyering  <jim@meyering.net>
8134
8135         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8136         the space-padded-by-default conversion specifiers, %e, %k, %l.
8137
8138 2003-05-03  Bruno Haible  <bruno@clisp.org>
8139
8140         Upgrade to Unicode-4.0.
8141         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8142         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8143         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8144         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8145         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8146         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8147         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8148         Change width of U+E0100..U+E01EF from 1 to 0.
8149
8150 2003-04-25  Bruno Haible  <bruno@clisp.org>
8151
8152         * copy-file.c: Include <stddef.h>, for size_t.
8153
8154 2003-04-25  Jim Meyering  <jim@meyering.net>
8155
8156         * copy-file.c (copy_file_preserving): Declare buf_size to be
8157         of type size_t, not int.
8158
8159 2003-04-11  Jim Meyering  <jim@meyering.net>
8160
8161         Merge changes from Coreutils.
8162
8163         2003-03-22  Jim Meyering  <jim@meyering.net>
8164
8165         * strftime.c (widen): Cast alloca return value to proper type.
8166
8167         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
8168
8169         From GNU libc.
8170         * strftime.c (my_strftime): Handle very large width
8171         specifications for numeric values correctly.  Improve checks for
8172         overflow.
8173
8174         2003-01-19  Jim Meyering  <jim@meyering.net>
8175
8176         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8177         (nl_get_alt_digit) [! defined my_strftime]: Define.
8178         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8179         _nl_get_alt_digit and _nl_get_walt_digit.
8180
8181         * strftime.c (my_strftime): Merge in locale-related changes from libc.
8182         These changes have no effect outside of _LIBC.
8183
8184 2003-04-10  Bruno Haible  <bruno@clisp.org>
8185
8186         * findprog.h: New file, from GNU gettext.
8187         * findprog.c: New file, from GNU gettext.
8188
8189 2003-04-05  Jim Meyering  <jim@meyering.net>
8190
8191         Merge changes from Coreutils.
8192
8193         * exclude.h (PARAMS): Remove definition and uses.
8194         * exclude.c: Remove uses of `PARAMS'.
8195
8196         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8197         Add test-cases for DOS filenames. Declare program_name.
8198         (main): Set up program_name.  Patch by Rich Dawe.
8199
8200         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8201         error from mntctl.
8202         Use mntctl's return value to drive the entry-processing loop, since
8203         we can't rely on the value of the vmt_length member in the last
8204         entry.  On some systems doing so could result in exhausting
8205         virtual memory.  Based in part on a patch from Mike Jetzer.
8206
8207 2003-04-04  Bruno Haible  <bruno@clisp.org>
8208
8209         * linebreak.h: New file, from GNU gettext.
8210         * linebreak.c: New file, from GNU gettext with slight modifications.
8211         * lbrkprop.h: New file, from GNU gettext.
8212
8213 2003-04-03  Bruno Haible  <bruno@clisp.org>
8214
8215         * utf8-ucs4.h: New file, from GNU gettext.
8216         * utf16-ucs4.h: New file, from GNU gettext.
8217         * ucs4-utf8.h: New file, from GNU gettext.
8218         * ucs4-utf16.h: New file, from GNU gettext.
8219
8220 2003-04-02  Bruno Haible  <bruno@clisp.org>
8221
8222         * binary-io.h: New file, from GNU gettext.
8223
8224 2003-04-01  Bruno Haible  <bruno@clisp.org>
8225
8226         * pathname.h: New file, from GNU gettext.
8227         * concatpath.c: New file, from GNU gettext.
8228
8229 2003-03-30  Bruno Haible  <bruno@clisp.org>
8230
8231         * copy-file.c (copy_file_preserving): Don't set owner if the function
8232         chown() doesn't exist.
8233
8234 2003-03-28  Bruno Haible  <bruno@clisp.org>
8235
8236         * copy-file.h: New file, from GNU gettext.
8237         * copy-file.c: New file, from GNU gettext.
8238
8239 2003-03-18  Jim Meyering  <jim@meyering.net>
8240
8241         * quote.c (quote_n): Fix typo in comment.
8242
8243 2003-03-14  Jim Meyering  <jim@meyering.net>
8244
8245         Merge changes from Coreutils.
8246         * obstack.h (obstack_object_size): Declare temporary, __o,
8247         to be const, in order to avoid warnings.
8248         (obstack_room): Likewise.
8249         (obstack_empty_p): Likewise.
8250
8251 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8252
8253         Merge changes from Bison.
8254         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8255         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8256         when compiling Bison 1.875's `bitset bset = obstack_alloc
8257         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8258         * hash.c: Include <stdbool.h> unconditionally.
8259
8260 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8261
8262         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8263         Reported by Bruce Becker; see:
8264         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8265
8266 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8267             Bruno Haible  <bruno@clisp.org>
8268
8269         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8270         Reported by John Hughes, see
8271         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8272
8273 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8274
8275         * poll_.h: New file.
8276         * poll.c: New file.
8277
8278 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8279
8280         * mathl.h: New file.
8281         * acosl.c: New file.
8282         * asinl.c: New file.
8283         * atanl.c: New file.
8284         * ceill.c: New file.
8285         * cosl.c: New file.
8286         * expl.c: New file.
8287         * floorl.c: New file.
8288         * frexpl.c: New file.
8289         * ldexpl.c: New file.
8290         * logl.c: New file.
8291         * sincosl.c: New file.
8292         * sinl.c: New file.
8293         * sqrtl.c: New file.
8294         * tanl.c: New file.
8295         * trigl.c: New file.
8296         * trigl.h: New file.
8297
8298 2003-02-17  Bruno Haible  <bruno@clisp.org>
8299
8300         * mkdtemp.h: New file, from GNU gettext.
8301         * mkdtemp.c: New file, from GNU gettext.
8302
8303 2003-01-31  Bruno Haible  <bruno@clisp.org>
8304
8305         * rename.c: #undef rename before defining rpl_rename.
8306         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8307
8308 2003-01-30  Bruno Haible  <bruno@clisp.org>
8309
8310         * printf-args.h: New file, from GNU gettext.
8311         * printf-args.c: New file, from GNU gettext.
8312         * printf-parse.h: New file, from GNU gettext.
8313         * printf-parse.c: New file, from GNU gettext.
8314         * vasnprintf.h: New file, from GNU gettext.
8315         * vasnprintf.c: New file, from GNU gettext.
8316         * asnprintf.c: New file, from GNU gettext.
8317         * vasprintf.h: New file, from GNU gettext with modifications.
8318         * vasprintf.c: New file, from GNU gettext.
8319         * asprintf.c: New file, from GNU gettext.
8320
8321 2003-01-29  Bruno Haible  <bruno@clisp.org>
8322
8323         * stpncpy.h: New file, from GNU gettext with modifications.
8324         * stpncpy.c: New file, from GNU gettext with modifications.
8325
8326 2003-01-28  Bruno Haible  <bruno@clisp.org>
8327
8328         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8329         Paul Eggert.
8330         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8331         Paul Eggert.
8332
8333 2003-01-27  Bruno Haible  <bruno@clisp.org>
8334
8335         * xsetenv.h: New file, from GNU gettext.
8336         * xsetenv.c: New file, from GNU gettext.
8337
8338 2003-01-23  Bruno Haible  <bruno@clisp.org>
8339
8340         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8341
8342 2003-01-22  Bruno Haible  <bruno@clisp.org>
8343
8344         * exit.h: New file, from GNU gettext.
8345
8346 2003-01-11  Bruno Haible  <bruno@clisp.org>
8347
8348         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8349         * strcase.h (strcasecmp, strncasecmp): Likewise.
8350
8351 2003-01-14  Jim Meyering  <jim@meyering.net>
8352
8353         * same.c (same_name): Tweak a comment.
8354
8355 2003-01-11  Bruno Haible  <bruno@clisp.org>
8356
8357         * same.c (same_name): Reorder tests so as to avoid calling stat()
8358         when a string comparison is sufficient.
8359
8360 2003-01-11  Bruno Haible  <bruno@clisp.org>
8361
8362         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8363         'unsigned int'.
8364
8365 2003-01-11  Bruno Haible  <bruno@clisp.org>
8366
8367         * hash-pjw.c: Add comment about low quality of this function.
8368
8369 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8370
8371         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8372         to avoid collisions with libcurses and libreadline.
8373
8374         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8375         * getstr.h, getstr.c: Remove.
8376         * getline.c: Include "getline.h", to check interface.
8377         Move body of old getstr.c here: this defines MIN_CHUNK and
8378         declares getdelim2, which is renamed from getstr.
8379         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8380
8381         * linebuffer.c (readlinebuffer): Renamed from readline.
8382         All uses changed.
8383         * linebuffer.h: Likewise.
8384         (readline): Remove backward-compatibility macro.
8385
8386 2003-01-12  Jim Meyering  <jim@meyering.net>
8387
8388         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8389
8390 2003-01-10  Bruno Haible  <bruno@clisp.org>
8391
8392         * alloca_.h: New file.
8393         * getdate.y: Unconditionally include alloca.h.
8394         * makepath.c: Likewise.
8395         * setenv.c: Likewise.
8396         * userspec.c: Likewise.
8397
8398 2003-01-09  Bruno Haible  <bruno@clisp.org>
8399
8400         * stdbool.h.in: New file.
8401
8402 2003-01-08  Bruno Haible  <bruno@clisp.org>
8403
8404         * safe-read.c: Include specification header first, to ensure its
8405         selfcontainedness.
8406         * full-write.c: Likewise.
8407
8408 2003-01-08  Jim Meyering  <jim@meyering.net>
8409
8410         * full-write.c: Undefine and define-away `const' after inclusion
8411         of errno.h, not before.  Suggestion from Bruno Haible.
8412
8413 2003-01-07  Jim Meyering  <jim@meyering.net>
8414
8415         * full-write.c: Rework so that it may serve to define full_read, too.
8416         * full-read.c: Simply #define FULL_READ and include full-write.c.
8417
8418 2003-01-06  Jim Meyering  <jim@meyering.net>
8419
8420         * version-etc.c: Update year in translatable copyright string.
8421
8422 2002-12-25  Bruno Haible  <bruno@clisp.org>
8423
8424         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8425         * xstrtol.h: Likewise.
8426         * xstrtoimax.c: Likewise.
8427         * xstrtoumax.c: Likewise.
8428         * human.h: Likewise.
8429
8430         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8431         on systems that have <inttypes.h> but not <stdint.h>.
8432
8433 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8434
8435         * memcoll.c (memcoll): Fall back on a simple algorithm using
8436         memcmp if strcoll doesn't work.
8437
8438 2002-12-23  Bruno Haible  <bruno@clisp.org>
8439
8440         * localcharset.h: New file.
8441         * localcharset.c: Include it.
8442         * unicodeio.c: Likewise.
8443
8444 2002-12-22  Bruno Haible  <bruno@clisp.org>
8445
8446         * utime.c (utime_null): No need to call ftruncate if the file was
8447         nonempty.
8448
8449 2002-12-23  Bruno Haible  <bruno@clisp.org>
8450
8451         * memcoll.c (STRCOLL): New macro.
8452         (memcoll): Use it.
8453
8454 2002-12-22  Bruno Haible  <bruno@clisp.org>
8455
8456         * getstr.h (getstr): Define, to avoid clash with libcurses.
8457         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8458
8459 2002-12-22  Bruno Haible  <bruno@clisp.org>
8460
8461         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8462
8463 2002-12-23  Bruno Haible  <bruno@clisp.org>
8464
8465         * getline.h: Include <stddef.h>, for size_t.
8466
8467         * unicodeio.h: Include <stddef.h>, for size_t.
8468         * unicodeio.c: Don't include <stddef.h>.
8469
8470 2002-12-17  Bruno Haible  <bruno@clisp.org>
8471
8472         * canon-host.c (strdup): Remove unused declaration.
8473
8474         * fsusage.c: Include full_read.h.
8475         (get_fs_usage): Use full_read instead of safe_read.
8476
8477         * utime.c (utime_null): Use SAFE_READ_ERROR.
8478
8479 2002-12-11  Bruno Haible  <bruno@clisp.org>
8480
8481         * setenv.h: Rewritten to cope with systems that have setenv() but not
8482         unsetenv().
8483         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8484         modifications:
8485
8486         2002-12-11  Bruno Haible  <bruno@clisp.org>
8487
8488                 * setenv.c (alloca): Fall back to malloc.
8489                 (freea): New macro.
8490                 (setenv): Use freea() to free memory allocated with alloca().
8491
8492         2002-11-13  Bruno Haible  <bruno@clisp.org>
8493
8494                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8495                 function declarations.
8496                 * unsetenv.c (unsetenv): Likewise.
8497
8498         2002-03-04  Bruno Haible  <bruno@clisp.org>
8499
8500                 Portability to AIX 4.3.3.
8501                 * unsetenv.c: New file, extracted from setenv.c.
8502                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8503
8504         2001-12-20  Bruno Haible  <bruno@clisp.org>
8505
8506                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8507                 use malloc instead. For SunOS 4.
8508
8509         2001-12-11  Bruno Haible  <bruno@clisp.org>
8510
8511                 * setenv.c: Declare alloca.
8512                 (compar_fn_t): New typedef.
8513                 (KNOWN_VALUE, STORE_VALUE): Use it.
8514
8515         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8516         setenv.h.
8517
8518 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8519
8520         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8521         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8522         Choose values that are less likely to collide with system fnmatch
8523         options.
8524         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8525         defined (e.g., a pure POSIX system).
8526         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8527         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8528
8529 2002-12-06  Jim Meyering  <jim@meyering.net>
8530
8531         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8532
8533         Merge in changes from libc's misc/error.c, in preparation
8534         for the merge of gnulib's changes back into libc.
8535
8536         * error.c (_): Define only if not already defined.
8537         Move definition to follow all #include directives.
8538         Include unlocked-io.h only if !_LIBC.
8539         [_LIBC]: Include <libio/libioP.h>.
8540         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8541         (fflush): Tweak definition to use INTUSE.
8542         (putc): Define.
8543
8544 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8545
8546         * alloca.c [defined emacs]: Include "lisp.h".
8547         (xalloc_die) [defined emacs]: New macro.
8548         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8549         [! defined emacs]: Include <xalloc.h>.
8550         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8551         (pointer): Typedef to POINTER_TYPE *.
8552         (malloc): Remove decl; we now always use xmalloc.
8553         (alloca): Use old-style definition, since Emacs needs this.
8554         Check for arithmetic overflow when computing combined size.
8555
8556 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8557
8558         Do not generate unlocked-io.h automatically, since it's easier to
8559         maintain it by hand.
8560
8561         * unlocked-io.h: New file, from GNU diffutils,
8562         but with proper copyright notice and attribution.
8563         * gen-uio: Remove.
8564         * Makefile.am: Add copyright notice.
8565         (libfetish_a_SOURCES): Add unlocked-io.h.
8566         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8567         (DISTCLEANFILES, io_functions): Remove macros.
8568         (EXTRA_DIST): Remove gen_uio.
8569         (unlocked-io.h): Remove rule.
8570
8571 2002-12-04  Jim Meyering  <jim@meyering.net>
8572
8573         Reflect the fact that stat.c and lstat.c are no longer generated.
8574         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8575         (DISTCLEANFILES): Likewise.
8576         (EXTRA_DIST): Likewise.
8577         (all_local): Don't depend on stat.c or lstat.c.
8578         (stat.c, lstat.c): Remove rules.
8579         (EXTRA_DIST): Remove xstat.in.
8580
8581         * xstat.in: Remove file.  Contents moved into stat.c.
8582         * stat.c: New file.  Contents mostly from xstat.in.
8583         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8584         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8585
8586         * safe-read.c: Rework so that it may serve to define safe_write, too.
8587         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8588
8589 2002-12-03  Jim Meyering  <jim@meyering.net>
8590
8591         * safe-read.c, safe-write.c: Change variable names and comments, but
8592         not semantics, to minimize the differences between these two files.
8593         (safe_read): Change comment to mention SAFE_READ_ERROR.
8594
8595         * safe-read.c (IS_EINTR): Define.
8596         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8597
8598 2002-12-02  Bruno Haible  <bruno@clisp.org>
8599
8600         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8601         Define, taken from safe-read.c.
8602         (INT_MAX): Provide fallback.
8603         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8604         * safe-write.h (SAFE_WRITE_ERROR): Define.
8605
8606         * safe-read.c (EINTR): Remove definition.
8607         (safe_read): Don't use EINTR if it is absent.
8608
8609 2002-12-02  Jim Meyering  <jim@meyering.net>
8610
8611         * safe-read.c (EINTR): Define.
8612         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8613         (INT_MAX): Provide fallback.
8614         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8615
8616         * safe-read.h (SAFE_READ_ERROR): Define.
8617
8618 2002-12-01  Jim Meyering  <jim@meyering.net>
8619
8620         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8621         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8622
8623 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8624
8625         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8626         hash_rehash): Replace `if (limit <= value) abort ();' with
8627         `if (! (value < limit)) abort ();', for readability.
8628
8629 2002-11-26    <karl@gnu.org>
8630
8631         * strdup.c: copy from libc again, with jim's ok.
8632         * .cppi-disable: re-add strdup.c
8633
8634 2002-11-25    <karl@gnu.org>
8635
8636         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8637         instead of "strtol.c".
8638
8639 2002-11-25  Jim Meyering  <jim@meyering.net>
8640
8641         * mktime.c: Sync from libc, now that it has the latest fix.
8642
8643 2002-11-24    <karl@gnu.org>
8644
8645         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8646         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8647
8648 2002-11-24  Jim Meyering  <jim@meyering.net>
8649
8650         Update from coreutils:
8651
8652         * mktime.c: Merge in changes from libc.
8653
8654         Avoid a link-time failure on some Linux systems.
8655         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8656         (__mon_yday): Declare with the STATIC attribute.
8657         (__mktime_internal): Likewise.
8658         Based on a report from Greg Schafer.
8659
8660 2002-11-23  Jim Meyering  <jim@meyering.net>
8661
8662         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8663         Use `unsigned', not `int', as type of index.
8664
8665         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8666
8667         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8668
8669 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8670
8671         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8672         hint that one should use `if (! x) abort ();' rather than `assert
8673         (x);', and anyway it's one less thing to worry about configuring.
8674         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8675         hash_rehash, hash_insert): Use abort rather than assert.
8676
8677 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8678
8679         * quotearg.h: Allow multiple inclusion by surrounding with
8680         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8681         so that we can be included first.
8682         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8683         * quotearg.c: Include quotearg.h immediately after config.h.
8684         No need to include stddef.h or sys/types.h any more.
8685         Surround local include files with "", not "<>".
8686         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8687         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8688         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8689         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8690         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8691         (ISPRINT): Remove; no longer needed now that we assume C89.
8692
8693         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8694         Preserve errno.
8695
8696         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8697         quotearg_char): Use SIZE_MAX rather than
8698         (size_t) -1 when we are talking about "infinity".
8699
8700         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8701
8702 2002-11-22  Bruno Haible  <bruno@clisp.org>
8703
8704         * safe-read.h: Assume C89. Add comments.
8705         (safe_read): Change return type to size_t.
8706         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8707         counts > SSIZE_MAX correctly.
8708         * safe-write.h: New file.
8709         * safe-write.c: New file.
8710         * full-read.h: New file.
8711         * full-read.c: New file.
8712         * full-write.h: Assume C89. Add comments.
8713         * full-write.c: Include safe-write.h.
8714         (full_write): Rewritten to use safe_write.
8715         Suggested by Jim Meyering and Paul Eggert.
8716
8717 2002-11-21  Bruno Haible  <bruno@clisp.org>
8718
8719         Remove case insensitive option matching.
8720         * argmatch.h (argcasematch): Remove declaration.
8721         (ARGCASEMATCH): Remove macro.
8722         (__xargmatch_internal): Remove case_sensitive argument.
8723         (XARGMATCH): Update.
8724         (XARGCASEMATCH): Remove macro.
8725         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8726         case_sensitive argument.
8727         (argcasematch): Remove function.
8728         (__xargmatch_internal): Remove case_sensitive argument.
8729         (main): Use XARGMATCH instead of XARGCASEMATCH.
8730
8731         * xmalloc.c: Change compile-time error message. Add comment about
8732         required autoconf version.
8733
8734 2002-11-21  Jim Meyering  <jim@meyering.net>
8735
8736         * strdup.c (strdup): Tweak comment and initial #if/#include.
8737
8738         Merge in changes from the coreutils.
8739
8740         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8741         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8742         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8743         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8744         int.  Work more efficiently if X is the same width as uintmax_t.
8745         Do not compare X to -1, to avoid bogus compiler warning.
8746         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8747         Don't assume that f_frsize and f_bsize are the same type.
8748
8749         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8750         on FreeBSD.
8751
8752         * makepath.c (make_path): Restore umask *before* creating the final
8753         component.
8754         (make_path): Minor reformatting.
8755
8756         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8757         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8758
8759         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8760         ones.  At least on GNU/Linux systems, `auto' means something else.
8761         From Michael Stone.
8762
8763 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8764
8765         Merge argmatch cleanups from Bison.  Assume C89.
8766
8767         * argmatch.c: Include config.h here, not in argmatch.h.
8768         Include stdlib.h, for EXIT_FAILURE.
8769         Always include <string.h>, since we assume C89.
8770         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8771         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8772         Include <stddef.h> instead, since it's all we need for size_t.
8773         (PARAMS): Remove.  All uses removed.
8774         (ARRAY_CARDINALITY): Do not bother to #undef.
8775         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8776         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8777         Remove unnecessary parentheses.
8778         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8779         Insert necessary parentheses.
8780         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8781         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8782
8783 2002-11-19  Bruno Haible  <bruno@clisp.org>
8784
8785         * mbswidth.c: Include mbswidth.h right at the beginning.
8786         * mbswidth.h: Include <stddef.h>, for size_t.
8787
8788         * mbswidth.h (PARAMS): Remove macro.
8789         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8790         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8791
8792         * gcd.h (PARAMS): Remove macro.
8793         (gcd): Use ANSI C function declarations.
8794         * gcd.c (gcd): Likewise.
8795
8796 2002-11-15  Bruno Haible  <bruno@clisp.org>
8797
8798         * strcspn.c: Include <stddef.h>.
8799         (strcspn): Use ANSI C function declaration. Change return type to
8800         size_t. Use NULL.
8801         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8802         (strpbrk): Use NULL.
8803         * strpbrk.h (PARAMS): Remove macro.
8804         (strpbrk): Use ANSI C function declaration.
8805         * strstr.c: Don't include <sys/types.h>.
8806         * strstr.h (PARAMS): Remove macro.
8807         (strstr): Use ANSI C function declarations.
8808
8809 2002-11-06  Bruno Haible  <bruno@clisp.org>
8810
8811         * gcd.h (gcd): Change argument type to 'unsigned long'.
8812         * gcd.c (gcd): Likewise.
8813
8814 2002-11-05  Bruno Haible  <bruno@clisp.org>
8815
8816         * gcd.h: New file, from gettext-0.11.5.
8817         * gcd.c: New file, from gettext-0.11.5.
8818
8819 2002-11-05  Bruno Haible  <bruno@clisp.org>
8820
8821         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8822         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8823         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8824         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8825
8826         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8827         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8828
8829         * closeout.c: Include gettext.h instead of <libintl.h>.
8830         * human.c: Include gettext.h instead of <libintl.h>.
8831         * quotearg.c: Include gettext.h instead of <libintl.h>.
8832         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8833         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8834         * userspec.c: Include gettext.h instead of <libintl.h>.
8835         * version-etc.c: Include gettext.h instead of <libintl.h>.
8836         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8837         (textdomain): Remove definition.
8838         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8839
8840         * long-options.c: Remove include of <libintl.h> and definition of _.
8841         * same.c: Remove include of <libintl.h> and definition of _.
8842
8843 2002-11-04  Bruno Haible  <bruno@clisp.org>
8844
8845         * stpcpy.h: New file, from GNU gettext-0.11.5.
8846         * strcase.h: New file, from GNU gettext-0.11.5.
8847         * strpbrk.h: New file, from GNU gettext-0.11.5.
8848         * strstr.h: New file, from GNU gettext-0.11.5.
8849         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8850
8851 2002-05-09  Bruno Haible  <bruno@clisp.org>
8852
8853         * config.charset: Update for newest glibc. Add canonical names
8854         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8855
8856 2002-05-09  Bruno Haible  <bruno@clisp.org>
8857
8858         * localcharset.c (get_charset_aliases): Add more Windows specific
8859         aliases.
8860
8861 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8862
8863         * config.charset: A few additions for Solaris.
8864
8865 2001-12-05  Bruno Haible  <bruno@clisp.org>
8866
8867         * localcharset.c (locale_charset): Don't return an empty string.
8868
8869 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8870
8871         * config.charset: msdos in uk_UA uses CP1125.
8872
8873 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8874
8875         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8876         * localcharset.c (locale_charset): Declare as extern "C".
8877
8878 2002-02-15  Bruno Haible  <bruno@clisp.org>
8879
8880         * config.charset [msdosdjgpp]: For Russian, use CP866.
8881
8882 2002-02-11  Bruno Haible  <bruno@clisp.org>
8883
8884         * config.charset: Add support for NetBSD.
8885
8886 2002-09-25    <karl@gnu.org>
8887
8888         * strdup.c: copy from libc/string (via ../config/srclist*).
8889         * getopt*: copy from libc/posix.
8890         * gettext.h: copy from gettext.
8891         * .cppi-disable: add strdup.c, gettext.h.
8892
8893 2002-07-01  Jim Meyering  <meyering@lucent.com>
8894
8895         * c-stack.c: Include sys/time.h.
8896         From Volker Borchert.
8897
8898 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8899
8900         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8901         New macro.  Use it uniformly instead of
8902         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8903         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8904         reported by Vin Shelton.
8905
8906 2002-06-22  Jim Meyering  <meyering@lucent.com>
8907
8908         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8909         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8910
8911 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8912
8913         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8914         Do not assume SA_SIGINFO behavior.
8915         Bug reported by Jim Meyering on NetBSD 1.5.2.
8916
8917 2002-06-22  Jim Meyering  <meyering@lucent.com>
8918
8919         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8920
8921         * exitfail.c, exitfail.h: Likewise.
8922         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8923
8924         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8925         of fnmatch.h.
8926         (EXTRA_DIST): Add fnmatch_loop.c.
8927         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8928
8929         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8930         * fnmatch.c: Update from diffutils-2.8.2.
8931         * fnmatch_.h: New file.  From diffutils-2.8.2.
8932         * fnmatch.h: Remove file.
8933
8934 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8935
8936         * file-type.h: Report an error if neither S_ISREG nor
8937         S_IFREG is defined, instead of using a test specific to glibc
8938         2.2.  This should be safe, since POSIX requires S_ISREG and
8939         Unix Version 7 had S_IFREG.  We don't need to check for
8940         <sys/types.h> since we don't use any symbols that it defines.
8941
8942 2002-06-15  Jim Meyering  <meyering@lucent.com>
8943
8944         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8945         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8946         have been included before this file.
8947
8948 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8949
8950         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8951         so that each temporary file name is unique and valid in the first
8952         8 characters, for operation under DOS.
8953
8954 2002-06-15  Jim Meyering  <meyering@lucent.com>
8955
8956         Work even with DJGPP 2.03, which lacks support for symlinks.
8957         From Richard Dawe.
8958         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8959         is defined.
8960         * lchown.c (S_ISLNK): Likewise.
8961
8962 2002-06-14  Jim Meyering  <meyering@lucent.com>
8963
8964         * file-type.h: Use the version from diffutils-2.8.2.
8965         * file-type.c: Likewise.
8966
8967 2002-05-27  Jim Meyering  <meyering@lucent.com>
8968
8969         Fix a problem seen only on nonconforming systems whereby ls.c's
8970         use of localtime, and then of gettimeofday would cause trouble:
8971         the localtime call used to initialize rpl_gettimeofday's save
8972         mechanism would clobber ls's current local time information so
8973         that in any long listing the first file would always be listed
8974         with date 1970-01-01.  Analysis by Volker Borchert.
8975
8976         * gettimeofday.c (localtime): Undefine.
8977         (rpl_localtime): New function.
8978
8979 2002-05-22  Jim Meyering  <meyering@lucent.com>
8980
8981         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8982         * file-type.h: New file.
8983         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8984
8985 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8986
8987         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8988
8989 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8990
8991         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8992         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8993         of 127, since 64 is the largest conceivable number for ancient
8994         nonstandard hosts.
8995         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8996
8997 2002-04-28  Jim Meyering  <meyering@lucent.com>
8998
8999         * sig2str.c (WTERMSIG): Remove definition (unused).
9000
9001 2002-04-28  Paul Eggert  <eggert@twinsun.com>
9002
9003         * sig2str.h, sig2str.c: New files.
9004         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
9005
9006 2002-04-24  Jim Meyering  <meyering@lucent.com>
9007
9008         * gettext.h: New file, from Gettext.
9009         * Makefile.am (INCLUDES): Remove -I../intl.
9010         (libfetish_a_SOURCES): Add gettext.h.
9011
9012 2002-04-16  Jim Meyering  <meyering@lucent.com>
9013
9014         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
9015         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
9016         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
9017
9018 2002-04-12  Jim Meyering  <meyering@lucent.com>
9019
9020         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
9021
9022 2002-03-10  Jim Meyering  <meyering@lucent.com>
9023
9024         * makepath.c (make_path): Remove a comma from a diagnostic.
9025         Suggestion from Santiago Vila.
9026
9027 2002-03-08  Jim Meyering  <meyering@lucent.com>
9028
9029         * rename.c: Mention that this wrapper is needed also on
9030         mips-dec-ultrix4.4 systems.
9031
9032 2002-03-02  Jim Meyering  <meyering@lucent.com>
9033
9034         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
9035         not HAVE_CLOCK_SETTIME.
9036
9037 2002-02-27  Paul Eggert  <eggert@twinsun.com>
9038
9039         * nanosleep.h: Rename to....
9040         * timespec.h: New name for nanosleep.h.  All uses changed.
9041
9042         * gettime.c: New file.
9043         * settime.c: New file.
9044         * stime.c: Remove.
9045
9046         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9047         timespec.h.  Remove nanosleep.h.
9048
9049 2002-02-25  Paul Eggert  <eggert@twinsun.com>
9050
9051         * acl.c, acl.h: New files.
9052         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9053
9054 2002-02-24  Jim Meyering  <meyering@lucent.com>
9055
9056         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9057         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9058         cause trouble.  Reported by Nelson Beebe.
9059
9060 2002-02-23  Paul Eggert  <eggert@twinsun.com>
9061
9062         * path-concat.c (xpath_concat): Reorder code to pacify
9063         compilers that don't know that xalloc_die never returns.
9064
9065 2002-02-20  Jim Meyering  <meyering@lucent.com>
9066
9067         * getdate.c: Regenerate using bison-1.33.
9068
9069 2002-02-15  Paul Eggert  <eggert@twinsun.com>
9070
9071         * posixver.c, posixver.h: New files.
9072         * Makefile.am (libfetish_a_SOURCES): Add them.
9073
9074 2002-02-02  Paul Eggert  <eggert@twinsun.com>
9075             Bruno Haible  <bruno@clisp.org>
9076
9077         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9078         (fwrite_success_callback): New declaration.
9079         * unicodeio.c (unicode_to_mb): New function, extracted from
9080         print_unicode_char. Call failure callback instead of error.
9081         (fwrite_success_callback): New function.
9082         (exit_failure_callback): New function.
9083         (fallback_failure_callback): New function.
9084         (print_unicode_char): Call unicode_to_mb.
9085
9086 2002-01-26  Jim Meyering  <meyering@lucent.com>
9087
9088         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9089
9090 2002-01-22  Jim Meyering  <meyering@lucent.com>
9091
9092         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9093         Otherwise, some versions of automake would omit the rule that makes
9094         Makefile from Makefile.in.
9095
9096 2001-01-21  Paul Eggert  <eggert@twinsun.com>
9097
9098         * xmemcoll.h, xmemcoll.c: New files.
9099         * Makefile.am (libfetish_a_SOURCES): Add them.
9100         * memcoll.c: Include errno.h, and declare errno if not defined.
9101         (memcoll): Set errno to zero if there is no error.
9102
9103         * quotearg.c (quotearg_buffer_restyled):
9104         Fix bug with quoting buffers containing NUL when backslashing escapes.
9105         This bug was exposed by the other changes in this patch.
9106         (quotearg_n_options): New arg ARGSIZE.
9107         All callers changed.
9108         (quoting_options_from_style): New function.
9109         (quotearg_n_style): Use it.
9110         (quotearg_n_style_mem): New function.
9111
9112         * quotearg.h (quotearg_n_style_mem): New function.
9113
9114 2002-01-16  Jim Meyering  <meyering@lucent.com>
9115
9116         * getdate.y: Add three semicolons, each just before a closing brace.
9117         Bison (as of version 1.31) no longer papers over that mistake.
9118
9119 2002-02-14  Paul Eggert  <eggert@twinsun.com>
9120
9121         * backupfile.c (ISDIGIT): Comment fix.
9122         * getdate.y (ISDIGIT): Likewise.
9123         * posixtm.c (ISDIGIT, year): Likewise.
9124         * strverscmp.c (ISDIGIT): Likewise.
9125         * userspec.c (ISDIGIT): Likewise.
9126
9127 2002-01-05  Jim Meyering  <meyering@lucent.com>
9128
9129         * version-etc.c (version_etc_copyright): Update copyright year.
9130
9131 2001-01-19  Paul Eggert  <eggert@twinsun.com>
9132
9133         * closeout.c (close_stdout_status): If ferror (stdout), do
9134         not silently exit merely because the output buffer happens to
9135         have nothing pending.
9136
9137 2001-12-18  Paul Eggert  <eggert@twinsun.com>
9138
9139         See the big note in ../ChangeLog.
9140         * human.c (suffixes): Prefer K to k for 1024.
9141         (generate_suffix_backwards): New function.
9142         (human_readable_inexact): Use it.
9143         * xstrtol.c (__xstrtol): If there is no number but there
9144         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
9145         Accept 'K' as well as 'k'.
9146
9147 2001-12-15  Jim Meyering  <meyering@lucent.com>
9148
9149         * regex.h (__restrict_arr): Update from libc.
9150
9151         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9152         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
9153         (STREQ): Define.
9154
9155 2001-12-10  Jim Meyering  <meyering@lucent.com>
9156
9157         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9158         Instead, include "xalloc.h".
9159         (initbuffer): Don't cast xmalloc return value to char*.
9160         (readline): Reword comment.
9161         Don't cast xrealloc return value to char*
9162         Return NULL, not 0.
9163
9164 2001-12-09  Jim Meyering  <meyering@lucent.com>
9165
9166         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9167         `signed and unsigned type in conditional expression'.
9168         * posixtm.c (posix_time_parse): Likewise.
9169
9170         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9171
9172         * readtokens.c (readtoken): Declare an index to be of type unsigned
9173         to avoid a pedantic warning.
9174
9175         * getstr.c: Don't include assert.h.
9176         (getstr): Remove warning-evoking assertions.
9177         Return -1 if offset parameter is out of bounds.
9178         Change the type of a local from int to size_t.
9179
9180         * strftime.c (my_strftime_localtime_r): Include this function
9181         definition in the `#if ! HAVE_TM_GMTOFF' block.
9182
9183         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9184         Include xalloc.h instead.
9185
9186 2001-12-02  Jim Meyering  <meyering@lucent.com>
9187
9188         * tempname.c: Don't declare getenv, thus reverting the change of
9189         2001-11-18.  It's no longer necessary, now that stdlib.h is always
9190         included.
9191
9192         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9193         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
9194
9195 2001-11-30  Akim Demaille  <akim@epita.fr>
9196
9197         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9198         before being defined.
9199
9200 2001-11-27  Paul Eggert  <eggert@twinsun.com>
9201
9202         * quotearg.h (quotearg_n, quotearg_n_style):
9203         First arg is int, not unsigned.
9204         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9205         (SIZE_MAX, UINT_MAX): New macros.
9206         (quotearg_n_options): Abort if N is negative.
9207         Avoid overflow check on hosts where size_t is 64 bits and int
9208         is 32 bits, as overflow is impossible there.
9209         Fix off-by-one typo that caused unnecessary reallocation.
9210
9211 2001-11-27  Jim Meyering  <meyering@lucent.com>
9212
9213         * tempname.c: Merge with version from libc.
9214         * regex.c: Likewise.
9215
9216         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9217         for which STDC_HEADERS is 0, it was not included, resulting in a
9218         warning about an integer-to-pointer conversion problem with getenv.
9219         Reported by Volker Borchert.
9220
9221 2001-11-26  Jim Meyering  <meyering@lucent.com>
9222
9223         * gtod.h: Remove file.
9224         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9225         * gettimeofday.c: Don't include gtod.h.
9226         (GTOD_init): Remove function.
9227         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9228         Suggestion from Volker Borchert.
9229
9230 2001-11-23  Jim Meyering  <meyering@lucent.com>
9231
9232         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9233         * hash.c (struct hash_table): Define it here instead.
9234
9235 2001-11-22  Jim Meyering  <meyering@lucent.com>
9236
9237         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9238
9239 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9240
9241         * tempname.c (TMP_MAX): Remove; no longer needed.
9242         (TEMPORARIES): New macro.
9243         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9244         removes an artificial limitation (e.g. HP-UX 10.20, where
9245         TMP_MAX is 17576).
9246
9247 2001-11-18  Jim Meyering  <meyering@lucent.com>
9248
9249         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9250         on SunOS 4.
9251
9252         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9253         files will be created before anything else.
9254
9255 2001-11-17  Jim Meyering  <meyering@lucent.com>
9256
9257         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9258         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9259         rather than group writable.  Patch by Juan F. Codagnone.
9260
9261         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9262         Instead, include "xalloc.h".
9263
9264         * mountlist.c: Include unlocked-io.h after all system headers.
9265         Remove explicit declarations of xmalloc, xrealloc,
9266         and xstrdup.  Instead, include "xalloc.h".
9267
9268         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9269         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9270         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9271
9272         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9273         Reported by Padraig Brady.
9274
9275         * mkstemp.c: #undef mkstemp.
9276         Include config.h.
9277         (rpl_mkstemp): Rename from mkstemp.
9278         Protoize.
9279
9280 2001-11-16  Jim Meyering  <meyering@lucent.com>
9281
9282         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9283         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9284         determine the amount of total physical memory, use pstat_getstatic.
9285         HPUX-11 doesn't define _SC_PHYS_PAGES.
9286         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9287         If sysconf couldn't be used to determine the amount of available
9288         physical memory, use both pstat_getstatic and pstat_getdynamic.
9289         Based on a patch from Bob Proulx.
9290
9291 2001-11-05  Jim Meyering  <meyering@lucent.com>
9292
9293         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9294
9295 2001-11-03  Jim Meyering  <meyering@lucent.com>
9296
9297         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9298         in argmatch_to_argument call.
9299
9300         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9301         argument.
9302
9303         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9304         e.g., a fault due to an attempt to free a NULL pointer.
9305
9306 2001-11-01  Jim Meyering  <meyering@lucent.com>
9307
9308         * dirfd.c, dirfd.h: New files.
9309         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9310
9311         * hash.c (hash_print) [TESTING]: Clean up.
9312
9313 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9314
9315         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9316         to avoid a warning if -Wall.
9317
9318 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9319
9320         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9321
9322 2001-10-21  Jim Meyering  <meyering@lucent.com>
9323
9324         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9325         this code would end up calling gettext even in packages built
9326         with --disable-nls.
9327         * getopt.c (_): Likewise.
9328         * regex.c (_): Likewise.
9329
9330 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9331
9332         * error.c (strerror_r): Do not declare unless !_LIBC.
9333         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9334         Use strerror_r that is only a macro, even if it is not a function.
9335         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9336         (private_strerror): Use prototypes, not old-style function definition.
9337         (print_errno_message): New function.
9338         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9339         char*-flavored one.
9340         (error_tail, error, error_at_line): Use it.
9341
9342 2001-10-11  Jim Meyering  <meyering@lucent.com>
9343
9344         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9345         and quote_n (1, ... to avoid clobbering a buffer.
9346
9347 2001-10-05  Jim Meyering  <meyering@lucent.com>
9348
9349         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9350         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9351         * hash-pjw.h: New file.
9352
9353 2001-09-30  Jim Meyering  <meyering@lucent.com>
9354
9355         * mountlist.c [MOUNTED_GETFSSTAT]:
9356         Include <sys/ucred.h>, for Apple Darwin.
9357         Include sys/mount.h and sys/fs_types.h only if available.
9358         (FS_TYPE): Define.
9359         (read_filesystem_list): Use FS_TYPE.
9360
9361 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9362
9363         * exclude.c (excluded_filename): 0 -> false, since it's
9364         a boolean context.
9365
9366 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9367
9368         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9369         #defines strtoimax.  Also treat the other strto* functions
9370         like strtoimax.
9371
9372         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9373         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9374         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9375
9376 2001-09-26  Jim Meyering  <meyering@lucent.com>
9377
9378         Most macros in unlocked-io.h had the wrong number of arguments.
9379         * gen-uio: New script.
9380         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9381         * unlocked-io.hin: Remove file.
9382         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9383         rather than trying to embed it here.
9384         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9385         Reported by Padraig Brady.
9386
9387 2001-09-25  Volker Borchert  <bt@teknon.de>
9388
9389         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9390
9391 2001-09-23  Jim Meyering  <meyering@lucent.com>
9392
9393         * mountlist.c: Remove useless parentheses in #if directives.
9394         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9395         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9396
9397 2001-09-22  Jim Meyering  <meyering@lucent.com>
9398
9399         * localcharset.c: Update from latest gettext.
9400         * config.charset: Likewise.
9401
9402 2001-09-20  Jim Meyering  <meyering@lucent.com>
9403
9404         * xstrtol.c (strtoimax): Guard declaration with
9405         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9406         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9407         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9408         (strtoumax): Likewise, for completeness (it wasn't necessary).
9409
9410 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9411
9412         * strtoimax.c (HAVE_LONG_LONG):
9413         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9414         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9415         to work around bug in IBM C compiler.
9416
9417 2001-09-16  Jim Meyering  <meyering@lucent.com>
9418
9419         * mkdir.c: New file.
9420
9421 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9422
9423         * xgetcwd.c: Revert some of the previous change; intead,
9424         fix the HAVE_GETCWD_NULL code to behave more like the
9425         !HAVE_GETCWD_NULL code used to.
9426
9427         Include "xalloc.h".
9428         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9429         invoke xalloc_die.
9430
9431 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9432
9433         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9434         Use ssize_t, not int, to store result of readlink.
9435         Check for ssize_t overflow as well as size_t overflow,
9436         as POSIX says the result of readlink is implementation-defined
9437         when ssize_t overflows.
9438         Remove unnecessary cast to char*.
9439         Use free+malloc instead of realloc, as the storage doesn't need
9440         to be preserved and it's clearer and can be more efficient that way.
9441         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9442         * xreadlink.h (xreadlink): Update prototype.
9443
9444 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9445
9446         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9447         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9448         spotted by Jim Meyering.
9449
9450 2001-09-03  Jim Meyering  <meyering@lucent.com>
9451
9452         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9453
9454 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9455
9456         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9457         like the HAVE_GETCWD_NULL code.
9458         Include pathmax.h if not HAVE_GETCWD.
9459         Do not include xalloc.h.
9460         (INITIAL_BUFFER_SIZE): New symbol.
9461         Do not use xmalloc / xrealloc, since the caller is responsible for
9462         handling errors.  Preserve errno around `free' during failure.
9463         Do not overrun buffer when using getwd.
9464
9465 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9466
9467         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9468         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9469
9470 2001-09-02  Jim Meyering  <meyering@lucent.com>
9471
9472         * error.c: Update from GNU libc.
9473
9474 2001-09-01  Jim Meyering  <meyering@lucent.com>
9475
9476         * xreadlink.c: New file.
9477         * xreadlink.h: New file.
9478         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9479
9480         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9481         doesn't conflict with sparc Solaris 7's definition in
9482         /usr/include/sys/int_types.h.
9483
9484         * exclude.c: Use `""', not `<>' to #include non-system header files.
9485         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9486         and strncasecmp as r-values.  Unixware didn't have declarations.
9487
9488 2001-08-31  Jim Meyering  <meyering@lucent.com>
9489
9490         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9491         Use an initial, malloc'd, buffer of length 128 rather than
9492         a statically allocated one of length 1024.
9493
9494 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9495
9496         * xgetcwd.c: Don't include pathmax.h.
9497         Include stdlib.h and unistd.h if available.
9498         Include xalloc.h.
9499         (xmalloc, xstrdup, free): Remove decls.
9500         (xgetcwd): Don't assume sizes fit in unsigned.
9501         Check for overflow when computing sizes.
9502         Simplify reallocation code.
9503
9504 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9505
9506         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9507
9508         * strtoimax.c: Renamed from strtoxmax.c, removing the
9509         old strtoimax.c.
9510
9511         Also, make the following further changes to make this file's
9512         configuration more similar to that of strtol.c:
9513         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9514         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9515         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9516         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9517         changed to signed values.
9518
9519         And make the following changes as well:
9520         Fix copyright notice, as 1999 was missing.
9521         (verify): New macro.
9522         (strtoimax): Check sizes at compile-time, not run-time.
9523         Prefer strtol to strtoll if both work.
9524         (main): Remove; it was not that useful and was a pain to maintain.
9525
9526         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9527
9528 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9529
9530         * savedir.c (savedir): Remove size parameter, as POSIX says that
9531         a directory's st_size can have an arbitrary value, so the old
9532         usage could waste an arbitrary amount of memory.  All uses
9533         changed.
9534         * savedir.h: Update prototype.
9535
9536 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9537
9538         * xstrtol.c (strtoimax): New decl.
9539
9540 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9541
9542         * xstrtol.h: Add copyright notice.
9543         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9544         LONGINT_INVALID_SUFFIX_CHAR.
9545
9546 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9547
9548         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9549         tm to be declared.
9550
9551 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9552
9553         * hash.c: Remove '2001' from copyright notice.
9554
9555 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9556
9557         * full-write.h: New file.
9558         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9559         * full-write.c: Correct credits, as cccp.c no longer
9560         exists and anyway it was so heavily changed from the old cccp
9561         code as to be unrecognizable.  Include full-write.h.
9562         (full_write) Return size_t, with short writes meaning failure.
9563         All callers changed.  This fixes a bug with large buffers
9564         on 64-bit hosts.
9565         * utime.c: Include full-write.h.
9566
9567 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9568
9569         Merge 'exclude' changes from tar 1.13.22.
9570         This fixes one or two unlikely storage allocation overflow bugs,
9571         but doesn't change user-visible behavior otherwise.
9572
9573 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9574
9575         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9576         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9577         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9578         Include if available.
9579         (<xalloc.h>): Include
9580         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9581         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9582         collide with FNM macros.
9583         (struct patopts): New struct.
9584         (struct exclude): Use it, as exclude patterns now come with options.
9585         (new_exclude): Support above changes.
9586         (new_exclude, add_exclude_file):
9587         Initial size must now be a power of two to simplify overflow checking.
9588         (free_exclude, fnmatch_no_wildcards): New function.
9589         (excluded_filename): No longer requires options arg, as the options
9590         are determined by add_exclude.  Now returns bool, not int.
9591         (excluded_filename, add_exclude):
9592         Add support for the fancy new exclusion options.
9593         (add_exclude, add_exclude_file): Now takes int options arg.
9594         Check for arithmetic overflow when computing sizes.
9595         (add_exclude_file): xrealloc might modify errno, so don't
9596         realloc until after errno might be used.
9597
9598         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9599         New macros.
9600         (free_exclude): New decl.
9601         (add_exclude, add_exclude_file): Now takes int options arg.
9602         (excluded_filename): No longer requires options arg, as the options
9603         are determined by add_exclude.  Now returns bool, not int.
9604
9605 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9606
9607         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9608
9609 2001-08-27  Jim Meyering  <meyering@lucent.com>
9610
9611         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9612
9613         * version-etc.c (N_): Remove definition.
9614         Revert most of last change.
9615         Instead, simply don't mark the `Copyright...' string for translation.
9616         Based on advice from Paul Eggert.
9617
9618         * strtoxmax.c: Tweak comment.
9619
9620 2001-08-26  Jim Meyering  <meyering@lucent.com>
9621
9622         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9623         of copyright with `%s' so translators don't get an untranslated
9624         message in 2002.
9625         (COPYRIGHT_YEAR): Define.
9626         (version_etc): Use fprintf rather than fputs.
9627         Suggestion from Ulrich Drepper.
9628
9629         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9630
9631         * strtoll.c: New file, from GNU libc.
9632         * xstrtoimax.c: New file.
9633
9634         * xstrtol.h: Add xstrtoimax.
9635         * strtoumax.c: New file.  Simply include "strtoumax.c".
9636         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9637
9638         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9639         * strtoxmax.c: ... then renamed to this.
9640
9641 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9642
9643         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9644         Port to Solaris 8, where 'sed' requires a space after the 'r'
9645         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9646         Redirect output to $tmp just once.
9647
9648 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9649
9650         * addext.c (<errno.h>): Include.
9651         (errno): Declare if not defined.
9652         (addext): Work correctly when pathconf returns -1 and leaves
9653         errno alone because there is no limit.  Also, work even if
9654         pathconf returns a value greater than SIZE_MAX.
9655
9656 2001-08-12  Jim Meyering  <meyering@lucent.com>
9657
9658         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9659         Simply `return getcwd (NULL, 0);'.
9660         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9661         Use 1300 as initial value for length, not PATH_MAX.
9662
9663         * pathmax.h: Clean up cpp syntax.
9664
9665 2001-08-12  Jim Meyering  <meyering@lucent.com>
9666
9667         * gettimeofday.c: New file.
9668         * gtod.h: New file.
9669         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9670
9671 2001-08-04  Jim Meyering  <meyering@lucent.com>
9672
9673         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9674         to get in sync with glibc.
9675
9676 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9677
9678         The following changes are from gettext 0.10.39 as maintained by
9679         Bruno Haible.
9680
9681         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9682         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9683         with inverted sense.  All uses changed.
9684
9685         * mbswidth.c: Don't include <limits.h>.
9686         Include <stdlib.h> and <string.h> unconditionally.
9687         (iswcntrl, mbsinit, ISCNTRL): New macros.
9688         (mbsnwidth): Use K&R style function declarations.
9689         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9690         can optimize it when MB_CUR_MAX == 1.
9691         The width of control characters is zero, not 1.
9692
9693 2001-07-15  Jim Meyering  <meyering@lucent.com>
9694
9695         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9696         (BUILT_SOURCES): Add unlocked-io.h.
9697         (io_functions): Define.
9698         (unlocked-io.h): New rule.
9699         (DISTCLEANFILES): Add unlocked-io.h.
9700         (all-local): Depend on unlocked-io.h, to ensure it is created.
9701
9702         * unlocked-io.hin: New file
9703
9704         * regex.c: Update from glibc.
9705
9706 2001-07-05  Jim Meyering  <meyering@lucent.com>
9707
9708         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9709         recommendation.
9710         (libfetish_a_SOURCES): Put all .h files here instead.
9711         Remove a thus-exposed (better checks in automake) duplicate and
9712         two unnecessary .h files.
9713
9714 2001-06-11  Jim Meyering  <meyering@lucent.com>
9715
9716         * regex.c: Update from GNU libc.
9717
9718 2001-05-27  Jim Meyering  <meyering@lucent.com>
9719
9720         * readutmp.h (UT_TYPE): Define.
9721
9722 2001-05-24  Jim Meyering  <meyering@lucent.com>
9723
9724         * argmatch.c: Include "quote.h".
9725         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9726         quote function.  Reported by Göran Uddeborg.
9727
9728 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9729
9730         * dirname.c (dir_name): Compute append_dot using path, not newpath
9731         which is not yet declared.
9732
9733 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9734
9735         * Makefile.am (libfetish_a_SOURCES):
9736         Add strftime.c, since we now compile it on all hosts.
9737
9738         * strftime.c (my_strftime):
9739         Define to nstrftime if emacs, but only if my_strftime is not defined.
9740         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9741         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9742         Add one more extra argument: a nanoseconds value.
9743         All uses changed.
9744         (ns): New macro.
9745         (my_strftime function): Add %N format.
9746         (emacs_strftimeu): Renamed from emacs_strftime,
9747         with extra ut argument.
9748
9749 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9750
9751         dirname code cleanup.  base_name now behaves more compatibly
9752         with POSIX basename when given file names that have trailing
9753         slashes, and similarly for dir_name.  Add new primitives
9754         base_len and dir_len.  Put the directory-name-related decls
9755         into dirname.h.
9756
9757         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9758         * backupfile.c (base_name): Likewise.
9759         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9760         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9761         * makepath.c (strip_trailing_slashes): Likewise.
9762         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9763         Likewise.
9764         * rename.c (strip_trailing_slashes): Likewise.
9765         * same.c (base_name): Likewise.
9766         * stripslash.c (ISSLASH): Likewise.
9767
9768         * addext.c: Include <dirname.h> after size_t is defined.
9769         * backupfile.c: Likewise.
9770
9771         * addext.c (addext): Use base_len to trim redundant
9772         trailing slashes instead of doing it ourselves.
9773         But do not trim the last slash if it is not redundant.
9774
9775         * backupfile.c (find_backup_file_name,
9776         max_backup_version): Use base_len instead of rolling it ourselves.
9777         Handle the case of "" and (on DOS) "C:" correctly.
9778
9779         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9780         Include <string.h>, <dirname.h>.
9781         (base_name): Allow file names ending in slashes, other than names
9782         that are all slashes.  In this case, return the basename followed
9783         by the slashes.  This is more general, and can be used in places
9784         where the original base_name purposely had an assertion failure.
9785         (base_len): New function.
9786
9787         * dirname.c: Include <string.h> instead of <stdlib.h>.
9788         Do not include <assert.h>; no longer needed.
9789         Include xalloc.h.
9790         (memrchr): Remove decl.
9791         (dir_name_r): Remove.
9792         (dir_len): Renamed from dirlen.  All callers changed.
9793         Rewrite in terms of base_name, for simplicity and consistency.
9794         (dir_name): Never return NULL.  All callers changed.
9795         Do not include <stdlib.h> in test program; no longer needed.
9796         return 0; is fine for test program.
9797
9798         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9799         New macros.
9800         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9801
9802         * path-concat.c (path_concat): Use base_len to compute
9803         base length, not strlen; this means we cannot rely on memcpy
9804         to null-terminate.
9805
9806         * same.c (STREQ): Remove.
9807         (same_name): Handle the case where the basename ends in trailing '/'.
9808
9809         * stripslash.c (strip_trailing_slashes): Return nonzero if
9810         a slash was stripped.  Do not strip the last slash after a
9811         file system prefix.
9812
9813 2001-04-08  Jim Meyering  <meyering@lucent.com>
9814
9815         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9816         recomputed; that's necessary when the offset spans a DST transition.
9817         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9818
9819 2001-04-02  Jim Meyering  <meyering@lucent.com>
9820
9821         * regex.h, regex.c: Update from GNU libc.
9822
9823 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9824
9825         * version-etc.c (version_etc_copyright): Update to 2001.
9826
9827 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9828
9829         * tempname.c (uint64_t): Define to uintmax_t if
9830         not defined, and if UINT64_MAX is not defined.
9831         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9832         Reported by John David Anglin.
9833
9834 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9835
9836         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9837         alias if codeset is empty.
9838         * config.charset (BeOS): Use wildcard syntax.
9839
9840 2001-03-13  Jim Meyering  <meyering@lucent.com>
9841
9842         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9843         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9844         From Bruno Haible.
9845
9846 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9847
9848         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9849         Don't return NULL.
9850         * unicodeio.c (print_unicode_char): Simplify accordingly.
9851
9852 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9853
9854         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9855         support for DOS/DJGPP.
9856
9857 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9858
9859         * Makefile.am (libfetish_a_SOURCES):
9860         Add dup-safer.c, fopen-safer.c.
9861         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9862
9863         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9864
9865 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9866
9867         The mkstemp replacement is taken from glibc 2.2.2, with some
9868         portability fixes for use outside glibc, as follows:
9869
9870         * tempname.c (struct_stat64): New macro.
9871         (direxists, __gen_tempname): Use it.
9872         This avoids a portability problem with Solaris 8.
9873
9874         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9875         (<stddef.h>, <stdint.h>, <string.h>):
9876         Include only if STDC_HEADERS || _LIBC.
9877         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9878         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9879         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9880         (__set_errno): Define this macro if <errno.h> doesn't.
9881         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9882         Define these macros if <stdio.h> doesn't.
9883         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9884         Define these macros if <sys/stat.h>
9885         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9886         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9887         __xstat64): Define if not _LIBC.
9888         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9889         (__gen_tempname): Invoke gettimeofday only if
9890         HAVE_GETTIMEOFDAY || _LIBC;
9891         otherwise, fall back on plain "time".
9892         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9893
9894         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9895
9896         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9897
9898 2001-02-17  Jim Meyering  <meyering@lucent.com>
9899
9900         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9901         around included file name.
9902
9903         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9904
9905         * strftime.c: Update from GNU libc (the only changes were to comments).
9906
9907 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9908
9909         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9910
9911 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9912
9913         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9914         Remove workaround macros for hosts that have mbrtowc but not
9915         mbstate_t, as we now insist on proper declarations for both
9916         before using mbrtowc.
9917
9918 2001-02-17  Jim Meyering  <meyering@lucent.com>
9919
9920         * regex.c: Update from libc.
9921
9922 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9923
9924         * alloca.c (malloc): Undef before defining, since stdlib.h
9925         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9926         Reported by Mark Hounschell via Paul Eggert.
9927
9928 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9929
9930         * config.charset: Update for FreeBSD 4.2.
9931
9932 2001-01-26  Jim Meyering  <meyering@lucent.com>
9933
9934         * quotearg.c: Include stddef.h.
9935         * quote.c: Include stddef.h.
9936         Reported by Axel Kittenberger.
9937
9938         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9939         line in double quotes so that it evokes a better diagnostic.
9940         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9941         Reported by Axel Kittenberger.
9942
9943 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9944
9945         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9946         to avoid a warning.  Add back 'const' to inptr.
9947
9948 2001-01-16  Jim Meyering  <meyering@lucent.com>
9949
9950         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9951         From Bruno Haible.
9952
9953 2001-01-14  Jim Meyering  <meyering@lucent.com>
9954
9955         * rename.c: New file.  From Volker Borchert.
9956         Include stdlib.h, string.h or strings.h, and xalloc.h.
9957         Use strip_trailing_slashes rather than open-coding it.
9958
9959 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9960
9961         * strftime.c: Sync with glibc time/strftime.c 1.81.
9962
9963 2001-01-03  Jim Meyering  <meyering@lucent.com>
9964
9965         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9966         local `inptr' to avoid warning with some system declarations of iconv.
9967
9968 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9969
9970         * modechange.c: Do not assume that mode_t uses the
9971         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9972         the other-execute bit of FOO even if S_IXOTH != 1.
9973
9974         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9975         WOTH, XOTH, ALLM): New macros.
9976         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9977          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9978         Use them.
9979         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9980         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9981         (mode_compile):
9982         No need to use uintmax_t; unsigned long is long enough.
9983         Don't bother to get suffix since we don't use it.
9984
9985 2000-12-24  Jim Meyering  <meyering@lucent.com>
9986
9987         * hash.c (is_prime): Return explicit boolean values.
9988         (hash_get_first): Return NULL to appease Irix5.6's 89.
9989         Reported by Nelson Beebe.
9990
9991 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9992
9993         * localcharset.c (locale_charset): Add support for Win32.
9994
9995 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9996
9997         * physmem.h, physmem.c: New files.
9998
9999         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
10000         (noinst_HEADERS): Add physmem.h.
10001
10002         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
10003         't' for compatibility with Solaris 8 sort.
10004
10005 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
10006
10007         * config.charset: Add support for BeOS.
10008
10009 2000-12-16  Jim Meyering  <meyering@lucent.com>
10010
10011         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
10012         SHELLS_FILE to a file name that's useful on djgpp systems.
10013         Include stdlib.h.
10014         (ADDITIONAL_DEFAULT_SHELLS): Define.
10015         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
10016         Based mostly on a patch from Prashant TR.
10017
10018 2000-12-16  Jim Meyering  <meyering@lucent.com>
10019
10020         This bug had a serious impact on chown: `chown N:M FILE' (for integer
10021         N and M) would have treated it like `chown N:N FILE'.
10022
10023         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
10024
10025 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
10026
10027         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
10028         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
10029         to the list of canonical encodings. Rename EUC-CN to GB2312.
10030
10031 2000-12-08  Andreas Schwab  <schwab@suse.de>
10032
10033         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
10034         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
10035
10036 2000-12-07  Jim Meyering  <meyering@lucent.com>
10037
10038         * stripslash.c (ISSLASH): Define.
10039         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
10040         From Prashant TR.
10041
10042         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
10043         (dir_name_r): Declare this function as static.
10044         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10045         manifest itself on a name containing a mix of slashes and
10046         backslashes.
10047         Make this function work with names starting with a DOS-style
10048         drive letter and colon prefix.
10049         (dir_name): Append `.' if necessary.
10050         Based mostly on patches from Prashant TR and Eli Zaretskii.
10051
10052         * dirname.h (dir_name_r): Remove prototype.
10053
10054 2000-12-05  Jim Meyering  <meyering@lucent.com>
10055
10056         * dirname.c (dir_name_r): Add `const' in a few local declarations.
10057
10058 2000-12-04  Jim Meyering  <meyering@lucent.com>
10059
10060         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10061         Also include memory.h, stdlib.h, unistd.h if appropriate.
10062         Reported by Andreas Jaeger (conflicting declaration of malloc).
10063
10064 2000-12-02  Jim Meyering  <meyering@lucent.com>
10065
10066         * closeout.h: Make idempotent, to avoid some obscure warnings.
10067
10068 2000-12-01  Paul Eggert  <eggert@twinsun.com>
10069
10070         * memrchr.c: Include <config.h> before any system include file.
10071
10072 2000-11-29  Paul Eggert  <eggert@twinsun.com>
10073
10074         * dirname.c (dir_name_r): Fix typo: int -> size_t.
10075
10076 2000-11-26  Jim Meyering  <meyering@lucent.com>
10077
10078         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
10079
10080 2000-11-22  Paul Eggert  <eggert@twinsun.com>
10081
10082         * strftime.c (my_strftime): Do not invoke mbrlen with a
10083         size of (size_t) -1; it's not portable.
10084
10085 2000-11-17  Akim Demaille  <akim@epita.fr>
10086
10087         * obstack.h: Formatting changes.
10088         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10089         prevent type checking.
10090         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10091         cast the value to (void *): assigning a `foo *' to a `void *'
10092         variable is valid.
10093         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10094
10095 2000-11-17  Jim Meyering  <meyering@lucent.com>
10096
10097         * strstr.c: Update from GNU libc.
10098
10099 2000-11-16  Jim Meyering  <meyering@lucent.com>
10100
10101         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10102
10103 2000-11-11  Jim Meyering  <meyering@lucent.com>
10104
10105         * error.c: Add a couple #includes, merging from GNU libc version.
10106
10107 2000-11-10  Jim Meyering  <meyering@lucent.com>
10108
10109         * obstack.h: Update from GNU libc.
10110         * obstack.c: Likewise.
10111
10112 2000-11-06  Paul Eggert  <eggert@twinsun.com>
10113
10114         * getusershell.c (setusershell): Use rewind rather than
10115         fseek/fseeko, to avoid configuration hassles with fseeko.
10116         Don't bother opening SHELLS_FILE if shellstream is NULL;
10117         it's not necessary.
10118
10119 2000-11-05  Jim Meyering  <meyering@lucent.com>
10120
10121         * makepath.h (make_dir): Declare.
10122         * makepath.c (make_dir): Remove `static' attribute.
10123         Tweak a comment.
10124
10125 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
10126
10127         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
10128         last one in a bucket, advance to the next bucket.
10129
10130 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
10131
10132         * fnmatch.c: Do not comment out all the code if we are using
10133         the GNU C library, because in some cases we are replacing buggy
10134         code in the GNU C library itself.
10135
10136 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10137
10138         * error.h, getline.h, modechange.h:
10139         Remove "2000" from Copyright line, as the file hasn't been
10140         changed this year other than in the copyright notice.
10141
10142         * xalloc.h: Add "2000" to Copyright line, as this file
10143         was changed this year.
10144
10145 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10146
10147         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10148         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10149         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10150
10151 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
10152
10153         * regex.h (__restrict_arr): Move definition out of #ifndef block.
10154         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10155         doesn't define __restrict_arr.
10156
10157 2000-10-29  Jim Meyering  <meyering@lucent.com>
10158
10159         * xstat.in: Fix grammar in comment.
10160
10161 2000-10-28  Jim Meyering  <meyering@lucent.com>
10162
10163         * memchr.c: Update from libc.
10164         Adjust for portability:
10165         [HAVE_STDLIB_H]: Include stdlib.h.
10166         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10167         Undef __memchr, too.
10168         [!weak_alias]: Define __memchr to memchr.
10169
10170         * regex.c: Update from libc.
10171         * regex.h: Likewise.
10172         * getopt1.c: Likewise.
10173         * memcmp.c: Likewise.
10174
10175         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10176         Avoid using fseek, when possible -- it's broken by design.
10177         Patch by Ulrich Drepper.
10178
10179 2000-10-26  Jim Meyering  <meyering@lucent.com>
10180
10181         * strftime.c: Update from libc.
10182
10183 2000-10-25  Jim Meyering  <meyering@lucent.com>
10184
10185         * obstack.c: Update from libc.
10186
10187 2000-10-23  Jim Meyering  <meyering@lucent.com>
10188
10189         * hard-locale.c (hard_locale): Revert last change -- it was simply
10190         wrong.  That set_locale call must not have any side effects.
10191         From Paul Eggert.
10192
10193 2000-10-22  Jim Meyering  <meyering@lucent.com>
10194
10195         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10196         [CYCLIC]: Remove now-unused definition.
10197
10198         * save-cwd.c (O_DIRECTORY): Define, if needed.
10199         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10200         Suggestion from Ulrich Drepper.
10201
10202 2000-10-21  Jim Meyering  <meyering@lucent.com>
10203
10204         * dirname.c (dir_name_r): New function, factored out of dir_name.
10205         (dir_name): Use dir_name_r.
10206         * dirname.h (dir_name_r): Declare it.
10207
10208 2000-10-21  Jim Meyering  <meyering@lucent.com>
10209
10210         * dirname.c (memrchr): Declare if necessary.
10211         (dir_name): Remove the restriction that there be no
10212         trailing slashes.  Now, this code skips past them, effectively
10213         ignoring them.
10214         [TEST_DIRNAME] (main): New unit tests.
10215
10216         * memrchr.c: New file from GNU libc.
10217         Undef __memrchr, too.
10218         [!weak_alias]: Define __memrchr to memrchr.
10219         Guard weak_alias use with `#ifdef weak_alias'.
10220
10221 2000-10-17  Jim Meyering  <meyering@lucent.com>
10222
10223         * quote.h (PARAMS): Define and use.
10224         Reported by Akim Demaille.
10225
10226         * getopt.c: Update from libc.
10227
10228 2000-10-16  Jim Meyering  <meyering@lucent.com>
10229
10230         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10231         From Jan Fedak.
10232
10233 2000-09-25  Jim Meyering  <meyering@lucent.com>
10234
10235         * md5.h (rol): Define (from GnuPG).
10236
10237         * sha.c: Give credit (GnuPG) where due.
10238         (M): Use rol rather than open-coding it.
10239         Add a FIXME comment.
10240
10241 2000-09-21  Jim Meyering  <meyering@lucent.com>
10242
10243         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10244         Reported by Michael Stone.
10245
10246 2000-09-20  Jim Meyering  <meyering@lucent.com>
10247
10248         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10249         (noinst_HEADERS): Add sha.h.
10250         Based on code from Scott G. Miller and from GnuPG.
10251
10252 2000-09-15  Jim Meyering  <meyering@lucent.com>
10253
10254         * regex.c: Update from libc.
10255
10256 2000-09-10  Jim Meyering  <meyering@lucent.com>
10257
10258         * getopt.c (_getopt_internal): Update from glibc.
10259
10260 2000-09-09  Jim Meyering  <meyering@lucent.com>
10261
10262         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10263         think it should be used as a general replacement for isascii.
10264         * fnmatch.c: Likewise.
10265         * mbswidth.c: Likewise
10266         * regex.c: Likewise.
10267
10268         Don't use atoi.
10269         * userspec.c: Include sys/param.h and limits.h.
10270         Include xstrtol.h.
10271         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10272         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10273         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10274         UID, GID.  Check range.
10275
10276 2000-09-06  Jim Meyering  <meyering@lucent.com>
10277
10278         * getopt.c (_getopt_internal): Update from glibc.
10279
10280 2000-08-30  Jim Meyering  <meyering@lucent.com>
10281
10282         * strftime.c: Merge in changes from GNU libc.
10283
10284 2000-08-26  Jim Meyering  <meyering@lucent.com>
10285
10286         * closeout.c: Include "__fpending.h".
10287         (close_stdout_status): Return right away if there's nothing to flush.
10288
10289         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10290         * __fpending.c: New file.
10291         * __fpending.h: New file.
10292
10293 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10294
10295         Standardize on "memory exhausted" instead of "Memory exhausted"
10296         or "virtual memory exhausted".
10297         * obstack.c (print_and_abort): Use "memory exhausted", not
10298         "virtual memory exhausted".
10299         * same.c (same_name): Invoke xalloc_die instead of printing
10300         our own message.
10301         * userspec.c (parse_user_spec): Likewise.
10302         * bumpalloc.h: comment fix
10303         * same.c, userspec.c: Include xalloc.h.
10304
10305         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10306         not char *const and pointing to a constant array.
10307         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10308         (xrealloc): Comment fix.
10309
10310         * userspec.c (parse_user_spec):
10311         Don't translate a message until just before returning,
10312         to avoid unnecessary translation.
10313
10314 2000-08-07  Jim Meyering  <meyering@lucent.com>
10315
10316         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10317         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10318         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10319         getgroups.c, gethostname.c, getopt.h, group-member.c,
10320         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10321         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10322         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10323         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10324         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10325         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10326         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10327         yesno.c: Back out Copyright date changes for each file with no change
10328         this year.  This eases coordination with other programs using the same
10329         source code modules.  From Paul Eggert.
10330
10331 2000-08-03  Greg McGary  <greg@mcgary.org>
10332
10333         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10334         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10335         (EXTEND_BUFFER): Use them.
10336
10337 2000-08-01  Jim Meyering  <meyering@lucent.com>
10338
10339         * dirname.c (ISSLASH): Define.
10340         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10341         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10342         both `\' and `/' may be use as path separators.
10343         Based on a patch from Prashant TR.
10344
10345 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10346
10347         * quotearg.c (quotearg_n_options): Don't make the initial
10348         slot vector a constant, since it might get modified.
10349
10350 2000-07-31  Jim Meyering  <meyering@lucent.com>
10351
10352         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10353         * obstack.c (print_and_abort): Likewise.
10354
10355 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10356
10357         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10358         buffer, so that the caller can always quote one small
10359         component of a "memory exhausted" message in slot 0.
10360         From a suggestion by Jim Meyering.
10361
10362 2000-07-30  Jim Meyering  <meyering@lucent.com>
10363
10364         * makepath.c (make_path): Quote the other instance, too.
10365
10366         * quotearg.c (N_STATIC_SLOTVECS): Define.
10367         (STATIC_BUF_SIZE): Define.
10368         (quotearg_n_options): Use only statically allocated storage when
10369         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10370         than STATIC_BUF_SIZE.
10371
10372 2000-07-29  Jim Meyering  <meyering@lucent.com>
10373
10374         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10375         * dirname.c (dir_name): Likewise.
10376
10377         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10378
10379         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10380         (dir_name): Assert that there are no trailing slashes.
10381
10382 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10383
10384         * mbswidth.h (mbswidth): Add a flags argument.
10385         (mbswidth): New declaration.
10386         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10387         * mbswidth.c (mbswidth): Add a flags argument.
10388         (mbsnwidth): New function.
10389
10390 2000-07-24  Jim Meyering  <meyering@lucent.com>
10391
10392         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10393
10394 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10395
10396         * mbswidth.c (_XOPEN_SOURCE):
10397         Don't define; this causes problems on Solaris 7.
10398         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10399
10400 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10401
10402         * quotearg.c:
10403         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10404         so that mbstate_t is always defined.
10405
10406         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10407         be 1 in at least one GCC installation, and this configuration
10408         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10409         performance on hosts that have mbrtowc but have only unibyte
10410         locales, but I assume these hosts are rare.
10411
10412 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10413
10414         * quotearg.c: Streamline by invoking multibyte code only if needed.
10415         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10416         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10417         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10418         invoke multibyte primitives.
10419
10420 2000-07-23  Jim Meyering  <meyering@lucent.com>
10421
10422         * basename.c (base_name): Add an assertion.
10423
10424 2000-07-15  Bruno Haible  <clisp.cons.org>
10425
10426         * quotearg.c: When the system forces us to redefine mbstate_t,
10427         shadow its mbsinit function.
10428
10429 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10430
10431         * mbswidth.h: New file.
10432         * mbswidth.c: New file.
10433         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10434         (noinst_HEADERS): Add mbswidth.h.
10435
10436 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10437
10438         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10439         and IRIX 6.
10440
10441 2000-07-15  Jim Meyering  <meyering@lucent.com>
10442
10443         * makepath.c: Include quote.h.
10444         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10445         corresponding argument in a `quote (...)' call.
10446         Give better diagnostics.
10447
10448         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10449         (noinst_HEADERS): Add quote.h.
10450
10451         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10452         from tar's src/misc.c.
10453         * quote.h: New file.  Prototypes for same.
10454
10455 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10456
10457         From a suggestion by Bruno Haible.
10458         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10459         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10460         to decide whether to define the BeOS workaround macro;
10461         this adjusts to the change to AC_MBSTATE_T.
10462
10463 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10464
10465         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10466
10467         * quotearg.c (quoting_style_args, quoting_style_vals,
10468         quotearg_buffer_restyled): Add support for
10469         clocale_quoting_style.  Undo previous change to
10470         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10471         and "{RIGHT QUOTATION MARK}" msgids.
10472
10473 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10474
10475         The old behavior of quoting `like this' doesn't look good with
10476         newer, ISO-style fonts.  See:
10477         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10478
10479         Instead, quote "like this" by default.  Let the translator
10480         tailor the locale-specific quoting behavior by providing
10481         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10482
10483         * quotearg.c (N_): New macro.
10484         (gettext_default): New function.
10485         (quotearg_buffer_restyled): Use
10486         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10487         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10488
10489 2000-07-09  Jim Meyering  <meyering@lucent.com>
10490
10491         * Most files: Update copyright dates to include 2000.
10492
10493 2000-07-08  Jim Meyering  <meyering@lucent.com>
10494
10495         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10496         if not defined.
10497         (xgethostname): Remove now-unnecessary #ifdef.
10498         Move declaration of `err' into loop where it's used.
10499
10500 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10501
10502         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10503         by allocating a larger buffer. Test the gethostname return value for
10504         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10505         returns an error and ENAMETOOLONG isn't defined.
10506
10507 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10508         and Bruno Haible  <haible@clisp.cons.org>
10509
10510         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10511
10512 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10513
10514         * quotearg.c (struct quoting_options): Simplify quote_these_too
10515         dimension.
10516
10517 2000-07-03  Jim Meyering  <meyering@lucent.com>
10518
10519         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10520         Reported by Bruno Haible.
10521
10522 2000-07-04  Jim Meyering  <meyering@lucent.com>
10523
10524         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10525         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10526         lacks mbrtowc.
10527
10528 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10529         and Bruno Haible  <haible@clisp.cons.org>
10530
10531         * quotearg.c (mbrtowc):
10532         Assign to *pwc, and return 1 only if result is nonzero.
10533         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10534
10535 2000-07-03  Jim Meyering  <meyering@lucent.com>
10536
10537         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10538         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10539         From Bob Proulx.
10540
10541 2000-07-02  Jim Meyering  <meyering@lucent.com>
10542
10543         * quotearg.c (mbstate_t): Don't define here.
10544
10545 2000-07-02  Jim Meyering  <meyering@lucent.com>
10546
10547         * nanosleep.c (SIGCONT): Define if not already defined.
10548
10549 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10550
10551         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10552         per change in ../m4/ls-mntd-fs.m4.
10553         (read_filesystem_list): Ignore symbolic links.
10554
10555 2000-06-29  Jim Meyering  <meyering@lucent.com>
10556
10557         * same.c: Include <string.h> or <strings.h>, as appropriate,
10558         for declaration of strcmp.
10559
10560         * long-options.c: Include <stdlib.h>, for declaration of exit.
10561
10562         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10563         Avoid warning by casting result to `char *' to remove `const'.
10564
10565 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10566
10567         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10568
10569 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10570
10571         savedir now sets errno on failure and invokes xmalloc to get memory.
10572         Fix a couple of other minor bugs while we're at it.
10573
10574         * savedir.c (<unistd.h>): Do not include; there's no need.
10575         (NAMLEN): Remove macro.
10576         (malloc, realloc): Remove decls.
10577         (stpcpy): Likewise.
10578         ("xalloc.h"): Include.
10579         (NAME_SIZE_DEFAULT): New macro.
10580         (savedir): Use xmalloc / xrealloc to allocate memory.
10581         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10582         Skip "" directory entries.
10583         Use strlen to calculate directory entry length, since the old method
10584         is rarely used these days and isn't worth supporting.
10585         Don't use a pointer after freeing it.
10586         Check for integer overflow when calculating allocation size.
10587         Use memcpy to copy entries, instead of stpcpy.
10588         Set errno properly when returning NULL.
10589         Check for readdir error.
10590
10591 2000-06-26  Jim Meyering  <meyering@lucent.com>
10592
10593         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10594
10595 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10596
10597         * getusershell.c (xmalloc, xrealloc): Remove functions.
10598         Include xalloc.h.
10599         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10600
10601 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10602
10603         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10604
10605 2000-06-24  Jim Meyering  <meyering@lucent.com>
10606
10607         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10608
10609 2000-06-21  Jim Meyering  <meyering@lucent.com>
10610
10611         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10612
10613 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10614
10615         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10616         (mbrtowc, mbstate_t): Define substitutes if
10617         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10618         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10619         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10620
10621 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10622
10623         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10624         than 1024, return a memory chunk of least possible size, instead
10625         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10626         Use free/xmalloc instead of xrealloc to avoid copying for very long
10627         paths.
10628
10629 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10630
10631         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10632         address, not strdup.  Include <stdlib.h> and don't declare free().
10633
10634 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10635
10636         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10637         the empty string.
10638
10639 2000-06-21  Jim Meyering  <meyering@lucent.com>
10640
10641         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10642         (noinst_HEADERS): Add getstr.h.
10643
10644         * getline.c (getstr): Move into a separate file.
10645         * getstr.c (getstr): New file, extracted from getline.c, with
10646         the following changes: new parameter, delim2; both delim[12]
10647         parameters have type `int', not `char'.  The latter would lose
10648         with 8-bit delimiters.
10649         * getstr.h: New file.
10650
10651 2000-06-19  Jim Meyering  <meyering@lucent.com>
10652
10653         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10654
10655 2000-06-18  Jim Meyering  <meyering@lucent.com>
10656
10657         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10658         Besides, these days every porting target provides a mkdir function.
10659
10660         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10661         (this snippet comes from src/system.h).
10662
10663 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10664
10665         * human.c (adjust_value): New function.
10666         (human_readable_inexact): Apply rounding style even when
10667         printing approximate values.
10668
10669 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10670
10671         * human.c (human_readable_inexact): Allow an input block
10672         size that is not a multiple of the output block size, and vice versa.
10673         Reported by Piergiorgio Sartor.
10674
10675 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10676
10677         * getdate.y (get_date): Apply relative times after time
10678         zone indicator, not before.  Reported by Todd A. Jacobs.
10679
10680 2000-06-13  Jim Meyering  <meyering@lucent.com>
10681
10682         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10683
10684         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10685
10686 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10687
10688         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10689
10690 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10691
10692         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10693
10694 2000-06-04  Jim Meyering  <meyering@lucent.com>
10695
10696         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10697         SunOS 4.1.4 for which gid_t is an unsigned type.
10698
10699 2000-06-03  Jim Meyering  <meyering@lucent.com>
10700
10701         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10702
10703 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10704
10705         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10706         newer, don't install charset.alias.
10707         * config.charset: Change the Linux/glibc rules so they become empty
10708         on glibc-2.1 or newer.
10709
10710 2000-06-02  Jim Meyering  <meyering@lucent.com>
10711
10712         * mountlist.c: Back out last change.  Instead, do this...
10713         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10714         member using the same `ignore'-testing code.
10715         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10716         fs_type strings.
10717         From Mark D. Roth.
10718
10719 2000-05-29  Jim Meyering  <meyering@lucent.com>
10720
10721         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10722         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10723
10724 2000-05-22  Jim Meyering  <meyering@lucent.com>
10725
10726         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10727
10728 2000-05-18  Jim Meyering  <meyering@lucent.com>
10729
10730         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10731         back, too, since it may have been modified by allocate_entry.
10732         (hash_delete): Rewrite to use neither the assignment operator
10733         nor the comma operator in an if-expression.
10734
10735 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10736
10737         * closeout.c:
10738         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10739         Remove; no longer needed.
10740         "quotearg.h": Add include.
10741         (file_name): Do not bother to explicitly initialize to NULL; it's less
10742         efficient on some hosts.
10743         (close_stdout_status): Remove test as to whether stdout was already
10744         closed; it breaks for the case "echo x | sort >&-".
10745         Quote file name colons.
10746         Do not assume that _("write error") lacks format strings.
10747
10748 2000-05-15  Jim Meyering  <meyering@lucent.com>
10749
10750         * version-etc.c (version_etc_copyright): Update the copyright string
10751         used in all --version output.
10752
10753 2000-05-14  Jim Meyering  <meyering@lucent.com>
10754
10755         * closeout.c (close_stdout_set_file_name): New function.
10756         (close_stdout_status): Use new file-scoped global.
10757         Return right away if fstat says the stdout file descriptor is invalid.
10758         * closeout.h (close_stdout_set_file_name): Declare.
10759
10760 2000-05-10  Jim Meyering  <meyering@lucent.com>
10761
10762         * closeout.c [default_exit_status]: New file-scoped variable.
10763         (close_stdout_set_status): New function.
10764         * closeout.h (close_stdout_set_status): Declare.
10765
10766 2000-05-08  Jim Meyering  <meyering@lucent.com>
10767
10768         * long-options.c: Don't include closeout.h.
10769         (parse_long_options): Don't call close_stdout for --version.
10770
10771 2000-05-06  Jim Meyering  <meyering@lucent.com>
10772
10773         * strnlen.c: Undefine __strnlen and strnlen.
10774         [!weak_alias]: Define __strnlen to strnlen.
10775
10776         * atexit.c: New file, from libiberty.
10777
10778 2000-05-06  Jim Meyering  <meyering@lucent.com>
10779
10780         * closeout.c (close_stdout_status): Also check for errors on the
10781         stderr stream.
10782
10783 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10784
10785         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10786         instead of xmalloc, xrealloc, path_concat.
10787         (locale_charset): Treat empty environment variables as absent.
10788         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10789
10790 2000-05-04  Jim Meyering  <meyering@lucent.com>
10791
10792         * getopt.c: Update from glibc.
10793         * obstack.c: Likewise.
10794         * obstack.h: Likewise.
10795         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10796
10797         * regex.h: Likewise.
10798         * strndup.c: Likewise.
10799         * strnlen.c: New file, from glibc.
10800
10801 2000-05-01  Jim Meyering  <meyering@lucent.com>
10802
10803         * full-write.c (full_write): Remove `FIXME' part of comment.
10804
10805 2000-04-29  Jim Meyering  <meyering@lucent.com>
10806
10807         * path-concat.c: Declare strdup only if it's not defined.
10808         * canon-host.c: Likewise.
10809
10810 2000-04-28  Jim Meyering  <meyering@lucent.com>
10811
10812         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10813         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10814         included first, then limits.h is included by locale.h by libintl.h.
10815         From John David Anglin.
10816
10817 2000-04-25  Jim Meyering  <meyering@lucent.com>
10818
10819         * makepath.c (S_IRWXUGO): Define.
10820         (make_path): Always perform explicit chmod if MODE specifies any
10821         of the `special' permission bits.  Prompted by a bug report against
10822         install from Mate Wierdl and Joost van Baal.
10823
10824 2000-04-18  Jim Meyering  <meyering@lucent.com>
10825
10826         * README: New file.
10827
10828         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10829         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10830
10831 2000-04-17  Jim Meyering  <meyering@lucent.com>
10832
10833         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10834         the definition of it to rpl_strftime also defined-away the system's
10835         declaration.
10836
10837 2000-04-15  Jim Meyering  <meyering@lucent.com>
10838
10839         Use `C' to denote so-called `contiguous' files, the same way
10840         that tar does.
10841         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10842         (ftypelet): Use S_ISCTG.
10843         From Michael Deutschmann.
10844
10845 2000-04-14  Jim Meyering  <meyering@lucent.com>
10846
10847         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10848
10849 2000-04-08  Jim Meyering  <meyering@lucent.com>
10850
10851         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10852         names don't conflict.  Reported by Eli Zaretskii.
10853
10854 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10855
10856         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10857         bug.  Deal with the different error behavior of Irix iconv.
10858
10859 2000-04-07  Jim Meyering  <meyering@lucent.com>
10860
10861         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10862         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10863
10864 2000-04-05  Jim Meyering  <meyering@lucent.com>
10865
10866         Portability tweaks required for ultrix4.3.
10867         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10868         * readutmp.c: Include sys/types.h before sys/stat.h.
10869         * canon-host.c: Declare strdup.
10870         * path-concat.c: Likewise.
10871         From John David Anglin.
10872
10873 2000-04-04  Jim Meyering  <meyering@lucent.com>
10874
10875         Be more DOS 8.3-friendly.
10876         * ref-add.sin: Renamed from ref-add.sed.in.
10877         * ref-del.sin: Renamed from ref-del.sed.in.
10878         * Makefile.am: Reflect renaming.
10879         Reported by Eli Zaretskii.
10880
10881         Use a temporary file name that won't clash with `charset.alias'
10882         in the DOS 8.3 name space.
10883         * Makefile.am (charset_tmp): Define.
10884         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10885         (uninstall-local): Likewise.
10886         Reported by Eli Zaretskii.
10887
10888 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10889
10890         * time/strftime.c (my_strftime): Make sure we call the system
10891         strftime, not ourselves, when invoking the underlying strftime.
10892
10893 2000-03-24  Jim Meyering  <meyering@lucent.com>
10894
10895         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10896         (charset_alias): Define.
10897         (install-exec-local): Factor out common code.
10898         (uninstall-local): Split lines longer than 80.
10899         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10900         (SUFFIXES): Define.
10901         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10902         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10903
10904 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10905
10906         * config.charset: Output a line containing "Packages using this file".
10907         * ref-add.sed.in, ref-del.sed.in: New files.
10908         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10909         ref-del.sed): New rules.
10910
10911 2000-03-17  Jim Meyering  <meyering@lucent.com>
10912
10913         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10914         Otherwise, include <strings.h>
10915
10916 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10917
10918         * unicodeio.c (utf8_wctomb): New function.
10919         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10920         format instead of in UCS-4 with platform dependent endianness.
10921
10922 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10923
10924         * savedir.c (savedir): Work even if directory size is
10925         negative; this can happen with some screwy NFS configurations.
10926
10927 2000-03-06  Jim Meyering  <meyering@lucent.com>
10928
10929         * localcharset.c (get_charset_aliases): Don't try to free file_name
10930         if it's NULL (because we ran out of memory).  From Bruno Haible.
10931
10932 2000-03-05  Jim Meyering  <meyering@lucent.com>
10933
10934         * localcharset.c ("path-concat.h"): Include.
10935         (get_charset_aliases): Use path_concat instead of ANSI string
10936         concatenation.
10937
10938         * unicodeio.h (PARAMS): Define.
10939         Use it to guard prototype.
10940
10941 2000-03-04  Jim Meyering  <meyering@lucent.com>
10942
10943         * Makefile.am (install-exec-local): Create $(libdir) before installing
10944         into it.
10945         (uninstall-local): Uncomment this rule so `make distcheck' works
10946         once again.
10947
10948         * unicodeio.c (<errno.h>): Include it.
10949         (errno): Declare if not defined.
10950
10951         * localcharset.c: Add Bruno's comment justifying use of volatile.
10952
10953         * config.charset: New version, incorporating remarks from a linux
10954         i18n mailing list.  From Bruno Haible.
10955
10956 2000-03-02  Jim Meyering  <meyering@lucent.com>
10957
10958         * Makefile.am (EXTRA_DIST): Add config.charset.
10959
10960 2000-03-01  Jim Meyering  <meyering@lucent.com>
10961
10962         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10963         * unicodeio.c: Likewise.
10964
10965 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10966
10967         * config.charset: New file.
10968         * localcharset.c: New file.
10969         * unicodeio.h, unicodeio.c: New files.
10970         * Makefile.am (DEFS): Add -DLIBDIR=...
10971         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10972         (noinst_HEADERS): Add unicodeio.h.
10973         (all-local, install-exec-local, charset.alias): New targets.
10974
10975 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10976
10977         * quotearg.c (ALERT_CHAR): New macro.
10978         (quotearg_buffer_restyled): Use it.
10979
10980 2000-02-27  Jim Meyering  <meyering@lucent.com>
10981
10982         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10983         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10984
10985         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10986         not `#if STDC_HEADERS'.
10987         Declare malloc if needed.
10988
10989         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10990         now that autoconf always defines the HAVE_DECL_ symbols.
10991         * human.c: Likewise.
10992         * same.c: Likewise.
10993         * strtoumax.c: Likewise.
10994
10995         * backupfile.c: Arrange for cpp to fail if the configure-time
10996         declaration check was not run.
10997         * hash.c: Likewise.
10998         * human.c: Likewise.
10999         * same.c: Likewise.
11000         * strtoumax.c: Likewise.
11001
11002         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
11003         then first look up the entire `.'-containing string as a login name.
11004
11005 2000-02-18  Paul Eggert  <eggert@twinsun.com>
11006
11007         * getdate.y: Handle two-digit years with leading zeros correctly.
11008         (textint): New typedef.
11009         (parser_control): Member year changed from int to textint.
11010         All uses changed.
11011         (YYSTYPE): Removed; replaced by %union with int and textint members.
11012         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
11013         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
11014         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
11015         (tSNUMBER, tUNUMBER): Now of type <textintval>.
11016         (date, number, to_year): Use width of number in digits, not its value,
11017         to determine whether it's a 2-digit year, or a 2-digit time.
11018         (yylex): Store number of digits of numeric tokens.
11019         Reported by John Kendall.
11020
11021         (parser_control): Changed from struct parser_control to typedef (for
11022         consistency).  All uses changed.
11023
11024         (tID): Removed; not used.
11025         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
11026
11027 2000-02-14  Paul Eggert  <eggert@twinsun.com>
11028
11029         * getpagesize.h (getpagesize): Port to VMS for Alpha;
11030         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
11031
11032 2000-02-12  Jim Meyering  <meyering@lucent.com>
11033
11034         * userspec.c (ISDIGIT): Define it.
11035         (isdigit): Remove definition.
11036         (is_number): Use ISDIGIT, not isdigit.
11037         <libintl.h>: Include.
11038         (_ and N_): Define.
11039         (parse_user_spec): Mark translatable strings.
11040
11041 2000-02-10  Jim Meyering  <meyering@lucent.com>
11042
11043         With these changes, nanosleep.[ch] are finally enough like the other
11044         lib/* replacement files to compile on a few more losing systems.
11045
11046         * nanosleep.h: Don't include config.h.
11047         Remove prototype from declaration of nanosleep.
11048         (PARAMS): Remove now-unneeded definition.
11049         * nanosleep.c: #undef nanosleep.
11050         (rpl_nanosleep): Rename from nanosleep.
11051
11052 2000-02-03  Jim Meyering  <meyering@lucent.com>
11053
11054         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11055         rather than with `#if HAVE_UTMPNAME'.
11056
11057 2000-02-01  Jim Meyering  <meyering@lucent.com>
11058
11059         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
11060
11061 2000-01-31  Jim Meyering  <meyering@lucent.com>
11062
11063         * nanosleep.h (nanosleep): Guard declaration with
11064         `#if ! HAVE_DECL_NANOSLEEP'.
11065         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11066         the declaration in that vendor's sys/timers.h.
11067         Reported by Christian Krackowizer.
11068
11069         * quotearg.c (ISASCII): Add #undef and move definition to follow
11070         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11071         (ISPRINT): Likewise.
11072         Reported by Tom Tromey.
11073
11074 2000-01-30  Jim Meyering  <meyering@lucent.com>
11075
11076         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11077         uses of ->ut_name.  The latter doesn't work with new Linux header files
11078         where only utmpx.ut_user is declared.
11079
11080         * readutmp.h (UT_USER): Define.
11081
11082 2000-01-23  Jim Meyering  <meyering@lucent.com>
11083
11084         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11085         obstack.c.
11086
11087 2000-01-22  Jim Meyering  <meyering@lucent.com>
11088
11089         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11090         [! HAVE_DECL_STRTOULL]: Declare strtoull.
11091         Required for some AIX systems.  Reported by Christian Krackowizer.
11092         [TESTING] (main): New function.
11093
11094         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
11095         * dirname.c (dir_name): Support for DOS-style file names with drive
11096         letters.
11097
11098         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11099
11100         * strverscmp.c (ISDIGIT): Define.
11101         (strverscmp): Use ISDIGIT, not isdigit.
11102
11103 2000-01-17  Paul Eggert  <eggert@twinsun.com>
11104
11105         * nanosleep.c (nanosleep):
11106         Don't use SA_INTERRUPT to decide whether to call sigaction, as
11107         POSIX.1 doesn't require SA_INTERRUPT and some systems
11108         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
11109         it's been part of POSIX.1 since day 1 (in 1988).
11110
11111 2000-01-17  Jim Meyering  <meyering@lucent.com>
11112
11113         * interlock: Remove unused file.  Reported by François Pinard.
11114
11115 2000-01-16  Paul Eggert  <eggert@twinsun.com>
11116
11117         * quotearg.c (quotearg_buffer_restyled): Do not quote
11118         alert, backslash, formfeed, and vertical tab unnecessarily in
11119         shell quoting style.
11120
11121
11122 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11123 Free Software Foundation, Inc.
11124 Copying and distribution of this file, with or without modification,
11125 are permitted provided the copyright notice and this notice are preserved.