6f4bd8d0f06151c4d342ccbb05ee70d0f3b55847
[gnulib.git] / lib / ChangeLog
1 2006-10-06  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * mkancesdirs.c (mkancesdirs): Pass to MAKE_DIR both the full file
4         name (relative to the original working directory) and the file
5         name component (relative to the temporary working directory).  All
6         callers changed.
7         * mkancesdirs.h (mkancesdirs): Adjust prototype to match.
8         * mkdir-p.c (make_dir_parents): Likewise.
9         * mkdir-p.h (make_dir_parents): Likewise.
10
11 2006-10-06  Eric Blake  <ebb9@byu.net>
12
13         * clean-temp.h (close_stream_temp): New declaration.
14         * clean-temp.c (includes): Pull in headers according to what
15         other modules are in use.
16         (close_stream_temp) [GNULIB_CLOSE_STREAM]: New function.
17
18 2006-10-06  Bruno Haible  <bruno@clisp.org>
19
20         * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
21         cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
22         int.
23         * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
24         cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
25         Return an error indicator.
26         Suggested by Eric Blake.
27
28 2006-10-06  Bruno Haible  <bruno@clisp.org>
29
30         * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
31         Reported by Eric Blake.
32
33 2006-10-06  Bruno Haible  <bruno@clisp.org>
34         and Paul Eggert  <eggert@cs.ucla.edu>
35
36         * closeout.c (close_stdout): Also close stderr.
37         * closeout.h: Update comment.
38
39 2006-10-06  Bruno Haible  <bruno@clisp.org>
40
41         * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
42         instead of fopen, fwriteerror.
43
44 2006-10-05  Bruno Haible  <bruno@clisp.org>
45
46         * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
47         fwriteerror_temp): New declarations.
48         * clean-temp.c (uintptr_t): Provide fallback definition.
49         (descriptors): New variable.
50         (cleanup): First, close the descriptors.
51         (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
52         fclose_temp, fwriteerror_temp): New functions.
53
54 2006-10-03  Bruno Haible
55
56         * gl_list.h (gl_sortedlist_search_from_to,
57         gl_sortedlist_indexof_from_to): New declarations.
58         (gl_list_implementation): New fields sortedlist_search_from_to,
59         sortedlist_indexof_from_to.
60         (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
61         inline functions.
62         * gl_list.c (gl_sortedlist_search_from_to,
63         gl_sortedlist_indexof_from_to): New functions.
64         * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
65         (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
66         (gl_array_sortedlist_search_from_to): New function.
67         (gl_array_list_implementation): Update.
68         * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
69         (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
70         (gl_carray_sortedlist_search_from_to): New function.
71         (gl_carray_list_implementation): Update.
72         * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
73         gl_linked_sortedlist_indexof_from_to): New functions.
74         * gl_linked_list.c (gl_linked_list_implementation): Update.
75         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
76         * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
77         gl_tree_sortedlist_indexof_from_to): New functions.
78         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
79         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
80         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
81         * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
82
83 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
84
85         Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
86         <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
87         * dirchownmod.c: Include lchown.h.
88         * lchown.c: Don't include files that lchown.h now includes.
89         Don't declare chown, since lchown.h now does that.
90         * lchown.h: Include errno.h, sys/types.h, unistd.h.
91         (lchown): Define to rpl_chown if lchown is declared but
92         does not exist.  Declare using a prototype if lchown is not
93         declared.  Add a copyright notice.
94         * mkstemp.h: Include <unistd.h>.
95         * openat.c: Include lchown.h.
96
97         * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
98         we now test for that separately.
99         * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
100         rather than O_NOFOLLOW, when testing whether it's possible to
101         avoid a race condition reliably.
102         * savewd.c (savewd_chdir): Likewise.
103
104         Remove macros that are no longer needed now that stdint.h is
105         reliable.
106         * fsusage.c (UINTMAX_MAX): Remove.
107         * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
108         * utimecmp.c (SIZE_MAX): Remove.
109
110 2006-10-03  Bruno Haible  <bruno@clisp.org>
111
112         * gl_list.h (gl_list_search_from, gl_list_search_from_to,
113         gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
114         (struct gl_list_implementation): Add fields search_from_to,
115         indexof_from_to. Remove fields search, indexof.
116         (gl_list_search): Use the search_from_to method.
117         (gl_list_search_from, gl_list_search_from_to): New functions.
118         (gl_list_indexof): Use the indexof_from_to method.
119         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
120         * gl_list.c (gl_list_search): Use the search_from_to method.
121         (gl_list_search_from, gl_list_search_from_to): New functions.
122         (gl_list_indexof): Use the indexof_from_to method.
123         (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
124         * gl_array_list.c (gl_array_indexof_from_to): Renamed from
125         gl_array_indexof. Add start_index, end_index arguments.
126         (gl_array_search_from_to): Renamed from gl_array_search. Add
127         start_index, end_index arguments.
128         (gl_array_remove, gl_array_list_implementation): Update.
129         * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
130         gl_carray_indexof. Add start_index, end_index arguments.
131         (gl_carray_search_from_to): Renamed from gl_carray_search. Add
132         start_index, end_index arguments.
133         (gl_carray_remove, gl_carray_list_implementation): Update.
134         * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
135         gl_linked_search. Add start_index, end_index arguments.
136         (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
137         start_index, end_index arguments.
138         (gl_linked_remove): Update.
139         * gl_linked_list.c (gl_linked_list_implementation): Update.
140         * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
141         * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
142         to 'size_t'.
143         * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
144         gl_tree_search. Add start_index, end_index arguments.
145         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
146         start_index, end_index arguments.
147         (gl_tree_remove): Update.
148         * gl_avltree_list.c (gl_avltree_list_implementation): Update.
149         * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
150         * gl_anytreehash_list1.h (compare_position_threshold): New function.
151         * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
152         gl_tree_search. Add start_index, end_index arguments.
153         (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
154         start_index, end_index arguments.
155         * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
156         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
157
158 2006-10-04  Bruno Haible  <bruno@clisp.org>
159
160         * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
161
162 2006-10-03  Bruno Haible  <bruno@clisp.org>
163
164         * gl_oset.h (gl_setelement_threshold_fn): New type.
165         (gl_oset_search_atleast): New declaration.
166         (struct gl_oset_implementation): Add field 'search_atleast'.
167         (gl_oset_search_atleast): New inline function.
168         * gl_oset.c (gl_oset_search_atleast): New function.
169         * gl_array_oset.c (gl_array_search_atleast): New function.
170         (gl_array_oset_implementation): Update.
171         * gl_anytree_oset.h (gl_tree_search_atleast): New function.
172         * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
173         * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
174
175 2006-10-04  Jim Meyering  <jim@meyering.net>
176
177         * fts.c (fts_open): Tiny comment change.
178
179 2006-10-03  Bruno Haible  <bruno@clisp.org>
180
181         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
182         from gl_avltreehash_list_implementation.
183
184 2006-10-03  Bruno Haible  <bruno@clisp.org>
185
186         * gl_oset.c (gl_oset_add): Fix return type.
187
188 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
189
190         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
191
192 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
193
194         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
195
196 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
197
198         Work around bug in Solaris 10 /proc file system:
199         /proc/self/fd/NNN/.. isn't the parent directory of
200         the directory whose file descriptor is NNN.  This needs to
201         be worked around at run time, not compile time, since a
202         program might be built on Solaris 8, where things work, and
203         run on Solaris 10.
204         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
205         to use the following interface instead:
206         (OPENAT_BUFFER_SIZE): New macro.
207         (openat_proc_name): New function.
208         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
209         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
210         Likewise.
211         * openat-proc.c: New file.
212
213 2006-09-29  Bruno Haible  <bruno@clisp.org>
214
215         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
216         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
217         argument. Set stdout_closed before testing for ferror, not after.
218         (fwriteerror, fwriteerror_no_ebadf): New functions.
219
220 2006-09-28  Bruno Haible  <bruno@clisp.org>
221
222         * strndup.h: Simplify the redefinition of strndup.
223         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
224
225 2006-09-28  Bruno Haible  <bruno@clisp.org>
226
227         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
228         * gl_linkedhash_list.c: Likewise.
229         * gl_rbtreehash_list.c: Likewise.
230
231 2006-09-28  Jim Meyering  <jim@meyering.net>
232
233         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
234         Include <unistd.h>.
235
236 2006-09-27  Jim Meyering  <jim@meyering.net>
237
238         This file could end up with a definition for a function
239         named __strndup, rather than rpl_strndup on a system with
240         incomplete weak_alias support.
241         * strndup.c (strndup): Rename from __strndup.
242         Remove #defines that used to map __strndup to strndup.
243         Don't use K&R prototypes.
244         Remove LIBC-related code, since this file is not sync'd with glibc.
245         * strndup.h: Revamp, accordingly.
246
247 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
248
249         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
250         getaddrinfo.
251
252         * __fpending.h: Don't include <stdio_ext.h> unless
253         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
254         it causes <stdio_ext.h> to cause a compile-time error.
255         Problem reported by Nelson H. F. Beebe.
256         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
257         of HAVE_DECL___PENDING.
258
259 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
260
261         * savewd.c: Include <signal.h>, for 'raise'.
262
263 2006-09-26  Eric Blake  <ebb9@byu.net>
264
265         * verror.c: Include <config.h> unconditionally.
266
267 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
268
269         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
270         (gl_linked_iterator_from_to): Initialize struct completely.
271         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
272         (gl_tree_iterator_from_to): Likewise
273         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
274         * gl_array_list.c [lint] (gl_array_iterator)
275         (gl_array_iterator_from_to): Likewise.
276         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
277         * gl_carray_list.c [lint] (gl_carray_iterator)
278         (gl_carray_iterator_from_to): Likewise.
279
280         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
281         * md4.c (md4_process_block): Remove unused variable.
282         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
283         parentheses for clarity.
284
285 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
286
287         Import this patch from libc:
288
289         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
290
291         * regex_internal.c (re_string_reconstruct): Handle
292         offset < pstr->valid_raw_len && pstr->offsets_needed case.
293         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
294         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
295         re_string_context_at.
296
297 2006-09-20  Bruno Haible  <bruno@clisp.org>
298
299         * mkdtemp.c: Import from libc.
300         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
301                 * sysdeps/posix/tempname.c (__gen_tempname): Change
302                 attempts_min into a macro.  Use preprocessor to decide how to
303                 initialize attempts [Coverity CID 67].
304         2001-11-27  Paul Eggert  <eggert@twinsun.com>
305                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
306                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
307
308 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
309
310         * mkstemp.h: New file, since some standard headers
311         #define mkstemp.
312         * mkstemp.c: Revamp to put the !_LIBC code together.
313         Include "mkstemp.h".
314         Make the _LIBC code resemble glibc original more,
315         e.g., use K&R style.
316         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
317         (mkstemp): Remove, since mkstemp.h does this for us.
318         * stdlib--.h: Include mkstemp.h.
319
320         Import this patch from libc:
321
322         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
323
324         * tempname.c (__gen_tempname): Change attempts_min
325         into a macro.  Use preprocessor to decide how to initialize
326         attempts [Coverity CID 67].
327
328 2006-09-18  Bruno Haible  <bruno@clisp.org>
329
330         * javaversion.c: Include configmake.h.
331
332 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
333
334         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
335         that prevented coreutils 6.1 from building.  Problem reported
336         by Petter Reinholdtsen.
337
338 2006-09-18  Jim Meyering  <jim@meyering.net>
339
340         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
341
342 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
343
344         * dirchownmod.c: Don't include fcntl.h; no longer needed.
345         (dirchownmod): New arg FD.  All callers changed.
346         Use FD rather than opening the directory ourself, as opening is
347         now the caller's responsibility.
348         * dirchownmod.h: Likewise.
349         * mkancesdirs.c: Include <sys/types.h>, for portability to older
350         hosts that require <sys/types.h> before <sys/stat.h>.  Include
351         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
352         (test_dir): Remove.
353         (mkancesdirs): Return length of prefix of FILE that has already
354         been made, or -2 if there is a child doing the work.  Redo
355         algorithm so that it is O(N) rather than O(N**2).  Optimize away
356         ".", and treat ".." specially since it might stray back into
357         already-created areas.  Use a subprocess if necessary.  New arg
358         WD; all users changed.  MAKE_DIR function should now return 1
359         if it creates a directory that is not readable.  Return -2 if
360         a child process is spun off.
361         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
362         Adjust signature to match code.
363         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
364         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
365         all users changed.
366         * savewd.c, savewd.h: New files.
367
368 2006-09-15  Jim Meyering  <jim@meyering.net>
369
370         * rename-dest-slash.c (has_trailing_slash): Use
371         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
372         (rpl_rename_dest_slash): Perform the cheaper trailing slash
373         test before testing whether SRC is a directory.
374         Suggestions from Bruno Haible.
375
376         Avoid a warning about an unused variable.
377         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
378         into the #ifdef block where it's used.
379
380         * rename-dest-slash.c: New file.
381
382 2006-09-14  Bruno Haible  <bruno@clisp.org>
383
384         * allocsa.c: Include <config.h> unconditionally.
385         * asnprintf.c: Likewise.
386         * asprintf.c: Likewise.
387         * c-strcasecmp.c: Likewise.
388         * c-strcasestr.c: Likewise.
389         * c-strncasecmp.c: Likewise.
390         * c-strstr.c: Likewise.
391         * classpath.c: Likewise.
392         * clean-temp.c: Likewise.
393         * concatpath.c: Likewise.
394         * copy-file.c: Likewise.
395         * csharpcomp.c: Likewise.
396         * csharpexec.c: Likewise.
397         * execute.c: Likewise.
398         * fatal-signal.c: Likewise.
399         * findprog.c: Likewise.
400         * fwriteerror.c: Likewise.
401         * gl_array_list.c: Likewise.
402         * gl_array_oset.c: Likewise.
403         * gl_avltree_list.c: Likewise.
404         * gl_avltree_oset.c: Likewise.
405         * gl_avltreehash_list.c: Likewise.
406         * gl_carray_list.c: Likewise.
407         * gl_linked_list.c: Likewise.
408         * gl_linkedhash_list.c: Likewise.
409         * gl_list.c: Likewise.
410         * gl_oset.c: Likewise.
411         * gl_rbtree_list.c: Likewise.
412         * gl_rbtree_oset.c: Likewise.
413         * gl_rbtreehash_list.c: Likewise.
414         * imaxabs.c: Likewise.
415         * imaxdiv.c: Likewise.
416         * javacomp.c: Likewise.
417         * javaexec.c: Likewise.
418         * javaversion.c: Likewise.
419         * linebreak.c: Likewise.
420         * localcharset.c: Likewise.
421         * lock.c: Likewise.
422         * mbchar.c: Likewise.
423         * mbswidth.c: Likewise.
424         * mkdtemp.c: Likewise.
425         * pipe.c: Likewise.
426         * printf-args.c: Likewise.
427         * printf-parse.c: Likewise.
428         * progname.c: Likewise.
429         * progreloc.c: Likewise.
430         * readlink.c: Likewise.
431         * sh-quote.c: Likewise.
432         * stpcpy.c: Likewise.
433         * stpncpy.c: Likewise.
434         * strcasecmp.c: Likewise.
435         * strcasestr.c: Likewise.
436         * strcspn.c: Likewise.
437         * striconv.c: Likewise.
438         * strncasecmp.c: Likewise.
439         * strnlen1.c: Likewise.
440         * strstr.c: Likewise.
441         * strtok_r.c: Likewise.
442         * tls.c: Likewise.
443         * tmpdir.c: Likewise.
444         * unicodeio.c: Likewise.
445         * unsetenv.c: Likewise.
446         * vasnprintf.c: Likewise.
447         * vasprintf.c: Likewise.
448         * wait-process.c: Likewise.
449         * xallocsa.c: Likewise.
450         * xsetenv.c: Likewise.
451         * xstriconv.c: Likewise.
452
453 2006-09-13  Eric Blake  <ebb9@byu.net>
454
455         * getopt.c: Fix typo in last commit.
456
457 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
458
459         * _fpending.c: Include <config.h> unconditionally, since we no
460         longer worry about uses that don't define HAVE_CONFIG_H.
461         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
462         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
463         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
464         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
465         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
466         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
467         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
468         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
469         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
470         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
471         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
472         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
473         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
474         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
475         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
476         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
477         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
478         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
479         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
480         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
481         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
482         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
483         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
484         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
485         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
486         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
487         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
488         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
489         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
490         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
491         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
492         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
493         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
494         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
495         Likewise.
496
497 2006-09-12  Jim Meyering  <jim@meyering.net>
498
499         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
500         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
501         Reported by Nelson H. F. Beebe.
502
503 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
504
505         * argp-help.c (argp_doc): Make sure NULL is not passed to
506         dgettext.
507
508 2006-09-10  Bruno Haible  <bruno@clisp.org>
509
510         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
511
512 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
513
514         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
515         program_invocation_name and program_invocation_short_name are
516         initialized.
517         * argp-namefrob.h: Move declarations of program_invocation_name
518         and program_invocation_short_name to argp.h, so they are visible
519         to user programs.
520         * argp.h: Likewise
521
522 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
523
524         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
525         convention.  Text proposed by Bruno Haible.
526         (struct argp_option): Document the use of N_() wrappers.
527
528         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
529         and translate the two parts separately, instead of feeding
530         the whole string to gettext.  This allows to exclude
531         '\v' from the strings visible to the translator by writing doc
532         strings as N_("..") "\v" N_("..").
533
534 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
535
536         * mktime.c (guess_time_tm): Fix bug where mktime
537         returned the maximum time_t value rather than (time_t) -1.
538         Problem originally reported by William Bardwell
539         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
540
541         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
542         Moved to here ...
543         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
544         ... from here.
545
546 2006-09-06  Bruno Haible  <bruno@clisp.org>
547
548         * striconv.h: New file.
549         * striconv.c: New file, merging iconvme.c with GNU gettext's
550         iconvstring.c.
551         * xstriconv.h: New file.
552         * xstriconv.c: New file.
553
554 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
555
556         * argz_.h: Sync from Libtool.
557
558         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
559                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
560
561         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
562
563 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
564
565         * trim.h: New file.
566         * trim.c: New file.
567
568 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
569
570         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
571         Problem reported by Ralf Wildenhues in
572         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
573
574         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
575         HAVE_STRUCT_STATFS_F_FSTYPENAME.
576
577 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
578
579         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
580         or stdbool.h, because they might not exist while configuring.
581
582         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
583         Don't include unistd.h or limits.h; not needed, since chdir-long.h
584         does that for us.
585         (O_DIRECTORY): Remove.
586
587 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
588
589         Work around a bug in both the Linux and SunOS 64-bit kernels:
590         nanosleep mishandles sleeps for longer than 2**31 seconds.
591         Problem reported by Frank v Waveren in
592         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
593         * nanosleep.c (BILLION): New constant.
594         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
595         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
596
597 2006-08-30  Jim Meyering  <jim@meyering.net>
598
599         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
600         the parameter.
601
602 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
603
604         * isapipe.c, isapipe.h: New files.
605
606 2006-08-29  Eric Blake  <ebb9@byu.net>
607
608         * error.c (error_at_line, print_errno_message): Match libc, after
609         resolution of upstream bug 3044.
610
611 2006-08-29  Bruno Haible  <bruno@clisp.org>
612
613         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
614
615 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
616
617         Sync from Libtool:
618
619         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
620
621         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
622         sharing with gnulib.  Report by Eric Blake.
623
624 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
625
626         * fcntl_.h: New file.
627         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
628         the fcntl module.
629         * dirchownmod.c: Likewise.
630         * fts.c: Likewise.
631
632         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
633         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
634         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
635         just before including <inttypes.h>, to avoid circular inclusion.
636
637 2006-08-28  Bruno Haible  <bruno@clisp.org>
638
639         * inttypes_.h (SCNX*): Remove definitions.
640         Reported by Eric Blake.
641
642 2006-08-26  Bruno Haible  <bruno@clisp.org>
643
644         * vasnprintf.c (EOVERFLOW): Remove definition.
645         (VASNPRINTF): Return a string of length > INT_MAX without failing.
646         * vasprintf.c: Include errno.h, limits.h.
647         (EOVERFLOW): New fallback definition.
648         (vasprintf): Test here whether the string length is > INT_MAX.
649         * vsnprintf.c: Include errno.h, limits.h.
650         (EOVERFLOW): New fallback definition.
651         (vsnprintf): Fix bug when generated string was too long for the buffer.
652         Test here whether the string length is > INT_MAX.
653
654 2006-08-26  Bruno Haible  <bruno@clisp.org>
655             Simon Josefsson  <jas@extundo.com>
656
657         BeOS portability.
658         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
659
660 2006-08-28  Bruno Haible  <bruno@clisp.org>
661
662         * c-strstr.h: New file, from GNU gettext.
663         * c-strstr.c: New file, from GNU gettext.
664
665 2006-08-26  Bruno Haible  <bruno@clisp.org>
666
667         * inttypes_.h: New file.
668         * inttypes.h: Remove file.
669         * stdint_.h: Include <inttypes.h> through its absolute filename.
670
671         * imaxabs.c: New file.
672
673         * imaxdiv.c: New file.
674
675 2006-08-22  Bruno Haible  <bruno@clisp.org>
676
677         * readutmp.h: Skip most definitions if neither <utmp.h> nor
678         <utmpx.h> exists.
679
680 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
681
682         BeOS portability.
683         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
684         Problem reported by Bruno Haible.
685
686 2006-08-21  Bruno Haible  <bruno@clisp.org>
687
688         BeOS portability.
689         * mbchar.h: Include <wctype.h> only if it exists.
690
691 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
692
693         * cycle-check.h: Include <stdint.h> unconditionally, since we
694         now assume the stdint module.  Do not include inttypes.h.
695         * fsusage.h: Likewise.
696         * getndelim2.c: Likewise.
697         * human.h: Likewise.
698         * inttostr.h: Likewise.
699         * obstack.c: Likewise.
700         * regex_internal.h: Likewise.
701         * tempname.c: Likewise.
702         * utimecmp.c: Likewise.
703         * xstrtol.h: Likewise.
704
705         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
706
707         * strtoimax.c: Adjust to macro name changes in Autoconf,
708         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
709         * xtime.h: Likewise.
710
711 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
712
713         * fchmodat.c: New file, from coreutils.  This was inadvertently
714         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
715
716 2006-08-18  Bruno Haible  <bruno@clisp.org>
717
718         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
719         (ME_DUMMY): Treat "kernfs" as a dummy.
720         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
721
722 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
723
724         Update from coreutils.
725
726         * __fpending.h: Add copyright notice.
727         * fprintftime.h: Likewise.
728         * savedir.c: Use (C) in copyright notice.
729         * savedir.h: Likewise.
730
731         2006-08-15  Jim Meyering  <jim@meyering.net>
732
733         * at-func.c: New file, with the logic of all emulated at-functions.
734         * openat-priv.h: Include <errno.h> and define ENOSYS,
735         in support of the EXPECTED_ERRNO macro.
736         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
737         Instead, define the appropriate symbols and include "at-func.c".
738         * mkdirat.c (mkdirat): Likewise.
739         * fchmodat.c (fchmodat): Likewise.
740         (ENOSYS): Remove definition.
741         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
742         Don't include "unistd--.h" -- it wasn't ever used.
743
744         2006-01-17  Jim Meyering  <jim@meyering.net>
745
746         Rewrite fts.c not to change the current working directory,
747         by using openat, fstatat, fdopendir, etc..
748
749         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
750         (HAVE_OPENAT_SUPPORT): Define.
751         [_LIBC] (fchdir): Don't undef or define; no longer used.
752         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
753         Now, this `function' always succeeds, and consumes its file descriptor
754         parameter -- so callers must not close such FDs.  Update callers.
755         (diropen_fd, opendirat, cwd_advance_fd): New functions.
756         (diropen): Add parameter, SP.  Adjust all callers.
757         Implement using diropen_fd, rather than open.
758         (fts_open): Initialize new member, fts_cwd_fd.
759         Remove fts_rft-setting code.
760         (fts_close): Close fts_cwd_fd, if necessary.
761         (__opendir2): Define in terms of opendir or opendirat,
762         depending on whether the FST_NOCHDIR flag is set.
763         (fts_build): Since fts_safe_changedir consumes its FD, and since
764         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
765         and close the dup'd file descriptor upon failure.
766         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
767         (fts_safe_changedir): Tweak semantics to reflect that this function
768         now calls cwd_advance_fd and hence consumes its FD argument.
769         * fts_.h [struct FTS] (fts_cwd_fd): New member.
770         [struct FTS] (fts_rft): Remove now-unused member.
771         [struct FTS] (fts_cycle.state): Improve comment.
772
773         * openat.c (openat_needs_fchdir): New function.
774         * openat.h (openat_needs_fchdir): Declare it.
775
776 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
777
778         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
779         Problem and fix reported by Pádraig Brady in
780         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
781
782 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
783
784         * memcoll.c (memcoll): Optimize for the common case where the
785         arguments are bytewise equal.
786
787 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
788
789         Change copyright notice from LGPL 2 to GPL 2, since that's the
790         standard form used in the gnulib repository.
791         * lock.c: LGPL -> GPL.
792         * lock.h: Likewise.
793         * strnlen1.c: Likewise.
794         * strnlen1.h: Likewise.
795         * tls.c: Likewise.
796         * tls.h: Likewise.
797         * tmpdir.c: Likewise.
798
799         * TODO: Remove; this belongs only in coreutils.
800
801 2006-08-14  Eric Blake  <ebb9@byu.net>
802
803         Import the following change from libc:
804
805         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
806
807         Upstream bug 2997.
808         * misc/error.c: Add space between program name and message if file
809         name is missing.
810
811 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
812
813         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
814         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
815
816         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
817         in wchar_t.  Problem reported by Eric Blake.
818
819         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
820         LEN is smaller than SIZE.  Suggested by Bruno Haible.
821         Also, help the compiler to keep LEN in a register.
822
823 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
824
825         * .cppi-disable: Add snprintf.h, socket_.h.
826         * snprintf.c: Include <errno.h> and <limits.h>.
827         (EOVERFLOW): Define if the system does not.
828         Do not include "minmax.h"; it wasn't used.
829         (snprintf): Don't assume size_t promotes to an unsigned type.
830         Fix bug when generated string was too long for the buffer: the
831         buffer's contents are supposed to be the initial prefix of the
832         output.  Don't assume vasnprintf returns EOVERFLOW if the size
833         exceeds INT_MAX; do the check ourselves.
834
835         Import the following changes from libc:
836
837         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
838
839         * posix/regex_internal.c (re_string_skip_chars): If no character has
840         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
841         to the byte which couldn't be converted.
842         (re_string_reconstruct): Don't clear valid_raw_len before calling
843         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
844         tip_context using re_string_context_at.
845
846         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
847
848         * posix/regex.h: g++ still cannot handled [restrict].
849
850         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
851
852         * posix/regex.h: Remove special handling for VMS.
853
854 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
855
856         Sync from coreutils.
857
858         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
859
860         * mountlist.c [ME_REMOTE]: Filter out cifs.
861         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
862
863 2006-08-08  Eric Blake  <ebb9@byu.net>
864
865         * verror.c (verror_at_line): Work around glibc bug 2997, so that
866         verror_at_line output complies with GNU Coding Standards even when
867         file is NULL.
868
869 2006-08-08  Eric Blake  <ebb9@byu.net>
870
871         * verror.h, verror.c: New files.
872
873 2006-08-07  Bruno Haible  <bruno@clisp.org>
874
875         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
876         versions of AIX.
877         Reported by Ralf Wildenhues.
878
879 2006-08-06  Eric Blake  <ebb9@byu.net>
880
881         * error.h: Fold in some upstream changes from glibc.
882         * error.c: Likewise.
883
884 2006-07-29  Bruno Haible  <bruno@clisp.org>
885
886         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
887
888 2006-07-29  Bruno Haible  <bruno@clisp.org>
889
890         * setenv.c: Undo unintended modification done on 2006-02-27.
891
892 2006-07-28  Eric Blake  <ebb9@byu.net>
893
894         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
895         macro expansion.
896
897 2006-07-28  Simon Josefsson  <jas@extundo.com>
898
899         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
900         #include's.
901
902 2006-07-28  Simon Josefsson  <jas@extundo.com>
903
904         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
905         #include's.
906
907 2006-07-28  Bruno Haible <bruno@clisp.org>
908
909         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
910
911 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
912
913         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
914         arpa/inet.h.
915
916 2006-07-28  Bruno Haible  <bruno@clisp.org>
917
918         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
919         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
920         fallbacks.
921         Avoids link error on FreeBSD 4.x.
922         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
923
924         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
925         encoding.
926         * mbswidth.c (iswcntrl): Likewise.
927
928 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
929
930         * modechange.c (mode_compile): Numeric modes now affect setuid and
931         setgid on directories only if they set these bits.
932         * modechange.h: Remove obsolete comment about masks.
933
934 2006-07-27  Bruno Haible  <bruno@clisp.org>
935
936         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
937         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
938         defined.
939
940 2006-07-26  Eric Blake  <ebb9@byu.net>
941
942         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
943         like mingw that lack mkstemp.
944         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
945         avoid compilation warning on mingw.
946
947 2006-07-25  Bruno Haible  <bruno@clisp.org>
948
949         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
950         <stdarg.h> or config.h.
951
952 2006-07-24  Bruno Haible  <bruno@clisp.org>
953
954         * clean-temp.h: New file, from GNU gettext.
955         * clean-temp.c: New file, from GNU gettext.
956
957 2006-07-24  Bruno Haible  <bruno@clisp.org>
958
959         * tmpdir.h: New file, from GNU gettext.
960         * tmpdir.c: New file, from GNU gettext.
961
962 2006-07-23  Bruno Haible  <bruno@clisp.org>
963
964         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
965         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
966         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
967         gl_linked_remove_at): Use it.
968
969 2006-07-23  Eric Blake  <ebb9@byu.net>
970
971         * tmpfile-safer.c: New file.
972         * stdio-safer.h (fopen_safer): Add prototype.
973         * stdio--.h (tmpfile): Make safer.
974
975 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
976
977         * close-stream.c, close-stream.h: New files.
978
979 2006-07-22  Bruno Haible  <bruno@clisp.org>
980
981         Merge from GNU gettext 0.15.
982
983         2005-07-05  Bruno Haible  <bruno@clisp.org>
984
985                 * printf-args.c (printf_fetchargs): Work around broken
986                 definition of wint_t on mingw.
987
988         2005-02-12  Bruno Haible  <bruno@clisp.org>
989
990                 * xallocsa.h: Add extern "C" for C++.
991
992         2006-05-17  Bruno Haible  <bruno@clisp.org>
993
994                 Cygwin portability.
995                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
996
997         2006-04-30  Bruno Haible  <bruno@clisp.org>
998
999                 * progreloc.c: Include <mach-o/dyld.h> if available.
1000                 (find_executable): Use _NSGetExecutablePath when possible.
1001
1002         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
1003
1004                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
1005                 function.
1006
1007         2005-12-29  Bruno Haible  <bruno@clisp.org>
1008
1009                 * progreloc.c (set_program_name_and_installdir): Fix
1010                 compilation error.
1011
1012         2005-12-04  Bruno Haible  <bruno@clisp.org>
1013
1014                 Cygwin portability.
1015                 * progreloc.c: Include <windows.h> also on Cygwin.
1016                 (find_executable): Add support for Cygwin.
1017                 (set_program_name_and_installdir): Handle also platforms with
1018                 nonempty EXEEXT.
1019
1020         2006-07-11  Bruno Haible  <bruno@clisp.org>
1021
1022                 * javacomp.c: Fix a comment.
1023                 Reported by Jim Meyering.
1024
1025         2006-04-30  Bruno Haible  <bruno@clisp.org>
1026
1027                 * javacomp.h (compile_java_class): Add source_version,
1028                 target_version arguments.
1029                 * javacomp.c: Rewritten to choose only a compiler that
1030                 respects the specified source_version and target_version.
1031
1032         2006-06-27  Bruno Haible  <bruno@clisp.org>
1033
1034                 Assume correct S_ISDIR macro.
1035                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1036
1037         2006-07-22  Bruno Haible  <bruno@clisp.org>
1038
1039                 * javaversion.h: New file, from GNU gettext.
1040                 * javaversion.c: New file, from GNU gettext.
1041                 * javaversion.java: New file, from GNU gettext.
1042                 * javaversion.class: New file, from GNU gettext.
1043
1044         2006-05-17  Bruno Haible  <bruno@clisp.org>
1045
1046                 Cygwin portability.
1047                 * javaexec.c (execute_java_class): Test for jview program
1048                 also on Cygwin.
1049
1050         2006-04-09  Bruno Haible  <bruno@clisp.org>
1051
1052                 * fatal-signal.c: Don't include string.h.
1053                 (at_fatal_signal): Use a copying loop instead of memcpy.
1054
1055         2005-12-04  Bruno Haible  <bruno@clisp.org>
1056
1057                 * csharpexec.c: Add support for 'clix' launcher (untested).
1058                 (execute_csharp_using_sscli): New function.
1059                 (execute_csharp_program): Call it.
1060
1061         2006-06-21  Bruno Haible  <bruno@clisp.org>
1062
1063                 Avoid warnings from recent versions of mcs.
1064                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1065                 -o, -L, -r any more. Use options documented since mcs-1.0
1066                 instead. Similarly for -g.
1067
1068         2005-07-09  Bruno Haible  <bruno@clisp.org>
1069
1070                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1071                 add a .dll suffix.
1072                 Reported by Mark Junker <mjscod@gmx.de>.
1073
1074         2006-06-17  Bruno Haible  <bruno@clisp.org>
1075
1076                 * config.charset: Update for NetBSD 3.0.
1077
1078         2006-05-17  Bruno Haible  <bruno@clisp.org>
1079
1080                 Cygwin portability.
1081                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1082
1083         2006-05-16  Bruno Haible  <bruno@clisp.org>
1084
1085                 * localcharset.c [CYGWIN]: Include <windows.h>.
1086                 (get_charset_aliases): For Cygwin, return the same CPxxx
1087                 aliases list as under WIN32.
1088                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1089                 the environment variables. Fall back to GetACP().
1090
1091         2006-04-05  Bruno Haible  <bruno@clisp.org>
1092
1093                 * config.charset: Update Juan Manuel Guerrero's address.
1094
1095         2005-02-12  Bruno Haible  <bruno@clisp.org>
1096
1097                 * allocsa.h: Add extern "C" for C++.
1098
1099         2005-02-10  Bruno Haible  <bruno@clisp.org>
1100
1101                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1102                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1103
1104         2006-07-22  Bruno Haible  <bruno@clisp.org>
1105
1106                 * gettext.h: Update to GNU gettext-0.15.
1107
1108 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1109         and Simon Josefsson <jas@extundo.com>
1110
1111         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1112
1113         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1114
1115 2006-07-21  Eric Blake  <ebb9@byu.net>
1116
1117         * stdlib-safer.h: New file from coreutils, required by
1118         stdlib--.h.
1119
1120 2006-07-19  Derek R. Price  <derek@ximbiot.com>
1121
1122         * getaddrinfo.h: Don't define unimplemented AI_* flags.
1123         Reindent and repaginate.
1124
1125 2006-07-17  Bruno Haible  <bruno@clisp.org>
1126
1127         * gl_list.h: New file.
1128         * gl_list.c: New file.
1129         * gl_array_list.h: New file.
1130         * gl_array_list.c: New file.
1131         * gl_carray_list.h: New file.
1132         * gl_carray_list.c: New file.
1133         * gl_linked_list.h: New file.
1134         * gl_linked_list.c: New file.
1135         * gl_anylinked_list1.h: New file.
1136         * gl_anylinked_list2.h: New file.
1137         * gl_avltree_list.h: New file.
1138         * gl_avltree_list.c: New file.
1139         * gl_anyavltree_list1.h: New file.
1140         * gl_anyavltree_list2.h: New file.
1141         * gl_rbtree_list.h: New file.
1142         * gl_rbtree_list.c: New file.
1143         * gl_anyrbtree_list1.h: New file.
1144         * gl_anyrbtree_list2.h: New file.
1145         * gl_anytree_list1.h: New file.
1146         * gl_anytree_list2.h: New file.
1147         * gl_linkedhash_list.h: New file.
1148         * gl_linkedhash_list.c: New file.
1149         * gl_anyhash_list1.h: New file.
1150         * gl_anyhash_list2.h: New file.
1151         * gl_avltreehash_list.h: New file.
1152         * gl_avltreehash_list.c: New file.
1153         * gl_rbtreehash_list.h: New file.
1154         * gl_rbtreehash_list.c: New file.
1155         * gl_anytreehash_list1.h: New file.
1156         * gl_anytreehash_list2.h: New file.
1157
1158         * gl_oset.h: New file.
1159         * gl_oset.c: New file.
1160         * gl_array_oset.h: New file.
1161         * gl_array_oset.c: New file.
1162         * gl_avltree_oset.h: New file.
1163         * gl_avltree_oset.c: New file.
1164         * gl_rbtree_oset.h: New file.
1165         * gl_rbtree_oset.c: New file.
1166         * gl_anytree_oset.h: New file.
1167
1168 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1169
1170         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1171         New files.
1172         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1173         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1174         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
1175         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1176         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
1177         callers changed.  Revamp internals significantly, by not
1178         attempting to create directories that are temporarily more
1179         permissive than the final results.  Do not attempt to use
1180         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1181         This removes some race conditions, fixes some bugs, and simplifies
1182         things.  Use new dirchownmod function to do owner and mode changes.
1183         * mkdir-p.h: Likewise.
1184         * modechange.c (octal_to_mode): New function.
1185         (struct mode_change): New member mentioned.
1186         (make_node_op_equals): New arg mentioned.  All callers changed.
1187         (mode_compile): Keep track of which mode bits the user has explicitly
1188         mentioned.
1189         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1190         New arg PMODE_BITS, to keep track of which mode bits the user
1191         mentioned; it treats S_ISUID and S_ISGID speciall.
1192         All callers changed.
1193         * modechange.h: Likewise.
1194
1195 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1196
1197         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1198
1199 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1200
1201         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1202         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1203         macros into the GNU _D_EXACT_NAMLEN.
1204         * savedir.c:  Likewise.
1205         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1206
1207 2006-07-09  Jim Meyering  <jim@meyering.net>
1208
1209         * argp-pv.c: Remove a doubled word in a comment.
1210         * check-version.c (check_version): Likewise.
1211         * javacomp.c (compile_java_class): Likewise.
1212
1213 2006-07-08  Jim Meyering  <jim@meyering.net>
1214
1215         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1216
1217 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1218
1219         * getaddrinfo.c: Changes to compile under MSVC6: changed
1220         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1221         brackets.  Other minor changes to suppress some compiler
1222         warnings.
1223
1224 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1225
1226         * getloadavg.c: Use __VMS, not VMS.
1227         * getopt.c: Likewise.
1228         * getpagesize.h: Likewise.
1229         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1230         probably does not work.
1231
1232 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1233         and Paul Eggert  <eggert@cs.ucla.edu>
1234
1235         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1236         Don't worry about this obsolete case any more.
1237         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1238         directories.
1239         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1240         worry about this obsolete case any more.
1241         * fts.c: Likewise.
1242         * getcwd.c: Likewise.
1243         * glob.h: Likewise.
1244         * savedir.c: Likewise.
1245
1246 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1247
1248         * .cppi-disable: Add wcwidth.
1249         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1250         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1251         (ISGRAPH): Remove.  All uses changed to isgraph.
1252         (FOLD) [!defined _LIBC]: Remove special case.
1253         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1254         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1255         HAVE_ISBLANK.
1256         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1257
1258 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1259
1260         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1261
1262 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1263
1264         * memcasecmp.c: Include <limits.h>.
1265         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1266         * strtod.c (strtod): Don't assume isspace works on negative chars.
1267         Don't assume isdigit succeeds only on '0' through '9'.
1268
1269 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1270
1271         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1272         All uses of is_space replaced by isspace.
1273         * exit.h: Don't talk about STDC_HEADERS.
1274         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1275         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1276         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1277         replaced by isprint etc.
1278         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1279         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1280         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1281         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1282         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1283         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1284
1285 2006-07-05  Eric Blake  <ebb9@byu.net>
1286
1287         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1288         missing from netdb.h.
1289         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1290
1291 2006-06-27  Bruno Haible  <bruno@clisp.org>
1292
1293         Assume ANSI C header files and <ctype.h> functions.
1294         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1295         (mbsnwidth): Use isprint, iscntrl instead.
1296
1297 2006-07-03  Jim Meyering  <jim@meyering.net>
1298
1299         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1300         macro is used before the first cycle_check call.
1301
1302 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1303
1304         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1305         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1306         reported by Mark D. Baushke, one in
1307         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1308
1309         Merge from coreutils.
1310
1311         * .cppi-disable: Add stdint_.h.
1312         * .cvsignore: Add stdint.h.
1313
1314         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1315
1316         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1317         both double and long double versions.
1318         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1319         * xstrtold.c: New file.
1320         * xstrtod.h (xstrtold): New decl.
1321
1322         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1323
1324         * filemode.c (setst): Remove.
1325         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1326         (arguably) clearer, and the generated code is a bit smaller on my
1327         Debian GNU/Linux stable x86 host.
1328
1329         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1330
1331         * filemode.c: Include "filemode.h" first, to test the interface.
1332         Assume that filemode.h includes sys/types.h and sys/stat.h.
1333         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1334         (ftypelet): Reorder to put common cases first, for efficiency.
1335         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1336         to do 'M'.
1337         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1338         of 10, for compatibility with FreeBSD.  All callers changed.
1339         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1340         that can't be deduced solely from st_mode.  First arg is now a const
1341         pointer.
1342         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1343         (strmode): Renamed from mode_string.
1344         (filemodestring): New decl.
1345         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1346         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1347         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1348
1349         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1350
1351         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1352         fsusage.h now does that.  Include fsusage.h first, to test interface.
1353         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1354         at most one method (the old code could have generated decls that
1355         didn't conform to C89, not that this was ever exercised).
1356         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1357
1358         2006-03-19  Jim Meyering  <jim@meyering.net>
1359
1360         Work even in a chroot where d_ino values for entries in "/"
1361         don't match the stat.st_ino values for the same names.
1362         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1363         number, iterate through all entries again, using lstat instead.
1364         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1365         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1366
1367         * getcwd.c (__getcwd): Clarify a comment.
1368         Use memcpy in place of a call to strcpy.
1369
1370         2006-03-12  Jim Meyering  <jim@meyering.net>
1371
1372         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1373         that of the current directory (which we're about to chdir ".." out of),
1374         then save the dev-ino of the parent, instead.
1375
1376         * same-inode.h (SAME_INODE): New file/macro.
1377         * chdir-safer.c (SAME_INODE): Remove definition.
1378         Include "same-inode.h", instead.
1379         * same.c: Likewise.
1380         * cycle-check.h: Include "same-inode.h".
1381         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1382         * cycle-check.c (SAME_INODE): Remove definition.
1383         * root-dev-ino.h: Include "same-inode.h".
1384
1385         2006-03-11  Eric Blake  <ebb9@byu.net>
1386
1387         * same.c (same_name): s/base_name/last_component/
1388         * backupfile.c (check_extension, numbered_backup): Likewise.
1389         * filenamecat.c (file_name_concat): Likewise.
1390
1391         2006-03-11  Eric Blake  <ebb9@byu.net>,
1392                     Paul Eggert  <eggert@cs.ucla.edu>
1393
1394         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1395         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1396         drive prefix.
1397         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1398         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1399         (last_component): New method.
1400         * dirname.c (dir_len): Determine when drive letters need a
1401         subsequent slash.  Preserve // when it is special.
1402         (dir_name): Don't append dot when drive letter is absolute.
1403         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1404         * basename.c (base_name): New semantics - malloc the result.
1405         Preserve // when it is special.  Preserve relative files that look
1406         like drive letters.
1407         (base_len): Preserve // when it is special.
1408         (last_component): New method, similar to old base_name semantics.
1409         * stripslash.c (strip_trailing_slashes): Use last_component, not
1410         base_name.  Strip redundant slashes from ///.
1411
1412 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1413
1414         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1415         both are 64 bits, since this seems to be the tradition, and this
1416         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1417         we ever run into a host that prefers long long to long in this
1418         case, we'll need another configure-time test.  Problem reported by
1419         Jim Meyering.
1420
1421 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1422
1423         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1424         possible collision with system files.
1425         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1426         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1427         WCHAR_MIN and WCHAR_MAX in this case.
1428         (<stddef.h>): Do not include; no longer needed.
1429         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1430         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1431         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1432         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1433         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1434         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1435         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1436         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1437         !defined(__c99))]: Include in this case too, since it's harmless
1438         now.
1439         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1440         dangerous to do so.
1441         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1442         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1443         (_STDINT_MIN, _STDINT_MAX): New macros.
1444         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1445         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1446         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1447         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1448         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1449         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1450         macros, not typedefs; this simplifies things quite a bit.
1451         Use long int for all types narrower than int64_t.
1452         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1453         Define in terms of long long int or int64_t or long int,
1454         not int64_t or int32_t.  This saves some compile-time testing.
1455         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1456         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1457         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1458         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1459         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1460         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1461         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1462         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1463         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1464         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1465         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1466         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1467         undef any previous version and define our own version, for
1468         simplicity and consistency with the new macros for types.
1469         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1470         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1471         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1472         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1473         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1474         @WINT_T_SUFFIX@ to keep things simple here.
1475         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1476         Simplify by assuming typical 8/16/32/64 host, since we're
1477         already doing that elsewhere anyway.
1478         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1479         and assume long long int is 64 bits if available.  This
1480         speeds up 'configure'.
1481
1482 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1483
1484         * getaddrinfo.c: fixed typo
1485
1486 2006-06-29  Eric Blake  <ebb9@byu.net>
1487
1488         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1489         unused static function.
1490
1491 2006-06-29  Eric Blake  <ebb9@byu.net>
1492
1493         * stat_.h: New file.
1494
1495 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1496
1497         * strftime.c: Assume strftime() exists.
1498
1499 2006-06-28  Bruno Haible  <bruno@clisp.org>
1500
1501         * getaddrinfo.h: Fix POSIX URL.
1502         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1503         (use_win32_p): Make static.
1504         (getaddrinfo): Reject service name if it is empty or does not consist
1505         solely of decimal digits, or if its value is > 65535.
1506         (getnameinfo): Remove useless casts.
1507
1508 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1509
1510         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1511         Autoconf 2.60 says this stuff was obsolete.
1512
1513 2006-05-12  Bruno Haible  <bruno@clisp.org>
1514
1515         * mkdtemp.c [MINGW]: Include <io.h>.
1516         (mkdir): Define using _mkdir.
1517
1518 2006-06-28  Bruno Haible  <bruno@clisp.org>
1519
1520         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1521         declaration for wcwidth.
1522         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1523
1524 2006-06-28  Eric Blake  <ebb9@byu.net>
1525
1526         * xvasprintf.h: Fix comments.
1527
1528 2006-06-28  Eric Blake  <ebb9@byu.net>
1529
1530         * mbchar.h (wcwidth): Include wcwidth.h.
1531         * mbswidth.c (wcwidth): Move from here...
1532         * wcwidth.h: ...to this new file.
1533
1534 2006-06-28  Simon Josefsson  <jas@extundo.com>
1535
1536         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1537         functions there.  It will succeed on Windows XP, but on Windows
1538         2000 and (presumably) earlier, it will fail, and use the internal
1539         re-implementation.
1540         (use_win32_p): New function.
1541         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1542         Support AI_NUMERICSERV to disable getservbyname.
1543         (getnameinfo): New function, only supports
1544         NI_NUMERICHOST|NI_NUMERICSERV for now.
1545
1546         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1547         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1548         getnameinfo.
1549
1550 2006-06-27  Bruno Haible  <bruno@clisp.org>
1551
1552         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1553
1554 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1555
1556         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1557         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1558         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1559
1560 2006-06-26  Bruno Haible  <bruno@clisp.org>
1561
1562         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1563         WCHAR_MAX.
1564         Reported by Mark D. Baushke and Larry Jones.
1565
1566 2006-06-26  Bruno Haible  <bruno@clisp.org>
1567
1568         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1569         in pre-C99 mode.
1570         Suggested by Mark D. Baushke and Larry Jones.
1571
1572 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1573
1574         * stdint_.h: Treat BSD/OS like OpenBSD.
1575
1576 2006-06-23  Bruno Haible  <bruno@clisp.org>
1577
1578         * stdint_.h: Treat IRIX like OpenBSD.
1579
1580 2006-06-23  Bruno Haible  <bruno@clisp.org>
1581
1582         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1583         ISO C 99 Technical Corrigendum 1.
1584
1585 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1586
1587         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1588         Some compiler complained about some of them.  Problem reported by
1589         Larry Jones in
1590         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1591
1592 2006-06-21  Simon Josefsson  <jas@extundo.com>
1593
1594         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1595         variable.
1596
1597         * socket_.h: Don't define WINVER.
1598
1599         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1600         slightly modified to work in gnulib.
1601
1602 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1603
1604         * read-file.c (fread_file): Start with buffer allocation of
1605         0 bytes rather than 1 byte; this simplifies the code.
1606         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1607         code to free buffer and save/restore errno.
1608         (internal_read_file): Remove unused local.
1609
1610 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1611
1612         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1613         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1614         Problem reported by Denis Excoffier in
1615         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1616
1617 2006-06-19  Simon Josefsson  <jas@extundo.com>
1618
1619         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1620
1621 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1622
1623         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1624
1625 2006-06-17  Bruno Haible  <bruno@clisp.org>
1626
1627         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1628
1629 2006-06-17  Bruno Haible  <bruno@clisp.org>
1630
1631         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1632         problem on Solaris 2.5.1.
1633
1634 2006-06-16  Eric Blake  <ebb9@byu.net>
1635
1636         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1637         * unicodeio.c [!defined errno]: Likewise.
1638         * strtol.c [!defined errno]: Likewise.
1639         * strtod.c [!defined errno]: Likewise.
1640
1641 2006-06-15  Bruno Haible  <bruno@clisp.org>
1642
1643         * stdint_.h: Rewritten to be fully auto-configured.
1644         Fixes bug on HP-UX/IA64.
1645
1646 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1647
1648         * getdate.y (__attribute__): Don't define if already defined.
1649         Problem reported by Larry Jones.
1650         * utimens.c (__attribute__): Likewise.
1651
1652 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1653
1654         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1655         reported by Andreas Schwab.
1656
1657 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1658             Bruno Haible  <bruno@clisp.org>
1659
1660         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1661
1662 2006-05-26  Martin Lambers  <marlam@marlam.de>
1663
1664         * getpass.c: Updates the test for the native W32 API, and adds
1665         missing includes, thus fixing compilation warnings.
1666
1667 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1668
1669         * tempname.c (small_open, large_open): New macros.
1670         (__open, __open64) [!_LIBC]: Remove.
1671         (__gen_tempname): Use small_open and large_open instead of __open
1672         and __open64.  This fixes a portability bug on HP-UX 11.11i
1673         reported by Simon Wing-Tang in
1674         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1675
1676 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1677
1678         * exclude.c (exclude_fnmatch): New function.
1679         (excluded_file_name): Call exclude_fnmatch.
1680         * exclude.h (excluded_file_name): New prototype
1681
1682 2006-05-24  Bruno Haible  <bruno@clisp.org>
1683
1684         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1685         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1686         Reported by Thorsten Maerz <torte@netztorte.de> via
1687         Aaron Stone <aaron@serendipity.cx>.
1688
1689 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1690
1691         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1692         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1693         (my_usleep): Don't mishandle maximum value.
1694
1695 2006-05-19  Jim Meyering  <jim@meyering.net>
1696
1697         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1698
1699 2006-05-17  Bruno Haible  <bruno@clisp.org>
1700
1701         Cygwin portability.
1702         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1703
1704 2006-05-17  Bruno Haible  <bruno@clisp.org>
1705
1706         * stdint_.h: Fix recognition of Cygwin.
1707
1708 2006-05-11  Jim Meyering  <jim@meyering.net>
1709
1710         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1711
1712 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1713
1714         * crc.c (crc32_update): Remove unnecessary L suffix.
1715         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1716         unwanted sign propagation, e.g., on hosts with 64-bit int.
1717         There still are some problems with reeelly weird theoretical hosts
1718         (e.g., 33-bit int) but it's not worth worrying about now.
1719         * sha1.c (rol): Likewise.
1720         (K1, K2, K3, K4): Remove unnecessary L suffix.
1721
1722 2006-05-10  Bruno Haible  <bruno@clisp.org>
1723
1724         * des.c: Cast to avoid warnings.
1725
1726 2006-05-10  Simon Josefsson  <jas@extundo.com>
1727
1728         * md4.c: Typo fix, update copyright years.
1729         (K1, K2): Don't use L because it turn computations into 64-bit on
1730         64-bit platforms.
1731
1732 2006-05-09  Bruno Haible  <bruno@clisp.org>
1733
1734         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1735         (EOVERFLOW): Define fallback value.
1736         (xstrcat): New function.
1737         (xvasprintf): Recognize the special case of a string concatenation.
1738
1739 2006-05-01  Bruno Haible  <bruno@clisp.org>
1740
1741         * stdint_.h: Shorter URL.
1742         * inttypes.h: Likewise.
1743
1744 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1745
1746         * verify.h: Document the internals better.  Most of this change
1747         was written by Bruno Haible.
1748
1749 2006-04-29  Bruno Haible  <bruno@clisp.org>
1750
1751         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1752         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1753
1754 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1755
1756         * getdate.y (get_date): When adding relative date, start with the
1757         initial time, not with the result of the first mktime call.
1758
1759 2006-04-23  Bruno Haible  <bruno@clisp.org>
1760
1761         * copy-file.c: Include <unistd.h> unconditionally.
1762         * execute.c: Likewise.
1763         * fatal-signal.c: Likewise.
1764         * findprog.c: Likewise.
1765         * mkdtemp.c: Likewise.
1766         * pipe.h: Likewise.
1767         * pipe.c: Likewise.
1768         * wait-process.h: Likewise.
1769
1770 2006-04-23  Bruno Haible  <bruno@clisp.org>
1771
1772         * fwriteerror.c (fwriteerror): Call fclose also when an error
1773         condition was already detected.
1774         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1775
1776 2006-04-19  Derek Price  <derek@ximbiot.com>
1777             Eric Blake  <ebb9@byu.net>
1778
1779         * inttypes.h: Correct grammar in comment.
1780
1781 2006-04-18  Derek Price  <derek@ximbiot.com>
1782             Paul Eggert  <eggert@cs.ucla.edu>
1783
1784         * inttypes.h: New file.
1785         * strtoimax.c: Assume <inttypes.h>.
1786
1787 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1788
1789         * utimens.c (futimens): glibc futimesat messes up if /proc
1790         isn't mounted.  Problem reported by Kir Kolyshkin.
1791
1792 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1793
1794         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1795         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1796         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1797
1798 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1799
1800         Merge regex changes from libc, removing some of our
1801         POSIX-conformance changes that were rejected and redoing them in a
1802         less-intrusive way.
1803
1804         * regcomp.c (re_compile_internal, init_dfa):
1805         Length arg is now size_t, not Idx.  All uses changed.
1806         (peek_token): Forward decl now says internal_function.
1807         (__re_error_msgid, __re_error_msgid_idx):
1808         Now static rather than extern with attribute_hidden.
1809         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1810         For some reason libc prefers K&R style defns for external functions.
1811         (regerror) [!defined _LIBC]: Likewise.
1812         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1813         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1814         (build_range_exp, build_collating_symbol):
1815         Use K&R-style defn.
1816         (re_compile_fastmap): Use '\0' to memset, not 0.
1817         (utf8_sb_map): Make the calculations more obvious.
1818         (init_dfa, parse_bracket_exp, build_charclass_op):
1819         Call calloc and cast result, as glibc does.
1820         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1821         (build_range_exp, build_collating_symbol):
1822         Now internal functions.
1823
1824         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1825
1826         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1827         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1828         Don't depend on VMS; depend on __VMS instead, for POSIX
1829         namespace cleanness.
1830         (regoff_t): Define to ssize_t, not long int.
1831
1832         Remove the REG_ macros named below.  Instead, make the old names
1833         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1834         __USE_GNU_REGEX.
1835         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1836         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1837         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1838         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1839         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1840         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1841         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1842         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1843         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1844         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1845         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1846         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1847         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1848         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1849         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1850         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1851         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1852         (REG_NREGS):
1853         Remove.  All uses replaced by the old RE_* names.
1854         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1855         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1856         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1857         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1858         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1859         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1860         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1861         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1862         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1863         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1864         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1865         Don't bother having these macros be independent of each others'
1866         values, since they no longer exist in the POSIX name space.
1867
1868         Rename the following member names back to their old names,
1869         unless !__USE_GNU_REGEX.  All uses changed back.
1870         (buffer): Renamed from re_buffer.
1871         (allocated): Renamed from re_allocated.
1872         (used): Renamed from re_used.
1873         (syntax): Renamed from re_syntax.
1874         (fastmap): Renamed from re_fastmap.
1875         (translate): Renamed from re_translate.
1876         (can_be_null): Renamed from re_can_be_null.
1877         (regs_allocated): Renamed from re_regs_allocated.
1878         (fastmap_accurate): Renamed from re_fastmap_accurate.
1879         (no_sub): Renamed from re_no_sub.
1880         (not_bol): Renamed from re_not_bol.
1881         (not_eol): Renamed from re_not_eol.
1882         (newline_anchor): Renamed from re_newline_anchor.
1883         (num_regs): Renamed from rm_num_regs.
1884         (start): Renamed from rm_start.
1885         (end): Renamed from rm_end.
1886
1887         (free_state): Move up a bit.
1888
1889         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1890         #define to be empty.
1891         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1892         when that is what is intended.
1893         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1894         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1895         (MAX): New macro.
1896         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1897         All uses changed back to re_malloc, etc.  It's now the caller's
1898         responsibility to check for overflow; all callers changed.
1899         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1900         (re_x2nrealloc): Remove.
1901         (free_state): Remove decl.
1902
1903         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1904         (re_set_registers, re_exec):
1905         Use K&R-style defn.
1906
1907         2006-01-31  Roland McGrath  <roland@redhat.com>
1908
1909         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1910         Reported by Mike Frysinger <vapier@gentoo.org>.
1911
1912         2006-01-15  Andreas Jaeger  <aj@suse.de>
1913
1914         [BZ #1950]
1915         * regex_internal.c (re_string_reconstruct): Adjust for
1916         build_wcs_upper_buffer change.
1917         (build_wcs_upper_buffer): Change return type.
1918
1919         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1920
1921         * regex_internal.h: Include <stdint.h> if available.
1922
1923         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1924
1925         * regex_internal.h (SIZE_MAX): Provide a default definition.
1926
1927         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1928
1929         * regcomp.c: Adjust for changed secondary hash function.
1930
1931         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1932
1933         * regex.h: Pretty printing.
1934         Clean up namespace a bit.
1935
1936         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1937
1938         * regexec.c (update_cur_sifted_state, check_arrival,
1939         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1940
1941         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1942                     Ulrich Drepper  <drepper@redhat.com>
1943
1944         [BZ #1302]
1945         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1946         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1947
1948         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1949
1950         [BZ #281]
1951         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1952         * regcomp.c: Remove unnecessary uses of
1953         unsigned RE_TRANSLATE_TYPE.
1954         * regex_internal.h: Likewise.
1955         * regex_internal.c: Likewise.
1956         * regexec.c: Likewise.
1957         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1958
1959         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1960
1961         * regexec.c (find_recover_state): Remove unnecessary
1962         initialization.
1963         (transit_state_bkref): Make DFA a const pointer.
1964         (get_subexp): Likewise.
1965         (check_arrival): Likewise.
1966         (update_cur_sifted_state): Likewise.
1967         (re_search_internal): Likewise.
1968         (prune_impossible_nodes): Likewise.
1969         (acquire_init_state_context): Likewise.
1970         (proceed_next_node): Likewise.
1971         (set_regs): Likewise.
1972         (free_fail_stack_return): Likewise.
1973         (check_arrival_expand_ecl): Mark DFA parameter as const.
1974         (check_arrival_expand_ecl_sub): Likewise.
1975         (check_subexp_limits): Likewise.
1976         (sub_epsilon_src_nodes):  Likewise.
1977         (add_epsilon_src_nodes):  Likewise.
1978         (merge_state_array): Likewise.
1979         (update_regs): Likewise.
1980         (build_trtable): Likewise.
1981         (sift_states_backward): Mark MCTX parameter as const.
1982         (build_sifted_states): Likewise.
1983         (update_cur_sifted_state): Likewise.
1984         (sift_states_mkref): Likewise.
1985         (check_arrival_expand_ecl): Mark eclosure as const.
1986         (check_dst_limits_calc_pos_1): Likewise.
1987         * regex_internal.h (re_match_context_t): Make dfa a const
1988         pointer.
1989
1990         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1991
1992         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1993         (transit_state_sb): Likewise.
1994         (transit_state_mb): Likewise.
1995         (sift_states_iter_mb): Likewise.
1996         (check_arrival_add_next_nodes): Likewise.
1997         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1998         [_LIBC] (re_search_2_stub): Use mempcpy.
1999
2000         * regex_internal.c (re_string_reconstruct): Avoid calling
2001         mbrtowc for very simple UTF-8 case.
2002
2003         * regex_internal.c (re_acquire_state): Make DFA pointer arg
2004         a pointer-to-const.
2005         (re_acquire_state_context): Likewise.
2006         * regex_internal.h: Adjust prototypes.
2007
2008         * regex.c: Prevent using C++ compilers.
2009
2010         * regex_internal.c (re_acquire_state): Minor code rearrangement.
2011         (re_acquire_state_context): Likewise.
2012
2013 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
2014             Bruno Haible  <bruno@clisp.org>
2015
2016         * stdint_.h: On OpenBSD, don't redefine types already included in
2017         <sys/types.h> and <inttypes.h>.
2018
2019 2006-03-24  Eric Blake  <ebb9@byu.net>
2020
2021         * time_r.c (copy_string_result): Remove, as it is no longer used.
2022
2023 2006-03-24  Simon Josefsson  <jas@extundo.com>
2024
2025         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2026         including some doc fixes.
2027         (base64_encode_alloc): Fix +1 bug on allocation failures.
2028
2029 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2030
2031         * base64.c (base64_encode): Do not read past end of array with
2032         unsanitized input on systems with CHAR_BIT > 8.
2033
2034 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
2035
2036         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2037         Typedef to long int, not to off_, as POSIX will likely change
2038         in that direction.
2039
2040 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2041
2042         * argp-help.c (validate_uparams): Fix typo
2043         * argp-parse.c (argp_default_options): Consistently begin help
2044         messages with a lowercase letter.
2045
2046 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
2047
2048         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
2049         overrun buffers and shouldn't be used (much as gets shouldn't be
2050         used).
2051         * time_r.c (asctime_r, ctime_r): Likewise.
2052
2053 2006-03-08  Simon Josefsson  <jas@extundo.com>
2054
2055         * gc-gnulib.c (randomize): Don't open files called 'no', they
2056         signal that configure disabled the device.
2057
2058 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
2059
2060         * c-stack.c: Include unistd.h unconditionally, since we now assume
2061         the unistd module.
2062         * getlogin_r.c: Likewise.
2063         * getlogin_r.h: Likewise.
2064         * glob.c: Likewise.
2065         * pagealign_alloc.c: Likewise.
2066         * unistd_.h: Remove; no longer needed.
2067
2068 2006-03-07  Simon Josefsson  <jas@extundo.com>
2069
2070         * unistd_.h: New file.
2071
2072 2006-03-07  Simon Josefsson  <jas@extundo.com>
2073
2074         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2075
2076 2006-03-01  Simon Josefsson  <jas@extundo.com>
2077
2078         * readline.c: Fix typo, tiny patch from Stepan Kasal
2079         <kasal@ucw.cz>.
2080
2081 2006-02-28  Simon Josefsson  <jas@extundo.com>
2082
2083         * getopt.c: Protect #include of unistd.h, for MSVS.
2084
2085 2006-02-27  Simon Josefsson  <jas@extundo.com>
2086
2087         * base64.h: Indent #define's.  From Jim Meyering
2088         <jim@meyering.net>.
2089
2090 2006-02-27  Jim Meyering  <jim@meyering.net>
2091
2092         Revert the change of 2006-02-24, so these files can continue
2093         to be sync'd from gettext.
2094         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2095         of `config.h'.
2096
2097 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
2098
2099         * glob.c: Say "invalid" rather than "illegal" in comments.
2100
2101 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2102
2103         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2104
2105 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2106
2107         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2108         AT_FDCWD exceeds INT_MAX.
2109         * openat.h (AT_FDCWD): Likewise.
2110
2111 2006-02-14  Jim Meyering  <jim@meyering.net>
2112
2113         Sync from coreutils.
2114
2115         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2116         failure on deficient systems, and simplify gnulib lgpl dependencies.
2117         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2118         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2119
2120         * xalloc-die.c: Remove unused definition of N_.
2121
2122 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2123
2124         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2125
2126 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
2127
2128         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2129         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2130
2131 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2132
2133         * argp-namefrob.h: Restore changes accidentally lost during the
2134         "autoupdate" on 2005-12-12.
2135
2136 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
2137
2138         * fnmatch.c (L_): Renamed from L, to work around a bug in
2139         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2140         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2141         All uses changed.
2142
2143 2006-01-26  Simon Josefsson  <jas@extundo.com>
2144
2145         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2146         prototype is visible on mingw32.
2147
2148         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2149         for mingw32.
2150
2151         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2152         mingw32).
2153
2154 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2155
2156         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
2157         attempt to open for write; this always fails, at least on POSIX
2158         hosts.  This reinstates the 2006-01-09 change, which was
2159         inadvertently removed.
2160
2161 2006-01-26  Bruno Haible  <bruno@clisp.org>
2162             Paul Eggert  <eggert@cs.ucla.edu>
2163
2164         * stdbool_.h (_Bool)
2165         [(! (defined __cplusplus || defined __BEOS__)
2166           && !defined __GNUC__
2167           && !(defined __HP_cc || defined __xlc__
2168                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2169                || defined __sgi))]:
2170         #define to signed char in these cases too; this simplifies
2171         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2172         etc., separately) and makes it more conservative.
2173
2174 2006-01-21  Jim Meyering  <jim@meyering.net>
2175
2176         Sync from the stable (b5) branch of coreutils:
2177
2178         * fts.c (fts_children): Don't let close() clobber errno from
2179         failed fchdir().
2180
2181         * fts.c (fts_stat): When following a symlink-to-directory,
2182         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2183         a dangling symlink.  That can also happen at least for ELOOP.
2184         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2185         FYI, this bug predates the inclusion of fts.c in coreutils.
2186
2187         * fts.c (fts_open): Put new maxarglen declaration and uses
2188         in their own block, so pre-c99 compilers don't object.
2189
2190         Avoid the double-free (first in fts_read, second in fts_close) that
2191         would occur when an `active' directory is made inaccessible (e.g.,
2192         via chmod a-x) during a traversal.
2193         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2194         before returning.  Reproduce this failure by
2195         mkdir -p a/b; cd a; chmod a-x . b
2196         Reported by Stavros Passas.
2197
2198 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2199
2200         * argp-namefrob.h: Bugfix. Remove stray #
2201
2202 2006-01-25  Bruno Haible  <bruno@clisp.org>
2203
2204         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2205         warnings.
2206         Reported by Paul Eggert.
2207
2208 2006-01-25  Jim Meyering  <jim@meyering.net>
2209
2210         * fileblocks.c: Remove more useless parentheses.
2211         * readutmp.h: Likewise.
2212
2213 2006-01-24  Bruno Haible  <bruno@clisp.org>
2214
2215         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2216         has it.
2217         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2218         2005-11-26.
2219
2220         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2221         to avoid problems with the built-in _Bool type.
2222         Reported by Paul Eggert on 2005-11-26.
2223
2224 2006-01-24  Jim Meyering  <jim@meyering.net>
2225
2226         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2227
2228 2006-01-24  Simon Josefsson  <jas@extundo.com>
2229
2230         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2231         Bruno.
2232
2233 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2234
2235         Work around porting bugs reported by Dieter in
2236         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2237         * getopt.c (_NOPROTO): Remove; no longer needed.
2238         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2239         Include "getopt.h" first, to check interface.
2240         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2241         !HAVE_DECL_GETENV.
2242         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2243         (__strndup): Revert to K&R-style function dfns, the glibc style.
2244         * strnlen.c: Don't claim it's taken from glibc; it's not.
2245         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2246         Include strnlen.h first, to get prototype properly.
2247         (strnlen): Renamed from __strnlen.
2248         Remove weak alias.
2249
2250 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2251
2252         These changes imported from libc.
2253         * getopt.c: Use __fxprintf instead of inline stream orientation
2254         test and two separate function calls.
2255         * strndup.c (__strndup): Add libc_hidden_def.
2256
2257 2006-01-22  Bruno Haible  <bruno@clisp.org>
2258
2259         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2260         temporary buffer for sprintf, take into account the precision also
2261         for 'd', 'i', 'u', 'o', 'x', 'X'.
2262
2263 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2264
2265         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2266         to pacify gcc -Wswitch-default.
2267
2268 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2269
2270         * argp-help.c (usage_long_opt): Do not print DOC options.
2271         (__argp_base_name): Removed
2272         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2273         typo.
2274         (__argp_base_name): Provide macro definition or extern declaration
2275         depending on the configuration
2276
2277 2006-01-20  Simon Josefsson  <jas@extundo.com>
2278
2279         * inet_ntop.h: Unconditionally include sys/socket.h.
2280
2281 2006-01-19  Simon Josefsson  <jas@extundo.com>
2282
2283         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2284
2285 2006-01-12  Simon Josefsson  <jas@extundo.com>
2286
2287         * base64.c: Fix warning, reported by Bruno Haible
2288         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2289
2290 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2291
2292         Sync from coreutils.
2293         * md5.c: Fix commentary typos.
2294         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2295         * md5.h (__attribute__): Remove; unused.
2296         * sha1.c: Fix commentary to match md5 better.
2297         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2298         so that we don't need to worry about alignment.  All uses changed.
2299         This merges the 2005-10-28 md5 change into sha1.
2300
2301 2006-01-11  Jim Meyering  <jim@meyering.net>
2302
2303         Sync from coreutils.
2304         * md5.c (OP): Fix spacing.
2305
2306 2006-01-11  Simon Josefsson  <jas@extundo.com>
2307
2308         * stdint_.h (SIZE_MAX): Add missing (.
2309
2310 2006-01-10  Bruno Haible  <bruno@clisp.org>
2311
2312         * argp.h (__const): Remove macro. Use const instead.
2313         * argp-fmtstream.h (__const): Likewise.
2314         * glob_.h (__const): Remove macro.
2315         * glob-libc.h: Use const instead of __const.
2316
2317 2006-01-10  Jim Meyering  <jim@meyering.net>
2318
2319         Avoid the double-free (first in fts_read, second in fts_close) that
2320         would occur when an `active' directory is made inaccessible (e.g.,
2321         via chmod a-x) during a traversal.
2322         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2323         before returning.  Reproduce this failure by
2324         mkdir -p a/b; cd a; chmod a-x . b
2325         Reported by Stavros Passas.
2326
2327         Sync from coreutils.
2328         * sha1.c: Tweak grammar in a comment.
2329
2330 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2331
2332         * regex_internal.h (BITSET_WORD_BITS):
2333         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2334         preprocessor mishandles large unsigned values as if they were signed.
2335         Problem reported by Claudio Fontana in
2336         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2337
2338 2006-01-10  Simon Josefsson  <jas@extundo.com>
2339
2340         * socket_.h: New file.
2341
2342 2006-01-10  Bruno Haible  <bruno@clisp.org>
2343
2344         * localcharset.c: Update from GNU gettext.
2345
2346 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2347
2348         Sync from coreutils.
2349         * chdir-long.c (cdb_free): Don't bother trying to open directory
2350         for write access: POSIX says that must fail.
2351         * fts.c (diropen): Likewise.
2352         * save-cwd.c (save_cwd): Likewise.
2353         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2354         well, for minor improvements on hosts that lack O_DIRECTORY.
2355         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2356         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2357         Fall back on chown if open failed with EACCES.
2358
2359         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2360         Report an error at compile-time if only a 1-second nominal clock
2361         resolution is found.
2362
2363         * lchmod.h: New file.
2364         * mkdir-p.c: Include lchmod.h, lchown.h.
2365         (make_dir_parents): Use lchown rather than chown, and
2366         lchmod rather than chmod.
2367
2368         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2369         too.  Problem with "none" reported by Bob Proulx.  Problem with
2370         "proc" reported by n0dalus.
2371
2372         * mountlist.c: Include <limits.h>.
2373         (dev_from_mount_options)
2374         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2375         New function.  It no longer assumes "dev=" has the System V meaning
2376         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2377         (read_file_system_list)
2378         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2379         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2380         dev= in that case.
2381
2382         * posixtm.h (PDS_PRE_2000): New macro.
2383         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2384         All usages changed.  Reject dates outside the range 1969-1999 if
2385         PDS_PRE_2000 is used.
2386
2387 2006-01-09  Jim Meyering  <jim@meyering.net>
2388
2389         Sync from coreutils.
2390
2391         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2392
2393         * chdir-safer.h, chdir-safer.c: New files.
2394
2395         * modechange.c (mode_compile): Reject an invalid mode string
2396         that starts with an octal digit.  From Andreas Gruenbacher.
2397
2398         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2399         and dup to open_safer and dup_safer, respectively.
2400         (openat_permissive): Fix typo in comment.
2401
2402         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2403         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2404         (_): Remove; no longer needed.
2405         (openat): Renamed from rpl_openat; no need for rpl_openat
2406         since openat.h renames openat for us.
2407         Replace most of the body with a call to openat_permissive,
2408         to avoid duplicate code.
2409         Port to (probably hypothetical) environments were mode_t is
2410         wider than int.
2411         (openat_permissive): Require mode arg, so that we can check
2412         types better.  Put it just after flags.  Change cwd failure
2413         indicator from pointer-to-bool to pointer-to-errno-value.
2414         All callers changed.
2415         Invoke openat_save_fail and/or openat_restore_fail if
2416         cwd_errno is null, so that openat can call us.
2417         (openat_permissive, fdopendir, fstatat, unlinkat):
2418         Simplify errno handling to avoid some duplicate code,
2419         as it's OK to set errno on success.
2420         * openat.h: Revamp code so that function macros depend on
2421         __OPENAT_PREFIX only, not also on AT_FDCWD.
2422         (openat_ro): Remove.  Caller changed to use openat_permissive.
2423         (openat_permissive): Now a macro, if not a function.
2424         (openat_restore_fail, openat_save_fail): Now always functions,
2425         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2426
2427         * openat-priv.h: New file, defining macros used by mkdirat.c
2428         and openat.c.
2429         * mkdirat.c: Include openat-priv.h.
2430         Remove definitions of macros defined therein.
2431         * openat.c: Likewise.
2432
2433         * mkdirat.c (mkdirat): New file and function.
2434         * openat.h (mkdirat): Declare.
2435
2436         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2437
2438         * openat.h (openat_permissive): Declare.
2439         (openat_ro): Define.
2440
2441         * openat.c (EXPECTED_ERRNO): New macro.
2442         (openat_permissive): New function -- used in remove.c rewrite.
2443         (all functions): Set errno just before returning, only if there
2444         was an actual failure.
2445         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2446
2447         Emulate openat-family functions using Linux's procfs, if possible.
2448         Idea and some code based on Ulrich Drepper's glibc changes.
2449
2450         * openat.c: (BUILD_PROC_NAME): New macro.
2451         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2452         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2453         before falling back on save_cwd and restore_cwd.
2454         (fdopendir, fstatat, unlinkat): Likewise.
2455
2456         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2457         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2458
2459         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2460         as second argument to va_arg.  Otherwise, some versions of gcc
2461         warn that `if this code is reached, the program will abort'.
2462
2463 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2464
2465         Sync from coreutils.
2466
2467         Add POSIX ACL support
2468         * acl.h (copy_acl, set_acl): Add declarations.
2469         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2470         systems other than Linux.
2471         (chmod_or_fchmod): New function: use fchmod when possible,
2472         and chmod otherwise.
2473         (file_has_acl): Add a POSIX ACL implementation, with a
2474         Linux-specific subcase.
2475         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2476         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2477         acls are unsupported.
2478         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2479         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2480         are unsupported.
2481
2482 2006-01-09  Bruno Haible  <bruno@clisp.org>
2483
2484         * sysexit_.h (EX_OK): New macro.
2485         Suggested by Martin Lambers <marlam@marlam.de>.
2486
2487 2006-01-09  Bruno Haible  <bruno@clisp.org>
2488
2489         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2490         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2491         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2492         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2493
2494 2006-01-09  Bruno Haible  <bruno@clisp.org>
2495
2496         * stdint_.h (SIZE_MAX): Write the value without involving negative
2497         numbers.
2498
2499 2005-10-16  Bruno Haible  <bruno@clisp.org>
2500
2501         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2502         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2503
2504 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2505
2506         * strftime.c (tzname): Don't declare if it is already #defined.
2507         Problem reported for Mingw by Mark Junker.
2508
2509 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2510
2511         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2512         long int, not int, for nanosecond counts, so that people who are
2513         used to POSIX struct timespec won't be surprised.  Reported by Jim
2514         Meyering.
2515
2516 2005-12-16  Jim Meyering  <jim@meyering.net>
2517
2518         * fprintftime.c, fprintftime.h: New files.
2519
2520 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2521
2522         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2523         * argp-help.c (fill_in_uparams): Check if the constructed
2524         struct uparams is valid. Fall back to the default values if it is
2525         not.
2526
2527 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2528
2529         * argp-help.c (__argp_base_name): New function
2530         (__argp_short_program_name): Rewrite using __argp_base_name
2531         * argp-namefrob.h: Define program_invocation_name and
2532         program_invocation_short_name if requested
2533         (__argp_base_name): Add prototype
2534         * argp-parse.c (argp_def): Use gettext wrappers
2535         (argp_default_parser): Use __argp_base_name
2536         * argp-pin.c: New file. Defines program_invocation_name and
2537         program_invocation_short_name on systems that lack them.
2538
2539 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2540
2541         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2542         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2543         porting problem reported by Georg Schwarz in
2544         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2545
2546 2005-07-09  Bruno Haible  <bruno@clisp.org>
2547
2548         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2549         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2550         Reported by Mark Junker <mjscod@gmx.de>.
2551
2552 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2553
2554         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2555         (uintmax_t) [defined uintmax_t]: Do not declare.
2556         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2557         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2558         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2559         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2560         sake of portability to weird hosts that C allows (though we don't
2561         know of any practical examples).
2562
2563         * savedir.h (fdsavedir): New decl.
2564         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2565         contains most of the former guts of savedir.
2566         (savedir): Use savedirstream.
2567         Include "openat.h".
2568
2569 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2570
2571         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2572         coreutils no longer futzes with rounding modes.
2573
2574 2005-11-14  Jim Meyering  <jim@meyering.net>
2575
2576         * mkstemp-safer.c: Include <config.h>, required for possible
2577         replacement of mkstemp.
2578
2579 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2580
2581         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2582         business.
2583         (gethrxtime) [! (HAVE_NANOUPTIME
2584         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2585         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2586         our own approximation.
2587
2588 2005-11-10  Simon Josefsson  <jas@extundo.com>
2589
2590         * readline.c: Remove EOL.
2591
2592 2005-11-08  Eric Blake  <ebb9@byu.net>
2593
2594         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2595
2596 2005-11-08  Eric Blake  <ebb9@byu.net>
2597
2598         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2599
2600 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2601
2602         Fix porting problem reported by Theodoros V. Kalamatianos.
2603         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2604         Don't assume that futimes failing means we must fail.
2605
2606 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2607
2608         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2609         leave errno alone.  Problem reported by Dmitry V. Levin.
2610
2611 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2612
2613         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2614         errno alone.  Problem reported by Frederic Jolliton.
2615
2616 2005-10-28  Simon Josefsson  <jas@extundo.com>
2617
2618         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2619         "restrict" keywords, as per POSIX.  Protect the function
2620         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2621         Don't use K&R prototypes.  Check the sprintf return values.
2622         Re-define EAFNOSUPPORT if not present.  Indent.
2623
2624         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2625         suggested by Bruno Haible <bruno@clisp.org>.
2626
2627         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2628
2629         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2630
2631         * gc-libgcrypt.c: Add MD2 (which is not available through
2632         libgcrypt).
2633
2634         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2635
2636         * md2.h, md2.c: New files.
2637
2638 2005-10-24  Simon Josefsson  <jas@extundo.com>
2639
2640         * md4.h: Shrink buffer size, now that we changed the type.
2641
2642 2005-10-22  Simon Josefsson  <jas@extundo.com>
2643
2644         * arcfour.h, arcfour.c: Use fixed size indices in the
2645         arcfour_context struct (simplify test vector testing in GNU
2646         Shishi).
2647
2648 2005-10-22  Simon Josefsson  <jas@extundo.com>
2649
2650         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2651         suggested by Bruno Haible <bruno@clisp.org>.
2652
2653 2005-10-22  Simon Josefsson  <jas@extundo.com>
2654
2655         * crc.h: Include stddef.h, for size_t.
2656
2657 2005-10-21  Simon Josefsson  <jas@extundo.com>
2658
2659         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2660         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2661
2662 2005-10-21  Simon Josefsson  <jas@extundo.com>
2663
2664         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2665         block.
2666
2667 2005-10-21  Simon Josefsson  <jas@extundo.com>
2668
2669         * gc-gnulib.c: Support ARCTWO in CBC mode.
2670
2671 2005-10-21  Simon Josefsson  <jas@extundo.com>
2672
2673         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2674         <bruno@clisp.org>.
2675
2676         * hmac-sha1.c (hmac_sha1): Likewise.
2677
2678         * crc.c (crc32_update): Actually use crc parameter, suggested by
2679         Bruno Haible <bruno@clisp.org>.
2680
2681         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2682         <bruno@clisp.org>.
2683
2684 2005-10-21  Simon Josefsson  <jas@extundo.com>
2685
2686         * des.h, des.c: New files.
2687
2688         * gc-gnulib.c: Support DES.c
2689
2690 2005-10-21  Simon Josefsson  <jas@extundo.com>
2691
2692         * arctwo.h, arctwo.c: New files.
2693
2694         * gc-gnulib.c: Support ARCTWO.
2695
2696 2005-10-21  Simon Josefsson  <jas@extundo.com>
2697
2698         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2699
2700 2005-10-19  Simon Josefsson  <jas@extundo.com>
2701
2702         * gc-gnulib.c: Support ARCFOUR.
2703
2704 2005-10-19  Simon Josefsson  <jas@extundo.com>
2705
2706         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2707         support.
2708
2709         * gc.h: Add ECB enum type.
2710
2711         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2712
2713 2005-10-19  Simon Josefsson  <jas@extundo.com>
2714
2715         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2716
2717 2005-10-18  Simon Josefsson  <jas@extundo.com>
2718
2719         * md4.h, md4.c: New files, based on md5.?.
2720
2721 2005-10-17  Simon Josefsson  <jas@extundo.com>
2722
2723         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2724
2725         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2726
2727 2005-10-17  Simon Josefsson  <jas@extundo.com>
2728
2729         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2730
2731 2005-10-17  Simon Josefsson  <jas@extundo.com>
2732
2733         * gc.h, gc-libgcrypt.c: Add ciphers.
2734
2735 2005-10-17  Simon Josefsson  <jas@extundo.com>
2736
2737         * sha1.c: Use uint32_t instead of md5_uint32.t
2738
2739         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2740         md5.h.
2741
2742         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2743
2744         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2745
2746 2005-10-15  Simon Josefsson  <jas@extundo.com>
2747
2748         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2749
2750         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2751
2752 2005-10-14  Simon Josefsson  <jas@extundo.com>
2753
2754         * arcfour.h, arcfour.c: New files.
2755
2756 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2757
2758         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2759         include <wchar.h>; no longer needed.
2760
2761 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2762         and  Ulrich Drepper  <drepper@redhat.com>
2763
2764         Import from libc.
2765         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2766         instead of inline stream orientation test and two separate
2767         function calls.  Pay no attention to USE_IN_LIBIO.
2768
2769 2005-10-14  Roland McGrath  <roland@redhat.com>
2770
2771         Import from libc.  [BZ #1331]
2772         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2773         macro argument.
2774         Reported by Matej Vela <vela@debian.org>.
2775
2776 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2777
2778         * mkdir-p.c (make_dir_parents): Don't report an error if an
2779         intermediate directory is in a read-only file system.  Problem
2780         reported by Eric Blake.
2781
2782 2005-10-13  Simon Josefsson  <jas@extundo.com>
2783
2784         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2785         Move memory allocation outside of loop.
2786
2787 2005-10-12  Simon Josefsson  <jas@extundo.com>
2788
2789         * gc-pbkdf2-sha1.c: New file.
2790
2791         * gc.h: Add gc_pbkdf2_sha1 prototype.
2792
2793 2005-10-12  Simon Josefsson  <jas@extundo.com>
2794
2795         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2796         suggested by Bruno Haible <bruno@clisp.org>.
2797
2798 2005-10-12  Simon Josefsson  <jas@extundo.com>
2799
2800         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2801
2802         * gc-gnulib.c (gc_hmac_sha1): New function.
2803
2804 2005-10-12  Simon Josefsson  <jas@extundo.com>
2805
2806         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2807
2808 2005-10-12  Simon Josefsson  <jas@extundo.com>
2809
2810         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2811         GC_USE_HMAC_MD5, respectively.
2812
2813         * gc-libgcrypt.c (gc_md5): Fix assert call.
2814         (gc_md5): Fix typo.
2815
2816         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2817
2818         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2819
2820         * gc-gnulib.c (gc_hash_buffer): Ditto.
2821
2822 2005-10-11  Bruno Haible  <bruno@clisp.org>
2823
2824         * c-strcasestr.h: New file, from GNU gettext.
2825         * c-strcasestr.c: New file, from GNU gettext.
2826
2827 2005-10-11  Bruno Haible  <bruno@clisp.org>
2828
2829         * c-strcase.h: New file, from GNU gettext.
2830         * c-strcasecmp.c: New file, from GNU gettext.
2831         * c-strncasecmp.c: New file, from GNU gettext.
2832
2833 2005-10-11  Simon Josefsson  <jas@extundo.com>
2834
2835         * crc.h, crc.c: New files.
2836
2837         * gc.h (gc_hash_buffer): Add doc.
2838
2839 2005-10-08  Simon Josefsson  <jas@extundo.com>
2840
2841         * gc.h: Add gc_hash and gc_hash_buffer.
2842
2843         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2844
2845         * gc-libgcrypt.c (gc_hash_buffer): Add.
2846
2847 2005-10-11  Bruno Haible  <bruno@clisp.org>
2848
2849         * strcasecmp.c: Include limits.h.
2850         (strcasecmp): Avoid integer overflow on exotic platforms.
2851         * strncasecmp.c: Include limits.h.
2852         (strncasecmp): Avoid integer overflow on exotic platforms.
2853         Reported by Paul Eggert.
2854
2855 2005-10-06  Simon Josefsson  <jas@extundo.com>
2856
2857         * hmac-md5.c: New file.
2858
2859         * hmac.h: New file.
2860
2861 2005-10-06  Simon Josefsson  <jas@extundo.com>
2862
2863         * memxor.c (memxor): Avoid casts and warnings.
2864
2865 2005-10-05  Derek Price  <derek@ximbiot.com>
2866
2867         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2868
2869 2005-10-05  Simon Josefsson  <jas@extundo.com>
2870
2871         * memxor.c (memxor): Fix compiler error.
2872
2873         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2874         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2875
2876         * memxor.h, memxor.c: New files.
2877
2878         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2879         we assume all systems have it, suggested by Jim Meyering
2880         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2881         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2882         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2883         same reasons.
2884
2885 2005-10-04  Bruno Haible  <bruno@clisp.org>
2886
2887         * verify.h (verify_true): Provide alternative definition for C++.
2888
2889 2005-10-04  Simon Josefsson  <jas@extundo.com>
2890
2891         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2892         D. Baushke" <mdb@gnu.org>.
2893
2894 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2895
2896         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2897         (SSIZE_MAX): New macro, if not already defined.
2898         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2899         than 2 GiB.
2900
2901 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2902
2903         * exclude.c: Include verify.h.
2904         (verify): Remove.  All callers changed to use verify.h's version.
2905         * strtoimax.c: Likewise.
2906         * utimecmp.c: Likewis.e
2907
2908         Sync from coreutils.
2909         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2910         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2911         * .cvsignore: Add fts.h, search.h, t-fpending.
2912         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2913         bother returning ENOSYS if settimeofday or stime fails; just let
2914         them return whatever errno they want to return.
2915         * utimens.c: Include unistd.h, for dup2.
2916         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2917         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2918
2919 2005-10-02  Jim Meyering  <jim@meyering.net>
2920
2921         Sync from coreutils.
2922         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2923         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2924         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2925         Remove AT_FDCWD test.
2926         Do not consume the fd unless successful.
2927         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2928         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2929         block, so that we don't even try to compile it if settimeofday is
2930         available.  This works around a compilation failure on OSF1 V5.1,
2931         due to stime requiring a `long int*' while tv_sec is `int'.
2932
2933 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2934
2935         * getdelim.c (getdelim): Remove unused variables.
2936
2937 2005-10-01  Simon Josefsson  <jas@extundo.com>
2938
2939         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2940         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2941         AI_* and EAI_* definitions.  Protect function declarations.
2942
2943 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2944
2945         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2946         so that the code works even with ancient cpp.  Portability problem
2947         with GCC 2.7.2.1 reported by Thomas M.Ott.
2948
2949 2005-09-27  Jim Meyering  <jim@meyering.net>
2950
2951         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2952
2953         * intprops.h (signed_type_or_expr__): Define.
2954         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2955         for unsigned types.
2956
2957 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2958
2959         * verify.h (verify_expr): Remove, replacing with:
2960         (verify_true): New macro that returns true instead of void.
2961         (verify_type__): Remove.
2962         (verify): Use verify_true rather than verify_type__.
2963
2964 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2965
2966         * utimens.c (ENOSYS): Define if not already defined.
2967         (futimens): Support having a null PATH if the file descriptor
2968         is nonnegative.
2969
2970         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2971         Remove.
2972         (__attribute): Define to empty unless GCC 3.1 or later.
2973         This works around a core dump on OpenBSD 3.4, which has GCC
2974         2.95.3, which dumps core when given __attribute__(()).  It also
2975         simplifies other tests, since we really don't want to bother with
2976         worrying about which ancient version of GCC supported what.
2977         Original problem reported by Yoann Vandoorselaere, with part of
2978         the fix suggested by Derek Price.
2979
2980 2005-09-24  Jim Meyering  <jim@meyering.net>
2981
2982         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2983         so we can once again use a positive bitfield width of 1 -- now we
2984         don't have to explain why we were using a bitfield width of 2.
2985
2986 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2987
2988         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2989         Problem reported by Eric Blake.
2990         (getaddrinfo): Initialize se so that it's not garbage.
2991         Redo internal storage allocation so that it doesn't make unportable
2992         assumptions about alignment.
2993         Fix a memory leak.
2994
2995         * utimens.c (futimens): Use futimesat if available.
2996         Prefer it to futimes since it doesn't have the futimes bug.
2997
2998         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2999         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
3000         Instead, declare a function that returns a pointer to an array,
3001         and use verify_type__ to declare the size of the array.
3002         Problem and germ of a solution reported by Bruno Haible.
3003         (verify_type__): Use 2, not 1, for bitfield size, to avoid
3004         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
3005
3006 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
3007
3008         Sync from coreutils.
3009
3010         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3011         stat-time.h.
3012         * argmatch.h: Include verify.h
3013         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3014         (ARGMATCH_ASSERT): Remove; unused.
3015         * canonicalize.c: Assume STDC_HEADERS.
3016         * exclude.c: Include "strcase.h".
3017         * regex_internal.h [!defined _LIBC]: Likewise.
3018         * getusershell.c: Include stdio--.h rather than stdio.h
3019         and stdio-safer.h.
3020         (getusershell): Call fopen, not fopen_safer.
3021         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3022         Do not include unistd-safer.h.
3023         (save_cwd): Don't call fd_safer; no longer needed
3024         now that we include fcntl--.h.
3025
3026         * getdate.y (relative_time): New type.
3027         (RELATIVE_TIME_0): New constant.
3028         (parser_control): Use relative_time instead of doing it ourselves.
3029         (%union): Add new relative_time rel member.
3030         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3031         Now typeless.
3032         (relunit, relunit_snumber): Now of type rel.
3033         (zone, rel, relunit, get_date): Adjust to above changes.
3034
3035         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3036         Do not include unistd-safer.h.
3037         (getloadavg): Don't call fd_safer; no longer needed
3038         now that we include fcntl--.h.
3039
3040         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3041         (make_dir_parents): Treat ENOSYS like EEXIST.
3042
3043         Improve quality of diagnostics on restore_cwd failure.
3044         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
3045         (make_dir_parents): Last arg is now int * (for errno), not bool *.
3046         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3047         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3048         each time through the loop.  Do not diagnose restore_cwd failure;
3049         that is the caller's job (and perhaps the caller does not care).
3050
3051         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3052         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3053         If the file already exists but is not a directory, don't bother
3054         to try to make its parents.
3055         Close potential file descriptor leak if we can't chdir("/") (!).
3056         Don't always return true if chdir($PWD) fails; return true only
3057         if the requested action was done successfully (except for the
3058         chdir($PWD)).
3059         Don't log final directory unless we actually made it.
3060         Refactor to avoid duplicate code to fix up permissions.
3061         Don't attempt to fix up parent permissions if chdir($PWD) fails.
3062
3063         * strftime.c (my_strftime): Rewrite the previous change slightly,
3064         to make it a bit faster and (I hope) clearer.
3065         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3066         Fix bug in formats like %2N.
3067
3068         * verify.h: New file.
3069
3070 2005-09-22  Jim Meyering  <jim@meyering.net>
3071
3072         Sync from coreutils.
3073
3074         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3075
3076         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3077         the .tm_year member, since otherwise gcc-4.0 would now warn about
3078         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3079
3080         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3081         order to avoid an unsuppressible warning from gcc on 64-bit systems.
3082
3083         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3084         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3085         when run in a time zone for which daylight savings time is in effect
3086         for the starting date.
3087
3088         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3089         stop us from restricting permissions of just-created absolute-named
3090         directories.
3091         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3092         to restore initial working directory.
3093         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3094         to tell caller if/when we change the working directory and are
3095         unable to return to the initial one.
3096         * mkdir-p.h (make_dir_parents): Update prototype.
3097         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3098         `return false'.  This fixes a bug introduced on 2004-07-30.
3099
3100         * openat.c (fdopendir): Be sure to close the supplied
3101         file descriptor before returning.  This makes our replacement
3102         implementation a little closer to Solaris's, where fdopendir
3103         ties the file descriptor to the returned DIR* pointer.
3104         * openat.c (unlinkat): New function.
3105         * openat.h (unlinkat): Add prototype.
3106         * openat-die.c (openat_save_fail): Rename from openat_save_die.
3107         (openat_restore_fail): Rename from openat_restore_die.
3108         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3109
3110         Provide an alternative to exiting immediately upon save_cwd or
3111         restore_cwd failure.  Now, an application can arrange e.g.,
3112         to perform a longjump in that case.
3113         * openat.c: Include dirname.h.
3114         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3115         (rpl_openat, fdopendir, fstatat): Call openat_save_die
3116         and openat_restore_die rather than calling error directly.
3117         Don't include "error.h" or "exitfail.h"; they're no longer needed.
3118
3119         * openat-die.c (openat_save_die, openat_restore_die): New file.
3120         * openat.h (openat_save_die, openat_restore_die): Declare and define.
3121
3122         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3123         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3124                             int utc, int nanoseconds);
3125         Background:
3126         date should not have to allocate a megabyte of virtual memory to
3127         handle a format argument like +%1048575T.  When implemented with
3128         strftime, it must allocate such a buffer, use strftime to fill it
3129         in, print it, then free it.
3130         With fprintftime, it simply prints everything and exits.
3131         With no need for memory allocation, that's one fewer way to fail.
3132         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3133         optional field width, not before, so we accept %9:z, not %:9z.
3134         (my_strftime): Be sure to use L_('x') for literals.
3135
3136         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3137         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3138         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3139         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3140         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3141         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3142         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3143         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3144         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3145
3146         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3147         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3148         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3149         and don't include <sys/file.h>).
3150
3151 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
3152
3153         Sync from coreutils.
3154
3155         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3156         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3157         [!LDAV_DONE]: Avoid unused variable warning.
3158
3159 2005-09-21  Bruno Haible  <bruno@clisp.org>
3160
3161         * unicodeio.h (unicode_to_mb): New declaration.
3162
3163 2005-09-20  Derek Price  <derek@ximbiot.com>
3164
3165         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3166
3167 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3168
3169         Use a consistent style for including <config.h>.
3170         * __fpending.c, acl.c, argmatch.c,
3171         argp-help.c, argp-parse.c,
3172         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3173         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3174         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3175         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3176         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3177         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3178         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3179         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3180         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3181         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3182         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3183         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3184         modechange.c, mountlist.c, open-safer.c, physmem.c,
3185         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3186         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3187         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3188         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3189         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3190         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3191         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3192         userspec.c, utimecmp.c, version-etc-fsf.c,
3193         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3194         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3195         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3196         Standardize inclusion of config.h.
3197         * __fpending.h, dirfd.h, getdate.h, human.h,
3198         inttostr.h:  Removed inclusion of config.h from header files.
3199         * inttostr.c:  Adjusted in-tree users.
3200         * timespec.h: Remove superfluous warning to include config.h.
3201         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3202         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3203         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3204         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3205
3206 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3207
3208         * stat-time.h: New file.
3209         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3210         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3211         in a different way.
3212         (timespec_cmp): New function.
3213         * utimecmp.c: Include stat-time.h.
3214         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3215         members exist, not on the obsolescent ST_MTIM_NSEC.
3216         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3217
3218 2005-09-15  Derek Price  <derek@ximbiot.com>
3219             Paul Eggert  <eggert@cs.ucla.edu>
3220
3221         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3222         changes, consolidating in...
3223         * regex_internal.h: ...this file.
3224
3225 2005-09-15  Derek Price  <derek@ximbiot.com>
3226
3227         * regex_internal.h: Blank `pure' for GNUC < 3.
3228         * regex_internal.c: Ditto, using this...
3229         (__GNUC_PREREQ): ...new macro.
3230         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3231         (__GNUC_PREREQ): ...this new macro.
3232
3233         * strstr.h: Include string.h. Define strstr as a macro here.
3234
3235 2005-09-13  Derek Price  <derek@ximbiot.com>
3236
3237         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3238         failure.
3239         Reported by Jim Meyering  <jim@meyering.net>.
3240
3241 2005-09-13  Jim Meyering  <jim@meyering.net>
3242
3243         * canon-host.c: Filter through gnu indent and reword comments slightly.
3244         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3245
3246 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3247
3248         * base64.c: Typo.
3249         (base64_encode): Put b64str in initialized data section.
3250
3251 2005-09-12  Derek Price  <derek@ximbiot.com>
3252
3253         Return usable errors from canon-host.
3254         * canon-host.h: New file.
3255         * canon-host.c (canon_host): Wrap...
3256         (canon_host_r): ...this new function, which now relies exclusively on
3257         getaddrinfo.
3258         (ch_strerror): New function.
3259         (last_cherror): New global.
3260         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3261         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3262         void *.
3263         (freeaddrinfo): Free ai->ai_canonname when set.
3264
3265 2005-09-12  Derek Price  <derek@ximbiot.com>
3266             Paul Eggert  <eggert@cs.ucla.edu>
3267
3268         * glob-libc.h: Renamed from glob_.h.  The new version is
3269         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3270         protecting things that should be done only in gnulib contexts.
3271         * glob_.h: New file, containing only the glob things needed for
3272         gnulib.
3273         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3274         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3275         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3276         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3277         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3278         and to respect the namespace rules better.
3279
3280 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3281
3282         Merge glibc and coreutils changes into gnulib, plus a few
3283         extra fixes.
3284         * md5.c: Use #error rather than a string.
3285         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3286         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3287         (__attribute__): Define to empty for non recent-GCC.
3288         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3289         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3290         Renamed from their non-__ counterparts, with new macros replacing
3291         them if not _LIBC.  Add __THROW attribute.
3292         (rol): Remove.
3293         (struct md5_ctx): Align buffer if using GCC.
3294         * sha1.h (struct sha1_ctx): Likewise.
3295         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3296         The old name was backwards.
3297         (NOTSWAP): Remove; not used.
3298         (rol): New macro, moved here from md5.h.
3299         (sha1_process_block): Remove a FIXME that doesn't make sense.
3300
3301 2005-09-12  Derek Price  <derek@ximbiot.com>
3302
3303         * gai_strerror.c: Include config.h when available.  Include
3304         getaddrinfo.h before other headers to test interface.
3305         Reported by Larry Jones <lawrence.jones@ugs.com>.
3306
3307 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3308
3309         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3310         definitions, since that's the preferred style in glibc.
3311         Fix a minor spacing issue, and update copyright notice to match glibc's.
3312
3313 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3314
3315         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3316
3317 2005-09-06  Simon Josefsson  <jas@extundo.com>
3318
3319         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3320         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3321
3322 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3323
3324         Change bitset word type from unsigned int to unsigned long int,
3325         as this has better performance on typical 64-bit hosts.
3326         Port bitset code to hosts with unusual word sizes.
3327         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3328         (build_collating_symbol):
3329         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3330         argument is a bitset.  This is merely a style issue, but it makes
3331         it clearer that an entire array is expected.
3332         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3333         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3334         Port to the case where bitset_word is not the same as unsigned int.
3335         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3336         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3337         Likewise.
3338         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3339         (build_trtable, group_nodes_into_DFAstates):
3340         Likewise.
3341         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3342         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3343         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3344         * regexec.c (group_nodes_into_DFAstates): Likewise.
3345         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3346         * regcomp.c (optimize_subexps, lower_subexp):
3347         Work even if bitset_word has holes in its bitwise representation.
3348         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3349         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3350         Likewise.
3351         * regex_internal.c (re_string_reconstruct):
3352         Don't assume UCHAR_MAX == 255.
3353         * regex_internal.h (bitset_set_all): Likewise.
3354         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3355         All uses changed.
3356         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3357         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3358         All uses changed.
3359         (BITSET_WORD_MAX): New macro.
3360         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3361         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3362         (bitset_empty, bitset_copy):
3363         Prefer sizeof (bitset) to multiplying it out ourselves.
3364         (bitset_not_merge): Remove; unused.
3365         (bitset_contain): Return bool, not unsigned int with one bit on.
3366         All callers changed.
3367         * regexec.c (build_trtable): Don't assume bitset has no stricter
3368         alignment than re_node_set; do this by defining a new internal
3369         type struct dests_alloc and using it to allocate memory.
3370
3371 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3372
3373         Check for arithmetic overflow when calculating sizes, to prevent
3374         some buffer-overflow issues.  These patches are conservative, in the
3375         sense that when I couldn't determine whether an overflow was possible,
3376         I inserted a run-time check.
3377         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3378         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3379         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3380         (re_xnrealloc, re_x2nrealloc): New inline functions.
3381         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3382         (build_equiv_class, build_charclass): Check for arithmetic overflow
3383         in size expression calculations.
3384         * regex_internal.c (re_string_realloc_buffers):
3385         (build_wcs_upper_buffer, re_node_set_add_intersect):
3386         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3387         (re_dfa_add_node, register_state): Likewise.
3388         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3389         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3390         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3391         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3392
3393 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3394
3395         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3396         to avoid a collision with bits/local_lim.h in glibc.
3397         All uses changed.  Problem reported by Dmitry V. Levin in
3398         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3399
3400         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3401         bugs in int versus size_t comparisons.
3402         (re_string_context_at): Fix bug where the code assumed that
3403         Idx is signed.
3404
3405         Use bool where appropriate.
3406         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3407         All callers changed.
3408         (calc_eclosure_iter): Likewise, for ROOT arg.
3409         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3410         (build_charclass_op): Likewise, for NON_MATCH arg.
3411         * regex_internal.c (re_string_allocate, re_string_construct):
3412         (re_string_construct_common): Likewise, for ICASE arg.
3413         * regexec.c (re_search_2_stub, re_search_stub):
3414         Likewise, for RET_LEN arg.
3415         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3416         (set_regs): Likewise, for FL_BACKTRACK arg.
3417         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3418         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3419         (calc_eclosure_iter, parse_bracket_exp):
3420         Use bool for internal variables that are booleans.
3421         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3422         (set_regs, build_sifted_states, sift_states_bkref):
3423         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3424         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3425         (find_collation_sequence_value):
3426         Likewise.
3427         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3428         (re_node_set_compare):
3429         Return bool, not int. All callers changed.
3430         * regexec.c (check_halt_node_context, check_dst_limits):
3431         (build_trtable, check_node_accept): Likewise.
3432         * regex_internal.h: Include stdbool.h.
3433
3434         Fix bugs uncovered when converting to bool.
3435         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3436         failure instead of charging ahead blindly.
3437         * regex_internal.c (register_state): Likewise.
3438         * regexec.c (re_search_2_stub): Use simpler method than boolean
3439         for freeing internal storage.
3440         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3441         bitset pieces used as boolean, to avoid undefined behavior
3442         on hosts that do int overflow checking.
3443
3444 2005-08-31  Derek Price  <derek@ximbiot.com>
3445
3446         * getdelim.c (getdelim): Return EOF on EOF.
3447         Reported by Larry Jones <lawrence.jones@ugs.com>.
3448
3449 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3450
3451         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3452         lengths fit in regoff_t; this isn't true if regoff_t is the same
3453         width as size_t.
3454         * regex.c (re_search_internal): 5th arg is LAST_START
3455         (= START + RANGE) instead of RANGE.  This avoids overflow
3456         problems when regoff_t is the same width as size_t.
3457         All callers changed.
3458         (re_search_2_stub): Check for overflow when adding the
3459         sizes of the two strings.
3460         (re_search_stub): Check for overflow when adding START
3461         to RANGE; if it occurs, substitute the extreme value.
3462
3463 2005-08-31  Jim Meyering  <jim@meyering.net>
3464
3465         * regcomp.c (search_duplicated_node): Make first pointer arg
3466         a pointer-to-const.
3467         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3468         (register_state): Likewise.
3469         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3470         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3471         (group_nodes_into_DFAstates): Likewise.
3472
3473 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3474
3475         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3476         old glibc regex code mishandles strings longer than 2**31 bytes.
3477         This patch fixes this when the regex code is used in gnulib
3478         (i.e., outside glibc).
3479
3480         This patch should not affect the use of the regex code inside
3481         glibc.  No doubt this problem also needs to be handled for glibc
3482         as well, but the result will be an incompatible change to the
3483         glibc ABI, and the old ABI will have to be supported too.  That
3484         can be the the subject for another patch.
3485
3486         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3487         governing whether the rest of this patch is active.  By default,
3488         the macro is disabled and the patch has no effect.
3489         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3490         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3491         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3492         (re_match_2, re_set_registers): Use the new types.
3493         * regex_internal.h (Idx, re_hashval_t): New types.
3494         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3495         New macros.
3496         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3497         (re_string_context_at, bin_tree_t, re_dfastate_t):
3498         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3499         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3500         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3501         (re_string_char_size_at, re_string_wchar_at):
3502         (re_string_elem_size_at):
3503         Use the new types and macros to port to 64-bit hosts.
3504         Use unsigned types for internal values, so that the code
3505         mostly works even for arrays larger than SSIZE_MAX.
3506         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3507         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3508         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3509         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3510         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3511         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3512         (calc_inveclosure, parse_dup_op, build_range_exp):
3513         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3514         (fetch_number, create_token_tree, mark_opt_subexp):
3515         Likewise.
3516         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3517         (create_cd_newstate, re_string_allocate, re_string_construct):
3518         (re_string_realloc_buffers, build_wcs_upper_buffer):
3519         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3520         (re_string_reconstruct, re_string_peek_byte_case):
3521         (re_string_fetch_byte_case, re_string_context_at):
3522         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3523         (re_node_set_init_copy, re_node_set_add_intersect):
3524         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3525         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3526         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3527         (re_acquire_state, re_acquire_state_context, register_state):
3528         Likewise.
3529         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3530         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3531         (re_search_internal, re_search_2_stub, re_search_stub)
3532         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3533         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3534         (update_cur_sifted_state, check_dst_limits):
3535         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3536         (check_subexp_limits, sift_states_bkref, merge_state_array):
3537         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3538         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3539         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3540         (expand_bkref_cache, check_node_accept_bytes):
3541         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3542         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3543         (acquire_init_state_context, check_halt_node_context):
3544         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3545         (sift_states_backward, clean_state_log_if_needed):
3546         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3547         (find_recover_state, transit_state_sb, transit_state_mb):
3548         (transit_state_bkref, build_trtable, match_ctx_clean):
3549         Likewise.
3550         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3551         to work around an assumption that REG_MISSING is negative.
3552
3553         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3554         (seek_collating_symbol_entry) [defined _LIBC]:
3555         (lookup_collation_sequence_value) [defined _LIBC]:
3556         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3557         Use prototypes rather than old-style function definitions.
3558         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3559         (transit_state_sb) [0]:
3560         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3561
3562         * regexec.c (re_search_internal): Simplify update of rm_so and
3563         rm_eo.
3564
3565         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3566         (optimize_subexps, lower_subexp):
3567         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3568         since the signed shift might overflow.  Use 1u<<31 instead.
3569         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3570         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3571         Likewise.
3572
3573         * regcomp.c (optimize_subexps, lower_subexp):
3574         Use CHAR_BIT rather than 8, for clarity.
3575         * regexec.c (check_dst_limits_calc_pos_1):
3576         (check_subexp_matching_top): Likewise.
3577         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3578         have to worry about portability issues when shifting it left.
3579         Remove no-longer-needed test for table_size > 0.
3580         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3581         in a word, as the resulting behavior is undefined.
3582         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3583         in one case, a <= should have been an <, and in another case the
3584         whole test was missing.
3585         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3586         the standard name CHAR_BIT.
3587         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3588         this is not true on one's complement and signed-magnitude hosts.
3589
3590         * regex_internal.h (re_sub_match_top_t): Remove unused member
3591         next_last_offset.
3592         (struct re_dfa_t): Remove unused member states_alloc.
3593         * regcomp.c (init_dfa): Don't initialize unused members.
3594
3595 2005-08-31  Bruno Haible  <bruno@clisp.org>
3596
3597         * strstr.c: Include <stddef.h>, for NULL.
3598         * strcasestr.c: Likewise.
3599         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3600
3601 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3602
3603         * iconvme.h: Add prototype for iconv_alloc.
3604
3605 2005-08-29  Simon Josefsson  <jas@extundo.com>
3606
3607         * iconvme.c: Fix errno.
3608
3609 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3610
3611         * iconvme.c: Split iconv_string into iconv_alloc.
3612
3613 2005-08-27  Jim Meyering  <jim@meyering.net>
3614
3615         * fopen-safer.c: Merge minor changes from coreutils.
3616         * dup-safer.c: Likewise.
3617         * fd-safer.c: Likewise.
3618
3619         Merge from coreutils.
3620         * stdio--.h: New file.
3621         * stdlib--.h: New file.
3622         * mkstemp-safer.c: New file.
3623
3624         GNU tar needs these.
3625         * pipe-safer.c: New file.
3626         * creat-safer.c: New file.
3627         * fcntl--.h (creat): Define to creat_safer.
3628         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3629         * unistd--.h (pipe): Define to pipe_safer.
3630         * unistd-safer.h: Declare pipe_safer.
3631
3632 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3633
3634         * regex_internal.h: Remove all references to
3635         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3636         or better.
3637         (bitset_not, bitset_merge, bitset_not_merge):
3638         (bitset_mask, re_string_allocate, re_string_construct):
3639         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3640         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3641         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3642         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3643         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3644         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3645         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3646         (re_acquire_state_context):
3647         Remove unnecessary forward decls.
3648         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3649         Put __attribute at function definition,
3650         now that the function decl has been removed.
3651         * regex_internal.c (re_string_peek_byte_case):
3652         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3653         Likewise.
3654
3655 2005-08-26  Simon Josefsson  <jas@extundo.com>
3656
3657         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3658         Haible <bruno@clisp.org>.
3659
3660 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3661
3662         * regexec.c (set_regs): Don't alloca with an unbounded size.
3663
3664         alloca modernization/simplification for regex.
3665         * regex.c: Remove portability cruft for alloca.  This no longer
3666         needs to be at the start of the file, and can be moved into
3667         regex_internal.h and simplified.
3668         * regex_internal.h: Include <alloca.h>.
3669         (__libc_use_alloca) [!defined _LIBC]: New macro.
3670         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3671         now works outside glibc.
3672
3673 2005-08-24  Simon Josefsson  <jas@extundo.com>
3674
3675         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3676         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3677         GLIBC specific code.
3678
3679 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3680
3681         Make regex safe for g++.  This fixes one real bug (an "err"
3682         that should have been "*err").  g++ problem reported by
3683         Sam Steingold.
3684         * regex_internal.h (re_calloc): New macro, consistent with
3685         re_malloc etc.  All callers of calloc changed to use re_calloc.
3686         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3687         not int.  All callers changed.
3688         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3689         just use an array of size MB_LEN_MAX.
3690         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3691         (find_recover_state): Change "err" to "*err"; this fixes what
3692         appears to be a real bug.
3693         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3694         versus int.
3695
3696 2005-08-25  Jim Meyering  <jim@meyering.net>
3697
3698         * open-safer.c: Include <config.h>.
3699         Otherwise, we'd lose LARGEFILE support in any file using
3700         e.g. "fcntl--.h"
3701
3702 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3703
3704         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3705         * regex.h (regerror): Likewise.
3706
3707         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3708         requires this.  (The code never needed it.)
3709
3710         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3711         All uses of recently-renamed identifiers changed to use the new,
3712         POSIX-compliant names.  The code will build and run just fine
3713         without these changes, but it's better to eat our own dog food
3714         and use the standard-conforming names.
3715
3716         * regex.h: Fix a multitude of POSIX name space violations.
3717         These changes have an effect only for programs that define
3718         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3719         do not change anything for programs compiled in the normal way.
3720         Also, there is no effect on the ABI.
3721
3722         (_REGEX_SOURCE): New macro.
3723         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3724         defined and _GNU_SOURCE is not; this fixes a name space violation.
3725
3726         Rename the following macros to obey POSIX requirements.
3727         The old names are still visible as macros if _REGEX_SOURCE is defined.
3728         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3729         RE_BACKSLASH_ESCAPE_IN_LISTS.
3730         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3731         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3732         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3733         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3734         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3735         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3736         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3737         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3738         (REG_INTERVALS): renamed from RE_INTERVALS.
3739         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3740         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3741         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3742         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3743         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3744         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3745         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3746         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3747         RE_UNMATCHED_RIGHT_PAREN_ORD.
3748         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3749         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3750         (REG_DEBUG): renamed from RE_DEBUG.
3751         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3752         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3753         unusual, since we can't clash with the POSIX REG_ICASE.
3754         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3755         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3756         (REG_NO_SUB): renamed from RE_NO_SUB.
3757         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3758         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3759         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3760         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3761         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3762         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3763         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3764         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3765         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3766         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3767         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3768         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3769         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3770         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3771         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3772         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3773         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3774         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3775         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3776         (REG_FIXED): Renamed from REGS_FIXED.
3777         (REG_NREGS): Renamed from RE_NREGS.
3778
3779         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3780         of other REG_* macros, since POSIX says the user is allowed to
3781         #undef these macros selectively.
3782
3783         (reg_errcode_t): Update comment stating what other tables need
3784         to be consistent.
3785
3786         Rename the following enum values to obey POSIX requirements.
3787         The old names are still visible as macros.
3788         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3789         is not defined, since GNU is supposed to be a superset of POSIX as
3790         much as possible, and since we want reg_errcode_t to be a signed
3791         type for implementation consistency.
3792         (_REG_NOERROR): Renamed from REG_NOERROR.
3793         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3794         (_REG_BADPAT): Renamed from REG_BADPAT.
3795         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3796         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3797         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3798         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3799         (_REG_EBRACK): Renamed from REG_EBRACK.
3800         (_REG_EPAREN): Renamed from REG_EPAREN.
3801         (_REG_EBRACE): Renamed from REG_EBRACE.
3802         (_REG_BADBR): Renamed from REG_BADBR.
3803         (_REG_ERANGE): Renamed from REG_ERANGE.
3804         (_REG_ESPACE): Renamed from REG_ESPACE.
3805         (_REG_BADRPT): Renamed from REG_BADRPT.
3806         (_REG_EEND): Renamed from REG_EEND.
3807         (_REG_ESIZE): Renamed from REG_ESIZE.
3808         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3809         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3810         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3811         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3812         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3813
3814         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3815         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3816         changed.  But support the old name if the new one is not defined
3817         and if _REGEX_SOURCE.
3818
3819         Change the following member names in struct re_pattern_buffer.
3820         The old names are still supported if !_REGEX_SOURCE.
3821         The new names are always supported, regardless of _REGEX_SOURCE.
3822         (re_buffer): Renamed from buffer.
3823         (re_allocated): Renamed from allocated.
3824         (re_used): Renamed from used.
3825         (re_syntax): Renamed from syntax.
3826         (re_fastmap): Renamed from fastmap.
3827         (re_translate): Renamed from translate.
3828         (re_can_be_null): Renamed from can_be_null.
3829         (re_regs_allocated): Renamed from regs_allocated.
3830         (re_fastmap_accurate): Renamed from fastmap_accurate.
3831         (re_no_sub): Renamed from no_sub.
3832         (re_not_bol): Renamed from not_bol.
3833         (re_not_eol): Renamed from not_eol.
3834         (re_newline_anchor): Renamed from newline_anchor.
3835
3836         Change the following member names in struct re_registers.
3837         The old names are still supported if !_REGEX_SOURCE.
3838         The new names are always supported, regardless of _REGEX_SOURCE.
3839         (rm_num_regs): Renamed from num_regs.
3840         (rm_start): Renamed from start.
3841         (rm_end): Renamed from end.
3842
3843         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3844         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3845         Prepend __ to parameter names.
3846
3847         Undo yesterday's changes.
3848
3849 2005-08-24  Jim Meyering  <jim@meyering.net>
3850
3851         Sync from coreutils.
3852         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3853
3854 2005-08-21  Bruno Haible  <bruno@clisp.org>
3855
3856         * lock.h: Add multiple inclusion guard.
3857         * tls.h: Add multiple inclusion guard.
3858
3859 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3860
3861         * regex.h (REG_NOSYS)
3862         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3863         Define, since POSIX requires it as of 2001.
3864         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3865         New private symbol, used to keep the enum signed in all cases.
3866         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3867         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3868
3869         * regex_internal.c (re_string_skip_chars, register_state):
3870         (calc_state_hash):
3871         Remove forward decls; no longer needed now that we use prototypes.
3872         * regexec.c (acquire_init_state_context, check_halt_node_context):
3873         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3874         (clean_state_log_if_needed): Likewise.
3875
3876 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3877
3878         Fix problems reported by Sam Steingold in
3879         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3880         * regexec.c (sift_states_bkref): Fix portability bug: the code
3881         assumed that reg_errcode_t is a signed type, which is not
3882         necessarily true if _XOPEN_SOURCE is not defined.
3883         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3884         some compilers warn about it otherwise.
3885
3886 2005-08-20  Jim Meyering  <jim@meyering.net>
3887
3888         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3889         of unused local, dfa.
3890
3891 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3892
3893         * regcomp.c (create_initial_state): Remove duplicate decl.
3894         (init_word_char, create_initial_state, duplicate_node_closure):
3895         (fetch_token, peek_token_bracket, build_range_exp):
3896         (build_collating_symbol): Remove forward decls; no longer needed
3897         now that we use prototypes.
3898
3899         * regcomp.c:
3900         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3901         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3902         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3903         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3904         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3905         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3906         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3907         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3908         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3909         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3910         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3911         (build_charclass, build_charclass_op, fetch_number, create_tree):
3912         (create_token_tree, mark_opt_subexp, duplicate_tree):
3913         Use prototypes rather than old-style definitions.
3914
3915         * regex_internal.c:
3916         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3917         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3918         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3919         (re_string_reconstruct, re_string_peek_byte_case):
3920         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3921         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3922         (re_node_set_init_copy, re_node_set_add_intersect):
3923         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3924         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3925         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3926         (re_acquire_state, re_acquire_state_context, register_state):
3927         (create_ci_newstate, create_cd_newstate, free_state):
3928         Likewise.
3929         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3930         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3931         (re_search_internal, prune_impossible_nodes):
3932         (acquire_init_state_context, check_matching, static):
3933         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3934         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3935         (update_regs, sift_states_backward, build_sifted_states):
3936         (clean_state_log_if_needed, merge_state_array):
3937         (update_cur_sifted_state, add_epsilon_src_nodes):
3938         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3939         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3940         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3941         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3942         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3943         (check_arrival, check_arrival_add_next_nodes):
3944         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3945         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3946         (check_node_accept_bytes, check_node_accept, extend_buffers):
3947         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3948         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3949         (sift_ctx_init):
3950         Likewise.
3951
3952         * regex_internal.h:
3953         (re_string_allocate, re_string_construct, re_string_reconstruct):
3954         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3955         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3956         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3957         (re_string_context_at, re_string_peek_byte_case):
3958         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3959         is defined, since we now use prototypes always.
3960
3961         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3962         C89 or better.  All uses removed.
3963
3964 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3965
3966         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3967         [defined lint]: Suppress bogus uninitialized-variable warnings.
3968
3969         * regcomp.c (duplicate_node): Return new index, not an error code,
3970         and let the caller return REG_ESPACE if out of space.  This
3971         removes an uninitialied-variable warning with GCC 4.0.1, and also
3972         avoids taking the address of a local variable.  All callers
3973         changed.
3974
3975 2005-08-19  Jim Meyering  <jim@meyering.net>
3976
3977         * regexec.c (proceed_next_node): Redo local variables to
3978         avoid GCC shadowing warnings.
3979
3980 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3981
3982         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3983         (re_node_set_insert_last, re_dfa_add_node):
3984         Rename local variables to avoid GCC shadowing warnings.
3985
3986 2005-08-18  Bruno Haible  <bruno@clisp.org>
3987
3988         * strstr.c (strstr): Fix return value in multibyte case.
3989         * strcasestr.c (strcasestr): Likewise.
3990
3991 2005-08-17  Jim Meyering  <jim@meyering.net>
3992
3993         Make the %s format (seconds since the epoch) work for a negative
3994         number and when used with a zero-padded field width, e.g. %015s.
3995
3996         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3997         label so that it precedes the code to set `digits'.  Otherwise,
3998         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3999         print `00-22'.  Now, it prints `-0022', as it should.
4000
4001 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4002
4003         * regex.h: Remove useless space-before-tab.  From coreutils.
4004
4005 2005-08-17  Bruno Haible  <bruno@clisp.org>
4006
4007         * strcasestr.h: New file.
4008         * strcasestr.c: New file.
4009
4010 2005-08-17  Bruno Haible  <bruno@clisp.org>
4011
4012         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4013         * strstr.c: Completely rewritten, with multibyte locale support.
4014
4015 2005-08-17  Bruno Haible  <bruno@clisp.org>
4016
4017         * strcasecmp.c: Use mbuiter.h.
4018
4019 2005-08-17  Bruno Haible  <bruno@clisp.org>
4020
4021         * mbuiter.h: New file.
4022
4023 2005-08-16  Bruno Haible  <bruno@clisp.org>
4024
4025         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4026         (mbi_init): Update.
4027         (mbi_avail, mbi_advance): Let the iteration end before the terminating
4028         NUL byte, not after it.
4029
4030 2005-08-16  Bruno Haible  <bruno@clisp.org>
4031
4032         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4033         the valid ones. Makes the comparison operations transitive:
4034         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4035         * strcasecmp.c (strcasecmp): Use mb_casecmp.
4036
4037 2005-08-16  Bruno Haible  <bruno@clisp.org>
4038
4039         * strcase.h (strcasecmp): Add note in comments.
4040         * strncasecmp.c: Use code from strcasecmp.c.
4041         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4042         (strcasecmp): Work correctly in multibyte locales.
4043
4044 2005-08-16  Bruno Haible  <bruno@clisp.org>
4045
4046         * strnlen1.h: New file.
4047         * strnlen1.c: New file.
4048
4049 2005-08-16  Bruno Haible  <bruno@clisp.org>
4050
4051         * mbfile.h: New file.
4052
4053 2005-08-16  Bruno Haible  <bruno@clisp.org>
4054
4055         * mbiter.h: New file.
4056
4057 2005-08-16  Bruno Haible  <bruno@clisp.org>
4058
4059         * mbchar.h: New file.
4060         * mbchar.c: New file.
4061
4062 2005-08-16  Bruno Haible  <bruno@clisp.org>
4063
4064         * tls.h: New file, from GNU gettext.
4065         * tls.c: New file, from GNU gettext.
4066
4067 2005-08-15  Bruno Haible  <bruno@clisp.org>
4068
4069         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4070         is defined.
4071
4072 2005-08-14  Jim Meyering  <jim@meyering.net>
4073
4074         Sync from coreutils.
4075
4076         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4077         Use the hash-table-based cycle-detection code not just when
4078         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4079         Reported by James Youngman in
4080         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4081         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4082         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4083         This lets us compile with -DFTS_DEBUG, once again.
4084         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4085         * fts.c (fd_safer): Remove decl.
4086         Include fcntl--.h rather than unistd-safer.h
4087         (fts_safe_changedir): Don't call fd_safer; no longer needed
4088         now that we include fcntl--.h.
4089
4090 2005-08-11  Simon Josefsson  <jas@extundo.com>
4091
4092         * readline.h, readline.c: New file.
4093
4094 2005-08-11  Bruno Haible  <bruno@clisp.org>
4095
4096         * strnlen.h (strnlen): Change parameter name to match comment.
4097
4098 2005-08-10  Simon Josefsson  <jas@extundo.com>
4099
4100         * strndup.c: Use strnlen.h.
4101
4102         * strnlen.h: New file.
4103
4104 2005-08-02  Simon Josefsson  <jas@extundo.com>
4105
4106         * getline.h, getline.c: Rewrite.
4107
4108         * getdelim.h, getdelim.c: New files, ported from glibc.
4109
4110 2005-07-31  Bruno Haible  <bruno@clisp.org>
4111
4112         * lock.h (gl_lock_initializer): New macro.
4113         (gl_lock_define_initialized): Use it.
4114         (gl_rwlock_initializer): New macro.
4115         (gl_rwlock_define_initialized): Use it.
4116         (gl_recursive_lock_initializer): New macro.
4117         (gl_recursive_lock_define_initialized): Use it.
4118
4119 2005-07-26  Bruno Haible  <bruno@clisp.org>
4120
4121         * lock.h: Update from GNU gettext.
4122         * lock.c: Update from GNU gettext.
4123
4124 2005-07-18  Bruno Haible  <bruno@clisp.org>
4125
4126         * lock.h (gl_once_t): New type.
4127         (gl_once_define, gl_once): New macros.
4128         * lock.c (fresh_once): New variable.
4129         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4130         functions.
4131
4132 2005-07-18  Simon Josefsson  <jas@extundo.com>
4133
4134         * check-version.c (check_version): Accept identical versions too.
4135
4136 2005-07-18  Bruno Haible  <bruno@clisp.org>
4137
4138         * lock.h: New file, from GNU gettext.
4139         * lock.c: New file, from GNU gettext.
4140
4141 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
4142
4143         * quotearg.c: Add translator comment suggested by Bruno Haible,
4144         with a minor change.
4145
4146 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4147
4148         * version-etc-fsf.c (version_etc_copyright): Parameterize the
4149         copyright symbol and the year.
4150         * version-etc.c (COPYRIGHT_YEAR): New constant.
4151         (version_etc_va): Use parameterized copyright notice.
4152         Reword to conform to the current GNU coding standards.
4153
4154 2005-07-11  Simon Josefsson  <jas@extundo.com>
4155
4156         * size_max.h: New file.
4157
4158 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4159
4160         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4161         block of defines.
4162
4163 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
4164        and  Paul Eggert  <eggert@cs.ucla.edu>
4165
4166         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4167         in wint_t, not wchar_t.  Remove now-unnecessary cast.
4168
4169 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4170
4171         * regex.c, regex.h: Sync from libc.
4172         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4173         New files, synced from libc, except that regex_internal.h
4174         currently has a small porting fix.
4175
4176 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
4177
4178         Remove the dependency of the strftime module on the tzset module.
4179         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4180         Copy the input structure, to work around some of the bug with
4181         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
4182         Solaris releases, you should also use the tzset module, but we won't
4183         require it as a dependency any more since we don't want LGPLed code
4184         to depend on GPLed code.
4185
4186 2005-07-02  Jim Meyering  <jim@meyering.net>
4187
4188         * backupfile.c (backup_args): Change a `0' to NULL.
4189
4190 2005-07-01  Jim Meyering  <jim@meyering.net>
4191
4192         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4193         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4194         * save-cwd.c, tempname.c:
4195         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4196         and don't include <sys/file.h>).
4197
4198 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4199
4200         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4201         declares only 'struct timespec;' (!).
4202
4203 2005-06-29  Jim Meyering  <jim@meyering.net>
4204
4205         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4206         type name.  Use the variable name instead.
4207         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4208
4209 2005-06-28  Simon Josefsson  <jas@extundo.com>
4210
4211         * check-version.h, check-version.c: New files.
4212
4213 2005-06-28  Simon Josefsson  <jas@extundo.com>
4214
4215         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4216         collision with global variable.  Better indentation.  Don't
4217         increment buffer pointer beyond buffer end.  Based on comments
4218         from Paul Eggert <eggert@cs.ucla.edu>.
4219
4220         * base64.h: Indent.
4221
4222 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4223
4224         * canon-host.c (canon-host): Append trailing "," to 0 in
4225         initializer of struct addrinfo, as an indication that we don't
4226         care how many members the structure has.
4227
4228 2005-06-24  Derek Price  <derek@ximbiot.com>
4229         and Bruno Haible  <bruno@clisp.org>
4230
4231         Remove stat module & update lstat.
4232         * stat.c: Remove this file...
4233         (slash_aware_lstat): ...moving this content and its support...
4234         * lstat.c (rpl_lstat): ...into here.
4235         * lstat.h: New file.
4236
4237 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4238
4239         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4240         (ranged_convert): Don't save conversion in a temporary struct.
4241         This causes a warning with GCC 4.0.0, and anyway in the typical
4242         case it's not worth the extra 100 bytes or so of code.
4243         (ranged_convert, __mktime_internal): When calling a function via a
4244         pointer P, use P () rather than (*P) (), as we now assume C89 or
4245         better.
4246
4247 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4248
4249         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4250         "who -r" failed to give output.  Problem reported by Tim Waugh.
4251
4252         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4253         (xcalloc): Use it to avoid needless tests.
4254         Problem reported by Jim Meyering.
4255
4256 2005-06-16  Jim Meyering  <jim@meyering.net>
4257
4258         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4259         when either N or S is zero.
4260
4261 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4262
4263         * argp.h (__option_is_short): Check upper limit of
4264         __key. Isprint() requires its argument to have the value
4265         of an unsigned char or EOF.
4266
4267 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4268
4269         * fnmatch.c (fnmatch): If there is an encoding error in a
4270         multibyte string or pattern, fall back on unibyte matching.
4271         Problem reported by James Youngman.
4272
4273 2005-06-08  Bruno Haible  <bruno@clisp.org>
4274
4275         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4276         warning on mingw.
4277
4278 2005-06-08  Bruno Haible  <bruno@clisp.org>
4279
4280         * csharpcomp.h: New file, from GNU gettext.
4281         * csharpcomp.c: New file, from GNU gettext.
4282         * csharpcomp.sh.in: New file, from GNU gettext.
4283
4284 2005-06-07  Derek Price  <derek@ximbiot.com>
4285
4286         Sync from CVS.
4287         * glob_.h: Indent nested #ifdef.
4288
4289 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4290
4291         Sync from coreutils.
4292         Use "file name" when talking about file names, instead of "filename"
4293         or "path", as per the GNU coding standards.
4294         * mkdir-p.c: Renamed from makepath.c.
4295         (make_dir_parents): Renamed from make_path.  All callers changed.
4296         * mkdir-p.h: Likewise.  All includers changed.
4297         * filenamecat.c: Renamed from path-concat.c.
4298         (file_name_concat): Renamed from path_concat.  All callers changed.
4299         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4300         * filenamecat.h: Likewise.  All includers changed.
4301         * acl.c: Don't use "path" or "filename" to mean "file name"
4302         in comments or local variable names.
4303         * basename.c: Likewise.
4304         * canonicalize.c, canonicalize.h: Likewise.
4305         * dirname.c, dirname.h: Likewise.
4306         * euidaccess.c: Likewise.
4307         * exclude.c: Likewise
4308         * fnmatch_.h, fnmatch_loop.c: Likewise.
4309         * fsusage.c, fsuage.h: Likewise.
4310         * fts.c, fts_.h: Likewise.
4311         * getcwd.c: Likewise.
4312         * getloadavg.c: Likewise.
4313         * mkstemp.c: Likewise.
4314         * mountlist.c, mountlist.h: Likewise.
4315         * openat.c, openat.h: Likewise.
4316         * readlink-stub.c: Likewise.
4317         * readutmp.c, readutmp.h: Likewise.
4318         * rename.c: Likewise.
4319         * rmdir.c: Likewise.
4320         * same.c: Likewise.
4321         * savedir.c: Likewise.
4322         * stripslash.c: Likewise.
4323         * tempname.c: Likewise.
4324         * xreadlink.c: Likewise.
4325         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4326         All uses changed.
4327         * exclude.h: Likewise.
4328
4329         * euidaccess.c (getuid, getgid, getuid, getegid)
4330         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4331         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4332         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4333         * pathmax.h: Include <limits.h> unconditionally, since other
4334         files have been getting away with it for years (MORE/BSD 4.3
4335         is extinct now).
4336         * userspec.c (getpwnam, getgrnam, getgrgid)
4337         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4338
4339         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4340         Define to 256, not 255, as per modern POSIX.
4341
4342 2005-06-01  Bruno Haible  <bruno@clisp.org>
4343
4344         * csharpexec.h: New file, from GNU gettext.
4345         * csharpexec.c: New file, from GNU gettext.
4346         * csharpexec.sh.in: New file, from GNU gettext.
4347
4348 2005-05-31  Derek Price  <derek@ximbiot.com>
4349             Paul Eggert  <eggert@cs.ucla.edu>
4350
4351         Sync from cvs.
4352         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4353
4354 2005-05-29  Derek Price  <derek@ximbiot.com>
4355             Paul Eggert  <eggert@cs.ucla.edu>
4356
4357         * glob_.h, glob.c: New files.
4358
4359 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4360
4361         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4362
4363         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4364         the configuration hassle isn't worth it.
4365         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4366         (LONGEST_MODIFIER, PRIuMAX): Remove.
4367
4368 2005-05-27  Bruno Haible  <bruno@clisp.org>
4369
4370         * getlogin_r.h: Remove second include of <stddef.h>.
4371
4372 2005-05-25  Bruno Haible  <bruno@clisp.org>
4373             Derek Price  <derek@ximbiot.com>
4374
4375         * getlogin_r.h: Simplify API documentation.
4376
4377 2005-05-25  Derek Price  <derek@ximbiot.com>
4378             Paul Eggert  <eggert@cs.ucla.edu>
4379
4380         * getlogin_r.c, getlogin_r.h: New files.
4381
4382 2005-05-22  Bruno Haible  <bruno@clisp.org>
4383
4384         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4385         Also include <sys/param.h> if it defines MIN, MAX.
4386         Based on a patch by Derek Price <derek@ximbiot.com>.
4387
4388 2005-05-22  Bruno Haible  <bruno@clisp.org>
4389
4390         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4391         (INT64_MIN): Fix definition.
4392         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4393
4394         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4395         NEED_SIGNED_INT_TYPES.
4396
4397         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4398         HAVE_SYSTEM_INTTYPES.
4399
4400 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4401
4402         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4403         so that unistd-safer.h (GPL'ed code) need not be included.
4404
4405 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4406
4407         New fts module.
4408         * fts.c: Don't include "cycle-check.h" or "hash.h".
4409         (setup_dir, free_dir): New functions.
4410         (enter_dir, leave_dir): Define trivial
4411         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4412         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4413         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4414         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4415         Move to fts-cycle.c.
4416         (fts_open): Use setup_dir.
4417         (fts_close): Use free_dir.
4418         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4419         This adds a label and some gotos, but the alternatives were messier.
4420         Check for memory allocation failure when entering a dir.
4421         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4422         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4423         (FTS): New member fts_cycle, that is a union that contains the
4424         old active_dir_ht and cycle_state.  All uses changed to mention
4425         fts_cycle.ht and fts_cycle.state.
4426         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4427         fts.c, with the following changes:
4428         (setup_dir, free_dir): New functions.
4429         (enter_dir): Now returns bool.  Return true if successful, false
4430         if memory exhausted.  All callers changed.
4431         Do not bother partly cleaning up on
4432         memory allocation failure; that is free_dir's job.
4433         However, free ad if hash_insert fails, to avoid memory leak.
4434         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4435         fts->fts_options to see which union member to use.
4436
4437 2005-05-20  Jim Meyering  <jim@meyering.net>
4438
4439         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4440         Now a macro, to pacify GCC.
4441
4442 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4443
4444         * chown.c (rpl_chown): Return -1 on failure.
4445
4446 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4447
4448         * canonicalize.c: Include canonicalize.h first, to test interface.
4449         Include <stddef.h> unconditionally, since we assume C89 now.
4450         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4451         * fts.c: Include fts_.h first, to check interface.
4452         Do not include intprops.h; no longer needed.
4453         Include cycle-check.h and hash.h, since fts_.h no longer does.
4454         Remove unnecessary casts of closedir to void.
4455         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4456         decide whether to decrement nlinks.
4457         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4458         (FTS): Use struct hash_table * instead of Hash_table, so that
4459         we no longer need to include hash.h here.
4460
4461 2005-05-17  Jim Meyering  <jim@meyering.net>
4462
4463         * fts.c, fts_.h: New files, from coreutils.
4464
4465 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4466
4467         Sync from coreutils.
4468         * unlinkdir.c, unlinkdir.h: New files.
4469         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4470         regex.h, unlocked-io.h, xtime.h:
4471         White space changes only.
4472         * makepath.c (make_path): Port to hosts where leading "//" is special.
4473         * yesno.c: Include getline.h, not ctype.h.
4474         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4475         Use getline to remove arbitrary restriction on response length.
4476
4477 2005-05-13  Bruno Haible  <bruno@clisp.org>
4478
4479         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4480         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4481         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4482         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4483         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4484         Add support for 64-bit integers in the MSVC compiler.
4485
4486 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4487
4488         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4489         Change the initial comment to refer to GPL, not LGPL.
4490         gnulib-tool will change it to LGPL as needed.
4491
4492         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4493         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4494         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4495         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4496         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4497         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4498         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4499         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4500         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4501         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4502         concatpath.c, config.charset, copy-file.c, copy-file.h,
4503         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4504         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4505         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4506         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4507         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4508         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4509         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4510         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4511         full-read.c, full-read.h, full-write.c, full-write.h,
4512         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4513         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4514         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4515         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4516         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4517         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4518         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4519         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4520         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4521         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4522         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4523         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4524         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4525         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4526         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4527         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4528         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4529         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4530         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4531         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4532         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4533         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4534         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4535         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4536         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4537         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4538         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4539         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4540         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4541         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4542         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4543         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4544         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4545         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4546         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4547         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4548         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4549         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4550         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4551         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4552         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4553         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4554         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4555         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4556         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4557         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4558         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4559         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4560         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4561         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4562         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4563         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4564         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4565         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4566         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4567         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4568         Update FSF postal mail address.
4569
4570 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4571
4572         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4573         specified in ai_socktype. Fix invalid ai_protocol
4574         check. ai_protocol is usually set to 0 or depending on
4575         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4576         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4577         ai_socktype / ai_protocol in the returned addrinfo structure.
4578
4579 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4580             Bruno Haible  <bruno@clisp.org>
4581
4582         * inet_ntop.h: New file.
4583         * inet_ntop.c: New file, from glibc with modifications.
4584
4585 2005-05-08  Jim Meyering  <jim@meyering.net>
4586
4587         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4588
4589 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4590
4591         Merge from coreutils.  Among other things,
4592         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4593         * fd-safer.c: New file.
4594         * fcntl-safer.h, open-safer.c: Remove.
4595         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4596         * dup-safer.c: Include unistd-safer.h first.
4597         Don't include errno.h.
4598         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4599         * file-type.h: Don't assume invoker included sys/stat.h first.
4600         * file-type.c: Rely on file-type.h change.
4601         * getloadavg.c: Include unistd-safer.h.
4602         (getloadavg): Use safer open.
4603         * getusershell.c: Include "stdio-safer.h".
4604         (getusershell): Use safer fopen.
4605         * long-options.c (long_options): Use NULL rather than 0.
4606         * modechange.h (mode_free): Remove; all callers changed to invoke
4607         'free'.
4608         * modechange.c: Likewise.
4609         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4610         (MODE_DONE): New constant.
4611         (struct mode_change): Remove 'next' member.
4612         (make_node_op_equals): New function; like the old one of the
4613         same name, except it allocates an array.
4614         (mode_compile, mode_create_from_ref): Use it.
4615         (mode_compile): Allocate result as an array, not a linked list.
4616         Parse octal string ourself, so that we catch mistakes like "+0".
4617         (mode_adjust): Arg is an array, not a linked list.
4618         * modechange.c: Include stat-macros.h, xalloc.h.
4619         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4620         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4621         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4622         Remove.  This is now stat-macros.h's job.
4623         (talloc): Remove.  All callers replaced by xalloc, so that
4624         our invokers don't have to worry about reporting memory failures.
4625         (make_node_op_equals): Remove.
4626         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4627         New constants.
4628         (struct mode_change): Moved here from modechange.h.
4629         (mode_append_entry): Remove.
4630         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4631         apps to have incorrect behavior.  Use simpler algorithm for head
4632         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4633         Detect more invalid usages rather than having somewhat-random behavior.
4634         Don't insert an "a=" action, as that leads to incorrect behavior.
4635         (mode_compile, mode_create_from_ref): Return NULL on error instead
4636         of an enum, since now there's only one way to have an error.  All
4637         callers changed.
4638         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4639         at the correct time.  Simplify calculation of "+u" and its ilk.
4640         Don't mishandle "+X".
4641         (mode_free): Remove "register" and localize decls.
4642         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4643         (struct mode_change): Move to modechange.c; callers don't
4644         need to see this stuff.
4645         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4646         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4647         (mode_change, mode_adjust): Reflect the new signatures noted above.
4648         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4649         that might redefine system include files.
4650         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4651         (my_usleep): Use NULL rather than (void *) 0.
4652         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4653         Use siginterrupt to specify that system calls should be interrupted.
4654         (rpl_nanosleep): Move initialization of suspended closer to call of
4655         my_usleep.
4656         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4657         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4658         (desirable_utmp_entry): New function.
4659         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4660         using x2nrealloc, to simplify logic.
4661         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4662         size calculation.  Do not assume utmp file is a regular file.
4663         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4664         (READ_UTMP_CHECK_PIDS): New constant.
4665         * save-cwd.c: Include unistd-safer.h.
4666         (save_cwd): Use fd_safer.
4667         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4668         [!_LIBC] Include "stat-macros.h" instead.
4669         * unistd-safer.h (fd_safer): New decl.
4670
4671 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4672
4673         * byteswap_.h: New file.
4674
4675 2005-04-25  Albert Chin  <china@thewrittenword.com>
4676
4677         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4678         Toolkit C bug.
4679
4680 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4681
4682         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4683         that "UTC +1 second" continues to work.  Problem reported
4684         by Dmitry V. Levin.
4685         (relunit_snumber): New rule.
4686         (relunit): Use it.
4687
4688 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4689
4690         * getdate.y (universal_time_zone_table): New constant.
4691         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4692         universal_time_zone_table.
4693         (lookup_zone): Prefer universal_time_zone_table to
4694         local_time_zone_table, so that "GMT" time stamps are allowed in
4695         London during the summer.  Problem reported by Ian Abbott.
4696
4697 2005-04-12  Jim Meyering  <jim@meyering.net>
4698
4699         * human.c (humblock): Set *options even when returning due to
4700         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4701         warning from gcc-4.
4702
4703 2005-04-09  Jim Meyering  <jim@meyering.net>
4704
4705         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4706         -Wuninitialized: initialize tm0.tm_year.
4707
4708 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4709
4710         * getdate.y (parser_control): rels_seen is now a boolean, not a
4711         count, since there's no maximum.  All uses changed.
4712         Add member dsts_seen.
4713         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4714         not being INT_MAX.
4715         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4716         Use pc_rels_seen to decide whther a date is absolute.
4717
4718         * getdate.y (number): Don't overwrite year.
4719         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4720         check.
4721
4722 2005-04-02  Simon Josefsson  <jas@extundo.com>
4723
4724         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4725         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4726
4727 2005-03-27  Jim Meyering  <jim@meyering.net>
4728
4729         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4730
4731 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4732
4733         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4734         "one's complement" -> "ones' complement" in comment, as per Knuth.
4735         "value of type" -> "type or expression" in comment.
4736         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4737
4738 2005-03-26  Jim Meyering  <jim@meyering.net>
4739
4740         Comment nits.
4741         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4742         Correct typos: s/or/of/.
4743
4744 2005-03-23  Jim Meyering  <jim@meyering.net>
4745
4746         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4747
4748 2005-03-21  Jim Meyering  <jim@meyering.net>
4749
4750         Changes imported from coreutils.
4751
4752         * cycle-check.c: Don't include xalloc.h.
4753
4754         * path-concat.c: Don't include assert.h.
4755         (path_concat): Remove assertion that would have triggered
4756         for ABASE starting with more than one slash.
4757         Reported by Andreas Schwab.
4758
4759         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4760         properly when ABASE is an absolute file name.
4761         Correct the description of this function.
4762         Include <assert.h>.
4763         Add an assertion and a test driver.
4764         This fixes a bug introduced on 2004-07-02.
4765         Andreas Schwab reported the resulting failure of cp --parents:
4766         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4767
4768 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4769
4770         * strftime.c (my_strftime): If the underlying strftime returns 0
4771         (which shouldn't happen), generate nothing instead of returning 0
4772         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4773
4774 2005-03-16  Bruno Haible  <bruno@clisp.org>
4775
4776         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4777
4778 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4779
4780         * strftime.c (my_strftime): Prepend space to format so that we can
4781         reliably distinguish strftime failure from empty output on POSIX
4782         hosts.
4783
4784 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4785
4786         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4787         (iconv_string): Don't guess a size-zero buffer, as that might cause
4788         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4789         result would be 'too large', where 'too large' is (heuristically)
4790         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4791         overflow concerns.  This will prevent some unwanted malloc failures
4792         when the inputs are very large.
4793
4794 2005-03-15  Bruno Haible  <bruno@clisp.org>
4795
4796         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4797         'negate'.
4798
4799         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4800         variable.
4801
4802         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4803
4804 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4805
4806         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4807         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4808         intprops.h.
4809         * strtol.c: Likewise.
4810
4811 2005-03-14  Simon Josefsson  <jas@extundo.com>
4812
4813         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4814         <fx@gnu.org>.
4815
4816 2005-03-14  Jim Meyering  <jim@meyering.net>
4817
4818         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4819         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4820         to be nonzero so that we (and caller) can detect the difference
4821         between a valid zero-length expansion and an error return, even
4822         when the underlying strftime fails before writing anything into
4823         that location.
4824
4825 2005-03-10  Jim Meyering  <jim@meyering.net>
4826
4827         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4828         so that this module works on systems without fchdir.
4829
4830 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4831
4832         Factor int-properties macros into a single file, except for
4833         glibc-related files.
4834         * intprops.h: New file.
4835         * getloadavg.c: Include it instead of limits.h.
4836         (INT_STRLEN_BOUND): Remove.
4837         * human.c: Include intprops.h.
4838         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4839         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4840         * inttostr.h: Include intprops.h instead of limits.h.
4841         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4842         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4843         for consistency with intprops.h.
4844         (time_t_is_integer, twos_complement_arithmetic): Use them.
4845         * sig2str.h: Include <signal.h>, intprops.h.
4846         (INT_STRLEN_BOUND): Remove.
4847         * strftime.c (TYPE_SIGNED): Remove.
4848         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4849         * strtol.c: Adjust comments to match intprops.h.
4850         * userspec.c: Include intprops.h.
4851         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4852         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4853         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4854         instead of rolling our own expressions.
4855         * xstrtol.c: Include xstrtol.h first, to test interface.
4856
4857         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4858         instead of int.
4859         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4860         the right thing even if adding 1900 would overflow.  Similarly
4861         for tm_mon + 1 and tm_yday + 1.
4862         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4863         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4864         (DO_SIGNED_NUMBER): New macro.
4865         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4866
4867 2005-03-07  Bruno Haible  <bruno@clisp.org>
4868
4869         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4870
4871 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4872             Bruno Haible  <bruno@clisp.org>
4873
4874         * pagealign_alloc.h: New file.
4875         * pagealign_alloc.c: New file.
4876
4877 2005-01-28  Bruno Haible  <bruno@clisp.org>
4878
4879         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4880         stpncpy.c uses it.
4881
4882 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4883
4884         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4885         The workaround isn't strictly needed for POSIX conformance, and
4886         it's too much of a pain to configure and maintain.  We'll ask
4887         people to fix their kernels instead.
4888         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4889         (NANOSLEEP_BUG_WORKAROUND): Remove.
4890         (xnanosleep): Remove the workaround.
4891
4892 2005-02-12  Bruno Haible  <bruno@clisp.org>
4893
4894         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4895
4896 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4897
4898         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4899         * timespec.h (gettime): Return void, since it always
4900         succeeds now.  All uses changed.
4901         * gettime.c (gettime) Likewise.
4902         [HAVE_NANOTIME]: Prefer nanotime.
4903         Assume gettimeofday succeeds, as POSIX requires.
4904         Assime time () succeeds, since other code already does.
4905         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4906         (timespec_subtract): Remove.
4907         (NANOSLEEP_BUG_WORKAROUND): New constant.
4908         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4909         things considerably.  Use it only on GNU/Linux hosts, since the
4910         workaround shouldn't be needed elsewhere.
4911
4912 2005-02-24  Bruno Haible  <bruno@clisp.org>
4913
4914         * gettext.h: Update from GNU gettext 0.14.2.
4915
4916 2005-02-24  Bruno Haible  <bruno@clisp.org>
4917
4918         * localcharset.c: Update from GNU gettext 0.14.2.
4919         * config.charset: Update from GNU gettext 0.14.2.
4920
4921 2005-02-22  Simon Josefsson  <jas@extundo.com>
4922
4923         * iconvme.h, iconvme.c: New files, from libc.
4924
4925 2005-02-20  Neil Conway  <neilc@samurai.com>
4926
4927         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4928         returned by OSX/Darwin if the specified buffer is not large
4929         enough for the hostname.
4930
4931 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4932
4933         * memrchr.h: New file.
4934         * chdir-long.c: Include it.
4935         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4936         Don't bother including stddef.h.
4937
4938 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4939
4940         * argp-help.c (__argp_help): Create a fake struct argp_state and
4941         pass it to _help, otherwise the latter coredumps trying to
4942         dereference state.root_argp.
4943
4944 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4945
4946         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4947         inclusion.
4948         Include <sys/types.h>, for dev_t.
4949         (ME_DUMMY, ME_REMOTE): Move from here....
4950         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4951         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4952         Dmitry V. Levin.
4953         Include mountlist.h first, to test the interface.
4954
4955 2005-01-29  Bruno Haible  <bruno@clisp.org>
4956
4957         * progname.c (program_name): Initialize.
4958         Needed when linking statically on MacOS X.
4959
4960 2005-01-28  Bruno Haible  <bruno@clisp.org>
4961
4962         * javacomp.sh.in: New file, from GNU gettext.
4963         * javacomp.h: New file, from GNU gettext.
4964         * javacomp.c: New file, from GNU gettext.
4965
4966 2005-01-26  Bruno Haible  <bruno@clisp.org>
4967
4968         * javaexec.sh.in: New file, from GNU gettext.
4969         * javaexec.h: New file, from GNU gettext.
4970         * javaexec.c: New file, from GNU gettext.
4971
4972 2005-01-26  Simon Josefsson  <jas@extundo.com>
4973
4974         * gai_strerror.c: Use GPL in header.
4975
4976 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4977
4978         * argp-help.c (hol_entry_help): Avoid using non-constant
4979         initializers for struct pentry_state.
4980         (__argp_error): Check return value of __asprintf
4981         (__argp_failure): Translate error message
4982
4983         * argp-parse.c: Removed braces around the expansion of N_()
4984
4985 2005-01-21  Jim Meyering  <jim@meyering.net>
4986
4987         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4988         same value as for Solaris 9.
4989
4990         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4991         component length.  This included changing the parameter to be
4992         of type `char *' rather than `char const *'.
4993         * chdir-long.h (chdir_long): Update prototype.
4994
4995         * openat.c (fdopendir, fstatat): New functions.
4996         * openat.h: Include headers required for use of DIR and struct stat.
4997         [AT_SYMLINK_NOFOLLOW]: Define.
4998         (fdopendir, fstatat): Add prototypes.
4999
5000 2005-01-21  Bruno Haible  <bruno@clisp.org>
5001
5002         * classpath.h: New file, from GNU gettext.
5003         * classpath.c: New file, from GNU gettext.
5004
5005 2005-01-20  Simon Josefsson  <jas@extundo.com>
5006
5007         * version-etc-fsf.c: New file, with version_etc_copyright.
5008         * version-etc.c: Remove version_etc_copyright.
5009         * version-etc.h (version_etc_copyright): Use [] instead of * in
5010         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5011
5012 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
5013
5014         * save-cwd.c (save_cwd): Remove code to support the case
5015         where fchdir is missing or flaky.
5016
5017 2005-01-20  Simon Josefsson  <jas@extundo.com>
5018
5019         * base64.h (isbase64): Add.
5020
5021         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5022         using a unsigned prototype, don't inline.
5023         (base64_decode): Use it.
5024
5025 2005-01-19  Bruno Haible  <bruno@clisp.org>
5026
5027         * sh-quote.h: New file, from GNU gettext.
5028         * sh-quote.c: New file, from GNU gettext.
5029
5030 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
5031
5032         Merge changes from coreutils, as described below in several
5033         changelogs dated today.
5034
5035         * save-cwd.c: Include "save-cwd.h" before other include files.
5036         (O_DIRECTORY): Remove; not needed here, since "." must be
5037         a directory.  All uses removed.
5038         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
5039         universal on Suns, and we also need to test for IRIX.
5040         Revamp code to use 'if' rather than '#if'.
5041         Avoid unnecessary comparison of cwd->desc to 0.
5042
5043         * utimens.c (futimens): Robustify the previous patch, by checking
5044         for known valid error numbers rather than observed invalid ones.
5045
5046 2005-01-18  Jim Meyering  <jim@meyering.net>
5047
5048         * version-etc.c (version_etc_copyright): Update copyright date.
5049
5050         * utimens.c (futimens): Account for the fact that futimes
5051         can also fail with errno == ENOSYS or errno == ENOENT.
5052         Patch from Dmitry V. Levin.
5053
5054         Change the name of the robust chdir function from chdir to chdir_long.
5055         * save-cwd.c: Include chdir-long.h rather than chdir.h.
5056         (restore_cwd): Use chdir_long, not chdir.
5057         * chdir-long.c: Renamed from chdir.c.
5058         * chdir-long.h: Renamed from chdir.h.
5059         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5060         Hurd.
5061
5062 2005-01-18  Bob Proulx  <bob@proulx.com>
5063
5064         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5065         offsetof() macro construct to avoid compile failure with native HP-UX
5066         11.0 ANSI C compiler.
5067
5068 2005-01-06  Bruno Haible  <bruno@clisp.org>
5069
5070         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5071         because stpncpy.m4 takes care of it.
5072
5073 2004-01-24  Bruno Haible  <bruno@clisp.org>
5074
5075         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5076
5077 2003-10-09  Bruno Haible  <bruno@clisp.org>
5078
5079         * progreloc.c: Include xalloc.h instead of xmalloc.h.
5080
5081 2005-01-06  Bruno Haible  <bruno@clisp.org>
5082
5083         * fwriteerror.h (fwriteerror): Change specification to include fclose.
5084         * fwriteerror.c: Include <stdbool.h>.
5085         (fwriteerror): At the end, close the file stream. Record whether
5086         stdout was already closed.
5087
5088 2004-05-27  Bruno Haible  <bruno@clisp.org>
5089
5090         * execute.c (environ): Declare if needed.
5091         * pipe.c (environ): Likewise.
5092         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5093
5094 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
5095
5096         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5097         definitions to be after all include files, to avoid collisions.
5098         Problem reported by Bob Proulx.
5099
5100 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
5101
5102         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5103         not needed.  This removes a dependency on the gettext module.
5104         [defined _LIBC]: Do not include <libintl.h>; not needed.
5105
5106 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
5107
5108         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5109         HAVE_DECL_STRTOLD.
5110
5111 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
5112
5113         * argp-parse.c: Include <stddef.h>.
5114         (alignof, alignto): New macros.
5115         (parser_init): Don't assume that void * is aligned sufficiently
5116         for struct option.
5117
5118         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5119         need to extend the stack.
5120         (YYINITDEPTH): New macro, so that the initial stack isn't overly
5121         large.
5122
5123 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5124
5125         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5126
5127 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
5128
5129         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5130         Remove now-obsolete comment about AIX.
5131         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5132         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5133         (YYMAXDEPTH): New macro.
5134
5135 2004-12-18  Bruno Haible  <bruno@clisp.org>
5136
5137         * fatal-signal.c (fatal_signals): Make non-const.
5138         (init_fatal_signals): New function.
5139         (uninstall_handlers, install_handlers): Ignore signals that were set to
5140         SIG_IGN.
5141         (at_fatal_signal): Call init_fatal_signals.
5142         (init_fatal_signal_set): Likewise. Ignore signals that were set to
5143         SIG_IGN.
5144         Reported by Paul Eggert.
5145
5146 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
5147
5148         * getdate.y (textint): New member "negative".
5149         (time_zone_hhmm): New function.
5150         Expect 14 shift-reduce conflicts, not 13.
5151         (o_colon_minutes): New rule.
5152         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5153         (yylex): Set the "negative" member of signed numbers.
5154
5155 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         Changes imported from coreutils.
5158         * hard-locale.c: Assume <locale.h> exists.
5159         Include "strdup.h".
5160         (GLIBC_VERSION): New macro.
5161         (hard_locale): Assume setlocale exists.
5162         Rewrite to avoid #ifdef.
5163         Use strdup rather than malloc + strcpy.
5164         * human.c: Assume <locale.h> exists.
5165         (human_readable): Assume localeconv exists.
5166
5167 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5168
5169         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5170         convert T2, not T.  (Imported from libc.)
5171
5172 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5173
5174         * getcwd.c (is_ENAMETOOLONG): New macro.
5175         (__getcwd.c): Don't restore errno; glibc doesn't.
5176         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5177         first, falling back to our code only if its results look suspicious.
5178         Ensure that the resulting buffer is only as large as necessary.
5179
5180         * readutmp.c: Include readutmp.h first.
5181         Include <errno.h>, since readutmp.h no longer does that.
5182         * readutmp.h: Don't include <errno.h>,
5183         <sys/param.h>, <time.h>; not needed to establish interface.
5184         (errno): Remove decl.
5185         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5186         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5187         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5188
5189 2004-11-28  Simon Josefsson  <jas@extundo.com>
5190
5191         * base64.h, base64.c: New file.
5192
5193 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5194
5195         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5196
5197 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5198
5199         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5200         HP's ANSI C compiler.
5201         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5202         Declaring int functions causes warnings on some modern systems and
5203         shouldn't be needed to compile on ancient ones.
5204         * same.c (MIN) [defined MIN]: Don't define, since it's already
5205         defined.
5206
5207         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5208         with the following changes.
5209         (__set_errno): Parenthesize properly.
5210         Include <stdbool.h>.
5211         (MIN, MAX, MATCHING_INO): New macros.
5212         (__getcwd): Define with prototype, not K&R form.
5213         Use heuristics to allocate default buffer on stack if possible.
5214         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5215         behavior, and to avoid the PATH_MAX limit when computing
5216         ../../../../...
5217         Use MATCHING_INO to compare inode number to file.
5218         Check for arithmetic overflow in size calculations.
5219         Fix bug in reallocation of dot array that caused getcwd to fail
5220         on directories nested deeper than 75.
5221         Be more careful about saving errno on error.
5222         Do not use realloc; use only free+malloc, as this is a bit
5223         more flexible and avoids a needless copy operation.
5224         Do not inspect st_dev and st_ino for symbolic links; POSIX
5225         doesn't specify the latter.
5226         Check for closedir errors.
5227         Avoid needless casts.
5228         Use "#ifdef weak_alias" around weak_alias, to be like other
5229         glibc code.
5230         The following changes to getcwd.c have effect only when used in
5231         gnulib; they have no effect inside glibc proper.
5232         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5233         as alloca isn't used.
5234         (alloca, __alloca): Likewise.
5235         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5236         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5237         unconditionally, as gnulib assumes C89 or better.
5238         Do not include <sys/param.h>.
5239         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5240         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5241         better.
5242         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5243         Include <dirent.h> in a way that is compatible with modern Autoconf.
5244         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5245         New macros, if not already defined.
5246         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5247         Use "_LIBC", not "defined _LIBC", for consistency.
5248         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5249         a mempcpy module.
5250         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5251         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5252         * xgetcwd.c: David MacKenzie's old code was removed, so give
5253         credit only to Jim Meyering and adjust the copyright dates.
5254         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5255         <stdlib.h>, <unistd.h>, "pathmax.h".
5256         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5257         (INITIAL_BUFFER_SIZE): Remove.
5258         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5259
5260 2004-11-23  Jim Meyering  <jim@meyering.net>
5261
5262         * getopt_.h: Remove trailing blanks.
5263
5264 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5265
5266         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5267         (futimens): New function, which uses futimes if available.
5268         (futimens, utimens): Support timespec==NULL, with same semantics
5269         as utime and utimens.
5270         * utimens.h (futimens): New decl.
5271
5272 2004-11-23  Jim Meyering  <jim@meyering.net>
5273
5274         * __fpending.c: Add comment.
5275
5276 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5277
5278         * getopt_.h: Re-addition of __getopt_argv_const caused
5279         redefinition warnings. To avoid them, include the defines
5280         in `#if !defined __need_getopt ... #endif'. The only place
5281         where __getopt_argv_const is used is in definitions
5282         of getopt_long and getopt_long_only below, which are as well
5283         protected by `#ifndef __need_getopt'.
5284         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5285         __need_getopt after including <stdio.h> and <unistd.h> These
5286         headers might have defined it.
5287
5288 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5289
5290         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5291         New macros.
5292         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5293         optopt): Use them instead of invoking ## directly; otherwise, the
5294         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5295
5296 2004-11-19  Bruno Haible  <bruno@clisp.org>
5297
5298         * strtok_r.c: Move comments from here...
5299         * strtok_r.h: ... to here.
5300
5301 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5302
5303         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5304         might fail.  Problem reported by Yoann Vandoorselaere.
5305         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5306         that mishandle size_t overflow.
5307
5308 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5309
5310         * canon-host.c: Include "strdup.h".
5311         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5312         Use strdup instead of malloc/strcpy to duplicate strings.
5313
5314         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5315         (human_space_before_unit): New constant.
5316         * human.c (human_readable): Support it.
5317
5318         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5319         (xgetcwd): Set errno correctly when failing.
5320         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5321         the failure is actually due to a PATH_MAX problem.
5322
5323         Further getopt changes to make it more likely that glibc will
5324         buy the changes back.
5325         * getopt.c (POSIXLY_CORRECT): New constant.
5326         (getopt): Use it, so to preserve glibc semantic
5327         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5328         when compiling for libc.
5329         * getopt_.h (__getopt_argv_const): Bring it back.
5330         (getopt_long, getopt_long_only): Use it.
5331
5332         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5333         New arg POSIXLY_CORRECT.  All callers changed.
5334         (getopt): Argv is now char * const *, as per standard.
5335         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5336         not char *__getopt_argv_const *.
5337         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5338         _getopt_long_only_r): Likewise.
5339         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5340         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5341         _getopt_long_r, _getopt_long_only_r): Likewise.
5342         * getopt_.h (__getopt_argv_const): Remove.
5343         (getopt): Argv is now char * const *, as per standard.
5344
5345         * getdate.y (tORDINAL): New token.
5346         (day, relunit): Allow it for relative times.
5347         (relative_time_table): Use tORDINAL for ordinals.
5348
5349 2004-11-15  Jim Meyering  <jim@meyering.net>
5350
5351         * closeout.c: Include "__fpending.h" once again.
5352         Include <stdbool.h>.
5353         (close_stdout): Don't fail just because stdout was closed initially,
5354         since some programs don't write to stdout in the normal course of
5355         operation (other than --version and --help), and we don't want this
5356         function to make e.g. `touch file >&-' fail.
5357         But do fail if it was closed and someone has tried to write to it.
5358         E.g., `printf foo >&-' must fail.
5359
5360 2004-11-11  Simon Josefsson  <jas@extundo.com>
5361
5362         * strtok_r.h, strtok_r.c: New file.
5363
5364 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5365
5366         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5367         we can stop lying to compilers about the constness of argv when we
5368         are compiled outside glibc.
5369         (getopt, getopt_long, getopt_long_only): Use it.
5370         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5371         getopt): Likewise.
5372         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5373         _getopt_long_only_r): Likewise.
5374         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5375         _getopt_long_only_r): Likewise.
5376
5377         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5378         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5379         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5380         the other external symbols.
5381         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5382         declaration, since the above renaming now works around collisions.
5383
5384 2004-11-11  Jim Meyering  <jim@meyering.net>
5385
5386         * linebreak.c: Remove trailing blanks.
5387         * alloca_.h: Likewise.
5388         * acosl.c: Likewise.
5389         * euidaccess.c: Likewise.
5390         * allocsa.h: Likewise.
5391
5392 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5393
5394         * mktime.c (SHR): New macro, which is a portable
5395         substitute for >> that should work even on Crays.
5396         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5397         Problem reported by Mark D. Baushke in
5398         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5399         * getdate.y (SHR): Likewise.
5400         (tm_diff): Use it.
5401         * strftime.c (SHR): Likewise.
5402         (tm_diff): Use it.
5403         * quotearg.c (struct quoting_options): Use unsigned int for
5404         quote_these_too, so that right shifts are well defined.  All uses
5405         changed.
5406
5407 2004-11-10  Simon Josefsson  <jas@extundo.com>
5408
5409         * getaddrinfo.h, getaddrinfo.c: New files.
5410
5411 2004-11-10  Jim Meyering  <jim@meyering.net>
5412
5413         Ensure that no close failure goes unreported.
5414         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5415         return early when it seems there's nothing to flush.
5416         Don't include __fpending.h.
5417
5418 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5419
5420         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5421
5422 2004-11-05  Bruno Haible  <bruno@clisp.org>
5423
5424         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5425         Reported by Mark D. Baushke <mdb@cvshome.org>.
5426
5427 2004-11-04  Bruno Haible  <bruno@clisp.org>
5428
5429         2004-09-11  Bruno Haible  <bruno@clisp.org>
5430                 * allocsa.valgrind: New file.
5431         2004-02-06  Bruno Haible  <bruno@clisp.org>
5432                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5433                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5434                 Reported by Christopher Seip <chris.seip@hp.com>.
5435
5436 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5437
5438         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5439         with errno == ERANGE if the buffer is too small.
5440         Problem reported by Mark D. Baushke.
5441
5442 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5443
5444         * xreadlink.c (MAXSIZE): New macro.
5445         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5446         size does not exceed MAXSIZE.  Avoid cast.
5447         As suggested by Mark D. Baushke in
5448         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5449         if readlink fails with buffer size just under MAXSIZE, try again
5450         with MAXSIZE.
5451
5452 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5453         and  Paul Eggert  <eggert@cs.ucla.edu>
5454
5455         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5456         (get_date): Overparenthesize to avoid GCC warning.
5457
5458 2004-11-02  Bruno Haible  <bruno@clisp.org>
5459
5460         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5461         function returns void.
5462
5463 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5464
5465         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5466         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5467         already declared.
5468
5469 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5470
5471         * getdate.y: Add support for TZ="foo" within a date string.
5472         Fix some bugs near time_t boundaries.  Reject dates with
5473         out-of-range components, e.g., "Sept 31".
5474         Include <stdlib.h>, "setenv.h", "xalloc.h".
5475         (ISDIGIT_LOCALE): Remove; unused.
5476         Note that the TZ and time functions used here are not reentrant.
5477         (mktime_ok, get_tz): New functions.
5478         (TZBUFSIZE): New constant.
5479         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5480         This requires that we sometimes generate our own TZ="XXX..." setting.
5481
5482 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5483
5484         * mktime.c (not_equal_tm): Remove redundant check.
5485
5486 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5487
5488         * getdate.y: Use Bison 1.875 features, and some minor
5489         code cleanups.  This change does not affect semantics.
5490         Don't include <stdlib.h>; no longer needed.
5491         Don't include unlocked-io.h; only the "#if TEST" code uses
5492         stdio, and performance isn't crucial there.
5493         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5494         Bison 1.875 features as described below.
5495         All uses of "PC." replaced by "pc->".
5496         (YYSTYPE): Add a forward declaration.
5497         (yylex, yyerror): Use full prototypes in forward decls.
5498         Use "%pure-parser" rather than obsolescent "%pure_parser".
5499         Use %parse-param and %lex-param instead of obsolescent
5500         YYPARSE_PARAM and YYLEX_PARAM.
5501         (meridian_table, month_and_day_table, time_units_table,
5502         relative_time_table, time_zone_table, military_table,
5503         lookup_zone, lookup_word, get_date):
5504         Use NULL instead of 0 where appropriate.
5505         (to_hour): Avoid abort (), to avoid a dependency on
5506         stdlib.h.
5507         (yyerror, yylex): Now accepts parser_control * arg.
5508         (main) [TEST]: Use '\0' rather than 0 for char.
5509
5510 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5511
5512         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5513         It's now the caller's responsibility to handle the case where
5514         !HAVE_GETPAGESIZE && !defined getpagesize.
5515
5516         * mktime.c (leapyear): Arg is long int, not int.
5517
5518 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5519
5520         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5521
5522 2004-10-12  Simon Josefsson  <jas@extundo.com>
5523
5524         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5525         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5526         to real functions.
5527
5528 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5529
5530         * vsnprintf.h: New file.
5531         * vsnprintf.c: New file.
5532
5533 2004-10-07  Bruno Haible  <bruno@clisp.org>
5534
5535         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5536         into the provided buffer.
5537
5538 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5539
5540         * diacrit.c, diacrit.h: Add GPL notice.
5541
5542         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5543         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5544         * logl.c (logl): Keep the code as similar to glibc as possible.
5545         This avoids a potential constant-folding bug.
5546
5547 2004-10-05  Bruno Haible  <bruno@clisp.org>
5548
5549         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5550
5551 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5552
5553         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5554         * xmalloc.c (xmemdup): Likewise.
5555         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5556         XFREE): Remove these long-obsolescent macros.
5557         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5558         * xstrdup.c: Remove.
5559
5560         * regex.c (re_comp): Cast gettext return value to char *,
5561         Problem reported by Martin Neitzel via Mark D. Baushke.
5562
5563 2004-10-04  Simon Josefsson  <jas@extundo.com>
5564
5565         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5566         '#ifdef USE_UNLOCKED_IO'.
5567
5568 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5569
5570         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5571         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5572         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5573         regex.c, sha1.c, version-etc.c, yesno.c:
5574         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5575         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5576         the includer's responsibility.
5577
5578         Sync from coreutils.
5579
5580         * modechange.c (mode_compile): Don't decrement a pointer that
5581         points to the start of a string, as the C Standard says the
5582         resulting behavior is undefined.
5583
5584         * backupfile.h (enum backuptype): Rename none -> no_backups,
5585         simple -> simple_backups, numbered_existing ->
5586         numbered_existing_backups, numbered -> numbered_backups
5587         to avoid shadowing problems.  All uses changed.
5588         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5589         * backupfile.c (check_extension, numbered_backup):
5590         Rename locals to avoid shadowing 'basename'.
5591         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5592         once.
5593
5594         * .cppi-disable: Add getopt_.h, getopt_int.h.
5595         * .cvsignore: Add getopt.h.
5596
5597 2004-10-04  Simon Josefsson  <jas@extundo.com>
5598
5599         * memmem.h: New file.
5600         * memmem.c: New file, taken from glibc.
5601
5602 2004-10-02  Jim Meyering  <jim@meyering.net>
5603
5604         * dirfd.h, getpagesize.h: Add copyright notice.
5605
5606 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5607
5608         * snprintf.c: Remove comments as to why each header is needed.
5609
5610 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5611
5612         * strsep.h: New file.
5613         * strsep.c: New file.
5614
5615 2004-10-01  Simon Josefsson  <jas@extundo.com>
5616
5617         * snprintf.c (snprintf): Handle size==0.
5618
5619 2004-10-01  Simon Josefsson  <jas@extundo.com>
5620             Bruno Haible  <bruno@clisp.org>
5621
5622         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5623         (snprintf): Declare 'args'.
5624
5625 2004-09-30  Simon Josefsson  <jas@extundo.com>
5626
5627         * snprintf.h, snprintf.c: New files.
5628
5629 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5630
5631         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5632         (hol_entry_help): Never translate an empty string.
5633         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5634         * argp.h (OPTION_NO_TRANS): New option.
5635
5636 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5637
5638         * xvasprintf.c: Include xalloc.h.
5639         (xvasprintf): Use xalloc_die, not xmalloc_die.
5640
5641 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5642
5643         * dummy.c: Change copyright notice to FSF, and license to GPL.
5644
5645 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5646
5647         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5648         Problem reported by Bruno Haible in:
5649         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5650
5651 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5652
5653         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5654         in case some system header has #define'd it.  Problem reported by
5655         Soeren D. Schulze in
5656         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5657
5658 2004-09-08  Bruno Haible  <bruno@clisp.org>
5659
5660         * stdint_.h: New file, taken from GNU clisp.
5661
5662 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5663
5664         * xvasprintf.h: New file.
5665         * xvasprintf.c: New file.
5666         * xasprintf.c: New file.
5667
5668 2004-09-08  Bruno Haible  <bruno@clisp.org>
5669
5670         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5671         is > INT_MAX.
5672         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5673
5674 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5675
5676         Import from coreutils.
5677         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5678         strings on unbounded length.  alloca's performance benefits aren't
5679         that important here.
5680         (V_STRDUP): Remove.
5681         (parse_with_separator): New function, with most of the internals
5682         of the old parse_user_spec.  Allow user to omit both user and group,
5683         for compatibility with FreeBSD.
5684         Clone only the user name, not the entire spec.
5685         Do not set *uid, *gid unless entirely successful.
5686         Avoid memory leak in some failing cases.
5687         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5688         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5689         (parse_user_spec): Rewrite to use parse_with_separator.
5690
5691 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5692
5693         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5694         its complicated substitute.
5695         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5696         and program_invocation_name.
5697         (__argp_basename) [!_LIBC]: Remove; the only use was
5698         replaced by its body.
5699         (__argp_short_program_name): Change condition from
5700         !defined __argp_short_program_name to
5701         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5702         to match argp-namefrob.h.
5703         (__argp_failure): Don't assume strerror_r returns char *.
5704         * argp-parse.c (N_): Define unconditionally.
5705         (argp_default_options): Fill out initializers with 0 to avoid
5706         gcc warnings.
5707
5708 2004-08-12  Simon Josefsson  <jas@extundo.com>
5709
5710         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5711         * getopt_.h: Renamed from getopt.h.
5712
5713 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5714
5715         Merge from coreutils.
5716
5717         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5718         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5719         for Reliant Unix 5.43.
5720
5721         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5722         (union fooround): Use uintmax_t, not long int.
5723         The rest is a merge from libc:
5724         [defined _LIBC]: Include <shlib-compat.h>.
5725         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5726
5727         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5728
5729         * strverscmp.c: Convert to UTF-8.
5730
5731 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5732
5733         * obstack.h (obstack_empty_p):
5734         Don't assume that chunk->contents is suitably aligned.
5735         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5736         Likewise. Problem reported by Benno in
5737         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5738
5739         * chown.c (rpl_chown): Work even if the file is writeable but not
5740         readable.  This could be improved further but it'd take some work.
5741
5742 2004-08-08  Simon Josefsson  <jas@extundo.com>
5743
5744         * xgethostname.c: Don't include error.h (not used).
5745
5746         * getpass.h: Add.
5747         * getpass.c: Include getpass.h first.
5748
5749 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5750
5751         * xalloc-die.c: New files.
5752         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5753         All uses removed.
5754         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5755         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5756         (_, N_, xalloc_die): Move to xalloc-die.c.
5757         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5758         so that we needn't mess with xalloc_msg_memory_exhausted.
5759
5760         * sha1.h: Renamed from sha.h.
5761         (SHA1_H): Renamed from _SHA_H.
5762         (sha1_ctx): Renamed from sha_ctx.
5763         (sha1_init_ctx): Renamed from sha_init_ctx.
5764         (sha1_process_block): Renamed from sha_process_block.
5765         (sha1_process_bytes): Renamed from sha_process_bytes.
5766         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5767         (sha1_read_ctx): Renamed from sha_read_ctx.
5768         (sha1_stream): Renamed from sha_stream.
5769         (sha1_buffer): Renamed from sha_buffer.
5770         * sha1.c: Likewise; renamed from sha.c.
5771         Do not include <sys/types.h>.
5772         Include <stddef.h> rather than <stdlib.h>.
5773
5774 2004-08-08  Bruno Haible  <bruno@clisp.org>
5775
5776         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5777         FILESYSTEM_PREFIX_LEN.
5778         * progreloc.c: Likewise.
5779         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5780
5781 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5782
5783         Merge from tar.
5784         * argp-help.c (make_hol, hol_append): Don't assume that
5785         SIZE_MAX is a valid preprocessor constant.
5786         (__argp_basename): Change from "#ifndef _LIBC"
5787         to "#ifndef __argp_short_program_name", so that
5788         we don't compile these functions for tar.
5789
5790         More merges from coreutils.
5791         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5792         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5793         yesno.h: New files.
5794         * addext.c: Remove; no longer needed.
5795         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5796         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5797         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5798         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5799         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5800         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5801         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5802         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5803         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5804         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5805         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5806         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5807         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5808         Import changes from coreutils.
5809
5810 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5811
5812         Merge from coreutils.
5813
5814         * .gdb-history: Remove; this doesn't belong here.
5815
5816         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5817         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5818         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5819
5820         * dirname.h: Include <stdbool.h>.
5821         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5822         for consistency with POSIX terminology.  All uses changed.
5823         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5824         (strip_trailing_slashes): Use bool for booleans.
5825         * stripslash.c (strip_trailing_slashes): Likewise.
5826
5827         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5828         sometimes returns a positive errno value even when it succeeds.
5829         (print_errno_message) [!LIBC]: Fall back on strerror if
5830         __strerror_r fails.
5831
5832         * path-concat.c (mempcpy): Don't define if a system header defines it.
5833         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5834         (longest_relative_suffix): New function.
5835         (path_concat): Use it.  Assume first argument is not NULL.
5836         Port to DOS.  Omit redundant separators.
5837         Report an error instead of returning NULL.
5838         Use mempcpy instead of memcpy.
5839         (xpath_concat): Remove: not declared or used.
5840
5841         * same.h: Include <stdbool.h>
5842         (same_name): Return bool, not int.
5843         * same.c (same_name): Likewise.
5844         (errno): Don't declare; we assume C89 or better now.
5845
5846         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5847         if not already defined.
5848
5849         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5850         * dup-safer.c (errno): Likewise.
5851
5852 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5853
5854         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5855         working.
5856
5857 2004-08-03  Simon Josefsson  <jas@extundo.com>
5858
5859         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5860         * progname.h: Don't include stdbool.h.
5861
5862 2004-08-02  Simon Josefsson  <jas@extundo.com>
5863
5864         * getsubopt.h: New file, with comments from Bruno Haible.
5865         * getsubopt.c: New file, from glibc, but slightly modified based on
5866         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5867
5868 2004-08-01  Simon Josefsson  <jas@extundo.com>
5869
5870         * xgetdomainname.c: Include stdlib.h, for free().
5871
5872 2004-07-16  Simon Josefsson  <jas@extundo.com>
5873
5874         * dummy.c: New file.
5875
5876 2004-07-16  Bruno Haible  <bruno@clisp.org>
5877
5878         * backupfile.h: Add extern "C" for C++.
5879         * closeout.h: Likewise.
5880         * copy-file.h: Likewise.
5881         * findprog.h: Likewise.
5882         * full-write.h: Likewise.
5883         * pathname.h: Likewise.
5884         * progname.h: Likewise.
5885         * stpcpy.h: Likewise.
5886         * stpncpy.h: Likewise.
5887         * strcase.h: Likewise.
5888         * strstr.h: Likewise.
5889         * xalloc.h: Likewise.
5890
5891         * mbswidth.h: Add extern "C" for C++.
5892         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5893
5894 2004-07-09  Simon Josefsson  <jas@extundo.com>
5895
5896         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5897         failed without this.)
5898
5899 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5900
5901         * fchown-stub.c: New file.
5902
5903 2004-06-24  Jim Meyering  <jim@meyering.net>
5904
5905         * obstack.h (obstack_base): Cast to (void *), per documentation.
5906
5907 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5908
5909         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5910
5911 2004-06-01  Jim Meyering  <jim@meyering.net>
5912
5913         * calloc.c: New file.
5914
5915 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5916
5917         * getdate.y (yylex): Allow space between sign and number.
5918         Problem reported by Dan Jacobson.
5919
5920 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5921         and  Jim Meyering  <jim@meyering.net>
5922
5923         Merge from coreutils CVS.
5924
5925         * stat-macros.h: New file, with contents from file-type.h
5926         and coreutils' system.h.
5927         * file-type.c: Include "stat-macros.h".
5928         * file-type.h (file_type): Move all macro definitions to new file,
5929         stat-macros.h.
5930
5931         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5932         Wrap old code with this conditional.
5933         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5934         function that does not dereference symlinks.
5935         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5936
5937         * xreadlink.c: Include xreadlink.h first, to catch .h file
5938         dependency problems.
5939         (xreadlink): Accept new arg SIZE, for efficiency.
5940         All decls and uses changed.
5941         * xreadlink.h: Include <stddef.h>, for size_t.
5942
5943         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5944         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5945
5946         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5947
5948 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5949
5950         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5951         macros to be defined.
5952         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5953         the allocator returns NULL because the requested size is zero.
5954
5955 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5956
5957         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5958         var.  Add comment explaining why libc still defines it.  This
5959         merges the following patch from glibc:
5960         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5961
5962 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5963
5964         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5965         present in glibc since revision 1.1 of this file.
5966         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5967         obstack_alignment_mask, obstack_alloc, obstack_base,
5968         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5969         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5970         obstack_grow0, obstack_init, obstack_int_grow,
5971         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5972         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5973         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5974         nonexistent functions.
5975
5976 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5977             Paul Eggert  <eggert@cs.ucla.edu>
5978
5979         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5980
5981 2004-05-14  Bruno Haible  <bruno@clisp.org>
5982
5983         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5984         that consists of a '.' followed by an empty digit string.
5985         Patch by Tor Lillqvist <tml@iki.fi>.
5986
5987 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5988
5989         Port obstack to the AS/400, where pointers are 16 bytes wide and
5990         you cannot cast an integer to a valid pointer.  This patch is
5991         currently waiting to be integrated into glibc; see
5992         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5993
5994         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5995         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5996         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5997         (struct obstack): temp member is now a union of a pointer and
5998         an integer, instead of an integer.  All integer uses changed.
5999         This does not affect the physical layout of struct obstack,
6000         except on hosts (like the AS/400) where the size or alignment of
6001         void * is greater than that of ptrdiff_t.
6002         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
6003         __STDC__)]: Store temporary in pointer member of union, not
6004         integer member.
6005         * obstack.c: Include <stddef.h>, for offsetof.
6006         (struct fooalign): Remove; it doesn't need a name.
6007         (union fooround): Change double to long double, and add void *.
6008         (DEFAULT_ALIGNMENT): Use offsetof to compute.
6009         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6010         not a macro.  Hence the values are always int; so remove all
6011         casts-to-int in uses.
6012
6013 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
6014             Derek Price  <derek@ximbiot.com>
6015
6016         * alloca.c: Include <alloca.h>, to get our interface.
6017         * alloca_.h: Use __alloca on AIX, so that we don't have to
6018         include <alloca.h> first.  Use C89 prototype for alloca; this
6019         requires including <stddef.h> for size_t.  Use extern "C" if C++.
6020         Use #elif for simplicity, since we can assume C89 now.
6021         Don't try to source the system alloca.h since it will not be found
6022         and to prevent recursively including its replacement.
6023         * fnmatch.c: Include <alloca.h> instead of opencoding.
6024         * regex.c: Likewise.
6025
6026 2004-05-16  Derek Price  <derek@ximbiot.com>
6027             Paul Eggert  <eggert@cs.ucla.edu>
6028
6029         getline cleanup.  This changes the getndelim2 API: both order of
6030         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6031         no delimiter).
6032
6033         * getline.c: Don't include stddef.h or stdio.h, since our
6034         interface does that.
6035         (getline): Always use getdelim, so that we don't have two
6036         copies of this code.
6037         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6038         if available.
6039         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6040         (GETNDELIM2_MAXIMUM): New macro.
6041         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
6042         instead of the old practice of delim2==0.  All callers changed.
6043         Return -1 on overflow, instead of returning junk.
6044         Do not set *linesize unless allocation succeeds.
6045         * getndelim2.h: Do not include stddef.h; no longer needed, now
6046         that we include sys/types.h.
6047         * getnline.h: Likewise.
6048         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6049         (getndelim2): Reorder arguments.
6050         * getnline.c (getnline, getndelim):
6051         Don't discard the NMAX argument.
6052         (getnline): Invoke getndelim, to avoid code duplication.
6053         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6054         of (size_t) -1 by callers of the getnline family.
6055
6056 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
6057
6058         * nanosleep.c (suspended): Change its type from int to
6059         sig_atomic_t volatile.
6060         (first_call): Make it private to rpl_nanosleep, and have it
6061         be zero initially as that's a bit faster.
6062         (my_usleep): Round up fractional times instead of truncating them,
6063         as this is the usual meaning for 'sleep'.
6064
6065         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6066         doesn't work.
6067         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6068         (ENOSYS): Define if not defined.
6069         (settime): Fall back on stime if it exists and settimeofday fails.
6070         But don't bother with fallbacks if a method fails with errno == EPERM.
6071
6072 2004-05-11  Jim Meyering  <jim@meyering.net>
6073
6074         Prior to this change, the save_cwd caller required read access to the
6075         current directory on most systems (ones with the fchdir function).
6076
6077         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6078         fails, try write-only, and finally, resort to using xgetcwd.
6079
6080 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
6081
6082         * obstack.c, obstack.h: Import changes from libc.
6083
6084 2004-04-28  Bruno Haible  <bruno@clisp.org>
6085
6086         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6087         implicitly appends .exe to executables.
6088         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6089         accepts Windows pathnames.
6090         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6091         Cygwin like Windows, since it now accepts Windows pathnames.
6092         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6093         Cygwin like Windows, since it now accepts Windows pathnames.
6094         Reported by Derek Robert Price <derek@ximbiot.com>.
6095
6096 2004-04-20  Jim Meyering  <jim@meyering.net>
6097
6098         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6099
6100 2004-04-20  Jim Meyering  <jim@meyering.net>
6101             Bruno Haible  <bruno@clisp.org>
6102
6103         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6104         memory when realloc fails.
6105
6106 2004-04-18  Jim Meyering  <jim@meyering.net>
6107
6108         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6109         don't leak memory and do call END_UTMP_ENT.
6110
6111 2004-04-11  Paul Eggert  <eggert@twinsun.com>
6112
6113         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6114         (CHAR_BIT): Remove, since we assume C89.
6115         Include <stdint.h> if available, as per current Autoconf CVS advice.
6116
6117 2004-03-30  Paul Eggert  <eggert@twinsun.com>
6118
6119         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6120         not bool, to be more consistent with Unix conventions.
6121         Suggested by Bruno Haible.
6122
6123         Merge from coreutils.
6124
6125         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6126         New files.
6127
6128         * getdate.h: Include stdbool.h, and timespec.h instead of
6129         the usual <time.h> dance.
6130         (get_date): Change signature to support fractional time stamps.
6131         All callers changed.
6132         * getdate.y: Include "getdate.h" first, as we can now
6133         assume C89 and don't need to worry about 'const'.
6134         Similarly, include "unlocked-io.h" near start, not in middle.
6135         Include <limits.h>.
6136         (textint.value): Use long int rather than int.
6137         (textint.digits): Use size_t rather than int.
6138         (BILLION, LOG10_BILLION): New constants.
6139         (parser_control): New member rel_ns.  Members day_ordinal,
6140         time_zone, month, day, hour, minutes, rel_year, rel_month,
6141         rel_day, rel_hour, rel_minutes, rel_seconds
6142         are now long int, not int.  Member seconds is now struct timespec,
6143         not int.  New member timespec_seen.  Members dates_seen, days_seen,
6144         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6145         not int.
6146         (%union.intval): Now long int, not int.
6147         New member timespec.
6148         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6149         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6150         (spec): Now is a timespec or an item list.
6151         (timespec, items): New nonterminals.
6152         (time, rel, relunit, number, get_date):
6153         Add support for fractional seconds.
6154         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6155         (gmtime, localtime, mktime): Remove decls; not needed with C89.
6156         (to_hour): First arg is now long int, not int.
6157         (to_year): Returns long int, not int.
6158         Don't treat year -70 like 70.
6159         (tm_diff): Returns long int, not int.
6160         (lookup_word): Use bool instead of int when appropriate.
6161         (yylex): Use size_t for count, not int.
6162         Detect overflow when parsing large integer constants.
6163         Add support for fractions.
6164         (get_date): Make pointers 'const' if possible.
6165         Use more-portable code to detect integer overflow.
6166         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
6167         Don't use ctime; it's not reliable if the year has >4 digits.
6168
6169         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6170         This is for compatibility with BSD.
6171
6172         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6173         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6174         From coreutils' system.h.
6175
6176         * userspec.c: Don't include "posixver.h".
6177         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6178         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6179         compatible extension.  Simplify code by removing a boolean int
6180         that was always nonzero if a string was nonnull.
6181
6182 2004-03-30  Jim Meyering  <jim@meyering.net>
6183
6184         Merge from coreutils.
6185
6186         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6187
6188         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6189         an empty input stream.
6190
6191         * readtokens.c: Include <stdbool.h>.
6192         (readtoken): Use `size_t' rather than int/long.
6193         All callers adjusted.
6194         Use `bool' rather than `int' where appropriate.
6195         Use memset rather than an explicit loop.
6196         Use x2nrealloc rather than xrealloc.
6197         Allow the use of `\0' as a delimiter.
6198         (readtokens): Likewise.
6199         * readtokens.h (readtoken, readtokens): Update prototypes.
6200
6201 2004-03-30  Bruno Haible  <bruno@clisp.org>
6202
6203         * getloadavg.c (getloadavg): Don't assume setlocale returns
6204         nonnull.
6205
6206 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6207
6208         Merge changes to getloadavg.c from coreutils and Emacs.
6209
6210         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6211         Define to an expression, not to the empty string.
6212         Include cloexec.h and xalloc.h.
6213         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6214         Use set_cloexec_flag rather than rolling our own.
6215         * cloexec.c, cloexec.h: New files.
6216
6217 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6218
6219         * getopt.h: Sync with libc CVS.
6220
6221 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6222             Bruno Haible  <bruno@clisp.org>
6223
6224         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6225         not on all platforms that have <wchar.h>.
6226         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6227
6228 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6229
6230         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6231         Sync with libc CVS.
6232         * getopt_int.h: New file, also synced from libc.
6233
6234 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6235
6236         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6237         '#if' expressions.  Unlike the code it replaces, it does not
6238         depend on (defined _SC_PAGESIZE).  However, it does depend on
6239         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6240         first reported by Jason Andrade in
6241         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6242
6243 2004-01-18  Simon Josefsson  <jas@extundo.com>
6244
6245         * strdup.h: New file.
6246         * strdup.c: Include it.
6247         * path-concat.c: Include strdup.h. Drop strdup declaration.
6248         * userspec.c: Include strdup.h. Drop strdup declaration.
6249
6250 2004-02-06  Karl Berry  <karl@gnu.org>
6251
6252         * config.charset: update from gettext 0.14.1.
6253
6254 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6255
6256         Add comments and code, prompted by suggestions from Bruno Haible
6257         for sh-quote.
6258         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6259         describing the enum quoting_style values.
6260         * quotearg.c (quotearg_alloc): New function.
6261         (quotearg_buffer_restyled): Treat lone { and } as special.
6262         Treat = as special.  Work around bug with older shells
6263         that "see" a '\' that is really the 2nd byte of a multibyte char.
6264         Quote empty string with shell_quoting_style.
6265
6266 2004-02-03  Bruno Haible  <bruno@clisp.org>
6267
6268         * pipe.h: New file, from GNU gettext.
6269         * pipe.c: New file, from GNU gettext.
6270
6271 2004-01-27  Bruno Haible  <bruno@clisp.org>
6272
6273         * execute.h: New file, from GNU gettext.
6274         * execute.c: New file, from GNU gettext.
6275         * w32spawn.h: New file, from GNU gettext.
6276
6277 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6278
6279         Exit-status fix from coreutils.
6280
6281         Use exit_failure consistently in place of EXIT_FAILURE,
6282         so that program exit statuses are consistent on failure.
6283
6284         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6285         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6286         * argmatch.h: Comment fix to match the above.
6287         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6288         Now a macro referring to exit_failure, instead of a separate
6289         variable.  Include "exitfail.h" to get it.
6290         * xstrtol.h: Include "exitfail.h".
6291         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6292
6293         * long-options.c (parse_long_options): Use prototype
6294         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6295         for clarity.
6296
6297 2004-01-21  Jim Meyering  <jim@meyering.net>
6298
6299         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6300         so as not to conflict with a different-sized __mktime_internal
6301         function in GNU libc.
6302         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6303         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6304
6305 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6306
6307         Merge from diffutils.
6308
6309         * file-type.c (file_type): Add typed memory objects.
6310         * file-type.h (S_TYPEISTMO): New macro.
6311
6312         * c-stack.h (c_stack_action): Remove argv argument.
6313         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6314         (die): Don't calculate message unless segv_action returns.
6315         (get_stack_location, min_address_from_argv, max_address_from_argv,
6316         volatile stack_base, volatile_stack_size): Remove.
6317         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6318         that every segmentation violation is a stack overflow.  (Ouch!)
6319         See Debian bug 136249 (still outstanding) for more info about why
6320         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6321
6322 2003-11-30  Bruno Haible  <bruno@clisp.org>
6323
6324         Safer stack allocation.
6325         * setenv.c: Include allocsa.h.
6326         (alloca): Remove fallback definition.
6327         (freea): Remove macro.
6328         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6329         instead of freea.
6330
6331 2003-10-17  Bruno Haible  <bruno@clisp.org>
6332
6333         * binary-io.h: Avoid warnings on Cygwin.
6334
6335 2003-12-28  Bruno Haible  <bruno@clisp.org>
6336
6337         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6338         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6339
6340 2003-11-28  Bruno Haible  <bruno@clisp.org>
6341
6342         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6343
6344 2003-11-27  Bruno Haible  <bruno@clisp.org>
6345
6346         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6347
6348 2003-11-17  Bruno Haible  <bruno@clisp.org>
6349
6350         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6351
6352 2003-11-24  Bruno Haible  <bruno@clisp.org>
6353
6354         * xallocsa.h: New file, from GNU gettext.
6355         * xallocsa.c: New file, from GNU gettext.
6356
6357 2003-11-24  Bruno Haible  <bruno@clisp.org>
6358
6359         * allocsa.h: New file, from GNU gettext.
6360         * allocsa.c: New file, from GNU gettext.
6361
6362 2003-11-24  Bruno Haible  <bruno@clisp.org>
6363
6364         * eealloc.h: New file.
6365
6366 2004-01-15  Jim Meyering  <jim@meyering.net>
6367
6368         Merge from coreutils.
6369
6370         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6371         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6372         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6373
6374         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6375         optional configure-time default.
6376
6377         * version-etc.c (version_etc_copyright): Update copyright date.
6378
6379         * xreadlink.c (xreadlink): Correct outdated comment.
6380
6381 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6382
6383         Merge from coreutils.
6384
6385         * posixver.c: Include posixver.h.
6386
6387         * same.c: Include <stdbool.h>, <limits.h>.
6388         (_POSIX_NAME_MAX): Define if not defined.
6389         (MIN): New macro.
6390         (same_name): If file names are silently truncated, report
6391         that the file names are the same if they are the same after
6392         the silent truncation.
6393
6394         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6395         conversion function.
6396         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6397         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6398         longer needed.
6399
6400 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6401
6402         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6403         with like-named macro in fnmatch.c.
6404         (EXT): Use an internal constant instead.
6405
6406         Merge fnmatch patches from glibc.
6407         * fnmatch.c (mbsinit): Remove define.
6408         Add libc_hidden_ver (__fnmatch, fnmatch).
6409         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6410         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6411
6412 2003-12-14  Karl Berry  <karl@gnu.org>
6413
6414         * config.charset: update from gettext-runtime.
6415
6416 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6417
6418         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6419         Bug reported by Alfred M. Szmidt.
6420
6421 2003-11-29  Karl Berry  <karl@gnu.org>
6422
6423         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6424
6425 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6426             Bruno Haible  <bruno@clisp.org>
6427
6428         * printf-parse.h: Don't include sys/types.h.
6429         (ARG_NONE): New macro.
6430         (char_directive): Change type of *arg_index fields to size_t.
6431         * printf-parse.c: Don't include sys/types.h.
6432         (SSIZE_MAX): Remove macro.
6433         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6434         Remove unnecessary overflow check.
6435         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6436         fields.
6437
6438 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6439
6440         * alloca.c: Remove dependency on xalloc module.
6441         (xalloc_die): Remove.
6442         (memory_full) [!defined emacs]: New macro.
6443         [!defined emacs]: Don't include xalloc.h.
6444         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6445         address arithmetic overflows.  Change datatypes a bit to avoid
6446         unnecessary casts.
6447
6448 2003-11-22  Jim Meyering  <jim@meyering.net>
6449
6450         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6451
6452 2003-11-17  Bruno Haible  <bruno@clisp.org>
6453
6454         * vasnprintf.c (alloca): Remove fallback definition.
6455         (freea): Remove definition.
6456         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6457         Reported by Paul Eggert.
6458
6459 2003-11-17  Jim Meyering  <jim@meyering.net>
6460
6461         On systems without utime and without a utimes function capable of
6462         dealing with a NULL struct utimbuf* argument, this utime replacement
6463         could -- in unusual circumstances -- leak a file descriptor.
6464         * utime.c: Include <unistd.h> and <errno.h>.
6465         (utime_null): Be sure to close `fd' and to preserve errno.
6466         Reported by Geoff Collyer via Arnold Robbins.
6467
6468 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6469             Bruno Haible  <bruno@clisp.org>
6470
6471         Protect against address arithmetic overflow.
6472         * printf-args.h: Include stddef.h.
6473         (arguments): Change type of field 'count' to size_t.
6474         * printf-args.c (printf_fetchargs): Use size_t instead of
6475         'unsigned int' where appropriate.
6476         * printf-parse.h: Include sys/types.h.
6477         (char_directive): Change type of *arg_index fields to ssize_t.
6478         (char_directives): Change type of fields 'count', max_*_length to
6479         size_t.
6480         * printf-parse.c: Include sys/types.h and xsize.h.
6481         (SSIZE_MAX): Define fallback value.
6482         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6483         instead of 'int' where appropriate. Check a_allocated, d_allocated
6484         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6485         * vasnprintf.c: Include xsize.h.
6486         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6487         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6488         overflow. Avoid wraparound when converting a width or precision from
6489         decimal to binary.
6490
6491 2003-11-16  Bruno Haible  <bruno@clisp.org>
6492
6493         Update from GNU gettext.
6494         * printf-parse.c: Generalize to it can be compiled for wide strings.
6495         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6496         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6497         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6498         SNPRINTF): New macros.
6499         Don't include <alloca.h> if the file is used inside libintl.
6500         (local_wcslen): New function, for Solaris 2.5.1.
6501         (VASNPRINTF): Use it instead of wcslen.
6502
6503 2003-11-16  Bruno Haible  <bruno@clisp.org>
6504
6505         * xsize.h (xmax): New function.
6506         (xsum, xsum3, xsum4): Declare as "pure" functions.
6507
6508 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6509
6510         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6511         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6512         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6513         heuristic is just as accurate as far as we know, and it removes a
6514         dependency on size_max.m4 and ptrdiff_max.m4.
6515
6516 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6517
6518         * xstrtol.c (__xstrtol): Remove "break" immediately after
6519         "return", to pacify some unknown compiler.  Problem reported
6520         by Joerg Schilling.
6521
6522 2003-11-11  Bruno Haible  <bruno@clisp.org>
6523
6524         * xsize.h (SIZE_MAX): Remove fallback definition.
6525         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6526         defined.
6527
6528 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6529
6530         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6531         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6532         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6533         From Bruno Haible.
6534         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6535         not (size_t) -1, since it's defined here.
6536
6537 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6538
6539         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6540         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6541         Reject sizes of exactly SIZE_MAX bytes.
6542         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6543         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6544
6545 2003-11-05  Bruno Haible  <bruno@clisp.org>
6546
6547         * xsize.h: Include limits.h, to avoid a possible collision with
6548         SIZE_MAX defined in <limits.h> on Solaris.
6549
6550 2003-11-04  Bruno Haible  <bruno@clisp.org>
6551
6552         * xsize.h: New file.
6553         * linebreak.c: Include xsize.h.
6554         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6555         argument for overflow.
6556         Suggested by Paul Eggert.
6557
6558 2003-10-31  Bruno Haible  <bruno@clisp.org>
6559
6560         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6561         to avoid (extremely rare) race condition.
6562         Suggested by Paul Eggert.
6563
6564 2003-11-03  Jim Meyering  <jim@meyering.net>
6565
6566         * userspec.c: Include "userspec.h".
6567         * userspec.h: New file.
6568
6569 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6570
6571         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6572         * mountlist.c (SIZE_MAX): Define if not defined already.
6573         (read_filesystem_list): Set and use me_type_malloced.
6574         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6575         whatever the type happens to be), for brevity and consistency.
6576         Check for size calculation overflow on Alphas running OSF/1.
6577
6578 2003-10-31  Jim Meyering  <jim@meyering.net>
6579
6580         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6581
6582         * linebuffer.c: Include <string.h> for declaration of memset.
6583
6584 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6585             Bruno Haible  <bruno@clisp.org>
6586
6587         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6588         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6589
6590 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6591
6592         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6593         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6594         no longer needed.
6595         * quotearg.c (quotearg_n_options): Use it.
6596         * group-member.c: Include <stdbool.h>.
6597         (free_group_info): Arg is now const *; don't free arg.
6598         (get_group_info): Now returns bool and accepts struct group_info *,
6599         rather than returning a malloc'ed struct group_info *.
6600         All uses changed.  Check for overflow in internal size calculation.
6601
6602         * getusershell.c (readname): Simplify the code by using x2nrealloc
6603         rather than xmalloc/xrealloc.
6604         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6605         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6606         conformance bug: the old code used a pointer after freeing the
6607         storage that it addressed.
6608         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6609         rather than doing it by hand.
6610         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6611         the buffer preserved.  Use free and xmalloc instead.
6612         * quotearg.c (quotearg_n_options): Likewise.
6613         Use a simpler test for size overflow.  Don't use xalloc_oversized
6614         because unsigned int might be wider than size_t (!); this suggests
6615         that we should switch from unsigned int to size_t for slot numbers.
6616
6617 2003-10-27  Bruno Haible  <bruno@clisp.org>
6618
6619         * stdbool_.h: Better support for BeOS.
6620
6621 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6622
6623         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6624         to allocate the returned structure.  Do not allocate a subarray,
6625         as x2nrealloc will do that.
6626         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6627         instead of xnrealloc.
6628         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6629
6630 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6631
6632         * xalloc.h (xalloc_oversized): New static inline function, for
6633         callers that want to do their own size-overflow checking.  Include
6634         <stdbool.h>, since xalloc_oversized returns bool.
6635         * xalloc.c (array_size_overflow): Remove.  All callers changed
6636         to use xalloc_oversized.
6637
6638         Add two functions x2realloc, x2nrealloc, for programs that grow
6639         arrays dynamically by doubling their sizes.
6640         * xalloc.h (x2realloc, x2nrealloc): New decls.
6641         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6642         New functions.
6643
6644         Port to C99 semantics for 'inline' of external functions.
6645         Bug reported by Bruno Haible.
6646         * xmalloc.c (xnmalloc_inline): New static inline function,
6647         with the old contents of xnmalloc.
6648         (xnmalloc, xmalloc): Use it.
6649         (xnrealloc_inline): New static inline function,
6650         with the old contents of xnrealloc.
6651         (xnrealloc, xrealloc): Use it.
6652
6653         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6654
6655 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6656
6657         Fix several address-calculation bugs in the hash modules,
6658         plus some minor code cleanup.
6659
6660         * hash.h: Include <stdbool.h>, for bool.
6661         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6662         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6663         hash_get_n_entries, hash_get_max_bucket_length,
6664         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6665         hash_rehash): Use size_t rather than unsigned.
6666         * hash.c (struct hash_table, hash_get_n_buckets,
6667         hash_get_n_buckets_used, hash_get_n_entries,
6668         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6669         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6670         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6671         Likewise.
6672         (SIZE_MAX): Define if not defined.
6673         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6674         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6675         hash_print):
6676         Use const * when possible.
6677         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6678         (check_tuning): Fix bug: if tuning parameters were very close to
6679         0 or 1, rounding errors could have caused subscript violations.
6680         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6681         (hash_initialize): Add 'fail:' label
6682         to free table and return NULL, and use it to simplify code.
6683         Use calloc rather than clearing the storage ourself.
6684         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6685         buffer size calculations.
6686         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6687         Include <stddef.h>, for size_t.
6688         * hash-pjw.c (hash_pjw): Likewise.
6689         Switch to method described by Bruno Haible.
6690         Include <limits.h>, for CHAR_BIT.
6691         (SIZE_BITS): New macro.
6692
6693 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6694
6695         * getndelim2.c (getndelim2): When size calculation overflows,
6696         ceiling the allocation at NMAX bytes rather than silently
6697         discarding input bytes before NMAX is reached.  This makes
6698         a difference only if NMAX exceeds SIZE_MAX / 2.
6699
6700         * obstack.c: Merge from glibc.
6701         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6702         Add libc_hidden_def (_obstack_newchunk).
6703         (_obstack_free) [! defined _LIBC]: Remove.
6704         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6705         a clone of the function body.
6706         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6707         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6708
6709         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6710         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6711         arg to memcpy.
6712
6713         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6714         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6715         Don't use lvalue casts, as GCC plans to remove support for them
6716         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6717         was also present in the non-GCC version, indicating that this
6718         code had always been buggy and had never been widely used.
6719         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6720         Use the fast variant of each macro, rather than copying the
6721         definiens of the fast variant; that way, we'll be more likely to
6722         catch future bugs in the fast variants.
6723
6724 2003-10-20  Bruno Haible  <bruno@clisp.org>
6725
6726         * wait-process.h: New file, from GNU gettext.
6727         * wait-process.c: New file, from GNU gettext.
6728
6729 2003-10-19  Jim Meyering  <jim@meyering.net>
6730
6731         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6732
6733 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6734
6735         * getgroups.c: Include <errno.h>, <stdlib.h>.
6736         (getgroups): First arg is int, not size_t.
6737         Don't let 'free' mangle errno.
6738
6739 2003-10-16  Jim Meyering  <jim@meyering.net>
6740
6741         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6742
6743 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6744
6745         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6746         (SIZE_MAX): Remove.
6747         (new_exclude, add_exclude_file): Initial size no longer needs to
6748         be a power of 2.
6749         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6750         our own address arithmetic overflow checking.
6751
6752         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6753         (fnmatch): Do not alloca more than 2000 wide characters;
6754         instead, use malloc for large buffers.
6755         Check for address arithmetic overflow, and return -1
6756         with errno set to ENOMEM in that case.
6757         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6758         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6759         instead, return -1.  Check for address arithmetic overflow.
6760
6761 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6762
6763         Handle invalid suffixes and overflow independently, so that
6764         callers can treat them independently as needed.  Fix some bugs in
6765         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6766         suffix for a human-readable blocksize.  The major caller-visible
6767         change is the addition of a new
6768         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6769         that both overflow and suffix chars were found.
6770
6771         * human.c (humblock): Don't check separately for invalid suffix
6772         char; that is xstrtoumax's job (now that its bug is fixed).
6773         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6774         INTMAX_MAX]: New macros.
6775         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6776         TYPE_MAXIMUM): New macros.
6777         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6778         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6779         if overflow occurs, as it's what __strtol does and it's more useful
6780         in practice.
6781         (__xstrtol): If __strtol reports some error other than ERANGE,
6782         reflect it to the caller as LONGINT_INVALID.  If it reports
6783         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6784         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6785         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6786         value.
6787         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6788         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6789         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6790         [defined UINTMAX_MAX]: New macros.
6791
6792 2003-10-14  Bruno Haible  <bruno@clisp.org>
6793
6794         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6795         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6796         Also use volatile where needed.
6797
6798 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6799
6800         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6801         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6802         and define in terms of the other primitives.
6803         * xmalloc.c: Include stdbool.h; do not include exit.h.
6804         (SIZE_MAX): Define if not already defined.
6805         (array_size_overflow): New function.
6806         (xalloc_die): Abort instead of exiting if 'error' returns.
6807         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6808         (xmalloc, xrealloc): Use them.
6809         (xcalloc): Check for address arithmetic overflow.
6810         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6811         a bit faster than strcpy.
6812
6813 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6814
6815         Merge getpass from libc, plus a few fixes.
6816
6817         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6818         Include <stdbool.h>.
6819         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6820         __fsetlocking to empty.
6821         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6822         do include <bits/libc-lock.h>.
6823         Do not include <fcntl.h>; not needed.
6824         [_LIBC]: Include <wchar.h>.
6825         (NOTCANCEL_MODE): New macro.
6826         (flockfile, funlockfile) [_LIBC]: New macros.
6827         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6828         [!_LIBC]: New macros.
6829         (call_fclose): New function.
6830         (getpass): Use it.  Save tty stream separately; this simplifies the
6831         code and makes it more reliable if stdin happens to equal stdout.
6832         Invoke __fsetlocking on tty.
6833         Handle thread cancellation if needed.
6834         Namespace cleanup (use __tcgetattr, __getline).
6835         Use bool for Booleans.
6836         [USE_IN_LIBIO]: Handle wide streams.
6837         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6838         stream might go where.
6839
6840         * unlocked-io.h: Include <stdio.h>, so that the caller
6841         doesn't have to include <stdio.h> before us.
6842         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6843         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6844         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6845         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6846         if not declared, so that we can use getpass.c code from libc without
6847         rewriting it.
6848         (flockfile, ftrylockfile, funlockfile): New macros.
6849
6850 2003-10-06  Bruno Haible  <bruno@clisp.org>
6851
6852         * version-etc-2.h: Remove file.
6853         * version-etc-2.c: Remove file.
6854
6855 2003-09-25  Jim Meyering  <jim@meyering.net>
6856             Bruno Haible  <bruno@clisp.org>
6857
6858         This lets translators provide better translations for the
6859         "Written by ..." part of --version output.
6860         * version-etc.h: Include stdarg.h.
6861         (version_etc_copyright): Declare as readonly.
6862         (version_etc): Make this function variadic with a NULL-terminated list
6863         of author name strings.
6864         (version_etc_va): New declaration.
6865         * version-etc.c: Include stdarg.h, stdlib.h.
6866         (version_etc_copyright): Declare as readonly.
6867         (version_etc_va): New function. Provide a different translatable string
6868         for each possible number of authors < 10. Abbreviate when there are 10
6869         authors or more.
6870         (version_etc): Make this function variadic. Call version_etc_va.
6871         Suggestion from Gary V. Vaughan.
6872
6873         * long-options.h (parse_long_options): Change prototype: the authors
6874         string is moved to the end and becomes variadic.
6875         * long-options.c: Include stdarg.h.
6876         (parse_long_options): Make this function variadic, too.
6877         Call version_etc_va, not version_etc.
6878
6879 2003-10-06  Bruno Haible  <bruno@clisp.org>
6880
6881         * fatal-signal.h: New file, from GNU gettext.
6882         * fatal-signal.c: New file, from GNU gettext.
6883
6884 2003-10-04  Karl Berry  <karl@gnu.org>
6885
6886         * argp*: update from libc.
6887
6888 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6889
6890         * getpass.c (getpass): Use a no-op fseek when switching from input to
6891         output mode on the same stream.
6892
6893 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6894
6895         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6896         Fix arg typo in previous patch.
6897
6898 2003-09-28  Jim Meyering  <jim@meyering.net>
6899
6900         * error.c: Correct cpp indentation.
6901
6902 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6903
6904         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6905         Omit the special code that used __typeof__, since we worry that
6906         it could be more trouble than it's worth.  See:
6907         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6908         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6909
6910         * free.c: New file.
6911
6912 2003-09-26  Jim Meyering  <jim@meyering.net>
6913
6914         * error.c (error_tail): Move some declarations
6915         into inner scope where the local variables are used.
6916
6917 2003-09-26  Bruno Haible  <bruno@clisp.org>
6918
6919         * stpncpy.h (gnu_stpncpy): New declaration.
6920         (stpncpy): Define as alias for gnu_stpncpy.
6921         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6922
6923 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6924
6925         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6926         (error_tail): Do not loop, reallocating temporary buffer, since
6927         the output cannot contain more wide characters than the input
6928         contains bytes, the size must be big enough already.  This avoids
6929         one potential size overflow calculation.  Check for size overflow
6930         when calculating temporary buffer size.  Free temporary buffer
6931         when done, if it was allocated with malloc; this plugs a memory
6932         leak.  Remove casts from void * to pointers, that are no longer
6933         needed now that we're assuming C89 or better.
6934
6935         Merge error changes from glibc.
6936
6937         * error.c, error.h: Update copyright notice header to match glibc.
6938         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6939         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6940         Disable cancellation while printing error.
6941         * error.h: Prepend __ to parameter names.
6942
6943 2003-09-25  Karl Berry  <karl@gnu.org>
6944
6945         * argp-fmtstream.c, argp-help.c: update from libc.
6946
6947 2003-09-25  Bruno Haible  <bruno@clisp.org>
6948
6949         * version-etc-2.h: New file, from version-etc.h with modifications.
6950         * version-etc-2.c: New file, from version-etc.c with modifications.
6951
6952 2003-09-25  Simon Josefsson  <jas@extundo.com>
6953
6954         * xgetdomainname.h: New file.
6955         * xgetdomainname.c: New file.
6956
6957 2003-09-25  Simon Josefsson  <jas@extundo.com>
6958             Bruno Haible  <bruno@clisp.org>
6959
6960         * getdomainname.h: New file.
6961         * getdomainname.c: New file.
6962
6963 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6964
6965         * linebuffer.c (freebuffer): Don't free the argument, just
6966         the buffer associated with the argument.  Bug reported by
6967         Simon Josefsson.
6968
6969 2003-09-19  Karl Berry  <karl@gnu.org>
6970
6971         * argp.h: update from libc.
6972
6973 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6974
6975         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6976         input error, instead of returning NULL the next time we are called
6977         (and therefore losing track of errno).
6978
6979 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6980
6981         * getndelim2.c (getndelim2): Don't trash errno when a read
6982         fails, so that the caller gets the proper errno.
6983
6984         * readutmp.c (read_utmp): Likewise.
6985         Check for fstat error.  Close stream and free storage
6986         when failing.
6987
6988 2003-09-14  Bruno Haible  <bruno@clisp.org>
6989
6990         * fwriteerror.h: New file.
6991         * fwriteerror.c: New file.
6992
6993 2003-09-14  Jim Meyering  <jim@meyering.net>
6994
6995         * getloadavg.c: Correct cpp indentation.
6996         * strdup.c: Likewise.
6997         * vasnprintf.c: Likewise.
6998
6999 2003-09-12  Paul Eggert  <eggert@twinsun.com>
7000
7001         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
7002         * obstack.c [!defined _LIBC]: Likewise.
7003         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
7004         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
7005         * exitfail.c: Don't include stdlib.h; no longer needed.
7006
7007         More changes to assume C89 or better.
7008
7009         * error.c (error_tail): Assume vprintf.
7010
7011         * argmatch.c (getenv): Remove decl.
7012         * progreloc.c (get_full_program_name): Define via prototype.
7013         * setenv.c (clearenv): Likewise.
7014         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7015         needed.
7016         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7017         (malloc, memcpy): Remove decls.
7018         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7019         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7020         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7021         (memcpy): Remove macro.
7022         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7023         (__P): Remove.  All uses removed.
7024         (PTR): Remove.  All uses changed to void *.
7025         (CHAR_BIT, NULL): Remove.
7026         (spaces, zeros, memset_space, memset_zero)
7027         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7028         Remove.
7029         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7030         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7031         Define with prototype.
7032         Remove now-unnecessary prototype decl.
7033         (extra_args_spec): Assume ANSI C.  All uses changed.
7034         (extra_args_spec_iso): Remove.
7035         (my_strftime, emacs_strftimeu): Define via prototype.
7036         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7037         unconditionally.
7038         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7039         * strtoimax.c: Include <stdlib.h> unconditionally.
7040         (strtoul, strtol): Remove decls.
7041         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7042         LONG_MAX): Remove.
7043         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7044         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
7045         (LOCALE_PARAM_PROTO): New macro.
7046         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7047         (INTERNAL (strtol), strtol): Define with a prototype.
7048         (PARAMS): Remove.  All uses removed.
7049         * tempname.c: Include <string.h> unconditionally.
7050         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7051         * xgethostname.c (main): Define with a prototype.
7052         * xmalloc.c: Include "xalloc.h" first, to check interface.
7053         Include <stdlib.h> unconditionally.
7054         (calloc, malloc, realloc, free): Remove decls.
7055         * xstrtod.c: Include "xstrtod.h" first, to check interface.
7056         Include <stdlib.h> unconditionally.  Sort include file names.
7057         (strtod): Remove.
7058         (xstrtod): Define with a prototype.
7059         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7060         (strtol, strtoul): Remove decls.
7061
7062 2003-09-11  Paul Eggert  <eggert@twinsun.com>
7063
7064         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7065         Include <stdlib.h>, <string.h> unconditionally.
7066         Remove now-unnecessary cast to char *.
7067         * strnlen.c: Include <string.h> unconditionally.
7068         * yesno.c (yesno): Define with a prototype.
7069
7070 2003-09-10  Bruno Haible  <bruno@clisp.org>
7071
7072         * strcspn.c: Include <string.h> unconditionally.
7073         * strpbrk.c: Include <string.h> unconditionally.
7074         * strstr.c: Include <string.h> unconditionally.
7075         * unicodeio.c: Include <string.h> unconditionally.
7076         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7077         * unsetenv.c: Likewise.
7078         * xreadlink.c: Include <stdlib.h> unconditionally.
7079         * yesno.c: Include <stdlib.h> unconditionally.
7080         (rpmatch): Add prototype.
7081
7082 2003-09-10  Jim Meyering  <jim@meyering.net>
7083
7084         * error.c: Correct indentation of cpp directives.
7085
7086 2003-09-09  Paul Eggert  <eggert@twinsun.com>
7087
7088         More K&R removal.
7089
7090         * acosl.c (main): Use a prototype.
7091         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7092         tanl.c: Likewise.
7093
7094         * getloadavg.c (getloadavg, main): Define via prototypes.
7095
7096         * getopt.h (struct option.name): Assume C89, and use 'const'.
7097         (getopt, etopt_long, getopt_long_only, _getopt_internal)
7098         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7099         with a prototype.
7100         * getopt.c (const): Remove macro.
7101         Include <string.h> unconditionally.
7102         (my_index): Remove; all uses changed to strchr.
7103         (strlen): Remove decl.
7104         (exchange): Remove forward decl; no longer needed.
7105         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7106         Define with prototype.
7107         * getopt1.c (const): Remove macro.
7108         (getopt_long, getopt_long_only, main): Define with prototype.
7109
7110         * getugroups.c: Include <string.h> unconditionally.
7111
7112         * getusershell.c: Include <stdlib.h> unconditionally.
7113         (getusershell, setusershell, endusershell, readname, main):
7114         Define with prototypes.
7115
7116         * group-member.c: Include group-member.h first.
7117         Include <stdlib.h> unconditionally.
7118
7119         * hard-locale.c: Include hard-locale.h first.
7120         Include <stdlib.h>, <string.h> unconditionally.
7121
7122         * hash.c (free, malloc): Remove decls.
7123         Include <stdlib.h> unconditionally.
7124
7125         * human.c: Include <stdlib.h>, <string.h> unconditionally.
7126         (getenv): Do not declare.
7127
7128         * idcache.c: Include <string.h> unconditionally.
7129
7130         * long-options.c: Include long-options.h first, to test interface.
7131         Include <stdlib.h> unconditionally.
7132
7133         * makepath.c: Include makepath.h first, to test interface.
7134         Include <stdlib.h> and <string.h> unconditionally.
7135
7136         * linebuffer.c: Include <stdlib.h>.
7137         (free): Remove decl.
7138
7139         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7140         rpl_malloc returns void *, not char *.
7141         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
7142
7143         * md5.h: Include <limits.h> unconditionally.
7144         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7145         (__P): Remove; all uses removed.
7146         * md5.c: Include "md5.h" first.
7147         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7148         md5_buffer, md5_process_bytes, md5_process_block):
7149         Define with prototypes.
7150         * sha.h (__P): Remove all uses.  (It wasn't defined??)
7151         * sha.c: Include "sha.h" first.
7152         Include <stdlib.h>, <string.h> unconditionally.
7153
7154         * memchr.c (__ptr_t): Remove; all uses changed to void *.
7155         * memcmp.c (__ptr_t): Likewise.
7156         * memrchr.c (__ptr_t): Likewise.
7157         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7158         Include <string.h> unconditionally.
7159         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7160         * memchr.c: Include <stdlib.h> unconditionally.
7161         * memchr.c (LONG_MAX): Remove.
7162         * memrchr.c (LONG_MAX): Likewise.
7163         * memchr.c (__memchr): Define via a prototype.
7164         * memrchr.c (__memrchr): Likewise.
7165         * memcmp.c (__P): Remove, and remove all uses.
7166         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7167         Remove forward decls; no longer needed.
7168         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7169         Use types required by C89 in prototype.
7170
7171         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7172         * savedir.c: Likewise.
7173         * mkdir.c (free): Remove decl.
7174         * rmdir.c (rmdir): Define with a prototype.
7175         * savedir.c: Include savedir.h first, to test interface.
7176
7177         * mktime.c (STDC_HEADERS): Remove.
7178         Include <stdlib.h>, <string.h> unconditionally.
7179
7180         * modechange.c: Include <stdlib.h> unconditionally.
7181         (malloc): Remove decl.
7182
7183         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7184         (free): Remove decl.
7185
7186         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7187         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7188         (This type really should be intptr_t, but that's a C99ism.)
7189         (_obstack_memcpy): Remove: all uses changed to memcpy.
7190         Include <string.h> unconditionally.
7191         (struct obstack): Assume __STDC__ for types of members
7192         chunkfun, freefun, extra_arg.
7193         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7194         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7195         obstack_begin, obstack_specify_allocation,
7196         obstack_specify_allocation_with_arg, obstack_chunkfun,
7197         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7198         Remove unprototyped decls and the macros that use them.
7199         * obstack.c (POINTER): Remove.  All uses changed to void *.
7200         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7201         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7202         (defined __STDC__ && __STDC__)]:
7203         Remove nonprototyped code.
7204         Include <stdlib.h> unconditionally.
7205         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7206         _obstack_allocated_p, _obstack_free, obstack_free,
7207         _obstack_memory_used, print_and_abort):
7208         Define using prototypes.
7209         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7210         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7211         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7212         obstack_next_free, obstack_object_size, obstack_room) [0]:
7213         Remove unused, unprototyped code.
7214
7215         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7216
7217         * physmem.c (physmem_total, physmem_available, main): Define
7218         with prototypes.
7219
7220         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7221         (main): Define with a prototype.
7222
7223         * posixver.c (getenv): Remove decl.
7224
7225         * putenv.c (malloc): Returns void *, not char *.
7226         Include <string.h> unconditionally.
7227         (strchr, memcpy, NULL): Do not define.
7228
7229         * readtokens.c: Include readtokens.h first, to test interface.
7230         Include <stdlib.h>, <string.h> unconditionally.
7231         (init_tokenbuffer): Define with a prototype.
7232
7233         * regex.c (PARAMS): Remove.  All uses removed.
7234         All uses of _RE_ARGS removed, too.
7235         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7236         unconditionally.
7237         (bzero): Assume memset exists.
7238         (memcmp, memcpy, NULL): Remove.
7239         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7240         char, or assignments to local vars of type signed char.
7241         (init_syntax_once, PREFIX(extract_number_and_incr),
7242         PREFIX(print_partial_compiled_pattern),
7243         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7244         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7245         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7246         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7247         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7248         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7249         wcs_compile_range, byte_compile_range, truncate_wchar,
7250         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7251         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7252         count_mbs_length, wcs_re_match_2_internal,
7253         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7254         PREFIX(alt_match_null_string_p),
7255         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7256         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7257         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7258         now-unnecessary declaration, if any.
7259         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7260         regcomp, regexec):
7261         Remove now-unnecessary casts among pointer types.
7262         * regex.h (_RE_ARGS): Remove.  All uses removed.
7263
7264         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7265         (free): Remove decl.
7266
7267         * rpmatch.c: Include <stdlib.h> unconditionally.
7268
7269         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7270         (free): Remove decl.
7271
7272         * save-cwd.c: Include <stdlib.h> unconditionally.
7273         * xgetcwd.c: Likewise.
7274
7275         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7276         (free): Remove decl.
7277
7278         * strchrnul.c (strchrnul): Define with a prototype.
7279         Fix bug: c_in was not converted to char before searching.
7280
7281         The following changes are not K&R related:
7282
7283         * group-member.h: Include <sys/types.h>, so that this file is
7284         self-contained.
7285         * makepath.h: Likewise.
7286
7287         * getusershell.c (readname, default_index, line_size, readname):
7288         Use size_t, not int, for sizes.
7289         (readname): If the size overflows, report an error instead of
7290         looping forever.
7291
7292 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7293
7294         * getndelim2.c: Assume stdlib.h per the C89 spec.
7295
7296 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7297
7298         Assume C89 or better; remove K&R cruft.
7299         A few of these changes were first proposed by Derek Robert Price
7300         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7301
7302         * addext.c: Include <string.h> unconditionally.
7303         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7304         Don't declare getenv or malloc.
7305
7306         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7307         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7308         (NULL): Remove.
7309         (find_stack_direction, alloca): Use prototypes.
7310
7311         * atexit.c (atexit): Define using a prototype.
7312
7313         * basename.c, dirname.c, stripslash.c:
7314         Include <string.h> unconditionally.
7315
7316         * bcopy.c: Include <stddef.h>.
7317         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7318
7319         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7320
7321         * error.h (error, error_at_line, error_print_progname)
7322         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7323         * error.c: Include error.h first, to check interface.
7324         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7325         (VA_START): Remove; all uses changeed to va_start.
7326         (exit, strerror): Remove decls.
7327         (error_print_progname): Prototype uncondionally.
7328         Don't include <errno.h>; no longer needed.
7329         (private_strerror): Remove.
7330         (error_tail): Always define.
7331         (error, error_at_line): Assume C89 or better; always use prototypes.
7332         * fatal.c: Include "fatal.h" first, to test interface.
7333         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7334         (VA_START): Remove; all uses changed to va_start.
7335         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7336         this case.
7337         (exit): Remove decl.
7338         (fatal): Prototype unconditionally.  Assume va_start works.
7339         Abort at end, to pacify gcc.
7340
7341         * euidaccess.c (main): Define with a prototype.
7342
7343         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7344
7345         * exitfail.c: Include <stdlib.h> unconditionally.
7346
7347         * fnmatch_.h (__P): Remove.  All uses changed to assume
7348         prototypes.
7349         * fnmatch.c: Include fnmatch.h first, to test interface.
7350         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7351         (getenv): Remove decl.
7352         (fnmatch): Define using a prototype.
7353         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7354         (FCT): Define using a prototype.
7355
7356         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7357
7358         * gethostname.c: Include <stddef.h>.
7359         (gethostname): Define with prototype.  Length is size_t, not int.
7360
7361 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7362
7363         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7364         getversion.c should have been removed then, but was accidentally
7365         preserved.
7366
7367         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7368         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7369
7370 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7371
7372         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7373         copy_tm_result.  Bug reported by Simon Josefsson in
7374         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7375
7376 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7377
7378         * time_r.c, time_r.h: New files.
7379
7380         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7381         __localtime_r.
7382         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7383         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7384
7385         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7386         __gmtime_r.
7387         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7388         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7389         Include <time_r.h>.
7390
7391         * timegm.c: Switch to glibc implementation, with the following changes:
7392         [defined HAVE_CONFIG_H]: Include <config.h>.
7393         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7394         (__mktime_internal) [!defined _LIBC]: New decl.
7395         (__gmtime_r) [!defined _LIBC]: New macro and function.
7396         (timegm): Use a prototype, since gnulib assumes C89.
7397         Do not bother declaring tmp to be const, as it's not really usefu.
7398         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7399         (timegm): Declare only if HAVE_DECL_TIMEGM.
7400
7401 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7402
7403         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7404         Bug reported by Lute Kamstra in
7405         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7406
7407         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7408         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7409         course with correspondingly smaller numbers for tomorrow and
7410         yesterday.  From Tadayoshi Funaba.  Originally installed into
7411         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7412         coreutils merge?).
7413
7414 2003-08-31  Simon Josefsson  <jas@extundo.com>
7415
7416         * timegm.h: New file.
7417         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7418
7419 2003-08-31  Karl Berry  <karl@gnu.org>
7420
7421         * argp.h: update from libc.
7422
7423 2003-08-28  Bruno Haible  <bruno@clisp.org>
7424
7425         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7426         warning on QNX, which defines O_BINARY to 000000.
7427
7428 2003-08-24  Bruno Haible  <bruno@clisp.org>
7429
7430         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7431         MSVC7 <stdio.h> is included later.
7432
7433 2003-08-20  Bruno Haible  <bruno@clisp.org>
7434
7435         * progname.h: New file, from GNU gettext.
7436         * progname.c: New file, from GNU gettext.
7437         * progreloc.c: New file, from GNU gettext.
7438
7439 2003-08-19  Bruno Haible  <bruno@clisp.org>
7440
7441         * xstrdup.c: Assume <string.h> exists.
7442
7443 2003-08-18  Jim Meyering  <jim@meyering.net>
7444
7445         * setenv.h: Indent nested cpp directive.
7446         * vasnprintf.c: Remove trailing blanks.
7447
7448 2003-08-17  Simon Josefsson  <jas@extundo.com>
7449             Bruno Haible  <bruno@clisp.org>
7450
7451         * xstrndup.h: New file.
7452         * xstrndup.c: New file.
7453
7454 2003-08-17  Bruno Haible  <bruno@clisp.org>
7455
7456         * strndup.h: New file.
7457
7458 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7459
7460         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7461         space, undoing this 2003-08-12 change:
7462         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7463
7464 2003-08-16  Jim Meyering  <jim@meyering.net>
7465
7466         Merge from coreutils.
7467         * xstrtoimax.c: #else #if -> #elif.
7468         * xstrtoumax.c: Likewise.
7469
7470 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7471
7472         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7473         rather than tab, after '#' in shell-script copyright notices.
7474         Suggested by Bruno Haible.
7475
7476 2003-08-15  Jim Meyering  <jim@meyering.net>
7477         and Paul Eggert  <eggert@twinsun.com>
7478
7479         Merge from coreutils.
7480         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7481         member but strut utmpx does not.  Needed for AIX 4.3.3.
7482         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7483
7484 2003-08-15  Jim Meyering  <jim@meyering.net>
7485
7486         Merge from coreutils.
7487         * xgethostname.c: Include <stdlib.h>.
7488         (xghostname): Don't exit for anything other than memory-related
7489         failure; just return NULL.
7490         * userspec.c: Include "posixver.h".
7491         (parse_user_spec): Accept `.' as a separator only
7492         in pre-POSIX-200112 mode.
7493         * strtoimax.c: Use #elif rather than #else #if.
7494         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7495         Remove function, now that we can rely on a working tzset function.
7496         [!_LIBC]: Ensure that the required autoconf test has been run.
7497         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7498         Use underlying_strftime for %r.
7499         * sha.c: Merge in some clean-up and optimization changes from glibc.
7500         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7501         Ensure that it is a multiple of 64.
7502         Rearrange loop exit tests so as to avoid performing an
7503         additional fread after encountering an error or EOF.
7504         * realloc.c: Update copyright date.
7505
7506 2003-08-14  Jim Meyering  <jim@meyering.net>
7507
7508         Merge from coreutils.
7509         * obstack.h: Whitespace changes.
7510         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7511         and xcalloc return values.
7512         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7513         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7514         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7515         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7516         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7517         error from mntctl.
7518         Use mntctl's return value to drive the entry-processing loop, since
7519         we can't rely on the value of the vmt_length member in the last
7520         entry.  On some systems doing so could result in exhausting
7521         virtual memory.  Based in part on a patch from Mike Jetzer.
7522
7523 2003-08-14  Jim Meyering  <jim@meyering.net>
7524         and Paul Eggert  <eggert@twinsun.com>
7525
7526         Merges from coreutils, plus other fixes.
7527         * physmem.c: Merge in portability changes from gcc/libiberty
7528         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7529         for credits and details.  Thanks to Kaveh Ghazi for helping
7530         to keep these files in sync.
7531         (ARRAY_SIZE): Define it.
7532         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7533         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7534         (memcasecmp): Don't assume size_t fits in unsigned int.
7535         Remove casts and duplicate code.
7536         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7537         (memcpy): Remove definition.
7538         Merge in some clean-up and optimization changes from glibc.
7539         [BLOCKSIZE]: Move definition to top of file.
7540         Ensure that it is a multiple of 64.
7541         Rearrange loop exit tests so as to avoid performing an
7542         additional fread after encountering an error or EOF.
7543         * md5.h (md5_uintptr): Define.
7544         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7545         return to the initial working directory.  Preserve errno
7546         for caller.
7547         * idcache.c: Include "xalloc.h".
7548         (xmalloc, xrealloc): Remove decls.
7549         (getuser): Remove casts no longer required in C89.
7550         * human.c: Include stdio.h, for sprintf.
7551         * group-member.c: Include "xalloc.h".
7552         (xmalloc, xrealloc): Remove decls.
7553         (get_group_info): Remove casts no longer required in C89.
7554         * getusershell.c (readname): Remove casts no longer required in C89.
7555         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7556         * getline.c: Whitespace fix, from coreutils.
7557
7558 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7559
7560         * exclude.c: Include <ctype.h>
7561         (IN_CTYPE_DOMAIN): New macro.
7562         (is_space): New fn.
7563         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7564         and empty lines.
7565
7566         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7567         Undo previous (whitespace-only) change.
7568
7569 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7570
7571         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7572         Normalize leading white space and remove trailing white space.
7573         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7574         notice, as per ../config/srclist-update.
7575
7576         Merge from coreutils.
7577         * euidaccess.h: New file.
7578         * euidaccess.c: Include it.
7579         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7580         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7581         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7582
7583 2003-08-11  Bruno Haible  <bruno@clisp.org>
7584
7585         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7586         (vasnprintf): Use it instead of wcslen.
7587
7588 2003-08-11  Bruno Haible  <bruno@clisp.org>
7589
7590         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7591         value to ensure that _Bool promotes to int. Use #define for _Bool when
7592         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7593
7594 2003-08-10  Karl Berry  <karl@gnu.org>
7595
7596         * regex.h: update from libc (whitespace fix).
7597
7598 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7599
7600         Merge some files from coreutils.  These changes were
7601         originally made by Jim Meyering.
7602         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7603         many older Unixes require this.
7604         * alloca.c (alloca): Remove cast to argument of free;
7605         no longer needed in C89.
7606         * alloca_.h, regex.h: Fix white space to match
7607         what GNU indent does.
7608
7609 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7610
7611         * bumpalloc.h: Remove.
7612
7613 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7614
7615         * getloadavg.c: Change copyright notice and spacing to conform to
7616         GNU coding style.
7617
7618         Merge from coreutils.
7619         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7620         From glibc.
7621         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7622         from Karl Berry, implemented by Jim Meyering.
7623         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7624         from Dmitry V. Levin.
7625         Remove anachronistic cast of xrealloc.
7626         * fnmatch_.h (__const): Remove.  Use 'const'.
7627         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7628         type. Otherwise, it wouldn't compile with at least /bin/cc on
7629         ymp-cray-unicos9.0.2.X.
7630         Combine two mostly-identical uses of alloca into one.
7631         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7632
7633 2003-08-04  Dave Love <d.love@dl.ac.uk>
7634
7635         [From Emacs.]
7636
7637         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7638         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7639         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7640         obsolete NLIST_NAME_UNION.
7641         [__GNU__]: Undef BSD and FSCALE.
7642         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7643
7644 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7645
7646         * stdbool_.h (_Bool): Make it signed char, instead of
7647         an enum type, so that it's guaranteed to promote to int.  See:
7648         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7649
7650 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7651
7652         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7653         (strerror): Don't assume that a printable int fits in 14 bytes.
7654
7655 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7656             Bruno Haible  <bruno@clisp.org>
7657
7658         * getline.h (getline, getdelim): Change return type to ssize_t.
7659         * getline.c (getline, getdelim): Likewise.
7660         Remove _GNU_SOURCE define; now it's defined in config.h through
7661         m4/getline.m4.
7662
7663 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7664
7665         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7666         over-parenthesization in macros.
7667
7668         Sync with coreutils.
7669
7670         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7671         required by C99.
7672
7673         Use `exit_failure' for xalloc and xmemcoll instead of their own
7674         private exit-failure variables.
7675         * xalloc.h (xalloc_exit_failure): Remove.
7676         * xmalloc.c: Likewise.  Include exitfail.h.
7677         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7678         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7679         * xmemcoll.c: Likewise.  Include exitfail.h.
7680         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7681
7682 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7683
7684         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7685         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7686         to test that it can stand by itself.  Include "exitfail.h".
7687         Clients should set exit_failure instead.
7688         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7689
7690 2003-07-18  Andreas Schwab  <schwab@suse.de>
7691
7692         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7693
7694 2003-07-18  Bruno Haible  <bruno@clisp.org>
7695
7696         * getndelim2.h: New file.
7697         * getndelim2.c: Make into a module of its own. Include config.h,
7698         getndelim2.h.
7699         (getndelim2): Make non-static. Change return type to ssize_t.
7700         * getline.h: Change argument names.
7701         * getline.c: Include getndelim2.h instead of getndelim2.c.
7702         * getnline.c: Include getndelim2.h.
7703
7704 2003-07-17  Bruno Haible  <bruno@clisp.org>
7705
7706         * Makefile.am: Remove file.
7707         * Makefile.in: Remove file.
7708
7709 2003-07-17  Bruno Haible  <bruno@clisp.org>
7710
7711         * getnline.h: New file.
7712         * getnline.c: New file.
7713         * getndelim2.c: New file, extracted from getline.c.
7714         (getndelim2): Renamed from getdelim2, with added nmax argument.
7715         * getline.c: Include getndelim2.c.
7716         (getdelim2): Moved out to getndelim2.c.
7717         (getline, getdelim): Update.
7718
7719 2003-07-15    <karl@gnu.org>
7720
7721         * vasnprintf.c: update from gettext.
7722
7723 2003-07-15  Jim Meyering  <jim@meyering.net>
7724
7725         * makepath.c (make_path): Enclose diagnostic in _(...).
7726
7727 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7728
7729         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7730         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7731         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7732         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7733         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7734         updated automatically by ../config/srclist-update.  This changes
7735         their license from LPGL to GPL.
7736
7737 2003-07-14  Jim Meyering  <jim@meyering.net>
7738
7739         Don't emit diagnostics.  Let callers do that.
7740         * save-cwd.c: Don't include "error.h".
7741         (save_cwd): Don't call error.  Ensure that errno is valid
7742         when returning nonzero.
7743
7744         * save-cwd.h (restore_cwd): Update prototype.
7745         * save-cwd.c (restore_cwd): Remove two parameters.
7746         Simplify.  Don't call error upon failure.  Let callers do that.
7747         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7748         when auditing is enabled.  But don't bother updating the #if.
7749
7750 2003-07-14  Simon Josefsson  <jas@extundo.com>
7751
7752         * mempcpy.h: New file.
7753         * mempcpy.c: New file.
7754
7755 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7756
7757         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7758         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7759         unicodeio.c, unicodeio.h, unlocked-io.h:
7760         Switch from LGPL to GPL.
7761
7762 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7763
7764         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7765         it breaks C++ compilation.
7766         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7767
7768 2003-07-10  Jim Meyering  <jim@meyering.net>
7769
7770         * vasnprintf.c: Remove trailing blanks.
7771         Make cpp indentation consistent.
7772
7773 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7774
7775         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7776         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7777         Switch from LGPL to GPL.
7778
7779 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7780
7781         * mktime.c: Fix some boundary cases and remove need for floating point.
7782
7783         Issue a compile-time diagnostic if time_t is floating point, or if
7784         two's complement arithmetic is not in effect, or if arithmetic
7785         right shift does not propagate the sign.  These assumptions were
7786         all in the original code but they weren't checked.
7787
7788         (TIME_T_MIDPOINT, verify): New macros.
7789         (__isleap): Remove; it has integer overflow problems.
7790         (leapyear): New function, without those problems.
7791         (ydhms_tm_diff): Remove; splitting into two parts.
7792         (ydhms_diff): New function, containing the arithmetic part of
7793         the old ydhms_tm_diff function.  Issue a compile-time
7794         diagnostic if we are not using C99 integer division.
7795         Avoid casts when possible.
7796         (guess_time_tm): New function, containing the checking part of
7797         the old ydhms_tm_diff function.  Return the new value, rather than
7798         the difference between it and the old.  Accept a new argument T
7799         so that *T specifies the old value.  Check for overflow in the result.
7800
7801         (__mktime_internal): Use a time_t offset, not a long int offset.
7802         This undoes the 2003-06-04 change, which is no longer needed now
7803         that we have better overflow checking.
7804         (localtime_offset): Likewise.
7805
7806         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7807         and long are 64-bit but int is only 32-bit.
7808         (ydhms_diff): Use long int to store year1 and yday1.
7809         Issue a compile-time diagnostic if long int is not wide enough.
7810
7811         (__mktime_internal): Use long int to store adjusted year and yday.
7812         Use plain C rather than preprocessor commands, if that doesn't
7813         affect efficiency.
7814         Check for overflow (and try to repair) after each probe
7815         rather than checking only at the very end.  This avoids some bugs
7816         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7817         does not equal GMT offset at maximum time).
7818         Use integer to check for overflow rather than floating point; this
7819         is more portable to non-IEEE hosts, and is a tad faster.
7820         When we detect that we are oscillating between two values,
7821         don't check whether tm_isdst has the requested value, since
7822         we already know the answer.  When tm_isdst has the wrong value,
7823         use a different heuristic to find the right one, based on the
7824         extreme values actually observed in practice in tz2003a,
7825         rather than the (overly optimistic) "previous 3 calendar quarters".
7826
7827         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7828         "T const" to accommodate glibc style.
7829         (check_result): Use less-confusing report format.  "long" -> "long int.
7830         (main): Likewise.
7831         Don't loop if the iteration overflows time_t.
7832         Allow a negative step in the iteration.
7833
7834 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7835
7836         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7837         having it depend on HAVE_SYS_TYPES_H.
7838
7839 2003-06-25  Bruno Haible  <bruno@clisp.org>
7840
7841         * readlink.c: New file.
7842
7843 2003-06-20  Bruno Haible  <bruno@clisp.org>
7844
7845         Assume C89, so PARAMS isn't needed.
7846         * unicodeio.h (PARAMS): Remove.
7847         * unicodeio.c: Don't use PARAMS.
7848
7849 2003-06-18  Jim Meyering  <jim@meyering.net>
7850
7851         Merge changes from coreutils.
7852         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7853         Remove explicit declarations of xmalloc and realloc.
7854         Include xalloc.h.
7855         (read_utmp): Remove anachronistic cast of xmalloc.
7856
7857 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7858
7859         Assume C89, so PARAMS isn't needed.
7860         * backupfile.h (PARAMS): Remove.  All uses removed.
7861         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7862         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7863         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7864         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7865         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7866         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7867         xstrtol.h: Likewise.
7868         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7869         same.h, strverscmp.h: Do not include config.h; no longer needed.
7870         Anyway, config.h should always be included before any other file.
7871
7872 2003-06-11  Simon Josefsson  <jas@extundo.com>
7873
7874         * sysexit_.h: New file.
7875
7876 2003-05-20  Derek Price  <derek@ximbiot.com>
7877
7878         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7879
7880 2003-06-10  Simon Josefsson  <jas@extundo.com>
7881
7882         * strchrnul.h: New file.
7883         * strchrnul.c: New file.
7884
7885 2003-06-10  Simon Josefsson <jas@extundo.com>
7886
7887         * argp.h: New file, from glibc.
7888         * argp-ba.c: New file, from glibc.
7889         * argp-eexst.c: New file, from glibc.
7890         * argp-fmtstream.c: New file, from glibc.
7891         * argp-fmtstream.h: New file, from glibc.
7892         * argp-fs-xinl.c: New file, from glibc.
7893         * argp-help.c: New file, from glibc.
7894         * argp-namefrob.h: New file, from glibc.
7895         * argp-parse.c: New file, from glibc.
7896         * argp-pv.c: New file, from glibc.
7897         * argp-pvh.c: New file, from glibc.
7898         * argp-xinl.c: New file, from glibc.
7899
7900 2003-06-07  Jim Meyering  <jim@meyering.net>
7901
7902         * readtokens.h: Put `Free Software Foundation, Inc.'
7903         in place of my name in the copyright comment.
7904         Remove definition and uses of __P.
7905
7906         From coreutils.
7907         * stat.c: Don't declare xmalloc explicitly.
7908         Instead, include "xalloc.h".
7909         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7910         xrealloc, and xcalloc return values.
7911         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7912         Improve comment.
7913         * xgetcwd.h: Remove definition/uses of PARAMS.
7914
7915 2003-06-06  Jim Meyering  <jim@meyering.net>
7916
7917         * stdbool_.h: Renamed from stdbool.h.in.
7918
7919 2003-06-06  Jim Meyering  <jim@meyering.net>
7920
7921         Merge from coreutils.
7922         * same.c: (same_name): Declare *_basename locals to be `const'.
7923         Consolidate declarations and initializations of *_base* locals.
7924
7925         Merge from coreutils.
7926         This avoids a core dump on systems without GNU putenv,
7927         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7928         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7929         (unsetenv): New static function, from GNU libc.
7930         (rpl_putenv): Use it.
7931
7932         * modechange.c: Remove trailing blanks.
7933
7934         Merge from coreutils.
7935         * fsusage.c: Remove declaration of statfs.
7936         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7937
7938         * posixtm.c: Include <stdbool.h> unconditionally.
7939
7940 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7941
7942         * mktime.c (__mktime_internal): When resolving a tm_isdst
7943         mismatch, look in future quarters as well as past.  This fixes a
7944         bug when processing fall-backwards gaps immediately after a long
7945         period of daylight-saving time.
7946
7947         * mktime.c: Assume freestanding C89 or better.
7948         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7949         (__P): Remove; not used.
7950         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7951         (mktime, not_equal_tm, print_tm, check_result,
7952         main): Use prototypes.  Use const * where appropriate.
7953         (main): Fix typo in testing code that uncovered by above changes.
7954         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7955
7956 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7957
7958         * mktime.c: Fix Debian bug 177940
7959         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7960         (localtime_offset): Now long int, not time_t, because we want it
7961         to be guaranteed to be signed.  All uses changed.
7962         (__mktime_internal): If overflow would occur when adding offset,
7963         don't add it.
7964
7965         Merge 'human' changes from coreutils.  Rewrite to support
7966         locale-specific notations like thousands separators.
7967         * human.c: Simplify authorship notice.
7968         Include human.h immediately after config.h.
7969         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7970         <limits.h>: Do not include, since human.h does.
7971         (SIZE_MAX, UINTMAX_MAX): New macros.
7972         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7973         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7974         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7975         (power_letter): Renamed from suffixes.
7976         (generate_suffix_backwards): Remove.
7977         (adjust_value): Now takes int style (because of human.h changes)
7978         and long double value (for greater precision on some platforms).
7979         (group_number): New function.
7980         (human_readable): Use it.  Use integer options, not enum.
7981         Put the options before the sizes in the arg list.
7982         Support all the new options.
7983         The old human_readable function has been removed;
7984         use inttostr.h instead.
7985         (human_readable, default_block_size, humblock):
7986         Use uintmax_t, not int, for block sizes.
7987         (human_readable_inexact, block_size_types): Remove.
7988         (block_size_opts): New constant.
7989         (human_options): Renamed from human_block_size, with new signature
7990         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7991         * human.h: Add copyright and authorship notice.
7992         Include <limits.h> and <stdbool.h> unconditionally.
7993         (PARAMS): Remove.  All uses removed.
7994         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7995         (enum human_inexact_style): Remove tag; now a nameless enum.
7996         (human_floor, human_ceiling, human_round_to_even): Now have
7997         values 2, 0, 1 rather than -1, 1, 0.
7998         (human_group_digits, human_suppress_point_zero, human_autoscale,
7999         human_base_1024, human_SI, human_B): New constants.
8000         (human_readable_inexact, human_block_size): Remove.
8001         (human_readable): Size args are now uintmax_t, not int.
8002         (human_options): New decl.
8003
8004         * exclude.c: (new_exclude, add_exclude): Remove casts that are
8005         unnecessary now that we assume C89 or better.  This change
8006         imported from coreutils.
8007
8008         * mktime.c (__mktime_internal): Do not reject negative timestamps
8009         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
8010         in the 2003-05-30 sync from glibc.
8011
8012         .h files should stand alone, but we shouldn't include <sys/types.h>
8013         if we can get away with just <stddef.h>.
8014
8015         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8016         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8017         rather than <sys/types.h>, as we merely need size_t.
8018         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8019         to get size_t.
8020         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8021         Include <stdio.h>, to get FILE.
8022         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8023         memcasecmp.h has included <stddef.h> and all we need is size_t.
8024         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8025         our interface, instead of including <sys/types.h>
8026
8027 2003-06-02  Paul Eggert  <eggert@twinsun.com>
8028
8029         [from coreutils]
8030         Fix some minor time-related bugs with POSIX time arguments.
8031         Some valid time stamps were being rejected (notably -1, and
8032         time stamps before 1900 on 64-bit hosts).  And some invalid
8033         time stamps were being accepted, e.g. September 31.
8034
8035         * posixtm.h (posixtime): Return bool instead of time_t, so
8036         that we can return (time_t) -1 successfully.
8037         * posixtm.c: Likewise.
8038         [HAVE_STDBOOL_H]: Include <stdbool.h>.
8039         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8040         (t): Remove static var.
8041         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8042         of static var.  All uses changed.
8043         (year): Do not reject years before 1900; they can occur with
8044         64-bit time_t.
8045         (posix_time_parse): Do not check for out-of-range components;
8046         that is now the caller's responsibility, since our checks were
8047         only approximations.
8048         (posixtime): Use mktime to check for out-of-range components,
8049         since it knows them exactly.
8050         If mktime returns (time_t) -1, check whether an error actually occurred
8051         by invoking localtime on -1.
8052         (main) [TEST_POSIXTIME]: Check for input data errors, and report
8053         posixtime failures better.
8054         Improve the test data (in comments only).
8055
8056 2003-05-30    <karl@gnu.org>
8057
8058         * mktime.c: update from libc.
8059
8060 2003-05-30  Bruno Haible  <bruno@clisp.org>
8061
8062         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8063         * localcharset.h: Likewise.
8064         * localcharset.c: Likewise.
8065
8066 2003-05-28  Paul Eggert  <eggert@twinsun.com>
8067
8068         Assume the headers required for C89 freestanding compilers.
8069         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8070         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8071         without checking for HAVE_LIMITS_H.
8072         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8073         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8074         to do that.
8075         * fatal.c: Include <stdarg.h> without checking for __STDC__.
8076         * exclude.c: Include <stdbool.h> unconditionally.
8077         * tempname.c: Include <stddef.h> unconditionally.
8078         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8079         * modechange.c, rpmatch.c (NULL): Don't define, since
8080         <stddef.h> does that.
8081         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8082         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8083         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8084         * xstrtol.c: Likewise.
8085         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8086         * savedir.c: Include <stddef.h> instead of defining NULL.
8087
8088         * addext.c (addext): Use assignment rather than cast, to avoid
8089         warnings on some platforms.
8090
8091         * mktime.c (__mktime_internal): Do not reject negative timestamps
8092         arbitrarily.
8093
8094 2003-05-10  Bruno Haible  <bruno@clisp.org>
8095
8096         * linebreak.c (iconv_string_length): Don't return -1 just because the
8097         string is longer than 4 KB.
8098
8099 2003-05-12  Jim Meyering  <jim@meyering.net>
8100
8101         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8102         the space-padded-by-default conversion specifiers, %e, %k, %l.
8103
8104 2003-05-03  Bruno Haible  <bruno@clisp.org>
8105
8106         Upgrade to Unicode-4.0.
8107         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8108         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8109         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8110         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8111         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8112         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8113         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8114         Change width of U+E0100..U+E01EF from 1 to 0.
8115
8116 2003-04-25  Bruno Haible  <bruno@clisp.org>
8117
8118         * copy-file.c: Include <stddef.h>, for size_t.
8119
8120 2003-04-25  Jim Meyering  <jim@meyering.net>
8121
8122         * copy-file.c (copy_file_preserving): Declare buf_size to be
8123         of type size_t, not int.
8124
8125 2003-04-11  Jim Meyering  <jim@meyering.net>
8126
8127         Merge changes from Coreutils.
8128
8129         2003-03-22  Jim Meyering  <jim@meyering.net>
8130
8131         * strftime.c (widen): Cast alloca return value to proper type.
8132
8133         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
8134
8135         From GNU libc.
8136         * strftime.c (my_strftime): Handle very large width
8137         specifications for numeric values correctly.  Improve checks for
8138         overflow.
8139
8140         2003-01-19  Jim Meyering  <jim@meyering.net>
8141
8142         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8143         (nl_get_alt_digit) [! defined my_strftime]: Define.
8144         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8145         _nl_get_alt_digit and _nl_get_walt_digit.
8146
8147         * strftime.c (my_strftime): Merge in locale-related changes from libc.
8148         These changes have no effect outside of _LIBC.
8149
8150 2003-04-10  Bruno Haible  <bruno@clisp.org>
8151
8152         * findprog.h: New file, from GNU gettext.
8153         * findprog.c: New file, from GNU gettext.
8154
8155 2003-04-05  Jim Meyering  <jim@meyering.net>
8156
8157         Merge changes from Coreutils.
8158
8159         * exclude.h (PARAMS): Remove definition and uses.
8160         * exclude.c: Remove uses of `PARAMS'.
8161
8162         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8163         Add test-cases for DOS filenames. Declare program_name.
8164         (main): Set up program_name.  Patch by Rich Dawe.
8165
8166         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8167         error from mntctl.
8168         Use mntctl's return value to drive the entry-processing loop, since
8169         we can't rely on the value of the vmt_length member in the last
8170         entry.  On some systems doing so could result in exhausting
8171         virtual memory.  Based in part on a patch from Mike Jetzer.
8172
8173 2003-04-04  Bruno Haible  <bruno@clisp.org>
8174
8175         * linebreak.h: New file, from GNU gettext.
8176         * linebreak.c: New file, from GNU gettext with slight modifications.
8177         * lbrkprop.h: New file, from GNU gettext.
8178
8179 2003-04-03  Bruno Haible  <bruno@clisp.org>
8180
8181         * utf8-ucs4.h: New file, from GNU gettext.
8182         * utf16-ucs4.h: New file, from GNU gettext.
8183         * ucs4-utf8.h: New file, from GNU gettext.
8184         * ucs4-utf16.h: New file, from GNU gettext.
8185
8186 2003-04-02  Bruno Haible  <bruno@clisp.org>
8187
8188         * binary-io.h: New file, from GNU gettext.
8189
8190 2003-04-01  Bruno Haible  <bruno@clisp.org>
8191
8192         * pathname.h: New file, from GNU gettext.
8193         * concatpath.c: New file, from GNU gettext.
8194
8195 2003-03-30  Bruno Haible  <bruno@clisp.org>
8196
8197         * copy-file.c (copy_file_preserving): Don't set owner if the function
8198         chown() doesn't exist.
8199
8200 2003-03-28  Bruno Haible  <bruno@clisp.org>
8201
8202         * copy-file.h: New file, from GNU gettext.
8203         * copy-file.c: New file, from GNU gettext.
8204
8205 2003-03-18  Jim Meyering  <jim@meyering.net>
8206
8207         * quote.c (quote_n): Fix typo in comment.
8208
8209 2003-03-14  Jim Meyering  <jim@meyering.net>
8210
8211         Merge changes from Coreutils.
8212         * obstack.h (obstack_object_size): Declare temporary, __o,
8213         to be const, in order to avoid warnings.
8214         (obstack_room): Likewise.
8215         (obstack_empty_p): Likewise.
8216
8217 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8218
8219         Merge changes from Bison.
8220         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8221         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8222         when compiling Bison 1.875's `bitset bset = obstack_alloc
8223         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8224         * hash.c: Include <stdbool.h> unconditionally.
8225
8226 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8227
8228         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8229         Reported by Bruce Becker; see:
8230         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8231
8232 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8233             Bruno Haible  <bruno@clisp.org>
8234
8235         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8236         Reported by John Hughes, see
8237         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8238
8239 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8240
8241         * poll_.h: New file.
8242         * poll.c: New file.
8243
8244 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8245
8246         * mathl.h: New file.
8247         * acosl.c: New file.
8248         * asinl.c: New file.
8249         * atanl.c: New file.
8250         * ceill.c: New file.
8251         * cosl.c: New file.
8252         * expl.c: New file.
8253         * floorl.c: New file.
8254         * frexpl.c: New file.
8255         * ldexpl.c: New file.
8256         * logl.c: New file.
8257         * sincosl.c: New file.
8258         * sinl.c: New file.
8259         * sqrtl.c: New file.
8260         * tanl.c: New file.
8261         * trigl.c: New file.
8262         * trigl.h: New file.
8263
8264 2003-02-17  Bruno Haible  <bruno@clisp.org>
8265
8266         * mkdtemp.h: New file, from GNU gettext.
8267         * mkdtemp.c: New file, from GNU gettext.
8268
8269 2003-01-31  Bruno Haible  <bruno@clisp.org>
8270
8271         * rename.c: #undef rename before defining rpl_rename.
8272         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8273
8274 2003-01-30  Bruno Haible  <bruno@clisp.org>
8275
8276         * printf-args.h: New file, from GNU gettext.
8277         * printf-args.c: New file, from GNU gettext.
8278         * printf-parse.h: New file, from GNU gettext.
8279         * printf-parse.c: New file, from GNU gettext.
8280         * vasnprintf.h: New file, from GNU gettext.
8281         * vasnprintf.c: New file, from GNU gettext.
8282         * asnprintf.c: New file, from GNU gettext.
8283         * vasprintf.h: New file, from GNU gettext with modifications.
8284         * vasprintf.c: New file, from GNU gettext.
8285         * asprintf.c: New file, from GNU gettext.
8286
8287 2003-01-29  Bruno Haible  <bruno@clisp.org>
8288
8289         * stpncpy.h: New file, from GNU gettext with modifications.
8290         * stpncpy.c: New file, from GNU gettext with modifications.
8291
8292 2003-01-28  Bruno Haible  <bruno@clisp.org>
8293
8294         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8295         Paul Eggert.
8296         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8297         Paul Eggert.
8298
8299 2003-01-27  Bruno Haible  <bruno@clisp.org>
8300
8301         * xsetenv.h: New file, from GNU gettext.
8302         * xsetenv.c: New file, from GNU gettext.
8303
8304 2003-01-23  Bruno Haible  <bruno@clisp.org>
8305
8306         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8307
8308 2003-01-22  Bruno Haible  <bruno@clisp.org>
8309
8310         * exit.h: New file, from GNU gettext.
8311
8312 2003-01-11  Bruno Haible  <bruno@clisp.org>
8313
8314         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8315         * strcase.h (strcasecmp, strncasecmp): Likewise.
8316
8317 2003-01-14  Jim Meyering  <jim@meyering.net>
8318
8319         * same.c (same_name): Tweak a comment.
8320
8321 2003-01-11  Bruno Haible  <bruno@clisp.org>
8322
8323         * same.c (same_name): Reorder tests so as to avoid calling stat()
8324         when a string comparison is sufficient.
8325
8326 2003-01-11  Bruno Haible  <bruno@clisp.org>
8327
8328         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8329         'unsigned int'.
8330
8331 2003-01-11  Bruno Haible  <bruno@clisp.org>
8332
8333         * hash-pjw.c: Add comment about low quality of this function.
8334
8335 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8336
8337         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8338         to avoid collisions with libcurses and libreadline.
8339
8340         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8341         * getstr.h, getstr.c: Remove.
8342         * getline.c: Include "getline.h", to check interface.
8343         Move body of old getstr.c here: this defines MIN_CHUNK and
8344         declares getdelim2, which is renamed from getstr.
8345         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8346
8347         * linebuffer.c (readlinebuffer): Renamed from readline.
8348         All uses changed.
8349         * linebuffer.h: Likewise.
8350         (readline): Remove backward-compatibility macro.
8351
8352 2003-01-12  Jim Meyering  <jim@meyering.net>
8353
8354         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8355
8356 2003-01-10  Bruno Haible  <bruno@clisp.org>
8357
8358         * alloca_.h: New file.
8359         * getdate.y: Unconditionally include alloca.h.
8360         * makepath.c: Likewise.
8361         * setenv.c: Likewise.
8362         * userspec.c: Likewise.
8363
8364 2003-01-09  Bruno Haible  <bruno@clisp.org>
8365
8366         * stdbool.h.in: New file.
8367
8368 2003-01-08  Bruno Haible  <bruno@clisp.org>
8369
8370         * safe-read.c: Include specification header first, to ensure its
8371         selfcontainedness.
8372         * full-write.c: Likewise.
8373
8374 2003-01-08  Jim Meyering  <jim@meyering.net>
8375
8376         * full-write.c: Undefine and define-away `const' after inclusion
8377         of errno.h, not before.  Suggestion from Bruno Haible.
8378
8379 2003-01-07  Jim Meyering  <jim@meyering.net>
8380
8381         * full-write.c: Rework so that it may serve to define full_read, too.
8382         * full-read.c: Simply #define FULL_READ and include full-write.c.
8383
8384 2003-01-06  Jim Meyering  <jim@meyering.net>
8385
8386         * version-etc.c: Update year in translatable copyright string.
8387
8388 2002-12-25  Bruno Haible  <bruno@clisp.org>
8389
8390         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8391         * xstrtol.h: Likewise.
8392         * xstrtoimax.c: Likewise.
8393         * xstrtoumax.c: Likewise.
8394         * human.h: Likewise.
8395
8396         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8397         on systems that have <inttypes.h> but not <stdint.h>.
8398
8399 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8400
8401         * memcoll.c (memcoll): Fall back on a simple algorithm using
8402         memcmp if strcoll doesn't work.
8403
8404 2002-12-23  Bruno Haible  <bruno@clisp.org>
8405
8406         * localcharset.h: New file.
8407         * localcharset.c: Include it.
8408         * unicodeio.c: Likewise.
8409
8410 2002-12-22  Bruno Haible  <bruno@clisp.org>
8411
8412         * utime.c (utime_null): No need to call ftruncate if the file was
8413         nonempty.
8414
8415 2002-12-23  Bruno Haible  <bruno@clisp.org>
8416
8417         * memcoll.c (STRCOLL): New macro.
8418         (memcoll): Use it.
8419
8420 2002-12-22  Bruno Haible  <bruno@clisp.org>
8421
8422         * getstr.h (getstr): Define, to avoid clash with libcurses.
8423         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8424
8425 2002-12-22  Bruno Haible  <bruno@clisp.org>
8426
8427         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8428
8429 2002-12-23  Bruno Haible  <bruno@clisp.org>
8430
8431         * getline.h: Include <stddef.h>, for size_t.
8432
8433         * unicodeio.h: Include <stddef.h>, for size_t.
8434         * unicodeio.c: Don't include <stddef.h>.
8435
8436 2002-12-17  Bruno Haible  <bruno@clisp.org>
8437
8438         * canon-host.c (strdup): Remove unused declaration.
8439
8440         * fsusage.c: Include full_read.h.
8441         (get_fs_usage): Use full_read instead of safe_read.
8442
8443         * utime.c (utime_null): Use SAFE_READ_ERROR.
8444
8445 2002-12-11  Bruno Haible  <bruno@clisp.org>
8446
8447         * setenv.h: Rewritten to cope with systems that have setenv() but not
8448         unsetenv().
8449         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8450         modifications:
8451
8452         2002-12-11  Bruno Haible  <bruno@clisp.org>
8453
8454                 * setenv.c (alloca): Fall back to malloc.
8455                 (freea): New macro.
8456                 (setenv): Use freea() to free memory allocated with alloca().
8457
8458         2002-11-13  Bruno Haible  <bruno@clisp.org>
8459
8460                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8461                 function declarations.
8462                 * unsetenv.c (unsetenv): Likewise.
8463
8464         2002-03-04  Bruno Haible  <bruno@clisp.org>
8465
8466                 Portability to AIX 4.3.3.
8467                 * unsetenv.c: New file, extracted from setenv.c.
8468                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8469
8470         2001-12-20  Bruno Haible  <bruno@clisp.org>
8471
8472                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8473                 use malloc instead. For SunOS 4.
8474
8475         2001-12-11  Bruno Haible  <bruno@clisp.org>
8476
8477                 * setenv.c: Declare alloca.
8478                 (compar_fn_t): New typedef.
8479                 (KNOWN_VALUE, STORE_VALUE): Use it.
8480
8481         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8482         setenv.h.
8483
8484 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8485
8486         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8487         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8488         Choose values that are less likely to collide with system fnmatch
8489         options.
8490         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8491         defined (e.g., a pure POSIX system).
8492         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8493         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8494
8495 2002-12-06  Jim Meyering  <jim@meyering.net>
8496
8497         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8498
8499         Merge in changes from libc's misc/error.c, in preparation
8500         for the merge of gnulib's changes back into libc.
8501
8502         * error.c (_): Define only if not already defined.
8503         Move definition to follow all #include directives.
8504         Include unlocked-io.h only if !_LIBC.
8505         [_LIBC]: Include <libio/libioP.h>.
8506         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8507         (fflush): Tweak definition to use INTUSE.
8508         (putc): Define.
8509
8510 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8511
8512         * alloca.c [defined emacs]: Include "lisp.h".
8513         (xalloc_die) [defined emacs]: New macro.
8514         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8515         [! defined emacs]: Include <xalloc.h>.
8516         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8517         (pointer): Typedef to POINTER_TYPE *.
8518         (malloc): Remove decl; we now always use xmalloc.
8519         (alloca): Use old-style definition, since Emacs needs this.
8520         Check for arithmetic overflow when computing combined size.
8521
8522 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8523
8524         Do not generate unlocked-io.h automatically, since it's easier to
8525         maintain it by hand.
8526
8527         * unlocked-io.h: New file, from GNU diffutils,
8528         but with proper copyright notice and attribution.
8529         * gen-uio: Remove.
8530         * Makefile.am: Add copyright notice.
8531         (libfetish_a_SOURCES): Add unlocked-io.h.
8532         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8533         (DISTCLEANFILES, io_functions): Remove macros.
8534         (EXTRA_DIST): Remove gen_uio.
8535         (unlocked-io.h): Remove rule.
8536
8537 2002-12-04  Jim Meyering  <jim@meyering.net>
8538
8539         Reflect the fact that stat.c and lstat.c are no longer generated.
8540         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8541         (DISTCLEANFILES): Likewise.
8542         (EXTRA_DIST): Likewise.
8543         (all_local): Don't depend on stat.c or lstat.c.
8544         (stat.c, lstat.c): Remove rules.
8545         (EXTRA_DIST): Remove xstat.in.
8546
8547         * xstat.in: Remove file.  Contents moved into stat.c.
8548         * stat.c: New file.  Contents mostly from xstat.in.
8549         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8550         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8551
8552         * safe-read.c: Rework so that it may serve to define safe_write, too.
8553         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8554
8555 2002-12-03  Jim Meyering  <jim@meyering.net>
8556
8557         * safe-read.c, safe-write.c: Change variable names and comments, but
8558         not semantics, to minimize the differences between these two files.
8559         (safe_read): Change comment to mention SAFE_READ_ERROR.
8560
8561         * safe-read.c (IS_EINTR): Define.
8562         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8563
8564 2002-12-02  Bruno Haible  <bruno@clisp.org>
8565
8566         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8567         Define, taken from safe-read.c.
8568         (INT_MAX): Provide fallback.
8569         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8570         * safe-write.h (SAFE_WRITE_ERROR): Define.
8571
8572         * safe-read.c (EINTR): Remove definition.
8573         (safe_read): Don't use EINTR if it is absent.
8574
8575 2002-12-02  Jim Meyering  <jim@meyering.net>
8576
8577         * safe-read.c (EINTR): Define.
8578         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8579         (INT_MAX): Provide fallback.
8580         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8581
8582         * safe-read.h (SAFE_READ_ERROR): Define.
8583
8584 2002-12-01  Jim Meyering  <jim@meyering.net>
8585
8586         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8587         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8588
8589 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8590
8591         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8592         hash_rehash): Replace `if (limit <= value) abort ();' with
8593         `if (! (value < limit)) abort ();', for readability.
8594
8595 2002-11-26    <karl@gnu.org>
8596
8597         * strdup.c: copy from libc again, with jim's ok.
8598         * .cppi-disable: re-add strdup.c
8599
8600 2002-11-25    <karl@gnu.org>
8601
8602         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8603         instead of "strtol.c".
8604
8605 2002-11-25  Jim Meyering  <jim@meyering.net>
8606
8607         * mktime.c: Sync from libc, now that it has the latest fix.
8608
8609 2002-11-24    <karl@gnu.org>
8610
8611         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8612         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8613
8614 2002-11-24  Jim Meyering  <jim@meyering.net>
8615
8616         Update from coreutils:
8617
8618         * mktime.c: Merge in changes from libc.
8619
8620         Avoid a link-time failure on some Linux systems.
8621         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8622         (__mon_yday): Declare with the STATIC attribute.
8623         (__mktime_internal): Likewise.
8624         Based on a report from Greg Schafer.
8625
8626 2002-11-23  Jim Meyering  <jim@meyering.net>
8627
8628         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8629         Use `unsigned', not `int', as type of index.
8630
8631         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8632
8633         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8634
8635 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8636
8637         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8638         hint that one should use `if (! x) abort ();' rather than `assert
8639         (x);', and anyway it's one less thing to worry about configuring.
8640         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8641         hash_rehash, hash_insert): Use abort rather than assert.
8642
8643 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8644
8645         * quotearg.h: Allow multiple inclusion by surrounding with
8646         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8647         so that we can be included first.
8648         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8649         * quotearg.c: Include quotearg.h immediately after config.h.
8650         No need to include stddef.h or sys/types.h any more.
8651         Surround local include files with "", not "<>".
8652         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8653         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8654         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8655         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8656         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8657         (ISPRINT): Remove; no longer needed now that we assume C89.
8658
8659         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8660         Preserve errno.
8661
8662         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8663         quotearg_char): Use SIZE_MAX rather than
8664         (size_t) -1 when we are talking about "infinity".
8665
8666         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8667
8668 2002-11-22  Bruno Haible  <bruno@clisp.org>
8669
8670         * safe-read.h: Assume C89. Add comments.
8671         (safe_read): Change return type to size_t.
8672         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8673         counts > SSIZE_MAX correctly.
8674         * safe-write.h: New file.
8675         * safe-write.c: New file.
8676         * full-read.h: New file.
8677         * full-read.c: New file.
8678         * full-write.h: Assume C89. Add comments.
8679         * full-write.c: Include safe-write.h.
8680         (full_write): Rewritten to use safe_write.
8681         Suggested by Jim Meyering and Paul Eggert.
8682
8683 2002-11-21  Bruno Haible  <bruno@clisp.org>
8684
8685         Remove case insensitive option matching.
8686         * argmatch.h (argcasematch): Remove declaration.
8687         (ARGCASEMATCH): Remove macro.
8688         (__xargmatch_internal): Remove case_sensitive argument.
8689         (XARGMATCH): Update.
8690         (XARGCASEMATCH): Remove macro.
8691         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8692         case_sensitive argument.
8693         (argcasematch): Remove function.
8694         (__xargmatch_internal): Remove case_sensitive argument.
8695         (main): Use XARGMATCH instead of XARGCASEMATCH.
8696
8697         * xmalloc.c: Change compile-time error message. Add comment about
8698         required autoconf version.
8699
8700 2002-11-21  Jim Meyering  <jim@meyering.net>
8701
8702         * strdup.c (strdup): Tweak comment and initial #if/#include.
8703
8704         Merge in changes from the coreutils.
8705
8706         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8707         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8708         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8709         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8710         int.  Work more efficiently if X is the same width as uintmax_t.
8711         Do not compare X to -1, to avoid bogus compiler warning.
8712         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8713         Don't assume that f_frsize and f_bsize are the same type.
8714
8715         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8716         on FreeBSD.
8717
8718         * makepath.c (make_path): Restore umask *before* creating the final
8719         component.
8720         (make_path): Minor reformatting.
8721
8722         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8723         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8724
8725         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8726         ones.  At least on GNU/Linux systems, `auto' means something else.
8727         From Michael Stone.
8728
8729 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8730
8731         Merge argmatch cleanups from Bison.  Assume C89.
8732
8733         * argmatch.c: Include config.h here, not in argmatch.h.
8734         Include stdlib.h, for EXIT_FAILURE.
8735         Always include <string.h>, since we assume C89.
8736         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8737         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8738         Include <stddef.h> instead, since it's all we need for size_t.
8739         (PARAMS): Remove.  All uses removed.
8740         (ARRAY_CARDINALITY): Do not bother to #undef.
8741         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8742         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8743         Remove unnecessary parentheses.
8744         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8745         Insert necessary parentheses.
8746         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8747         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8748
8749 2002-11-19  Bruno Haible  <bruno@clisp.org>
8750
8751         * mbswidth.c: Include mbswidth.h right at the beginning.
8752         * mbswidth.h: Include <stddef.h>, for size_t.
8753
8754         * mbswidth.h (PARAMS): Remove macro.
8755         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8756         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8757
8758         * gcd.h (PARAMS): Remove macro.
8759         (gcd): Use ANSI C function declarations.
8760         * gcd.c (gcd): Likewise.
8761
8762 2002-11-15  Bruno Haible  <bruno@clisp.org>
8763
8764         * strcspn.c: Include <stddef.h>.
8765         (strcspn): Use ANSI C function declaration. Change return type to
8766         size_t. Use NULL.
8767         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8768         (strpbrk): Use NULL.
8769         * strpbrk.h (PARAMS): Remove macro.
8770         (strpbrk): Use ANSI C function declaration.
8771         * strstr.c: Don't include <sys/types.h>.
8772         * strstr.h (PARAMS): Remove macro.
8773         (strstr): Use ANSI C function declarations.
8774
8775 2002-11-06  Bruno Haible  <bruno@clisp.org>
8776
8777         * gcd.h (gcd): Change argument type to 'unsigned long'.
8778         * gcd.c (gcd): Likewise.
8779
8780 2002-11-05  Bruno Haible  <bruno@clisp.org>
8781
8782         * gcd.h: New file, from gettext-0.11.5.
8783         * gcd.c: New file, from gettext-0.11.5.
8784
8785 2002-11-05  Bruno Haible  <bruno@clisp.org>
8786
8787         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8788         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8789         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8790         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8791
8792         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8793         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8794
8795         * closeout.c: Include gettext.h instead of <libintl.h>.
8796         * human.c: Include gettext.h instead of <libintl.h>.
8797         * quotearg.c: Include gettext.h instead of <libintl.h>.
8798         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8799         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8800         * userspec.c: Include gettext.h instead of <libintl.h>.
8801         * version-etc.c: Include gettext.h instead of <libintl.h>.
8802         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8803         (textdomain): Remove definition.
8804         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8805
8806         * long-options.c: Remove include of <libintl.h> and definition of _.
8807         * same.c: Remove include of <libintl.h> and definition of _.
8808
8809 2002-11-04  Bruno Haible  <bruno@clisp.org>
8810
8811         * stpcpy.h: New file, from GNU gettext-0.11.5.
8812         * strcase.h: New file, from GNU gettext-0.11.5.
8813         * strpbrk.h: New file, from GNU gettext-0.11.5.
8814         * strstr.h: New file, from GNU gettext-0.11.5.
8815         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8816
8817 2002-05-09  Bruno Haible  <bruno@clisp.org>
8818
8819         * config.charset: Update for newest glibc. Add canonical names
8820         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8821
8822 2002-05-09  Bruno Haible  <bruno@clisp.org>
8823
8824         * localcharset.c (get_charset_aliases): Add more Windows specific
8825         aliases.
8826
8827 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8828
8829         * config.charset: A few additions for Solaris.
8830
8831 2001-12-05  Bruno Haible  <bruno@clisp.org>
8832
8833         * localcharset.c (locale_charset): Don't return an empty string.
8834
8835 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8836
8837         * config.charset: msdos in uk_UA uses CP1125.
8838
8839 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8840
8841         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8842         * localcharset.c (locale_charset): Declare as extern "C".
8843
8844 2002-02-15  Bruno Haible  <bruno@clisp.org>
8845
8846         * config.charset [msdosdjgpp]: For Russian, use CP866.
8847
8848 2002-02-11  Bruno Haible  <bruno@clisp.org>
8849
8850         * config.charset: Add support for NetBSD.
8851
8852 2002-09-25    <karl@gnu.org>
8853
8854         * strdup.c: copy from libc/string (via ../config/srclist*).
8855         * getopt*: copy from libc/posix.
8856         * gettext.h: copy from gettext.
8857         * .cppi-disable: add strdup.c, gettext.h.
8858
8859 2002-07-01  Jim Meyering  <meyering@lucent.com>
8860
8861         * c-stack.c: Include sys/time.h.
8862         From Volker Borchert.
8863
8864 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8865
8866         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8867         New macro.  Use it uniformly instead of
8868         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8869         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8870         reported by Vin Shelton.
8871
8872 2002-06-22  Jim Meyering  <meyering@lucent.com>
8873
8874         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8875         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8876
8877 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8878
8879         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8880         Do not assume SA_SIGINFO behavior.
8881         Bug reported by Jim Meyering on NetBSD 1.5.2.
8882
8883 2002-06-22  Jim Meyering  <meyering@lucent.com>
8884
8885         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8886
8887         * exitfail.c, exitfail.h: Likewise.
8888         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8889
8890         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8891         of fnmatch.h.
8892         (EXTRA_DIST): Add fnmatch_loop.c.
8893         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8894
8895         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8896         * fnmatch.c: Update from diffutils-2.8.2.
8897         * fnmatch_.h: New file.  From diffutils-2.8.2.
8898         * fnmatch.h: Remove file.
8899
8900 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8901
8902         * file-type.h: Report an error if neither S_ISREG nor
8903         S_IFREG is defined, instead of using a test specific to glibc
8904         2.2.  This should be safe, since POSIX requires S_ISREG and
8905         Unix Version 7 had S_IFREG.  We don't need to check for
8906         <sys/types.h> since we don't use any symbols that it defines.
8907
8908 2002-06-15  Jim Meyering  <meyering@lucent.com>
8909
8910         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8911         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8912         have been included before this file.
8913
8914 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8915
8916         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8917         so that each temporary file name is unique and valid in the first
8918         8 characters, for operation under DOS.
8919
8920 2002-06-15  Jim Meyering  <meyering@lucent.com>
8921
8922         Work even with DJGPP 2.03, which lacks support for symlinks.
8923         From Richard Dawe.
8924         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8925         is defined.
8926         * lchown.c (S_ISLNK): Likewise.
8927
8928 2002-06-14  Jim Meyering  <meyering@lucent.com>
8929
8930         * file-type.h: Use the version from diffutils-2.8.2.
8931         * file-type.c: Likewise.
8932
8933 2002-05-27  Jim Meyering  <meyering@lucent.com>
8934
8935         Fix a problem seen only on nonconforming systems whereby ls.c's
8936         use of localtime, and then of gettimeofday would cause trouble:
8937         the localtime call used to initialize rpl_gettimeofday's save
8938         mechanism would clobber ls's current local time information so
8939         that in any long listing the first file would always be listed
8940         with date 1970-01-01.  Analysis by Volker Borchert.
8941
8942         * gettimeofday.c (localtime): Undefine.
8943         (rpl_localtime): New function.
8944
8945 2002-05-22  Jim Meyering  <meyering@lucent.com>
8946
8947         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8948         * file-type.h: New file.
8949         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8950
8951 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8952
8953         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8954
8955 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8956
8957         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8958         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8959         of 127, since 64 is the largest conceivable number for ancient
8960         nonstandard hosts.
8961         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8962
8963 2002-04-28  Jim Meyering  <meyering@lucent.com>
8964
8965         * sig2str.c (WTERMSIG): Remove definition (unused).
8966
8967 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8968
8969         * sig2str.h, sig2str.c: New files.
8970         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8971
8972 2002-04-24  Jim Meyering  <meyering@lucent.com>
8973
8974         * gettext.h: New file, from Gettext.
8975         * Makefile.am (INCLUDES): Remove -I../intl.
8976         (libfetish_a_SOURCES): Add gettext.h.
8977
8978 2002-04-16  Jim Meyering  <meyering@lucent.com>
8979
8980         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8981         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8982         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8983
8984 2002-04-12  Jim Meyering  <meyering@lucent.com>
8985
8986         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8987
8988 2002-03-10  Jim Meyering  <meyering@lucent.com>
8989
8990         * makepath.c (make_path): Remove a comma from a diagnostic.
8991         Suggestion from Santiago Vila.
8992
8993 2002-03-08  Jim Meyering  <meyering@lucent.com>
8994
8995         * rename.c: Mention that this wrapper is needed also on
8996         mips-dec-ultrix4.4 systems.
8997
8998 2002-03-02  Jim Meyering  <meyering@lucent.com>
8999
9000         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
9001         not HAVE_CLOCK_SETTIME.
9002
9003 2002-02-27  Paul Eggert  <eggert@twinsun.com>
9004
9005         * nanosleep.h: Rename to....
9006         * timespec.h: New name for nanosleep.h.  All uses changed.
9007
9008         * gettime.c: New file.
9009         * settime.c: New file.
9010         * stime.c: Remove.
9011
9012         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9013         timespec.h.  Remove nanosleep.h.
9014
9015 2002-02-25  Paul Eggert  <eggert@twinsun.com>
9016
9017         * acl.c, acl.h: New files.
9018         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9019
9020 2002-02-24  Jim Meyering  <meyering@lucent.com>
9021
9022         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9023         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9024         cause trouble.  Reported by Nelson Beebe.
9025
9026 2002-02-23  Paul Eggert  <eggert@twinsun.com>
9027
9028         * path-concat.c (xpath_concat): Reorder code to pacify
9029         compilers that don't know that xalloc_die never returns.
9030
9031 2002-02-20  Jim Meyering  <meyering@lucent.com>
9032
9033         * getdate.c: Regenerate using bison-1.33.
9034
9035 2002-02-15  Paul Eggert  <eggert@twinsun.com>
9036
9037         * posixver.c, posixver.h: New files.
9038         * Makefile.am (libfetish_a_SOURCES): Add them.
9039
9040 2002-02-02  Paul Eggert  <eggert@twinsun.com>
9041             Bruno Haible  <bruno@clisp.org>
9042
9043         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9044         (fwrite_success_callback): New declaration.
9045         * unicodeio.c (unicode_to_mb): New function, extracted from
9046         print_unicode_char. Call failure callback instead of error.
9047         (fwrite_success_callback): New function.
9048         (exit_failure_callback): New function.
9049         (fallback_failure_callback): New function.
9050         (print_unicode_char): Call unicode_to_mb.
9051
9052 2002-01-26  Jim Meyering  <meyering@lucent.com>
9053
9054         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9055
9056 2002-01-22  Jim Meyering  <meyering@lucent.com>
9057
9058         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9059         Otherwise, some versions of automake would omit the rule that makes
9060         Makefile from Makefile.in.
9061
9062 2001-01-21  Paul Eggert  <eggert@twinsun.com>
9063
9064         * xmemcoll.h, xmemcoll.c: New files.
9065         * Makefile.am (libfetish_a_SOURCES): Add them.
9066         * memcoll.c: Include errno.h, and declare errno if not defined.
9067         (memcoll): Set errno to zero if there is no error.
9068
9069         * quotearg.c (quotearg_buffer_restyled):
9070         Fix bug with quoting buffers containing NUL when backslashing escapes.
9071         This bug was exposed by the other changes in this patch.
9072         (quotearg_n_options): New arg ARGSIZE.
9073         All callers changed.
9074         (quoting_options_from_style): New function.
9075         (quotearg_n_style): Use it.
9076         (quotearg_n_style_mem): New function.
9077
9078         * quotearg.h (quotearg_n_style_mem): New function.
9079
9080 2002-01-16  Jim Meyering  <meyering@lucent.com>
9081
9082         * getdate.y: Add three semicolons, each just before a closing brace.
9083         Bison (as of version 1.31) no longer papers over that mistake.
9084
9085 2002-02-14  Paul Eggert  <eggert@twinsun.com>
9086
9087         * backupfile.c (ISDIGIT): Comment fix.
9088         * getdate.y (ISDIGIT): Likewise.
9089         * posixtm.c (ISDIGIT, year): Likewise.
9090         * strverscmp.c (ISDIGIT): Likewise.
9091         * userspec.c (ISDIGIT): Likewise.
9092
9093 2002-01-05  Jim Meyering  <meyering@lucent.com>
9094
9095         * version-etc.c (version_etc_copyright): Update copyright year.
9096
9097 2001-01-19  Paul Eggert  <eggert@twinsun.com>
9098
9099         * closeout.c (close_stdout_status): If ferror (stdout), do
9100         not silently exit merely because the output buffer happens to
9101         have nothing pending.
9102
9103 2001-12-18  Paul Eggert  <eggert@twinsun.com>
9104
9105         See the big note in ../ChangeLog.
9106         * human.c (suffixes): Prefer K to k for 1024.
9107         (generate_suffix_backwards): New function.
9108         (human_readable_inexact): Use it.
9109         * xstrtol.c (__xstrtol): If there is no number but there
9110         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
9111         Accept 'K' as well as 'k'.
9112
9113 2001-12-15  Jim Meyering  <meyering@lucent.com>
9114
9115         * regex.h (__restrict_arr): Update from libc.
9116
9117         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9118         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
9119         (STREQ): Define.
9120
9121 2001-12-10  Jim Meyering  <meyering@lucent.com>
9122
9123         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9124         Instead, include "xalloc.h".
9125         (initbuffer): Don't cast xmalloc return value to char*.
9126         (readline): Reword comment.
9127         Don't cast xrealloc return value to char*
9128         Return NULL, not 0.
9129
9130 2001-12-09  Jim Meyering  <meyering@lucent.com>
9131
9132         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9133         `signed and unsigned type in conditional expression'.
9134         * posixtm.c (posix_time_parse): Likewise.
9135
9136         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9137
9138         * readtokens.c (readtoken): Declare an index to be of type unsigned
9139         to avoid a pedantic warning.
9140
9141         * getstr.c: Don't include assert.h.
9142         (getstr): Remove warning-evoking assertions.
9143         Return -1 if offset parameter is out of bounds.
9144         Change the type of a local from int to size_t.
9145
9146         * strftime.c (my_strftime_localtime_r): Include this function
9147         definition in the `#if ! HAVE_TM_GMTOFF' block.
9148
9149         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9150         Include xalloc.h instead.
9151
9152 2001-12-02  Jim Meyering  <meyering@lucent.com>
9153
9154         * tempname.c: Don't declare getenv, thus reverting the change of
9155         2001-11-18.  It's no longer necessary, now that stdlib.h is always
9156         included.
9157
9158         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9159         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
9160
9161 2001-11-30  Akim Demaille  <akim@epita.fr>
9162
9163         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9164         before being defined.
9165
9166 2001-11-27  Paul Eggert  <eggert@twinsun.com>
9167
9168         * quotearg.h (quotearg_n, quotearg_n_style):
9169         First arg is int, not unsigned.
9170         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9171         (SIZE_MAX, UINT_MAX): New macros.
9172         (quotearg_n_options): Abort if N is negative.
9173         Avoid overflow check on hosts where size_t is 64 bits and int
9174         is 32 bits, as overflow is impossible there.
9175         Fix off-by-one typo that caused unnecessary reallocation.
9176
9177 2001-11-27  Jim Meyering  <meyering@lucent.com>
9178
9179         * tempname.c: Merge with version from libc.
9180         * regex.c: Likewise.
9181
9182         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9183         for which STDC_HEADERS is 0, it was not included, resulting in a
9184         warning about an integer-to-pointer conversion problem with getenv.
9185         Reported by Volker Borchert.
9186
9187 2001-11-26  Jim Meyering  <meyering@lucent.com>
9188
9189         * gtod.h: Remove file.
9190         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9191         * gettimeofday.c: Don't include gtod.h.
9192         (GTOD_init): Remove function.
9193         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9194         Suggestion from Volker Borchert.
9195
9196 2001-11-23  Jim Meyering  <meyering@lucent.com>
9197
9198         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9199         * hash.c (struct hash_table): Define it here instead.
9200
9201 2001-11-22  Jim Meyering  <meyering@lucent.com>
9202
9203         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9204
9205 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9206
9207         * tempname.c (TMP_MAX): Remove; no longer needed.
9208         (TEMPORARIES): New macro.
9209         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9210         removes an artificial limitation (e.g. HP-UX 10.20, where
9211         TMP_MAX is 17576).
9212
9213 2001-11-18  Jim Meyering  <meyering@lucent.com>
9214
9215         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9216         on SunOS 4.
9217
9218         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9219         files will be created before anything else.
9220
9221 2001-11-17  Jim Meyering  <meyering@lucent.com>
9222
9223         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9224         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9225         rather than group writable.  Patch by Juan F. Codagnone.
9226
9227         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9228         Instead, include "xalloc.h".
9229
9230         * mountlist.c: Include unlocked-io.h after all system headers.
9231         Remove explicit declarations of xmalloc, xrealloc,
9232         and xstrdup.  Instead, include "xalloc.h".
9233
9234         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9235         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9236         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9237
9238         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9239         Reported by Padraig Brady.
9240
9241         * mkstemp.c: #undef mkstemp.
9242         Include config.h.
9243         (rpl_mkstemp): Rename from mkstemp.
9244         Protoize.
9245
9246 2001-11-16  Jim Meyering  <meyering@lucent.com>
9247
9248         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9249         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9250         determine the amount of total physical memory, use pstat_getstatic.
9251         HPUX-11 doesn't define _SC_PHYS_PAGES.
9252         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9253         If sysconf couldn't be used to determine the amount of available
9254         physical memory, use both pstat_getstatic and pstat_getdynamic.
9255         Based on a patch from Bob Proulx.
9256
9257 2001-11-05  Jim Meyering  <meyering@lucent.com>
9258
9259         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9260
9261 2001-11-03  Jim Meyering  <meyering@lucent.com>
9262
9263         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9264         in argmatch_to_argument call.
9265
9266         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9267         argument.
9268
9269         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9270         e.g., a fault due to an attempt to free a NULL pointer.
9271
9272 2001-11-01  Jim Meyering  <meyering@lucent.com>
9273
9274         * dirfd.c, dirfd.h: New files.
9275         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9276
9277         * hash.c (hash_print) [TESTING]: Clean up.
9278
9279 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9280
9281         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9282         to avoid a warning if -Wall.
9283
9284 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9285
9286         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9287
9288 2001-10-21  Jim Meyering  <meyering@lucent.com>
9289
9290         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9291         this code would end up calling gettext even in packages built
9292         with --disable-nls.
9293         * getopt.c (_): Likewise.
9294         * regex.c (_): Likewise.
9295
9296 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9297
9298         * error.c (strerror_r): Do not declare unless !_LIBC.
9299         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9300         Use strerror_r that is only a macro, even if it is not a function.
9301         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9302         (private_strerror): Use prototypes, not old-style function definition.
9303         (print_errno_message): New function.
9304         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9305         char*-flavored one.
9306         (error_tail, error, error_at_line): Use it.
9307
9308 2001-10-11  Jim Meyering  <meyering@lucent.com>
9309
9310         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9311         and quote_n (1, ... to avoid clobbering a buffer.
9312
9313 2001-10-05  Jim Meyering  <meyering@lucent.com>
9314
9315         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9316         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9317         * hash-pjw.h: New file.
9318
9319 2001-09-30  Jim Meyering  <meyering@lucent.com>
9320
9321         * mountlist.c [MOUNTED_GETFSSTAT]:
9322         Include <sys/ucred.h>, for Apple Darwin.
9323         Include sys/mount.h and sys/fs_types.h only if available.
9324         (FS_TYPE): Define.
9325         (read_filesystem_list): Use FS_TYPE.
9326
9327 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9328
9329         * exclude.c (excluded_filename): 0 -> false, since it's
9330         a boolean context.
9331
9332 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9333
9334         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9335         #defines strtoimax.  Also treat the other strto* functions
9336         like strtoimax.
9337
9338         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9339         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9340         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9341
9342 2001-09-26  Jim Meyering  <meyering@lucent.com>
9343
9344         Most macros in unlocked-io.h had the wrong number of arguments.
9345         * gen-uio: New script.
9346         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9347         * unlocked-io.hin: Remove file.
9348         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9349         rather than trying to embed it here.
9350         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9351         Reported by Padraig Brady.
9352
9353 2001-09-25  Volker Borchert  <bt@teknon.de>
9354
9355         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9356
9357 2001-09-23  Jim Meyering  <meyering@lucent.com>
9358
9359         * mountlist.c: Remove useless parentheses in #if directives.
9360         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9361         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9362
9363 2001-09-22  Jim Meyering  <meyering@lucent.com>
9364
9365         * localcharset.c: Update from latest gettext.
9366         * config.charset: Likewise.
9367
9368 2001-09-20  Jim Meyering  <meyering@lucent.com>
9369
9370         * xstrtol.c (strtoimax): Guard declaration with
9371         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9372         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9373         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9374         (strtoumax): Likewise, for completeness (it wasn't necessary).
9375
9376 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9377
9378         * strtoimax.c (HAVE_LONG_LONG):
9379         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9380         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9381         to work around bug in IBM C compiler.
9382
9383 2001-09-16  Jim Meyering  <meyering@lucent.com>
9384
9385         * mkdir.c: New file.
9386
9387 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9388
9389         * xgetcwd.c: Revert some of the previous change; intead,
9390         fix the HAVE_GETCWD_NULL code to behave more like the
9391         !HAVE_GETCWD_NULL code used to.
9392
9393         Include "xalloc.h".
9394         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9395         invoke xalloc_die.
9396
9397 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9398
9399         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9400         Use ssize_t, not int, to store result of readlink.
9401         Check for ssize_t overflow as well as size_t overflow,
9402         as POSIX says the result of readlink is implementation-defined
9403         when ssize_t overflows.
9404         Remove unnecessary cast to char*.
9405         Use free+malloc instead of realloc, as the storage doesn't need
9406         to be preserved and it's clearer and can be more efficient that way.
9407         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9408         * xreadlink.h (xreadlink): Update prototype.
9409
9410 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9411
9412         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9413         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9414         spotted by Jim Meyering.
9415
9416 2001-09-03  Jim Meyering  <meyering@lucent.com>
9417
9418         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9419
9420 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9421
9422         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9423         like the HAVE_GETCWD_NULL code.
9424         Include pathmax.h if not HAVE_GETCWD.
9425         Do not include xalloc.h.
9426         (INITIAL_BUFFER_SIZE): New symbol.
9427         Do not use xmalloc / xrealloc, since the caller is responsible for
9428         handling errors.  Preserve errno around `free' during failure.
9429         Do not overrun buffer when using getwd.
9430
9431 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9432
9433         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9434         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9435
9436 2001-09-02  Jim Meyering  <meyering@lucent.com>
9437
9438         * error.c: Update from GNU libc.
9439
9440 2001-09-01  Jim Meyering  <meyering@lucent.com>
9441
9442         * xreadlink.c: New file.
9443         * xreadlink.h: New file.
9444         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9445
9446         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9447         doesn't conflict with sparc Solaris 7's definition in
9448         /usr/include/sys/int_types.h.
9449
9450         * exclude.c: Use `""', not `<>' to #include non-system header files.
9451         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9452         and strncasecmp as r-values.  Unixware didn't have declarations.
9453
9454 2001-08-31  Jim Meyering  <meyering@lucent.com>
9455
9456         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9457         Use an initial, malloc'd, buffer of length 128 rather than
9458         a statically allocated one of length 1024.
9459
9460 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9461
9462         * xgetcwd.c: Don't include pathmax.h.
9463         Include stdlib.h and unistd.h if available.
9464         Include xalloc.h.
9465         (xmalloc, xstrdup, free): Remove decls.
9466         (xgetcwd): Don't assume sizes fit in unsigned.
9467         Check for overflow when computing sizes.
9468         Simplify reallocation code.
9469
9470 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9471
9472         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9473
9474         * strtoimax.c: Renamed from strtoxmax.c, removing the
9475         old strtoimax.c.
9476
9477         Also, make the following further changes to make this file's
9478         configuration more similar to that of strtol.c:
9479         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9480         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9481         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9482         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9483         changed to signed values.
9484
9485         And make the following changes as well:
9486         Fix copyright notice, as 1999 was missing.
9487         (verify): New macro.
9488         (strtoimax): Check sizes at compile-time, not run-time.
9489         Prefer strtol to strtoll if both work.
9490         (main): Remove; it was not that useful and was a pain to maintain.
9491
9492         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9493
9494 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9495
9496         * savedir.c (savedir): Remove size parameter, as POSIX says that
9497         a directory's st_size can have an arbitrary value, so the old
9498         usage could waste an arbitrary amount of memory.  All uses
9499         changed.
9500         * savedir.h: Update prototype.
9501
9502 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9503
9504         * xstrtol.c (strtoimax): New decl.
9505
9506 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9507
9508         * xstrtol.h: Add copyright notice.
9509         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9510         LONGINT_INVALID_SUFFIX_CHAR.
9511
9512 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9513
9514         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9515         tm to be declared.
9516
9517 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9518
9519         * hash.c: Remove '2001' from copyright notice.
9520
9521 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9522
9523         * full-write.h: New file.
9524         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9525         * full-write.c: Correct credits, as cccp.c no longer
9526         exists and anyway it was so heavily changed from the old cccp
9527         code as to be unrecognizable.  Include full-write.h.
9528         (full_write) Return size_t, with short writes meaning failure.
9529         All callers changed.  This fixes a bug with large buffers
9530         on 64-bit hosts.
9531         * utime.c: Include full-write.h.
9532
9533 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9534
9535         Merge 'exclude' changes from tar 1.13.22.
9536         This fixes one or two unlikely storage allocation overflow bugs,
9537         but doesn't change user-visible behavior otherwise.
9538
9539 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9540
9541         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9542         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9543         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9544         Include if available.
9545         (<xalloc.h>): Include
9546         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9547         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9548         collide with FNM macros.
9549         (struct patopts): New struct.
9550         (struct exclude): Use it, as exclude patterns now come with options.
9551         (new_exclude): Support above changes.
9552         (new_exclude, add_exclude_file):
9553         Initial size must now be a power of two to simplify overflow checking.
9554         (free_exclude, fnmatch_no_wildcards): New function.
9555         (excluded_filename): No longer requires options arg, as the options
9556         are determined by add_exclude.  Now returns bool, not int.
9557         (excluded_filename, add_exclude):
9558         Add support for the fancy new exclusion options.
9559         (add_exclude, add_exclude_file): Now takes int options arg.
9560         Check for arithmetic overflow when computing sizes.
9561         (add_exclude_file): xrealloc might modify errno, so don't
9562         realloc until after errno might be used.
9563
9564         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9565         New macros.
9566         (free_exclude): New decl.
9567         (add_exclude, add_exclude_file): Now takes int options arg.
9568         (excluded_filename): No longer requires options arg, as the options
9569         are determined by add_exclude.  Now returns bool, not int.
9570
9571 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9572
9573         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9574
9575 2001-08-27  Jim Meyering  <meyering@lucent.com>
9576
9577         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9578
9579         * version-etc.c (N_): Remove definition.
9580         Revert most of last change.
9581         Instead, simply don't mark the `Copyright...' string for translation.
9582         Based on advice from Paul Eggert.
9583
9584         * strtoxmax.c: Tweak comment.
9585
9586 2001-08-26  Jim Meyering  <meyering@lucent.com>
9587
9588         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9589         of copyright with `%s' so translators don't get an untranslated
9590         message in 2002.
9591         (COPYRIGHT_YEAR): Define.
9592         (version_etc): Use fprintf rather than fputs.
9593         Suggestion from Ulrich Drepper.
9594
9595         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9596
9597         * strtoll.c: New file, from GNU libc.
9598         * xstrtoimax.c: New file.
9599
9600         * xstrtol.h: Add xstrtoimax.
9601         * strtoumax.c: New file.  Simply include "strtoumax.c".
9602         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9603
9604         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9605         * strtoxmax.c: ... then renamed to this.
9606
9607 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9608
9609         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9610         Port to Solaris 8, where 'sed' requires a space after the 'r'
9611         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9612         Redirect output to $tmp just once.
9613
9614 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9615
9616         * addext.c (<errno.h>): Include.
9617         (errno): Declare if not defined.
9618         (addext): Work correctly when pathconf returns -1 and leaves
9619         errno alone because there is no limit.  Also, work even if
9620         pathconf returns a value greater than SIZE_MAX.
9621
9622 2001-08-12  Jim Meyering  <meyering@lucent.com>
9623
9624         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9625         Simply `return getcwd (NULL, 0);'.
9626         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9627         Use 1300 as initial value for length, not PATH_MAX.
9628
9629         * pathmax.h: Clean up cpp syntax.
9630
9631 2001-08-12  Jim Meyering  <meyering@lucent.com>
9632
9633         * gettimeofday.c: New file.
9634         * gtod.h: New file.
9635         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9636
9637 2001-08-04  Jim Meyering  <meyering@lucent.com>
9638
9639         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9640         to get in sync with glibc.
9641
9642 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9643
9644         The following changes are from gettext 0.10.39 as maintained by
9645         Bruno Haible.
9646
9647         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9648         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9649         with inverted sense.  All uses changed.
9650
9651         * mbswidth.c: Don't include <limits.h>.
9652         Include <stdlib.h> and <string.h> unconditionally.
9653         (iswcntrl, mbsinit, ISCNTRL): New macros.
9654         (mbsnwidth): Use K&R style function declarations.
9655         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9656         can optimize it when MB_CUR_MAX == 1.
9657         The width of control characters is zero, not 1.
9658
9659 2001-07-15  Jim Meyering  <meyering@lucent.com>
9660
9661         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9662         (BUILT_SOURCES): Add unlocked-io.h.
9663         (io_functions): Define.
9664         (unlocked-io.h): New rule.
9665         (DISTCLEANFILES): Add unlocked-io.h.
9666         (all-local): Depend on unlocked-io.h, to ensure it is created.
9667
9668         * unlocked-io.hin: New file
9669
9670         * regex.c: Update from glibc.
9671
9672 2001-07-05  Jim Meyering  <meyering@lucent.com>
9673
9674         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9675         recommendation.
9676         (libfetish_a_SOURCES): Put all .h files here instead.
9677         Remove a thus-exposed (better checks in automake) duplicate and
9678         two unnecessary .h files.
9679
9680 2001-06-11  Jim Meyering  <meyering@lucent.com>
9681
9682         * regex.c: Update from GNU libc.
9683
9684 2001-05-27  Jim Meyering  <meyering@lucent.com>
9685
9686         * readutmp.h (UT_TYPE): Define.
9687
9688 2001-05-24  Jim Meyering  <meyering@lucent.com>
9689
9690         * argmatch.c: Include "quote.h".
9691         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9692         quote function.  Reported by Göran Uddeborg.
9693
9694 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9695
9696         * dirname.c (dir_name): Compute append_dot using path, not newpath
9697         which is not yet declared.
9698
9699 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9700
9701         * Makefile.am (libfetish_a_SOURCES):
9702         Add strftime.c, since we now compile it on all hosts.
9703
9704         * strftime.c (my_strftime):
9705         Define to nstrftime if emacs, but only if my_strftime is not defined.
9706         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9707         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9708         Add one more extra argument: a nanoseconds value.
9709         All uses changed.
9710         (ns): New macro.
9711         (my_strftime function): Add %N format.
9712         (emacs_strftimeu): Renamed from emacs_strftime,
9713         with extra ut argument.
9714
9715 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9716
9717         dirname code cleanup.  base_name now behaves more compatibly
9718         with POSIX basename when given file names that have trailing
9719         slashes, and similarly for dir_name.  Add new primitives
9720         base_len and dir_len.  Put the directory-name-related decls
9721         into dirname.h.
9722
9723         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9724         * backupfile.c (base_name): Likewise.
9725         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9726         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9727         * makepath.c (strip_trailing_slashes): Likewise.
9728         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9729         Likewise.
9730         * rename.c (strip_trailing_slashes): Likewise.
9731         * same.c (base_name): Likewise.
9732         * stripslash.c (ISSLASH): Likewise.
9733
9734         * addext.c: Include <dirname.h> after size_t is defined.
9735         * backupfile.c: Likewise.
9736
9737         * addext.c (addext): Use base_len to trim redundant
9738         trailing slashes instead of doing it ourselves.
9739         But do not trim the last slash if it is not redundant.
9740
9741         * backupfile.c (find_backup_file_name,
9742         max_backup_version): Use base_len instead of rolling it ourselves.
9743         Handle the case of "" and (on DOS) "C:" correctly.
9744
9745         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9746         Include <string.h>, <dirname.h>.
9747         (base_name): Allow file names ending in slashes, other than names
9748         that are all slashes.  In this case, return the basename followed
9749         by the slashes.  This is more general, and can be used in places
9750         where the original base_name purposely had an assertion failure.
9751         (base_len): New function.
9752
9753         * dirname.c: Include <string.h> instead of <stdlib.h>.
9754         Do not include <assert.h>; no longer needed.
9755         Include xalloc.h.
9756         (memrchr): Remove decl.
9757         (dir_name_r): Remove.
9758         (dir_len): Renamed from dirlen.  All callers changed.
9759         Rewrite in terms of base_name, for simplicity and consistency.
9760         (dir_name): Never return NULL.  All callers changed.
9761         Do not include <stdlib.h> in test program; no longer needed.
9762         return 0; is fine for test program.
9763
9764         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9765         New macros.
9766         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9767
9768         * path-concat.c (path_concat): Use base_len to compute
9769         base length, not strlen; this means we cannot rely on memcpy
9770         to null-terminate.
9771
9772         * same.c (STREQ): Remove.
9773         (same_name): Handle the case where the basename ends in trailing '/'.
9774
9775         * stripslash.c (strip_trailing_slashes): Return nonzero if
9776         a slash was stripped.  Do not strip the last slash after a
9777         file system prefix.
9778
9779 2001-04-08  Jim Meyering  <meyering@lucent.com>
9780
9781         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9782         recomputed; that's necessary when the offset spans a DST transition.
9783         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9784
9785 2001-04-02  Jim Meyering  <meyering@lucent.com>
9786
9787         * regex.h, regex.c: Update from GNU libc.
9788
9789 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9790
9791         * version-etc.c (version_etc_copyright): Update to 2001.
9792
9793 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9794
9795         * tempname.c (uint64_t): Define to uintmax_t if
9796         not defined, and if UINT64_MAX is not defined.
9797         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9798         Reported by John David Anglin.
9799
9800 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9801
9802         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9803         alias if codeset is empty.
9804         * config.charset (BeOS): Use wildcard syntax.
9805
9806 2001-03-13  Jim Meyering  <meyering@lucent.com>
9807
9808         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9809         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9810         From Bruno Haible.
9811
9812 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9813
9814         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9815         Don't return NULL.
9816         * unicodeio.c (print_unicode_char): Simplify accordingly.
9817
9818 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9819
9820         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9821         support for DOS/DJGPP.
9822
9823 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9824
9825         * Makefile.am (libfetish_a_SOURCES):
9826         Add dup-safer.c, fopen-safer.c.
9827         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9828
9829         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9830
9831 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9832
9833         The mkstemp replacement is taken from glibc 2.2.2, with some
9834         portability fixes for use outside glibc, as follows:
9835
9836         * tempname.c (struct_stat64): New macro.
9837         (direxists, __gen_tempname): Use it.
9838         This avoids a portability problem with Solaris 8.
9839
9840         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9841         (<stddef.h>, <stdint.h>, <string.h>):
9842         Include only if STDC_HEADERS || _LIBC.
9843         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9844         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9845         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9846         (__set_errno): Define this macro if <errno.h> doesn't.
9847         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9848         Define these macros if <stdio.h> doesn't.
9849         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9850         Define these macros if <sys/stat.h>
9851         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9852         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9853         __xstat64): Define if not _LIBC.
9854         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9855         (__gen_tempname): Invoke gettimeofday only if
9856         HAVE_GETTIMEOFDAY || _LIBC;
9857         otherwise, fall back on plain "time".
9858         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9859
9860         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9861
9862         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9863
9864 2001-02-17  Jim Meyering  <meyering@lucent.com>
9865
9866         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9867         around included file name.
9868
9869         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9870
9871         * strftime.c: Update from GNU libc (the only changes were to comments).
9872
9873 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9874
9875         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9876
9877 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9878
9879         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9880         Remove workaround macros for hosts that have mbrtowc but not
9881         mbstate_t, as we now insist on proper declarations for both
9882         before using mbrtowc.
9883
9884 2001-02-17  Jim Meyering  <meyering@lucent.com>
9885
9886         * regex.c: Update from libc.
9887
9888 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9889
9890         * alloca.c (malloc): Undef before defining, since stdlib.h
9891         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9892         Reported by Mark Hounschell via Paul Eggert.
9893
9894 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9895
9896         * config.charset: Update for FreeBSD 4.2.
9897
9898 2001-01-26  Jim Meyering  <meyering@lucent.com>
9899
9900         * quotearg.c: Include stddef.h.
9901         * quote.c: Include stddef.h.
9902         Reported by Axel Kittenberger.
9903
9904         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9905         line in double quotes so that it evokes a better diagnostic.
9906         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9907         Reported by Axel Kittenberger.
9908
9909 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9910
9911         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9912         to avoid a warning.  Add back 'const' to inptr.
9913
9914 2001-01-16  Jim Meyering  <meyering@lucent.com>
9915
9916         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9917         From Bruno Haible.
9918
9919 2001-01-14  Jim Meyering  <meyering@lucent.com>
9920
9921         * rename.c: New file.  From Volker Borchert.
9922         Include stdlib.h, string.h or strings.h, and xalloc.h.
9923         Use strip_trailing_slashes rather than open-coding it.
9924
9925 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9926
9927         * strftime.c: Sync with glibc time/strftime.c 1.81.
9928
9929 2001-01-03  Jim Meyering  <meyering@lucent.com>
9930
9931         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9932         local `inptr' to avoid warning with some system declarations of iconv.
9933
9934 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9935
9936         * modechange.c: Do not assume that mode_t uses the
9937         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9938         the other-execute bit of FOO even if S_IXOTH != 1.
9939
9940         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9941         WOTH, XOTH, ALLM): New macros.
9942         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9943          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9944         Use them.
9945         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9946         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9947         (mode_compile):
9948         No need to use uintmax_t; unsigned long is long enough.
9949         Don't bother to get suffix since we don't use it.
9950
9951 2000-12-24  Jim Meyering  <meyering@lucent.com>
9952
9953         * hash.c (is_prime): Return explicit boolean values.
9954         (hash_get_first): Return NULL to appease Irix5.6's 89.
9955         Reported by Nelson Beebe.
9956
9957 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9958
9959         * localcharset.c (locale_charset): Add support for Win32.
9960
9961 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9962
9963         * physmem.h, physmem.c: New files.
9964
9965         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9966         (noinst_HEADERS): Add physmem.h.
9967
9968         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9969         't' for compatibility with Solaris 8 sort.
9970
9971 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9972
9973         * config.charset: Add support for BeOS.
9974
9975 2000-12-16  Jim Meyering  <meyering@lucent.com>
9976
9977         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9978         SHELLS_FILE to a file name that's useful on djgpp systems.
9979         Include stdlib.h.
9980         (ADDITIONAL_DEFAULT_SHELLS): Define.
9981         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9982         Based mostly on a patch from Prashant TR.
9983
9984 2000-12-16  Jim Meyering  <meyering@lucent.com>
9985
9986         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9987         N and M) would have treated it like `chown N:N FILE'.
9988
9989         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9990
9991 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9992
9993         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9994         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9995         to the list of canonical encodings. Rename EUC-CN to GB2312.
9996
9997 2000-12-08  Andreas Schwab  <schwab@suse.de>
9998
9999         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
10000         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
10001
10002 2000-12-07  Jim Meyering  <meyering@lucent.com>
10003
10004         * stripslash.c (ISSLASH): Define.
10005         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
10006         From Prashant TR.
10007
10008         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
10009         (dir_name_r): Declare this function as static.
10010         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10011         manifest itself on a name containing a mix of slashes and
10012         backslashes.
10013         Make this function work with names starting with a DOS-style
10014         drive letter and colon prefix.
10015         (dir_name): Append `.' if necessary.
10016         Based mostly on patches from Prashant TR and Eli Zaretskii.
10017
10018         * dirname.h (dir_name_r): Remove prototype.
10019
10020 2000-12-05  Jim Meyering  <meyering@lucent.com>
10021
10022         * dirname.c (dir_name_r): Add `const' in a few local declarations.
10023
10024 2000-12-04  Jim Meyering  <meyering@lucent.com>
10025
10026         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10027         Also include memory.h, stdlib.h, unistd.h if appropriate.
10028         Reported by Andreas Jaeger (conflicting declaration of malloc).
10029
10030 2000-12-02  Jim Meyering  <meyering@lucent.com>
10031
10032         * closeout.h: Make idempotent, to avoid some obscure warnings.
10033
10034 2000-12-01  Paul Eggert  <eggert@twinsun.com>
10035
10036         * memrchr.c: Include <config.h> before any system include file.
10037
10038 2000-11-29  Paul Eggert  <eggert@twinsun.com>
10039
10040         * dirname.c (dir_name_r): Fix typo: int -> size_t.
10041
10042 2000-11-26  Jim Meyering  <meyering@lucent.com>
10043
10044         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
10045
10046 2000-11-22  Paul Eggert  <eggert@twinsun.com>
10047
10048         * strftime.c (my_strftime): Do not invoke mbrlen with a
10049         size of (size_t) -1; it's not portable.
10050
10051 2000-11-17  Akim Demaille  <akim@epita.fr>
10052
10053         * obstack.h: Formatting changes.
10054         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10055         prevent type checking.
10056         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10057         cast the value to (void *): assigning a `foo *' to a `void *'
10058         variable is valid.
10059         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10060
10061 2000-11-17  Jim Meyering  <meyering@lucent.com>
10062
10063         * strstr.c: Update from GNU libc.
10064
10065 2000-11-16  Jim Meyering  <meyering@lucent.com>
10066
10067         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10068
10069 2000-11-11  Jim Meyering  <meyering@lucent.com>
10070
10071         * error.c: Add a couple #includes, merging from GNU libc version.
10072
10073 2000-11-10  Jim Meyering  <meyering@lucent.com>
10074
10075         * obstack.h: Update from GNU libc.
10076         * obstack.c: Likewise.
10077
10078 2000-11-06  Paul Eggert  <eggert@twinsun.com>
10079
10080         * getusershell.c (setusershell): Use rewind rather than
10081         fseek/fseeko, to avoid configuration hassles with fseeko.
10082         Don't bother opening SHELLS_FILE if shellstream is NULL;
10083         it's not necessary.
10084
10085 2000-11-05  Jim Meyering  <meyering@lucent.com>
10086
10087         * makepath.h (make_dir): Declare.
10088         * makepath.c (make_dir): Remove `static' attribute.
10089         Tweak a comment.
10090
10091 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
10092
10093         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
10094         last one in a bucket, advance to the next bucket.
10095
10096 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
10097
10098         * fnmatch.c: Do not comment out all the code if we are using
10099         the GNU C library, because in some cases we are replacing buggy
10100         code in the GNU C library itself.
10101
10102 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10103
10104         * error.h, getline.h, modechange.h:
10105         Remove "2000" from Copyright line, as the file hasn't been
10106         changed this year other than in the copyright notice.
10107
10108         * xalloc.h: Add "2000" to Copyright line, as this file
10109         was changed this year.
10110
10111 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10112
10113         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10114         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10115         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10116
10117 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
10118
10119         * regex.h (__restrict_arr): Move definition out of #ifndef block.
10120         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10121         doesn't define __restrict_arr.
10122
10123 2000-10-29  Jim Meyering  <meyering@lucent.com>
10124
10125         * xstat.in: Fix grammar in comment.
10126
10127 2000-10-28  Jim Meyering  <meyering@lucent.com>
10128
10129         * memchr.c: Update from libc.
10130         Adjust for portability:
10131         [HAVE_STDLIB_H]: Include stdlib.h.
10132         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10133         Undef __memchr, too.
10134         [!weak_alias]: Define __memchr to memchr.
10135
10136         * regex.c: Update from libc.
10137         * regex.h: Likewise.
10138         * getopt1.c: Likewise.
10139         * memcmp.c: Likewise.
10140
10141         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10142         Avoid using fseek, when possible -- it's broken by design.
10143         Patch by Ulrich Drepper.
10144
10145 2000-10-26  Jim Meyering  <meyering@lucent.com>
10146
10147         * strftime.c: Update from libc.
10148
10149 2000-10-25  Jim Meyering  <meyering@lucent.com>
10150
10151         * obstack.c: Update from libc.
10152
10153 2000-10-23  Jim Meyering  <meyering@lucent.com>
10154
10155         * hard-locale.c (hard_locale): Revert last change -- it was simply
10156         wrong.  That set_locale call must not have any side effects.
10157         From Paul Eggert.
10158
10159 2000-10-22  Jim Meyering  <meyering@lucent.com>
10160
10161         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10162         [CYCLIC]: Remove now-unused definition.
10163
10164         * save-cwd.c (O_DIRECTORY): Define, if needed.
10165         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10166         Suggestion from Ulrich Drepper.
10167
10168 2000-10-21  Jim Meyering  <meyering@lucent.com>
10169
10170         * dirname.c (dir_name_r): New function, factored out of dir_name.
10171         (dir_name): Use dir_name_r.
10172         * dirname.h (dir_name_r): Declare it.
10173
10174 2000-10-21  Jim Meyering  <meyering@lucent.com>
10175
10176         * dirname.c (memrchr): Declare if necessary.
10177         (dir_name): Remove the restriction that there be no
10178         trailing slashes.  Now, this code skips past them, effectively
10179         ignoring them.
10180         [TEST_DIRNAME] (main): New unit tests.
10181
10182         * memrchr.c: New file from GNU libc.
10183         Undef __memrchr, too.
10184         [!weak_alias]: Define __memrchr to memrchr.
10185         Guard weak_alias use with `#ifdef weak_alias'.
10186
10187 2000-10-17  Jim Meyering  <meyering@lucent.com>
10188
10189         * quote.h (PARAMS): Define and use.
10190         Reported by Akim Demaille.
10191
10192         * getopt.c: Update from libc.
10193
10194 2000-10-16  Jim Meyering  <meyering@lucent.com>
10195
10196         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10197         From Jan Fedak.
10198
10199 2000-09-25  Jim Meyering  <meyering@lucent.com>
10200
10201         * md5.h (rol): Define (from GnuPG).
10202
10203         * sha.c: Give credit (GnuPG) where due.
10204         (M): Use rol rather than open-coding it.
10205         Add a FIXME comment.
10206
10207 2000-09-21  Jim Meyering  <meyering@lucent.com>
10208
10209         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10210         Reported by Michael Stone.
10211
10212 2000-09-20  Jim Meyering  <meyering@lucent.com>
10213
10214         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10215         (noinst_HEADERS): Add sha.h.
10216         Based on code from Scott G. Miller and from GnuPG.
10217
10218 2000-09-15  Jim Meyering  <meyering@lucent.com>
10219
10220         * regex.c: Update from libc.
10221
10222 2000-09-10  Jim Meyering  <meyering@lucent.com>
10223
10224         * getopt.c (_getopt_internal): Update from glibc.
10225
10226 2000-09-09  Jim Meyering  <meyering@lucent.com>
10227
10228         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10229         think it should be used as a general replacement for isascii.
10230         * fnmatch.c: Likewise.
10231         * mbswidth.c: Likewise
10232         * regex.c: Likewise.
10233
10234         Don't use atoi.
10235         * userspec.c: Include sys/param.h and limits.h.
10236         Include xstrtol.h.
10237         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10238         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10239         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10240         UID, GID.  Check range.
10241
10242 2000-09-06  Jim Meyering  <meyering@lucent.com>
10243
10244         * getopt.c (_getopt_internal): Update from glibc.
10245
10246 2000-08-30  Jim Meyering  <meyering@lucent.com>
10247
10248         * strftime.c: Merge in changes from GNU libc.
10249
10250 2000-08-26  Jim Meyering  <meyering@lucent.com>
10251
10252         * closeout.c: Include "__fpending.h".
10253         (close_stdout_status): Return right away if there's nothing to flush.
10254
10255         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10256         * __fpending.c: New file.
10257         * __fpending.h: New file.
10258
10259 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10260
10261         Standardize on "memory exhausted" instead of "Memory exhausted"
10262         or "virtual memory exhausted".
10263         * obstack.c (print_and_abort): Use "memory exhausted", not
10264         "virtual memory exhausted".
10265         * same.c (same_name): Invoke xalloc_die instead of printing
10266         our own message.
10267         * userspec.c (parse_user_spec): Likewise.
10268         * bumpalloc.h: comment fix
10269         * same.c, userspec.c: Include xalloc.h.
10270
10271         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10272         not char *const and pointing to a constant array.
10273         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10274         (xrealloc): Comment fix.
10275
10276         * userspec.c (parse_user_spec):
10277         Don't translate a message until just before returning,
10278         to avoid unnecessary translation.
10279
10280 2000-08-07  Jim Meyering  <meyering@lucent.com>
10281
10282         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10283         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10284         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10285         getgroups.c, gethostname.c, getopt.h, group-member.c,
10286         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10287         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10288         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10289         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10290         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10291         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10292         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10293         yesno.c: Back out Copyright date changes for each file with no change
10294         this year.  This eases coordination with other programs using the same
10295         source code modules.  From Paul Eggert.
10296
10297 2000-08-03  Greg McGary  <greg@mcgary.org>
10298
10299         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10300         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10301         (EXTEND_BUFFER): Use them.
10302
10303 2000-08-01  Jim Meyering  <meyering@lucent.com>
10304
10305         * dirname.c (ISSLASH): Define.
10306         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10307         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10308         both `\' and `/' may be use as path separators.
10309         Based on a patch from Prashant TR.
10310
10311 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10312
10313         * quotearg.c (quotearg_n_options): Don't make the initial
10314         slot vector a constant, since it might get modified.
10315
10316 2000-07-31  Jim Meyering  <meyering@lucent.com>
10317
10318         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10319         * obstack.c (print_and_abort): Likewise.
10320
10321 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10322
10323         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10324         buffer, so that the caller can always quote one small
10325         component of a "memory exhausted" message in slot 0.
10326         From a suggestion by Jim Meyering.
10327
10328 2000-07-30  Jim Meyering  <meyering@lucent.com>
10329
10330         * makepath.c (make_path): Quote the other instance, too.
10331
10332         * quotearg.c (N_STATIC_SLOTVECS): Define.
10333         (STATIC_BUF_SIZE): Define.
10334         (quotearg_n_options): Use only statically allocated storage when
10335         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10336         than STATIC_BUF_SIZE.
10337
10338 2000-07-29  Jim Meyering  <meyering@lucent.com>
10339
10340         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10341         * dirname.c (dir_name): Likewise.
10342
10343         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10344
10345         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10346         (dir_name): Assert that there are no trailing slashes.
10347
10348 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10349
10350         * mbswidth.h (mbswidth): Add a flags argument.
10351         (mbswidth): New declaration.
10352         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10353         * mbswidth.c (mbswidth): Add a flags argument.
10354         (mbsnwidth): New function.
10355
10356 2000-07-24  Jim Meyering  <meyering@lucent.com>
10357
10358         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10359
10360 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10361
10362         * mbswidth.c (_XOPEN_SOURCE):
10363         Don't define; this causes problems on Solaris 7.
10364         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10365
10366 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10367
10368         * quotearg.c:
10369         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10370         so that mbstate_t is always defined.
10371
10372         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10373         be 1 in at least one GCC installation, and this configuration
10374         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10375         performance on hosts that have mbrtowc but have only unibyte
10376         locales, but I assume these hosts are rare.
10377
10378 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10379
10380         * quotearg.c: Streamline by invoking multibyte code only if needed.
10381         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10382         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10383         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10384         invoke multibyte primitives.
10385
10386 2000-07-23  Jim Meyering  <meyering@lucent.com>
10387
10388         * basename.c (base_name): Add an assertion.
10389
10390 2000-07-15  Bruno Haible  <clisp.cons.org>
10391
10392         * quotearg.c: When the system forces us to redefine mbstate_t,
10393         shadow its mbsinit function.
10394
10395 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10396
10397         * mbswidth.h: New file.
10398         * mbswidth.c: New file.
10399         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10400         (noinst_HEADERS): Add mbswidth.h.
10401
10402 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10403
10404         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10405         and IRIX 6.
10406
10407 2000-07-15  Jim Meyering  <meyering@lucent.com>
10408
10409         * makepath.c: Include quote.h.
10410         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10411         corresponding argument in a `quote (...)' call.
10412         Give better diagnostics.
10413
10414         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10415         (noinst_HEADERS): Add quote.h.
10416
10417         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10418         from tar's src/misc.c.
10419         * quote.h: New file.  Prototypes for same.
10420
10421 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10422
10423         From a suggestion by Bruno Haible.
10424         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10425         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10426         to decide whether to define the BeOS workaround macro;
10427         this adjusts to the change to AC_MBSTATE_T.
10428
10429 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10430
10431         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10432
10433         * quotearg.c (quoting_style_args, quoting_style_vals,
10434         quotearg_buffer_restyled): Add support for
10435         clocale_quoting_style.  Undo previous change to
10436         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10437         and "{RIGHT QUOTATION MARK}" msgids.
10438
10439 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10440
10441         The old behavior of quoting `like this' doesn't look good with
10442         newer, ISO-style fonts.  See:
10443         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10444
10445         Instead, quote "like this" by default.  Let the translator
10446         tailor the locale-specific quoting behavior by providing
10447         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10448
10449         * quotearg.c (N_): New macro.
10450         (gettext_default): New function.
10451         (quotearg_buffer_restyled): Use
10452         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10453         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10454
10455 2000-07-09  Jim Meyering  <meyering@lucent.com>
10456
10457         * Most files: Update copyright dates to include 2000.
10458
10459 2000-07-08  Jim Meyering  <meyering@lucent.com>
10460
10461         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10462         if not defined.
10463         (xgethostname): Remove now-unnecessary #ifdef.
10464         Move declaration of `err' into loop where it's used.
10465
10466 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10467
10468         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10469         by allocating a larger buffer. Test the gethostname return value for
10470         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10471         returns an error and ENAMETOOLONG isn't defined.
10472
10473 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10474         and Bruno Haible  <haible@clisp.cons.org>
10475
10476         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10477
10478 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10479
10480         * quotearg.c (struct quoting_options): Simplify quote_these_too
10481         dimension.
10482
10483 2000-07-03  Jim Meyering  <meyering@lucent.com>
10484
10485         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10486         Reported by Bruno Haible.
10487
10488 2000-07-04  Jim Meyering  <meyering@lucent.com>
10489
10490         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10491         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10492         lacks mbrtowc.
10493
10494 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10495         and Bruno Haible  <haible@clisp.cons.org>
10496
10497         * quotearg.c (mbrtowc):
10498         Assign to *pwc, and return 1 only if result is nonzero.
10499         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10500
10501 2000-07-03  Jim Meyering  <meyering@lucent.com>
10502
10503         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10504         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10505         From Bob Proulx.
10506
10507 2000-07-02  Jim Meyering  <meyering@lucent.com>
10508
10509         * quotearg.c (mbstate_t): Don't define here.
10510
10511 2000-07-02  Jim Meyering  <meyering@lucent.com>
10512
10513         * nanosleep.c (SIGCONT): Define if not already defined.
10514
10515 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10516
10517         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10518         per change in ../m4/ls-mntd-fs.m4.
10519         (read_filesystem_list): Ignore symbolic links.
10520
10521 2000-06-29  Jim Meyering  <meyering@lucent.com>
10522
10523         * same.c: Include <string.h> or <strings.h>, as appropriate,
10524         for declaration of strcmp.
10525
10526         * long-options.c: Include <stdlib.h>, for declaration of exit.
10527
10528         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10529         Avoid warning by casting result to `char *' to remove `const'.
10530
10531 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10532
10533         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10534
10535 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10536
10537         savedir now sets errno on failure and invokes xmalloc to get memory.
10538         Fix a couple of other minor bugs while we're at it.
10539
10540         * savedir.c (<unistd.h>): Do not include; there's no need.
10541         (NAMLEN): Remove macro.
10542         (malloc, realloc): Remove decls.
10543         (stpcpy): Likewise.
10544         ("xalloc.h"): Include.
10545         (NAME_SIZE_DEFAULT): New macro.
10546         (savedir): Use xmalloc / xrealloc to allocate memory.
10547         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10548         Skip "" directory entries.
10549         Use strlen to calculate directory entry length, since the old method
10550         is rarely used these days and isn't worth supporting.
10551         Don't use a pointer after freeing it.
10552         Check for integer overflow when calculating allocation size.
10553         Use memcpy to copy entries, instead of stpcpy.
10554         Set errno properly when returning NULL.
10555         Check for readdir error.
10556
10557 2000-06-26  Jim Meyering  <meyering@lucent.com>
10558
10559         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10560
10561 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10562
10563         * getusershell.c (xmalloc, xrealloc): Remove functions.
10564         Include xalloc.h.
10565         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10566
10567 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10568
10569         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10570
10571 2000-06-24  Jim Meyering  <meyering@lucent.com>
10572
10573         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10574
10575 2000-06-21  Jim Meyering  <meyering@lucent.com>
10576
10577         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10578
10579 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10580
10581         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10582         (mbrtowc, mbstate_t): Define substitutes if
10583         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10584         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10585         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10586
10587 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10588
10589         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10590         than 1024, return a memory chunk of least possible size, instead
10591         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10592         Use free/xmalloc instead of xrealloc to avoid copying for very long
10593         paths.
10594
10595 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10596
10597         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10598         address, not strdup.  Include <stdlib.h> and don't declare free().
10599
10600 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10601
10602         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10603         the empty string.
10604
10605 2000-06-21  Jim Meyering  <meyering@lucent.com>
10606
10607         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10608         (noinst_HEADERS): Add getstr.h.
10609
10610         * getline.c (getstr): Move into a separate file.
10611         * getstr.c (getstr): New file, extracted from getline.c, with
10612         the following changes: new parameter, delim2; both delim[12]
10613         parameters have type `int', not `char'.  The latter would lose
10614         with 8-bit delimiters.
10615         * getstr.h: New file.
10616
10617 2000-06-19  Jim Meyering  <meyering@lucent.com>
10618
10619         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10620
10621 2000-06-18  Jim Meyering  <meyering@lucent.com>
10622
10623         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10624         Besides, these days every porting target provides a mkdir function.
10625
10626         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10627         (this snippet comes from src/system.h).
10628
10629 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10630
10631         * human.c (adjust_value): New function.
10632         (human_readable_inexact): Apply rounding style even when
10633         printing approximate values.
10634
10635 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10636
10637         * human.c (human_readable_inexact): Allow an input block
10638         size that is not a multiple of the output block size, and vice versa.
10639         Reported by Piergiorgio Sartor.
10640
10641 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10642
10643         * getdate.y (get_date): Apply relative times after time
10644         zone indicator, not before.  Reported by Todd A. Jacobs.
10645
10646 2000-06-13  Jim Meyering  <meyering@lucent.com>
10647
10648         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10649
10650         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10651
10652 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10653
10654         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10655
10656 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10657
10658         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10659
10660 2000-06-04  Jim Meyering  <meyering@lucent.com>
10661
10662         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10663         SunOS 4.1.4 for which gid_t is an unsigned type.
10664
10665 2000-06-03  Jim Meyering  <meyering@lucent.com>
10666
10667         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10668
10669 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10670
10671         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10672         newer, don't install charset.alias.
10673         * config.charset: Change the Linux/glibc rules so they become empty
10674         on glibc-2.1 or newer.
10675
10676 2000-06-02  Jim Meyering  <meyering@lucent.com>
10677
10678         * mountlist.c: Back out last change.  Instead, do this...
10679         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10680         member using the same `ignore'-testing code.
10681         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10682         fs_type strings.
10683         From Mark D. Roth.
10684
10685 2000-05-29  Jim Meyering  <meyering@lucent.com>
10686
10687         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10688         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10689
10690 2000-05-22  Jim Meyering  <meyering@lucent.com>
10691
10692         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10693
10694 2000-05-18  Jim Meyering  <meyering@lucent.com>
10695
10696         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10697         back, too, since it may have been modified by allocate_entry.
10698         (hash_delete): Rewrite to use neither the assignment operator
10699         nor the comma operator in an if-expression.
10700
10701 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10702
10703         * closeout.c:
10704         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10705         Remove; no longer needed.
10706         "quotearg.h": Add include.
10707         (file_name): Do not bother to explicitly initialize to NULL; it's less
10708         efficient on some hosts.
10709         (close_stdout_status): Remove test as to whether stdout was already
10710         closed; it breaks for the case "echo x | sort >&-".
10711         Quote file name colons.
10712         Do not assume that _("write error") lacks format strings.
10713
10714 2000-05-15  Jim Meyering  <meyering@lucent.com>
10715
10716         * version-etc.c (version_etc_copyright): Update the copyright string
10717         used in all --version output.
10718
10719 2000-05-14  Jim Meyering  <meyering@lucent.com>
10720
10721         * closeout.c (close_stdout_set_file_name): New function.
10722         (close_stdout_status): Use new file-scoped global.
10723         Return right away if fstat says the stdout file descriptor is invalid.
10724         * closeout.h (close_stdout_set_file_name): Declare.
10725
10726 2000-05-10  Jim Meyering  <meyering@lucent.com>
10727
10728         * closeout.c [default_exit_status]: New file-scoped variable.
10729         (close_stdout_set_status): New function.
10730         * closeout.h (close_stdout_set_status): Declare.
10731
10732 2000-05-08  Jim Meyering  <meyering@lucent.com>
10733
10734         * long-options.c: Don't include closeout.h.
10735         (parse_long_options): Don't call close_stdout for --version.
10736
10737 2000-05-06  Jim Meyering  <meyering@lucent.com>
10738
10739         * strnlen.c: Undefine __strnlen and strnlen.
10740         [!weak_alias]: Define __strnlen to strnlen.
10741
10742         * atexit.c: New file, from libiberty.
10743
10744 2000-05-06  Jim Meyering  <meyering@lucent.com>
10745
10746         * closeout.c (close_stdout_status): Also check for errors on the
10747         stderr stream.
10748
10749 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10750
10751         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10752         instead of xmalloc, xrealloc, path_concat.
10753         (locale_charset): Treat empty environment variables as absent.
10754         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10755
10756 2000-05-04  Jim Meyering  <meyering@lucent.com>
10757
10758         * getopt.c: Update from glibc.
10759         * obstack.c: Likewise.
10760         * obstack.h: Likewise.
10761         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10762
10763         * regex.h: Likewise.
10764         * strndup.c: Likewise.
10765         * strnlen.c: New file, from glibc.
10766
10767 2000-05-01  Jim Meyering  <meyering@lucent.com>
10768
10769         * full-write.c (full_write): Remove `FIXME' part of comment.
10770
10771 2000-04-29  Jim Meyering  <meyering@lucent.com>
10772
10773         * path-concat.c: Declare strdup only if it's not defined.
10774         * canon-host.c: Likewise.
10775
10776 2000-04-28  Jim Meyering  <meyering@lucent.com>
10777
10778         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10779         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10780         included first, then limits.h is included by locale.h by libintl.h.
10781         From John David Anglin.
10782
10783 2000-04-25  Jim Meyering  <meyering@lucent.com>
10784
10785         * makepath.c (S_IRWXUGO): Define.
10786         (make_path): Always perform explicit chmod if MODE specifies any
10787         of the `special' permission bits.  Prompted by a bug report against
10788         install from Mate Wierdl and Joost van Baal.
10789
10790 2000-04-18  Jim Meyering  <meyering@lucent.com>
10791
10792         * README: New file.
10793
10794         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10795         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10796
10797 2000-04-17  Jim Meyering  <meyering@lucent.com>
10798
10799         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10800         the definition of it to rpl_strftime also defined-away the system's
10801         declaration.
10802
10803 2000-04-15  Jim Meyering  <meyering@lucent.com>
10804
10805         Use `C' to denote so-called `contiguous' files, the same way
10806         that tar does.
10807         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10808         (ftypelet): Use S_ISCTG.
10809         From Michael Deutschmann.
10810
10811 2000-04-14  Jim Meyering  <meyering@lucent.com>
10812
10813         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10814
10815 2000-04-08  Jim Meyering  <meyering@lucent.com>
10816
10817         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10818         names don't conflict.  Reported by Eli Zaretskii.
10819
10820 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10821
10822         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10823         bug.  Deal with the different error behavior of Irix iconv.
10824
10825 2000-04-07  Jim Meyering  <meyering@lucent.com>
10826
10827         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10828         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10829
10830 2000-04-05  Jim Meyering  <meyering@lucent.com>
10831
10832         Portability tweaks required for ultrix4.3.
10833         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10834         * readutmp.c: Include sys/types.h before sys/stat.h.
10835         * canon-host.c: Declare strdup.
10836         * path-concat.c: Likewise.
10837         From John David Anglin.
10838
10839 2000-04-04  Jim Meyering  <meyering@lucent.com>
10840
10841         Be more DOS 8.3-friendly.
10842         * ref-add.sin: Renamed from ref-add.sed.in.
10843         * ref-del.sin: Renamed from ref-del.sed.in.
10844         * Makefile.am: Reflect renaming.
10845         Reported by Eli Zaretskii.
10846
10847         Use a temporary file name that won't clash with `charset.alias'
10848         in the DOS 8.3 name space.
10849         * Makefile.am (charset_tmp): Define.
10850         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10851         (uninstall-local): Likewise.
10852         Reported by Eli Zaretskii.
10853
10854 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10855
10856         * time/strftime.c (my_strftime): Make sure we call the system
10857         strftime, not ourselves, when invoking the underlying strftime.
10858
10859 2000-03-24  Jim Meyering  <meyering@lucent.com>
10860
10861         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10862         (charset_alias): Define.
10863         (install-exec-local): Factor out common code.
10864         (uninstall-local): Split lines longer than 80.
10865         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10866         (SUFFIXES): Define.
10867         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10868         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10869
10870 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10871
10872         * config.charset: Output a line containing "Packages using this file".
10873         * ref-add.sed.in, ref-del.sed.in: New files.
10874         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10875         ref-del.sed): New rules.
10876
10877 2000-03-17  Jim Meyering  <meyering@lucent.com>
10878
10879         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10880         Otherwise, include <strings.h>
10881
10882 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10883
10884         * unicodeio.c (utf8_wctomb): New function.
10885         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10886         format instead of in UCS-4 with platform dependent endianness.
10887
10888 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10889
10890         * savedir.c (savedir): Work even if directory size is
10891         negative; this can happen with some screwy NFS configurations.
10892
10893 2000-03-06  Jim Meyering  <meyering@lucent.com>
10894
10895         * localcharset.c (get_charset_aliases): Don't try to free file_name
10896         if it's NULL (because we ran out of memory).  From Bruno Haible.
10897
10898 2000-03-05  Jim Meyering  <meyering@lucent.com>
10899
10900         * localcharset.c ("path-concat.h"): Include.
10901         (get_charset_aliases): Use path_concat instead of ANSI string
10902         concatenation.
10903
10904         * unicodeio.h (PARAMS): Define.
10905         Use it to guard prototype.
10906
10907 2000-03-04  Jim Meyering  <meyering@lucent.com>
10908
10909         * Makefile.am (install-exec-local): Create $(libdir) before installing
10910         into it.
10911         (uninstall-local): Uncomment this rule so `make distcheck' works
10912         once again.
10913
10914         * unicodeio.c (<errno.h>): Include it.
10915         (errno): Declare if not defined.
10916
10917         * localcharset.c: Add Bruno's comment justifying use of volatile.
10918
10919         * config.charset: New version, incorporating remarks from a linux
10920         i18n mailing list.  From Bruno Haible.
10921
10922 2000-03-02  Jim Meyering  <meyering@lucent.com>
10923
10924         * Makefile.am (EXTRA_DIST): Add config.charset.
10925
10926 2000-03-01  Jim Meyering  <meyering@lucent.com>
10927
10928         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10929         * unicodeio.c: Likewise.
10930
10931 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10932
10933         * config.charset: New file.
10934         * localcharset.c: New file.
10935         * unicodeio.h, unicodeio.c: New files.
10936         * Makefile.am (DEFS): Add -DLIBDIR=...
10937         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10938         (noinst_HEADERS): Add unicodeio.h.
10939         (all-local, install-exec-local, charset.alias): New targets.
10940
10941 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10942
10943         * quotearg.c (ALERT_CHAR): New macro.
10944         (quotearg_buffer_restyled): Use it.
10945
10946 2000-02-27  Jim Meyering  <meyering@lucent.com>
10947
10948         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10949         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10950
10951         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10952         not `#if STDC_HEADERS'.
10953         Declare malloc if needed.
10954
10955         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10956         now that autoconf always defines the HAVE_DECL_ symbols.
10957         * human.c: Likewise.
10958         * same.c: Likewise.
10959         * strtoumax.c: Likewise.
10960
10961         * backupfile.c: Arrange for cpp to fail if the configure-time
10962         declaration check was not run.
10963         * hash.c: Likewise.
10964         * human.c: Likewise.
10965         * same.c: Likewise.
10966         * strtoumax.c: Likewise.
10967
10968         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10969         then first look up the entire `.'-containing string as a login name.
10970
10971 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10972
10973         * getdate.y: Handle two-digit years with leading zeros correctly.
10974         (textint): New typedef.
10975         (parser_control): Member year changed from int to textint.
10976         All uses changed.
10977         (YYSTYPE): Removed; replaced by %union with int and textint members.
10978         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10979         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10980         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10981         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10982         (date, number, to_year): Use width of number in digits, not its value,
10983         to determine whether it's a 2-digit year, or a 2-digit time.
10984         (yylex): Store number of digits of numeric tokens.
10985         Reported by John Kendall.
10986
10987         (parser_control): Changed from struct parser_control to typedef (for
10988         consistency).  All uses changed.
10989
10990         (tID): Removed; not used.
10991         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10992
10993 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10994
10995         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10996         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10997
10998 2000-02-12  Jim Meyering  <meyering@lucent.com>
10999
11000         * userspec.c (ISDIGIT): Define it.
11001         (isdigit): Remove definition.
11002         (is_number): Use ISDIGIT, not isdigit.
11003         <libintl.h>: Include.
11004         (_ and N_): Define.
11005         (parse_user_spec): Mark translatable strings.
11006
11007 2000-02-10  Jim Meyering  <meyering@lucent.com>
11008
11009         With these changes, nanosleep.[ch] are finally enough like the other
11010         lib/* replacement files to compile on a few more losing systems.
11011
11012         * nanosleep.h: Don't include config.h.
11013         Remove prototype from declaration of nanosleep.
11014         (PARAMS): Remove now-unneeded definition.
11015         * nanosleep.c: #undef nanosleep.
11016         (rpl_nanosleep): Rename from nanosleep.
11017
11018 2000-02-03  Jim Meyering  <meyering@lucent.com>
11019
11020         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11021         rather than with `#if HAVE_UTMPNAME'.
11022
11023 2000-02-01  Jim Meyering  <meyering@lucent.com>
11024
11025         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
11026
11027 2000-01-31  Jim Meyering  <meyering@lucent.com>
11028
11029         * nanosleep.h (nanosleep): Guard declaration with
11030         `#if ! HAVE_DECL_NANOSLEEP'.
11031         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11032         the declaration in that vendor's sys/timers.h.
11033         Reported by Christian Krackowizer.
11034
11035         * quotearg.c (ISASCII): Add #undef and move definition to follow
11036         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11037         (ISPRINT): Likewise.
11038         Reported by Tom Tromey.
11039
11040 2000-01-30  Jim Meyering  <meyering@lucent.com>
11041
11042         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11043         uses of ->ut_name.  The latter doesn't work with new Linux header files
11044         where only utmpx.ut_user is declared.
11045
11046         * readutmp.h (UT_USER): Define.
11047
11048 2000-01-23  Jim Meyering  <meyering@lucent.com>
11049
11050         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11051         obstack.c.
11052
11053 2000-01-22  Jim Meyering  <meyering@lucent.com>
11054
11055         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11056         [! HAVE_DECL_STRTOULL]: Declare strtoull.
11057         Required for some AIX systems.  Reported by Christian Krackowizer.
11058         [TESTING] (main): New function.
11059
11060         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
11061         * dirname.c (dir_name): Support for DOS-style file names with drive
11062         letters.
11063
11064         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11065
11066         * strverscmp.c (ISDIGIT): Define.
11067         (strverscmp): Use ISDIGIT, not isdigit.
11068
11069 2000-01-17  Paul Eggert  <eggert@twinsun.com>
11070
11071         * nanosleep.c (nanosleep):
11072         Don't use SA_INTERRUPT to decide whether to call sigaction, as
11073         POSIX.1 doesn't require SA_INTERRUPT and some systems
11074         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
11075         it's been part of POSIX.1 since day 1 (in 1988).
11076
11077 2000-01-17  Jim Meyering  <meyering@lucent.com>
11078
11079         * interlock: Remove unused file.  Reported by François Pinard.
11080
11081 2000-01-16  Paul Eggert  <eggert@twinsun.com>
11082
11083         * quotearg.c (quotearg_buffer_restyled): Do not quote
11084         alert, backslash, formfeed, and vertical tab unnecessarily in
11085         shell quoting style.
11086
11087
11088 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11089 Free Software Foundation, Inc.
11090 Copying and distribution of this file, with or without modification,
11091 are permitted provided the copyright notice and this notice are preserved.