1 2006-10-06 Bruno Haible <bruno@clisp.org>
3 * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
4 cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
6 * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
7 cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
8 Return an error indicator.
9 Suggested by Eric Blake.
11 2006-10-06 Bruno Haible <bruno@clisp.org>
13 * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
14 Reported by Eric Blake.
16 2006-09-29 Bruno Haible <bruno@clisp.org>
17 and Paul Eggert <eggert@cs.ucla.edu>
19 * closeout.c (close_stdout): Also close stderr.
20 * closeout.h: Update comment.
22 2006-10-06 Bruno Haible <bruno@clisp.org>
24 * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
25 instead of fopen, fwriteerror.
27 2006-10-05 Bruno Haible <bruno@clisp.org>
29 * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
30 fwriteerror_temp): New declarations.
31 * clean-temp.c (uintptr_t): Provide fallback definition.
32 (descriptors): New variable.
33 (cleanup): First, close the descriptors.
34 (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
35 fclose_temp, fwriteerror_temp): New functions.
37 2006-10-03 Bruno Haible
39 * gl_list.h (gl_sortedlist_search_from_to,
40 gl_sortedlist_indexof_from_to): New declarations.
41 (gl_list_implementation): New fields sortedlist_search_from_to,
42 sortedlist_indexof_from_to.
43 (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
45 * gl_list.c (gl_sortedlist_search_from_to,
46 gl_sortedlist_indexof_from_to): New functions.
47 * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
48 (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
49 (gl_array_sortedlist_search_from_to): New function.
50 (gl_array_list_implementation): Update.
51 * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
52 (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
53 (gl_carray_sortedlist_search_from_to): New function.
54 (gl_carray_list_implementation): Update.
55 * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
56 gl_linked_sortedlist_indexof_from_to): New functions.
57 * gl_linked_list.c (gl_linked_list_implementation): Update.
58 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
59 * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
60 gl_tree_sortedlist_indexof_from_to): New functions.
61 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
62 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
63 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
64 * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
66 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
68 Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
69 <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
70 * dirchownmod.c: Include lchown.h.
71 * lchown.c: Don't include files that lchown.h now includes.
72 Don't declare chown, since lchown.h now does that.
73 * lchown.h: Include errno.h, sys/types.h, unistd.h.
74 (lchown): Define to rpl_chown if lchown is declared but
75 does not exist. Declare using a prototype if lchown is not
76 declared. Add a copyright notice.
77 * mkstemp.h: Include <unistd.h>.
78 * openat.c: Include lchown.h.
80 * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
81 we now test for that separately.
82 * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
83 rather than O_NOFOLLOW, when testing whether it's possible to
84 avoid a race condition reliably.
85 * savewd.c (savewd_chdir): Likewise.
87 Remove macros that are no longer needed now that stdint.h is
89 * fsusage.c (UINTMAX_MAX): Remove.
90 * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
91 * utimecmp.c (SIZE_MAX): Remove.
93 2006-10-03 Bruno Haible <bruno@clisp.org>
95 * gl_list.h (gl_list_search_from, gl_list_search_from_to,
96 gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
97 (struct gl_list_implementation): Add fields search_from_to,
98 indexof_from_to. Remove fields search, indexof.
99 (gl_list_search): Use the search_from_to method.
100 (gl_list_search_from, gl_list_search_from_to): New functions.
101 (gl_list_indexof): Use the indexof_from_to method.
102 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
103 * gl_list.c (gl_list_search): Use the search_from_to method.
104 (gl_list_search_from, gl_list_search_from_to): New functions.
105 (gl_list_indexof): Use the indexof_from_to method.
106 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
107 * gl_array_list.c (gl_array_indexof_from_to): Renamed from
108 gl_array_indexof. Add start_index, end_index arguments.
109 (gl_array_search_from_to): Renamed from gl_array_search. Add
110 start_index, end_index arguments.
111 (gl_array_remove, gl_array_list_implementation): Update.
112 * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
113 gl_carray_indexof. Add start_index, end_index arguments.
114 (gl_carray_search_from_to): Renamed from gl_carray_search. Add
115 start_index, end_index arguments.
116 (gl_carray_remove, gl_carray_list_implementation): Update.
117 * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
118 gl_linked_search. Add start_index, end_index arguments.
119 (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
120 start_index, end_index arguments.
121 (gl_linked_remove): Update.
122 * gl_linked_list.c (gl_linked_list_implementation): Update.
123 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
124 * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
126 * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
127 gl_tree_search. Add start_index, end_index arguments.
128 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
129 start_index, end_index arguments.
130 (gl_tree_remove): Update.
131 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
132 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
133 * gl_anytreehash_list1.h (compare_position_threshold): New function.
134 * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
135 gl_tree_search. Add start_index, end_index arguments.
136 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
137 start_index, end_index arguments.
138 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
139 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
141 2006-10-04 Bruno Haible <bruno@clisp.org>
143 * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
145 2006-10-03 Bruno Haible <bruno@clisp.org>
147 * gl_oset.h (gl_setelement_threshold_fn): New type.
148 (gl_oset_search_atleast): New declaration.
149 (struct gl_oset_implementation): Add field 'search_atleast'.
150 (gl_oset_search_atleast): New inline function.
151 * gl_oset.c (gl_oset_search_atleast): New function.
152 * gl_array_oset.c (gl_array_search_atleast): New function.
153 (gl_array_oset_implementation): Update.
154 * gl_anytree_oset.h (gl_tree_search_atleast): New function.
155 * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
156 * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
158 2006-10-04 Jim Meyering <jim@meyering.net>
160 * fts.c (fts_open): Tiny comment change.
162 2006-10-03 Bruno Haible <bruno@clisp.org>
164 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
165 from gl_avltreehash_list_implementation.
167 2006-10-03 Bruno Haible <bruno@clisp.org>
169 * gl_oset.c (gl_oset_add): Fix return type.
171 2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
173 * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
175 2006-10-02 Paolo Bonzini <bonzini@gnu.org> (tiny change)
177 * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
179 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
181 Work around bug in Solaris 10 /proc file system:
182 /proc/self/fd/NNN/.. isn't the parent directory of
183 the directory whose file descriptor is NNN. This needs to
184 be worked around at run time, not compile time, since a
185 program might be built on Solaris 8, where things work, and
187 * openat-priv.h (BUILD_PROC_NAME): Remove. All callers changed
188 to use the following interface instead:
189 (OPENAT_BUFFER_SIZE): New macro.
190 (openat_proc_name): New function.
191 * at-func.c (AT_FUNC_NAME): Adjust to above changes.
192 * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
194 * openat-proc.c: New file.
196 2006-09-29 Bruno Haible <bruno@clisp.org>
198 * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
199 * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
200 argument. Set stdout_closed before testing for ferror, not after.
201 (fwriteerror, fwriteerror_no_ebadf): New functions.
203 2006-09-28 Bruno Haible <bruno@clisp.org>
205 * strndup.h: Simplify the redefinition of strndup.
206 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
208 2006-09-28 Bruno Haible <bruno@clisp.org>
210 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
211 * gl_linkedhash_list.c: Likewise.
212 * gl_rbtreehash_list.c: Likewise.
214 2006-09-28 Jim Meyering <jim@meyering.net>
216 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
219 2006-09-27 Jim Meyering <jim@meyering.net>
221 This file could end up with a definition for a function
222 named __strndup, rather than rpl_strndup on a system with
223 incomplete weak_alias support.
224 * strndup.c (strndup): Rename from __strndup.
225 Remove #defines that used to map __strndup to strndup.
226 Don't use K&R prototypes.
227 Remove LIBC-related code, since this file is not sync'd with glibc.
228 * strndup.h: Revamp, accordingly.
230 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
232 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
235 * __fpending.h: Don't include <stdio_ext.h> unless
236 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
237 it causes <stdio_ext.h> to cause a compile-time error.
238 Problem reported by Nelson H. F. Beebe.
239 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
240 of HAVE_DECL___PENDING.
242 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
244 * savewd.c: Include <signal.h>, for 'raise'.
246 2006-09-26 Eric Blake <ebb9@byu.net>
248 * verror.c: Include <config.h> unconditionally.
250 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
252 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
253 (gl_linked_iterator_from_to): Initialize struct completely.
254 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
255 (gl_tree_iterator_from_to): Likewise
256 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
257 * gl_array_list.c [lint] (gl_array_iterator)
258 (gl_array_iterator_from_to): Likewise.
259 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
260 * gl_carray_list.c [lint] (gl_carray_iterator)
261 (gl_carray_iterator_from_to): Likewise.
263 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
264 * md4.c (md4_process_block): Remove unused variable.
265 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
266 parentheses for clarity.
268 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
270 Import this patch from libc:
272 2006-09-06 Jakub Jelinek <jakub@redhat.com>
274 * regex_internal.c (re_string_reconstruct): Handle
275 offset < pstr->valid_raw_len && pstr->offsets_needed case.
276 Ensure no bytes read before raw_mbs array. Pass a saved copy of
277 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
278 re_string_context_at.
280 2006-09-20 Bruno Haible <bruno@clisp.org>
282 * mkdtemp.c: Import from libc.
283 2006-04-07 Ulrich Drepper <drepper@redhat.com>
284 * sysdeps/posix/tempname.c (__gen_tempname): Change
285 attempts_min into a macro. Use preprocessor to decide how to
286 initialize attempts [Coverity CID 67].
287 2001-11-27 Paul Eggert <eggert@twinsun.com>
288 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
289 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
291 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
293 * mkstemp.h: New file, since some standard headers
295 * mkstemp.c: Revamp to put the !_LIBC code together.
297 Make the _LIBC code resemble glibc original more,
299 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
300 (mkstemp): Remove, since mkstemp.h does this for us.
301 * stdlib--.h: Include mkstemp.h.
303 Import this patch from libc:
305 2006-04-07 Ulrich Drepper <drepper@redhat.com>
307 * tempname.c (__gen_tempname): Change attempts_min
308 into a macro. Use preprocessor to decide how to initialize
309 attempts [Coverity CID 67].
311 2006-09-18 Bruno Haible <bruno@clisp.org>
313 * javaversion.c: Include configmake.h.
315 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
317 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
318 that prevented coreutils 6.1 from building. Problem reported
319 by Petter Reinholdtsen.
321 2006-09-18 Jim Meyering <jim@meyering.net>
323 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
325 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
327 * dirchownmod.c: Don't include fcntl.h; no longer needed.
328 (dirchownmod): New arg FD. All callers changed.
329 Use FD rather than opening the directory ourself, as opening is
330 now the caller's responsibility.
331 * dirchownmod.h: Likewise.
332 * mkancesdirs.c: Include <sys/types.h>, for portability to older
333 hosts that require <sys/types.h> before <sys/stat.h>. Include
334 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
336 (mkancesdirs): Return length of prefix of FILE that has already
337 been made, or -2 if there is a child doing the work. Redo
338 algorithm so that it is O(N) rather than O(N**2). Optimize away
339 ".", and treat ".." specially since it might stray back into
340 already-created areas. Use a subprocess if necessary. New arg
341 WD; all users changed. MAKE_DIR function should now return 1
342 if it creates a directory that is not readable. Return -2 if
343 a child process is spun off.
344 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
345 Adjust signature to match code.
346 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
347 (make_dir_parents): Use a subprocess if necessary. New arg WD;
349 * savewd.c, savewd.h: New files.
351 2006-09-15 Jim Meyering <jim@meyering.net>
353 * rename-dest-slash.c (has_trailing_slash): Use
354 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
355 (rpl_rename_dest_slash): Perform the cheaper trailing slash
356 test before testing whether SRC is a directory.
357 Suggestions from Bruno Haible.
359 Avoid a warning about an unused variable.
360 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
361 into the #ifdef block where it's used.
363 * rename-dest-slash.c: New file.
365 2006-09-14 Bruno Haible <bruno@clisp.org>
367 * allocsa.c: Include <config.h> unconditionally.
368 * asnprintf.c: Likewise.
369 * asprintf.c: Likewise.
370 * c-strcasecmp.c: Likewise.
371 * c-strcasestr.c: Likewise.
372 * c-strncasecmp.c: Likewise.
373 * c-strstr.c: Likewise.
374 * classpath.c: Likewise.
375 * clean-temp.c: Likewise.
376 * concatpath.c: Likewise.
377 * copy-file.c: Likewise.
378 * csharpcomp.c: Likewise.
379 * csharpexec.c: Likewise.
380 * execute.c: Likewise.
381 * fatal-signal.c: Likewise.
382 * findprog.c: Likewise.
383 * fwriteerror.c: Likewise.
384 * gl_array_list.c: Likewise.
385 * gl_array_oset.c: Likewise.
386 * gl_avltree_list.c: Likewise.
387 * gl_avltree_oset.c: Likewise.
388 * gl_avltreehash_list.c: Likewise.
389 * gl_carray_list.c: Likewise.
390 * gl_linked_list.c: Likewise.
391 * gl_linkedhash_list.c: Likewise.
392 * gl_list.c: Likewise.
393 * gl_oset.c: Likewise.
394 * gl_rbtree_list.c: Likewise.
395 * gl_rbtree_oset.c: Likewise.
396 * gl_rbtreehash_list.c: Likewise.
397 * imaxabs.c: Likewise.
398 * imaxdiv.c: Likewise.
399 * javacomp.c: Likewise.
400 * javaexec.c: Likewise.
401 * javaversion.c: Likewise.
402 * linebreak.c: Likewise.
403 * localcharset.c: Likewise.
405 * mbchar.c: Likewise.
406 * mbswidth.c: Likewise.
407 * mkdtemp.c: Likewise.
409 * printf-args.c: Likewise.
410 * printf-parse.c: Likewise.
411 * progname.c: Likewise.
412 * progreloc.c: Likewise.
413 * readlink.c: Likewise.
414 * sh-quote.c: Likewise.
415 * stpcpy.c: Likewise.
416 * stpncpy.c: Likewise.
417 * strcasecmp.c: Likewise.
418 * strcasestr.c: Likewise.
419 * strcspn.c: Likewise.
420 * striconv.c: Likewise.
421 * strncasecmp.c: Likewise.
422 * strnlen1.c: Likewise.
423 * strstr.c: Likewise.
424 * strtok_r.c: Likewise.
426 * tmpdir.c: Likewise.
427 * unicodeio.c: Likewise.
428 * unsetenv.c: Likewise.
429 * vasnprintf.c: Likewise.
430 * vasprintf.c: Likewise.
431 * wait-process.c: Likewise.
432 * xallocsa.c: Likewise.
433 * xsetenv.c: Likewise.
434 * xstriconv.c: Likewise.
436 2006-09-13 Eric Blake <ebb9@byu.net>
438 * getopt.c: Fix typo in last commit.
440 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
442 * _fpending.c: Include <config.h> unconditionally, since we no
443 longer worry about uses that don't define HAVE_CONFIG_H.
444 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
445 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
446 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
447 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
448 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
449 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
450 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
451 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
452 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
453 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
454 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
455 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
456 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
457 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
458 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
459 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
460 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
461 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
462 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
463 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
464 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
465 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
466 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
467 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
468 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
469 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
470 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
471 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
472 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
473 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
474 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
475 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
476 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
477 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
480 2006-09-12 Jim Meyering <jim@meyering.net>
482 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
483 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
484 Reported by Nelson H. F. Beebe.
486 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
488 * argp-help.c (argp_doc): Make sure NULL is not passed to
491 2006-09-10 Bruno Haible <bruno@clisp.org>
493 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
495 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
497 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
498 program_invocation_name and program_invocation_short_name are
500 * argp-namefrob.h: Move declarations of program_invocation_name
501 and program_invocation_short_name to argp.h, so they are visible
505 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
507 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
508 convention. Text proposed by Bruno Haible.
509 (struct argp_option): Document the use of N_() wrappers.
511 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
512 and translate the two parts separately, instead of feeding
513 the whole string to gettext. This allows to exclude
514 '\v' from the strings visible to the translator by writing doc
515 strings as N_("..") "\v" N_("..").
517 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
519 * mktime.c (guess_time_tm): Fix bug where mktime
520 returned the maximum time_t value rather than (time_t) -1.
521 Problem originally reported by William Bardwell
522 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
524 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
526 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
529 2006-09-06 Bruno Haible <bruno@clisp.org>
531 * striconv.h: New file.
532 * striconv.c: New file, merging iconvme.c with GNU gettext's
534 * xstriconv.h: New file.
535 * xstriconv.c: New file.
537 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
539 * argz_.h: Sync from Libtool.
541 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
542 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
544 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
546 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
551 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
553 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
554 Problem reported by Ralf Wildenhues in
555 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
557 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
558 HAVE_STRUCT_STATFS_F_FSTYPENAME.
560 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
562 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
563 or stdbool.h, because they might not exist while configuring.
565 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
566 Don't include unistd.h or limits.h; not needed, since chdir-long.h
568 (O_DIRECTORY): Remove.
570 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
572 Work around a bug in both the Linux and SunOS 64-bit kernels:
573 nanosleep mishandles sleeps for longer than 2**31 seconds.
574 Problem reported by Frank v Waveren in
575 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
576 * nanosleep.c (BILLION): New constant.
577 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
578 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
580 2006-08-30 Jim Meyering <jim@meyering.net>
582 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
585 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
587 * isapipe.c, isapipe.h: New files.
589 2006-08-29 Eric Blake <ebb9@byu.net>
591 * error.c (error_at_line, print_errno_message): Match libc, after
592 resolution of upstream bug 3044.
594 2006-08-29 Bruno Haible <bruno@clisp.org>
596 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
598 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
602 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
604 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
605 sharing with gnulib. Report by Eric Blake.
607 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
609 * fcntl_.h: New file.
610 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
612 * dirchownmod.c: Likewise.
615 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
616 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
617 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
618 just before including <inttypes.h>, to avoid circular inclusion.
620 2006-08-28 Bruno Haible <bruno@clisp.org>
622 * inttypes_.h (SCNX*): Remove definitions.
623 Reported by Eric Blake.
625 2006-08-26 Bruno Haible <bruno@clisp.org>
627 * vasnprintf.c (EOVERFLOW): Remove definition.
628 (VASNPRINTF): Return a string of length > INT_MAX without failing.
629 * vasprintf.c: Include errno.h, limits.h.
630 (EOVERFLOW): New fallback definition.
631 (vasprintf): Test here whether the string length is > INT_MAX.
632 * vsnprintf.c: Include errno.h, limits.h.
633 (EOVERFLOW): New fallback definition.
634 (vsnprintf): Fix bug when generated string was too long for the buffer.
635 Test here whether the string length is > INT_MAX.
637 2006-08-26 Bruno Haible <bruno@clisp.org>
638 Simon Josefsson <jas@extundo.com>
641 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
643 2006-08-28 Bruno Haible <bruno@clisp.org>
645 * c-strstr.h: New file, from GNU gettext.
646 * c-strstr.c: New file, from GNU gettext.
648 2006-08-26 Bruno Haible <bruno@clisp.org>
650 * inttypes_.h: New file.
651 * inttypes.h: Remove file.
652 * stdint_.h: Include <inttypes.h> through its absolute filename.
654 * imaxabs.c: New file.
656 * imaxdiv.c: New file.
658 2006-08-22 Bruno Haible <bruno@clisp.org>
660 * readutmp.h: Skip most definitions if neither <utmp.h> nor
663 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
666 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
667 Problem reported by Bruno Haible.
669 2006-08-21 Bruno Haible <bruno@clisp.org>
672 * mbchar.h: Include <wctype.h> only if it exists.
674 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
676 * cycle-check.h: Include <stdint.h> unconditionally, since we
677 now assume the stdint module. Do not include inttypes.h.
678 * fsusage.h: Likewise.
679 * getndelim2.c: Likewise.
681 * inttostr.h: Likewise.
682 * obstack.c: Likewise.
683 * regex_internal.h: Likewise.
684 * tempname.c: Likewise.
685 * utimecmp.c: Likewise.
686 * xstrtol.h: Likewise.
688 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
690 * strtoimax.c: Adjust to macro name changes in Autoconf,
691 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
694 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
696 * fchmodat.c: New file, from coreutils. This was inadvertently
697 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
699 2006-08-18 Bruno Haible <bruno@clisp.org>
701 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
702 (ME_DUMMY): Treat "kernfs" as a dummy.
703 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
705 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
707 Update from coreutils.
709 * __fpending.h: Add copyright notice.
710 * fprintftime.h: Likewise.
711 * savedir.c: Use (C) in copyright notice.
712 * savedir.h: Likewise.
714 2006-08-15 Jim Meyering <jim@meyering.net>
716 * at-func.c: New file, with the logic of all emulated at-functions.
717 * openat-priv.h: Include <errno.h> and define ENOSYS,
718 in support of the EXPECTED_ERRNO macro.
719 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
720 Instead, define the appropriate symbols and include "at-func.c".
721 * mkdirat.c (mkdirat): Likewise.
722 * fchmodat.c (fchmodat): Likewise.
723 (ENOSYS): Remove definition.
724 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
725 Don't include "unistd--.h" -- it wasn't ever used.
727 2006-01-17 Jim Meyering <jim@meyering.net>
729 Rewrite fts.c not to change the current working directory,
730 by using openat, fstatat, fdopendir, etc..
732 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
733 (HAVE_OPENAT_SUPPORT): Define.
734 [_LIBC] (fchdir): Don't undef or define; no longer used.
735 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
736 Now, this `function' always succeeds, and consumes its file descriptor
737 parameter -- so callers must not close such FDs. Update callers.
738 (diropen_fd, opendirat, cwd_advance_fd): New functions.
739 (diropen): Add parameter, SP. Adjust all callers.
740 Implement using diropen_fd, rather than open.
741 (fts_open): Initialize new member, fts_cwd_fd.
742 Remove fts_rft-setting code.
743 (fts_close): Close fts_cwd_fd, if necessary.
744 (__opendir2): Define in terms of opendir or opendirat,
745 depending on whether the FST_NOCHDIR flag is set.
746 (fts_build): Since fts_safe_changedir consumes its FD, and since
747 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
748 and close the dup'd file descriptor upon failure.
749 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
750 (fts_safe_changedir): Tweak semantics to reflect that this function
751 now calls cwd_advance_fd and hence consumes its FD argument.
752 * fts_.h [struct FTS] (fts_cwd_fd): New member.
753 [struct FTS] (fts_rft): Remove now-unused member.
754 [struct FTS] (fts_cycle.state): Improve comment.
756 * openat.c (openat_needs_fchdir): New function.
757 * openat.h (openat_needs_fchdir): Declare it.
759 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
761 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
762 Problem and fix reported by Pádraig Brady in
763 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
765 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
767 * memcoll.c (memcoll): Optimize for the common case where the
768 arguments are bytewise equal.
770 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
772 Change copyright notice from LGPL 2 to GPL 2, since that's the
773 standard form used in the gnulib repository.
774 * lock.c: LGPL -> GPL.
776 * strnlen1.c: Likewise.
777 * strnlen1.h: Likewise.
780 * tmpdir.c: Likewise.
782 * TODO: Remove; this belongs only in coreutils.
784 2006-08-14 Eric Blake <ebb9@byu.net>
786 Import the following change from libc:
788 2006-08-12 Ulrich Drepper <drepper@redhat.com>
791 * misc/error.c: Add space between program name and message if file
794 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
796 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
797 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
799 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
800 in wchar_t. Problem reported by Eric Blake.
802 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
803 LEN is smaller than SIZE. Suggested by Bruno Haible.
804 Also, help the compiler to keep LEN in a register.
806 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
808 * .cppi-disable: Add snprintf.h, socket_.h.
809 * snprintf.c: Include <errno.h> and <limits.h>.
810 (EOVERFLOW): Define if the system does not.
811 Do not include "minmax.h"; it wasn't used.
812 (snprintf): Don't assume size_t promotes to an unsigned type.
813 Fix bug when generated string was too long for the buffer: the
814 buffer's contents are supposed to be the initial prefix of the
815 output. Don't assume vasnprintf returns EOVERFLOW if the size
816 exceeds INT_MAX; do the check ourselves.
818 Import the following changes from libc:
820 2006-06-02 Jakub Jelinek <jakub@redhat.com>
822 * posix/regex_internal.c (re_string_skip_chars): If no character has
823 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
824 to the byte which couldn't be converted.
825 (re_string_reconstruct): Don't clear valid_raw_len before calling
826 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
827 tip_context using re_string_context_at.
829 2006-05-02 Ulrich Drepper <drepper@redhat.com>
831 * posix/regex.h: g++ still cannot handled [restrict].
833 2006-04-21 Ulrich Drepper <drepper@redhat.com>
835 * posix/regex.h: Remove special handling for VMS.
837 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
841 2006-07-19 Mike Frysinger <vapier@gentoo.org>
843 * mountlist.c [ME_REMOTE]: Filter out cifs.
844 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
846 2006-08-08 Eric Blake <ebb9@byu.net>
848 * verror.c (verror_at_line): Work around glibc bug 2997, so that
849 verror_at_line output complies with GNU Coding Standards even when
852 2006-08-08 Eric Blake <ebb9@byu.net>
854 * verror.h, verror.c: New files.
856 2006-08-07 Bruno Haible <bruno@clisp.org>
858 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
860 Reported by Ralf Wildenhues.
862 2006-08-06 Eric Blake <ebb9@byu.net>
864 * error.h: Fold in some upstream changes from glibc.
867 2006-07-29 Bruno Haible <bruno@clisp.org>
869 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
871 2006-07-29 Bruno Haible <bruno@clisp.org>
873 * setenv.c: Undo unintended modification done on 2006-02-27.
875 2006-07-28 Eric Blake <ebb9@byu.net>
877 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
880 2006-07-28 Simon Josefsson <jas@extundo.com>
882 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
885 2006-07-28 Simon Josefsson <jas@extundo.com>
887 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
890 2006-07-28 Bruno Haible <bruno@clisp.org>
892 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
894 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
896 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
899 2006-07-28 Bruno Haible <bruno@clisp.org>
901 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
902 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
904 Avoids link error on FreeBSD 4.x.
905 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
907 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
909 * mbswidth.c (iswcntrl): Likewise.
911 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
913 * modechange.c (mode_compile): Numeric modes now affect setuid and
914 setgid on directories only if they set these bits.
915 * modechange.h: Remove obsolete comment about masks.
917 2006-07-27 Bruno Haible <bruno@clisp.org>
919 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
920 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
923 2006-07-26 Eric Blake <ebb9@byu.net>
925 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
926 like mingw that lack mkstemp.
927 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
928 avoid compilation warning on mingw.
930 2006-07-25 Bruno Haible <bruno@clisp.org>
932 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
933 <stdarg.h> or config.h.
935 2006-07-24 Bruno Haible <bruno@clisp.org>
937 * clean-temp.h: New file, from GNU gettext.
938 * clean-temp.c: New file, from GNU gettext.
940 2006-07-24 Bruno Haible <bruno@clisp.org>
942 * tmpdir.h: New file, from GNU gettext.
943 * tmpdir.c: New file, from GNU gettext.
945 2006-07-23 Bruno Haible <bruno@clisp.org>
947 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
948 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
949 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
950 gl_linked_remove_at): Use it.
952 2006-07-23 Eric Blake <ebb9@byu.net>
954 * tmpfile-safer.c: New file.
955 * stdio-safer.h (fopen_safer): Add prototype.
956 * stdio--.h (tmpfile): Make safer.
958 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
960 * close-stream.c, close-stream.h: New files.
962 2006-07-22 Bruno Haible <bruno@clisp.org>
964 Merge from GNU gettext 0.15.
966 2005-07-05 Bruno Haible <bruno@clisp.org>
968 * printf-args.c (printf_fetchargs): Work around broken
969 definition of wint_t on mingw.
971 2005-02-12 Bruno Haible <bruno@clisp.org>
973 * xallocsa.h: Add extern "C" for C++.
975 2006-05-17 Bruno Haible <bruno@clisp.org>
978 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
980 2006-04-30 Bruno Haible <bruno@clisp.org>
982 * progreloc.c: Include <mach-o/dyld.h> if available.
983 (find_executable): Use _NSGetExecutablePath when possible.
985 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
987 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
990 2005-12-29 Bruno Haible <bruno@clisp.org>
992 * progreloc.c (set_program_name_and_installdir): Fix
995 2005-12-04 Bruno Haible <bruno@clisp.org>
998 * progreloc.c: Include <windows.h> also on Cygwin.
999 (find_executable): Add support for Cygwin.
1000 (set_program_name_and_installdir): Handle also platforms with
1003 2006-07-11 Bruno Haible <bruno@clisp.org>
1005 * javacomp.c: Fix a comment.
1006 Reported by Jim Meyering.
1008 2006-04-30 Bruno Haible <bruno@clisp.org>
1010 * javacomp.h (compile_java_class): Add source_version,
1011 target_version arguments.
1012 * javacomp.c: Rewritten to choose only a compiler that
1013 respects the specified source_version and target_version.
1015 2006-06-27 Bruno Haible <bruno@clisp.org>
1017 Assume correct S_ISDIR macro.
1018 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1020 2006-07-22 Bruno Haible <bruno@clisp.org>
1022 * javaversion.h: New file, from GNU gettext.
1023 * javaversion.c: New file, from GNU gettext.
1024 * javaversion.java: New file, from GNU gettext.
1025 * javaversion.class: New file, from GNU gettext.
1027 2006-05-17 Bruno Haible <bruno@clisp.org>
1030 * javaexec.c (execute_java_class): Test for jview program
1033 2006-04-09 Bruno Haible <bruno@clisp.org>
1035 * fatal-signal.c: Don't include string.h.
1036 (at_fatal_signal): Use a copying loop instead of memcpy.
1038 2005-12-04 Bruno Haible <bruno@clisp.org>
1040 * csharpexec.c: Add support for 'clix' launcher (untested).
1041 (execute_csharp_using_sscli): New function.
1042 (execute_csharp_program): Call it.
1044 2006-06-21 Bruno Haible <bruno@clisp.org>
1046 Avoid warnings from recent versions of mcs.
1047 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1048 -o, -L, -r any more. Use options documented since mcs-1.0
1049 instead. Similarly for -g.
1051 2005-07-09 Bruno Haible <bruno@clisp.org>
1053 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1055 Reported by Mark Junker <mjscod@gmx.de>.
1057 2006-06-17 Bruno Haible <bruno@clisp.org>
1059 * config.charset: Update for NetBSD 3.0.
1061 2006-05-17 Bruno Haible <bruno@clisp.org>
1064 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1066 2006-05-16 Bruno Haible <bruno@clisp.org>
1068 * localcharset.c [CYGWIN]: Include <windows.h>.
1069 (get_charset_aliases): For Cygwin, return the same CPxxx
1070 aliases list as under WIN32.
1071 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1072 the environment variables. Fall back to GetACP().
1074 2006-04-05 Bruno Haible <bruno@clisp.org>
1076 * config.charset: Update Juan Manuel Guerrero's address.
1078 2005-02-12 Bruno Haible <bruno@clisp.org>
1080 * allocsa.h: Add extern "C" for C++.
1082 2005-02-10 Bruno Haible <bruno@clisp.org>
1084 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1085 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1087 2006-07-22 Bruno Haible <bruno@clisp.org>
1089 * gettext.h: Update to GNU gettext-0.15.
1091 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1092 and Simon Josefsson <jas@extundo.com>
1094 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1096 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1098 2006-07-21 Eric Blake <ebb9@byu.net>
1100 * stdlib-safer.h: New file from coreutils, required by
1103 2006-07-19 Derek R. Price <derek@ximbiot.com>
1105 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1106 Reindent and repaginate.
1108 2006-07-17 Bruno Haible <bruno@clisp.org>
1110 * gl_list.h: New file.
1111 * gl_list.c: New file.
1112 * gl_array_list.h: New file.
1113 * gl_array_list.c: New file.
1114 * gl_carray_list.h: New file.
1115 * gl_carray_list.c: New file.
1116 * gl_linked_list.h: New file.
1117 * gl_linked_list.c: New file.
1118 * gl_anylinked_list1.h: New file.
1119 * gl_anylinked_list2.h: New file.
1120 * gl_avltree_list.h: New file.
1121 * gl_avltree_list.c: New file.
1122 * gl_anyavltree_list1.h: New file.
1123 * gl_anyavltree_list2.h: New file.
1124 * gl_rbtree_list.h: New file.
1125 * gl_rbtree_list.c: New file.
1126 * gl_anyrbtree_list1.h: New file.
1127 * gl_anyrbtree_list2.h: New file.
1128 * gl_anytree_list1.h: New file.
1129 * gl_anytree_list2.h: New file.
1130 * gl_linkedhash_list.h: New file.
1131 * gl_linkedhash_list.c: New file.
1132 * gl_anyhash_list1.h: New file.
1133 * gl_anyhash_list2.h: New file.
1134 * gl_avltreehash_list.h: New file.
1135 * gl_avltreehash_list.c: New file.
1136 * gl_rbtreehash_list.h: New file.
1137 * gl_rbtreehash_list.c: New file.
1138 * gl_anytreehash_list1.h: New file.
1139 * gl_anytreehash_list2.h: New file.
1141 * gl_oset.h: New file.
1142 * gl_oset.c: New file.
1143 * gl_array_oset.h: New file.
1144 * gl_array_oset.c: New file.
1145 * gl_avltree_oset.h: New file.
1146 * gl_avltree_oset.c: New file.
1147 * gl_rbtree_oset.h: New file.
1148 * gl_rbtree_oset.c: New file.
1149 * gl_anytree_oset.h: New file.
1151 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1153 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1155 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1156 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1157 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1158 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1159 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1160 callers changed. Revamp internals significantly, by not
1161 attempting to create directories that are temporarily more
1162 permissive than the final results. Do not attempt to use
1163 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1164 This removes some race conditions, fixes some bugs, and simplifies
1165 things. Use new dirchownmod function to do owner and mode changes.
1166 * mkdir-p.h: Likewise.
1167 * modechange.c (octal_to_mode): New function.
1168 (struct mode_change): New member mentioned.
1169 (make_node_op_equals): New arg mentioned. All callers changed.
1170 (mode_compile): Keep track of which mode bits the user has explicitly
1172 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1173 New arg PMODE_BITS, to keep track of which mode bits the user
1174 mentioned; it treats S_ISUID and S_ISGID speciall.
1175 All callers changed.
1176 * modechange.h: Likewise.
1178 2006-07-11 Derek R. Price <derek@ximbiot.com>
1180 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1182 2006-07-10 Derek R. Price <derek@ximbiot.com>
1184 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1185 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1186 macros into the GNU _D_EXACT_NAMLEN.
1187 * savedir.c: Likewise.
1188 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1190 2006-07-09 Jim Meyering <jim@meyering.net>
1192 * argp-pv.c: Remove a doubled word in a comment.
1193 * check-version.c (check_version): Likewise.
1194 * javacomp.c (compile_java_class): Likewise.
1196 2006-07-08 Jim Meyering <jim@meyering.net>
1198 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1200 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1202 * getaddrinfo.c: Changes to compile under MSVC6: changed
1203 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1204 brackets. Other minor changes to suppress some compiler
1207 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1209 * getloadavg.c: Use __VMS, not VMS.
1210 * getopt.c: Likewise.
1211 * getpagesize.h: Likewise.
1212 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1213 probably does not work.
1215 2006-07-06 Derek R. Price <derek@ximbiot.com>
1216 and Paul Eggert <eggert@cs.ucla.edu>
1218 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1219 Don't worry about this obsolete case any more.
1220 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1222 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1223 worry about this obsolete case any more.
1225 * getcwd.c: Likewise.
1227 * savedir.c: Likewise.
1229 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1231 * .cppi-disable: Add wcwidth.
1232 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1233 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1234 (ISGRAPH): Remove. All uses changed to isgraph.
1235 (FOLD) [!defined _LIBC]: Remove special case.
1236 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1237 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1239 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1241 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1243 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1245 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1247 * memcasecmp.c: Include <limits.h>.
1248 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1249 * strtod.c (strtod): Don't assume isspace works on negative chars.
1250 Don't assume isdigit succeeds only on '0' through '9'.
1252 2006-07-05 Derek R. Price <derek@ximbiot.com>
1254 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1255 All uses of is_space replaced by isspace.
1256 * exit.h: Don't talk about STDC_HEADERS.
1257 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1258 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1259 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1260 replaced by isprint etc.
1261 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1262 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1263 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1264 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1265 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1266 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1268 2006-07-05 Eric Blake <ebb9@byu.net>
1270 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1271 missing from netdb.h.
1272 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1274 2006-06-27 Bruno Haible <bruno@clisp.org>
1276 Assume ANSI C header files and <ctype.h> functions.
1277 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1278 (mbsnwidth): Use isprint, iscntrl instead.
1280 2006-07-03 Jim Meyering <jim@meyering.net>
1282 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1283 macro is used before the first cycle_check call.
1285 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1287 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1288 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1289 reported by Mark D. Baushke, one in
1290 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1292 Merge from coreutils.
1294 * .cppi-disable: Add stdint_.h.
1295 * .cvsignore: Add stdint.h.
1297 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1299 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1300 both double and long double versions.
1301 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1302 * xstrtold.c: New file.
1303 * xstrtod.h (xstrtold): New decl.
1305 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1307 * filemode.c (setst): Remove.
1308 (strmode): Rewrite to avoid setst. This makes the code shorter,
1309 (arguably) clearer, and the generated code is a bit smaller on my
1310 Debian GNU/Linux stable x86 host.
1312 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1314 * filemode.c: Include "filemode.h" first, to test the interface.
1315 Assume that filemode.h includes sys/types.h and sys/stat.h.
1316 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1317 (ftypelet): Reorder to put common cases first, for efficiency.
1318 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1320 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1321 of 10, for compatibility with FreeBSD. All callers changed.
1322 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1323 that can't be deduced solely from st_mode. First arg is now a const
1325 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1326 (strmode): Renamed from mode_string.
1327 (filemodestring): New decl.
1328 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1329 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1330 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1332 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1334 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1335 fsusage.h now does that. Include fsusage.h first, to test interface.
1336 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1337 at most one method (the old code could have generated decls that
1338 didn't conform to C89, not that this was ever exercised).
1339 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1341 2006-03-19 Jim Meyering <jim@meyering.net>
1343 Work even in a chroot where d_ino values for entries in "/"
1344 don't match the stat.st_ino values for the same names.
1345 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1346 number, iterate through all entries again, using lstat instead.
1347 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1348 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1350 * getcwd.c (__getcwd): Clarify a comment.
1351 Use memcpy in place of a call to strcpy.
1353 2006-03-12 Jim Meyering <jim@meyering.net>
1355 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1356 that of the current directory (which we're about to chdir ".." out of),
1357 then save the dev-ino of the parent, instead.
1359 * same-inode.h (SAME_INODE): New file/macro.
1360 * chdir-safer.c (SAME_INODE): Remove definition.
1361 Include "same-inode.h", instead.
1363 * cycle-check.h: Include "same-inode.h".
1364 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1365 * cycle-check.c (SAME_INODE): Remove definition.
1366 * root-dev-ino.h: Include "same-inode.h".
1368 2006-03-11 Eric Blake <ebb9@byu.net>
1370 * same.c (same_name): s/base_name/last_component/
1371 * backupfile.c (check_extension, numbered_backup): Likewise.
1372 * filenamecat.c (file_name_concat): Likewise.
1374 2006-03-11 Eric Blake <ebb9@byu.net>,
1375 Paul Eggert <eggert@cs.ucla.edu>
1377 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1378 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1380 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1381 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1382 (last_component): New method.
1383 * dirname.c (dir_len): Determine when drive letters need a
1384 subsequent slash. Preserve // when it is special.
1385 (dir_name): Don't append dot when drive letter is absolute.
1386 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1387 * basename.c (base_name): New semantics - malloc the result.
1388 Preserve // when it is special. Preserve relative files that look
1390 (base_len): Preserve // when it is special.
1391 (last_component): New method, similar to old base_name semantics.
1392 * stripslash.c (strip_trailing_slashes): Use last_component, not
1393 base_name. Strip redundant slashes from ///.
1395 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1397 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1398 both are 64 bits, since this seems to be the tradition, and this
1399 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1400 we ever run into a host that prefers long long to long in this
1401 case, we'll need another configure-time test. Problem reported by
1404 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1406 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1407 possible collision with system files.
1408 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1409 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1410 WCHAR_MIN and WCHAR_MAX in this case.
1411 (<stddef.h>): Do not include; no longer needed.
1412 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1413 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1414 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1415 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1416 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1417 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1418 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1419 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1420 !defined(__c99))]: Include in this case too, since it's harmless
1422 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1424 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1425 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1426 (_STDINT_MIN, _STDINT_MAX): New macros.
1427 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1428 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1429 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1430 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1431 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1432 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1433 macros, not typedefs; this simplifies things quite a bit.
1434 Use long int for all types narrower than int64_t.
1435 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1436 Define in terms of long long int or int64_t or long int,
1437 not int64_t or int32_t. This saves some compile-time testing.
1438 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1439 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1440 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1441 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1442 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1443 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1444 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1445 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1446 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1447 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1448 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1449 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1450 undef any previous version and define our own version, for
1451 simplicity and consistency with the new macros for types.
1452 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1453 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1454 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1455 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1456 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1457 @WINT_T_SUFFIX@ to keep things simple here.
1458 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1459 Simplify by assuming typical 8/16/32/64 host, since we're
1460 already doing that elsewhere anyway.
1461 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1462 and assume long long int is 64 bits if available. This
1463 speeds up 'configure'.
1465 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1467 * getaddrinfo.c: fixed typo
1469 2006-06-29 Eric Blake <ebb9@byu.net>
1471 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1472 unused static function.
1474 2006-06-29 Eric Blake <ebb9@byu.net>
1476 * stat_.h: New file.
1478 2006-06-29 Derek R. Price <derek@ximbiot.com>
1480 * strftime.c: Assume strftime() exists.
1482 2006-06-28 Bruno Haible <bruno@clisp.org>
1484 * getaddrinfo.h: Fix POSIX URL.
1485 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1486 (use_win32_p): Make static.
1487 (getaddrinfo): Reject service name if it is empty or does not consist
1488 solely of decimal digits, or if its value is > 65535.
1489 (getnameinfo): Remove useless casts.
1491 2006-06-28 Derek R. Price <derek@ximbiot.com>
1493 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1494 Autoconf 2.60 says this stuff was obsolete.
1496 2006-05-12 Bruno Haible <bruno@clisp.org>
1498 * mkdtemp.c [MINGW]: Include <io.h>.
1499 (mkdir): Define using _mkdir.
1501 2006-06-28 Bruno Haible <bruno@clisp.org>
1503 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1504 declaration for wcwidth.
1505 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1507 2006-06-28 Eric Blake <ebb9@byu.net>
1509 * xvasprintf.h: Fix comments.
1511 2006-06-28 Eric Blake <ebb9@byu.net>
1513 * mbchar.h (wcwidth): Include wcwidth.h.
1514 * mbswidth.c (wcwidth): Move from here...
1515 * wcwidth.h: ...to this new file.
1517 2006-06-28 Simon Josefsson <jas@extundo.com>
1519 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1520 functions there. It will succeed on Windows XP, but on Windows
1521 2000 and (presumably) earlier, it will fail, and use the internal
1523 (use_win32_p): New function.
1524 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1525 Support AI_NUMERICSERV to disable getservbyname.
1526 (getnameinfo): New function, only supports
1527 NI_NUMERICHOST|NI_NUMERICSERV for now.
1529 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1530 only have some of them. Add AI_NUMERICSERV. Add prototype for
1533 2006-06-27 Bruno Haible <bruno@clisp.org>
1535 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1537 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1539 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1540 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1541 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1543 2006-06-26 Bruno Haible <bruno@clisp.org>
1545 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1547 Reported by Mark D. Baushke and Larry Jones.
1549 2006-06-26 Bruno Haible <bruno@clisp.org>
1551 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1553 Suggested by Mark D. Baushke and Larry Jones.
1555 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1557 * stdint_.h: Treat BSD/OS like OpenBSD.
1559 2006-06-23 Bruno Haible <bruno@clisp.org>
1561 * stdint_.h: Treat IRIX like OpenBSD.
1563 2006-06-23 Bruno Haible <bruno@clisp.org>
1565 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1566 ISO C 99 Technical Corrigendum 1.
1568 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1570 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1571 Some compiler complained about some of them. Problem reported by
1573 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1575 2006-06-21 Simon Josefsson <jas@extundo.com>
1577 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1580 * socket_.h: Don't define WINVER.
1582 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1583 slightly modified to work in gnulib.
1585 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1587 * read-file.c (fread_file): Start with buffer allocation of
1588 0 bytes rather than 1 byte; this simplifies the code.
1589 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1590 code to free buffer and save/restore errno.
1591 (internal_read_file): Remove unused local.
1593 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1595 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1596 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1597 Problem reported by Denis Excoffier in
1598 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1600 2006-06-19 Simon Josefsson <jas@extundo.com>
1602 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1604 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1606 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1608 2006-06-17 Bruno Haible <bruno@clisp.org>
1610 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1612 2006-06-17 Bruno Haible <bruno@clisp.org>
1614 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1615 problem on Solaris 2.5.1.
1617 2006-06-16 Eric Blake <ebb9@byu.net>
1619 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1620 * unicodeio.c [!defined errno]: Likewise.
1621 * strtol.c [!defined errno]: Likewise.
1622 * strtod.c [!defined errno]: Likewise.
1624 2006-06-15 Bruno Haible <bruno@clisp.org>
1626 * stdint_.h: Rewritten to be fully auto-configured.
1627 Fixes bug on HP-UX/IA64.
1629 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1631 * getdate.y (__attribute__): Don't define if already defined.
1632 Problem reported by Larry Jones.
1633 * utimens.c (__attribute__): Likewise.
1635 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1637 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1638 reported by Andreas Schwab.
1640 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1641 Bruno Haible <bruno@clisp.org>
1643 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1645 2006-05-26 Martin Lambers <marlam@marlam.de>
1647 * getpass.c: Updates the test for the native W32 API, and adds
1648 missing includes, thus fixing compilation warnings.
1650 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1652 * tempname.c (small_open, large_open): New macros.
1653 (__open, __open64) [!_LIBC]: Remove.
1654 (__gen_tempname): Use small_open and large_open instead of __open
1655 and __open64. This fixes a portability bug on HP-UX 11.11i
1656 reported by Simon Wing-Tang in
1657 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1659 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1661 * exclude.c (exclude_fnmatch): New function.
1662 (excluded_file_name): Call exclude_fnmatch.
1663 * exclude.h (excluded_file_name): New prototype
1665 2006-05-24 Bruno Haible <bruno@clisp.org>
1667 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1668 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1669 Reported by Thorsten Maerz <torte@netztorte.de> via
1670 Aaron Stone <aaron@serendipity.cx>.
1672 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1674 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1675 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1676 (my_usleep): Don't mishandle maximum value.
1678 2006-05-19 Jim Meyering <jim@meyering.net>
1680 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1682 2006-05-17 Bruno Haible <bruno@clisp.org>
1685 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1687 2006-05-17 Bruno Haible <bruno@clisp.org>
1689 * stdint_.h: Fix recognition of Cygwin.
1691 2006-05-11 Jim Meyering <jim@meyering.net>
1693 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1695 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1697 * crc.c (crc32_update): Remove unnecessary L suffix.
1698 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1699 unwanted sign propagation, e.g., on hosts with 64-bit int.
1700 There still are some problems with reeelly weird theoretical hosts
1701 (e.g., 33-bit int) but it's not worth worrying about now.
1702 * sha1.c (rol): Likewise.
1703 (K1, K2, K3, K4): Remove unnecessary L suffix.
1705 2006-05-10 Bruno Haible <bruno@clisp.org>
1707 * des.c: Cast to avoid warnings.
1709 2006-05-10 Simon Josefsson <jas@extundo.com>
1711 * md4.c: Typo fix, update copyright years.
1712 (K1, K2): Don't use L because it turn computations into 64-bit on
1715 2006-05-09 Bruno Haible <bruno@clisp.org>
1717 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1718 (EOVERFLOW): Define fallback value.
1719 (xstrcat): New function.
1720 (xvasprintf): Recognize the special case of a string concatenation.
1722 2006-05-01 Bruno Haible <bruno@clisp.org>
1724 * stdint_.h: Shorter URL.
1725 * inttypes.h: Likewise.
1727 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1729 * verify.h: Document the internals better. Most of this change
1730 was written by Bruno Haible.
1732 2006-04-29 Bruno Haible <bruno@clisp.org>
1734 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1735 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1737 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1739 * getdate.y (get_date): When adding relative date, start with the
1740 initial time, not with the result of the first mktime call.
1742 2006-04-23 Bruno Haible <bruno@clisp.org>
1744 * copy-file.c: Include <unistd.h> unconditionally.
1745 * execute.c: Likewise.
1746 * fatal-signal.c: Likewise.
1747 * findprog.c: Likewise.
1748 * mkdtemp.c: Likewise.
1751 * wait-process.h: Likewise.
1753 2006-04-23 Bruno Haible <bruno@clisp.org>
1755 * fwriteerror.c (fwriteerror): Call fclose also when an error
1756 condition was already detected.
1757 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1759 2006-04-19 Derek Price <derek@ximbiot.com>
1760 Eric Blake <ebb9@byu.net>
1762 * inttypes.h: Correct grammar in comment.
1764 2006-04-18 Derek Price <derek@ximbiot.com>
1765 Paul Eggert <eggert@cs.ucla.edu>
1767 * inttypes.h: New file.
1768 * strtoimax.c: Assume <inttypes.h>.
1770 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1772 * utimens.c (futimens): glibc futimesat messes up if /proc
1773 isn't mounted. Problem reported by Kir Kolyshkin.
1775 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1777 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1778 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1779 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1781 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1783 Merge regex changes from libc, removing some of our
1784 POSIX-conformance changes that were rejected and redoing them in a
1787 * regcomp.c (re_compile_internal, init_dfa):
1788 Length arg is now size_t, not Idx. All uses changed.
1789 (peek_token): Forward decl now says internal_function.
1790 (__re_error_msgid, __re_error_msgid_idx):
1791 Now static rather than extern with attribute_hidden.
1792 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1793 For some reason libc prefers K&R style defns for external functions.
1794 (regerror) [!defined _LIBC]: Likewise.
1795 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1796 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1797 (build_range_exp, build_collating_symbol):
1799 (re_compile_fastmap): Use '\0' to memset, not 0.
1800 (utf8_sb_map): Make the calculations more obvious.
1801 (init_dfa, parse_bracket_exp, build_charclass_op):
1802 Call calloc and cast result, as glibc does.
1803 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1804 (build_range_exp, build_collating_symbol):
1805 Now internal functions.
1807 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1809 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1810 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1811 Don't depend on VMS; depend on __VMS instead, for POSIX
1812 namespace cleanness.
1813 (regoff_t): Define to ssize_t, not long int.
1815 Remove the REG_ macros named below. Instead, make the old names
1816 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1818 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1819 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1820 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1821 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1822 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1823 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1824 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1825 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1826 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1827 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1828 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1829 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1830 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1831 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1832 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1833 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1834 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1836 Remove. All uses replaced by the old RE_* names.
1837 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1838 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1839 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1840 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1841 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1842 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1843 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1844 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1845 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1846 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1847 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1848 Don't bother having these macros be independent of each others'
1849 values, since they no longer exist in the POSIX name space.
1851 Rename the following member names back to their old names,
1852 unless !__USE_GNU_REGEX. All uses changed back.
1853 (buffer): Renamed from re_buffer.
1854 (allocated): Renamed from re_allocated.
1855 (used): Renamed from re_used.
1856 (syntax): Renamed from re_syntax.
1857 (fastmap): Renamed from re_fastmap.
1858 (translate): Renamed from re_translate.
1859 (can_be_null): Renamed from re_can_be_null.
1860 (regs_allocated): Renamed from re_regs_allocated.
1861 (fastmap_accurate): Renamed from re_fastmap_accurate.
1862 (no_sub): Renamed from re_no_sub.
1863 (not_bol): Renamed from re_not_bol.
1864 (not_eol): Renamed from re_not_eol.
1865 (newline_anchor): Renamed from re_newline_anchor.
1866 (num_regs): Renamed from rm_num_regs.
1867 (start): Renamed from rm_start.
1868 (end): Renamed from rm_end.
1870 (free_state): Move up a bit.
1872 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1873 #define to be empty.
1874 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1875 when that is what is intended.
1876 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1877 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1879 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1880 All uses changed back to re_malloc, etc. It's now the caller's
1881 responsibility to check for overflow; all callers changed.
1882 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1883 (re_x2nrealloc): Remove.
1884 (free_state): Remove decl.
1886 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1887 (re_set_registers, re_exec):
1890 2006-01-31 Roland McGrath <roland@redhat.com>
1892 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1893 Reported by Mike Frysinger <vapier@gentoo.org>.
1895 2006-01-15 Andreas Jaeger <aj@suse.de>
1898 * regex_internal.c (re_string_reconstruct): Adjust for
1899 build_wcs_upper_buffer change.
1900 (build_wcs_upper_buffer): Change return type.
1902 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1904 * regex_internal.h: Include <stdint.h> if available.
1906 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1908 * regex_internal.h (SIZE_MAX): Provide a default definition.
1910 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1912 * regcomp.c: Adjust for changed secondary hash function.
1914 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1916 * regex.h: Pretty printing.
1917 Clean up namespace a bit.
1919 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1921 * regexec.c (update_cur_sifted_state, check_arrival,
1922 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1924 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1925 Ulrich Drepper <drepper@redhat.com>
1928 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1929 (bitset_word_t): Renamed from bitset_word. All uses changed.
1931 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1934 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1935 * regcomp.c: Remove unnecessary uses of
1936 unsigned RE_TRANSLATE_TYPE.
1937 * regex_internal.h: Likewise.
1938 * regex_internal.c: Likewise.
1939 * regexec.c: Likewise.
1940 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1942 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1944 * regexec.c (find_recover_state): Remove unnecessary
1946 (transit_state_bkref): Make DFA a const pointer.
1947 (get_subexp): Likewise.
1948 (check_arrival): Likewise.
1949 (update_cur_sifted_state): Likewise.
1950 (re_search_internal): Likewise.
1951 (prune_impossible_nodes): Likewise.
1952 (acquire_init_state_context): Likewise.
1953 (proceed_next_node): Likewise.
1954 (set_regs): Likewise.
1955 (free_fail_stack_return): Likewise.
1956 (check_arrival_expand_ecl): Mark DFA parameter as const.
1957 (check_arrival_expand_ecl_sub): Likewise.
1958 (check_subexp_limits): Likewise.
1959 (sub_epsilon_src_nodes): Likewise.
1960 (add_epsilon_src_nodes): Likewise.
1961 (merge_state_array): Likewise.
1962 (update_regs): Likewise.
1963 (build_trtable): Likewise.
1964 (sift_states_backward): Mark MCTX parameter as const.
1965 (build_sifted_states): Likewise.
1966 (update_cur_sifted_state): Likewise.
1967 (sift_states_mkref): Likewise.
1968 (check_arrival_expand_ecl): Mark eclosure as const.
1969 (check_dst_limits_calc_pos_1): Likewise.
1970 * regex_internal.h (re_match_context_t): Make dfa a const
1973 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1975 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1976 (transit_state_sb): Likewise.
1977 (transit_state_mb): Likewise.
1978 (sift_states_iter_mb): Likewise.
1979 (check_arrival_add_next_nodes): Likewise.
1980 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1981 [_LIBC] (re_search_2_stub): Use mempcpy.
1983 * regex_internal.c (re_string_reconstruct): Avoid calling
1984 mbrtowc for very simple UTF-8 case.
1986 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1988 (re_acquire_state_context): Likewise.
1989 * regex_internal.h: Adjust prototypes.
1991 * regex.c: Prevent using C++ compilers.
1993 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1994 (re_acquire_state_context): Likewise.
1996 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1997 Bruno Haible <bruno@clisp.org>
1999 * stdint_.h: On OpenBSD, don't redefine types already included in
2000 <sys/types.h> and <inttypes.h>.
2002 2006-03-24 Eric Blake <ebb9@byu.net>
2004 * time_r.c (copy_string_result): Remove, as it is no longer used.
2006 2006-03-24 Simon Josefsson <jas@extundo.com>
2008 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2009 including some doc fixes.
2010 (base64_encode_alloc): Fix +1 bug on allocation failures.
2012 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2014 * base64.c (base64_encode): Do not read past end of array with
2015 unsanitized input on systems with CHAR_BIT > 8.
2017 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2019 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2020 Typedef to long int, not to off_, as POSIX will likely change
2023 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
2025 * argp-help.c (validate_uparams): Fix typo
2026 * argp-parse.c (argp_default_options): Consistently begin help
2027 messages with a lowercase letter.
2029 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
2031 * time_r.h (asctime_r, ctime_r): Remove. These functions can
2032 overrun buffers and shouldn't be used (much as gets shouldn't be
2034 * time_r.c (asctime_r, ctime_r): Likewise.
2036 2006-03-08 Simon Josefsson <jas@extundo.com>
2038 * gc-gnulib.c (randomize): Don't open files called 'no', they
2039 signal that configure disabled the device.
2041 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
2043 * c-stack.c: Include unistd.h unconditionally, since we now assume
2045 * getlogin_r.c: Likewise.
2046 * getlogin_r.h: Likewise.
2048 * pagealign_alloc.c: Likewise.
2049 * unistd_.h: Remove; no longer needed.
2051 2006-03-07 Simon Josefsson <jas@extundo.com>
2053 * unistd_.h: New file.
2055 2006-03-07 Simon Josefsson <jas@extundo.com>
2057 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2059 2006-03-01 Simon Josefsson <jas@extundo.com>
2061 * readline.c: Fix typo, tiny patch from Stepan Kasal
2064 2006-02-28 Simon Josefsson <jas@extundo.com>
2066 * getopt.c: Protect #include of unistd.h, for MSVS.
2068 2006-02-27 Simon Josefsson <jas@extundo.com>
2070 * base64.h: Indent #define's. From Jim Meyering
2073 2006-02-27 Jim Meyering <jim@meyering.net>
2075 Revert the change of 2006-02-24, so these files can continue
2076 to be sync'd from gettext.
2077 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2080 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2082 * glob.c: Say "invalid" rather than "illegal" in comments.
2084 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2086 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2088 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2090 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2091 AT_FDCWD exceeds INT_MAX.
2092 * openat.h (AT_FDCWD): Likewise.
2094 2006-02-14 Jim Meyering <jim@meyering.net>
2096 Sync from coreutils.
2098 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2099 failure on deficient systems, and simplify gnulib lgpl dependencies.
2100 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2101 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2103 * xalloc-die.c: Remove unused definition of N_.
2105 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2107 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2109 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2111 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2112 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2114 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2116 * argp-namefrob.h: Restore changes accidentally lost during the
2117 "autoupdate" on 2005-12-12.
2119 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2121 * fnmatch.c (L_): Renamed from L, to work around a bug in
2122 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2123 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2126 2006-01-26 Simon Josefsson <jas@extundo.com>
2128 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2129 prototype is visible on mingw32.
2131 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2134 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2137 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2139 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2140 attempt to open for write; this always fails, at least on POSIX
2141 hosts. This reinstates the 2006-01-09 change, which was
2142 inadvertently removed.
2144 2006-01-26 Bruno Haible <bruno@clisp.org>
2145 Paul Eggert <eggert@cs.ucla.edu>
2147 * stdbool_.h (_Bool)
2148 [(! (defined __cplusplus || defined __BEOS__)
2149 && !defined __GNUC__
2150 && !(defined __HP_cc || defined __xlc__
2151 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2152 || defined __sgi))]:
2153 #define to signed char in these cases too; this simplifies
2154 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2155 etc., separately) and makes it more conservative.
2157 2006-01-21 Jim Meyering <jim@meyering.net>
2159 Sync from the stable (b5) branch of coreutils:
2161 * fts.c (fts_children): Don't let close() clobber errno from
2164 * fts.c (fts_stat): When following a symlink-to-directory,
2165 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2166 a dangling symlink. That can also happen at least for ELOOP.
2167 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2168 FYI, this bug predates the inclusion of fts.c in coreutils.
2170 * fts.c (fts_open): Put new maxarglen declaration and uses
2171 in their own block, so pre-c99 compilers don't object.
2173 Avoid the double-free (first in fts_read, second in fts_close) that
2174 would occur when an `active' directory is made inaccessible (e.g.,
2175 via chmod a-x) during a traversal.
2176 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2177 before returning. Reproduce this failure by
2178 mkdir -p a/b; cd a; chmod a-x . b
2179 Reported by Stavros Passas.
2181 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2183 * argp-namefrob.h: Bugfix. Remove stray #
2185 2006-01-25 Bruno Haible <bruno@clisp.org>
2187 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2189 Reported by Paul Eggert.
2191 2006-01-25 Jim Meyering <jim@meyering.net>
2193 * fileblocks.c: Remove more useless parentheses.
2194 * readutmp.h: Likewise.
2196 2006-01-24 Bruno Haible <bruno@clisp.org>
2198 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2200 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2203 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2204 to avoid problems with the built-in _Bool type.
2205 Reported by Paul Eggert on 2005-11-26.
2207 2006-01-24 Jim Meyering <jim@meyering.net>
2209 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2211 2006-01-24 Simon Josefsson <jas@extundo.com>
2213 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2216 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2218 Work around porting bugs reported by Dieter in
2219 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2220 * getopt.c (_NOPROTO): Remove; no longer needed.
2221 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2222 Include "getopt.h" first, to check interface.
2223 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2225 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2226 (__strndup): Revert to K&R-style function dfns, the glibc style.
2227 * strnlen.c: Don't claim it's taken from glibc; it's not.
2228 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2229 Include strnlen.h first, to get prototype properly.
2230 (strnlen): Renamed from __strnlen.
2233 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2235 These changes imported from libc.
2236 * getopt.c: Use __fxprintf instead of inline stream orientation
2237 test and two separate function calls.
2238 * strndup.c (__strndup): Add libc_hidden_def.
2240 2006-01-22 Bruno Haible <bruno@clisp.org>
2242 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2243 temporary buffer for sprintf, take into account the precision also
2244 for 'd', 'i', 'u', 'o', 'x', 'X'.
2246 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2248 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2249 to pacify gcc -Wswitch-default.
2251 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2253 * argp-help.c (usage_long_opt): Do not print DOC options.
2254 (__argp_base_name): Removed
2255 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2257 (__argp_base_name): Provide macro definition or extern declaration
2258 depending on the configuration
2260 2006-01-20 Simon Josefsson <jas@extundo.com>
2262 * inet_ntop.h: Unconditionally include sys/socket.h.
2264 2006-01-19 Simon Josefsson <jas@extundo.com>
2266 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2268 2006-01-12 Simon Josefsson <jas@extundo.com>
2270 * base64.c: Fix warning, reported by Bruno Haible
2271 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2273 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2275 Sync from coreutils.
2276 * md5.c: Fix commentary typos.
2277 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2278 * md5.h (__attribute__): Remove; unused.
2279 * sha1.c: Fix commentary to match md5 better.
2280 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2281 so that we don't need to worry about alignment. All uses changed.
2282 This merges the 2005-10-28 md5 change into sha1.
2284 2006-01-11 Jim Meyering <jim@meyering.net>
2286 Sync from coreutils.
2287 * md5.c (OP): Fix spacing.
2289 2006-01-11 Simon Josefsson <jas@extundo.com>
2291 * stdint_.h (SIZE_MAX): Add missing (.
2293 2006-01-10 Bruno Haible <bruno@clisp.org>
2295 * argp.h (__const): Remove macro. Use const instead.
2296 * argp-fmtstream.h (__const): Likewise.
2297 * glob_.h (__const): Remove macro.
2298 * glob-libc.h: Use const instead of __const.
2300 2006-01-10 Jim Meyering <jim@meyering.net>
2302 Avoid the double-free (first in fts_read, second in fts_close) that
2303 would occur when an `active' directory is made inaccessible (e.g.,
2304 via chmod a-x) during a traversal.
2305 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2306 before returning. Reproduce this failure by
2307 mkdir -p a/b; cd a; chmod a-x . b
2308 Reported by Stavros Passas.
2310 Sync from coreutils.
2311 * sha1.c: Tweak grammar in a comment.
2313 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2315 * regex_internal.h (BITSET_WORD_BITS):
2316 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2317 preprocessor mishandles large unsigned values as if they were signed.
2318 Problem reported by Claudio Fontana in
2319 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2321 2006-01-10 Simon Josefsson <jas@extundo.com>
2323 * socket_.h: New file.
2325 2006-01-10 Bruno Haible <bruno@clisp.org>
2327 * localcharset.c: Update from GNU gettext.
2329 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2331 Sync from coreutils.
2332 * chdir-long.c (cdb_free): Don't bother trying to open directory
2333 for write access: POSIX says that must fail.
2334 * fts.c (diropen): Likewise.
2335 * save-cwd.c (save_cwd): Likewise.
2336 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2337 well, for minor improvements on hosts that lack O_DIRECTORY.
2338 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2339 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2340 Fall back on chown if open failed with EACCES.
2342 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2343 Report an error at compile-time if only a 1-second nominal clock
2344 resolution is found.
2346 * lchmod.h: New file.
2347 * mkdir-p.c: Include lchmod.h, lchown.h.
2348 (make_dir_parents): Use lchown rather than chown, and
2349 lchmod rather than chmod.
2351 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2352 too. Problem with "none" reported by Bob Proulx. Problem with
2353 "proc" reported by n0dalus.
2355 * mountlist.c: Include <limits.h>.
2356 (dev_from_mount_options)
2357 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2358 New function. It no longer assumes "dev=" has the System V meaning
2359 on Linux (since it doesn't). It also parses "dev=" more carefully.
2360 (read_file_system_list)
2361 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2362 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2365 * posixtm.h (PDS_PRE_2000): New macro.
2366 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2367 All usages changed. Reject dates outside the range 1969-1999 if
2368 PDS_PRE_2000 is used.
2370 2006-01-09 Jim Meyering <jim@meyering.net>
2372 Sync from coreutils.
2374 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2376 * chdir-safer.h, chdir-safer.c: New files.
2378 * modechange.c (mode_compile): Reject an invalid mode string
2379 that starts with an octal digit. From Andreas Gruenbacher.
2381 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2382 and dup to open_safer and dup_safer, respectively.
2383 (openat_permissive): Fix typo in comment.
2385 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2386 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2387 (_): Remove; no longer needed.
2388 (openat): Renamed from rpl_openat; no need for rpl_openat
2389 since openat.h renames openat for us.
2390 Replace most of the body with a call to openat_permissive,
2391 to avoid duplicate code.
2392 Port to (probably hypothetical) environments were mode_t is
2394 (openat_permissive): Require mode arg, so that we can check
2395 types better. Put it just after flags. Change cwd failure
2396 indicator from pointer-to-bool to pointer-to-errno-value.
2397 All callers changed.
2398 Invoke openat_save_fail and/or openat_restore_fail if
2399 cwd_errno is null, so that openat can call us.
2400 (openat_permissive, fdopendir, fstatat, unlinkat):
2401 Simplify errno handling to avoid some duplicate code,
2402 as it's OK to set errno on success.
2403 * openat.h: Revamp code so that function macros depend on
2404 __OPENAT_PREFIX only, not also on AT_FDCWD.
2405 (openat_ro): Remove. Caller changed to use openat_permissive.
2406 (openat_permissive): Now a macro, if not a function.
2407 (openat_restore_fail, openat_save_fail): Now always functions,
2408 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2410 * openat-priv.h: New file, defining macros used by mkdirat.c
2412 * mkdirat.c: Include openat-priv.h.
2413 Remove definitions of macros defined therein.
2414 * openat.c: Likewise.
2416 * mkdirat.c (mkdirat): New file and function.
2417 * openat.h (mkdirat): Declare.
2419 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2421 * openat.h (openat_permissive): Declare.
2422 (openat_ro): Define.
2424 * openat.c (EXPECTED_ERRNO): New macro.
2425 (openat_permissive): New function -- used in remove.c rewrite.
2426 (all functions): Set errno just before returning, only if there
2427 was an actual failure.
2428 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2430 Emulate openat-family functions using Linux's procfs, if possible.
2431 Idea and some code based on Ulrich Drepper's glibc changes.
2433 * openat.c: (BUILD_PROC_NAME): New macro.
2434 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2435 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2436 before falling back on save_cwd and restore_cwd.
2437 (fdopendir, fstatat, unlinkat): Likewise.
2439 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2440 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2442 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2443 as second argument to va_arg. Otherwise, some versions of gcc
2444 warn that `if this code is reached, the program will abort'.
2446 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2448 Sync from coreutils.
2450 Add POSIX ACL support
2451 * acl.h (copy_acl, set_acl): Add declarations.
2452 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2453 systems other than Linux.
2454 (chmod_or_fchmod): New function: use fchmod when possible,
2455 and chmod otherwise.
2456 (file_has_acl): Add a POSIX ACL implementation, with a
2457 Linux-specific subcase.
2458 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2459 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2460 acls are unsupported.
2461 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2462 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2465 2006-01-09 Bruno Haible <bruno@clisp.org>
2467 * sysexit_.h (EX_OK): New macro.
2468 Suggested by Martin Lambers <marlam@marlam.de>.
2470 2006-01-09 Bruno Haible <bruno@clisp.org>
2472 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2473 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2474 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2475 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2477 2006-01-09 Bruno Haible <bruno@clisp.org>
2479 * stdint_.h (SIZE_MAX): Write the value without involving negative
2482 2005-10-16 Bruno Haible <bruno@clisp.org>
2484 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2485 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2487 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2489 * strftime.c (tzname): Don't declare if it is already #defined.
2490 Problem reported for Mingw by Mark Junker.
2492 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2494 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2495 long int, not int, for nanosecond counts, so that people who are
2496 used to POSIX struct timespec won't be surprised. Reported by Jim
2499 2005-12-16 Jim Meyering <jim@meyering.net>
2501 * fprintftime.c, fprintftime.h: New files.
2503 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2505 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2506 * argp-help.c (fill_in_uparams): Check if the constructed
2507 struct uparams is valid. Fall back to the default values if it is
2510 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2512 * argp-help.c (__argp_base_name): New function
2513 (__argp_short_program_name): Rewrite using __argp_base_name
2514 * argp-namefrob.h: Define program_invocation_name and
2515 program_invocation_short_name if requested
2516 (__argp_base_name): Add prototype
2517 * argp-parse.c (argp_def): Use gettext wrappers
2518 (argp_default_parser): Use __argp_base_name
2519 * argp-pin.c: New file. Defines program_invocation_name and
2520 program_invocation_short_name on systems that lack them.
2522 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2524 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2525 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2526 porting problem reported by Georg Schwarz in
2527 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2529 2005-07-09 Bruno Haible <bruno@clisp.org>
2531 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2532 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2533 Reported by Mark Junker <mjscod@gmx.de>.
2535 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2537 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2538 (uintmax_t) [defined uintmax_t]: Do not declare.
2539 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2540 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2541 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2542 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2543 sake of portability to weird hosts that C allows (though we don't
2544 know of any practical examples).
2546 * savedir.h (fdsavedir): New decl.
2547 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2548 contains most of the former guts of savedir.
2549 (savedir): Use savedirstream.
2552 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2554 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2555 coreutils no longer futzes with rounding modes.
2557 2005-11-14 Jim Meyering <jim@meyering.net>
2559 * mkstemp-safer.c: Include <config.h>, required for possible
2560 replacement of mkstemp.
2562 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2564 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2566 (gethrxtime) [! (HAVE_NANOUPTIME
2567 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2568 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2569 our own approximation.
2571 2005-11-10 Simon Josefsson <jas@extundo.com>
2573 * readline.c: Remove EOL.
2575 2005-11-08 Eric Blake <ebb9@byu.net>
2577 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2579 2005-11-08 Eric Blake <ebb9@byu.net>
2581 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2583 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2585 Fix porting problem reported by Theodoros V. Kalamatianos.
2586 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2587 Don't assume that futimes failing means we must fail.
2589 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2591 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2592 leave errno alone. Problem reported by Dmitry V. Levin.
2594 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2596 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2597 errno alone. Problem reported by Frederic Jolliton.
2599 2005-10-28 Simon Josefsson <jas@extundo.com>
2601 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2602 "restrict" keywords, as per POSIX. Protect the function
2603 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2604 Don't use K&R prototypes. Check the sprintf return values.
2605 Re-define EAFNOSUPPORT if not present. Indent.
2607 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2608 suggested by Bruno Haible <bruno@clisp.org>.
2610 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2612 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2614 * gc-libgcrypt.c: Add MD2 (which is not available through
2617 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2619 * md2.h, md2.c: New files.
2621 2005-10-24 Simon Josefsson <jas@extundo.com>
2623 * md4.h: Shrink buffer size, now that we changed the type.
2625 2005-10-22 Simon Josefsson <jas@extundo.com>
2627 * arcfour.h, arcfour.c: Use fixed size indices in the
2628 arcfour_context struct (simplify test vector testing in GNU
2631 2005-10-22 Simon Josefsson <jas@extundo.com>
2633 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2634 suggested by Bruno Haible <bruno@clisp.org>.
2636 2005-10-22 Simon Josefsson <jas@extundo.com>
2638 * crc.h: Include stddef.h, for size_t.
2640 2005-10-21 Simon Josefsson <jas@extundo.com>
2642 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2643 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2645 2005-10-21 Simon Josefsson <jas@extundo.com>
2647 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2650 2005-10-21 Simon Josefsson <jas@extundo.com>
2652 * gc-gnulib.c: Support ARCTWO in CBC mode.
2654 2005-10-21 Simon Josefsson <jas@extundo.com>
2656 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2659 * hmac-sha1.c (hmac_sha1): Likewise.
2661 * crc.c (crc32_update): Actually use crc parameter, suggested by
2662 Bruno Haible <bruno@clisp.org>.
2664 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2667 2005-10-21 Simon Josefsson <jas@extundo.com>
2669 * des.h, des.c: New files.
2671 * gc-gnulib.c: Support DES.c
2673 2005-10-21 Simon Josefsson <jas@extundo.com>
2675 * arctwo.h, arctwo.c: New files.
2677 * gc-gnulib.c: Support ARCTWO.
2679 2005-10-21 Simon Josefsson <jas@extundo.com>
2681 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2683 2005-10-19 Simon Josefsson <jas@extundo.com>
2685 * gc-gnulib.c: Support ARCFOUR.
2687 2005-10-19 Simon Josefsson <jas@extundo.com>
2689 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2692 * gc.h: Add ECB enum type.
2694 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2696 2005-10-19 Simon Josefsson <jas@extundo.com>
2698 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2700 2005-10-18 Simon Josefsson <jas@extundo.com>
2702 * md4.h, md4.c: New files, based on md5.?.
2704 2005-10-17 Simon Josefsson <jas@extundo.com>
2706 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2708 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2710 2005-10-17 Simon Josefsson <jas@extundo.com>
2712 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2714 2005-10-17 Simon Josefsson <jas@extundo.com>
2716 * gc.h, gc-libgcrypt.c: Add ciphers.
2718 2005-10-17 Simon Josefsson <jas@extundo.com>
2720 * sha1.c: Use uint32_t instead of md5_uint32.t
2722 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2725 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2727 * md5.h: Use stdint.h and uint32_t. Doc fix.
2729 2005-10-15 Simon Josefsson <jas@extundo.com>
2731 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2733 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2735 2005-10-14 Simon Josefsson <jas@extundo.com>
2737 * arcfour.h, arcfour.c: New files.
2739 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2741 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2742 include <wchar.h>; no longer needed.
2744 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2745 and Ulrich Drepper <drepper@redhat.com>
2748 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2749 instead of inline stream orientation test and two separate
2750 function calls. Pay no attention to USE_IN_LIBIO.
2752 2005-10-14 Roland McGrath <roland@redhat.com>
2754 Import from libc. [BZ #1331]
2755 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2757 Reported by Matej Vela <vela@debian.org>.
2759 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2761 * mkdir-p.c (make_dir_parents): Don't report an error if an
2762 intermediate directory is in a read-only file system. Problem
2763 reported by Eric Blake.
2765 2005-10-13 Simon Josefsson <jas@extundo.com>
2767 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2768 Move memory allocation outside of loop.
2770 2005-10-12 Simon Josefsson <jas@extundo.com>
2772 * gc-pbkdf2-sha1.c: New file.
2774 * gc.h: Add gc_pbkdf2_sha1 prototype.
2776 2005-10-12 Simon Josefsson <jas@extundo.com>
2778 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2779 suggested by Bruno Haible <bruno@clisp.org>.
2781 2005-10-12 Simon Josefsson <jas@extundo.com>
2783 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2785 * gc-gnulib.c (gc_hmac_sha1): New function.
2787 2005-10-12 Simon Josefsson <jas@extundo.com>
2789 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2791 2005-10-12 Simon Josefsson <jas@extundo.com>
2793 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2794 GC_USE_HMAC_MD5, respectively.
2796 * gc-libgcrypt.c (gc_md5): Fix assert call.
2799 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2801 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2803 * gc-gnulib.c (gc_hash_buffer): Ditto.
2805 2005-10-11 Bruno Haible <bruno@clisp.org>
2807 * c-strcasestr.h: New file, from GNU gettext.
2808 * c-strcasestr.c: New file, from GNU gettext.
2810 2005-10-11 Bruno Haible <bruno@clisp.org>
2812 * c-strcase.h: New file, from GNU gettext.
2813 * c-strcasecmp.c: New file, from GNU gettext.
2814 * c-strncasecmp.c: New file, from GNU gettext.
2816 2005-10-11 Simon Josefsson <jas@extundo.com>
2818 * crc.h, crc.c: New files.
2820 * gc.h (gc_hash_buffer): Add doc.
2822 2005-10-08 Simon Josefsson <jas@extundo.com>
2824 * gc.h: Add gc_hash and gc_hash_buffer.
2826 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2828 * gc-libgcrypt.c (gc_hash_buffer): Add.
2830 2005-10-11 Bruno Haible <bruno@clisp.org>
2832 * strcasecmp.c: Include limits.h.
2833 (strcasecmp): Avoid integer overflow on exotic platforms.
2834 * strncasecmp.c: Include limits.h.
2835 (strncasecmp): Avoid integer overflow on exotic platforms.
2836 Reported by Paul Eggert.
2838 2005-10-06 Simon Josefsson <jas@extundo.com>
2840 * hmac-md5.c: New file.
2844 2005-10-06 Simon Josefsson <jas@extundo.com>
2846 * memxor.c (memxor): Avoid casts and warnings.
2848 2005-10-05 Derek Price <derek@ximbiot.com>
2850 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2852 2005-10-05 Simon Josefsson <jas@extundo.com>
2854 * memxor.c (memxor): Fix compiler error.
2856 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2857 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2859 * memxor.h, memxor.c: New files.
2861 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2862 we assume all systems have it, suggested by Jim Meyering
2863 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2864 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2865 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2868 2005-10-04 Bruno Haible <bruno@clisp.org>
2870 * verify.h (verify_true): Provide alternative definition for C++.
2872 2005-10-04 Simon Josefsson <jas@extundo.com>
2874 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2875 D. Baushke" <mdb@gnu.org>.
2877 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2879 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2880 (SSIZE_MAX): New macro, if not already defined.
2881 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2884 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2886 * exclude.c: Include verify.h.
2887 (verify): Remove. All callers changed to use verify.h's version.
2888 * strtoimax.c: Likewise.
2889 * utimecmp.c: Likewis.e
2891 Sync from coreutils.
2892 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2893 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2894 * .cvsignore: Add fts.h, search.h, t-fpending.
2895 * settime.c (settime): Fix { typo in previous patch. Also, don't
2896 bother returning ENOSYS if settimeofday or stime fails; just let
2897 them return whatever errno they want to return.
2898 * utimens.c: Include unistd.h, for dup2.
2899 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2900 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2902 2005-10-02 Jim Meyering <jim@meyering.net>
2904 Sync from coreutils.
2905 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2906 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2907 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2908 Remove AT_FDCWD test.
2909 Do not consume the fd unless successful.
2910 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2911 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2912 block, so that we don't even try to compile it if settimeofday is
2913 available. This works around a compilation failure on OSF1 V5.1,
2914 due to stime requiring a `long int*' while tv_sec is `int'.
2916 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2918 * getdelim.c (getdelim): Remove unused variables.
2920 2005-10-01 Simon Josefsson <jas@extundo.com>
2922 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2923 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2924 AI_* and EAI_* definitions. Protect function declarations.
2926 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2928 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2929 so that the code works even with ancient cpp. Portability problem
2930 with GCC 2.7.2.1 reported by Thomas M.Ott.
2932 2005-09-27 Jim Meyering <jim@meyering.net>
2934 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2936 * intprops.h (signed_type_or_expr__): Define.
2937 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2940 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2942 * verify.h (verify_expr): Remove, replacing with:
2943 (verify_true): New macro that returns true instead of void.
2944 (verify_type__): Remove.
2945 (verify): Use verify_true rather than verify_type__.
2947 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2949 * utimens.c (ENOSYS): Define if not already defined.
2950 (futimens): Support having a null PATH if the file descriptor
2953 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2955 (__attribute): Define to empty unless GCC 3.1 or later.
2956 This works around a core dump on OpenBSD 3.4, which has GCC
2957 2.95.3, which dumps core when given __attribute__(()). It also
2958 simplifies other tests, since we really don't want to bother with
2959 worrying about which ancient version of GCC supported what.
2960 Original problem reported by Yoann Vandoorselaere, with part of
2961 the fix suggested by Derek Price.
2963 2005-09-24 Jim Meyering <jim@meyering.net>
2965 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2966 so we can once again use a positive bitfield width of 1 -- now we
2967 don't have to explain why we were using a bitfield width of 2.
2969 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2971 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2972 Problem reported by Eric Blake.
2973 (getaddrinfo): Initialize se so that it's not garbage.
2974 Redo internal storage allocation so that it doesn't make unportable
2975 assumptions about alignment.
2978 * utimens.c (futimens): Use futimesat if available.
2979 Prefer it to futimes since it doesn't have the futimes bug.
2981 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2982 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2983 Instead, declare a function that returns a pointer to an array,
2984 and use verify_type__ to declare the size of the array.
2985 Problem and germ of a solution reported by Bruno Haible.
2986 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2987 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2989 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2991 Sync from coreutils.
2993 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2995 * argmatch.h: Include verify.h
2996 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2997 (ARGMATCH_ASSERT): Remove; unused.
2998 * canonicalize.c: Assume STDC_HEADERS.
2999 * exclude.c: Include "strcase.h".
3000 * regex_internal.h [!defined _LIBC]: Likewise.
3001 * getusershell.c: Include stdio--.h rather than stdio.h
3003 (getusershell): Call fopen, not fopen_safer.
3004 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3005 Do not include unistd-safer.h.
3006 (save_cwd): Don't call fd_safer; no longer needed
3007 now that we include fcntl--.h.
3009 * getdate.y (relative_time): New type.
3010 (RELATIVE_TIME_0): New constant.
3011 (parser_control): Use relative_time instead of doing it ourselves.
3012 (%union): Add new relative_time rel member.
3013 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3015 (relunit, relunit_snumber): Now of type rel.
3016 (zone, rel, relunit, get_date): Adjust to above changes.
3018 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3019 Do not include unistd-safer.h.
3020 (getloadavg): Don't call fd_safer; no longer needed
3021 now that we include fcntl--.h.
3023 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3024 (make_dir_parents): Treat ENOSYS like EEXIST.
3026 Improve quality of diagnostics on restore_cwd failure.
3027 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
3028 (make_dir_parents): Last arg is now int * (for errno), not bool *.
3029 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3030 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3031 each time through the loop. Do not diagnose restore_cwd failure;
3032 that is the caller's job (and perhaps the caller does not care).
3034 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3035 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3036 If the file already exists but is not a directory, don't bother
3037 to try to make its parents.
3038 Close potential file descriptor leak if we can't chdir("/") (!).
3039 Don't always return true if chdir($PWD) fails; return true only
3040 if the requested action was done successfully (except for the
3042 Don't log final directory unless we actually made it.
3043 Refactor to avoid duplicate code to fix up permissions.
3044 Don't attempt to fix up parent permissions if chdir($PWD) fails.
3046 * strftime.c (my_strftime): Rewrite the previous change slightly,
3047 to make it a bit faster and (I hope) clearer.
3048 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3049 Fix bug in formats like %2N.
3051 * verify.h: New file.
3053 2005-09-22 Jim Meyering <jim@meyering.net>
3055 Sync from coreutils.
3057 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3059 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3060 the .tm_year member, since otherwise gcc-4.0 would now warn about
3061 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3063 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3064 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3066 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3067 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3068 when run in a time zone for which daylight savings time is in effect
3069 for the starting date.
3071 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3072 stop us from restricting permissions of just-created absolute-named
3074 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3075 to restore initial working directory.
3076 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3077 to tell caller if/when we change the working directory and are
3078 unable to return to the initial one.
3079 * mkdir-p.h (make_dir_parents): Update prototype.
3080 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3081 `return false'. This fixes a bug introduced on 2004-07-30.
3083 * openat.c (fdopendir): Be sure to close the supplied
3084 file descriptor before returning. This makes our replacement
3085 implementation a little closer to Solaris's, where fdopendir
3086 ties the file descriptor to the returned DIR* pointer.
3087 * openat.c (unlinkat): New function.
3088 * openat.h (unlinkat): Add prototype.
3089 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3090 (openat_restore_fail): Rename from openat_restore_die.
3091 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3093 Provide an alternative to exiting immediately upon save_cwd or
3094 restore_cwd failure. Now, an application can arrange e.g.,
3095 to perform a longjump in that case.
3096 * openat.c: Include dirname.h.
3097 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3098 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3099 and openat_restore_die rather than calling error directly.
3100 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3102 * openat-die.c (openat_save_die, openat_restore_die): New file.
3103 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3105 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3106 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3107 int utc, int nanoseconds);
3109 date should not have to allocate a megabyte of virtual memory to
3110 handle a format argument like +%1048575T. When implemented with
3111 strftime, it must allocate such a buffer, use strftime to fill it
3112 in, print it, then free it.
3113 With fprintftime, it simply prints everything and exits.
3114 With no need for memory allocation, that's one fewer way to fail.
3115 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3116 optional field width, not before, so we accept %9:z, not %:9z.
3117 (my_strftime): Be sure to use L_('x') for literals.
3119 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3120 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3121 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3122 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3123 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3124 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3125 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3126 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3127 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3129 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3130 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3131 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3132 and don't include <sys/file.h>).
3134 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3136 Sync from coreutils.
3138 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3139 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3140 [!LDAV_DONE]: Avoid unused variable warning.
3142 2005-09-21 Bruno Haible <bruno@clisp.org>
3144 * unicodeio.h (unicode_to_mb): New declaration.
3146 2005-09-20 Derek Price <derek@ximbiot.com>
3148 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3150 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3152 Use a consistent style for including <config.h>.
3153 * __fpending.c, acl.c, argmatch.c,
3154 argp-help.c, argp-parse.c,
3155 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3156 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3157 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3158 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3159 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3160 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3161 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3162 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3163 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3164 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3165 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3166 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3167 modechange.c, mountlist.c, open-safer.c, physmem.c,
3168 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3169 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3170 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3171 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3172 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3173 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3174 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3175 userspec.c, utimecmp.c, version-etc-fsf.c,
3176 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3177 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3178 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3179 Standardize inclusion of config.h.
3180 * __fpending.h, dirfd.h, getdate.h, human.h,
3181 inttostr.h: Removed inclusion of config.h from header files.
3182 * inttostr.c: Adjusted in-tree users.
3183 * timespec.h: Remove superfluous warning to include config.h.
3184 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3185 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3186 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3187 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3189 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3191 * stat-time.h: New file.
3192 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3193 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3195 (timespec_cmp): New function.
3196 * utimecmp.c: Include stat-time.h.
3197 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3198 members exist, not on the obsolescent ST_MTIM_NSEC.
3199 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3201 2005-09-15 Derek Price <derek@ximbiot.com>
3202 Paul Eggert <eggert@cs.ucla.edu>
3204 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3205 changes, consolidating in...
3206 * regex_internal.h: ...this file.
3208 2005-09-15 Derek Price <derek@ximbiot.com>
3210 * regex_internal.h: Blank `pure' for GNUC < 3.
3211 * regex_internal.c: Ditto, using this...
3212 (__GNUC_PREREQ): ...new macro.
3213 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3214 (__GNUC_PREREQ): ...this new macro.
3216 * strstr.h: Include string.h. Define strstr as a macro here.
3218 2005-09-13 Derek Price <derek@ximbiot.com>
3220 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3222 Reported by Jim Meyering <jim@meyering.net>.
3224 2005-09-13 Jim Meyering <jim@meyering.net>
3226 * canon-host.c: Filter through gnu indent and reword comments slightly.
3227 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3229 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3232 (base64_encode): Put b64str in initialized data section.
3234 2005-09-12 Derek Price <derek@ximbiot.com>
3236 Return usable errors from canon-host.
3237 * canon-host.h: New file.
3238 * canon-host.c (canon_host): Wrap...
3239 (canon_host_r): ...this new function, which now relies exclusively on
3241 (ch_strerror): New function.
3242 (last_cherror): New global.
3243 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3244 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3246 (freeaddrinfo): Free ai->ai_canonname when set.
3248 2005-09-12 Derek Price <derek@ximbiot.com>
3249 Paul Eggert <eggert@cs.ucla.edu>
3251 * glob-libc.h: Renamed from glob_.h. The new version is
3252 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3253 protecting things that should be done only in gnulib contexts.
3254 * glob_.h: New file, containing only the glob things needed for
3256 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3257 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3258 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3259 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3260 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3261 and to respect the namespace rules better.
3263 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3265 Merge glibc and coreutils changes into gnulib, plus a few
3267 * md5.c: Use #error rather than a string.
3268 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3269 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3270 (__attribute__): Define to empty for non recent-GCC.
3271 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3272 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3273 Renamed from their non-__ counterparts, with new macros replacing
3274 them if not _LIBC. Add __THROW attribute.
3276 (struct md5_ctx): Align buffer if using GCC.
3277 * sha1.h (struct sha1_ctx): Likewise.
3278 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3279 The old name was backwards.
3280 (NOTSWAP): Remove; not used.
3281 (rol): New macro, moved here from md5.h.
3282 (sha1_process_block): Remove a FIXME that doesn't make sense.
3284 2005-09-12 Derek Price <derek@ximbiot.com>
3286 * gai_strerror.c: Include config.h when available. Include
3287 getaddrinfo.h before other headers to test interface.
3288 Reported by Larry Jones <lawrence.jones@ugs.com>.
3290 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3292 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3293 definitions, since that's the preferred style in glibc.
3294 Fix a minor spacing issue, and update copyright notice to match glibc's.
3296 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3298 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3300 2005-09-06 Simon Josefsson <jas@extundo.com>
3302 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3303 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3305 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3307 Change bitset word type from unsigned int to unsigned long int,
3308 as this has better performance on typical 64-bit hosts.
3309 Port bitset code to hosts with unusual word sizes.
3310 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3311 (build_collating_symbol):
3312 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3313 argument is a bitset. This is merely a style issue, but it makes
3314 it clearer that an entire array is expected.
3315 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3316 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3317 Port to the case where bitset_word is not the same as unsigned int.
3318 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3319 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3321 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3322 (build_trtable, group_nodes_into_DFAstates):
3324 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3325 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3326 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3327 * regexec.c (group_nodes_into_DFAstates): Likewise.
3328 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3329 * regcomp.c (optimize_subexps, lower_subexp):
3330 Work even if bitset_word has holes in its bitwise representation.
3331 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3332 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3334 * regex_internal.c (re_string_reconstruct):
3335 Don't assume UCHAR_MAX == 255.
3336 * regex_internal.h (bitset_set_all): Likewise.
3337 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3339 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3340 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3342 (BITSET_WORD_MAX): New macro.
3343 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3344 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3345 (bitset_empty, bitset_copy):
3346 Prefer sizeof (bitset) to multiplying it out ourselves.
3347 (bitset_not_merge): Remove; unused.
3348 (bitset_contain): Return bool, not unsigned int with one bit on.
3349 All callers changed.
3350 * regexec.c (build_trtable): Don't assume bitset has no stricter
3351 alignment than re_node_set; do this by defining a new internal
3352 type struct dests_alloc and using it to allocate memory.
3354 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3356 Check for arithmetic overflow when calculating sizes, to prevent
3357 some buffer-overflow issues. These patches are conservative, in the
3358 sense that when I couldn't determine whether an overflow was possible,
3359 I inserted a run-time check.
3360 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3361 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3362 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3363 (re_xnrealloc, re_x2nrealloc): New inline functions.
3364 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3365 (build_equiv_class, build_charclass): Check for arithmetic overflow
3366 in size expression calculations.
3367 * regex_internal.c (re_string_realloc_buffers):
3368 (build_wcs_upper_buffer, re_node_set_add_intersect):
3369 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3370 (re_dfa_add_node, register_state): Likewise.
3371 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3372 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3373 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3374 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3376 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3378 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3379 to avoid a collision with bits/local_lim.h in glibc.
3380 All uses changed. Problem reported by Dmitry V. Levin in
3381 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3383 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3384 bugs in int versus size_t comparisons.
3385 (re_string_context_at): Fix bug where the code assumed that
3388 Use bool where appropriate.
3389 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3390 All callers changed.
3391 (calc_eclosure_iter): Likewise, for ROOT arg.
3392 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3393 (build_charclass_op): Likewise, for NON_MATCH arg.
3394 * regex_internal.c (re_string_allocate, re_string_construct):
3395 (re_string_construct_common): Likewise, for ICASE arg.
3396 * regexec.c (re_search_2_stub, re_search_stub):
3397 Likewise, for RET_LEN arg.
3398 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3399 (set_regs): Likewise, for FL_BACKTRACK arg.
3400 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3401 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3402 (calc_eclosure_iter, parse_bracket_exp):
3403 Use bool for internal variables that are booleans.
3404 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3405 (set_regs, build_sifted_states, sift_states_bkref):
3406 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3407 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3408 (find_collation_sequence_value):
3410 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3411 (re_node_set_compare):
3412 Return bool, not int. All callers changed.
3413 * regexec.c (check_halt_node_context, check_dst_limits):
3414 (build_trtable, check_node_accept): Likewise.
3415 * regex_internal.h: Include stdbool.h.
3417 Fix bugs uncovered when converting to bool.
3418 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3419 failure instead of charging ahead blindly.
3420 * regex_internal.c (register_state): Likewise.
3421 * regexec.c (re_search_2_stub): Use simpler method than boolean
3422 for freeing internal storage.
3423 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3424 bitset pieces used as boolean, to avoid undefined behavior
3425 on hosts that do int overflow checking.
3427 2005-08-31 Derek Price <derek@ximbiot.com>
3429 * getdelim.c (getdelim): Return EOF on EOF.
3430 Reported by Larry Jones <lawrence.jones@ugs.com>.
3432 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3434 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3435 lengths fit in regoff_t; this isn't true if regoff_t is the same
3437 * regex.c (re_search_internal): 5th arg is LAST_START
3438 (= START + RANGE) instead of RANGE. This avoids overflow
3439 problems when regoff_t is the same width as size_t.
3440 All callers changed.
3441 (re_search_2_stub): Check for overflow when adding the
3442 sizes of the two strings.
3443 (re_search_stub): Check for overflow when adding START
3444 to RANGE; if it occurs, substitute the extreme value.
3446 2005-08-31 Jim Meyering <jim@meyering.net>
3448 * regcomp.c (search_duplicated_node): Make first pointer arg
3450 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3451 (register_state): Likewise.
3452 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3453 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3454 (group_nodes_into_DFAstates): Likewise.
3456 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3458 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3459 old glibc regex code mishandles strings longer than 2**31 bytes.
3460 This patch fixes this when the regex code is used in gnulib
3461 (i.e., outside glibc).
3463 This patch should not affect the use of the regex code inside
3464 glibc. No doubt this problem also needs to be handled for glibc
3465 as well, but the result will be an incompatible change to the
3466 glibc ABI, and the old ABI will have to be supported too. That
3467 can be the the subject for another patch.
3469 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3470 governing whether the rest of this patch is active. By default,
3471 the macro is disabled and the patch has no effect.
3472 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3473 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3474 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3475 (re_match_2, re_set_registers): Use the new types.
3476 * regex_internal.h (Idx, re_hashval_t): New types.
3477 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3479 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3480 (re_string_context_at, bin_tree_t, re_dfastate_t):
3481 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3482 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3483 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3484 (re_string_char_size_at, re_string_wchar_at):
3485 (re_string_elem_size_at):
3486 Use the new types and macros to port to 64-bit hosts.
3487 Use unsigned types for internal values, so that the code
3488 mostly works even for arrays larger than SSIZE_MAX.
3489 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3490 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3491 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3492 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3493 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3494 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3495 (calc_inveclosure, parse_dup_op, build_range_exp):
3496 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3497 (fetch_number, create_token_tree, mark_opt_subexp):
3499 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3500 (create_cd_newstate, re_string_allocate, re_string_construct):
3501 (re_string_realloc_buffers, build_wcs_upper_buffer):
3502 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3503 (re_string_reconstruct, re_string_peek_byte_case):
3504 (re_string_fetch_byte_case, re_string_context_at):
3505 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3506 (re_node_set_init_copy, re_node_set_add_intersect):
3507 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3508 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3509 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3510 (re_acquire_state, re_acquire_state_context, register_state):
3512 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3513 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3514 (re_search_internal, re_search_2_stub, re_search_stub)
3515 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3516 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3517 (update_cur_sifted_state, check_dst_limits):
3518 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3519 (check_subexp_limits, sift_states_bkref, merge_state_array):
3520 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3521 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3522 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3523 (expand_bkref_cache, check_node_accept_bytes):
3524 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3525 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3526 (acquire_init_state_context, check_halt_node_context):
3527 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3528 (sift_states_backward, clean_state_log_if_needed):
3529 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3530 (find_recover_state, transit_state_sb, transit_state_mb):
3531 (transit_state_bkref, build_trtable, match_ctx_clean):
3533 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3534 to work around an assumption that REG_MISSING is negative.
3536 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3537 (seek_collating_symbol_entry) [defined _LIBC]:
3538 (lookup_collation_sequence_value) [defined _LIBC]:
3539 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3540 Use prototypes rather than old-style function definitions.
3541 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3542 (transit_state_sb) [0]:
3543 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3545 * regexec.c (re_search_internal): Simplify update of rm_so and
3548 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3549 (optimize_subexps, lower_subexp):
3550 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3551 since the signed shift might overflow. Use 1u<<31 instead.
3552 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3553 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3556 * regcomp.c (optimize_subexps, lower_subexp):
3557 Use CHAR_BIT rather than 8, for clarity.
3558 * regexec.c (check_dst_limits_calc_pos_1):
3559 (check_subexp_matching_top): Likewise.
3560 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3561 have to worry about portability issues when shifting it left.
3562 Remove no-longer-needed test for table_size > 0.
3563 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3564 in a word, as the resulting behavior is undefined.
3565 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3566 in one case, a <= should have been an <, and in another case the
3567 whole test was missing.
3568 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3569 the standard name CHAR_BIT.
3570 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3571 this is not true on one's complement and signed-magnitude hosts.
3573 * regex_internal.h (re_sub_match_top_t): Remove unused member
3575 (struct re_dfa_t): Remove unused member states_alloc.
3576 * regcomp.c (init_dfa): Don't initialize unused members.
3578 2005-08-31 Bruno Haible <bruno@clisp.org>
3580 * strstr.c: Include <stddef.h>, for NULL.
3581 * strcasestr.c: Likewise.
3582 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3584 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3586 * iconvme.h: Add prototype for iconv_alloc.
3588 2005-08-29 Simon Josefsson <jas@extundo.com>
3590 * iconvme.c: Fix errno.
3592 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3594 * iconvme.c: Split iconv_string into iconv_alloc.
3596 2005-08-27 Jim Meyering <jim@meyering.net>
3598 * fopen-safer.c: Merge minor changes from coreutils.
3599 * dup-safer.c: Likewise.
3600 * fd-safer.c: Likewise.
3602 Merge from coreutils.
3603 * stdio--.h: New file.
3604 * stdlib--.h: New file.
3605 * mkstemp-safer.c: New file.
3607 GNU tar needs these.
3608 * pipe-safer.c: New file.
3609 * creat-safer.c: New file.
3610 * fcntl--.h (creat): Define to creat_safer.
3611 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3612 * unistd--.h (pipe): Define to pipe_safer.
3613 * unistd-safer.h: Declare pipe_safer.
3615 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3617 * regex_internal.h: Remove all references to
3618 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3620 (bitset_not, bitset_merge, bitset_not_merge):
3621 (bitset_mask, re_string_allocate, re_string_construct):
3622 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3623 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3624 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3625 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3626 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3627 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3628 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3629 (re_acquire_state_context):
3630 Remove unnecessary forward decls.
3631 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3632 Put __attribute at function definition,
3633 now that the function decl has been removed.
3634 * regex_internal.c (re_string_peek_byte_case):
3635 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3638 2005-08-26 Simon Josefsson <jas@extundo.com>
3640 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3641 Haible <bruno@clisp.org>.
3643 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3645 * regexec.c (set_regs): Don't alloca with an unbounded size.
3647 alloca modernization/simplification for regex.
3648 * regex.c: Remove portability cruft for alloca. This no longer
3649 needs to be at the start of the file, and can be moved into
3650 regex_internal.h and simplified.
3651 * regex_internal.h: Include <alloca.h>.
3652 (__libc_use_alloca) [!defined _LIBC]: New macro.
3653 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3654 now works outside glibc.
3656 2005-08-24 Simon Josefsson <jas@extundo.com>
3658 * getpass.c: Add WIN32 implementation. Conditionalize use of
3659 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3660 GLIBC specific code.
3662 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3664 Make regex safe for g++. This fixes one real bug (an "err"
3665 that should have been "*err"). g++ problem reported by
3667 * regex_internal.h (re_calloc): New macro, consistent with
3668 re_malloc etc. All callers of calloc changed to use re_calloc.
3669 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3670 not int. All callers changed.
3671 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3672 just use an array of size MB_LEN_MAX.
3673 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3674 (find_recover_state): Change "err" to "*err"; this fixes what
3675 appears to be a real bug.
3676 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3679 2005-08-25 Jim Meyering <jim@meyering.net>
3681 * open-safer.c: Include <config.h>.
3682 Otherwise, we'd lose LARGEFILE support in any file using
3685 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3687 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3688 * regex.h (regerror): Likewise.
3690 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3691 requires this. (The code never needed it.)
3693 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3694 All uses of recently-renamed identifiers changed to use the new,
3695 POSIX-compliant names. The code will build and run just fine
3696 without these changes, but it's better to eat our own dog food
3697 and use the standard-conforming names.
3699 * regex.h: Fix a multitude of POSIX name space violations.
3700 These changes have an effect only for programs that define
3701 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3702 do not change anything for programs compiled in the normal way.
3703 Also, there is no effect on the ABI.
3705 (_REGEX_SOURCE): New macro.
3706 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3707 defined and _GNU_SOURCE is not; this fixes a name space violation.
3709 Rename the following macros to obey POSIX requirements.
3710 The old names are still visible as macros if _REGEX_SOURCE is defined.
3711 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3712 RE_BACKSLASH_ESCAPE_IN_LISTS.
3713 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3714 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3715 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3716 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3717 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3718 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3719 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3720 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3721 (REG_INTERVALS): renamed from RE_INTERVALS.
3722 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3723 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3724 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3725 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3726 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3727 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3728 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3729 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3730 RE_UNMATCHED_RIGHT_PAREN_ORD.
3731 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3732 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3733 (REG_DEBUG): renamed from RE_DEBUG.
3734 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3735 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3736 unusual, since we can't clash with the POSIX REG_ICASE.
3737 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3738 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3739 (REG_NO_SUB): renamed from RE_NO_SUB.
3740 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3741 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3742 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3743 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3744 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3745 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3746 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3747 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3748 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3749 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3750 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3751 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3752 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3753 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3754 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3755 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3756 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3757 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3758 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3759 (REG_FIXED): Renamed from REGS_FIXED.
3760 (REG_NREGS): Renamed from RE_NREGS.
3762 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3763 of other REG_* macros, since POSIX says the user is allowed to
3764 #undef these macros selectively.
3766 (reg_errcode_t): Update comment stating what other tables need
3769 Rename the following enum values to obey POSIX requirements.
3770 The old names are still visible as macros.
3771 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3772 is not defined, since GNU is supposed to be a superset of POSIX as
3773 much as possible, and since we want reg_errcode_t to be a signed
3774 type for implementation consistency.
3775 (_REG_NOERROR): Renamed from REG_NOERROR.
3776 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3777 (_REG_BADPAT): Renamed from REG_BADPAT.
3778 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3779 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3780 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3781 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3782 (_REG_EBRACK): Renamed from REG_EBRACK.
3783 (_REG_EPAREN): Renamed from REG_EPAREN.
3784 (_REG_EBRACE): Renamed from REG_EBRACE.
3785 (_REG_BADBR): Renamed from REG_BADBR.
3786 (_REG_ERANGE): Renamed from REG_ERANGE.
3787 (_REG_ESPACE): Renamed from REG_ESPACE.
3788 (_REG_BADRPT): Renamed from REG_BADRPT.
3789 (_REG_EEND): Renamed from REG_EEND.
3790 (_REG_ESIZE): Renamed from REG_ESIZE.
3791 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3792 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3793 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3794 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3795 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3797 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3798 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3799 changed. But support the old name if the new one is not defined
3800 and if _REGEX_SOURCE.
3802 Change the following member names in struct re_pattern_buffer.
3803 The old names are still supported if !_REGEX_SOURCE.
3804 The new names are always supported, regardless of _REGEX_SOURCE.
3805 (re_buffer): Renamed from buffer.
3806 (re_allocated): Renamed from allocated.
3807 (re_used): Renamed from used.
3808 (re_syntax): Renamed from syntax.
3809 (re_fastmap): Renamed from fastmap.
3810 (re_translate): Renamed from translate.
3811 (re_can_be_null): Renamed from can_be_null.
3812 (re_regs_allocated): Renamed from regs_allocated.
3813 (re_fastmap_accurate): Renamed from fastmap_accurate.
3814 (re_no_sub): Renamed from no_sub.
3815 (re_not_bol): Renamed from not_bol.
3816 (re_not_eol): Renamed from not_eol.
3817 (re_newline_anchor): Renamed from newline_anchor.
3819 Change the following member names in struct re_registers.
3820 The old names are still supported if !_REGEX_SOURCE.
3821 The new names are always supported, regardless of _REGEX_SOURCE.
3822 (rm_num_regs): Renamed from num_regs.
3823 (rm_start): Renamed from start.
3824 (rm_end): Renamed from end.
3826 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3827 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3828 Prepend __ to parameter names.
3830 Undo yesterday's changes.
3832 2005-08-24 Jim Meyering <jim@meyering.net>
3834 Sync from coreutils.
3835 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3837 2005-08-21 Bruno Haible <bruno@clisp.org>
3839 * lock.h: Add multiple inclusion guard.
3840 * tls.h: Add multiple inclusion guard.
3842 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3844 * regex.h (REG_NOSYS)
3845 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3846 Define, since POSIX requires it as of 2001.
3847 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3848 New private symbol, used to keep the enum signed in all cases.
3849 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3850 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3852 * regex_internal.c (re_string_skip_chars, register_state):
3854 Remove forward decls; no longer needed now that we use prototypes.
3855 * regexec.c (acquire_init_state_context, check_halt_node_context):
3856 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3857 (clean_state_log_if_needed): Likewise.
3859 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3861 Fix problems reported by Sam Steingold in
3862 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3863 * regexec.c (sift_states_bkref): Fix portability bug: the code
3864 assumed that reg_errcode_t is a signed type, which is not
3865 necessarily true if _XOPEN_SOURCE is not defined.
3866 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3867 some compilers warn about it otherwise.
3869 2005-08-20 Jim Meyering <jim@meyering.net>
3871 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3872 of unused local, dfa.
3874 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3876 * regcomp.c (create_initial_state): Remove duplicate decl.
3877 (init_word_char, create_initial_state, duplicate_node_closure):
3878 (fetch_token, peek_token_bracket, build_range_exp):
3879 (build_collating_symbol): Remove forward decls; no longer needed
3880 now that we use prototypes.
3883 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3884 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3885 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3886 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3887 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3888 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3889 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3890 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3891 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3892 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3893 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3894 (build_charclass, build_charclass_op, fetch_number, create_tree):
3895 (create_token_tree, mark_opt_subexp, duplicate_tree):
3896 Use prototypes rather than old-style definitions.
3899 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3900 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3901 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3902 (re_string_reconstruct, re_string_peek_byte_case):
3903 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3904 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3905 (re_node_set_init_copy, re_node_set_add_intersect):
3906 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3907 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3908 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3909 (re_acquire_state, re_acquire_state_context, register_state):
3910 (create_ci_newstate, create_cd_newstate, free_state):
3912 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3913 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3914 (re_search_internal, prune_impossible_nodes):
3915 (acquire_init_state_context, check_matching, static):
3916 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3917 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3918 (update_regs, sift_states_backward, build_sifted_states):
3919 (clean_state_log_if_needed, merge_state_array):
3920 (update_cur_sifted_state, add_epsilon_src_nodes):
3921 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3922 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3923 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3924 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3925 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3926 (check_arrival, check_arrival_add_next_nodes):
3927 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3928 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3929 (check_node_accept_bytes, check_node_accept, extend_buffers):
3930 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3931 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3936 (re_string_allocate, re_string_construct, re_string_reconstruct):
3937 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3938 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3939 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3940 (re_string_context_at, re_string_peek_byte_case):
3941 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3942 is defined, since we now use prototypes always.
3944 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3945 C89 or better. All uses removed.
3947 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3949 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3950 [defined lint]: Suppress bogus uninitialized-variable warnings.
3952 * regcomp.c (duplicate_node): Return new index, not an error code,
3953 and let the caller return REG_ESPACE if out of space. This
3954 removes an uninitialied-variable warning with GCC 4.0.1, and also
3955 avoids taking the address of a local variable. All callers
3958 2005-08-19 Jim Meyering <jim@meyering.net>
3960 * regexec.c (proceed_next_node): Redo local variables to
3961 avoid GCC shadowing warnings.
3963 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3965 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3966 (re_node_set_insert_last, re_dfa_add_node):
3967 Rename local variables to avoid GCC shadowing warnings.
3969 2005-08-18 Bruno Haible <bruno@clisp.org>
3971 * strstr.c (strstr): Fix return value in multibyte case.
3972 * strcasestr.c (strcasestr): Likewise.
3974 2005-08-17 Jim Meyering <jim@meyering.net>
3976 Make the %s format (seconds since the epoch) work for a negative
3977 number and when used with a zero-padded field width, e.g. %015s.
3979 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3980 label so that it precedes the code to set `digits'. Otherwise,
3981 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3982 print `00-22'. Now, it prints `-0022', as it should.
3984 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3986 * regex.h: Remove useless space-before-tab. From coreutils.
3988 2005-08-17 Bruno Haible <bruno@clisp.org>
3990 * strcasestr.h: New file.
3991 * strcasestr.c: New file.
3993 2005-08-17 Bruno Haible <bruno@clisp.org>
3995 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3996 * strstr.c: Completely rewritten, with multibyte locale support.
3998 2005-08-17 Bruno Haible <bruno@clisp.org>
4000 * strcasecmp.c: Use mbuiter.h.
4002 2005-08-17 Bruno Haible <bruno@clisp.org>
4004 * mbuiter.h: New file.
4006 2005-08-16 Bruno Haible <bruno@clisp.org>
4008 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4010 (mbi_avail, mbi_advance): Let the iteration end before the terminating
4011 NUL byte, not after it.
4013 2005-08-16 Bruno Haible <bruno@clisp.org>
4015 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4016 the valid ones. Makes the comparison operations transitive:
4017 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4018 * strcasecmp.c (strcasecmp): Use mb_casecmp.
4020 2005-08-16 Bruno Haible <bruno@clisp.org>
4022 * strcase.h (strcasecmp): Add note in comments.
4023 * strncasecmp.c: Use code from strcasecmp.c.
4024 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4025 (strcasecmp): Work correctly in multibyte locales.
4027 2005-08-16 Bruno Haible <bruno@clisp.org>
4029 * strnlen1.h: New file.
4030 * strnlen1.c: New file.
4032 2005-08-16 Bruno Haible <bruno@clisp.org>
4034 * mbfile.h: New file.
4036 2005-08-16 Bruno Haible <bruno@clisp.org>
4038 * mbiter.h: New file.
4040 2005-08-16 Bruno Haible <bruno@clisp.org>
4042 * mbchar.h: New file.
4043 * mbchar.c: New file.
4045 2005-08-16 Bruno Haible <bruno@clisp.org>
4047 * tls.h: New file, from GNU gettext.
4048 * tls.c: New file, from GNU gettext.
4050 2005-08-15 Bruno Haible <bruno@clisp.org>
4052 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4055 2005-08-14 Jim Meyering <jim@meyering.net>
4057 Sync from coreutils.
4059 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4060 Use the hash-table-based cycle-detection code not just when
4061 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4062 Reported by James Youngman in
4063 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4064 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4065 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4066 This lets us compile with -DFTS_DEBUG, once again.
4067 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4068 * fts.c (fd_safer): Remove decl.
4069 Include fcntl--.h rather than unistd-safer.h
4070 (fts_safe_changedir): Don't call fd_safer; no longer needed
4071 now that we include fcntl--.h.
4073 2005-08-11 Simon Josefsson <jas@extundo.com>
4075 * readline.h, readline.c: New file.
4077 2005-08-11 Bruno Haible <bruno@clisp.org>
4079 * strnlen.h (strnlen): Change parameter name to match comment.
4081 2005-08-10 Simon Josefsson <jas@extundo.com>
4083 * strndup.c: Use strnlen.h.
4085 * strnlen.h: New file.
4087 2005-08-02 Simon Josefsson <jas@extundo.com>
4089 * getline.h, getline.c: Rewrite.
4091 * getdelim.h, getdelim.c: New files, ported from glibc.
4093 2005-07-31 Bruno Haible <bruno@clisp.org>
4095 * lock.h (gl_lock_initializer): New macro.
4096 (gl_lock_define_initialized): Use it.
4097 (gl_rwlock_initializer): New macro.
4098 (gl_rwlock_define_initialized): Use it.
4099 (gl_recursive_lock_initializer): New macro.
4100 (gl_recursive_lock_define_initialized): Use it.
4102 2005-07-26 Bruno Haible <bruno@clisp.org>
4104 * lock.h: Update from GNU gettext.
4105 * lock.c: Update from GNU gettext.
4107 2005-07-18 Bruno Haible <bruno@clisp.org>
4109 * lock.h (gl_once_t): New type.
4110 (gl_once_define, gl_once): New macros.
4111 * lock.c (fresh_once): New variable.
4112 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4115 2005-07-18 Simon Josefsson <jas@extundo.com>
4117 * check-version.c (check_version): Accept identical versions too.
4119 2005-07-18 Bruno Haible <bruno@clisp.org>
4121 * lock.h: New file, from GNU gettext.
4122 * lock.c: New file, from GNU gettext.
4124 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4126 * quotearg.c: Add translator comment suggested by Bruno Haible,
4127 with a minor change.
4129 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4131 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4132 copyright symbol and the year.
4133 * version-etc.c (COPYRIGHT_YEAR): New constant.
4134 (version_etc_va): Use parameterized copyright notice.
4135 Reword to conform to the current GNU coding standards.
4137 2005-07-11 Simon Josefsson <jas@extundo.com>
4139 * size_max.h: New file.
4141 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4143 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4146 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4147 and Paul Eggert <eggert@cs.ucla.edu>
4149 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4150 in wint_t, not wchar_t. Remove now-unnecessary cast.
4152 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4154 * regex.c, regex.h: Sync from libc.
4155 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4156 New files, synced from libc, except that regex_internal.h
4157 currently has a small porting fix.
4159 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4161 Remove the dependency of the strftime module on the tzset module.
4162 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4163 Copy the input structure, to work around some of the bug with
4164 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4165 Solaris releases, you should also use the tzset module, but we won't
4166 require it as a dependency any more since we don't want LGPLed code
4167 to depend on GPLed code.
4169 2005-07-02 Jim Meyering <jim@meyering.net>
4171 * backupfile.c (backup_args): Change a `0' to NULL.
4173 2005-07-01 Jim Meyering <jim@meyering.net>
4175 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4176 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4177 * save-cwd.c, tempname.c:
4178 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4179 and don't include <sys/file.h>).
4181 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4183 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4184 declares only 'struct timespec;' (!).
4186 2005-06-29 Jim Meyering <jim@meyering.net>
4188 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4189 type name. Use the variable name instead.
4190 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4192 2005-06-28 Simon Josefsson <jas@extundo.com>
4194 * check-version.h, check-version.c: New files.
4196 2005-06-28 Simon Josefsson <jas@extundo.com>
4198 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4199 collision with global variable. Better indentation. Don't
4200 increment buffer pointer beyond buffer end. Based on comments
4201 from Paul Eggert <eggert@cs.ucla.edu>.
4205 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4207 * canon-host.c (canon-host): Append trailing "," to 0 in
4208 initializer of struct addrinfo, as an indication that we don't
4209 care how many members the structure has.
4211 2005-06-24 Derek Price <derek@ximbiot.com>
4212 and Bruno Haible <bruno@clisp.org>
4214 Remove stat module & update lstat.
4215 * stat.c: Remove this file...
4216 (slash_aware_lstat): ...moving this content and its support...
4217 * lstat.c (rpl_lstat): ...into here.
4218 * lstat.h: New file.
4220 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4222 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4223 (ranged_convert): Don't save conversion in a temporary struct.
4224 This causes a warning with GCC 4.0.0, and anyway in the typical
4225 case it's not worth the extra 100 bytes or so of code.
4226 (ranged_convert, __mktime_internal): When calling a function via a
4227 pointer P, use P () rather than (*P) (), as we now assume C89 or
4230 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4232 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4233 "who -r" failed to give output. Problem reported by Tim Waugh.
4235 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4236 (xcalloc): Use it to avoid needless tests.
4237 Problem reported by Jim Meyering.
4239 2005-06-16 Jim Meyering <jim@meyering.net>
4241 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4242 when either N or S is zero.
4244 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4246 * argp.h (__option_is_short): Check upper limit of
4247 __key. Isprint() requires its argument to have the value
4248 of an unsigned char or EOF.
4250 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4252 * fnmatch.c (fnmatch): If there is an encoding error in a
4253 multibyte string or pattern, fall back on unibyte matching.
4254 Problem reported by James Youngman.
4256 2005-06-08 Bruno Haible <bruno@clisp.org>
4258 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4261 2005-06-08 Bruno Haible <bruno@clisp.org>
4263 * csharpcomp.h: New file, from GNU gettext.
4264 * csharpcomp.c: New file, from GNU gettext.
4265 * csharpcomp.sh.in: New file, from GNU gettext.
4267 2005-06-07 Derek Price <derek@ximbiot.com>
4270 * glob_.h: Indent nested #ifdef.
4272 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4274 Sync from coreutils.
4275 Use "file name" when talking about file names, instead of "filename"
4276 or "path", as per the GNU coding standards.
4277 * mkdir-p.c: Renamed from makepath.c.
4278 (make_dir_parents): Renamed from make_path. All callers changed.
4279 * mkdir-p.h: Likewise. All includers changed.
4280 * filenamecat.c: Renamed from path-concat.c.
4281 (file_name_concat): Renamed from path_concat. All callers changed.
4282 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4283 * filenamecat.h: Likewise. All includers changed.
4284 * acl.c: Don't use "path" or "filename" to mean "file name"
4285 in comments or local variable names.
4286 * basename.c: Likewise.
4287 * canonicalize.c, canonicalize.h: Likewise.
4288 * dirname.c, dirname.h: Likewise.
4289 * euidaccess.c: Likewise.
4290 * exclude.c: Likewise
4291 * fnmatch_.h, fnmatch_loop.c: Likewise.
4292 * fsusage.c, fsuage.h: Likewise.
4293 * fts.c, fts_.h: Likewise.
4294 * getcwd.c: Likewise.
4295 * getloadavg.c: Likewise.
4296 * mkstemp.c: Likewise.
4297 * mountlist.c, mountlist.h: Likewise.
4298 * openat.c, openat.h: Likewise.
4299 * readlink-stub.c: Likewise.
4300 * readutmp.c, readutmp.h: Likewise.
4301 * rename.c: Likewise.
4302 * rmdir.c: Likewise.
4304 * savedir.c: Likewise.
4305 * stripslash.c: Likewise.
4306 * tempname.c: Likewise.
4307 * xreadlink.c: Likewise.
4308 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4310 * exclude.h: Likewise.
4312 * euidaccess.c (getuid, getgid, getuid, getegid)
4313 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4314 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4315 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4316 * pathmax.h: Include <limits.h> unconditionally, since other
4317 files have been getting away with it for years (MORE/BSD 4.3
4319 * userspec.c (getpwnam, getgrnam, getgrgid)
4320 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4322 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4323 Define to 256, not 255, as per modern POSIX.
4325 2005-06-01 Bruno Haible <bruno@clisp.org>
4327 * csharpexec.h: New file, from GNU gettext.
4328 * csharpexec.c: New file, from GNU gettext.
4329 * csharpexec.sh.in: New file, from GNU gettext.
4331 2005-05-31 Derek Price <derek@ximbiot.com>
4332 Paul Eggert <eggert@cs.ucla.edu>
4335 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4337 2005-05-29 Derek Price <derek@ximbiot.com>
4338 Paul Eggert <eggert@cs.ucla.edu>
4340 * glob_.h, glob.c: New files.
4342 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4344 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4346 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4347 the configuration hassle isn't worth it.
4348 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4349 (LONGEST_MODIFIER, PRIuMAX): Remove.
4351 2005-05-27 Bruno Haible <bruno@clisp.org>
4353 * getlogin_r.h: Remove second include of <stddef.h>.
4355 2005-05-25 Bruno Haible <bruno@clisp.org>
4356 Derek Price <derek@ximbiot.com>
4358 * getlogin_r.h: Simplify API documentation.
4360 2005-05-25 Derek Price <derek@ximbiot.com>
4361 Paul Eggert <eggert@cs.ucla.edu>
4363 * getlogin_r.c, getlogin_r.h: New files.
4365 2005-05-22 Bruno Haible <bruno@clisp.org>
4367 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4368 Also include <sys/param.h> if it defines MIN, MAX.
4369 Based on a patch by Derek Price <derek@ximbiot.com>.
4371 2005-05-22 Bruno Haible <bruno@clisp.org>
4373 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4374 (INT64_MIN): Fix definition.
4375 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4377 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4378 NEED_SIGNED_INT_TYPES.
4380 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4381 HAVE_SYSTEM_INTTYPES.
4383 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4385 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4386 so that unistd-safer.h (GPL'ed code) need not be included.
4388 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4391 * fts.c: Don't include "cycle-check.h" or "hash.h".
4392 (setup_dir, free_dir): New functions.
4393 (enter_dir, leave_dir): Define trivial
4394 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4395 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4396 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4397 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4398 Move to fts-cycle.c.
4399 (fts_open): Use setup_dir.
4400 (fts_close): Use free_dir.
4401 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4402 This adds a label and some gotos, but the alternatives were messier.
4403 Check for memory allocation failure when entering a dir.
4404 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4405 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4406 (FTS): New member fts_cycle, that is a union that contains the
4407 old active_dir_ht and cycle_state. All uses changed to mention
4408 fts_cycle.ht and fts_cycle.state.
4409 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4410 fts.c, with the following changes:
4411 (setup_dir, free_dir): New functions.
4412 (enter_dir): Now returns bool. Return true if successful, false
4413 if memory exhausted. All callers changed.
4414 Do not bother partly cleaning up on
4415 memory allocation failure; that is free_dir's job.
4416 However, free ad if hash_insert fails, to avoid memory leak.
4417 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4418 fts->fts_options to see which union member to use.
4420 2005-05-20 Jim Meyering <jim@meyering.net>
4422 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4423 Now a macro, to pacify GCC.
4425 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4427 * chown.c (rpl_chown): Return -1 on failure.
4429 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4431 * canonicalize.c: Include canonicalize.h first, to test interface.
4432 Include <stddef.h> unconditionally, since we assume C89 now.
4433 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4434 * fts.c: Include fts_.h first, to check interface.
4435 Do not include intprops.h; no longer needed.
4436 Include cycle-check.h and hash.h, since fts_.h no longer does.
4437 Remove unnecessary casts of closedir to void.
4438 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4439 decide whether to decrement nlinks.
4440 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4441 (FTS): Use struct hash_table * instead of Hash_table, so that
4442 we no longer need to include hash.h here.
4444 2005-05-17 Jim Meyering <jim@meyering.net>
4446 * fts.c, fts_.h: New files, from coreutils.
4448 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4450 Sync from coreutils.
4451 * unlinkdir.c, unlinkdir.h: New files.
4452 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4453 regex.h, unlocked-io.h, xtime.h:
4454 White space changes only.
4455 * makepath.c (make_path): Port to hosts where leading "//" is special.
4456 * yesno.c: Include getline.h, not ctype.h.
4457 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4458 Use getline to remove arbitrary restriction on response length.
4460 2005-05-13 Bruno Haible <bruno@clisp.org>
4462 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4463 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4464 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4465 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4466 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4467 Add support for 64-bit integers in the MSVC compiler.
4469 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4471 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4472 Change the initial comment to refer to GPL, not LGPL.
4473 gnulib-tool will change it to LGPL as needed.
4475 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4476 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4477 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4478 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4479 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4480 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4481 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4482 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4483 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4484 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4485 concatpath.c, config.charset, copy-file.c, copy-file.h,
4486 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4487 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4488 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4489 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4490 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4491 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4492 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4493 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4494 full-read.c, full-read.h, full-write.c, full-write.h,
4495 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4496 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4497 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4498 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4499 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4500 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4501 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4502 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4503 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4504 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4505 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4506 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4507 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4508 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4509 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4510 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4511 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4512 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4513 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4514 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4515 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4516 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4517 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4518 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4519 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4520 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4521 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4522 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4523 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4524 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4525 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4526 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4527 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4528 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4529 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4530 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4531 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4532 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4533 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4534 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4535 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4536 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4537 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4538 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4539 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4540 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4541 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4542 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4543 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4544 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4545 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4546 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4547 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4548 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4549 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4550 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4551 Update FSF postal mail address.
4553 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4555 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4556 specified in ai_socktype. Fix invalid ai_protocol
4557 check. ai_protocol is usually set to 0 or depending on
4558 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4559 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4560 ai_socktype / ai_protocol in the returned addrinfo structure.
4562 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4563 Bruno Haible <bruno@clisp.org>
4565 * inet_ntop.h: New file.
4566 * inet_ntop.c: New file, from glibc with modifications.
4568 2005-05-08 Jim Meyering <jim@meyering.net>
4570 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4572 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4574 Merge from coreutils. Among other things,
4575 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4576 * fd-safer.c: New file.
4577 * fcntl-safer.h, open-safer.c: Remove.
4578 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4579 * dup-safer.c: Include unistd-safer.h first.
4580 Don't include errno.h.
4581 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4582 * file-type.h: Don't assume invoker included sys/stat.h first.
4583 * file-type.c: Rely on file-type.h change.
4584 * getloadavg.c: Include unistd-safer.h.
4585 (getloadavg): Use safer open.
4586 * getusershell.c: Include "stdio-safer.h".
4587 (getusershell): Use safer fopen.
4588 * long-options.c (long_options): Use NULL rather than 0.
4589 * modechange.h (mode_free): Remove; all callers changed to invoke
4591 * modechange.c: Likewise.
4592 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4593 (MODE_DONE): New constant.
4594 (struct mode_change): Remove 'next' member.
4595 (make_node_op_equals): New function; like the old one of the
4596 same name, except it allocates an array.
4597 (mode_compile, mode_create_from_ref): Use it.
4598 (mode_compile): Allocate result as an array, not a linked list.
4599 Parse octal string ourself, so that we catch mistakes like "+0".
4600 (mode_adjust): Arg is an array, not a linked list.
4601 * modechange.c: Include stat-macros.h, xalloc.h.
4602 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4603 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4604 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4605 Remove. This is now stat-macros.h's job.
4606 (talloc): Remove. All callers replaced by xalloc, so that
4607 our invokers don't have to worry about reporting memory failures.
4608 (make_node_op_equals): Remove.
4609 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4611 (struct mode_change): Moved here from modechange.h.
4612 (mode_append_entry): Remove.
4613 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4614 apps to have incorrect behavior. Use simpler algorithm for head
4615 and tail. Don't futz with umask; that's now the job of mode_adjust.
4616 Detect more invalid usages rather than having somewhat-random behavior.
4617 Don't insert an "a=" action, as that leads to incorrect behavior.
4618 (mode_compile, mode_create_from_ref): Return NULL on error instead
4619 of an enum, since now there's only one way to have an error. All
4621 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4622 at the correct time. Simplify calculation of "+u" and its ilk.
4623 Don't mishandle "+X".
4624 (mode_free): Remove "register" and localize decls.
4625 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4626 (struct mode_change): Move to modechange.c; callers don't
4627 need to see this stuff.
4628 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4629 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4630 (mode_change, mode_adjust): Reflect the new signatures noted above.
4631 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4632 that might redefine system include files.
4633 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4634 (my_usleep): Use NULL rather than (void *) 0.
4635 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4636 Use siginterrupt to specify that system calls should be interrupted.
4637 (rpl_nanosleep): Move initialization of suspended closer to call of
4639 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4640 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4641 (desirable_utmp_entry): New function.
4642 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4643 using x2nrealloc, to simplify logic.
4644 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4645 size calculation. Do not assume utmp file is a regular file.
4646 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4647 (READ_UTMP_CHECK_PIDS): New constant.
4648 * save-cwd.c: Include unistd-safer.h.
4649 (save_cwd): Use fd_safer.
4650 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4651 [!_LIBC] Include "stat-macros.h" instead.
4652 * unistd-safer.h (fd_safer): New decl.
4654 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4656 * byteswap_.h: New file.
4658 2005-04-25 Albert Chin <china@thewrittenword.com>
4660 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4663 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4665 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4666 that "UTC +1 second" continues to work. Problem reported
4668 (relunit_snumber): New rule.
4671 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4673 * getdate.y (universal_time_zone_table): New constant.
4674 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4675 universal_time_zone_table.
4676 (lookup_zone): Prefer universal_time_zone_table to
4677 local_time_zone_table, so that "GMT" time stamps are allowed in
4678 London during the summer. Problem reported by Ian Abbott.
4680 2005-04-12 Jim Meyering <jim@meyering.net>
4682 * human.c (humblock): Set *options even when returning due to
4683 xstrtoumax conversion failure. Thanks to a used-uninitialized
4686 2005-04-09 Jim Meyering <jim@meyering.net>
4688 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4689 -Wuninitialized: initialize tm0.tm_year.
4691 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4693 * getdate.y (parser_control): rels_seen is now a boolean, not a
4694 count, since there's no maximum. All uses changed.
4695 Add member dsts_seen.
4696 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4698 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4699 Use pc_rels_seen to decide whther a date is absolute.
4701 * getdate.y (number): Don't overwrite year.
4702 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4705 2005-04-02 Simon Josefsson <jas@extundo.com>
4707 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4708 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4710 2005-03-27 Jim Meyering <jim@meyering.net>
4712 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4714 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4716 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4717 "one's complement" -> "ones' complement" in comment, as per Knuth.
4718 "value of type" -> "type or expression" in comment.
4719 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4721 2005-03-26 Jim Meyering <jim@meyering.net>
4724 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4725 Correct typos: s/or/of/.
4727 2005-03-23 Jim Meyering <jim@meyering.net>
4729 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4731 2005-03-21 Jim Meyering <jim@meyering.net>
4733 Changes imported from coreutils.
4735 * cycle-check.c: Don't include xalloc.h.
4737 * path-concat.c: Don't include assert.h.
4738 (path_concat): Remove assertion that would have triggered
4739 for ABASE starting with more than one slash.
4740 Reported by Andreas Schwab.
4742 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4743 properly when ABASE is an absolute file name.
4744 Correct the description of this function.
4746 Add an assertion and a test driver.
4747 This fixes a bug introduced on 2004-07-02.
4748 Andreas Schwab reported the resulting failure of cp --parents:
4749 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4751 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4753 * strftime.c (my_strftime): If the underlying strftime returns 0
4754 (which shouldn't happen), generate nothing instead of returning 0
4755 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4757 2005-03-16 Bruno Haible <bruno@clisp.org>
4759 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4761 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4763 * strftime.c (my_strftime): Prepend space to format so that we can
4764 reliably distinguish strftime failure from empty output on POSIX
4767 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4769 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4770 (iconv_string): Don't guess a size-zero buffer, as that might cause
4771 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4772 result would be 'too large', where 'too large' is (heuristically)
4773 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4774 overflow concerns. This will prevent some unwanted malloc failures
4775 when the inputs are very large.
4777 2005-03-15 Bruno Haible <bruno@clisp.org>
4779 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4782 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4785 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4787 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4789 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4790 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4792 * strtol.c: Likewise.
4794 2005-03-14 Simon Josefsson <jas@extundo.com>
4796 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4799 2005-03-14 Jim Meyering <jim@meyering.net>
4801 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4802 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4803 to be nonzero so that we (and caller) can detect the difference
4804 between a valid zero-length expansion and an error return, even
4805 when the underlying strftime fails before writing anything into
4808 2005-03-10 Jim Meyering <jim@meyering.net>
4810 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4811 so that this module works on systems without fchdir.
4813 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4815 Factor int-properties macros into a single file, except for
4816 glibc-related files.
4817 * intprops.h: New file.
4818 * getloadavg.c: Include it instead of limits.h.
4819 (INT_STRLEN_BOUND): Remove.
4820 * human.c: Include intprops.h.
4821 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4822 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4823 * inttostr.h: Include intprops.h instead of limits.h.
4824 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4825 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4826 for consistency with intprops.h.
4827 (time_t_is_integer, twos_complement_arithmetic): Use them.
4828 * sig2str.h: Include <signal.h>, intprops.h.
4829 (INT_STRLEN_BOUND): Remove.
4830 * strftime.c (TYPE_SIGNED): Remove.
4831 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4832 * strtol.c: Adjust comments to match intprops.h.
4833 * userspec.c: Include intprops.h.
4834 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4835 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4836 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4837 instead of rolling our own expressions.
4838 * xstrtol.c: Include xstrtol.h first, to test interface.
4840 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4842 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4843 the right thing even if adding 1900 would overflow. Similarly
4844 for tm_mon + 1 and tm_yday + 1.
4845 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4846 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4847 (DO_SIGNED_NUMBER): New macro.
4848 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4850 2005-03-07 Bruno Haible <bruno@clisp.org>
4852 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4854 2005-03-03 Derek R. Price <derek@ximbiot.com>
4855 Bruno Haible <bruno@clisp.org>
4857 * pagealign_alloc.h: New file.
4858 * pagealign_alloc.c: New file.
4860 2005-01-28 Bruno Haible <bruno@clisp.org>
4862 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4865 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4867 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4868 The workaround isn't strictly needed for POSIX conformance, and
4869 it's too much of a pain to configure and maintain. We'll ask
4870 people to fix their kernels instead.
4871 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4872 (NANOSLEEP_BUG_WORKAROUND): Remove.
4873 (xnanosleep): Remove the workaround.
4875 2005-02-12 Bruno Haible <bruno@clisp.org>
4877 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4879 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4881 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4882 * timespec.h (gettime): Return void, since it always
4883 succeeds now. All uses changed.
4884 * gettime.c (gettime) Likewise.
4885 [HAVE_NANOTIME]: Prefer nanotime.
4886 Assume gettimeofday succeeds, as POSIX requires.
4887 Assime time () succeeds, since other code already does.
4888 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4889 (timespec_subtract): Remove.
4890 (NANOSLEEP_BUG_WORKAROUND): New constant.
4891 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4892 things considerably. Use it only on GNU/Linux hosts, since the
4893 workaround shouldn't be needed elsewhere.
4895 2005-02-24 Bruno Haible <bruno@clisp.org>
4897 * gettext.h: Update from GNU gettext 0.14.2.
4899 2005-02-24 Bruno Haible <bruno@clisp.org>
4901 * localcharset.c: Update from GNU gettext 0.14.2.
4902 * config.charset: Update from GNU gettext 0.14.2.
4904 2005-02-22 Simon Josefsson <jas@extundo.com>
4906 * iconvme.h, iconvme.c: New files, from libc.
4908 2005-02-20 Neil Conway <neilc@samurai.com>
4910 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4911 returned by OSX/Darwin if the specified buffer is not large
4912 enough for the hostname.
4914 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4916 * memrchr.h: New file.
4917 * chdir-long.c: Include it.
4918 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4919 Don't bother including stddef.h.
4921 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4923 * argp-help.c (__argp_help): Create a fake struct argp_state and
4924 pass it to _help, otherwise the latter coredumps trying to
4925 dereference state.root_argp.
4927 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4929 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4931 Include <sys/types.h>, for dev_t.
4932 (ME_DUMMY, ME_REMOTE): Move from here....
4933 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4934 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4936 Include mountlist.h first, to test the interface.
4938 2005-01-29 Bruno Haible <bruno@clisp.org>
4940 * progname.c (program_name): Initialize.
4941 Needed when linking statically on MacOS X.
4943 2005-01-28 Bruno Haible <bruno@clisp.org>
4945 * javacomp.sh.in: New file, from GNU gettext.
4946 * javacomp.h: New file, from GNU gettext.
4947 * javacomp.c: New file, from GNU gettext.
4949 2005-01-26 Bruno Haible <bruno@clisp.org>
4951 * javaexec.sh.in: New file, from GNU gettext.
4952 * javaexec.h: New file, from GNU gettext.
4953 * javaexec.c: New file, from GNU gettext.
4955 2005-01-26 Simon Josefsson <jas@extundo.com>
4957 * gai_strerror.c: Use GPL in header.
4959 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4961 * argp-help.c (hol_entry_help): Avoid using non-constant
4962 initializers for struct pentry_state.
4963 (__argp_error): Check return value of __asprintf
4964 (__argp_failure): Translate error message
4966 * argp-parse.c: Removed braces around the expansion of N_()
4968 2005-01-21 Jim Meyering <jim@meyering.net>
4970 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4971 same value as for Solaris 9.
4973 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4974 component length. This included changing the parameter to be
4975 of type `char *' rather than `char const *'.
4976 * chdir-long.h (chdir_long): Update prototype.
4978 * openat.c (fdopendir, fstatat): New functions.
4979 * openat.h: Include headers required for use of DIR and struct stat.
4980 [AT_SYMLINK_NOFOLLOW]: Define.
4981 (fdopendir, fstatat): Add prototypes.
4983 2005-01-21 Bruno Haible <bruno@clisp.org>
4985 * classpath.h: New file, from GNU gettext.
4986 * classpath.c: New file, from GNU gettext.
4988 2005-01-20 Simon Josefsson <jas@extundo.com>
4990 * version-etc-fsf.c: New file, with version_etc_copyright.
4991 * version-etc.c: Remove version_etc_copyright.
4992 * version-etc.h (version_etc_copyright): Use [] instead of * in
4993 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4995 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4997 * save-cwd.c (save_cwd): Remove code to support the case
4998 where fchdir is missing or flaky.
5000 2005-01-20 Simon Josefsson <jas@extundo.com>
5002 * base64.h (isbase64): Add.
5004 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5005 using a unsigned prototype, don't inline.
5006 (base64_decode): Use it.
5008 2005-01-19 Bruno Haible <bruno@clisp.org>
5010 * sh-quote.h: New file, from GNU gettext.
5011 * sh-quote.c: New file, from GNU gettext.
5013 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
5015 Merge changes from coreutils, as described below in several
5016 changelogs dated today.
5018 * save-cwd.c: Include "save-cwd.h" before other include files.
5019 (O_DIRECTORY): Remove; not needed here, since "." must be
5020 a directory. All uses removed.
5021 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
5022 universal on Suns, and we also need to test for IRIX.
5023 Revamp code to use 'if' rather than '#if'.
5024 Avoid unnecessary comparison of cwd->desc to 0.
5026 * utimens.c (futimens): Robustify the previous patch, by checking
5027 for known valid error numbers rather than observed invalid ones.
5029 2005-01-18 Jim Meyering <jim@meyering.net>
5031 * version-etc.c (version_etc_copyright): Update copyright date.
5033 * utimens.c (futimens): Account for the fact that futimes
5034 can also fail with errno == ENOSYS or errno == ENOENT.
5035 Patch from Dmitry V. Levin.
5037 Change the name of the robust chdir function from chdir to chdir_long.
5038 * save-cwd.c: Include chdir-long.h rather than chdir.h.
5039 (restore_cwd): Use chdir_long, not chdir.
5040 * chdir-long.c: Renamed from chdir.c.
5041 * chdir-long.h: Renamed from chdir.h.
5042 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5045 2005-01-18 Bob Proulx <bob@proulx.com>
5047 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5048 offsetof() macro construct to avoid compile failure with native HP-UX
5049 11.0 ANSI C compiler.
5051 2005-01-06 Bruno Haible <bruno@clisp.org>
5053 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5054 because stpncpy.m4 takes care of it.
5056 2004-01-24 Bruno Haible <bruno@clisp.org>
5058 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5060 2003-10-09 Bruno Haible <bruno@clisp.org>
5062 * progreloc.c: Include xalloc.h instead of xmalloc.h.
5064 2005-01-06 Bruno Haible <bruno@clisp.org>
5066 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5067 * fwriteerror.c: Include <stdbool.h>.
5068 (fwriteerror): At the end, close the file stream. Record whether
5069 stdout was already closed.
5071 2004-05-27 Bruno Haible <bruno@clisp.org>
5073 * execute.c (environ): Declare if needed.
5074 * pipe.c (environ): Likewise.
5075 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5077 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5079 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5080 definitions to be after all include files, to avoid collisions.
5081 Problem reported by Bob Proulx.
5083 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5085 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5086 not needed. This removes a dependency on the gettext module.
5087 [defined _LIBC]: Do not include <libintl.h>; not needed.
5089 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5091 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5094 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5096 * argp-parse.c: Include <stddef.h>.
5097 (alignof, alignto): New macros.
5098 (parser_init): Don't assume that void * is aligned sufficiently
5101 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5102 need to extend the stack.
5103 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5106 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5108 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5110 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5112 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5113 Remove now-obsolete comment about AIX.
5114 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5115 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5116 (YYMAXDEPTH): New macro.
5118 2004-12-18 Bruno Haible <bruno@clisp.org>
5120 * fatal-signal.c (fatal_signals): Make non-const.
5121 (init_fatal_signals): New function.
5122 (uninstall_handlers, install_handlers): Ignore signals that were set to
5124 (at_fatal_signal): Call init_fatal_signals.
5125 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5127 Reported by Paul Eggert.
5129 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5131 * getdate.y (textint): New member "negative".
5132 (time_zone_hhmm): New function.
5133 Expect 14 shift-reduce conflicts, not 13.
5134 (o_colon_minutes): New rule.
5135 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5136 (yylex): Set the "negative" member of signed numbers.
5138 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5140 Changes imported from coreutils.
5141 * hard-locale.c: Assume <locale.h> exists.
5143 (GLIBC_VERSION): New macro.
5144 (hard_locale): Assume setlocale exists.
5145 Rewrite to avoid #ifdef.
5146 Use strdup rather than malloc + strcpy.
5147 * human.c: Assume <locale.h> exists.
5148 (human_readable): Assume localeconv exists.
5150 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5152 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5153 convert T2, not T. (Imported from libc.)
5155 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5157 * getcwd.c (is_ENAMETOOLONG): New macro.
5158 (__getcwd.c): Don't restore errno; glibc doesn't.
5159 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5160 first, falling back to our code only if its results look suspicious.
5161 Ensure that the resulting buffer is only as large as necessary.
5163 * readutmp.c: Include readutmp.h first.
5164 Include <errno.h>, since readutmp.h no longer does that.
5165 * readutmp.h: Don't include <errno.h>,
5166 <sys/param.h>, <time.h>; not needed to establish interface.
5167 (errno): Remove decl.
5168 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5169 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5170 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5172 2004-11-28 Simon Josefsson <jas@extundo.com>
5174 * base64.h, base64.c: New file.
5176 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5178 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5180 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5182 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5183 HP's ANSI C compiler.
5184 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5185 Declaring int functions causes warnings on some modern systems and
5186 shouldn't be needed to compile on ancient ones.
5187 * same.c (MIN) [defined MIN]: Don't define, since it's already
5190 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5191 with the following changes.
5192 (__set_errno): Parenthesize properly.
5193 Include <stdbool.h>.
5194 (MIN, MAX, MATCHING_INO): New macros.
5195 (__getcwd): Define with prototype, not K&R form.
5196 Use heuristics to allocate default buffer on stack if possible.
5197 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5198 behavior, and to avoid the PATH_MAX limit when computing
5200 Use MATCHING_INO to compare inode number to file.
5201 Check for arithmetic overflow in size calculations.
5202 Fix bug in reallocation of dot array that caused getcwd to fail
5203 on directories nested deeper than 75.
5204 Be more careful about saving errno on error.
5205 Do not use realloc; use only free+malloc, as this is a bit
5206 more flexible and avoids a needless copy operation.
5207 Do not inspect st_dev and st_ino for symbolic links; POSIX
5208 doesn't specify the latter.
5209 Check for closedir errors.
5210 Avoid needless casts.
5211 Use "#ifdef weak_alias" around weak_alias, to be like other
5213 The following changes to getcwd.c have effect only when used in
5214 gnulib; they have no effect inside glibc proper.
5215 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5216 as alloca isn't used.
5217 (alloca, __alloca): Likewise.
5218 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5219 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5220 unconditionally, as gnulib assumes C89 or better.
5221 Do not include <sys/param.h>.
5222 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5223 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5225 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5226 Include <dirent.h> in a way that is compatible with modern Autoconf.
5227 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5228 New macros, if not already defined.
5229 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5230 Use "_LIBC", not "defined _LIBC", for consistency.
5231 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5233 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5234 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5235 * xgetcwd.c: David MacKenzie's old code was removed, so give
5236 credit only to Jim Meyering and adjust the copyright dates.
5237 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5238 <stdlib.h>, <unistd.h>, "pathmax.h".
5239 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5240 (INITIAL_BUFFER_SIZE): Remove.
5241 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5243 2004-11-23 Jim Meyering <jim@meyering.net>
5245 * getopt_.h: Remove trailing blanks.
5247 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5249 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5250 (futimens): New function, which uses futimes if available.
5251 (futimens, utimens): Support timespec==NULL, with same semantics
5252 as utime and utimens.
5253 * utimens.h (futimens): New decl.
5255 2004-11-23 Jim Meyering <jim@meyering.net>
5257 * __fpending.c: Add comment.
5259 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5261 * getopt_.h: Re-addition of __getopt_argv_const caused
5262 redefinition warnings. To avoid them, include the defines
5263 in `#if !defined __need_getopt ... #endif'. The only place
5264 where __getopt_argv_const is used is in definitions
5265 of getopt_long and getopt_long_only below, which are as well
5266 protected by `#ifndef __need_getopt'.
5267 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5268 __need_getopt after including <stdio.h> and <unistd.h> These
5269 headers might have defined it.
5271 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5273 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5275 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5276 optopt): Use them instead of invoking ## directly; otherwise, the
5277 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5279 2004-11-19 Bruno Haible <bruno@clisp.org>
5281 * strtok_r.c: Move comments from here...
5282 * strtok_r.h: ... to here.
5284 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5286 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5287 might fail. Problem reported by Yoann Vandoorselaere.
5288 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5289 that mishandle size_t overflow.
5291 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5293 * canon-host.c: Include "strdup.h".
5294 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5295 Use strdup instead of malloc/strcpy to duplicate strings.
5297 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5298 (human_space_before_unit): New constant.
5299 * human.c (human_readable): Support it.
5301 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5302 (xgetcwd): Set errno correctly when failing.
5303 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5304 the failure is actually due to a PATH_MAX problem.
5306 Further getopt changes to make it more likely that glibc will
5307 buy the changes back.
5308 * getopt.c (POSIXLY_CORRECT): New constant.
5309 (getopt): Use it, so to preserve glibc semantic
5310 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5311 when compiling for libc.
5312 * getopt_.h (__getopt_argv_const): Bring it back.
5313 (getopt_long, getopt_long_only): Use it.
5315 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5316 New arg POSIXLY_CORRECT. All callers changed.
5317 (getopt): Argv is now char * const *, as per standard.
5318 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5319 not char *__getopt_argv_const *.
5320 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5321 _getopt_long_only_r): Likewise.
5322 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5323 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5324 _getopt_long_r, _getopt_long_only_r): Likewise.
5325 * getopt_.h (__getopt_argv_const): Remove.
5326 (getopt): Argv is now char * const *, as per standard.
5328 * getdate.y (tORDINAL): New token.
5329 (day, relunit): Allow it for relative times.
5330 (relative_time_table): Use tORDINAL for ordinals.
5332 2004-11-15 Jim Meyering <jim@meyering.net>
5334 * closeout.c: Include "__fpending.h" once again.
5335 Include <stdbool.h>.
5336 (close_stdout): Don't fail just because stdout was closed initially,
5337 since some programs don't write to stdout in the normal course of
5338 operation (other than --version and --help), and we don't want this
5339 function to make e.g. `touch file >&-' fail.
5340 But do fail if it was closed and someone has tried to write to it.
5341 E.g., `printf foo >&-' must fail.
5343 2004-11-11 Simon Josefsson <jas@extundo.com>
5345 * strtok_r.h, strtok_r.c: New file.
5347 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5349 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5350 we can stop lying to compilers about the constness of argv when we
5351 are compiled outside glibc.
5352 (getopt, getopt_long, getopt_long_only): Use it.
5353 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5355 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5356 _getopt_long_only_r): Likewise.
5357 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5358 _getopt_long_only_r): Likewise.
5360 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5361 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5362 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5363 the other external symbols.
5364 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5365 declaration, since the above renaming now works around collisions.
5367 2004-11-11 Jim Meyering <jim@meyering.net>
5369 * linebreak.c: Remove trailing blanks.
5370 * alloca_.h: Likewise.
5371 * acosl.c: Likewise.
5372 * euidaccess.c: Likewise.
5373 * allocsa.h: Likewise.
5375 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5377 * mktime.c (SHR): New macro, which is a portable
5378 substitute for >> that should work even on Crays.
5379 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5380 Problem reported by Mark D. Baushke in
5381 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5382 * getdate.y (SHR): Likewise.
5384 * strftime.c (SHR): Likewise.
5386 * quotearg.c (struct quoting_options): Use unsigned int for
5387 quote_these_too, so that right shifts are well defined. All uses
5390 2004-11-10 Simon Josefsson <jas@extundo.com>
5392 * getaddrinfo.h, getaddrinfo.c: New files.
5394 2004-11-10 Jim Meyering <jim@meyering.net>
5396 Ensure that no close failure goes unreported.
5397 * closeout.c (close_stdout): Always close stdout. I.e., don't
5398 return early when it seems there's nothing to flush.
5399 Don't include __fpending.h.
5401 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5403 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5405 2004-11-05 Bruno Haible <bruno@clisp.org>
5407 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5408 Reported by Mark D. Baushke <mdb@cvshome.org>.
5410 2004-11-04 Bruno Haible <bruno@clisp.org>
5412 2004-09-11 Bruno Haible <bruno@clisp.org>
5413 * allocsa.valgrind: New file.
5414 2004-02-06 Bruno Haible <bruno@clisp.org>
5415 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5416 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5417 Reported by Christopher Seip <chris.seip@hp.com>.
5419 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5421 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5422 with errno == ERANGE if the buffer is too small.
5423 Problem reported by Mark D. Baushke.
5425 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5427 * xreadlink.c (MAXSIZE): New macro.
5428 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5429 size does not exceed MAXSIZE. Avoid cast.
5430 As suggested by Mark D. Baushke in
5431 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5432 if readlink fails with buffer size just under MAXSIZE, try again
5435 2004-11-02 Derek R. Price <derek@ximbiot.com>
5436 and Paul Eggert <eggert@cs.ucla.edu>
5438 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5439 (get_date): Overparenthesize to avoid GCC warning.
5441 2004-11-02 Bruno Haible <bruno@clisp.org>
5443 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5444 function returns void.
5446 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5448 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5449 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5452 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5454 * getdate.y: Add support for TZ="foo" within a date string.
5455 Fix some bugs near time_t boundaries. Reject dates with
5456 out-of-range components, e.g., "Sept 31".
5457 Include <stdlib.h>, "setenv.h", "xalloc.h".
5458 (ISDIGIT_LOCALE): Remove; unused.
5459 Note that the TZ and time functions used here are not reentrant.
5460 (mktime_ok, get_tz): New functions.
5461 (TZBUFSIZE): New constant.
5462 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5463 This requires that we sometimes generate our own TZ="XXX..." setting.
5465 2004-10-27 Derek R. Price <derek@ximbiot.com>
5467 * mktime.c (not_equal_tm): Remove redundant check.
5469 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5471 * getdate.y: Use Bison 1.875 features, and some minor
5472 code cleanups. This change does not affect semantics.
5473 Don't include <stdlib.h>; no longer needed.
5474 Don't include unlocked-io.h; only the "#if TEST" code uses
5475 stdio, and performance isn't crucial there.
5476 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5477 Bison 1.875 features as described below.
5478 All uses of "PC." replaced by "pc->".
5479 (YYSTYPE): Add a forward declaration.
5480 (yylex, yyerror): Use full prototypes in forward decls.
5481 Use "%pure-parser" rather than obsolescent "%pure_parser".
5482 Use %parse-param and %lex-param instead of obsolescent
5483 YYPARSE_PARAM and YYLEX_PARAM.
5484 (meridian_table, month_and_day_table, time_units_table,
5485 relative_time_table, time_zone_table, military_table,
5486 lookup_zone, lookup_word, get_date):
5487 Use NULL instead of 0 where appropriate.
5488 (to_hour): Avoid abort (), to avoid a dependency on
5490 (yyerror, yylex): Now accepts parser_control * arg.
5491 (main) [TEST]: Use '\0' rather than 0 for char.
5493 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5495 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5496 It's now the caller's responsibility to handle the case where
5497 !HAVE_GETPAGESIZE && !defined getpagesize.
5499 * mktime.c (leapyear): Arg is long int, not int.
5501 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5503 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5505 2004-10-12 Simon Josefsson <jas@extundo.com>
5507 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5508 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5511 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5513 * vsnprintf.h: New file.
5514 * vsnprintf.c: New file.
5516 2004-10-07 Bruno Haible <bruno@clisp.org>
5518 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5519 into the provided buffer.
5521 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5523 * diacrit.c, diacrit.h: Add GPL notice.
5525 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5526 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5527 * logl.c (logl): Keep the code as similar to glibc as possible.
5528 This avoids a potential constant-folding bug.
5530 2004-10-05 Bruno Haible <bruno@clisp.org>
5532 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5534 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5536 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5537 * xmalloc.c (xmemdup): Likewise.
5538 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5539 XFREE): Remove these long-obsolescent macros.
5540 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5541 * xstrdup.c: Remove.
5543 * regex.c (re_comp): Cast gettext return value to char *,
5544 Problem reported by Martin Neitzel via Mark D. Baushke.
5546 2004-10-04 Simon Josefsson <jas@extundo.com>
5548 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5549 '#ifdef USE_UNLOCKED_IO'.
5551 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5553 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5554 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5555 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5556 regex.c, sha1.c, version-etc.c, yesno.c:
5557 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5558 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5559 the includer's responsibility.
5561 Sync from coreutils.
5563 * modechange.c (mode_compile): Don't decrement a pointer that
5564 points to the start of a string, as the C Standard says the
5565 resulting behavior is undefined.
5567 * backupfile.h (enum backuptype): Rename none -> no_backups,
5568 simple -> simple_backups, numbered_existing ->
5569 numbered_existing_backups, numbered -> numbered_backups
5570 to avoid shadowing problems. All uses changed.
5571 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5572 * backupfile.c (check_extension, numbered_backup):
5573 Rename locals to avoid shadowing 'basename'.
5574 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5577 * .cppi-disable: Add getopt_.h, getopt_int.h.
5578 * .cvsignore: Add getopt.h.
5580 2004-10-04 Simon Josefsson <jas@extundo.com>
5582 * memmem.h: New file.
5583 * memmem.c: New file, taken from glibc.
5585 2004-10-02 Jim Meyering <jim@meyering.net>
5587 * dirfd.h, getpagesize.h: Add copyright notice.
5589 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5591 * snprintf.c: Remove comments as to why each header is needed.
5593 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5595 * strsep.h: New file.
5596 * strsep.c: New file.
5598 2004-10-01 Simon Josefsson <jas@extundo.com>
5600 * snprintf.c (snprintf): Handle size==0.
5602 2004-10-01 Simon Josefsson <jas@extundo.com>
5603 Bruno Haible <bruno@clisp.org>
5605 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5606 (snprintf): Declare 'args'.
5608 2004-09-30 Simon Josefsson <jas@extundo.com>
5610 * snprintf.h, snprintf.c: New files.
5612 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5614 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5615 (hol_entry_help): Never translate an empty string.
5616 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5617 * argp.h (OPTION_NO_TRANS): New option.
5619 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5621 * xvasprintf.c: Include xalloc.h.
5622 (xvasprintf): Use xalloc_die, not xmalloc_die.
5624 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5626 * dummy.c: Change copyright notice to FSF, and license to GPL.
5628 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5630 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5631 Problem reported by Bruno Haible in:
5632 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5634 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5636 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5637 in case some system header has #define'd it. Problem reported by
5638 Soeren D. Schulze in
5639 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5641 2004-09-08 Bruno Haible <bruno@clisp.org>
5643 * stdint_.h: New file, taken from GNU clisp.
5645 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5647 * xvasprintf.h: New file.
5648 * xvasprintf.c: New file.
5649 * xasprintf.c: New file.
5651 2004-09-08 Bruno Haible <bruno@clisp.org>
5653 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5655 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5657 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5659 Import from coreutils.
5660 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5661 strings on unbounded length. alloca's performance benefits aren't
5662 that important here.
5664 (parse_with_separator): New function, with most of the internals
5665 of the old parse_user_spec. Allow user to omit both user and group,
5666 for compatibility with FreeBSD.
5667 Clone only the user name, not the entire spec.
5668 Do not set *uid, *gid unless entirely successful.
5669 Avoid memory leak in some failing cases.
5670 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5671 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5672 (parse_user_spec): Rewrite to use parse_with_separator.
5674 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5676 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5677 its complicated substitute.
5678 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5679 and program_invocation_name.
5680 (__argp_basename) [!_LIBC]: Remove; the only use was
5681 replaced by its body.
5682 (__argp_short_program_name): Change condition from
5683 !defined __argp_short_program_name to
5684 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5685 to match argp-namefrob.h.
5686 (__argp_failure): Don't assume strerror_r returns char *.
5687 * argp-parse.c (N_): Define unconditionally.
5688 (argp_default_options): Fill out initializers with 0 to avoid
5691 2004-08-12 Simon Josefsson <jas@extundo.com>
5693 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5694 * getopt_.h: Renamed from getopt.h.
5696 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5698 Merge from coreutils.
5700 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5701 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5702 for Reliant Unix 5.43.
5704 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5705 (union fooround): Use uintmax_t, not long int.
5706 The rest is a merge from libc:
5707 [defined _LIBC]: Include <shlib-compat.h>.
5708 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5710 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5712 * strverscmp.c: Convert to UTF-8.
5714 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5716 * obstack.h (obstack_empty_p):
5717 Don't assume that chunk->contents is suitably aligned.
5718 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5719 Likewise. Problem reported by Benno in
5720 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5722 * chown.c (rpl_chown): Work even if the file is writeable but not
5723 readable. This could be improved further but it'd take some work.
5725 2004-08-08 Simon Josefsson <jas@extundo.com>
5727 * xgethostname.c: Don't include error.h (not used).
5730 * getpass.c: Include getpass.h first.
5732 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5734 * xalloc-die.c: New files.
5735 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5737 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5738 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5739 (_, N_, xalloc_die): Move to xalloc-die.c.
5740 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5741 so that we needn't mess with xalloc_msg_memory_exhausted.
5743 * sha1.h: Renamed from sha.h.
5744 (SHA1_H): Renamed from _SHA_H.
5745 (sha1_ctx): Renamed from sha_ctx.
5746 (sha1_init_ctx): Renamed from sha_init_ctx.
5747 (sha1_process_block): Renamed from sha_process_block.
5748 (sha1_process_bytes): Renamed from sha_process_bytes.
5749 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5750 (sha1_read_ctx): Renamed from sha_read_ctx.
5751 (sha1_stream): Renamed from sha_stream.
5752 (sha1_buffer): Renamed from sha_buffer.
5753 * sha1.c: Likewise; renamed from sha.c.
5754 Do not include <sys/types.h>.
5755 Include <stddef.h> rather than <stdlib.h>.
5757 2004-08-08 Bruno Haible <bruno@clisp.org>
5759 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5760 FILESYSTEM_PREFIX_LEN.
5761 * progreloc.c: Likewise.
5762 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5764 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5767 * argp-help.c (make_hol, hol_append): Don't assume that
5768 SIZE_MAX is a valid preprocessor constant.
5769 (__argp_basename): Change from "#ifndef _LIBC"
5770 to "#ifndef __argp_short_program_name", so that
5771 we don't compile these functions for tar.
5773 More merges from coreutils.
5774 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5775 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5777 * addext.c: Remove; no longer needed.
5778 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5779 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5780 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5781 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5782 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5783 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5784 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5785 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5786 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5787 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5788 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5789 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5790 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5791 Import changes from coreutils.
5793 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5795 Merge from coreutils.
5797 * .gdb-history: Remove; this doesn't belong here.
5799 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5800 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5801 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5803 * dirname.h: Include <stdbool.h>.
5804 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5805 for consistency with POSIX terminology. All uses changed.
5806 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5807 (strip_trailing_slashes): Use bool for booleans.
5808 * stripslash.c (strip_trailing_slashes): Likewise.
5810 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5811 sometimes returns a positive errno value even when it succeeds.
5812 (print_errno_message) [!LIBC]: Fall back on strerror if
5815 * path-concat.c (mempcpy): Don't define if a system header defines it.
5816 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5817 (longest_relative_suffix): New function.
5818 (path_concat): Use it. Assume first argument is not NULL.
5819 Port to DOS. Omit redundant separators.
5820 Report an error instead of returning NULL.
5821 Use mempcpy instead of memcpy.
5822 (xpath_concat): Remove: not declared or used.
5824 * same.h: Include <stdbool.h>
5825 (same_name): Return bool, not int.
5826 * same.c (same_name): Likewise.
5827 (errno): Don't declare; we assume C89 or better now.
5829 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5830 if not already defined.
5832 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5833 * dup-safer.c (errno): Likewise.
5835 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5837 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5840 2004-08-03 Simon Josefsson <jas@extundo.com>
5842 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5843 * progname.h: Don't include stdbool.h.
5845 2004-08-02 Simon Josefsson <jas@extundo.com>
5847 * getsubopt.h: New file, with comments from Bruno Haible.
5848 * getsubopt.c: New file, from glibc, but slightly modified based on
5849 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5851 2004-08-01 Simon Josefsson <jas@extundo.com>
5853 * xgetdomainname.c: Include stdlib.h, for free().
5855 2004-07-16 Simon Josefsson <jas@extundo.com>
5857 * dummy.c: New file.
5859 2004-07-16 Bruno Haible <bruno@clisp.org>
5861 * backupfile.h: Add extern "C" for C++.
5862 * closeout.h: Likewise.
5863 * copy-file.h: Likewise.
5864 * findprog.h: Likewise.
5865 * full-write.h: Likewise.
5866 * pathname.h: Likewise.
5867 * progname.h: Likewise.
5868 * stpcpy.h: Likewise.
5869 * stpncpy.h: Likewise.
5870 * strcase.h: Likewise.
5871 * strstr.h: Likewise.
5872 * xalloc.h: Likewise.
5874 * mbswidth.h: Add extern "C" for C++.
5875 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5877 2004-07-09 Simon Josefsson <jas@extundo.com>
5879 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5880 failed without this.)
5882 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5884 * fchown-stub.c: New file.
5886 2004-06-24 Jim Meyering <jim@meyering.net>
5888 * obstack.h (obstack_base): Cast to (void *), per documentation.
5890 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5892 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5894 2004-06-01 Jim Meyering <jim@meyering.net>
5896 * calloc.c: New file.
5898 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5900 * getdate.y (yylex): Allow space between sign and number.
5901 Problem reported by Dan Jacobson.
5903 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5904 and Jim Meyering <jim@meyering.net>
5906 Merge from coreutils CVS.
5908 * stat-macros.h: New file, with contents from file-type.h
5909 and coreutils' system.h.
5910 * file-type.c: Include "stat-macros.h".
5911 * file-type.h (file_type): Move all macro definitions to new file,
5914 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5915 Wrap old code with this conditional.
5916 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5917 function that does not dereference symlinks.
5918 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5920 * xreadlink.c: Include xreadlink.h first, to catch .h file
5921 dependency problems.
5922 (xreadlink): Accept new arg SIZE, for efficiency.
5923 All decls and uses changed.
5924 * xreadlink.h: Include <stddef.h>, for size_t.
5926 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5927 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5929 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5931 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5933 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5934 macros to be defined.
5935 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5936 the allocator returns NULL because the requested size is zero.
5938 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5940 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5941 var. Add comment explaining why libc still defines it. This
5942 merges the following patch from glibc:
5943 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5945 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5947 * obstack.c (_obstack): Remove unused variable. It hasn't been
5948 present in glibc since revision 1.1 of this file.
5949 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5950 obstack_alignment_mask, obstack_alloc, obstack_base,
5951 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5952 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5953 obstack_grow0, obstack_init, obstack_int_grow,
5954 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5955 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5956 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5957 nonexistent functions.
5959 2004-05-17 Derek R. Price <derek@ximbiot.com>
5960 Paul Eggert <eggert@cs.ucla.edu>
5962 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5964 2004-05-14 Bruno Haible <bruno@clisp.org>
5966 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5967 that consists of a '.' followed by an empty digit string.
5968 Patch by Tor Lillqvist <tml@iki.fi>.
5970 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5972 Port obstack to the AS/400, where pointers are 16 bytes wide and
5973 you cannot cast an integer to a valid pointer. This patch is
5974 currently waiting to be integrated into glibc; see
5975 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5977 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5978 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5979 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5980 (struct obstack): temp member is now a union of a pointer and
5981 an integer, instead of an integer. All integer uses changed.
5982 This does not affect the physical layout of struct obstack,
5983 except on hosts (like the AS/400) where the size or alignment of
5984 void * is greater than that of ptrdiff_t.
5985 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5986 __STDC__)]: Store temporary in pointer member of union, not
5988 * obstack.c: Include <stddef.h>, for offsetof.
5989 (struct fooalign): Remove; it doesn't need a name.
5990 (union fooround): Change double to long double, and add void *.
5991 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5992 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5993 not a macro. Hence the values are always int; so remove all
5994 casts-to-int in uses.
5996 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5997 Derek Price <derek@ximbiot.com>
5999 * alloca.c: Include <alloca.h>, to get our interface.
6000 * alloca_.h: Use __alloca on AIX, so that we don't have to
6001 include <alloca.h> first. Use C89 prototype for alloca; this
6002 requires including <stddef.h> for size_t. Use extern "C" if C++.
6003 Use #elif for simplicity, since we can assume C89 now.
6004 Don't try to source the system alloca.h since it will not be found
6005 and to prevent recursively including its replacement.
6006 * fnmatch.c: Include <alloca.h> instead of opencoding.
6007 * regex.c: Likewise.
6009 2004-05-16 Derek Price <derek@ximbiot.com>
6010 Paul Eggert <eggert@cs.ucla.edu>
6012 getline cleanup. This changes the getndelim2 API: both order of
6013 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6016 * getline.c: Don't include stddef.h or stdio.h, since our
6017 interface does that.
6018 (getline): Always use getdelim, so that we don't have two
6019 copies of this code.
6020 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6022 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6023 (GETNDELIM2_MAXIMUM): New macro.
6024 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
6025 instead of the old practice of delim2==0. All callers changed.
6026 Return -1 on overflow, instead of returning junk.
6027 Do not set *linesize unless allocation succeeds.
6028 * getndelim2.h: Do not include stddef.h; no longer needed, now
6029 that we include sys/types.h.
6030 * getnline.h: Likewise.
6031 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6032 (getndelim2): Reorder arguments.
6033 * getnline.c (getnline, getndelim):
6034 Don't discard the NMAX argument.
6035 (getnline): Invoke getndelim, to avoid code duplication.
6036 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6037 of (size_t) -1 by callers of the getnline family.
6039 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
6041 * nanosleep.c (suspended): Change its type from int to
6042 sig_atomic_t volatile.
6043 (first_call): Make it private to rpl_nanosleep, and have it
6044 be zero initially as that's a bit faster.
6045 (my_usleep): Round up fractional times instead of truncating them,
6046 as this is the usual meaning for 'sleep'.
6048 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6050 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6051 (ENOSYS): Define if not defined.
6052 (settime): Fall back on stime if it exists and settimeofday fails.
6053 But don't bother with fallbacks if a method fails with errno == EPERM.
6055 2004-05-11 Jim Meyering <jim@meyering.net>
6057 Prior to this change, the save_cwd caller required read access to the
6058 current directory on most systems (ones with the fchdir function).
6060 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6061 fails, try write-only, and finally, resort to using xgetcwd.
6063 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6065 * obstack.c, obstack.h: Import changes from libc.
6067 2004-04-28 Bruno Haible <bruno@clisp.org>
6069 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6070 implicitly appends .exe to executables.
6071 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6072 accepts Windows pathnames.
6073 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6074 Cygwin like Windows, since it now accepts Windows pathnames.
6075 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6076 Cygwin like Windows, since it now accepts Windows pathnames.
6077 Reported by Derek Robert Price <derek@ximbiot.com>.
6079 2004-04-20 Jim Meyering <jim@meyering.net>
6081 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6083 2004-04-20 Jim Meyering <jim@meyering.net>
6084 Bruno Haible <bruno@clisp.org>
6086 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6087 memory when realloc fails.
6089 2004-04-18 Jim Meyering <jim@meyering.net>
6091 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6092 don't leak memory and do call END_UTMP_ENT.
6094 2004-04-11 Paul Eggert <eggert@twinsun.com>
6096 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6097 (CHAR_BIT): Remove, since we assume C89.
6098 Include <stdint.h> if available, as per current Autoconf CVS advice.
6100 2004-03-30 Paul Eggert <eggert@twinsun.com>
6102 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6103 not bool, to be more consistent with Unix conventions.
6104 Suggested by Bruno Haible.
6106 Merge from coreutils.
6108 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6111 * getdate.h: Include stdbool.h, and timespec.h instead of
6112 the usual <time.h> dance.
6113 (get_date): Change signature to support fractional time stamps.
6114 All callers changed.
6115 * getdate.y: Include "getdate.h" first, as we can now
6116 assume C89 and don't need to worry about 'const'.
6117 Similarly, include "unlocked-io.h" near start, not in middle.
6119 (textint.value): Use long int rather than int.
6120 (textint.digits): Use size_t rather than int.
6121 (BILLION, LOG10_BILLION): New constants.
6122 (parser_control): New member rel_ns. Members day_ordinal,
6123 time_zone, month, day, hour, minutes, rel_year, rel_month,
6124 rel_day, rel_hour, rel_minutes, rel_seconds
6125 are now long int, not int. Member seconds is now struct timespec,
6126 not int. New member timespec_seen. Members dates_seen, days_seen,
6127 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6129 (%union.intval): Now long int, not int.
6130 New member timespec.
6131 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6132 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6133 (spec): Now is a timespec or an item list.
6134 (timespec, items): New nonterminals.
6135 (time, rel, relunit, number, get_date):
6136 Add support for fractional seconds.
6137 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6138 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6139 (to_hour): First arg is now long int, not int.
6140 (to_year): Returns long int, not int.
6141 Don't treat year -70 like 70.
6142 (tm_diff): Returns long int, not int.
6143 (lookup_word): Use bool instead of int when appropriate.
6144 (yylex): Use size_t for count, not int.
6145 Detect overflow when parsing large integer constants.
6146 Add support for fractions.
6147 (get_date): Make pointers 'const' if possible.
6148 Use more-portable code to detect integer overflow.
6149 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6150 Don't use ctime; it's not reliable if the year has >4 digits.
6152 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6153 This is for compatibility with BSD.
6155 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6156 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6157 From coreutils' system.h.
6159 * userspec.c: Don't include "posixver.h".
6160 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6161 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6162 compatible extension. Simplify code by removing a boolean int
6163 that was always nonzero if a string was nonnull.
6165 2004-03-30 Jim Meyering <jim@meyering.net>
6167 Merge from coreutils.
6169 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6171 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6172 an empty input stream.
6174 * readtokens.c: Include <stdbool.h>.
6175 (readtoken): Use `size_t' rather than int/long.
6176 All callers adjusted.
6177 Use `bool' rather than `int' where appropriate.
6178 Use memset rather than an explicit loop.
6179 Use x2nrealloc rather than xrealloc.
6180 Allow the use of `\0' as a delimiter.
6181 (readtokens): Likewise.
6182 * readtokens.h (readtoken, readtokens): Update prototypes.
6184 2004-03-30 Bruno Haible <bruno@clisp.org>
6186 * getloadavg.c (getloadavg): Don't assume setlocale returns
6189 2004-03-29 Paul Eggert <eggert@twinsun.com>
6191 Merge changes to getloadavg.c from coreutils and Emacs.
6193 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6194 Define to an expression, not to the empty string.
6195 Include cloexec.h and xalloc.h.
6196 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6197 Use set_cloexec_flag rather than rolling our own.
6198 * cloexec.c, cloexec.h: New files.
6200 2004-03-18 Paul Eggert <eggert@twinsun.com>
6202 * getopt.h: Sync with libc CVS.
6204 2004-03-18 Paul Eggert <eggert@twinsun.com>
6205 Bruno Haible <bruno@clisp.org>
6207 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6208 not on all platforms that have <wchar.h>.
6209 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6211 2004-03-09 Paul Eggert <eggert@twinsun.com>
6213 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6215 * getopt_int.h: New file, also synced from libc.
6217 2004-03-07 Paul Eggert <eggert@twinsun.com>
6219 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6220 '#if' expressions. Unlike the code it replaces, it does not
6221 depend on (defined _SC_PAGESIZE). However, it does depend on
6222 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6223 first reported by Jason Andrade in
6224 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6226 2004-01-18 Simon Josefsson <jas@extundo.com>
6228 * strdup.h: New file.
6229 * strdup.c: Include it.
6230 * path-concat.c: Include strdup.h. Drop strdup declaration.
6231 * userspec.c: Include strdup.h. Drop strdup declaration.
6233 2004-02-06 Karl Berry <karl@gnu.org>
6235 * config.charset: update from gettext 0.14.1.
6237 2004-02-05 Paul Eggert <eggert@twinsun.com>
6239 Add comments and code, prompted by suggestions from Bruno Haible
6241 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6242 describing the enum quoting_style values.
6243 * quotearg.c (quotearg_alloc): New function.
6244 (quotearg_buffer_restyled): Treat lone { and } as special.
6245 Treat = as special. Work around bug with older shells
6246 that "see" a '\' that is really the 2nd byte of a multibyte char.
6247 Quote empty string with shell_quoting_style.
6249 2004-02-03 Bruno Haible <bruno@clisp.org>
6251 * pipe.h: New file, from GNU gettext.
6252 * pipe.c: New file, from GNU gettext.
6254 2004-01-27 Bruno Haible <bruno@clisp.org>
6256 * execute.h: New file, from GNU gettext.
6257 * execute.c: New file, from GNU gettext.
6258 * w32spawn.h: New file, from GNU gettext.
6260 2004-01-23 Paul Eggert <eggert@twinsun.com>
6262 Exit-status fix from coreutils.
6264 Use exit_failure consistently in place of EXIT_FAILURE,
6265 so that program exit statuses are consistent on failure.
6267 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6268 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6269 * argmatch.h: Comment fix to match the above.
6270 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6271 Now a macro referring to exit_failure, instead of a separate
6272 variable. Include "exitfail.h" to get it.
6273 * xstrtol.h: Include "exitfail.h".
6274 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6276 * long-options.c (parse_long_options): Use prototype
6277 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6280 2004-01-21 Jim Meyering <jim@meyering.net>
6282 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6283 so as not to conflict with a different-sized __mktime_internal
6284 function in GNU libc.
6285 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6286 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6288 2004-01-18 Paul Eggert <eggert@twinsun.com>
6290 Merge from diffutils.
6292 * file-type.c (file_type): Add typed memory objects.
6293 * file-type.h (S_TYPEISTMO): New macro.
6295 * c-stack.h (c_stack_action): Remove argv argument.
6296 * c-stack.c (c_stack_action): Likewise. All uses changed.
6297 (die): Don't calculate message unless segv_action returns.
6298 (get_stack_location, min_address_from_argv, max_address_from_argv,
6299 volatile stack_base, volatile_stack_size): Remove.
6300 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6301 that every segmentation violation is a stack overflow. (Ouch!)
6302 See Debian bug 136249 (still outstanding) for more info about why
6303 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6305 2003-11-30 Bruno Haible <bruno@clisp.org>
6307 Safer stack allocation.
6308 * setenv.c: Include allocsa.h.
6309 (alloca): Remove fallback definition.
6310 (freea): Remove macro.
6311 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6314 2003-10-17 Bruno Haible <bruno@clisp.org>
6316 * binary-io.h: Avoid warnings on Cygwin.
6318 2003-12-28 Bruno Haible <bruno@clisp.org>
6320 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6321 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6323 2003-11-28 Bruno Haible <bruno@clisp.org>
6325 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6327 2003-11-27 Bruno Haible <bruno@clisp.org>
6329 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6331 2003-11-17 Bruno Haible <bruno@clisp.org>
6333 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6335 2003-11-24 Bruno Haible <bruno@clisp.org>
6337 * xallocsa.h: New file, from GNU gettext.
6338 * xallocsa.c: New file, from GNU gettext.
6340 2003-11-24 Bruno Haible <bruno@clisp.org>
6342 * allocsa.h: New file, from GNU gettext.
6343 * allocsa.c: New file, from GNU gettext.
6345 2003-11-24 Bruno Haible <bruno@clisp.org>
6347 * eealloc.h: New file.
6349 2004-01-15 Jim Meyering <jim@meyering.net>
6351 Merge from coreutils.
6353 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6354 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6355 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6357 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6358 optional configure-time default.
6360 * version-etc.c (version_etc_copyright): Update copyright date.
6362 * xreadlink.c (xreadlink): Correct outdated comment.
6364 2004-01-15 Paul Eggert <eggert@twinsun.com>
6366 Merge from coreutils.
6368 * posixver.c: Include posixver.h.
6370 * same.c: Include <stdbool.h>, <limits.h>.
6371 (_POSIX_NAME_MAX): Define if not defined.
6373 (same_name): If file names are silently truncated, report
6374 that the file names are the same if they are the same after
6375 the silent truncation.
6377 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6378 conversion function.
6379 * xstrtod.c (xstrtod): Likewise. All callers changed to
6380 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6383 2004-01-14 Paul Eggert <eggert@twinsun.com>
6385 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6386 with like-named macro in fnmatch.c.
6387 (EXT): Use an internal constant instead.
6389 Merge fnmatch patches from glibc.
6390 * fnmatch.c (mbsinit): Remove define.
6391 Add libc_hidden_ver (__fnmatch, fnmatch).
6392 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6393 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6395 2003-12-14 Karl Berry <karl@gnu.org>
6397 * config.charset: update from gettext-runtime.
6399 2003-12-03 Paul Eggert <eggert@twinsun.com>
6401 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6402 Bug reported by Alfred M. Szmidt.
6404 2003-11-29 Karl Berry <karl@gnu.org>
6406 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6408 2003-11-23 Paul Eggert <eggert@twinsun.com>
6409 Bruno Haible <bruno@clisp.org>
6411 * printf-parse.h: Don't include sys/types.h.
6412 (ARG_NONE): New macro.
6413 (char_directive): Change type of *arg_index fields to size_t.
6414 * printf-parse.c: Don't include sys/types.h.
6415 (SSIZE_MAX): Remove macro.
6416 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6417 Remove unnecessary overflow check.
6418 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6421 2003-11-24 Paul Eggert <eggert@twinsun.com>
6423 * alloca.c: Remove dependency on xalloc module.
6424 (xalloc_die): Remove.
6425 (memory_full) [!defined emacs]: New macro.
6426 [!defined emacs]: Don't include xalloc.h.
6427 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6428 address arithmetic overflows. Change datatypes a bit to avoid
6431 2003-11-22 Jim Meyering <jim@meyering.net>
6433 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6435 2003-11-17 Bruno Haible <bruno@clisp.org>
6437 * vasnprintf.c (alloca): Remove fallback definition.
6438 (freea): Remove definition.
6439 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6440 Reported by Paul Eggert.
6442 2003-11-17 Jim Meyering <jim@meyering.net>
6444 On systems without utime and without a utimes function capable of
6445 dealing with a NULL struct utimbuf* argument, this utime replacement
6446 could -- in unusual circumstances -- leak a file descriptor.
6447 * utime.c: Include <unistd.h> and <errno.h>.
6448 (utime_null): Be sure to close `fd' and to preserve errno.
6449 Reported by Geoff Collyer via Arnold Robbins.
6451 2003-11-16 Paul Eggert <eggert@twinsun.com>
6452 Bruno Haible <bruno@clisp.org>
6454 Protect against address arithmetic overflow.
6455 * printf-args.h: Include stddef.h.
6456 (arguments): Change type of field 'count' to size_t.
6457 * printf-args.c (printf_fetchargs): Use size_t instead of
6458 'unsigned int' where appropriate.
6459 * printf-parse.h: Include sys/types.h.
6460 (char_directive): Change type of *arg_index fields to ssize_t.
6461 (char_directives): Change type of fields 'count', max_*_length to
6463 * printf-parse.c: Include sys/types.h and xsize.h.
6464 (SSIZE_MAX): Define fallback value.
6465 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6466 instead of 'int' where appropriate. Check a_allocated, d_allocated
6467 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6468 * vasnprintf.c: Include xsize.h.
6469 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6470 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6471 overflow. Avoid wraparound when converting a width or precision from
6474 2003-11-16 Bruno Haible <bruno@clisp.org>
6476 Update from GNU gettext.
6477 * printf-parse.c: Generalize to it can be compiled for wide strings.
6478 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6479 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6480 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6481 SNPRINTF): New macros.
6482 Don't include <alloca.h> if the file is used inside libintl.
6483 (local_wcslen): New function, for Solaris 2.5.1.
6484 (VASNPRINTF): Use it instead of wcslen.
6486 2003-11-16 Bruno Haible <bruno@clisp.org>
6488 * xsize.h (xmax): New function.
6489 (xsum, xsum3, xsum4): Declare as "pure" functions.
6491 2003-11-12 Paul Eggert <eggert@twinsun.com>
6493 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6494 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6495 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6496 heuristic is just as accurate as far as we know, and it removes a
6497 dependency on size_max.m4 and ptrdiff_max.m4.
6499 2003-11-12 Paul Eggert <eggert@twinsun.com>
6501 * xstrtol.c (__xstrtol): Remove "break" immediately after
6502 "return", to pacify some unknown compiler. Problem reported
6505 2003-11-11 Bruno Haible <bruno@clisp.org>
6507 * xsize.h (SIZE_MAX): Remove fallback definition.
6508 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6511 2003-11-10 Paul Eggert <eggert@twinsun.com>
6513 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6514 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6515 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6517 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6518 not (size_t) -1, since it's defined here.
6520 2003-11-06 Paul Eggert <eggert@twinsun.com>
6522 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6523 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6524 Reject sizes of exactly SIZE_MAX bytes.
6525 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6526 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6528 2003-11-05 Bruno Haible <bruno@clisp.org>
6530 * xsize.h: Include limits.h, to avoid a possible collision with
6531 SIZE_MAX defined in <limits.h> on Solaris.
6533 2003-11-04 Bruno Haible <bruno@clisp.org>
6535 * xsize.h: New file.
6536 * linebreak.c: Include xsize.h.
6537 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6538 argument for overflow.
6539 Suggested by Paul Eggert.
6541 2003-10-31 Bruno Haible <bruno@clisp.org>
6543 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6544 to avoid (extremely rare) race condition.
6545 Suggested by Paul Eggert.
6547 2003-11-03 Jim Meyering <jim@meyering.net>
6549 * userspec.c: Include "userspec.h".
6550 * userspec.h: New file.
6552 2003-10-31 Paul Eggert <eggert@twinsun.com>
6554 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6555 * mountlist.c (SIZE_MAX): Define if not defined already.
6556 (read_filesystem_list): Set and use me_type_malloced.
6557 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6558 whatever the type happens to be), for brevity and consistency.
6559 Check for size calculation overflow on Alphas running OSF/1.
6561 2003-10-31 Jim Meyering <jim@meyering.net>
6563 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6565 * linebuffer.c: Include <string.h> for declaration of memset.
6567 2003-10-30 Paul Eggert <eggert@twinsun.com>
6568 Bruno Haible <bruno@clisp.org>
6570 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6571 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6573 2003-10-29 Paul Eggert <eggert@twinsun.com>
6575 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6576 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6578 * quotearg.c (quotearg_n_options): Use it.
6579 * group-member.c: Include <stdbool.h>.
6580 (free_group_info): Arg is now const *; don't free arg.
6581 (get_group_info): Now returns bool and accepts struct group_info *,
6582 rather than returning a malloc'ed struct group_info *.
6583 All uses changed. Check for overflow in internal size calculation.
6585 * getusershell.c (readname): Simplify the code by using x2nrealloc
6586 rather than xmalloc/xrealloc.
6587 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6588 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6589 conformance bug: the old code used a pointer after freeing the
6590 storage that it addressed.
6591 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6592 rather than doing it by hand.
6593 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6594 the buffer preserved. Use free and xmalloc instead.
6595 * quotearg.c (quotearg_n_options): Likewise.
6596 Use a simpler test for size overflow. Don't use xalloc_oversized
6597 because unsigned int might be wider than size_t (!); this suggests
6598 that we should switch from unsigned int to size_t for slot numbers.
6600 2003-10-27 Bruno Haible <bruno@clisp.org>
6602 * stdbool_.h: Better support for BeOS.
6604 2003-10-27 Paul Eggert <eggert@twinsun.com>
6606 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6607 to allocate the returned structure. Do not allocate a subarray,
6608 as x2nrealloc will do that.
6609 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6610 instead of xnrealloc.
6611 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6613 2003-10-26 Paul Eggert <eggert@twinsun.com>
6615 * xalloc.h (xalloc_oversized): New static inline function, for
6616 callers that want to do their own size-overflow checking. Include
6617 <stdbool.h>, since xalloc_oversized returns bool.
6618 * xalloc.c (array_size_overflow): Remove. All callers changed
6619 to use xalloc_oversized.
6621 Add two functions x2realloc, x2nrealloc, for programs that grow
6622 arrays dynamically by doubling their sizes.
6623 * xalloc.h (x2realloc, x2nrealloc): New decls.
6624 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6627 Port to C99 semantics for 'inline' of external functions.
6628 Bug reported by Bruno Haible.
6629 * xmalloc.c (xnmalloc_inline): New static inline function,
6630 with the old contents of xnmalloc.
6631 (xnmalloc, xmalloc): Use it.
6632 (xnrealloc_inline): New static inline function,
6633 with the old contents of xnrealloc.
6634 (xnrealloc, xrealloc): Use it.
6636 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6638 2003-10-25 Paul Eggert <eggert@twinsun.com>
6640 Fix several address-calculation bugs in the hash modules,
6641 plus some minor code cleanup.
6643 * hash.h: Include <stdbool.h>, for bool.
6644 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6645 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6646 hash_get_n_entries, hash_get_max_bucket_length,
6647 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6648 hash_rehash): Use size_t rather than unsigned.
6649 * hash.c (struct hash_table, hash_get_n_buckets,
6650 hash_get_n_buckets_used, hash_get_n_entries,
6651 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6652 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6653 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6655 (SIZE_MAX): Define if not defined.
6656 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6657 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6659 Use const * when possible.
6660 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6661 (check_tuning): Fix bug: if tuning parameters were very close to
6662 0 or 1, rounding errors could have caused subscript violations.
6663 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6664 (hash_initialize): Add 'fail:' label
6665 to free table and return NULL, and use it to simplify code.
6666 Use calloc rather than clearing the storage ourself.
6667 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6668 buffer size calculations.
6669 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6670 Include <stddef.h>, for size_t.
6671 * hash-pjw.c (hash_pjw): Likewise.
6672 Switch to method described by Bruno Haible.
6673 Include <limits.h>, for CHAR_BIT.
6674 (SIZE_BITS): New macro.
6676 2003-10-21 Paul Eggert <eggert@twinsun.com>
6678 * getndelim2.c (getndelim2): When size calculation overflows,
6679 ceiling the allocation at NMAX bytes rather than silently
6680 discarding input bytes before NMAX is reached. This makes
6681 a difference only if NMAX exceeds SIZE_MAX / 2.
6683 * obstack.c: Merge from glibc.
6684 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6685 Add libc_hidden_def (_obstack_newchunk).
6686 (_obstack_free) [! defined _LIBC]: Remove.
6687 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6688 a clone of the function body.
6689 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6690 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6692 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6693 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6696 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6697 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6698 Don't use lvalue casts, as GCC plans to remove support for them
6699 in GCC 3.5. Reported by Joseph S. Myers. This bug
6700 was also present in the non-GCC version, indicating that this
6701 code had always been buggy and had never been widely used.
6702 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6703 Use the fast variant of each macro, rather than copying the
6704 definiens of the fast variant; that way, we'll be more likely to
6705 catch future bugs in the fast variants.
6707 2003-10-20 Bruno Haible <bruno@clisp.org>
6709 * wait-process.h: New file, from GNU gettext.
6710 * wait-process.c: New file, from GNU gettext.
6712 2003-10-19 Jim Meyering <jim@meyering.net>
6714 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6716 2003-10-16 Paul Eggert <eggert@twinsun.com>
6718 * getgroups.c: Include <errno.h>, <stdlib.h>.
6719 (getgroups): First arg is int, not size_t.
6720 Don't let 'free' mangle errno.
6722 2003-10-16 Jim Meyering <jim@meyering.net>
6724 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6726 2003-10-15 Paul Eggert <eggert@twinsun.com>
6728 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6730 (new_exclude, add_exclude_file): Initial size no longer needs to
6732 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6733 our own address arithmetic overflow checking.
6735 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6736 (fnmatch): Do not alloca more than 2000 wide characters;
6737 instead, use malloc for large buffers.
6738 Check for address arithmetic overflow, and return -1
6739 with errno set to ENOMEM in that case.
6740 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6741 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6742 instead, return -1. Check for address arithmetic overflow.
6744 2003-10-14 Paul Eggert <eggert@twinsun.com>
6746 Handle invalid suffixes and overflow independently, so that
6747 callers can treat them independently as needed. Fix some bugs in
6748 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6749 suffix for a human-readable blocksize. The major caller-visible
6750 change is the addition of a new
6751 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6752 that both overflow and suffix chars were found.
6754 * human.c (humblock): Don't check separately for invalid suffix
6755 char; that is xstrtoumax's job (now that its bug is fixed).
6756 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6757 INTMAX_MAX]: New macros.
6758 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6759 TYPE_MAXIMUM): New macros.
6760 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6761 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6762 if overflow occurs, as it's what __strtol does and it's more useful
6764 (__xstrtol): If __strtol reports some error other than ERANGE,
6765 reflect it to the caller as LONGINT_INVALID. If it reports
6766 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6767 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6768 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6770 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6771 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6772 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6773 [defined UINTMAX_MAX]: New macros.
6775 2003-10-14 Bruno Haible <bruno@clisp.org>
6777 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6778 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6779 Also use volatile where needed.
6781 2003-10-12 Paul Eggert <eggert@twinsun.com>
6783 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6784 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6785 and define in terms of the other primitives.
6786 * xmalloc.c: Include stdbool.h; do not include exit.h.
6787 (SIZE_MAX): Define if not already defined.
6788 (array_size_overflow): New function.
6789 (xalloc_die): Abort instead of exiting if 'error' returns.
6790 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6791 (xmalloc, xrealloc): Use them.
6792 (xcalloc): Check for address arithmetic overflow.
6793 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6794 a bit faster than strcpy.
6796 2003-10-08 Paul Eggert <eggert@twinsun.com>
6798 Merge getpass from libc, plus a few fixes.
6800 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6801 Include <stdbool.h>.
6802 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6803 __fsetlocking to empty.
6804 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6805 do include <bits/libc-lock.h>.
6806 Do not include <fcntl.h>; not needed.
6807 [_LIBC]: Include <wchar.h>.
6808 (NOTCANCEL_MODE): New macro.
6809 (flockfile, funlockfile) [_LIBC]: New macros.
6810 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6811 [!_LIBC]: New macros.
6812 (call_fclose): New function.
6813 (getpass): Use it. Save tty stream separately; this simplifies the
6814 code and makes it more reliable if stdin happens to equal stdout.
6815 Invoke __fsetlocking on tty.
6816 Handle thread cancellation if needed.
6817 Namespace cleanup (use __tcgetattr, __getline).
6818 Use bool for Booleans.
6819 [USE_IN_LIBIO]: Handle wide streams.
6820 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6821 stream might go where.
6823 * unlocked-io.h: Include <stdio.h>, so that the caller
6824 doesn't have to include <stdio.h> before us.
6825 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6826 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6827 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6828 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6829 if not declared, so that we can use getpass.c code from libc without
6831 (flockfile, ftrylockfile, funlockfile): New macros.
6833 2003-10-06 Bruno Haible <bruno@clisp.org>
6835 * version-etc-2.h: Remove file.
6836 * version-etc-2.c: Remove file.
6838 2003-09-25 Jim Meyering <jim@meyering.net>
6839 Bruno Haible <bruno@clisp.org>
6841 This lets translators provide better translations for the
6842 "Written by ..." part of --version output.
6843 * version-etc.h: Include stdarg.h.
6844 (version_etc_copyright): Declare as readonly.
6845 (version_etc): Make this function variadic with a NULL-terminated list
6846 of author name strings.
6847 (version_etc_va): New declaration.
6848 * version-etc.c: Include stdarg.h, stdlib.h.
6849 (version_etc_copyright): Declare as readonly.
6850 (version_etc_va): New function. Provide a different translatable string
6851 for each possible number of authors < 10. Abbreviate when there are 10
6853 (version_etc): Make this function variadic. Call version_etc_va.
6854 Suggestion from Gary V. Vaughan.
6856 * long-options.h (parse_long_options): Change prototype: the authors
6857 string is moved to the end and becomes variadic.
6858 * long-options.c: Include stdarg.h.
6859 (parse_long_options): Make this function variadic, too.
6860 Call version_etc_va, not version_etc.
6862 2003-10-06 Bruno Haible <bruno@clisp.org>
6864 * fatal-signal.h: New file, from GNU gettext.
6865 * fatal-signal.c: New file, from GNU gettext.
6867 2003-10-04 Karl Berry <karl@gnu.org>
6869 * argp*: update from libc.
6871 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6873 * getpass.c (getpass): Use a no-op fseek when switching from input to
6874 output mode on the same stream.
6876 2003-09-29 Paul Eggert <eggert@twinsun.com>
6878 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6879 Fix arg typo in previous patch.
6881 2003-09-28 Jim Meyering <jim@meyering.net>
6883 * error.c: Correct cpp indentation.
6885 2003-09-27 Paul Eggert <eggert@twinsun.com>
6887 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6888 Omit the special code that used __typeof__, since we worry that
6889 it could be more trouble than it's worth. See:
6890 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6891 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6895 2003-09-26 Jim Meyering <jim@meyering.net>
6897 * error.c (error_tail): Move some declarations
6898 into inner scope where the local variables are used.
6900 2003-09-26 Bruno Haible <bruno@clisp.org>
6902 * stpncpy.h (gnu_stpncpy): New declaration.
6903 (stpncpy): Define as alias for gnu_stpncpy.
6904 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6906 2003-09-26 Paul Eggert <eggert@twinsun.com>
6908 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6909 (error_tail): Do not loop, reallocating temporary buffer, since
6910 the output cannot contain more wide characters than the input
6911 contains bytes, the size must be big enough already. This avoids
6912 one potential size overflow calculation. Check for size overflow
6913 when calculating temporary buffer size. Free temporary buffer
6914 when done, if it was allocated with malloc; this plugs a memory
6915 leak. Remove casts from void * to pointers, that are no longer
6916 needed now that we're assuming C89 or better.
6918 Merge error changes from glibc.
6920 * error.c, error.h: Update copyright notice header to match glibc.
6921 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6922 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6923 Disable cancellation while printing error.
6924 * error.h: Prepend __ to parameter names.
6926 2003-09-25 Karl Berry <karl@gnu.org>
6928 * argp-fmtstream.c, argp-help.c: update from libc.
6930 2003-09-25 Bruno Haible <bruno@clisp.org>
6932 * version-etc-2.h: New file, from version-etc.h with modifications.
6933 * version-etc-2.c: New file, from version-etc.c with modifications.
6935 2003-09-25 Simon Josefsson <jas@extundo.com>
6937 * xgetdomainname.h: New file.
6938 * xgetdomainname.c: New file.
6940 2003-09-25 Simon Josefsson <jas@extundo.com>
6941 Bruno Haible <bruno@clisp.org>
6943 * getdomainname.h: New file.
6944 * getdomainname.c: New file.
6946 2003-09-24 Paul Eggert <eggert@twinsun.com>
6948 * linebuffer.c (freebuffer): Don't free the argument, just
6949 the buffer associated with the argument. Bug reported by
6952 2003-09-19 Karl Berry <karl@gnu.org>
6954 * argp.h: update from libc.
6956 2003-09-16 Paul Eggert <eggert@twinsun.com>
6958 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6959 input error, instead of returning NULL the next time we are called
6960 (and therefore losing track of errno).
6962 2003-09-15 Paul Eggert <eggert@twinsun.com>
6964 * getndelim2.c (getndelim2): Don't trash errno when a read
6965 fails, so that the caller gets the proper errno.
6967 * readutmp.c (read_utmp): Likewise.
6968 Check for fstat error. Close stream and free storage
6971 2003-09-14 Bruno Haible <bruno@clisp.org>
6973 * fwriteerror.h: New file.
6974 * fwriteerror.c: New file.
6976 2003-09-14 Jim Meyering <jim@meyering.net>
6978 * getloadavg.c: Correct cpp indentation.
6979 * strdup.c: Likewise.
6980 * vasnprintf.c: Likewise.
6982 2003-09-12 Paul Eggert <eggert@twinsun.com>
6984 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6985 * obstack.c [!defined _LIBC]: Likewise.
6986 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6987 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6988 * exitfail.c: Don't include stdlib.h; no longer needed.
6990 More changes to assume C89 or better.
6992 * error.c (error_tail): Assume vprintf.
6994 * argmatch.c (getenv): Remove decl.
6995 * progreloc.c (get_full_program_name): Define via prototype.
6996 * setenv.c (clearenv): Likewise.
6997 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6999 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7000 (malloc, memcpy): Remove decls.
7001 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7002 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7003 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7004 (memcpy): Remove macro.
7005 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7006 (__P): Remove. All uses removed.
7007 (PTR): Remove. All uses changed to void *.
7008 (CHAR_BIT, NULL): Remove.
7009 (spaces, zeros, memset_space, memset_zero)
7010 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7012 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7013 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7014 Define with prototype.
7015 Remove now-unnecessary prototype decl.
7016 (extra_args_spec): Assume ANSI C. All uses changed.
7017 (extra_args_spec_iso): Remove.
7018 (my_strftime, emacs_strftimeu): Define via prototype.
7019 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7021 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7022 * strtoimax.c: Include <stdlib.h> unconditionally.
7023 (strtoul, strtol): Remove decls.
7024 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7026 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7027 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
7028 (LOCALE_PARAM_PROTO): New macro.
7029 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7030 (INTERNAL (strtol), strtol): Define with a prototype.
7031 (PARAMS): Remove. All uses removed.
7032 * tempname.c: Include <string.h> unconditionally.
7033 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7034 * xgethostname.c (main): Define with a prototype.
7035 * xmalloc.c: Include "xalloc.h" first, to check interface.
7036 Include <stdlib.h> unconditionally.
7037 (calloc, malloc, realloc, free): Remove decls.
7038 * xstrtod.c: Include "xstrtod.h" first, to check interface.
7039 Include <stdlib.h> unconditionally. Sort include file names.
7041 (xstrtod): Define with a prototype.
7042 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7043 (strtol, strtoul): Remove decls.
7045 2003-09-11 Paul Eggert <eggert@twinsun.com>
7047 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7048 Include <stdlib.h>, <string.h> unconditionally.
7049 Remove now-unnecessary cast to char *.
7050 * strnlen.c: Include <string.h> unconditionally.
7051 * yesno.c (yesno): Define with a prototype.
7053 2003-09-10 Bruno Haible <bruno@clisp.org>
7055 * strcspn.c: Include <string.h> unconditionally.
7056 * strpbrk.c: Include <string.h> unconditionally.
7057 * strstr.c: Include <string.h> unconditionally.
7058 * unicodeio.c: Include <string.h> unconditionally.
7059 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7060 * unsetenv.c: Likewise.
7061 * xreadlink.c: Include <stdlib.h> unconditionally.
7062 * yesno.c: Include <stdlib.h> unconditionally.
7063 (rpmatch): Add prototype.
7065 2003-09-10 Jim Meyering <jim@meyering.net>
7067 * error.c: Correct indentation of cpp directives.
7069 2003-09-09 Paul Eggert <eggert@twinsun.com>
7073 * acosl.c (main): Use a prototype.
7074 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7077 * getloadavg.c (getloadavg, main): Define via prototypes.
7079 * getopt.h (struct option.name): Assume C89, and use 'const'.
7080 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7081 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7083 * getopt.c (const): Remove macro.
7084 Include <string.h> unconditionally.
7085 (my_index): Remove; all uses changed to strchr.
7086 (strlen): Remove decl.
7087 (exchange): Remove forward decl; no longer needed.
7088 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7089 Define with prototype.
7090 * getopt1.c (const): Remove macro.
7091 (getopt_long, getopt_long_only, main): Define with prototype.
7093 * getugroups.c: Include <string.h> unconditionally.
7095 * getusershell.c: Include <stdlib.h> unconditionally.
7096 (getusershell, setusershell, endusershell, readname, main):
7097 Define with prototypes.
7099 * group-member.c: Include group-member.h first.
7100 Include <stdlib.h> unconditionally.
7102 * hard-locale.c: Include hard-locale.h first.
7103 Include <stdlib.h>, <string.h> unconditionally.
7105 * hash.c (free, malloc): Remove decls.
7106 Include <stdlib.h> unconditionally.
7108 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7109 (getenv): Do not declare.
7111 * idcache.c: Include <string.h> unconditionally.
7113 * long-options.c: Include long-options.h first, to test interface.
7114 Include <stdlib.h> unconditionally.
7116 * makepath.c: Include makepath.h first, to test interface.
7117 Include <stdlib.h> and <string.h> unconditionally.
7119 * linebuffer.c: Include <stdlib.h>.
7120 (free): Remove decl.
7122 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7123 rpl_malloc returns void *, not char *.
7124 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7126 * md5.h: Include <limits.h> unconditionally.
7127 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7128 (__P): Remove; all uses removed.
7129 * md5.c: Include "md5.h" first.
7130 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7131 md5_buffer, md5_process_bytes, md5_process_block):
7132 Define with prototypes.
7133 * sha.h (__P): Remove all uses. (It wasn't defined??)
7134 * sha.c: Include "sha.h" first.
7135 Include <stdlib.h>, <string.h> unconditionally.
7137 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7138 * memcmp.c (__ptr_t): Likewise.
7139 * memrchr.c (__ptr_t): Likewise.
7140 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7141 Include <string.h> unconditionally.
7142 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7143 * memchr.c: Include <stdlib.h> unconditionally.
7144 * memchr.c (LONG_MAX): Remove.
7145 * memrchr.c (LONG_MAX): Likewise.
7146 * memchr.c (__memchr): Define via a prototype.
7147 * memrchr.c (__memrchr): Likewise.
7148 * memcmp.c (__P): Remove, and remove all uses.
7149 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7150 Remove forward decls; no longer needed.
7151 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7152 Use types required by C89 in prototype.
7154 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7155 * savedir.c: Likewise.
7156 * mkdir.c (free): Remove decl.
7157 * rmdir.c (rmdir): Define with a prototype.
7158 * savedir.c: Include savedir.h first, to test interface.
7160 * mktime.c (STDC_HEADERS): Remove.
7161 Include <stdlib.h>, <string.h> unconditionally.
7163 * modechange.c: Include <stdlib.h> unconditionally.
7164 (malloc): Remove decl.
7166 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7167 (free): Remove decl.
7169 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7170 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7171 (This type really should be intptr_t, but that's a C99ism.)
7172 (_obstack_memcpy): Remove: all uses changed to memcpy.
7173 Include <string.h> unconditionally.
7174 (struct obstack): Assume __STDC__ for types of members
7175 chunkfun, freefun, extra_arg.
7176 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7177 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7178 obstack_begin, obstack_specify_allocation,
7179 obstack_specify_allocation_with_arg, obstack_chunkfun,
7180 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7181 Remove unprototyped decls and the macros that use them.
7182 * obstack.c (POINTER): Remove. All uses changed to void *.
7183 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7184 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7185 (defined __STDC__ && __STDC__)]:
7186 Remove nonprototyped code.
7187 Include <stdlib.h> unconditionally.
7188 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7189 _obstack_allocated_p, _obstack_free, obstack_free,
7190 _obstack_memory_used, print_and_abort):
7191 Define using prototypes.
7192 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7193 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7194 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7195 obstack_next_free, obstack_object_size, obstack_room) [0]:
7196 Remove unused, unprototyped code.
7198 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7200 * physmem.c (physmem_total, physmem_available, main): Define
7203 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7204 (main): Define with a prototype.
7206 * posixver.c (getenv): Remove decl.
7208 * putenv.c (malloc): Returns void *, not char *.
7209 Include <string.h> unconditionally.
7210 (strchr, memcpy, NULL): Do not define.
7212 * readtokens.c: Include readtokens.h first, to test interface.
7213 Include <stdlib.h>, <string.h> unconditionally.
7214 (init_tokenbuffer): Define with a prototype.
7216 * regex.c (PARAMS): Remove. All uses removed.
7217 All uses of _RE_ARGS removed, too.
7218 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7220 (bzero): Assume memset exists.
7221 (memcmp, memcpy, NULL): Remove.
7222 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7223 char, or assignments to local vars of type signed char.
7224 (init_syntax_once, PREFIX(extract_number_and_incr),
7225 PREFIX(print_partial_compiled_pattern),
7226 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7227 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7228 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7229 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7230 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7231 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7232 wcs_compile_range, byte_compile_range, truncate_wchar,
7233 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7234 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7235 count_mbs_length, wcs_re_match_2_internal,
7236 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7237 PREFIX(alt_match_null_string_p),
7238 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7239 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7240 regfree, PREFIX(extract_number)): Define with prototype. Remove
7241 now-unnecessary declaration, if any.
7242 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7244 Remove now-unnecessary casts among pointer types.
7245 * regex.h (_RE_ARGS): Remove. All uses removed.
7247 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7248 (free): Remove decl.
7250 * rpmatch.c: Include <stdlib.h> unconditionally.
7252 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7253 (free): Remove decl.
7255 * save-cwd.c: Include <stdlib.h> unconditionally.
7256 * xgetcwd.c: Likewise.
7258 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7259 (free): Remove decl.
7261 * strchrnul.c (strchrnul): Define with a prototype.
7262 Fix bug: c_in was not converted to char before searching.
7264 The following changes are not K&R related:
7266 * group-member.h: Include <sys/types.h>, so that this file is
7268 * makepath.h: Likewise.
7270 * getusershell.c (readname, default_index, line_size, readname):
7271 Use size_t, not int, for sizes.
7272 (readname): If the size overflows, report an error instead of
7275 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7277 * getndelim2.c: Assume stdlib.h per the C89 spec.
7279 2003-09-08 Paul Eggert <eggert@twinsun.com>
7281 Assume C89 or better; remove K&R cruft.
7282 A few of these changes were first proposed by Derek Robert Price
7283 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7285 * addext.c: Include <string.h> unconditionally.
7286 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7287 Don't declare getenv or malloc.
7289 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7290 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7292 (find_stack_direction, alloca): Use prototypes.
7294 * atexit.c (atexit): Define using a prototype.
7296 * basename.c, dirname.c, stripslash.c:
7297 Include <string.h> unconditionally.
7299 * bcopy.c: Include <stddef.h>.
7300 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7302 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7304 * error.h (error, error_at_line, error_print_progname)
7305 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7306 * error.c: Include error.h first, to check interface.
7307 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7308 (VA_START): Remove; all uses changeed to va_start.
7309 (exit, strerror): Remove decls.
7310 (error_print_progname): Prototype uncondionally.
7311 Don't include <errno.h>; no longer needed.
7312 (private_strerror): Remove.
7313 (error_tail): Always define.
7314 (error, error_at_line): Assume C89 or better; always use prototypes.
7315 * fatal.c: Include "fatal.h" first, to test interface.
7316 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7317 (VA_START): Remove; all uses changed to va_start.
7318 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7320 (exit): Remove decl.
7321 (fatal): Prototype unconditionally. Assume va_start works.
7322 Abort at end, to pacify gcc.
7324 * euidaccess.c (main): Define with a prototype.
7326 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7328 * exitfail.c: Include <stdlib.h> unconditionally.
7330 * fnmatch_.h (__P): Remove. All uses changed to assume
7332 * fnmatch.c: Include fnmatch.h first, to test interface.
7333 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7334 (getenv): Remove decl.
7335 (fnmatch): Define using a prototype.
7336 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7337 (FCT): Define using a prototype.
7339 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7341 * gethostname.c: Include <stddef.h>.
7342 (gethostname): Define with prototype. Length is size_t, not int.
7344 2003-09-08 Paul Eggert <eggert@twinsun.com>
7346 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7347 getversion.c should have been removed then, but was accidentally
7350 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7351 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7353 2003-09-07 Paul Eggert <eggert@twinsun.com>
7355 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7356 copy_tm_result. Bug reported by Simon Josefsson in
7357 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7359 2003-09-06 Paul Eggert <eggert@twinsun.com>
7361 * time_r.c, time_r.h: New files.
7363 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7365 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7366 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7368 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7370 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7371 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7374 * timegm.c: Switch to glibc implementation, with the following changes:
7375 [defined HAVE_CONFIG_H]: Include <config.h>.
7376 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7377 (__mktime_internal) [!defined _LIBC]: New decl.
7378 (__gmtime_r) [!defined _LIBC]: New macro and function.
7379 (timegm): Use a prototype, since gnulib assumes C89.
7380 Do not bother declaring tmp to be const, as it's not really usefu.
7381 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7382 (timegm): Declare only if HAVE_DECL_TIMEGM.
7384 2003-09-03 Paul Eggert <eggert@twinsun.com>
7386 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7387 Bug reported by Lute Kamstra in
7388 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7390 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7391 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7392 course with correspondingly smaller numbers for tomorrow and
7393 yesterday. From Tadayoshi Funaba. Originally installed into
7394 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7397 2003-08-31 Simon Josefsson <jas@extundo.com>
7399 * timegm.h: New file.
7400 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7402 2003-08-31 Karl Berry <karl@gnu.org>
7404 * argp.h: update from libc.
7406 2003-08-28 Bruno Haible <bruno@clisp.org>
7408 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7409 warning on QNX, which defines O_BINARY to 000000.
7411 2003-08-24 Bruno Haible <bruno@clisp.org>
7413 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7414 MSVC7 <stdio.h> is included later.
7416 2003-08-20 Bruno Haible <bruno@clisp.org>
7418 * progname.h: New file, from GNU gettext.
7419 * progname.c: New file, from GNU gettext.
7420 * progreloc.c: New file, from GNU gettext.
7422 2003-08-19 Bruno Haible <bruno@clisp.org>
7424 * xstrdup.c: Assume <string.h> exists.
7426 2003-08-18 Jim Meyering <jim@meyering.net>
7428 * setenv.h: Indent nested cpp directive.
7429 * vasnprintf.c: Remove trailing blanks.
7431 2003-08-17 Simon Josefsson <jas@extundo.com>
7432 Bruno Haible <bruno@clisp.org>
7434 * xstrndup.h: New file.
7435 * xstrndup.c: New file.
7437 2003-08-17 Bruno Haible <bruno@clisp.org>
7439 * strndup.h: New file.
7441 2003-08-16 Paul Eggert <eggert@twinsun.com>
7443 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7444 space, undoing this 2003-08-12 change:
7445 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7447 2003-08-16 Jim Meyering <jim@meyering.net>
7449 Merge from coreutils.
7450 * xstrtoimax.c: #else #if -> #elif.
7451 * xstrtoumax.c: Likewise.
7453 2003-08-15 Paul Eggert <eggert@twinsun.com>
7455 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7456 rather than tab, after '#' in shell-script copyright notices.
7457 Suggested by Bruno Haible.
7459 2003-08-15 Jim Meyering <jim@meyering.net>
7460 and Paul Eggert <eggert@twinsun.com>
7462 Merge from coreutils.
7463 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7464 member but strut utmpx does not. Needed for AIX 4.3.3.
7465 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7467 2003-08-15 Jim Meyering <jim@meyering.net>
7469 Merge from coreutils.
7470 * xgethostname.c: Include <stdlib.h>.
7471 (xghostname): Don't exit for anything other than memory-related
7472 failure; just return NULL.
7473 * userspec.c: Include "posixver.h".
7474 (parse_user_spec): Accept `.' as a separator only
7475 in pre-POSIX-200112 mode.
7476 * strtoimax.c: Use #elif rather than #else #if.
7477 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7478 Remove function, now that we can rely on a working tzset function.
7479 [!_LIBC]: Ensure that the required autoconf test has been run.
7480 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7481 Use underlying_strftime for %r.
7482 * sha.c: Merge in some clean-up and optimization changes from glibc.
7483 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7484 Ensure that it is a multiple of 64.
7485 Rearrange loop exit tests so as to avoid performing an
7486 additional fread after encountering an error or EOF.
7487 * realloc.c: Update copyright date.
7489 2003-08-14 Jim Meyering <jim@meyering.net>
7491 Merge from coreutils.
7492 * obstack.h: Whitespace changes.
7493 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7494 and xcalloc return values.
7495 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7496 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7497 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7498 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7499 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7501 Use mntctl's return value to drive the entry-processing loop, since
7502 we can't rely on the value of the vmt_length member in the last
7503 entry. On some systems doing so could result in exhausting
7504 virtual memory. Based in part on a patch from Mike Jetzer.
7506 2003-08-14 Jim Meyering <jim@meyering.net>
7507 and Paul Eggert <eggert@twinsun.com>
7509 Merges from coreutils, plus other fixes.
7510 * physmem.c: Merge in portability changes from gcc/libiberty
7511 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7512 for credits and details. Thanks to Kaveh Ghazi for helping
7513 to keep these files in sync.
7514 (ARRAY_SIZE): Define it.
7515 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7516 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7517 (memcasecmp): Don't assume size_t fits in unsigned int.
7518 Remove casts and duplicate code.
7519 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7520 (memcpy): Remove definition.
7521 Merge in some clean-up and optimization changes from glibc.
7522 [BLOCKSIZE]: Move definition to top of file.
7523 Ensure that it is a multiple of 64.
7524 Rearrange loop exit tests so as to avoid performing an
7525 additional fread after encountering an error or EOF.
7526 * md5.h (md5_uintptr): Define.
7527 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7528 return to the initial working directory. Preserve errno
7530 * idcache.c: Include "xalloc.h".
7531 (xmalloc, xrealloc): Remove decls.
7532 (getuser): Remove casts no longer required in C89.
7533 * human.c: Include stdio.h, for sprintf.
7534 * group-member.c: Include "xalloc.h".
7535 (xmalloc, xrealloc): Remove decls.
7536 (get_group_info): Remove casts no longer required in C89.
7537 * getusershell.c (readname): Remove casts no longer required in C89.
7538 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7539 * getline.c: Whitespace fix, from coreutils.
7541 2003-08-13 Paul Eggert <eggert@twinsun.com>
7543 * exclude.c: Include <ctype.h>
7544 (IN_CTYPE_DOMAIN): New macro.
7546 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7549 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7550 Undo previous (whitespace-only) change.
7552 2003-08-12 Paul Eggert <eggert@twinsun.com>
7554 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7555 Normalize leading white space and remove trailing white space.
7556 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7557 notice, as per ../config/srclist-update.
7559 Merge from coreutils.
7560 * euidaccess.h: New file.
7561 * euidaccess.c: Include it.
7562 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7563 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7564 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7566 2003-08-11 Bruno Haible <bruno@clisp.org>
7568 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7569 (vasnprintf): Use it instead of wcslen.
7571 2003-08-11 Bruno Haible <bruno@clisp.org>
7573 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7574 value to ensure that _Bool promotes to int. Use #define for _Bool when
7575 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7577 2003-08-10 Karl Berry <karl@gnu.org>
7579 * regex.h: update from libc (whitespace fix).
7581 2003-08-09 Paul Eggert <eggert@twinsun.com>
7583 Merge some files from coreutils. These changes were
7584 originally made by Jim Meyering.
7585 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7586 many older Unixes require this.
7587 * alloca.c (alloca): Remove cast to argument of free;
7588 no longer needed in C89.
7589 * alloca_.h, regex.h: Fix white space to match
7590 what GNU indent does.
7592 2003-08-05 Paul Eggert <eggert@twinsun.com>
7594 * bumpalloc.h: Remove.
7596 2003-08-04 Paul Eggert <eggert@twinsun.com>
7598 * getloadavg.c: Change copyright notice and spacing to conform to
7601 Merge from coreutils.
7602 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7604 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7605 from Karl Berry, implemented by Jim Meyering.
7606 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7607 from Dmitry V. Levin.
7608 Remove anachronistic cast of xrealloc.
7609 * fnmatch_.h (__const): Remove. Use 'const'.
7610 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7611 type. Otherwise, it wouldn't compile with at least /bin/cc on
7612 ymp-cray-unicos9.0.2.X.
7613 Combine two mostly-identical uses of alloca into one.
7614 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7616 2003-08-04 Dave Love <d.love@dl.ac.uk>
7620 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7621 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7622 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7623 obsolete NLIST_NAME_UNION.
7624 [__GNU__]: Undef BSD and FSCALE.
7625 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7627 2003-08-03 Paul Eggert <eggert@twinsun.com>
7629 * stdbool_.h (_Bool): Make it signed char, instead of
7630 an enum type, so that it's guaranteed to promote to int. See:
7631 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7633 2003-07-31 Paul Eggert <eggert@twinsun.com>
7635 * strerror.c: Include config.h, limits.h. Declare sprintf.
7636 (strerror): Don't assume that a printable int fits in 14 bytes.
7638 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7639 Bruno Haible <bruno@clisp.org>
7641 * getline.h (getline, getdelim): Change return type to ssize_t.
7642 * getline.c (getline, getdelim): Likewise.
7643 Remove _GNU_SOURCE define; now it's defined in config.h through
7646 2003-07-22 Paul Eggert <eggert@twinsun.com>
7648 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7649 over-parenthesization in macros.
7651 Sync with coreutils.
7653 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7656 Use `exit_failure' for xalloc and xmemcoll instead of their own
7657 private exit-failure variables.
7658 * xalloc.h (xalloc_exit_failure): Remove.
7659 * xmalloc.c: Likewise. Include exitfail.h.
7660 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7661 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7662 * xmemcoll.c: Likewise. Include exitfail.h.
7663 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7665 2003-07-18 Paul Eggert <eggert@twinsun.com>
7667 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7668 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7669 to test that it can stand by itself. Include "exitfail.h".
7670 Clients should set exit_failure instead.
7671 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7673 2003-07-18 Andreas Schwab <schwab@suse.de>
7675 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7677 2003-07-18 Bruno Haible <bruno@clisp.org>
7679 * getndelim2.h: New file.
7680 * getndelim2.c: Make into a module of its own. Include config.h,
7682 (getndelim2): Make non-static. Change return type to ssize_t.
7683 * getline.h: Change argument names.
7684 * getline.c: Include getndelim2.h instead of getndelim2.c.
7685 * getnline.c: Include getndelim2.h.
7687 2003-07-17 Bruno Haible <bruno@clisp.org>
7689 * Makefile.am: Remove file.
7690 * Makefile.in: Remove file.
7692 2003-07-17 Bruno Haible <bruno@clisp.org>
7694 * getnline.h: New file.
7695 * getnline.c: New file.
7696 * getndelim2.c: New file, extracted from getline.c.
7697 (getndelim2): Renamed from getdelim2, with added nmax argument.
7698 * getline.c: Include getndelim2.c.
7699 (getdelim2): Moved out to getndelim2.c.
7700 (getline, getdelim): Update.
7702 2003-07-15 <karl@gnu.org>
7704 * vasnprintf.c: update from gettext.
7706 2003-07-15 Jim Meyering <jim@meyering.net>
7708 * makepath.c (make_path): Enclose diagnostic in _(...).
7710 2003-07-14 Paul Eggert <eggert@twinsun.com>
7712 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7713 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7714 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7715 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7716 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7717 updated automatically by ../config/srclist-update. This changes
7718 their license from LPGL to GPL.
7720 2003-07-14 Jim Meyering <jim@meyering.net>
7722 Don't emit diagnostics. Let callers do that.
7723 * save-cwd.c: Don't include "error.h".
7724 (save_cwd): Don't call error. Ensure that errno is valid
7725 when returning nonzero.
7727 * save-cwd.h (restore_cwd): Update prototype.
7728 * save-cwd.c (restore_cwd): Remove two parameters.
7729 Simplify. Don't call error upon failure. Let callers do that.
7730 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7731 when auditing is enabled. But don't bother updating the #if.
7733 2003-07-14 Simon Josefsson <jas@extundo.com>
7735 * mempcpy.h: New file.
7736 * mempcpy.c: New file.
7738 2003-07-14 Paul Eggert <eggert@twinsun.com>
7740 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7741 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7742 unicodeio.c, unicodeio.h, unlocked-io.h:
7743 Switch from LGPL to GPL.
7745 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7747 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7748 it breaks C++ compilation.
7749 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7751 2003-07-10 Jim Meyering <jim@meyering.net>
7753 * vasnprintf.c: Remove trailing blanks.
7754 Make cpp indentation consistent.
7756 2003-07-09 Paul Eggert <eggert@twinsun.com>
7758 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7759 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7760 Switch from LGPL to GPL.
7762 2003-07-07 Paul Eggert <eggert@twinsun.com>
7764 * mktime.c: Fix some boundary cases and remove need for floating point.
7766 Issue a compile-time diagnostic if time_t is floating point, or if
7767 two's complement arithmetic is not in effect, or if arithmetic
7768 right shift does not propagate the sign. These assumptions were
7769 all in the original code but they weren't checked.
7771 (TIME_T_MIDPOINT, verify): New macros.
7772 (__isleap): Remove; it has integer overflow problems.
7773 (leapyear): New function, without those problems.
7774 (ydhms_tm_diff): Remove; splitting into two parts.
7775 (ydhms_diff): New function, containing the arithmetic part of
7776 the old ydhms_tm_diff function. Issue a compile-time
7777 diagnostic if we are not using C99 integer division.
7778 Avoid casts when possible.
7779 (guess_time_tm): New function, containing the checking part of
7780 the old ydhms_tm_diff function. Return the new value, rather than
7781 the difference between it and the old. Accept a new argument T
7782 so that *T specifies the old value. Check for overflow in the result.
7784 (__mktime_internal): Use a time_t offset, not a long int offset.
7785 This undoes the 2003-06-04 change, which is no longer needed now
7786 that we have better overflow checking.
7787 (localtime_offset): Likewise.
7789 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7790 and long are 64-bit but int is only 32-bit.
7791 (ydhms_diff): Use long int to store year1 and yday1.
7792 Issue a compile-time diagnostic if long int is not wide enough.
7794 (__mktime_internal): Use long int to store adjusted year and yday.
7795 Use plain C rather than preprocessor commands, if that doesn't
7797 Check for overflow (and try to repair) after each probe
7798 rather than checking only at the very end. This avoids some bugs
7799 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7800 does not equal GMT offset at maximum time).
7801 Use integer to check for overflow rather than floating point; this
7802 is more portable to non-IEEE hosts, and is a tad faster.
7803 When we detect that we are oscillating between two values,
7804 don't check whether tm_isdst has the requested value, since
7805 we already know the answer. When tm_isdst has the wrong value,
7806 use a different heuristic to find the right one, based on the
7807 extreme values actually observed in practice in tz2003a,
7808 rather than the (overly optimistic) "previous 3 calendar quarters".
7810 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7811 "T const" to accommodate glibc style.
7812 (check_result): Use less-confusing report format. "long" -> "long int.
7814 Don't loop if the iteration overflows time_t.
7815 Allow a negative step in the iteration.
7817 2003-07-01 Paul Eggert <eggert@twinsun.com>
7819 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7820 having it depend on HAVE_SYS_TYPES_H.
7822 2003-06-25 Bruno Haible <bruno@clisp.org>
7824 * readlink.c: New file.
7826 2003-06-20 Bruno Haible <bruno@clisp.org>
7828 Assume C89, so PARAMS isn't needed.
7829 * unicodeio.h (PARAMS): Remove.
7830 * unicodeio.c: Don't use PARAMS.
7832 2003-06-18 Jim Meyering <jim@meyering.net>
7834 Merge changes from coreutils.
7835 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7836 Remove explicit declarations of xmalloc and realloc.
7838 (read_utmp): Remove anachronistic cast of xmalloc.
7840 2003-06-17 Paul Eggert <eggert@twinsun.com>
7842 Assume C89, so PARAMS isn't needed.
7843 * backupfile.h (PARAMS): Remove. All uses removed.
7844 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7845 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7846 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7847 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7848 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7849 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7850 xstrtol.h: Likewise.
7851 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7852 same.h, strverscmp.h: Do not include config.h; no longer needed.
7853 Anyway, config.h should always be included before any other file.
7855 2003-06-11 Simon Josefsson <jas@extundo.com>
7857 * sysexit_.h: New file.
7859 2003-05-20 Derek Price <derek@ximbiot.com>
7861 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7863 2003-06-10 Simon Josefsson <jas@extundo.com>
7865 * strchrnul.h: New file.
7866 * strchrnul.c: New file.
7868 2003-06-10 Simon Josefsson <jas@extundo.com>
7870 * argp.h: New file, from glibc.
7871 * argp-ba.c: New file, from glibc.
7872 * argp-eexst.c: New file, from glibc.
7873 * argp-fmtstream.c: New file, from glibc.
7874 * argp-fmtstream.h: New file, from glibc.
7875 * argp-fs-xinl.c: New file, from glibc.
7876 * argp-help.c: New file, from glibc.
7877 * argp-namefrob.h: New file, from glibc.
7878 * argp-parse.c: New file, from glibc.
7879 * argp-pv.c: New file, from glibc.
7880 * argp-pvh.c: New file, from glibc.
7881 * argp-xinl.c: New file, from glibc.
7883 2003-06-07 Jim Meyering <jim@meyering.net>
7885 * readtokens.h: Put `Free Software Foundation, Inc.'
7886 in place of my name in the copyright comment.
7887 Remove definition and uses of __P.
7890 * stat.c: Don't declare xmalloc explicitly.
7891 Instead, include "xalloc.h".
7892 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7893 xrealloc, and xcalloc return values.
7894 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7896 * xgetcwd.h: Remove definition/uses of PARAMS.
7898 2003-06-06 Jim Meyering <jim@meyering.net>
7900 * stdbool_.h: Renamed from stdbool.h.in.
7902 2003-06-06 Jim Meyering <jim@meyering.net>
7904 Merge from coreutils.
7905 * same.c: (same_name): Declare *_basename locals to be `const'.
7906 Consolidate declarations and initializations of *_base* locals.
7908 Merge from coreutils.
7909 This avoids a core dump on systems without GNU putenv,
7910 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7911 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7912 (unsetenv): New static function, from GNU libc.
7913 (rpl_putenv): Use it.
7915 * modechange.c: Remove trailing blanks.
7917 Merge from coreutils.
7918 * fsusage.c: Remove declaration of statfs.
7919 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7921 * posixtm.c: Include <stdbool.h> unconditionally.
7923 2003-06-05 Paul Eggert <eggert@twinsun.com>
7925 * mktime.c (__mktime_internal): When resolving a tm_isdst
7926 mismatch, look in future quarters as well as past. This fixes a
7927 bug when processing fall-backwards gaps immediately after a long
7928 period of daylight-saving time.
7930 * mktime.c: Assume freestanding C89 or better.
7931 (HAVE_LIMITS_H): Remove. Assume it's 1.
7932 (__P): Remove; not used.
7933 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7934 (mktime, not_equal_tm, print_tm, check_result,
7935 main): Use prototypes. Use const * where appropriate.
7936 (main): Fix typo in testing code that uncovered by above changes.
7937 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7939 2003-06-04 Paul Eggert <eggert@twinsun.com>
7941 * mktime.c: Fix Debian bug 177940
7942 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7943 (localtime_offset): Now long int, not time_t, because we want it
7944 to be guaranteed to be signed. All uses changed.
7945 (__mktime_internal): If overflow would occur when adding offset,
7948 Merge 'human' changes from coreutils. Rewrite to support
7949 locale-specific notations like thousands separators.
7950 * human.c: Simplify authorship notice.
7951 Include human.h immediately after config.h.
7952 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7953 <limits.h>: Do not include, since human.h does.
7954 (SIZE_MAX, UINTMAX_MAX): New macros.
7955 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7956 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7957 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7958 (power_letter): Renamed from suffixes.
7959 (generate_suffix_backwards): Remove.
7960 (adjust_value): Now takes int style (because of human.h changes)
7961 and long double value (for greater precision on some platforms).
7962 (group_number): New function.
7963 (human_readable): Use it. Use integer options, not enum.
7964 Put the options before the sizes in the arg list.
7965 Support all the new options.
7966 The old human_readable function has been removed;
7967 use inttostr.h instead.
7968 (human_readable, default_block_size, humblock):
7969 Use uintmax_t, not int, for block sizes.
7970 (human_readable_inexact, block_size_types): Remove.
7971 (block_size_opts): New constant.
7972 (human_options): Renamed from human_block_size, with new signature
7973 that allows block sizes up to UINTMAX_MAX. All callers changed.
7974 * human.h: Add copyright and authorship notice.
7975 Include <limits.h> and <stdbool.h> unconditionally.
7976 (PARAMS): Remove. All uses removed.
7977 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7978 (enum human_inexact_style): Remove tag; now a nameless enum.
7979 (human_floor, human_ceiling, human_round_to_even): Now have
7980 values 2, 0, 1 rather than -1, 1, 0.
7981 (human_group_digits, human_suppress_point_zero, human_autoscale,
7982 human_base_1024, human_SI, human_B): New constants.
7983 (human_readable_inexact, human_block_size): Remove.
7984 (human_readable): Size args are now uintmax_t, not int.
7985 (human_options): New decl.
7987 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7988 unnecessary now that we assume C89 or better. This change
7989 imported from coreutils.
7991 * mktime.c (__mktime_internal): Do not reject negative timestamps
7992 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7993 in the 2003-05-30 sync from glibc.
7995 .h files should stand alone, but we shouldn't include <sys/types.h>
7996 if we can get away with just <stddef.h>.
7998 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7999 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8000 rather than <sys/types.h>, as we merely need size_t.
8001 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8003 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8004 Include <stdio.h>, to get FILE.
8005 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8006 memcasecmp.h has included <stddef.h> and all we need is size_t.
8007 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8008 our interface, instead of including <sys/types.h>
8010 2003-06-02 Paul Eggert <eggert@twinsun.com>
8013 Fix some minor time-related bugs with POSIX time arguments.
8014 Some valid time stamps were being rejected (notably -1, and
8015 time stamps before 1900 on 64-bit hosts). And some invalid
8016 time stamps were being accepted, e.g. September 31.
8018 * posixtm.h (posixtime): Return bool instead of time_t, so
8019 that we can return (time_t) -1 successfully.
8020 * posixtm.c: Likewise.
8021 [HAVE_STDBOOL_H]: Include <stdbool.h>.
8022 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8023 (t): Remove static var.
8024 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8025 of static var. All uses changed.
8026 (year): Do not reject years before 1900; they can occur with
8028 (posix_time_parse): Do not check for out-of-range components;
8029 that is now the caller's responsibility, since our checks were
8030 only approximations.
8031 (posixtime): Use mktime to check for out-of-range components,
8032 since it knows them exactly.
8033 If mktime returns (time_t) -1, check whether an error actually occurred
8034 by invoking localtime on -1.
8035 (main) [TEST_POSIXTIME]: Check for input data errors, and report
8036 posixtime failures better.
8037 Improve the test data (in comments only).
8039 2003-05-30 <karl@gnu.org>
8041 * mktime.c: update from libc.
8043 2003-05-30 Bruno Haible <bruno@clisp.org>
8045 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8046 * localcharset.h: Likewise.
8047 * localcharset.c: Likewise.
8049 2003-05-28 Paul Eggert <eggert@twinsun.com>
8051 Assume the headers required for C89 freestanding compilers.
8052 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8053 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8054 without checking for HAVE_LIMITS_H.
8055 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8056 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8058 * fatal.c: Include <stdarg.h> without checking for __STDC__.
8059 * exclude.c: Include <stdbool.h> unconditionally.
8060 * tempname.c: Include <stddef.h> unconditionally.
8061 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8062 * modechange.c, rpmatch.c (NULL): Don't define, since
8063 <stddef.h> does that.
8064 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8065 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8066 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8067 * xstrtol.c: Likewise.
8068 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8069 * savedir.c: Include <stddef.h> instead of defining NULL.
8071 * addext.c (addext): Use assignment rather than cast, to avoid
8072 warnings on some platforms.
8074 * mktime.c (__mktime_internal): Do not reject negative timestamps
8077 2003-05-10 Bruno Haible <bruno@clisp.org>
8079 * linebreak.c (iconv_string_length): Don't return -1 just because the
8080 string is longer than 4 KB.
8082 2003-05-12 Jim Meyering <jim@meyering.net>
8084 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8085 the space-padded-by-default conversion specifiers, %e, %k, %l.
8087 2003-05-03 Bruno Haible <bruno@clisp.org>
8089 Upgrade to Unicode-4.0.
8090 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8091 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8092 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8093 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8094 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8095 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8096 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8097 Change width of U+E0100..U+E01EF from 1 to 0.
8099 2003-04-25 Bruno Haible <bruno@clisp.org>
8101 * copy-file.c: Include <stddef.h>, for size_t.
8103 2003-04-25 Jim Meyering <jim@meyering.net>
8105 * copy-file.c (copy_file_preserving): Declare buf_size to be
8106 of type size_t, not int.
8108 2003-04-11 Jim Meyering <jim@meyering.net>
8110 Merge changes from Coreutils.
8112 2003-03-22 Jim Meyering <jim@meyering.net>
8114 * strftime.c (widen): Cast alloca return value to proper type.
8116 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8119 * strftime.c (my_strftime): Handle very large width
8120 specifications for numeric values correctly. Improve checks for
8123 2003-01-19 Jim Meyering <jim@meyering.net>
8125 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8126 (nl_get_alt_digit) [! defined my_strftime]: Define.
8127 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8128 _nl_get_alt_digit and _nl_get_walt_digit.
8130 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8131 These changes have no effect outside of _LIBC.
8133 2003-04-10 Bruno Haible <bruno@clisp.org>
8135 * findprog.h: New file, from GNU gettext.
8136 * findprog.c: New file, from GNU gettext.
8138 2003-04-05 Jim Meyering <jim@meyering.net>
8140 Merge changes from Coreutils.
8142 * exclude.h (PARAMS): Remove definition and uses.
8143 * exclude.c: Remove uses of `PARAMS'.
8145 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8146 Add test-cases for DOS filenames. Declare program_name.
8147 (main): Set up program_name. Patch by Rich Dawe.
8149 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8151 Use mntctl's return value to drive the entry-processing loop, since
8152 we can't rely on the value of the vmt_length member in the last
8153 entry. On some systems doing so could result in exhausting
8154 virtual memory. Based in part on a patch from Mike Jetzer.
8156 2003-04-04 Bruno Haible <bruno@clisp.org>
8158 * linebreak.h: New file, from GNU gettext.
8159 * linebreak.c: New file, from GNU gettext with slight modifications.
8160 * lbrkprop.h: New file, from GNU gettext.
8162 2003-04-03 Bruno Haible <bruno@clisp.org>
8164 * utf8-ucs4.h: New file, from GNU gettext.
8165 * utf16-ucs4.h: New file, from GNU gettext.
8166 * ucs4-utf8.h: New file, from GNU gettext.
8167 * ucs4-utf16.h: New file, from GNU gettext.
8169 2003-04-02 Bruno Haible <bruno@clisp.org>
8171 * binary-io.h: New file, from GNU gettext.
8173 2003-04-01 Bruno Haible <bruno@clisp.org>
8175 * pathname.h: New file, from GNU gettext.
8176 * concatpath.c: New file, from GNU gettext.
8178 2003-03-30 Bruno Haible <bruno@clisp.org>
8180 * copy-file.c (copy_file_preserving): Don't set owner if the function
8181 chown() doesn't exist.
8183 2003-03-28 Bruno Haible <bruno@clisp.org>
8185 * copy-file.h: New file, from GNU gettext.
8186 * copy-file.c: New file, from GNU gettext.
8188 2003-03-18 Jim Meyering <jim@meyering.net>
8190 * quote.c (quote_n): Fix typo in comment.
8192 2003-03-14 Jim Meyering <jim@meyering.net>
8194 Merge changes from Coreutils.
8195 * obstack.h (obstack_object_size): Declare temporary, __o,
8196 to be const, in order to avoid warnings.
8197 (obstack_room): Likewise.
8198 (obstack_empty_p): Likewise.
8200 2003-03-13 Paul Eggert <eggert@twinsun.com>
8202 Merge changes from Bison.
8203 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8204 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8205 when compiling Bison 1.875's `bitset bset = obstack_alloc
8206 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8207 * hash.c: Include <stdbool.h> unconditionally.
8209 2003-03-09 Paul Eggert <eggert@twinsun.com>
8211 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8212 Reported by Bruce Becker; see:
8213 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8215 2003-03-03 Paul Eggert <eggert@twinsun.com>
8216 Bruno Haible <bruno@clisp.org>
8218 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8219 Reported by John Hughes, see
8220 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8222 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8224 * poll_.h: New file.
8227 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8229 * mathl.h: New file.
8230 * acosl.c: New file.
8231 * asinl.c: New file.
8232 * atanl.c: New file.
8233 * ceill.c: New file.
8236 * floorl.c: New file.
8237 * frexpl.c: New file.
8238 * ldexpl.c: New file.
8240 * sincosl.c: New file.
8242 * sqrtl.c: New file.
8244 * trigl.c: New file.
8245 * trigl.h: New file.
8247 2003-02-17 Bruno Haible <bruno@clisp.org>
8249 * mkdtemp.h: New file, from GNU gettext.
8250 * mkdtemp.c: New file, from GNU gettext.
8252 2003-01-31 Bruno Haible <bruno@clisp.org>
8254 * rename.c: #undef rename before defining rpl_rename.
8255 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8257 2003-01-30 Bruno Haible <bruno@clisp.org>
8259 * printf-args.h: New file, from GNU gettext.
8260 * printf-args.c: New file, from GNU gettext.
8261 * printf-parse.h: New file, from GNU gettext.
8262 * printf-parse.c: New file, from GNU gettext.
8263 * vasnprintf.h: New file, from GNU gettext.
8264 * vasnprintf.c: New file, from GNU gettext.
8265 * asnprintf.c: New file, from GNU gettext.
8266 * vasprintf.h: New file, from GNU gettext with modifications.
8267 * vasprintf.c: New file, from GNU gettext.
8268 * asprintf.c: New file, from GNU gettext.
8270 2003-01-29 Bruno Haible <bruno@clisp.org>
8272 * stpncpy.h: New file, from GNU gettext with modifications.
8273 * stpncpy.c: New file, from GNU gettext with modifications.
8275 2003-01-28 Bruno Haible <bruno@clisp.org>
8277 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8279 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8282 2003-01-27 Bruno Haible <bruno@clisp.org>
8284 * xsetenv.h: New file, from GNU gettext.
8285 * xsetenv.c: New file, from GNU gettext.
8287 2003-01-23 Bruno Haible <bruno@clisp.org>
8289 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8291 2003-01-22 Bruno Haible <bruno@clisp.org>
8293 * exit.h: New file, from GNU gettext.
8295 2003-01-11 Bruno Haible <bruno@clisp.org>
8297 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8298 * strcase.h (strcasecmp, strncasecmp): Likewise.
8300 2003-01-14 Jim Meyering <jim@meyering.net>
8302 * same.c (same_name): Tweak a comment.
8304 2003-01-11 Bruno Haible <bruno@clisp.org>
8306 * same.c (same_name): Reorder tests so as to avoid calling stat()
8307 when a string comparison is sufficient.
8309 2003-01-11 Bruno Haible <bruno@clisp.org>
8311 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8314 2003-01-11 Bruno Haible <bruno@clisp.org>
8316 * hash-pjw.c: Add comment about low quality of this function.
8318 2003-01-12 Paul Eggert <eggert@twinsun.com>
8320 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8321 to avoid collisions with libcurses and libreadline.
8323 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8324 * getstr.h, getstr.c: Remove.
8325 * getline.c: Include "getline.h", to check interface.
8326 Move body of old getstr.c here: this defines MIN_CHUNK and
8327 declares getdelim2, which is renamed from getstr.
8328 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8330 * linebuffer.c (readlinebuffer): Renamed from readline.
8332 * linebuffer.h: Likewise.
8333 (readline): Remove backward-compatibility macro.
8335 2003-01-12 Jim Meyering <jim@meyering.net>
8337 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8339 2003-01-10 Bruno Haible <bruno@clisp.org>
8341 * alloca_.h: New file.
8342 * getdate.y: Unconditionally include alloca.h.
8343 * makepath.c: Likewise.
8344 * setenv.c: Likewise.
8345 * userspec.c: Likewise.
8347 2003-01-09 Bruno Haible <bruno@clisp.org>
8349 * stdbool.h.in: New file.
8351 2003-01-08 Bruno Haible <bruno@clisp.org>
8353 * safe-read.c: Include specification header first, to ensure its
8355 * full-write.c: Likewise.
8357 2003-01-08 Jim Meyering <jim@meyering.net>
8359 * full-write.c: Undefine and define-away `const' after inclusion
8360 of errno.h, not before. Suggestion from Bruno Haible.
8362 2003-01-07 Jim Meyering <jim@meyering.net>
8364 * full-write.c: Rework so that it may serve to define full_read, too.
8365 * full-read.c: Simply #define FULL_READ and include full-write.c.
8367 2003-01-06 Jim Meyering <jim@meyering.net>
8369 * version-etc.c: Update year in translatable copyright string.
8371 2002-12-25 Bruno Haible <bruno@clisp.org>
8373 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8374 * xstrtol.h: Likewise.
8375 * xstrtoimax.c: Likewise.
8376 * xstrtoumax.c: Likewise.
8377 * human.h: Likewise.
8379 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8380 on systems that have <inttypes.h> but not <stdint.h>.
8382 2002-12-31 Paul Eggert <eggert@twinsun.com>
8384 * memcoll.c (memcoll): Fall back on a simple algorithm using
8385 memcmp if strcoll doesn't work.
8387 2002-12-23 Bruno Haible <bruno@clisp.org>
8389 * localcharset.h: New file.
8390 * localcharset.c: Include it.
8391 * unicodeio.c: Likewise.
8393 2002-12-22 Bruno Haible <bruno@clisp.org>
8395 * utime.c (utime_null): No need to call ftruncate if the file was
8398 2002-12-23 Bruno Haible <bruno@clisp.org>
8400 * memcoll.c (STRCOLL): New macro.
8403 2002-12-22 Bruno Haible <bruno@clisp.org>
8405 * getstr.h (getstr): Define, to avoid clash with libcurses.
8406 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8408 2002-12-22 Bruno Haible <bruno@clisp.org>
8410 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8412 2002-12-23 Bruno Haible <bruno@clisp.org>
8414 * getline.h: Include <stddef.h>, for size_t.
8416 * unicodeio.h: Include <stddef.h>, for size_t.
8417 * unicodeio.c: Don't include <stddef.h>.
8419 2002-12-17 Bruno Haible <bruno@clisp.org>
8421 * canon-host.c (strdup): Remove unused declaration.
8423 * fsusage.c: Include full_read.h.
8424 (get_fs_usage): Use full_read instead of safe_read.
8426 * utime.c (utime_null): Use SAFE_READ_ERROR.
8428 2002-12-11 Bruno Haible <bruno@clisp.org>
8430 * setenv.h: Rewritten to cope with systems that have setenv() but not
8432 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8435 2002-12-11 Bruno Haible <bruno@clisp.org>
8437 * setenv.c (alloca): Fall back to malloc.
8439 (setenv): Use freea() to free memory allocated with alloca().
8441 2002-11-13 Bruno Haible <bruno@clisp.org>
8443 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8444 function declarations.
8445 * unsetenv.c (unsetenv): Likewise.
8447 2002-03-04 Bruno Haible <bruno@clisp.org>
8449 Portability to AIX 4.3.3.
8450 * unsetenv.c: New file, extracted from setenv.c.
8451 * setenv.c: Move the unsetenv() function to unsetenv.c.
8453 2001-12-20 Bruno Haible <bruno@clisp.org>
8455 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8456 use malloc instead. For SunOS 4.
8458 2001-12-11 Bruno Haible <bruno@clisp.org>
8460 * setenv.c: Declare alloca.
8461 (compar_fn_t): New typedef.
8462 (KNOWN_VALUE, STORE_VALUE): Use it.
8464 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8467 2002-12-10 Paul Eggert <eggert@twinsun.com>
8469 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8470 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8471 Choose values that are less likely to collide with system fnmatch
8473 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8474 defined (e.g., a pure POSIX system).
8475 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8476 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8478 2002-12-06 Jim Meyering <jim@meyering.net>
8480 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8482 Merge in changes from libc's misc/error.c, in preparation
8483 for the merge of gnulib's changes back into libc.
8485 * error.c (_): Define only if not already defined.
8486 Move definition to follow all #include directives.
8487 Include unlocked-io.h only if !_LIBC.
8488 [_LIBC]: Include <libio/libioP.h>.
8489 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8490 (fflush): Tweak definition to use INTUSE.
8493 2002-12-05 Paul Eggert <eggert@twinsun.com>
8495 * alloca.c [defined emacs]: Include "lisp.h".
8496 (xalloc_die) [defined emacs]: New macro.
8497 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8498 [! defined emacs]: Include <xalloc.h>.
8499 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8500 (pointer): Typedef to POINTER_TYPE *.
8501 (malloc): Remove decl; we now always use xmalloc.
8502 (alloca): Use old-style definition, since Emacs needs this.
8503 Check for arithmetic overflow when computing combined size.
8505 2002-12-04 Paul Eggert <eggert@twinsun.com>
8507 Do not generate unlocked-io.h automatically, since it's easier to
8508 maintain it by hand.
8510 * unlocked-io.h: New file, from GNU diffutils,
8511 but with proper copyright notice and attribution.
8513 * Makefile.am: Add copyright notice.
8514 (libfetish_a_SOURCES): Add unlocked-io.h.
8515 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8516 (DISTCLEANFILES, io_functions): Remove macros.
8517 (EXTRA_DIST): Remove gen_uio.
8518 (unlocked-io.h): Remove rule.
8520 2002-12-04 Jim Meyering <jim@meyering.net>
8522 Reflect the fact that stat.c and lstat.c are no longer generated.
8523 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8524 (DISTCLEANFILES): Likewise.
8525 (EXTRA_DIST): Likewise.
8526 (all_local): Don't depend on stat.c or lstat.c.
8527 (stat.c, lstat.c): Remove rules.
8528 (EXTRA_DIST): Remove xstat.in.
8530 * xstat.in: Remove file. Contents moved into stat.c.
8531 * stat.c: New file. Contents mostly from xstat.in.
8532 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8533 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8535 * safe-read.c: Rework so that it may serve to define safe_write, too.
8536 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8538 2002-12-03 Jim Meyering <jim@meyering.net>
8540 * safe-read.c, safe-write.c: Change variable names and comments, but
8541 not semantics, to minimize the differences between these two files.
8542 (safe_read): Change comment to mention SAFE_READ_ERROR.
8544 * safe-read.c (IS_EINTR): Define.
8545 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8547 2002-12-02 Bruno Haible <bruno@clisp.org>
8549 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8550 Define, taken from safe-read.c.
8551 (INT_MAX): Provide fallback.
8552 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8553 * safe-write.h (SAFE_WRITE_ERROR): Define.
8555 * safe-read.c (EINTR): Remove definition.
8556 (safe_read): Don't use EINTR if it is absent.
8558 2002-12-02 Jim Meyering <jim@meyering.net>
8560 * safe-read.c (EINTR): Define.
8561 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8562 (INT_MAX): Provide fallback.
8563 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8565 * safe-read.h (SAFE_READ_ERROR): Define.
8567 2002-12-01 Jim Meyering <jim@meyering.net>
8569 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8570 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8572 2002-11-27 Paul Eggert <eggert@twinsun.com>
8574 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8575 hash_rehash): Replace `if (limit <= value) abort ();' with
8576 `if (! (value < limit)) abort ();', for readability.
8578 2002-11-26 <karl@gnu.org>
8580 * strdup.c: copy from libc again, with jim's ok.
8581 * .cppi-disable: re-add strdup.c
8583 2002-11-25 <karl@gnu.org>
8585 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8586 instead of "strtol.c".
8588 2002-11-25 Jim Meyering <jim@meyering.net>
8590 * mktime.c: Sync from libc, now that it has the latest fix.
8592 2002-11-24 <karl@gnu.org>
8594 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8595 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8597 2002-11-24 Jim Meyering <jim@meyering.net>
8599 Update from coreutils:
8601 * mktime.c: Merge in changes from libc.
8603 Avoid a link-time failure on some Linux systems.
8604 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8605 (__mon_yday): Declare with the STATIC attribute.
8606 (__mktime_internal): Likewise.
8607 Based on a report from Greg Schafer.
8609 2002-11-23 Jim Meyering <jim@meyering.net>
8611 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8612 Use `unsigned', not `int', as type of index.
8614 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8616 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8618 2002-11-22 Paul Eggert <eggert@twinsun.com>
8620 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8621 hint that one should use `if (! x) abort ();' rather than `assert
8622 (x);', and anyway it's one less thing to worry about configuring.
8623 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8624 hash_rehash, hash_insert): Use abort rather than assert.
8626 2002-11-22 Paul Eggert <eggert@twinsun.com>
8628 * quotearg.h: Allow multiple inclusion by surrounding with
8629 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8630 so that we can be included first.
8631 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8632 * quotearg.c: Include quotearg.h immediately after config.h.
8633 No need to include stddef.h or sys/types.h any more.
8634 Surround local include files with "", not "<>".
8635 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8636 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8637 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8638 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8639 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8640 (ISPRINT): Remove; no longer needed now that we assume C89.
8642 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8645 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8646 quotearg_char): Use SIZE_MAX rather than
8647 (size_t) -1 when we are talking about "infinity".
8649 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8651 2002-11-22 Bruno Haible <bruno@clisp.org>
8653 * safe-read.h: Assume C89. Add comments.
8654 (safe_read): Change return type to size_t.
8655 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8656 counts > SSIZE_MAX correctly.
8657 * safe-write.h: New file.
8658 * safe-write.c: New file.
8659 * full-read.h: New file.
8660 * full-read.c: New file.
8661 * full-write.h: Assume C89. Add comments.
8662 * full-write.c: Include safe-write.h.
8663 (full_write): Rewritten to use safe_write.
8664 Suggested by Jim Meyering and Paul Eggert.
8666 2002-11-21 Bruno Haible <bruno@clisp.org>
8668 Remove case insensitive option matching.
8669 * argmatch.h (argcasematch): Remove declaration.
8670 (ARGCASEMATCH): Remove macro.
8671 (__xargmatch_internal): Remove case_sensitive argument.
8672 (XARGMATCH): Update.
8673 (XARGCASEMATCH): Remove macro.
8674 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8675 case_sensitive argument.
8676 (argcasematch): Remove function.
8677 (__xargmatch_internal): Remove case_sensitive argument.
8678 (main): Use XARGMATCH instead of XARGCASEMATCH.
8680 * xmalloc.c: Change compile-time error message. Add comment about
8681 required autoconf version.
8683 2002-11-21 Jim Meyering <jim@meyering.net>
8685 * strdup.c (strdup): Tweak comment and initial #if/#include.
8687 Merge in changes from the coreutils.
8689 2002-09-25 Paul Eggert <eggert@twinsun.com>
8690 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8691 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8692 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8693 int. Work more efficiently if X is the same width as uintmax_t.
8694 Do not compare X to -1, to avoid bogus compiler warning.
8695 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8696 Don't assume that f_frsize and f_bsize are the same type.
8698 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8701 * makepath.c (make_path): Restore umask *before* creating the final
8703 (make_path): Minor reformatting.
8705 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8706 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8708 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8709 ones. At least on GNU/Linux systems, `auto' means something else.
8712 2002-11-20 Paul Eggert <eggert@twinsun.com>
8714 Merge argmatch cleanups from Bison. Assume C89.
8716 * argmatch.c: Include config.h here, not in argmatch.h.
8717 Include stdlib.h, for EXIT_FAILURE.
8718 Always include <string.h>, since we assume C89.
8719 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8720 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8721 Include <stddef.h> instead, since it's all we need for size_t.
8722 (PARAMS): Remove. All uses removed.
8723 (ARRAY_CARDINALITY): Do not bother to #undef.
8724 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8725 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8726 Remove unnecessary parentheses.
8727 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8728 Insert necessary parentheses.
8729 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8730 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8732 2002-11-19 Bruno Haible <bruno@clisp.org>
8734 * mbswidth.c: Include mbswidth.h right at the beginning.
8735 * mbswidth.h: Include <stddef.h>, for size_t.
8737 * mbswidth.h (PARAMS): Remove macro.
8738 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8739 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8741 * gcd.h (PARAMS): Remove macro.
8742 (gcd): Use ANSI C function declarations.
8743 * gcd.c (gcd): Likewise.
8745 2002-11-15 Bruno Haible <bruno@clisp.org>
8747 * strcspn.c: Include <stddef.h>.
8748 (strcspn): Use ANSI C function declaration. Change return type to
8750 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8751 (strpbrk): Use NULL.
8752 * strpbrk.h (PARAMS): Remove macro.
8753 (strpbrk): Use ANSI C function declaration.
8754 * strstr.c: Don't include <sys/types.h>.
8755 * strstr.h (PARAMS): Remove macro.
8756 (strstr): Use ANSI C function declarations.
8758 2002-11-06 Bruno Haible <bruno@clisp.org>
8760 * gcd.h (gcd): Change argument type to 'unsigned long'.
8761 * gcd.c (gcd): Likewise.
8763 2002-11-05 Bruno Haible <bruno@clisp.org>
8765 * gcd.h: New file, from gettext-0.11.5.
8766 * gcd.c: New file, from gettext-0.11.5.
8768 2002-11-05 Bruno Haible <bruno@clisp.org>
8770 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8771 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8772 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8773 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8775 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8776 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8778 * closeout.c: Include gettext.h instead of <libintl.h>.
8779 * human.c: Include gettext.h instead of <libintl.h>.
8780 * quotearg.c: Include gettext.h instead of <libintl.h>.
8781 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8782 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8783 * userspec.c: Include gettext.h instead of <libintl.h>.
8784 * version-etc.c: Include gettext.h instead of <libintl.h>.
8785 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8786 (textdomain): Remove definition.
8787 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8789 * long-options.c: Remove include of <libintl.h> and definition of _.
8790 * same.c: Remove include of <libintl.h> and definition of _.
8792 2002-11-04 Bruno Haible <bruno@clisp.org>
8794 * stpcpy.h: New file, from GNU gettext-0.11.5.
8795 * strcase.h: New file, from GNU gettext-0.11.5.
8796 * strpbrk.h: New file, from GNU gettext-0.11.5.
8797 * strstr.h: New file, from GNU gettext-0.11.5.
8798 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8800 2002-05-09 Bruno Haible <bruno@clisp.org>
8802 * config.charset: Update for newest glibc. Add canonical names
8803 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8805 2002-05-09 Bruno Haible <bruno@clisp.org>
8807 * localcharset.c (get_charset_aliases): Add more Windows specific
8810 2002-05-08 Owen Taylor <otaylor@redhat.com>
8812 * config.charset: A few additions for Solaris.
8814 2001-12-05 Bruno Haible <bruno@clisp.org>
8816 * localcharset.c (locale_charset): Don't return an empty string.
8818 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8820 * config.charset: msdos in uk_UA uses CP1125.
8822 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8824 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8825 * localcharset.c (locale_charset): Declare as extern "C".
8827 2002-02-15 Bruno Haible <bruno@clisp.org>
8829 * config.charset [msdosdjgpp]: For Russian, use CP866.
8831 2002-02-11 Bruno Haible <bruno@clisp.org>
8833 * config.charset: Add support for NetBSD.
8835 2002-09-25 <karl@gnu.org>
8837 * strdup.c: copy from libc/string (via ../config/srclist*).
8838 * getopt*: copy from libc/posix.
8839 * gettext.h: copy from gettext.
8840 * .cppi-disable: add strdup.c, gettext.h.
8842 2002-07-01 Jim Meyering <meyering@lucent.com>
8844 * c-stack.c: Include sys/time.h.
8845 From Volker Borchert.
8847 2002-06-11 Paul Eggert <eggert@twinsun.com>
8849 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8850 New macro. Use it uniformly instead of
8851 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8852 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8853 reported by Vin Shelton.
8855 2002-06-22 Jim Meyering <meyering@lucent.com>
8857 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8858 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8860 2002-06-22 Paul Eggert <eggert@twinsun.com>
8862 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8863 Do not assume SA_SIGINFO behavior.
8864 Bug reported by Jim Meyering on NetBSD 1.5.2.
8866 2002-06-22 Jim Meyering <meyering@lucent.com>
8868 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8870 * exitfail.c, exitfail.h: Likewise.
8871 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8873 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8875 (EXTRA_DIST): Add fnmatch_loop.c.
8876 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8878 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8879 * fnmatch.c: Update from diffutils-2.8.2.
8880 * fnmatch_.h: New file. From diffutils-2.8.2.
8881 * fnmatch.h: Remove file.
8883 2002-06-18 Paul Eggert <eggert@twinsun.com>
8885 * file-type.h: Report an error if neither S_ISREG nor
8886 S_IFREG is defined, instead of using a test specific to glibc
8887 2.2. This should be safe, since POSIX requires S_ISREG and
8888 Unix Version 7 had S_IFREG. We don't need to check for
8889 <sys/types.h> since we don't use any symbols that it defines.
8891 2002-06-15 Jim Meyering <meyering@lucent.com>
8893 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8894 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8895 have been included before this file.
8897 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8899 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8900 so that each temporary file name is unique and valid in the first
8901 8 characters, for operation under DOS.
8903 2002-06-15 Jim Meyering <meyering@lucent.com>
8905 Work even with DJGPP 2.03, which lacks support for symlinks.
8907 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8909 * lchown.c (S_ISLNK): Likewise.
8911 2002-06-14 Jim Meyering <meyering@lucent.com>
8913 * file-type.h: Use the version from diffutils-2.8.2.
8914 * file-type.c: Likewise.
8916 2002-05-27 Jim Meyering <meyering@lucent.com>
8918 Fix a problem seen only on nonconforming systems whereby ls.c's
8919 use of localtime, and then of gettimeofday would cause trouble:
8920 the localtime call used to initialize rpl_gettimeofday's save
8921 mechanism would clobber ls's current local time information so
8922 that in any long listing the first file would always be listed
8923 with date 1970-01-01. Analysis by Volker Borchert.
8925 * gettimeofday.c (localtime): Undefine.
8926 (rpl_localtime): New function.
8928 2002-05-22 Jim Meyering <meyering@lucent.com>
8930 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8931 * file-type.h: New file.
8932 * file-type.c (file_type): New file/function. Extracted from diffutils.
8934 2002-04-29 Paul Eggert <eggert@twinsun.com>
8936 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8938 2002-04-28 Paul Eggert <eggert@twinsun.com>
8940 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8941 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8942 of 127, since 64 is the largest conceivable number for ancient
8944 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8946 2002-04-28 Jim Meyering <meyering@lucent.com>
8948 * sig2str.c (WTERMSIG): Remove definition (unused).
8950 2002-04-28 Paul Eggert <eggert@twinsun.com>
8952 * sig2str.h, sig2str.c: New files.
8953 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8955 2002-04-24 Jim Meyering <meyering@lucent.com>
8957 * gettext.h: New file, from Gettext.
8958 * Makefile.am (INCLUDES): Remove -I../intl.
8959 (libfetish_a_SOURCES): Add gettext.h.
8961 2002-04-16 Jim Meyering <meyering@lucent.com>
8963 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8964 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8965 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8967 2002-04-12 Jim Meyering <meyering@lucent.com>
8969 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8971 2002-03-10 Jim Meyering <meyering@lucent.com>
8973 * makepath.c (make_path): Remove a comma from a diagnostic.
8974 Suggestion from Santiago Vila.
8976 2002-03-08 Jim Meyering <meyering@lucent.com>
8978 * rename.c: Mention that this wrapper is needed also on
8979 mips-dec-ultrix4.4 systems.
8981 2002-03-02 Jim Meyering <meyering@lucent.com>
8983 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8984 not HAVE_CLOCK_SETTIME.
8986 2002-02-27 Paul Eggert <eggert@twinsun.com>
8988 * nanosleep.h: Rename to....
8989 * timespec.h: New name for nanosleep.h. All uses changed.
8991 * gettime.c: New file.
8992 * settime.c: New file.
8995 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8996 timespec.h. Remove nanosleep.h.
8998 2002-02-25 Paul Eggert <eggert@twinsun.com>
9000 * acl.c, acl.h: New files.
9001 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9003 2002-02-24 Jim Meyering <meyering@lucent.com>
9005 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9006 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9007 cause trouble. Reported by Nelson Beebe.
9009 2002-02-23 Paul Eggert <eggert@twinsun.com>
9011 * path-concat.c (xpath_concat): Reorder code to pacify
9012 compilers that don't know that xalloc_die never returns.
9014 2002-02-20 Jim Meyering <meyering@lucent.com>
9016 * getdate.c: Regenerate using bison-1.33.
9018 2002-02-15 Paul Eggert <eggert@twinsun.com>
9020 * posixver.c, posixver.h: New files.
9021 * Makefile.am (libfetish_a_SOURCES): Add them.
9023 2002-02-02 Paul Eggert <eggert@twinsun.com>
9024 Bruno Haible <bruno@clisp.org>
9026 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9027 (fwrite_success_callback): New declaration.
9028 * unicodeio.c (unicode_to_mb): New function, extracted from
9029 print_unicode_char. Call failure callback instead of error.
9030 (fwrite_success_callback): New function.
9031 (exit_failure_callback): New function.
9032 (fallback_failure_callback): New function.
9033 (print_unicode_char): Call unicode_to_mb.
9035 2002-01-26 Jim Meyering <meyering@lucent.com>
9037 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9039 2002-01-22 Jim Meyering <meyering@lucent.com>
9041 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9042 Otherwise, some versions of automake would omit the rule that makes
9043 Makefile from Makefile.in.
9045 2001-01-21 Paul Eggert <eggert@twinsun.com>
9047 * xmemcoll.h, xmemcoll.c: New files.
9048 * Makefile.am (libfetish_a_SOURCES): Add them.
9049 * memcoll.c: Include errno.h, and declare errno if not defined.
9050 (memcoll): Set errno to zero if there is no error.
9052 * quotearg.c (quotearg_buffer_restyled):
9053 Fix bug with quoting buffers containing NUL when backslashing escapes.
9054 This bug was exposed by the other changes in this patch.
9055 (quotearg_n_options): New arg ARGSIZE.
9056 All callers changed.
9057 (quoting_options_from_style): New function.
9058 (quotearg_n_style): Use it.
9059 (quotearg_n_style_mem): New function.
9061 * quotearg.h (quotearg_n_style_mem): New function.
9063 2002-01-16 Jim Meyering <meyering@lucent.com>
9065 * getdate.y: Add three semicolons, each just before a closing brace.
9066 Bison (as of version 1.31) no longer papers over that mistake.
9068 2002-02-14 Paul Eggert <eggert@twinsun.com>
9070 * backupfile.c (ISDIGIT): Comment fix.
9071 * getdate.y (ISDIGIT): Likewise.
9072 * posixtm.c (ISDIGIT, year): Likewise.
9073 * strverscmp.c (ISDIGIT): Likewise.
9074 * userspec.c (ISDIGIT): Likewise.
9076 2002-01-05 Jim Meyering <meyering@lucent.com>
9078 * version-etc.c (version_etc_copyright): Update copyright year.
9080 2001-01-19 Paul Eggert <eggert@twinsun.com>
9082 * closeout.c (close_stdout_status): If ferror (stdout), do
9083 not silently exit merely because the output buffer happens to
9084 have nothing pending.
9086 2001-12-18 Paul Eggert <eggert@twinsun.com>
9088 See the big note in ../ChangeLog.
9089 * human.c (suffixes): Prefer K to k for 1024.
9090 (generate_suffix_backwards): New function.
9091 (human_readable_inexact): Use it.
9092 * xstrtol.c (__xstrtol): If there is no number but there
9093 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9094 Accept 'K' as well as 'k'.
9096 2001-12-15 Jim Meyering <meyering@lucent.com>
9098 * regex.h (__restrict_arr): Update from libc.
9100 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9101 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9104 2001-12-10 Jim Meyering <meyering@lucent.com>
9106 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9107 Instead, include "xalloc.h".
9108 (initbuffer): Don't cast xmalloc return value to char*.
9109 (readline): Reword comment.
9110 Don't cast xrealloc return value to char*
9113 2001-12-09 Jim Meyering <meyering@lucent.com>
9115 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9116 `signed and unsigned type in conditional expression'.
9117 * posixtm.c (posix_time_parse): Likewise.
9119 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9121 * readtokens.c (readtoken): Declare an index to be of type unsigned
9122 to avoid a pedantic warning.
9124 * getstr.c: Don't include assert.h.
9125 (getstr): Remove warning-evoking assertions.
9126 Return -1 if offset parameter is out of bounds.
9127 Change the type of a local from int to size_t.
9129 * strftime.c (my_strftime_localtime_r): Include this function
9130 definition in the `#if ! HAVE_TM_GMTOFF' block.
9132 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9133 Include xalloc.h instead.
9135 2001-12-02 Jim Meyering <meyering@lucent.com>
9137 * tempname.c: Don't declare getenv, thus reverting the change of
9138 2001-11-18. It's no longer necessary, now that stdlib.h is always
9141 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9142 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9144 2001-11-30 Akim Demaille <akim@epita.fr>
9146 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9147 before being defined.
9149 2001-11-27 Paul Eggert <eggert@twinsun.com>
9151 * quotearg.h (quotearg_n, quotearg_n_style):
9152 First arg is int, not unsigned.
9153 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9154 (SIZE_MAX, UINT_MAX): New macros.
9155 (quotearg_n_options): Abort if N is negative.
9156 Avoid overflow check on hosts where size_t is 64 bits and int
9157 is 32 bits, as overflow is impossible there.
9158 Fix off-by-one typo that caused unnecessary reallocation.
9160 2001-11-27 Jim Meyering <meyering@lucent.com>
9162 * tempname.c: Merge with version from libc.
9163 * regex.c: Likewise.
9165 * tempname.c: Include stdlib.h unconditionally. On some old systems
9166 for which STDC_HEADERS is 0, it was not included, resulting in a
9167 warning about an integer-to-pointer conversion problem with getenv.
9168 Reported by Volker Borchert.
9170 2001-11-26 Jim Meyering <meyering@lucent.com>
9172 * gtod.h: Remove file.
9173 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9174 * gettimeofday.c: Don't include gtod.h.
9175 (GTOD_init): Remove function.
9176 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9177 Suggestion from Volker Borchert.
9179 2001-11-23 Jim Meyering <meyering@lucent.com>
9181 * hash.h (struct hash_table): Don't define here. Merely declare it.
9182 * hash.c (struct hash_table): Define it here instead.
9184 2001-11-22 Jim Meyering <meyering@lucent.com>
9186 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9188 2001-11-18 Paul Eggert <eggert@twinsun.com>
9190 * tempname.c (TMP_MAX): Remove; no longer needed.
9191 (TEMPORARIES): New macro.
9192 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9193 removes an artificial limitation (e.g. HP-UX 10.20, where
9196 2001-11-18 Jim Meyering <meyering@lucent.com>
9198 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9201 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9202 files will be created before anything else.
9204 2001-11-17 Jim Meyering <meyering@lucent.com>
9206 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9207 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9208 rather than group writable. Patch by Juan F. Codagnone.
9210 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9211 Instead, include "xalloc.h".
9213 * mountlist.c: Include unlocked-io.h after all system headers.
9214 Remove explicit declarations of xmalloc, xrealloc,
9215 and xstrdup. Instead, include "xalloc.h".
9217 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9218 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9219 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9221 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9222 Reported by Padraig Brady.
9224 * mkstemp.c: #undef mkstemp.
9226 (rpl_mkstemp): Rename from mkstemp.
9229 2001-11-16 Jim Meyering <meyering@lucent.com>
9231 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9232 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9233 determine the amount of total physical memory, use pstat_getstatic.
9234 HPUX-11 doesn't define _SC_PHYS_PAGES.
9235 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9236 If sysconf couldn't be used to determine the amount of available
9237 physical memory, use both pstat_getstatic and pstat_getdynamic.
9238 Based on a patch from Bob Proulx.
9240 2001-11-05 Jim Meyering <meyering@lucent.com>
9242 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9244 2001-11-03 Jim Meyering <meyering@lucent.com>
9246 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9247 in argmatch_to_argument call.
9249 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9252 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9253 e.g., a fault due to an attempt to free a NULL pointer.
9255 2001-11-01 Jim Meyering <meyering@lucent.com>
9257 * dirfd.c, dirfd.h: New files.
9258 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9260 * hash.c (hash_print) [TESTING]: Clean up.
9262 2001-10-22 Paul Eggert <eggert@twinsun.com>
9264 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9265 to avoid a warning if -Wall.
9267 2001-10-21 Paul Eggert <eggert@twinsun.com>
9269 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9271 2001-10-21 Jim Meyering <meyering@lucent.com>
9273 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9274 this code would end up calling gettext even in packages built
9276 * getopt.c (_): Likewise.
9277 * regex.c (_): Likewise.
9279 2001-10-20 Paul Eggert <eggert@twinsun.com>
9281 * error.c (strerror_r): Do not declare unless !_LIBC.
9282 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9283 Use strerror_r that is only a macro, even if it is not a function.
9284 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9285 (private_strerror): Use prototypes, not old-style function definition.
9286 (print_errno_message): New function.
9287 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9289 (error_tail, error, error_at_line): Use it.
9291 2001-10-11 Jim Meyering <meyering@lucent.com>
9293 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9294 and quote_n (1, ... to avoid clobbering a buffer.
9296 2001-10-05 Jim Meyering <meyering@lucent.com>
9298 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9299 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9300 * hash-pjw.h: New file.
9302 2001-09-30 Jim Meyering <meyering@lucent.com>
9304 * mountlist.c [MOUNTED_GETFSSTAT]:
9305 Include <sys/ucred.h>, for Apple Darwin.
9306 Include sys/mount.h and sys/fs_types.h only if available.
9308 (read_filesystem_list): Use FS_TYPE.
9310 2001-09-29 Paul Eggert <eggert@twinsun.com>
9312 * exclude.c (excluded_filename): 0 -> false, since it's
9315 2001-09-28 Paul Eggert <eggert@twinsun.com>
9317 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9318 #defines strtoimax. Also treat the other strto* functions
9321 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9322 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9323 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9325 2001-09-26 Jim Meyering <meyering@lucent.com>
9327 Most macros in unlocked-io.h had the wrong number of arguments.
9328 * gen-uio: New script.
9329 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9330 * unlocked-io.hin: Remove file.
9331 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9332 rather than trying to embed it here.
9333 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9334 Reported by Padraig Brady.
9336 2001-09-25 Volker Borchert <bt@teknon.de>
9338 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9340 2001-09-23 Jim Meyering <meyering@lucent.com>
9342 * mountlist.c: Remove useless parentheses in #if directives.
9343 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9344 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9346 2001-09-22 Jim Meyering <meyering@lucent.com>
9348 * localcharset.c: Update from latest gettext.
9349 * config.charset: Likewise.
9351 2001-09-20 Jim Meyering <meyering@lucent.com>
9353 * xstrtol.c (strtoimax): Guard declaration with
9354 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9355 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9356 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9357 (strtoumax): Likewise, for completeness (it wasn't necessary).
9359 2001-09-06 Paul Eggert <eggert@twinsun.com>
9361 * strtoimax.c (HAVE_LONG_LONG):
9362 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9363 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9364 to work around bug in IBM C compiler.
9366 2001-09-16 Jim Meyering <meyering@lucent.com>
9368 * mkdir.c: New file.
9370 2001-09-04 Paul Eggert <eggert@twinsun.com>
9372 * xgetcwd.c: Revert some of the previous change; intead,
9373 fix the HAVE_GETCWD_NULL code to behave more like the
9374 !HAVE_GETCWD_NULL code used to.
9377 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9380 2001-09-04 Paul Eggert <eggert@twinsun.com>
9382 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9383 Use ssize_t, not int, to store result of readlink.
9384 Check for ssize_t overflow as well as size_t overflow,
9385 as POSIX says the result of readlink is implementation-defined
9386 when ssize_t overflows.
9387 Remove unnecessary cast to char*.
9388 Use free+malloc instead of realloc, as the storage doesn't need
9389 to be preserved and it's clearer and can be more efficient that way.
9390 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9391 * xreadlink.h (xreadlink): Update prototype.
9393 2001-09-03 Paul Eggert <eggert@twinsun.com>
9395 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9396 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9397 spotted by Jim Meyering.
9399 2001-09-03 Jim Meyering <meyering@lucent.com>
9401 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9403 2001-09-03 Paul Eggert <eggert@twinsun.com>
9405 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9406 like the HAVE_GETCWD_NULL code.
9407 Include pathmax.h if not HAVE_GETCWD.
9408 Do not include xalloc.h.
9409 (INITIAL_BUFFER_SIZE): New symbol.
9410 Do not use xmalloc / xrealloc, since the caller is responsible for
9411 handling errors. Preserve errno around `free' during failure.
9412 Do not overrun buffer when using getwd.
9414 2001-09-03 Paul Eggert <eggert@twinsun.com>
9416 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9417 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9419 2001-09-02 Jim Meyering <meyering@lucent.com>
9421 * error.c: Update from GNU libc.
9423 2001-09-01 Jim Meyering <meyering@lucent.com>
9425 * xreadlink.c: New file.
9426 * xreadlink.h: New file.
9427 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9429 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9430 doesn't conflict with sparc Solaris 7's definition in
9431 /usr/include/sys/int_types.h.
9433 * exclude.c: Use `""', not `<>' to #include non-system header files.
9434 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9435 and strncasecmp as r-values. Unixware didn't have declarations.
9437 2001-08-31 Jim Meyering <meyering@lucent.com>
9439 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9440 Use an initial, malloc'd, buffer of length 128 rather than
9441 a statically allocated one of length 1024.
9443 2001-08-30 Paul Eggert <eggert@twinsun.com>
9445 * xgetcwd.c: Don't include pathmax.h.
9446 Include stdlib.h and unistd.h if available.
9448 (xmalloc, xstrdup, free): Remove decls.
9449 (xgetcwd): Don't assume sizes fit in unsigned.
9450 Check for overflow when computing sizes.
9451 Simplify reallocation code.
9453 2001-08-28 Paul Eggert <eggert@twinsun.com>
9455 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9457 * strtoimax.c: Renamed from strtoxmax.c, removing the
9460 Also, make the following further changes to make this file's
9461 configuration more similar to that of strtol.c:
9462 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9463 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9464 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9465 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9466 changed to signed values.
9468 And make the following changes as well:
9469 Fix copyright notice, as 1999 was missing.
9470 (verify): New macro.
9471 (strtoimax): Check sizes at compile-time, not run-time.
9472 Prefer strtol to strtoll if both work.
9473 (main): Remove; it was not that useful and was a pain to maintain.
9475 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9477 2001-08-30 Paul Eggert <eggert@twinsun.com>
9479 * savedir.c (savedir): Remove size parameter, as POSIX says that
9480 a directory's st_size can have an arbitrary value, so the old
9481 usage could waste an arbitrary amount of memory. All uses
9483 * savedir.h: Update prototype.
9485 2001-08-30 Paul Eggert <eggert@twinsun.com>
9487 * xstrtol.c (strtoimax): New decl.
9489 2001-08-28 Paul Eggert <eggert@twinsun.com>
9491 * xstrtol.h: Add copyright notice.
9492 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9493 LONGINT_INVALID_SUFFIX_CHAR.
9495 2001-08-30 Paul Eggert <eggert@twinsun.com>
9497 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9500 2001-08-30 Paul Eggert <eggert@twinsun.com>
9502 * hash.c: Remove '2001' from copyright notice.
9504 2001-08-30 Paul Eggert <eggert@twinsun.com>
9506 * full-write.h: New file.
9507 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9508 * full-write.c: Correct credits, as cccp.c no longer
9509 exists and anyway it was so heavily changed from the old cccp
9510 code as to be unrecognizable. Include full-write.h.
9511 (full_write) Return size_t, with short writes meaning failure.
9512 All callers changed. This fixes a bug with large buffers
9514 * utime.c: Include full-write.h.
9516 2001-08-30 Paul Eggert <eggert@twinsun.com>
9518 Merge 'exclude' changes from tar 1.13.22.
9519 This fixes one or two unlikely storage allocation overflow bugs,
9520 but doesn't change user-visible behavior otherwise.
9522 2001-08-30 Paul Eggert <eggert@twinsun.com>
9524 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9525 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9526 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9527 Include if available.
9528 (<xalloc.h>): Include
9529 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9530 (verify): New macro. Use it to verify that EXCLUDE macros do not
9531 collide with FNM macros.
9532 (struct patopts): New struct.
9533 (struct exclude): Use it, as exclude patterns now come with options.
9534 (new_exclude): Support above changes.
9535 (new_exclude, add_exclude_file):
9536 Initial size must now be a power of two to simplify overflow checking.
9537 (free_exclude, fnmatch_no_wildcards): New function.
9538 (excluded_filename): No longer requires options arg, as the options
9539 are determined by add_exclude. Now returns bool, not int.
9540 (excluded_filename, add_exclude):
9541 Add support for the fancy new exclusion options.
9542 (add_exclude, add_exclude_file): Now takes int options arg.
9543 Check for arithmetic overflow when computing sizes.
9544 (add_exclude_file): xrealloc might modify errno, so don't
9545 realloc until after errno might be used.
9547 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9549 (free_exclude): New decl.
9550 (add_exclude, add_exclude_file): Now takes int options arg.
9551 (excluded_filename): No longer requires options arg, as the options
9552 are determined by add_exclude. Now returns bool, not int.
9554 2001-08-30 Paul Eggert <eggert@twinsun.com>
9556 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9558 2001-08-27 Jim Meyering <meyering@lucent.com>
9560 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9562 * version-etc.c (N_): Remove definition.
9563 Revert most of last change.
9564 Instead, simply don't mark the `Copyright...' string for translation.
9565 Based on advice from Paul Eggert.
9567 * strtoxmax.c: Tweak comment.
9569 2001-08-26 Jim Meyering <meyering@lucent.com>
9571 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9572 of copyright with `%s' so translators don't get an untranslated
9574 (COPYRIGHT_YEAR): Define.
9575 (version_etc): Use fprintf rather than fputs.
9576 Suggestion from Ulrich Drepper.
9578 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9580 * strtoll.c: New file, from GNU libc.
9581 * xstrtoimax.c: New file.
9583 * xstrtol.h: Add xstrtoimax.
9584 * strtoumax.c: New file. Simply include "strtoumax.c".
9585 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9587 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9588 * strtoxmax.c: ... then renamed to this.
9590 2001-08-13 Paul Eggert <eggert@twinsun.com>
9592 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9593 Port to Solaris 8, where 'sed' requires a space after the 'r'
9594 command, and where sh dislikes "$/". Clean up the spacing a bit.
9595 Redirect output to $tmp just once.
9597 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9599 * addext.c (<errno.h>): Include.
9600 (errno): Declare if not defined.
9601 (addext): Work correctly when pathconf returns -1 and leaves
9602 errno alone because there is no limit. Also, work even if
9603 pathconf returns a value greater than SIZE_MAX.
9605 2001-08-12 Jim Meyering <meyering@lucent.com>
9607 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9608 Simply `return getcwd (NULL, 0);'.
9609 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9610 Use 1300 as initial value for length, not PATH_MAX.
9612 * pathmax.h: Clean up cpp syntax.
9614 2001-08-12 Jim Meyering <meyering@lucent.com>
9616 * gettimeofday.c: New file.
9618 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9620 2001-08-04 Jim Meyering <meyering@lucent.com>
9622 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9623 to get in sync with glibc.
9625 2001-08-03 Paul Eggert <eggert@twinsun.com>
9627 The following changes are from gettext 0.10.39 as maintained by
9630 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9631 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9632 with inverted sense. All uses changed.
9634 * mbswidth.c: Don't include <limits.h>.
9635 Include <stdlib.h> and <string.h> unconditionally.
9636 (iswcntrl, mbsinit, ISCNTRL): New macros.
9637 (mbsnwidth): Use K&R style function declarations.
9638 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9639 can optimize it when MB_CUR_MAX == 1.
9640 The width of control characters is zero, not 1.
9642 2001-07-15 Jim Meyering <meyering@lucent.com>
9644 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9645 (BUILT_SOURCES): Add unlocked-io.h.
9646 (io_functions): Define.
9647 (unlocked-io.h): New rule.
9648 (DISTCLEANFILES): Add unlocked-io.h.
9649 (all-local): Depend on unlocked-io.h, to ensure it is created.
9651 * unlocked-io.hin: New file
9653 * regex.c: Update from glibc.
9655 2001-07-05 Jim Meyering <meyering@lucent.com>
9657 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9659 (libfetish_a_SOURCES): Put all .h files here instead.
9660 Remove a thus-exposed (better checks in automake) duplicate and
9661 two unnecessary .h files.
9663 2001-06-11 Jim Meyering <meyering@lucent.com>
9665 * regex.c: Update from GNU libc.
9667 2001-05-27 Jim Meyering <meyering@lucent.com>
9669 * readutmp.h (UT_TYPE): Define.
9671 2001-05-24 Jim Meyering <meyering@lucent.com>
9673 * argmatch.c: Include "quote.h".
9674 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9675 quote function. Reported by Göran Uddeborg.
9677 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9679 * dirname.c (dir_name): Compute append_dot using path, not newpath
9680 which is not yet declared.
9682 2001-05-11 Paul Eggert <eggert@twinsun.com>
9684 * Makefile.am (libfetish_a_SOURCES):
9685 Add strftime.c, since we now compile it on all hosts.
9687 * strftime.c (my_strftime):
9688 Define to nstrftime if emacs, but only if my_strftime is not defined.
9689 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9690 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9691 Add one more extra argument: a nanoseconds value.
9694 (my_strftime function): Add %N format.
9695 (emacs_strftimeu): Renamed from emacs_strftime,
9696 with extra ut argument.
9698 2001-05-11 Paul Eggert <eggert@twinsun.com>
9700 dirname code cleanup. base_name now behaves more compatibly
9701 with POSIX basename when given file names that have trailing
9702 slashes, and similarly for dir_name. Add new primitives
9703 base_len and dir_len. Put the directory-name-related decls
9706 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9707 * backupfile.c (base_name): Likewise.
9708 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9709 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9710 * makepath.c (strip_trailing_slashes): Likewise.
9711 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9713 * rename.c (strip_trailing_slashes): Likewise.
9714 * same.c (base_name): Likewise.
9715 * stripslash.c (ISSLASH): Likewise.
9717 * addext.c: Include <dirname.h> after size_t is defined.
9718 * backupfile.c: Likewise.
9720 * addext.c (addext): Use base_len to trim redundant
9721 trailing slashes instead of doing it ourselves.
9722 But do not trim the last slash if it is not redundant.
9724 * backupfile.c (find_backup_file_name,
9725 max_backup_version): Use base_len instead of rolling it ourselves.
9726 Handle the case of "" and (on DOS) "C:" correctly.
9728 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9729 Include <string.h>, <dirname.h>.
9730 (base_name): Allow file names ending in slashes, other than names
9731 that are all slashes. In this case, return the basename followed
9732 by the slashes. This is more general, and can be used in places
9733 where the original base_name purposely had an assertion failure.
9734 (base_len): New function.
9736 * dirname.c: Include <string.h> instead of <stdlib.h>.
9737 Do not include <assert.h>; no longer needed.
9739 (memrchr): Remove decl.
9740 (dir_name_r): Remove.
9741 (dir_len): Renamed from dirlen. All callers changed.
9742 Rewrite in terms of base_name, for simplicity and consistency.
9743 (dir_name): Never return NULL. All callers changed.
9744 Do not include <stdlib.h> in test program; no longer needed.
9745 return 0; is fine for test program.
9747 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9749 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9751 * path-concat.c (path_concat): Use base_len to compute
9752 base length, not strlen; this means we cannot rely on memcpy
9755 * same.c (STREQ): Remove.
9756 (same_name): Handle the case where the basename ends in trailing '/'.
9758 * stripslash.c (strip_trailing_slashes): Return nonzero if
9759 a slash was stripped. Do not strip the last slash after a
9762 2001-04-08 Jim Meyering <meyering@lucent.com>
9764 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9765 recomputed; that's necessary when the offset spans a DST transition.
9766 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9768 2001-04-02 Jim Meyering <meyering@lucent.com>
9770 * regex.h, regex.c: Update from GNU libc.
9772 2001-03-19 Paul Eggert <eggert@twinsun.com>
9774 * version-etc.c (version_etc_copyright): Update to 2001.
9776 2001-03-16 Paul Eggert <eggert@twinsun.com>
9778 * tempname.c (uint64_t): Define to uintmax_t if
9779 not defined, and if UINT64_MAX is not defined.
9780 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9781 Reported by John David Anglin.
9783 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9785 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9786 alias if codeset is empty.
9787 * config.charset (BeOS): Use wildcard syntax.
9789 2001-03-13 Jim Meyering <meyering@lucent.com>
9791 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9792 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9795 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9797 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9799 * unicodeio.c (print_unicode_char): Simplify accordingly.
9801 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9803 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9804 support for DOS/DJGPP.
9806 2001-02-28 Paul Eggert <eggert@twinsun.com>
9808 * Makefile.am (libfetish_a_SOURCES):
9809 Add dup-safer.c, fopen-safer.c.
9810 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9812 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9814 2001-02-25 Paul Eggert <eggert@twinsun.com>
9816 The mkstemp replacement is taken from glibc 2.2.2, with some
9817 portability fixes for use outside glibc, as follows:
9819 * tempname.c (struct_stat64): New macro.
9820 (direxists, __gen_tempname): Use it.
9821 This avoids a portability problem with Solaris 8.
9823 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9824 (<stddef.h>, <stdint.h>, <string.h>):
9825 Include only if STDC_HEADERS || _LIBC.
9826 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9827 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9828 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9829 (__set_errno): Define this macro if <errno.h> doesn't.
9830 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9831 Define these macros if <stdio.h> doesn't.
9832 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9833 Define these macros if <sys/stat.h>
9834 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9835 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9836 __xstat64): Define if not _LIBC.
9837 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9838 (__gen_tempname): Invoke gettimeofday only if
9839 HAVE_GETTIMEOFDAY || _LIBC;
9840 otherwise, fall back on plain "time".
9841 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9843 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9845 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9847 2001-02-17 Jim Meyering <meyering@lucent.com>
9849 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9850 around included file name.
9852 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9854 * strftime.c: Update from GNU libc (the only changes were to comments).
9856 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9858 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9860 2001-02-17 Paul Eggert <eggert@twinsun.com>
9862 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9863 Remove workaround macros for hosts that have mbrtowc but not
9864 mbstate_t, as we now insist on proper declarations for both
9865 before using mbrtowc.
9867 2001-02-17 Jim Meyering <meyering@lucent.com>
9869 * regex.c: Update from libc.
9871 2001-02-16 Paul Eggert <eggert@twinsun.com>
9873 * alloca.c (malloc): Undef before defining, since stdlib.h
9874 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9875 Reported by Mark Hounschell via Paul Eggert.
9877 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9879 * config.charset: Update for FreeBSD 4.2.
9881 2001-01-26 Jim Meyering <meyering@lucent.com>
9883 * quotearg.c: Include stddef.h.
9884 * quote.c: Include stddef.h.
9885 Reported by Axel Kittenberger.
9887 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9888 line in double quotes so that it evokes a better diagnostic.
9889 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9890 Reported by Axel Kittenberger.
9892 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9894 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9895 to avoid a warning. Add back 'const' to inptr.
9897 2001-01-16 Jim Meyering <meyering@lucent.com>
9899 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9902 2001-01-14 Jim Meyering <meyering@lucent.com>
9904 * rename.c: New file. From Volker Borchert.
9905 Include stdlib.h, string.h or strings.h, and xalloc.h.
9906 Use strip_trailing_slashes rather than open-coding it.
9908 2001-01-03 Paul Eggert <eggert@twinsun.com>
9910 * strftime.c: Sync with glibc time/strftime.c 1.81.
9912 2001-01-03 Jim Meyering <meyering@lucent.com>
9914 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9915 local `inptr' to avoid warning with some system declarations of iconv.
9917 2000-12-29 Paul Eggert <eggert@twinsun.com>
9919 * modechange.c: Do not assume that mode_t uses the
9920 traditional octal encoding. E.g. "chmod 1 FOO" should set
9921 the other-execute bit of FOO even if S_IXOTH != 1.
9923 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9924 WOTH, XOTH, ALLM): New macros.
9925 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9926 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9928 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9929 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9931 No need to use uintmax_t; unsigned long is long enough.
9932 Don't bother to get suffix since we don't use it.
9934 2000-12-24 Jim Meyering <meyering@lucent.com>
9936 * hash.c (is_prime): Return explicit boolean values.
9937 (hash_get_first): Return NULL to appease Irix5.6's 89.
9938 Reported by Nelson Beebe.
9940 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9942 * localcharset.c (locale_charset): Add support for Win32.
9944 2000-12-18 Paul Eggert <eggert@twinsun.com>
9946 * physmem.h, physmem.c: New files.
9948 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9949 (noinst_HEADERS): Add physmem.h.
9951 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9952 't' for compatibility with Solaris 8 sort.
9954 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9956 * config.charset: Add support for BeOS.
9958 2000-12-16 Jim Meyering <meyering@lucent.com>
9960 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9961 SHELLS_FILE to a file name that's useful on djgpp systems.
9963 (ADDITIONAL_DEFAULT_SHELLS): Define.
9964 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9965 Based mostly on a patch from Prashant TR.
9967 2000-12-16 Jim Meyering <meyering@lucent.com>
9969 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9970 N and M) would have treated it like `chown N:N FILE'.
9972 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9974 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9976 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9977 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9978 to the list of canonical encodings. Rename EUC-CN to GB2312.
9980 2000-12-08 Andreas Schwab <schwab@suse.de>
9982 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9983 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9985 2000-12-07 Jim Meyering <meyering@lucent.com>
9987 * stripslash.c (ISSLASH): Define.
9988 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9991 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9992 (dir_name_r): Declare this function as static.
9993 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9994 manifest itself on a name containing a mix of slashes and
9996 Make this function work with names starting with a DOS-style
9997 drive letter and colon prefix.
9998 (dir_name): Append `.' if necessary.
9999 Based mostly on patches from Prashant TR and Eli Zaretskii.
10001 * dirname.h (dir_name_r): Remove prototype.
10003 2000-12-05 Jim Meyering <meyering@lucent.com>
10005 * dirname.c (dir_name_r): Add `const' in a few local declarations.
10007 2000-12-04 Jim Meyering <meyering@lucent.com>
10009 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10010 Also include memory.h, stdlib.h, unistd.h if appropriate.
10011 Reported by Andreas Jaeger (conflicting declaration of malloc).
10013 2000-12-02 Jim Meyering <meyering@lucent.com>
10015 * closeout.h: Make idempotent, to avoid some obscure warnings.
10017 2000-12-01 Paul Eggert <eggert@twinsun.com>
10019 * memrchr.c: Include <config.h> before any system include file.
10021 2000-11-29 Paul Eggert <eggert@twinsun.com>
10023 * dirname.c (dir_name_r): Fix typo: int -> size_t.
10025 2000-11-26 Jim Meyering <meyering@lucent.com>
10027 * memcoll.c: Include sys/types.h. From Werner Almesberger.
10029 2000-11-22 Paul Eggert <eggert@twinsun.com>
10031 * strftime.c (my_strftime): Do not invoke mbrlen with a
10032 size of (size_t) -1; it's not portable.
10034 2000-11-17 Akim Demaille <akim@epita.fr>
10036 * obstack.h: Formatting changes.
10037 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10038 prevent type checking.
10039 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10040 cast the value to (void *): assigning a `foo *' to a `void *'
10042 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10044 2000-11-17 Jim Meyering <meyering@lucent.com>
10046 * strstr.c: Update from GNU libc.
10048 2000-11-16 Jim Meyering <meyering@lucent.com>
10050 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10052 2000-11-11 Jim Meyering <meyering@lucent.com>
10054 * error.c: Add a couple #includes, merging from GNU libc version.
10056 2000-11-10 Jim Meyering <meyering@lucent.com>
10058 * obstack.h: Update from GNU libc.
10059 * obstack.c: Likewise.
10061 2000-11-06 Paul Eggert <eggert@twinsun.com>
10063 * getusershell.c (setusershell): Use rewind rather than
10064 fseek/fseeko, to avoid configuration hassles with fseeko.
10065 Don't bother opening SHELLS_FILE if shellstream is NULL;
10066 it's not necessary.
10068 2000-11-05 Jim Meyering <meyering@lucent.com>
10070 * makepath.h (make_dir): Declare.
10071 * makepath.c (make_dir): Remove `static' attribute.
10074 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10076 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10077 last one in a bucket, advance to the next bucket.
10079 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10081 * fnmatch.c: Do not comment out all the code if we are using
10082 the GNU C library, because in some cases we are replacing buggy
10083 code in the GNU C library itself.
10085 2000-10-30 Paul Eggert <eggert@twinsun.com>
10087 * error.h, getline.h, modechange.h:
10088 Remove "2000" from Copyright line, as the file hasn't been
10089 changed this year other than in the copyright notice.
10091 * xalloc.h: Add "2000" to Copyright line, as this file
10092 was changed this year.
10094 2000-10-30 Paul Eggert <eggert@twinsun.com>
10096 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10097 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10098 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10100 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10102 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10103 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10104 doesn't define __restrict_arr.
10106 2000-10-29 Jim Meyering <meyering@lucent.com>
10108 * xstat.in: Fix grammar in comment.
10110 2000-10-28 Jim Meyering <meyering@lucent.com>
10112 * memchr.c: Update from libc.
10113 Adjust for portability:
10114 [HAVE_STDLIB_H]: Include stdlib.h.
10115 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10116 Undef __memchr, too.
10117 [!weak_alias]: Define __memchr to memchr.
10119 * regex.c: Update from libc.
10120 * regex.h: Likewise.
10121 * getopt1.c: Likewise.
10122 * memcmp.c: Likewise.
10124 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10125 Avoid using fseek, when possible -- it's broken by design.
10126 Patch by Ulrich Drepper.
10128 2000-10-26 Jim Meyering <meyering@lucent.com>
10130 * strftime.c: Update from libc.
10132 2000-10-25 Jim Meyering <meyering@lucent.com>
10134 * obstack.c: Update from libc.
10136 2000-10-23 Jim Meyering <meyering@lucent.com>
10138 * hard-locale.c (hard_locale): Revert last change -- it was simply
10139 wrong. That set_locale call must not have any side effects.
10142 2000-10-22 Jim Meyering <meyering@lucent.com>
10144 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10145 [CYCLIC]: Remove now-unused definition.
10147 * save-cwd.c (O_DIRECTORY): Define, if needed.
10148 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10149 Suggestion from Ulrich Drepper.
10151 2000-10-21 Jim Meyering <meyering@lucent.com>
10153 * dirname.c (dir_name_r): New function, factored out of dir_name.
10154 (dir_name): Use dir_name_r.
10155 * dirname.h (dir_name_r): Declare it.
10157 2000-10-21 Jim Meyering <meyering@lucent.com>
10159 * dirname.c (memrchr): Declare if necessary.
10160 (dir_name): Remove the restriction that there be no
10161 trailing slashes. Now, this code skips past them, effectively
10163 [TEST_DIRNAME] (main): New unit tests.
10165 * memrchr.c: New file from GNU libc.
10166 Undef __memrchr, too.
10167 [!weak_alias]: Define __memrchr to memrchr.
10168 Guard weak_alias use with `#ifdef weak_alias'.
10170 2000-10-17 Jim Meyering <meyering@lucent.com>
10172 * quote.h (PARAMS): Define and use.
10173 Reported by Akim Demaille.
10175 * getopt.c: Update from libc.
10177 2000-10-16 Jim Meyering <meyering@lucent.com>
10179 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10182 2000-09-25 Jim Meyering <meyering@lucent.com>
10184 * md5.h (rol): Define (from GnuPG).
10186 * sha.c: Give credit (GnuPG) where due.
10187 (M): Use rol rather than open-coding it.
10188 Add a FIXME comment.
10190 2000-09-21 Jim Meyering <meyering@lucent.com>
10192 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10193 Reported by Michael Stone.
10195 2000-09-20 Jim Meyering <meyering@lucent.com>
10197 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10198 (noinst_HEADERS): Add sha.h.
10199 Based on code from Scott G. Miller and from GnuPG.
10201 2000-09-15 Jim Meyering <meyering@lucent.com>
10203 * regex.c: Update from libc.
10205 2000-09-10 Jim Meyering <meyering@lucent.com>
10207 * getopt.c (_getopt_internal): Update from glibc.
10209 2000-09-09 Jim Meyering <meyering@lucent.com>
10211 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10212 think it should be used as a general replacement for isascii.
10213 * fnmatch.c: Likewise.
10214 * mbswidth.c: Likewise
10215 * regex.c: Likewise.
10218 * userspec.c: Include sys/param.h and limits.h.
10220 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10221 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10222 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10223 UID, GID. Check range.
10225 2000-09-06 Jim Meyering <meyering@lucent.com>
10227 * getopt.c (_getopt_internal): Update from glibc.
10229 2000-08-30 Jim Meyering <meyering@lucent.com>
10231 * strftime.c: Merge in changes from GNU libc.
10233 2000-08-26 Jim Meyering <meyering@lucent.com>
10235 * closeout.c: Include "__fpending.h".
10236 (close_stdout_status): Return right away if there's nothing to flush.
10238 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10239 * __fpending.c: New file.
10240 * __fpending.h: New file.
10242 2000-08-07 Paul Eggert <eggert@twinsun.com>
10244 Standardize on "memory exhausted" instead of "Memory exhausted"
10245 or "virtual memory exhausted".
10246 * obstack.c (print_and_abort): Use "memory exhausted", not
10247 "virtual memory exhausted".
10248 * same.c (same_name): Invoke xalloc_die instead of printing
10250 * userspec.c (parse_user_spec): Likewise.
10251 * bumpalloc.h: comment fix
10252 * same.c, userspec.c: Include xalloc.h.
10254 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10255 not char *const and pointing to a constant array.
10256 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10257 (xrealloc): Comment fix.
10259 * userspec.c (parse_user_spec):
10260 Don't translate a message until just before returning,
10261 to avoid unnecessary translation.
10263 2000-08-07 Jim Meyering <meyering@lucent.com>
10265 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10266 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10267 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10268 getgroups.c, gethostname.c, getopt.h, group-member.c,
10269 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10270 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10271 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10272 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10273 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10274 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10275 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10276 yesno.c: Back out Copyright date changes for each file with no change
10277 this year. This eases coordination with other programs using the same
10278 source code modules. From Paul Eggert.
10280 2000-08-03 Greg McGary <greg@mcgary.org>
10282 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10283 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10284 (EXTEND_BUFFER): Use them.
10286 2000-08-01 Jim Meyering <meyering@lucent.com>
10288 * dirname.c (ISSLASH): Define.
10289 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10290 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10291 both `\' and `/' may be use as path separators.
10292 Based on a patch from Prashant TR.
10294 2000-07-31 Paul Eggert <eggert@twinsun.com>
10296 * quotearg.c (quotearg_n_options): Don't make the initial
10297 slot vector a constant, since it might get modified.
10299 2000-07-31 Jim Meyering <meyering@lucent.com>
10301 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10302 * obstack.c (print_and_abort): Likewise.
10304 2000-07-30 Paul Eggert <eggert@twinsun.com>
10306 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10307 buffer, so that the caller can always quote one small
10308 component of a "memory exhausted" message in slot 0.
10309 From a suggestion by Jim Meyering.
10311 2000-07-30 Jim Meyering <meyering@lucent.com>
10313 * makepath.c (make_path): Quote the other instance, too.
10315 * quotearg.c (N_STATIC_SLOTVECS): Define.
10316 (STATIC_BUF_SIZE): Define.
10317 (quotearg_n_options): Use only statically allocated storage when
10318 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10319 than STATIC_BUF_SIZE.
10321 2000-07-29 Jim Meyering <meyering@lucent.com>
10323 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10324 * dirname.c (dir_name): Likewise.
10326 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10328 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10329 (dir_name): Assert that there are no trailing slashes.
10331 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10333 * mbswidth.h (mbswidth): Add a flags argument.
10334 (mbswidth): New declaration.
10335 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10336 * mbswidth.c (mbswidth): Add a flags argument.
10337 (mbsnwidth): New function.
10339 2000-07-24 Jim Meyering <meyering@lucent.com>
10341 * mbswidth.c: Remove useless #else. From Bruno Haible.
10343 2000-07-23 Paul Eggert <eggert@twinsun.com>
10345 * mbswidth.c (_XOPEN_SOURCE):
10346 Don't define; this causes problems on Solaris 7.
10347 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10349 2000-07-23 Paul Eggert <eggert@twinsun.com>
10352 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10353 so that mbstate_t is always defined.
10355 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10356 be 1 in at least one GCC installation, and this configuration
10357 error is likely to be common. Ignoring MB_LEN_MAX hurts
10358 performance on hosts that have mbrtowc but have only unibyte
10359 locales, but I assume these hosts are rare.
10361 2000-07-23 Paul Eggert <eggert@twinsun.com>
10363 * quotearg.c: Streamline by invoking multibyte code only if needed.
10364 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10365 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10366 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10367 invoke multibyte primitives.
10369 2000-07-23 Jim Meyering <meyering@lucent.com>
10371 * basename.c (base_name): Add an assertion.
10373 2000-07-15 Bruno Haible <clisp.cons.org>
10375 * quotearg.c: When the system forces us to redefine mbstate_t,
10376 shadow its mbsinit function.
10378 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10380 * mbswidth.h: New file.
10381 * mbswidth.c: New file.
10382 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10383 (noinst_HEADERS): Add mbswidth.h.
10385 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10387 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10390 2000-07-15 Jim Meyering <meyering@lucent.com>
10392 * makepath.c: Include quote.h.
10393 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10394 corresponding argument in a `quote (...)' call.
10395 Give better diagnostics.
10397 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10398 (noinst_HEADERS): Add quote.h.
10400 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10401 from tar's src/misc.c.
10402 * quote.h: New file. Prototypes for same.
10404 2000-07-10 Paul Eggert <eggert@twinsun.com>
10406 From a suggestion by Bruno Haible.
10407 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10408 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10409 to decide whether to define the BeOS workaround macro;
10410 this adjusts to the change to AC_MBSTATE_T.
10412 2000-07-13 Paul Eggert <eggert@twinsun.com>
10414 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10416 * quotearg.c (quoting_style_args, quoting_style_vals,
10417 quotearg_buffer_restyled): Add support for
10418 clocale_quoting_style. Undo previous change to
10419 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10420 and "{RIGHT QUOTATION MARK}" msgids.
10422 2000-07-05 Paul Eggert <eggert@twinsun.com>
10424 The old behavior of quoting `like this' doesn't look good with
10425 newer, ISO-style fonts. See:
10426 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10428 Instead, quote "like this" by default. Let the translator
10429 tailor the locale-specific quoting behavior by providing
10430 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10432 * quotearg.c (N_): New macro.
10433 (gettext_default): New function.
10434 (quotearg_buffer_restyled): Use
10435 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10436 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10438 2000-07-09 Jim Meyering <meyering@lucent.com>
10440 * Most files: Update copyright dates to include 2000.
10442 2000-07-08 Jim Meyering <meyering@lucent.com>
10444 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10446 (xgethostname): Remove now-unnecessary #ifdef.
10447 Move declaration of `err' into loop where it's used.
10449 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10451 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10452 by allocating a larger buffer. Test the gethostname return value for
10453 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10454 returns an error and ENAMETOOLONG isn't defined.
10456 2000-07-05 Paul Eggert <eggert@twinsun.com>
10457 and Bruno Haible <haible@clisp.cons.org>
10459 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10461 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10463 * quotearg.c (struct quoting_options): Simplify quote_these_too
10466 2000-07-03 Jim Meyering <meyering@lucent.com>
10468 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10469 Reported by Bruno Haible.
10471 2000-07-04 Jim Meyering <meyering@lucent.com>
10473 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10474 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10477 2000-07-03 Paul Eggert <eggert@twinsun.com>
10478 and Bruno Haible <haible@clisp.cons.org>
10480 * quotearg.c (mbrtowc):
10481 Assign to *pwc, and return 1 only if result is nonzero.
10482 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10484 2000-07-03 Jim Meyering <meyering@lucent.com>
10486 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10487 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10490 2000-07-02 Jim Meyering <meyering@lucent.com>
10492 * quotearg.c (mbstate_t): Don't define here.
10494 2000-07-02 Jim Meyering <meyering@lucent.com>
10496 * nanosleep.c (SIGCONT): Define if not already defined.
10498 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10500 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10501 per change in ../m4/ls-mntd-fs.m4.
10502 (read_filesystem_list): Ignore symbolic links.
10504 2000-06-29 Jim Meyering <meyering@lucent.com>
10506 * same.c: Include <string.h> or <strings.h>, as appropriate,
10507 for declaration of strcmp.
10509 * long-options.c: Include <stdlib.h>, for declaration of exit.
10511 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10512 Avoid warning by casting result to `char *' to remove `const'.
10514 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10516 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10518 2000-06-26 Paul Eggert <eggert@twinsun.com>
10520 savedir now sets errno on failure and invokes xmalloc to get memory.
10521 Fix a couple of other minor bugs while we're at it.
10523 * savedir.c (<unistd.h>): Do not include; there's no need.
10524 (NAMLEN): Remove macro.
10525 (malloc, realloc): Remove decls.
10526 (stpcpy): Likewise.
10527 ("xalloc.h"): Include.
10528 (NAME_SIZE_DEFAULT): New macro.
10529 (savedir): Use xmalloc / xrealloc to allocate memory.
10530 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10531 Skip "" directory entries.
10532 Use strlen to calculate directory entry length, since the old method
10533 is rarely used these days and isn't worth supporting.
10534 Don't use a pointer after freeing it.
10535 Check for integer overflow when calculating allocation size.
10536 Use memcpy to copy entries, instead of stpcpy.
10537 Set errno properly when returning NULL.
10538 Check for readdir error.
10540 2000-06-26 Jim Meyering <meyering@lucent.com>
10542 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10544 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10546 * getusershell.c (xmalloc, xrealloc): Remove functions.
10548 Don't include <stdlib.h>. Don't declare malloc, realloc.
10550 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10552 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10554 2000-06-24 Jim Meyering <meyering@lucent.com>
10556 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10558 2000-06-21 Jim Meyering <meyering@lucent.com>
10560 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10562 2000-06-19 Paul Eggert <eggert@twinsun.com>
10564 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10565 (mbrtowc, mbstate_t): Define substitutes if
10566 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10567 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10568 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10570 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10572 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10573 than 1024, return a memory chunk of least possible size, instead
10574 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10575 Use free/xmalloc instead of xrealloc to avoid copying for very long
10578 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10580 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10581 address, not strdup. Include <stdlib.h> and don't declare free().
10583 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10585 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10588 2000-06-21 Jim Meyering <meyering@lucent.com>
10590 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10591 (noinst_HEADERS): Add getstr.h.
10593 * getline.c (getstr): Move into a separate file.
10594 * getstr.c (getstr): New file, extracted from getline.c, with
10595 the following changes: new parameter, delim2; both delim[12]
10596 parameters have type `int', not `char'. The latter would lose
10597 with 8-bit delimiters.
10598 * getstr.h: New file.
10600 2000-06-19 Jim Meyering <meyering@lucent.com>
10602 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10604 2000-06-18 Jim Meyering <meyering@lucent.com>
10606 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10607 Besides, these days every porting target provides a mkdir function.
10609 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10610 (this snippet comes from src/system.h).
10612 2000-06-15 Paul Eggert <eggert@twinsun.com>
10614 * human.c (adjust_value): New function.
10615 (human_readable_inexact): Apply rounding style even when
10616 printing approximate values.
10618 2000-06-14 Paul Eggert <eggert@twinsun.com>
10620 * human.c (human_readable_inexact): Allow an input block
10621 size that is not a multiple of the output block size, and vice versa.
10622 Reported by Piergiorgio Sartor.
10624 2000-06-14 Paul Eggert <eggert@twinsun.com>
10626 * getdate.y (get_date): Apply relative times after time
10627 zone indicator, not before. Reported by Todd A. Jacobs.
10629 2000-06-13 Jim Meyering <meyering@lucent.com>
10631 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10633 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10635 2000-06-12 Paul Eggert <eggert@twinsun.com>
10637 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10639 2000-06-04 Paul Eggert <eggert@twinsun.com>
10641 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10643 2000-06-04 Jim Meyering <meyering@lucent.com>
10645 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10646 SunOS 4.1.4 for which gid_t is an unsigned type.
10648 2000-06-03 Jim Meyering <meyering@lucent.com>
10650 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10652 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10654 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10655 newer, don't install charset.alias.
10656 * config.charset: Change the Linux/glibc rules so they become empty
10657 on glibc-2.1 or newer.
10659 2000-06-02 Jim Meyering <meyering@lucent.com>
10661 * mountlist.c: Back out last change. Instead, do this...
10662 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10663 member using the same `ignore'-testing code.
10664 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10668 2000-05-29 Jim Meyering <meyering@lucent.com>
10670 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10671 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10673 2000-05-22 Jim Meyering <meyering@lucent.com>
10675 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10677 2000-05-18 Jim Meyering <meyering@lucent.com>
10679 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10680 back, too, since it may have been modified by allocate_entry.
10681 (hash_delete): Rewrite to use neither the assignment operator
10682 nor the comma operator in an if-expression.
10684 2000-05-15 Paul Eggert <eggert@twinsun.com>
10687 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10688 Remove; no longer needed.
10689 "quotearg.h": Add include.
10690 (file_name): Do not bother to explicitly initialize to NULL; it's less
10691 efficient on some hosts.
10692 (close_stdout_status): Remove test as to whether stdout was already
10693 closed; it breaks for the case "echo x | sort >&-".
10694 Quote file name colons.
10695 Do not assume that _("write error") lacks format strings.
10697 2000-05-15 Jim Meyering <meyering@lucent.com>
10699 * version-etc.c (version_etc_copyright): Update the copyright string
10700 used in all --version output.
10702 2000-05-14 Jim Meyering <meyering@lucent.com>
10704 * closeout.c (close_stdout_set_file_name): New function.
10705 (close_stdout_status): Use new file-scoped global.
10706 Return right away if fstat says the stdout file descriptor is invalid.
10707 * closeout.h (close_stdout_set_file_name): Declare.
10709 2000-05-10 Jim Meyering <meyering@lucent.com>
10711 * closeout.c [default_exit_status]: New file-scoped variable.
10712 (close_stdout_set_status): New function.
10713 * closeout.h (close_stdout_set_status): Declare.
10715 2000-05-08 Jim Meyering <meyering@lucent.com>
10717 * long-options.c: Don't include closeout.h.
10718 (parse_long_options): Don't call close_stdout for --version.
10720 2000-05-06 Jim Meyering <meyering@lucent.com>
10722 * strnlen.c: Undefine __strnlen and strnlen.
10723 [!weak_alias]: Define __strnlen to strnlen.
10725 * atexit.c: New file, from libiberty.
10727 2000-05-06 Jim Meyering <meyering@lucent.com>
10729 * closeout.c (close_stdout_status): Also check for errors on the
10732 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10734 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10735 instead of xmalloc, xrealloc, path_concat.
10736 (locale_charset): Treat empty environment variables as absent.
10737 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10739 2000-05-04 Jim Meyering <meyering@lucent.com>
10741 * getopt.c: Update from glibc.
10742 * obstack.c: Likewise.
10743 * obstack.h: Likewise.
10744 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10746 * regex.h: Likewise.
10747 * strndup.c: Likewise.
10748 * strnlen.c: New file, from glibc.
10750 2000-05-01 Jim Meyering <meyering@lucent.com>
10752 * full-write.c (full_write): Remove `FIXME' part of comment.
10754 2000-04-29 Jim Meyering <meyering@lucent.com>
10756 * path-concat.c: Declare strdup only if it's not defined.
10757 * canon-host.c: Likewise.
10759 2000-04-28 Jim Meyering <meyering@lucent.com>
10761 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10762 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10763 included first, then limits.h is included by locale.h by libintl.h.
10764 From John David Anglin.
10766 2000-04-25 Jim Meyering <meyering@lucent.com>
10768 * makepath.c (S_IRWXUGO): Define.
10769 (make_path): Always perform explicit chmod if MODE specifies any
10770 of the `special' permission bits. Prompted by a bug report against
10771 install from Mate Wierdl and Joost van Baal.
10773 2000-04-18 Jim Meyering <meyering@lucent.com>
10775 * README: New file.
10777 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10778 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10780 2000-04-17 Jim Meyering <meyering@lucent.com>
10782 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10783 the definition of it to rpl_strftime also defined-away the system's
10786 2000-04-15 Jim Meyering <meyering@lucent.com>
10788 Use `C' to denote so-called `contiguous' files, the same way
10790 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10791 (ftypelet): Use S_ISCTG.
10792 From Michael Deutschmann.
10794 2000-04-14 Jim Meyering <meyering@lucent.com>
10796 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10798 2000-04-08 Jim Meyering <meyering@lucent.com>
10800 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10801 names don't conflict. Reported by Eli Zaretskii.
10803 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10805 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10806 bug. Deal with the different error behavior of Irix iconv.
10808 2000-04-07 Jim Meyering <meyering@lucent.com>
10810 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10811 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10813 2000-04-05 Jim Meyering <meyering@lucent.com>
10815 Portability tweaks required for ultrix4.3.
10816 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10817 * readutmp.c: Include sys/types.h before sys/stat.h.
10818 * canon-host.c: Declare strdup.
10819 * path-concat.c: Likewise.
10820 From John David Anglin.
10822 2000-04-04 Jim Meyering <meyering@lucent.com>
10824 Be more DOS 8.3-friendly.
10825 * ref-add.sin: Renamed from ref-add.sed.in.
10826 * ref-del.sin: Renamed from ref-del.sed.in.
10827 * Makefile.am: Reflect renaming.
10828 Reported by Eli Zaretskii.
10830 Use a temporary file name that won't clash with `charset.alias'
10831 in the DOS 8.3 name space.
10832 * Makefile.am (charset_tmp): Define.
10833 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10834 (uninstall-local): Likewise.
10835 Reported by Eli Zaretskii.
10837 2000-03-29 Paul Eggert <eggert@twinsun.com>
10839 * time/strftime.c (my_strftime): Make sure we call the system
10840 strftime, not ourselves, when invoking the underlying strftime.
10842 2000-03-24 Jim Meyering <meyering@lucent.com>
10844 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10845 (charset_alias): Define.
10846 (install-exec-local): Factor out common code.
10847 (uninstall-local): Split lines longer than 80.
10848 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10849 (SUFFIXES): Define.
10850 (.sed.in.sed): New rule. Don't redirect directly to $@.
10851 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10853 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10855 * config.charset: Output a line containing "Packages using this file".
10856 * ref-add.sed.in, ref-del.sed.in: New files.
10857 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10858 ref-del.sed): New rules.
10860 2000-03-17 Jim Meyering <meyering@lucent.com>
10862 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10863 Otherwise, include <strings.h>
10865 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10867 * unicodeio.c (utf8_wctomb): New function.
10868 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10869 format instead of in UCS-4 with platform dependent endianness.
10871 2000-03-07 Paul Eggert <eggert@twinsun.com>
10873 * savedir.c (savedir): Work even if directory size is
10874 negative; this can happen with some screwy NFS configurations.
10876 2000-03-06 Jim Meyering <meyering@lucent.com>
10878 * localcharset.c (get_charset_aliases): Don't try to free file_name
10879 if it's NULL (because we ran out of memory). From Bruno Haible.
10881 2000-03-05 Jim Meyering <meyering@lucent.com>
10883 * localcharset.c ("path-concat.h"): Include.
10884 (get_charset_aliases): Use path_concat instead of ANSI string
10887 * unicodeio.h (PARAMS): Define.
10888 Use it to guard prototype.
10890 2000-03-04 Jim Meyering <meyering@lucent.com>
10892 * Makefile.am (install-exec-local): Create $(libdir) before installing
10894 (uninstall-local): Uncomment this rule so `make distcheck' works
10897 * unicodeio.c (<errno.h>): Include it.
10898 (errno): Declare if not defined.
10900 * localcharset.c: Add Bruno's comment justifying use of volatile.
10902 * config.charset: New version, incorporating remarks from a linux
10903 i18n mailing list. From Bruno Haible.
10905 2000-03-02 Jim Meyering <meyering@lucent.com>
10907 * Makefile.am (EXTRA_DIST): Add config.charset.
10909 2000-03-01 Jim Meyering <meyering@lucent.com>
10911 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10912 * unicodeio.c: Likewise.
10914 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10916 * config.charset: New file.
10917 * localcharset.c: New file.
10918 * unicodeio.h, unicodeio.c: New files.
10919 * Makefile.am (DEFS): Add -DLIBDIR=...
10920 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10921 (noinst_HEADERS): Add unicodeio.h.
10922 (all-local, install-exec-local, charset.alias): New targets.
10924 2000-02-28 Paul Eggert <eggert@twinsun.com>
10926 * quotearg.c (ALERT_CHAR): New macro.
10927 (quotearg_buffer_restyled): Use it.
10929 2000-02-27 Jim Meyering <meyering@lucent.com>
10931 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10932 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10934 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10935 not `#if STDC_HEADERS'.
10936 Declare malloc if needed.
10938 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10939 now that autoconf always defines the HAVE_DECL_ symbols.
10940 * human.c: Likewise.
10941 * same.c: Likewise.
10942 * strtoumax.c: Likewise.
10944 * backupfile.c: Arrange for cpp to fail if the configure-time
10945 declaration check was not run.
10946 * hash.c: Likewise.
10947 * human.c: Likewise.
10948 * same.c: Likewise.
10949 * strtoumax.c: Likewise.
10951 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10952 then first look up the entire `.'-containing string as a login name.
10954 2000-02-18 Paul Eggert <eggert@twinsun.com>
10956 * getdate.y: Handle two-digit years with leading zeros correctly.
10957 (textint): New typedef.
10958 (parser_control): Member year changed from int to textint.
10960 (YYSTYPE): Removed; replaced by %union with int and textint members.
10961 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10962 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10963 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10964 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10965 (date, number, to_year): Use width of number in digits, not its value,
10966 to determine whether it's a 2-digit year, or a 2-digit time.
10967 (yylex): Store number of digits of numeric tokens.
10968 Reported by John Kendall.
10970 (parser_control): Changed from struct parser_control to typedef (for
10971 consistency). All uses changed.
10973 (tID): Removed; not used.
10974 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10976 2000-02-14 Paul Eggert <eggert@twinsun.com>
10978 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10979 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10981 2000-02-12 Jim Meyering <meyering@lucent.com>
10983 * userspec.c (ISDIGIT): Define it.
10984 (isdigit): Remove definition.
10985 (is_number): Use ISDIGIT, not isdigit.
10986 <libintl.h>: Include.
10987 (_ and N_): Define.
10988 (parse_user_spec): Mark translatable strings.
10990 2000-02-10 Jim Meyering <meyering@lucent.com>
10992 With these changes, nanosleep.[ch] are finally enough like the other
10993 lib/* replacement files to compile on a few more losing systems.
10995 * nanosleep.h: Don't include config.h.
10996 Remove prototype from declaration of nanosleep.
10997 (PARAMS): Remove now-unneeded definition.
10998 * nanosleep.c: #undef nanosleep.
10999 (rpl_nanosleep): Rename from nanosleep.
11001 2000-02-03 Jim Meyering <meyering@lucent.com>
11003 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11004 rather than with `#if HAVE_UTMPNAME'.
11006 2000-02-01 Jim Meyering <meyering@lucent.com>
11008 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
11010 2000-01-31 Jim Meyering <meyering@lucent.com>
11012 * nanosleep.h (nanosleep): Guard declaration with
11013 `#if ! HAVE_DECL_NANOSLEEP'.
11014 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11015 the declaration in that vendor's sys/timers.h.
11016 Reported by Christian Krackowizer.
11018 * quotearg.c (ISASCII): Add #undef and move definition to follow
11019 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11020 (ISPRINT): Likewise.
11021 Reported by Tom Tromey.
11023 2000-01-30 Jim Meyering <meyering@lucent.com>
11025 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11026 uses of ->ut_name. The latter doesn't work with new Linux header files
11027 where only utmpx.ut_user is declared.
11029 * readutmp.h (UT_USER): Define.
11031 2000-01-23 Jim Meyering <meyering@lucent.com>
11033 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11036 2000-01-22 Jim Meyering <meyering@lucent.com>
11038 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11039 [! HAVE_DECL_STRTOULL]: Declare strtoull.
11040 Required for some AIX systems. Reported by Christian Krackowizer.
11041 [TESTING] (main): New function.
11043 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
11044 * dirname.c (dir_name): Support for DOS-style file names with drive
11047 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11049 * strverscmp.c (ISDIGIT): Define.
11050 (strverscmp): Use ISDIGIT, not isdigit.
11052 2000-01-17 Paul Eggert <eggert@twinsun.com>
11054 * nanosleep.c (nanosleep):
11055 Don't use SA_INTERRUPT to decide whether to call sigaction, as
11056 POSIX.1 doesn't require SA_INTERRUPT and some systems
11057 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
11058 it's been part of POSIX.1 since day 1 (in 1988).
11060 2000-01-17 Jim Meyering <meyering@lucent.com>
11062 * interlock: Remove unused file. Reported by François Pinard.
11064 2000-01-16 Paul Eggert <eggert@twinsun.com>
11066 * quotearg.c (quotearg_buffer_restyled): Do not quote
11067 alert, backslash, formfeed, and vertical tab unnecessarily in
11068 shell quoting style.
11071 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11072 Free Software Foundation, Inc.
11073 Copying and distribution of this file, with or without modification,
11074 are permitted provided the copyright notice and this notice are preserved.