1 2006-10-06 Eric Blake <ebb9@byu.net>
3 * clean-temp.h (close_stream_temp): New declaration.
4 * clean-temp.c (includes): Pull in headers according to what
5 other modules are in use.
6 (close_stream_temp) [GNULIB_CLOSE_STREAM]: New function.
8 2006-10-06 Bruno Haible <bruno@clisp.org>
10 * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
11 cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
13 * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
14 cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
15 Return an error indicator.
16 Suggested by Eric Blake.
18 2006-10-06 Bruno Haible <bruno@clisp.org>
20 * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
21 Reported by Eric Blake.
23 2006-09-29 Bruno Haible <bruno@clisp.org>
24 and Paul Eggert <eggert@cs.ucla.edu>
26 * closeout.c (close_stdout): Also close stderr.
27 * closeout.h: Update comment.
29 2006-10-06 Bruno Haible <bruno@clisp.org>
31 * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
32 instead of fopen, fwriteerror.
34 2006-10-05 Bruno Haible <bruno@clisp.org>
36 * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
37 fwriteerror_temp): New declarations.
38 * clean-temp.c (uintptr_t): Provide fallback definition.
39 (descriptors): New variable.
40 (cleanup): First, close the descriptors.
41 (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
42 fclose_temp, fwriteerror_temp): New functions.
44 2006-10-03 Bruno Haible
46 * gl_list.h (gl_sortedlist_search_from_to,
47 gl_sortedlist_indexof_from_to): New declarations.
48 (gl_list_implementation): New fields sortedlist_search_from_to,
49 sortedlist_indexof_from_to.
50 (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
52 * gl_list.c (gl_sortedlist_search_from_to,
53 gl_sortedlist_indexof_from_to): New functions.
54 * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
55 (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
56 (gl_array_sortedlist_search_from_to): New function.
57 (gl_array_list_implementation): Update.
58 * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
59 (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
60 (gl_carray_sortedlist_search_from_to): New function.
61 (gl_carray_list_implementation): Update.
62 * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
63 gl_linked_sortedlist_indexof_from_to): New functions.
64 * gl_linked_list.c (gl_linked_list_implementation): Update.
65 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
66 * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
67 gl_tree_sortedlist_indexof_from_to): New functions.
68 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
69 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
70 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
71 * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
73 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
75 Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
76 <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
77 * dirchownmod.c: Include lchown.h.
78 * lchown.c: Don't include files that lchown.h now includes.
79 Don't declare chown, since lchown.h now does that.
80 * lchown.h: Include errno.h, sys/types.h, unistd.h.
81 (lchown): Define to rpl_chown if lchown is declared but
82 does not exist. Declare using a prototype if lchown is not
83 declared. Add a copyright notice.
84 * mkstemp.h: Include <unistd.h>.
85 * openat.c: Include lchown.h.
87 * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
88 we now test for that separately.
89 * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
90 rather than O_NOFOLLOW, when testing whether it's possible to
91 avoid a race condition reliably.
92 * savewd.c (savewd_chdir): Likewise.
94 Remove macros that are no longer needed now that stdint.h is
96 * fsusage.c (UINTMAX_MAX): Remove.
97 * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
98 * utimecmp.c (SIZE_MAX): Remove.
100 2006-10-03 Bruno Haible <bruno@clisp.org>
102 * gl_list.h (gl_list_search_from, gl_list_search_from_to,
103 gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
104 (struct gl_list_implementation): Add fields search_from_to,
105 indexof_from_to. Remove fields search, indexof.
106 (gl_list_search): Use the search_from_to method.
107 (gl_list_search_from, gl_list_search_from_to): New functions.
108 (gl_list_indexof): Use the indexof_from_to method.
109 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
110 * gl_list.c (gl_list_search): Use the search_from_to method.
111 (gl_list_search_from, gl_list_search_from_to): New functions.
112 (gl_list_indexof): Use the indexof_from_to method.
113 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
114 * gl_array_list.c (gl_array_indexof_from_to): Renamed from
115 gl_array_indexof. Add start_index, end_index arguments.
116 (gl_array_search_from_to): Renamed from gl_array_search. Add
117 start_index, end_index arguments.
118 (gl_array_remove, gl_array_list_implementation): Update.
119 * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
120 gl_carray_indexof. Add start_index, end_index arguments.
121 (gl_carray_search_from_to): Renamed from gl_carray_search. Add
122 start_index, end_index arguments.
123 (gl_carray_remove, gl_carray_list_implementation): Update.
124 * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
125 gl_linked_search. Add start_index, end_index arguments.
126 (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
127 start_index, end_index arguments.
128 (gl_linked_remove): Update.
129 * gl_linked_list.c (gl_linked_list_implementation): Update.
130 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
131 * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
133 * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
134 gl_tree_search. Add start_index, end_index arguments.
135 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
136 start_index, end_index arguments.
137 (gl_tree_remove): Update.
138 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
139 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
140 * gl_anytreehash_list1.h (compare_position_threshold): New function.
141 * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
142 gl_tree_search. Add start_index, end_index arguments.
143 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
144 start_index, end_index arguments.
145 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
146 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
148 2006-10-04 Bruno Haible <bruno@clisp.org>
150 * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
152 2006-10-03 Bruno Haible <bruno@clisp.org>
154 * gl_oset.h (gl_setelement_threshold_fn): New type.
155 (gl_oset_search_atleast): New declaration.
156 (struct gl_oset_implementation): Add field 'search_atleast'.
157 (gl_oset_search_atleast): New inline function.
158 * gl_oset.c (gl_oset_search_atleast): New function.
159 * gl_array_oset.c (gl_array_search_atleast): New function.
160 (gl_array_oset_implementation): Update.
161 * gl_anytree_oset.h (gl_tree_search_atleast): New function.
162 * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
163 * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
165 2006-10-04 Jim Meyering <jim@meyering.net>
167 * fts.c (fts_open): Tiny comment change.
169 2006-10-03 Bruno Haible <bruno@clisp.org>
171 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
172 from gl_avltreehash_list_implementation.
174 2006-10-03 Bruno Haible <bruno@clisp.org>
176 * gl_oset.c (gl_oset_add): Fix return type.
178 2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
180 * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
182 2006-10-02 Paolo Bonzini <bonzini@gnu.org> (tiny change)
184 * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
186 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
188 Work around bug in Solaris 10 /proc file system:
189 /proc/self/fd/NNN/.. isn't the parent directory of
190 the directory whose file descriptor is NNN. This needs to
191 be worked around at run time, not compile time, since a
192 program might be built on Solaris 8, where things work, and
194 * openat-priv.h (BUILD_PROC_NAME): Remove. All callers changed
195 to use the following interface instead:
196 (OPENAT_BUFFER_SIZE): New macro.
197 (openat_proc_name): New function.
198 * at-func.c (AT_FUNC_NAME): Adjust to above changes.
199 * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
201 * openat-proc.c: New file.
203 2006-09-29 Bruno Haible <bruno@clisp.org>
205 * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
206 * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
207 argument. Set stdout_closed before testing for ferror, not after.
208 (fwriteerror, fwriteerror_no_ebadf): New functions.
210 2006-09-28 Bruno Haible <bruno@clisp.org>
212 * strndup.h: Simplify the redefinition of strndup.
213 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
215 2006-09-28 Bruno Haible <bruno@clisp.org>
217 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
218 * gl_linkedhash_list.c: Likewise.
219 * gl_rbtreehash_list.c: Likewise.
221 2006-09-28 Jim Meyering <jim@meyering.net>
223 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
226 2006-09-27 Jim Meyering <jim@meyering.net>
228 This file could end up with a definition for a function
229 named __strndup, rather than rpl_strndup on a system with
230 incomplete weak_alias support.
231 * strndup.c (strndup): Rename from __strndup.
232 Remove #defines that used to map __strndup to strndup.
233 Don't use K&R prototypes.
234 Remove LIBC-related code, since this file is not sync'd with glibc.
235 * strndup.h: Revamp, accordingly.
237 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
239 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
242 * __fpending.h: Don't include <stdio_ext.h> unless
243 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
244 it causes <stdio_ext.h> to cause a compile-time error.
245 Problem reported by Nelson H. F. Beebe.
246 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
247 of HAVE_DECL___PENDING.
249 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
251 * savewd.c: Include <signal.h>, for 'raise'.
253 2006-09-26 Eric Blake <ebb9@byu.net>
255 * verror.c: Include <config.h> unconditionally.
257 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
259 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
260 (gl_linked_iterator_from_to): Initialize struct completely.
261 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
262 (gl_tree_iterator_from_to): Likewise
263 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
264 * gl_array_list.c [lint] (gl_array_iterator)
265 (gl_array_iterator_from_to): Likewise.
266 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
267 * gl_carray_list.c [lint] (gl_carray_iterator)
268 (gl_carray_iterator_from_to): Likewise.
270 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
271 * md4.c (md4_process_block): Remove unused variable.
272 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
273 parentheses for clarity.
275 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
277 Import this patch from libc:
279 2006-09-06 Jakub Jelinek <jakub@redhat.com>
281 * regex_internal.c (re_string_reconstruct): Handle
282 offset < pstr->valid_raw_len && pstr->offsets_needed case.
283 Ensure no bytes read before raw_mbs array. Pass a saved copy of
284 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
285 re_string_context_at.
287 2006-09-20 Bruno Haible <bruno@clisp.org>
289 * mkdtemp.c: Import from libc.
290 2006-04-07 Ulrich Drepper <drepper@redhat.com>
291 * sysdeps/posix/tempname.c (__gen_tempname): Change
292 attempts_min into a macro. Use preprocessor to decide how to
293 initialize attempts [Coverity CID 67].
294 2001-11-27 Paul Eggert <eggert@twinsun.com>
295 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
296 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
298 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
300 * mkstemp.h: New file, since some standard headers
302 * mkstemp.c: Revamp to put the !_LIBC code together.
304 Make the _LIBC code resemble glibc original more,
306 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
307 (mkstemp): Remove, since mkstemp.h does this for us.
308 * stdlib--.h: Include mkstemp.h.
310 Import this patch from libc:
312 2006-04-07 Ulrich Drepper <drepper@redhat.com>
314 * tempname.c (__gen_tempname): Change attempts_min
315 into a macro. Use preprocessor to decide how to initialize
316 attempts [Coverity CID 67].
318 2006-09-18 Bruno Haible <bruno@clisp.org>
320 * javaversion.c: Include configmake.h.
322 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
324 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
325 that prevented coreutils 6.1 from building. Problem reported
326 by Petter Reinholdtsen.
328 2006-09-18 Jim Meyering <jim@meyering.net>
330 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
332 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
334 * dirchownmod.c: Don't include fcntl.h; no longer needed.
335 (dirchownmod): New arg FD. All callers changed.
336 Use FD rather than opening the directory ourself, as opening is
337 now the caller's responsibility.
338 * dirchownmod.h: Likewise.
339 * mkancesdirs.c: Include <sys/types.h>, for portability to older
340 hosts that require <sys/types.h> before <sys/stat.h>. Include
341 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
343 (mkancesdirs): Return length of prefix of FILE that has already
344 been made, or -2 if there is a child doing the work. Redo
345 algorithm so that it is O(N) rather than O(N**2). Optimize away
346 ".", and treat ".." specially since it might stray back into
347 already-created areas. Use a subprocess if necessary. New arg
348 WD; all users changed. MAKE_DIR function should now return 1
349 if it creates a directory that is not readable. Return -2 if
350 a child process is spun off.
351 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
352 Adjust signature to match code.
353 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
354 (make_dir_parents): Use a subprocess if necessary. New arg WD;
356 * savewd.c, savewd.h: New files.
358 2006-09-15 Jim Meyering <jim@meyering.net>
360 * rename-dest-slash.c (has_trailing_slash): Use
361 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
362 (rpl_rename_dest_slash): Perform the cheaper trailing slash
363 test before testing whether SRC is a directory.
364 Suggestions from Bruno Haible.
366 Avoid a warning about an unused variable.
367 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
368 into the #ifdef block where it's used.
370 * rename-dest-slash.c: New file.
372 2006-09-14 Bruno Haible <bruno@clisp.org>
374 * allocsa.c: Include <config.h> unconditionally.
375 * asnprintf.c: Likewise.
376 * asprintf.c: Likewise.
377 * c-strcasecmp.c: Likewise.
378 * c-strcasestr.c: Likewise.
379 * c-strncasecmp.c: Likewise.
380 * c-strstr.c: Likewise.
381 * classpath.c: Likewise.
382 * clean-temp.c: Likewise.
383 * concatpath.c: Likewise.
384 * copy-file.c: Likewise.
385 * csharpcomp.c: Likewise.
386 * csharpexec.c: Likewise.
387 * execute.c: Likewise.
388 * fatal-signal.c: Likewise.
389 * findprog.c: Likewise.
390 * fwriteerror.c: Likewise.
391 * gl_array_list.c: Likewise.
392 * gl_array_oset.c: Likewise.
393 * gl_avltree_list.c: Likewise.
394 * gl_avltree_oset.c: Likewise.
395 * gl_avltreehash_list.c: Likewise.
396 * gl_carray_list.c: Likewise.
397 * gl_linked_list.c: Likewise.
398 * gl_linkedhash_list.c: Likewise.
399 * gl_list.c: Likewise.
400 * gl_oset.c: Likewise.
401 * gl_rbtree_list.c: Likewise.
402 * gl_rbtree_oset.c: Likewise.
403 * gl_rbtreehash_list.c: Likewise.
404 * imaxabs.c: Likewise.
405 * imaxdiv.c: Likewise.
406 * javacomp.c: Likewise.
407 * javaexec.c: Likewise.
408 * javaversion.c: Likewise.
409 * linebreak.c: Likewise.
410 * localcharset.c: Likewise.
412 * mbchar.c: Likewise.
413 * mbswidth.c: Likewise.
414 * mkdtemp.c: Likewise.
416 * printf-args.c: Likewise.
417 * printf-parse.c: Likewise.
418 * progname.c: Likewise.
419 * progreloc.c: Likewise.
420 * readlink.c: Likewise.
421 * sh-quote.c: Likewise.
422 * stpcpy.c: Likewise.
423 * stpncpy.c: Likewise.
424 * strcasecmp.c: Likewise.
425 * strcasestr.c: Likewise.
426 * strcspn.c: Likewise.
427 * striconv.c: Likewise.
428 * strncasecmp.c: Likewise.
429 * strnlen1.c: Likewise.
430 * strstr.c: Likewise.
431 * strtok_r.c: Likewise.
433 * tmpdir.c: Likewise.
434 * unicodeio.c: Likewise.
435 * unsetenv.c: Likewise.
436 * vasnprintf.c: Likewise.
437 * vasprintf.c: Likewise.
438 * wait-process.c: Likewise.
439 * xallocsa.c: Likewise.
440 * xsetenv.c: Likewise.
441 * xstriconv.c: Likewise.
443 2006-09-13 Eric Blake <ebb9@byu.net>
445 * getopt.c: Fix typo in last commit.
447 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
449 * _fpending.c: Include <config.h> unconditionally, since we no
450 longer worry about uses that don't define HAVE_CONFIG_H.
451 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
452 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
453 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
454 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
455 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
456 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
457 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
458 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
459 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
460 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
461 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
462 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
463 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
464 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
465 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
466 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
467 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
468 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
469 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
470 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
471 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
472 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
473 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
474 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
475 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
476 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
477 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
478 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
479 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
480 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
481 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
482 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
483 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
484 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
487 2006-09-12 Jim Meyering <jim@meyering.net>
489 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
490 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
491 Reported by Nelson H. F. Beebe.
493 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
495 * argp-help.c (argp_doc): Make sure NULL is not passed to
498 2006-09-10 Bruno Haible <bruno@clisp.org>
500 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
502 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
504 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
505 program_invocation_name and program_invocation_short_name are
507 * argp-namefrob.h: Move declarations of program_invocation_name
508 and program_invocation_short_name to argp.h, so they are visible
512 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
514 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
515 convention. Text proposed by Bruno Haible.
516 (struct argp_option): Document the use of N_() wrappers.
518 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
519 and translate the two parts separately, instead of feeding
520 the whole string to gettext. This allows to exclude
521 '\v' from the strings visible to the translator by writing doc
522 strings as N_("..") "\v" N_("..").
524 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
526 * mktime.c (guess_time_tm): Fix bug where mktime
527 returned the maximum time_t value rather than (time_t) -1.
528 Problem originally reported by William Bardwell
529 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
531 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
533 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
536 2006-09-06 Bruno Haible <bruno@clisp.org>
538 * striconv.h: New file.
539 * striconv.c: New file, merging iconvme.c with GNU gettext's
541 * xstriconv.h: New file.
542 * xstriconv.c: New file.
544 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
546 * argz_.h: Sync from Libtool.
548 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
549 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
551 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
553 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
558 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
560 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
561 Problem reported by Ralf Wildenhues in
562 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
564 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
565 HAVE_STRUCT_STATFS_F_FSTYPENAME.
567 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
569 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
570 or stdbool.h, because they might not exist while configuring.
572 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
573 Don't include unistd.h or limits.h; not needed, since chdir-long.h
575 (O_DIRECTORY): Remove.
577 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
579 Work around a bug in both the Linux and SunOS 64-bit kernels:
580 nanosleep mishandles sleeps for longer than 2**31 seconds.
581 Problem reported by Frank v Waveren in
582 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
583 * nanosleep.c (BILLION): New constant.
584 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
585 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
587 2006-08-30 Jim Meyering <jim@meyering.net>
589 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
592 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
594 * isapipe.c, isapipe.h: New files.
596 2006-08-29 Eric Blake <ebb9@byu.net>
598 * error.c (error_at_line, print_errno_message): Match libc, after
599 resolution of upstream bug 3044.
601 2006-08-29 Bruno Haible <bruno@clisp.org>
603 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
605 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
609 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
611 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
612 sharing with gnulib. Report by Eric Blake.
614 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
616 * fcntl_.h: New file.
617 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
619 * dirchownmod.c: Likewise.
622 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
623 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
624 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
625 just before including <inttypes.h>, to avoid circular inclusion.
627 2006-08-28 Bruno Haible <bruno@clisp.org>
629 * inttypes_.h (SCNX*): Remove definitions.
630 Reported by Eric Blake.
632 2006-08-26 Bruno Haible <bruno@clisp.org>
634 * vasnprintf.c (EOVERFLOW): Remove definition.
635 (VASNPRINTF): Return a string of length > INT_MAX without failing.
636 * vasprintf.c: Include errno.h, limits.h.
637 (EOVERFLOW): New fallback definition.
638 (vasprintf): Test here whether the string length is > INT_MAX.
639 * vsnprintf.c: Include errno.h, limits.h.
640 (EOVERFLOW): New fallback definition.
641 (vsnprintf): Fix bug when generated string was too long for the buffer.
642 Test here whether the string length is > INT_MAX.
644 2006-08-26 Bruno Haible <bruno@clisp.org>
645 Simon Josefsson <jas@extundo.com>
648 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
650 2006-08-28 Bruno Haible <bruno@clisp.org>
652 * c-strstr.h: New file, from GNU gettext.
653 * c-strstr.c: New file, from GNU gettext.
655 2006-08-26 Bruno Haible <bruno@clisp.org>
657 * inttypes_.h: New file.
658 * inttypes.h: Remove file.
659 * stdint_.h: Include <inttypes.h> through its absolute filename.
661 * imaxabs.c: New file.
663 * imaxdiv.c: New file.
665 2006-08-22 Bruno Haible <bruno@clisp.org>
667 * readutmp.h: Skip most definitions if neither <utmp.h> nor
670 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
673 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
674 Problem reported by Bruno Haible.
676 2006-08-21 Bruno Haible <bruno@clisp.org>
679 * mbchar.h: Include <wctype.h> only if it exists.
681 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
683 * cycle-check.h: Include <stdint.h> unconditionally, since we
684 now assume the stdint module. Do not include inttypes.h.
685 * fsusage.h: Likewise.
686 * getndelim2.c: Likewise.
688 * inttostr.h: Likewise.
689 * obstack.c: Likewise.
690 * regex_internal.h: Likewise.
691 * tempname.c: Likewise.
692 * utimecmp.c: Likewise.
693 * xstrtol.h: Likewise.
695 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
697 * strtoimax.c: Adjust to macro name changes in Autoconf,
698 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
701 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
703 * fchmodat.c: New file, from coreutils. This was inadvertently
704 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
706 2006-08-18 Bruno Haible <bruno@clisp.org>
708 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
709 (ME_DUMMY): Treat "kernfs" as a dummy.
710 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
712 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
714 Update from coreutils.
716 * __fpending.h: Add copyright notice.
717 * fprintftime.h: Likewise.
718 * savedir.c: Use (C) in copyright notice.
719 * savedir.h: Likewise.
721 2006-08-15 Jim Meyering <jim@meyering.net>
723 * at-func.c: New file, with the logic of all emulated at-functions.
724 * openat-priv.h: Include <errno.h> and define ENOSYS,
725 in support of the EXPECTED_ERRNO macro.
726 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
727 Instead, define the appropriate symbols and include "at-func.c".
728 * mkdirat.c (mkdirat): Likewise.
729 * fchmodat.c (fchmodat): Likewise.
730 (ENOSYS): Remove definition.
731 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
732 Don't include "unistd--.h" -- it wasn't ever used.
734 2006-01-17 Jim Meyering <jim@meyering.net>
736 Rewrite fts.c not to change the current working directory,
737 by using openat, fstatat, fdopendir, etc..
739 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
740 (HAVE_OPENAT_SUPPORT): Define.
741 [_LIBC] (fchdir): Don't undef or define; no longer used.
742 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
743 Now, this `function' always succeeds, and consumes its file descriptor
744 parameter -- so callers must not close such FDs. Update callers.
745 (diropen_fd, opendirat, cwd_advance_fd): New functions.
746 (diropen): Add parameter, SP. Adjust all callers.
747 Implement using diropen_fd, rather than open.
748 (fts_open): Initialize new member, fts_cwd_fd.
749 Remove fts_rft-setting code.
750 (fts_close): Close fts_cwd_fd, if necessary.
751 (__opendir2): Define in terms of opendir or opendirat,
752 depending on whether the FST_NOCHDIR flag is set.
753 (fts_build): Since fts_safe_changedir consumes its FD, and since
754 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
755 and close the dup'd file descriptor upon failure.
756 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
757 (fts_safe_changedir): Tweak semantics to reflect that this function
758 now calls cwd_advance_fd and hence consumes its FD argument.
759 * fts_.h [struct FTS] (fts_cwd_fd): New member.
760 [struct FTS] (fts_rft): Remove now-unused member.
761 [struct FTS] (fts_cycle.state): Improve comment.
763 * openat.c (openat_needs_fchdir): New function.
764 * openat.h (openat_needs_fchdir): Declare it.
766 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
768 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
769 Problem and fix reported by Pádraig Brady in
770 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
772 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
774 * memcoll.c (memcoll): Optimize for the common case where the
775 arguments are bytewise equal.
777 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
779 Change copyright notice from LGPL 2 to GPL 2, since that's the
780 standard form used in the gnulib repository.
781 * lock.c: LGPL -> GPL.
783 * strnlen1.c: Likewise.
784 * strnlen1.h: Likewise.
787 * tmpdir.c: Likewise.
789 * TODO: Remove; this belongs only in coreutils.
791 2006-08-14 Eric Blake <ebb9@byu.net>
793 Import the following change from libc:
795 2006-08-12 Ulrich Drepper <drepper@redhat.com>
798 * misc/error.c: Add space between program name and message if file
801 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
803 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
804 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
806 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
807 in wchar_t. Problem reported by Eric Blake.
809 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
810 LEN is smaller than SIZE. Suggested by Bruno Haible.
811 Also, help the compiler to keep LEN in a register.
813 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
815 * .cppi-disable: Add snprintf.h, socket_.h.
816 * snprintf.c: Include <errno.h> and <limits.h>.
817 (EOVERFLOW): Define if the system does not.
818 Do not include "minmax.h"; it wasn't used.
819 (snprintf): Don't assume size_t promotes to an unsigned type.
820 Fix bug when generated string was too long for the buffer: the
821 buffer's contents are supposed to be the initial prefix of the
822 output. Don't assume vasnprintf returns EOVERFLOW if the size
823 exceeds INT_MAX; do the check ourselves.
825 Import the following changes from libc:
827 2006-06-02 Jakub Jelinek <jakub@redhat.com>
829 * posix/regex_internal.c (re_string_skip_chars): If no character has
830 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
831 to the byte which couldn't be converted.
832 (re_string_reconstruct): Don't clear valid_raw_len before calling
833 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
834 tip_context using re_string_context_at.
836 2006-05-02 Ulrich Drepper <drepper@redhat.com>
838 * posix/regex.h: g++ still cannot handled [restrict].
840 2006-04-21 Ulrich Drepper <drepper@redhat.com>
842 * posix/regex.h: Remove special handling for VMS.
844 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
848 2006-07-19 Mike Frysinger <vapier@gentoo.org>
850 * mountlist.c [ME_REMOTE]: Filter out cifs.
851 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
853 2006-08-08 Eric Blake <ebb9@byu.net>
855 * verror.c (verror_at_line): Work around glibc bug 2997, so that
856 verror_at_line output complies with GNU Coding Standards even when
859 2006-08-08 Eric Blake <ebb9@byu.net>
861 * verror.h, verror.c: New files.
863 2006-08-07 Bruno Haible <bruno@clisp.org>
865 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
867 Reported by Ralf Wildenhues.
869 2006-08-06 Eric Blake <ebb9@byu.net>
871 * error.h: Fold in some upstream changes from glibc.
874 2006-07-29 Bruno Haible <bruno@clisp.org>
876 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
878 2006-07-29 Bruno Haible <bruno@clisp.org>
880 * setenv.c: Undo unintended modification done on 2006-02-27.
882 2006-07-28 Eric Blake <ebb9@byu.net>
884 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
887 2006-07-28 Simon Josefsson <jas@extundo.com>
889 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
892 2006-07-28 Simon Josefsson <jas@extundo.com>
894 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
897 2006-07-28 Bruno Haible <bruno@clisp.org>
899 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
901 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
903 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
906 2006-07-28 Bruno Haible <bruno@clisp.org>
908 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
909 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
911 Avoids link error on FreeBSD 4.x.
912 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
914 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
916 * mbswidth.c (iswcntrl): Likewise.
918 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
920 * modechange.c (mode_compile): Numeric modes now affect setuid and
921 setgid on directories only if they set these bits.
922 * modechange.h: Remove obsolete comment about masks.
924 2006-07-27 Bruno Haible <bruno@clisp.org>
926 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
927 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
930 2006-07-26 Eric Blake <ebb9@byu.net>
932 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
933 like mingw that lack mkstemp.
934 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
935 avoid compilation warning on mingw.
937 2006-07-25 Bruno Haible <bruno@clisp.org>
939 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
940 <stdarg.h> or config.h.
942 2006-07-24 Bruno Haible <bruno@clisp.org>
944 * clean-temp.h: New file, from GNU gettext.
945 * clean-temp.c: New file, from GNU gettext.
947 2006-07-24 Bruno Haible <bruno@clisp.org>
949 * tmpdir.h: New file, from GNU gettext.
950 * tmpdir.c: New file, from GNU gettext.
952 2006-07-23 Bruno Haible <bruno@clisp.org>
954 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
955 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
956 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
957 gl_linked_remove_at): Use it.
959 2006-07-23 Eric Blake <ebb9@byu.net>
961 * tmpfile-safer.c: New file.
962 * stdio-safer.h (fopen_safer): Add prototype.
963 * stdio--.h (tmpfile): Make safer.
965 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
967 * close-stream.c, close-stream.h: New files.
969 2006-07-22 Bruno Haible <bruno@clisp.org>
971 Merge from GNU gettext 0.15.
973 2005-07-05 Bruno Haible <bruno@clisp.org>
975 * printf-args.c (printf_fetchargs): Work around broken
976 definition of wint_t on mingw.
978 2005-02-12 Bruno Haible <bruno@clisp.org>
980 * xallocsa.h: Add extern "C" for C++.
982 2006-05-17 Bruno Haible <bruno@clisp.org>
985 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
987 2006-04-30 Bruno Haible <bruno@clisp.org>
989 * progreloc.c: Include <mach-o/dyld.h> if available.
990 (find_executable): Use _NSGetExecutablePath when possible.
992 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
994 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
997 2005-12-29 Bruno Haible <bruno@clisp.org>
999 * progreloc.c (set_program_name_and_installdir): Fix
1002 2005-12-04 Bruno Haible <bruno@clisp.org>
1005 * progreloc.c: Include <windows.h> also on Cygwin.
1006 (find_executable): Add support for Cygwin.
1007 (set_program_name_and_installdir): Handle also platforms with
1010 2006-07-11 Bruno Haible <bruno@clisp.org>
1012 * javacomp.c: Fix a comment.
1013 Reported by Jim Meyering.
1015 2006-04-30 Bruno Haible <bruno@clisp.org>
1017 * javacomp.h (compile_java_class): Add source_version,
1018 target_version arguments.
1019 * javacomp.c: Rewritten to choose only a compiler that
1020 respects the specified source_version and target_version.
1022 2006-06-27 Bruno Haible <bruno@clisp.org>
1024 Assume correct S_ISDIR macro.
1025 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1027 2006-07-22 Bruno Haible <bruno@clisp.org>
1029 * javaversion.h: New file, from GNU gettext.
1030 * javaversion.c: New file, from GNU gettext.
1031 * javaversion.java: New file, from GNU gettext.
1032 * javaversion.class: New file, from GNU gettext.
1034 2006-05-17 Bruno Haible <bruno@clisp.org>
1037 * javaexec.c (execute_java_class): Test for jview program
1040 2006-04-09 Bruno Haible <bruno@clisp.org>
1042 * fatal-signal.c: Don't include string.h.
1043 (at_fatal_signal): Use a copying loop instead of memcpy.
1045 2005-12-04 Bruno Haible <bruno@clisp.org>
1047 * csharpexec.c: Add support for 'clix' launcher (untested).
1048 (execute_csharp_using_sscli): New function.
1049 (execute_csharp_program): Call it.
1051 2006-06-21 Bruno Haible <bruno@clisp.org>
1053 Avoid warnings from recent versions of mcs.
1054 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1055 -o, -L, -r any more. Use options documented since mcs-1.0
1056 instead. Similarly for -g.
1058 2005-07-09 Bruno Haible <bruno@clisp.org>
1060 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1062 Reported by Mark Junker <mjscod@gmx.de>.
1064 2006-06-17 Bruno Haible <bruno@clisp.org>
1066 * config.charset: Update for NetBSD 3.0.
1068 2006-05-17 Bruno Haible <bruno@clisp.org>
1071 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1073 2006-05-16 Bruno Haible <bruno@clisp.org>
1075 * localcharset.c [CYGWIN]: Include <windows.h>.
1076 (get_charset_aliases): For Cygwin, return the same CPxxx
1077 aliases list as under WIN32.
1078 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1079 the environment variables. Fall back to GetACP().
1081 2006-04-05 Bruno Haible <bruno@clisp.org>
1083 * config.charset: Update Juan Manuel Guerrero's address.
1085 2005-02-12 Bruno Haible <bruno@clisp.org>
1087 * allocsa.h: Add extern "C" for C++.
1089 2005-02-10 Bruno Haible <bruno@clisp.org>
1091 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1092 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1094 2006-07-22 Bruno Haible <bruno@clisp.org>
1096 * gettext.h: Update to GNU gettext-0.15.
1098 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1099 and Simon Josefsson <jas@extundo.com>
1101 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1103 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1105 2006-07-21 Eric Blake <ebb9@byu.net>
1107 * stdlib-safer.h: New file from coreutils, required by
1110 2006-07-19 Derek R. Price <derek@ximbiot.com>
1112 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1113 Reindent and repaginate.
1115 2006-07-17 Bruno Haible <bruno@clisp.org>
1117 * gl_list.h: New file.
1118 * gl_list.c: New file.
1119 * gl_array_list.h: New file.
1120 * gl_array_list.c: New file.
1121 * gl_carray_list.h: New file.
1122 * gl_carray_list.c: New file.
1123 * gl_linked_list.h: New file.
1124 * gl_linked_list.c: New file.
1125 * gl_anylinked_list1.h: New file.
1126 * gl_anylinked_list2.h: New file.
1127 * gl_avltree_list.h: New file.
1128 * gl_avltree_list.c: New file.
1129 * gl_anyavltree_list1.h: New file.
1130 * gl_anyavltree_list2.h: New file.
1131 * gl_rbtree_list.h: New file.
1132 * gl_rbtree_list.c: New file.
1133 * gl_anyrbtree_list1.h: New file.
1134 * gl_anyrbtree_list2.h: New file.
1135 * gl_anytree_list1.h: New file.
1136 * gl_anytree_list2.h: New file.
1137 * gl_linkedhash_list.h: New file.
1138 * gl_linkedhash_list.c: New file.
1139 * gl_anyhash_list1.h: New file.
1140 * gl_anyhash_list2.h: New file.
1141 * gl_avltreehash_list.h: New file.
1142 * gl_avltreehash_list.c: New file.
1143 * gl_rbtreehash_list.h: New file.
1144 * gl_rbtreehash_list.c: New file.
1145 * gl_anytreehash_list1.h: New file.
1146 * gl_anytreehash_list2.h: New file.
1148 * gl_oset.h: New file.
1149 * gl_oset.c: New file.
1150 * gl_array_oset.h: New file.
1151 * gl_array_oset.c: New file.
1152 * gl_avltree_oset.h: New file.
1153 * gl_avltree_oset.c: New file.
1154 * gl_rbtree_oset.h: New file.
1155 * gl_rbtree_oset.c: New file.
1156 * gl_anytree_oset.h: New file.
1158 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1160 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1162 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1163 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1164 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1165 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1166 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1167 callers changed. Revamp internals significantly, by not
1168 attempting to create directories that are temporarily more
1169 permissive than the final results. Do not attempt to use
1170 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1171 This removes some race conditions, fixes some bugs, and simplifies
1172 things. Use new dirchownmod function to do owner and mode changes.
1173 * mkdir-p.h: Likewise.
1174 * modechange.c (octal_to_mode): New function.
1175 (struct mode_change): New member mentioned.
1176 (make_node_op_equals): New arg mentioned. All callers changed.
1177 (mode_compile): Keep track of which mode bits the user has explicitly
1179 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1180 New arg PMODE_BITS, to keep track of which mode bits the user
1181 mentioned; it treats S_ISUID and S_ISGID speciall.
1182 All callers changed.
1183 * modechange.h: Likewise.
1185 2006-07-11 Derek R. Price <derek@ximbiot.com>
1187 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1189 2006-07-10 Derek R. Price <derek@ximbiot.com>
1191 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1192 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1193 macros into the GNU _D_EXACT_NAMLEN.
1194 * savedir.c: Likewise.
1195 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1197 2006-07-09 Jim Meyering <jim@meyering.net>
1199 * argp-pv.c: Remove a doubled word in a comment.
1200 * check-version.c (check_version): Likewise.
1201 * javacomp.c (compile_java_class): Likewise.
1203 2006-07-08 Jim Meyering <jim@meyering.net>
1205 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1207 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1209 * getaddrinfo.c: Changes to compile under MSVC6: changed
1210 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1211 brackets. Other minor changes to suppress some compiler
1214 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1216 * getloadavg.c: Use __VMS, not VMS.
1217 * getopt.c: Likewise.
1218 * getpagesize.h: Likewise.
1219 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1220 probably does not work.
1222 2006-07-06 Derek R. Price <derek@ximbiot.com>
1223 and Paul Eggert <eggert@cs.ucla.edu>
1225 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1226 Don't worry about this obsolete case any more.
1227 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1229 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1230 worry about this obsolete case any more.
1232 * getcwd.c: Likewise.
1234 * savedir.c: Likewise.
1236 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1238 * .cppi-disable: Add wcwidth.
1239 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1240 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1241 (ISGRAPH): Remove. All uses changed to isgraph.
1242 (FOLD) [!defined _LIBC]: Remove special case.
1243 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1244 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1246 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1248 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1250 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1252 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1254 * memcasecmp.c: Include <limits.h>.
1255 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1256 * strtod.c (strtod): Don't assume isspace works on negative chars.
1257 Don't assume isdigit succeeds only on '0' through '9'.
1259 2006-07-05 Derek R. Price <derek@ximbiot.com>
1261 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1262 All uses of is_space replaced by isspace.
1263 * exit.h: Don't talk about STDC_HEADERS.
1264 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1265 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1266 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1267 replaced by isprint etc.
1268 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1269 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1270 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1271 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1272 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1273 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1275 2006-07-05 Eric Blake <ebb9@byu.net>
1277 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1278 missing from netdb.h.
1279 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1281 2006-06-27 Bruno Haible <bruno@clisp.org>
1283 Assume ANSI C header files and <ctype.h> functions.
1284 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1285 (mbsnwidth): Use isprint, iscntrl instead.
1287 2006-07-03 Jim Meyering <jim@meyering.net>
1289 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1290 macro is used before the first cycle_check call.
1292 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1294 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1295 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1296 reported by Mark D. Baushke, one in
1297 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1299 Merge from coreutils.
1301 * .cppi-disable: Add stdint_.h.
1302 * .cvsignore: Add stdint.h.
1304 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1306 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1307 both double and long double versions.
1308 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1309 * xstrtold.c: New file.
1310 * xstrtod.h (xstrtold): New decl.
1312 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1314 * filemode.c (setst): Remove.
1315 (strmode): Rewrite to avoid setst. This makes the code shorter,
1316 (arguably) clearer, and the generated code is a bit smaller on my
1317 Debian GNU/Linux stable x86 host.
1319 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1321 * filemode.c: Include "filemode.h" first, to test the interface.
1322 Assume that filemode.h includes sys/types.h and sys/stat.h.
1323 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1324 (ftypelet): Reorder to put common cases first, for efficiency.
1325 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1327 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1328 of 10, for compatibility with FreeBSD. All callers changed.
1329 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1330 that can't be deduced solely from st_mode. First arg is now a const
1332 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1333 (strmode): Renamed from mode_string.
1334 (filemodestring): New decl.
1335 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1336 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1337 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1339 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1341 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1342 fsusage.h now does that. Include fsusage.h first, to test interface.
1343 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1344 at most one method (the old code could have generated decls that
1345 didn't conform to C89, not that this was ever exercised).
1346 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1348 2006-03-19 Jim Meyering <jim@meyering.net>
1350 Work even in a chroot where d_ino values for entries in "/"
1351 don't match the stat.st_ino values for the same names.
1352 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1353 number, iterate through all entries again, using lstat instead.
1354 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1355 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1357 * getcwd.c (__getcwd): Clarify a comment.
1358 Use memcpy in place of a call to strcpy.
1360 2006-03-12 Jim Meyering <jim@meyering.net>
1362 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1363 that of the current directory (which we're about to chdir ".." out of),
1364 then save the dev-ino of the parent, instead.
1366 * same-inode.h (SAME_INODE): New file/macro.
1367 * chdir-safer.c (SAME_INODE): Remove definition.
1368 Include "same-inode.h", instead.
1370 * cycle-check.h: Include "same-inode.h".
1371 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1372 * cycle-check.c (SAME_INODE): Remove definition.
1373 * root-dev-ino.h: Include "same-inode.h".
1375 2006-03-11 Eric Blake <ebb9@byu.net>
1377 * same.c (same_name): s/base_name/last_component/
1378 * backupfile.c (check_extension, numbered_backup): Likewise.
1379 * filenamecat.c (file_name_concat): Likewise.
1381 2006-03-11 Eric Blake <ebb9@byu.net>,
1382 Paul Eggert <eggert@cs.ucla.edu>
1384 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1385 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1387 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1388 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1389 (last_component): New method.
1390 * dirname.c (dir_len): Determine when drive letters need a
1391 subsequent slash. Preserve // when it is special.
1392 (dir_name): Don't append dot when drive letter is absolute.
1393 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1394 * basename.c (base_name): New semantics - malloc the result.
1395 Preserve // when it is special. Preserve relative files that look
1397 (base_len): Preserve // when it is special.
1398 (last_component): New method, similar to old base_name semantics.
1399 * stripslash.c (strip_trailing_slashes): Use last_component, not
1400 base_name. Strip redundant slashes from ///.
1402 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1404 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1405 both are 64 bits, since this seems to be the tradition, and this
1406 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1407 we ever run into a host that prefers long long to long in this
1408 case, we'll need another configure-time test. Problem reported by
1411 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1413 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1414 possible collision with system files.
1415 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1416 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1417 WCHAR_MIN and WCHAR_MAX in this case.
1418 (<stddef.h>): Do not include; no longer needed.
1419 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1420 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1421 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1422 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1423 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1424 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1425 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1426 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1427 !defined(__c99))]: Include in this case too, since it's harmless
1429 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1431 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1432 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1433 (_STDINT_MIN, _STDINT_MAX): New macros.
1434 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1435 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1436 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1437 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1438 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1439 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1440 macros, not typedefs; this simplifies things quite a bit.
1441 Use long int for all types narrower than int64_t.
1442 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1443 Define in terms of long long int or int64_t or long int,
1444 not int64_t or int32_t. This saves some compile-time testing.
1445 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1446 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1447 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1448 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1449 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1450 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1451 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1452 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1453 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1454 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1455 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1456 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1457 undef any previous version and define our own version, for
1458 simplicity and consistency with the new macros for types.
1459 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1460 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1461 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1462 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1463 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1464 @WINT_T_SUFFIX@ to keep things simple here.
1465 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1466 Simplify by assuming typical 8/16/32/64 host, since we're
1467 already doing that elsewhere anyway.
1468 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1469 and assume long long int is 64 bits if available. This
1470 speeds up 'configure'.
1472 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1474 * getaddrinfo.c: fixed typo
1476 2006-06-29 Eric Blake <ebb9@byu.net>
1478 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1479 unused static function.
1481 2006-06-29 Eric Blake <ebb9@byu.net>
1483 * stat_.h: New file.
1485 2006-06-29 Derek R. Price <derek@ximbiot.com>
1487 * strftime.c: Assume strftime() exists.
1489 2006-06-28 Bruno Haible <bruno@clisp.org>
1491 * getaddrinfo.h: Fix POSIX URL.
1492 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1493 (use_win32_p): Make static.
1494 (getaddrinfo): Reject service name if it is empty or does not consist
1495 solely of decimal digits, or if its value is > 65535.
1496 (getnameinfo): Remove useless casts.
1498 2006-06-28 Derek R. Price <derek@ximbiot.com>
1500 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1501 Autoconf 2.60 says this stuff was obsolete.
1503 2006-05-12 Bruno Haible <bruno@clisp.org>
1505 * mkdtemp.c [MINGW]: Include <io.h>.
1506 (mkdir): Define using _mkdir.
1508 2006-06-28 Bruno Haible <bruno@clisp.org>
1510 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1511 declaration for wcwidth.
1512 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1514 2006-06-28 Eric Blake <ebb9@byu.net>
1516 * xvasprintf.h: Fix comments.
1518 2006-06-28 Eric Blake <ebb9@byu.net>
1520 * mbchar.h (wcwidth): Include wcwidth.h.
1521 * mbswidth.c (wcwidth): Move from here...
1522 * wcwidth.h: ...to this new file.
1524 2006-06-28 Simon Josefsson <jas@extundo.com>
1526 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1527 functions there. It will succeed on Windows XP, but on Windows
1528 2000 and (presumably) earlier, it will fail, and use the internal
1530 (use_win32_p): New function.
1531 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1532 Support AI_NUMERICSERV to disable getservbyname.
1533 (getnameinfo): New function, only supports
1534 NI_NUMERICHOST|NI_NUMERICSERV for now.
1536 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1537 only have some of them. Add AI_NUMERICSERV. Add prototype for
1540 2006-06-27 Bruno Haible <bruno@clisp.org>
1542 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1544 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1546 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1547 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1548 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1550 2006-06-26 Bruno Haible <bruno@clisp.org>
1552 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1554 Reported by Mark D. Baushke and Larry Jones.
1556 2006-06-26 Bruno Haible <bruno@clisp.org>
1558 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1560 Suggested by Mark D. Baushke and Larry Jones.
1562 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1564 * stdint_.h: Treat BSD/OS like OpenBSD.
1566 2006-06-23 Bruno Haible <bruno@clisp.org>
1568 * stdint_.h: Treat IRIX like OpenBSD.
1570 2006-06-23 Bruno Haible <bruno@clisp.org>
1572 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1573 ISO C 99 Technical Corrigendum 1.
1575 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1577 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1578 Some compiler complained about some of them. Problem reported by
1580 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1582 2006-06-21 Simon Josefsson <jas@extundo.com>
1584 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1587 * socket_.h: Don't define WINVER.
1589 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1590 slightly modified to work in gnulib.
1592 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1594 * read-file.c (fread_file): Start with buffer allocation of
1595 0 bytes rather than 1 byte; this simplifies the code.
1596 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1597 code to free buffer and save/restore errno.
1598 (internal_read_file): Remove unused local.
1600 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1602 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1603 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1604 Problem reported by Denis Excoffier in
1605 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1607 2006-06-19 Simon Josefsson <jas@extundo.com>
1609 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1611 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1613 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1615 2006-06-17 Bruno Haible <bruno@clisp.org>
1617 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1619 2006-06-17 Bruno Haible <bruno@clisp.org>
1621 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1622 problem on Solaris 2.5.1.
1624 2006-06-16 Eric Blake <ebb9@byu.net>
1626 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1627 * unicodeio.c [!defined errno]: Likewise.
1628 * strtol.c [!defined errno]: Likewise.
1629 * strtod.c [!defined errno]: Likewise.
1631 2006-06-15 Bruno Haible <bruno@clisp.org>
1633 * stdint_.h: Rewritten to be fully auto-configured.
1634 Fixes bug on HP-UX/IA64.
1636 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1638 * getdate.y (__attribute__): Don't define if already defined.
1639 Problem reported by Larry Jones.
1640 * utimens.c (__attribute__): Likewise.
1642 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1644 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1645 reported by Andreas Schwab.
1647 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1648 Bruno Haible <bruno@clisp.org>
1650 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1652 2006-05-26 Martin Lambers <marlam@marlam.de>
1654 * getpass.c: Updates the test for the native W32 API, and adds
1655 missing includes, thus fixing compilation warnings.
1657 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1659 * tempname.c (small_open, large_open): New macros.
1660 (__open, __open64) [!_LIBC]: Remove.
1661 (__gen_tempname): Use small_open and large_open instead of __open
1662 and __open64. This fixes a portability bug on HP-UX 11.11i
1663 reported by Simon Wing-Tang in
1664 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1666 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1668 * exclude.c (exclude_fnmatch): New function.
1669 (excluded_file_name): Call exclude_fnmatch.
1670 * exclude.h (excluded_file_name): New prototype
1672 2006-05-24 Bruno Haible <bruno@clisp.org>
1674 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1675 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1676 Reported by Thorsten Maerz <torte@netztorte.de> via
1677 Aaron Stone <aaron@serendipity.cx>.
1679 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1681 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1682 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1683 (my_usleep): Don't mishandle maximum value.
1685 2006-05-19 Jim Meyering <jim@meyering.net>
1687 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1689 2006-05-17 Bruno Haible <bruno@clisp.org>
1692 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1694 2006-05-17 Bruno Haible <bruno@clisp.org>
1696 * stdint_.h: Fix recognition of Cygwin.
1698 2006-05-11 Jim Meyering <jim@meyering.net>
1700 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1702 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1704 * crc.c (crc32_update): Remove unnecessary L suffix.
1705 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1706 unwanted sign propagation, e.g., on hosts with 64-bit int.
1707 There still are some problems with reeelly weird theoretical hosts
1708 (e.g., 33-bit int) but it's not worth worrying about now.
1709 * sha1.c (rol): Likewise.
1710 (K1, K2, K3, K4): Remove unnecessary L suffix.
1712 2006-05-10 Bruno Haible <bruno@clisp.org>
1714 * des.c: Cast to avoid warnings.
1716 2006-05-10 Simon Josefsson <jas@extundo.com>
1718 * md4.c: Typo fix, update copyright years.
1719 (K1, K2): Don't use L because it turn computations into 64-bit on
1722 2006-05-09 Bruno Haible <bruno@clisp.org>
1724 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1725 (EOVERFLOW): Define fallback value.
1726 (xstrcat): New function.
1727 (xvasprintf): Recognize the special case of a string concatenation.
1729 2006-05-01 Bruno Haible <bruno@clisp.org>
1731 * stdint_.h: Shorter URL.
1732 * inttypes.h: Likewise.
1734 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1736 * verify.h: Document the internals better. Most of this change
1737 was written by Bruno Haible.
1739 2006-04-29 Bruno Haible <bruno@clisp.org>
1741 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1742 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1744 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1746 * getdate.y (get_date): When adding relative date, start with the
1747 initial time, not with the result of the first mktime call.
1749 2006-04-23 Bruno Haible <bruno@clisp.org>
1751 * copy-file.c: Include <unistd.h> unconditionally.
1752 * execute.c: Likewise.
1753 * fatal-signal.c: Likewise.
1754 * findprog.c: Likewise.
1755 * mkdtemp.c: Likewise.
1758 * wait-process.h: Likewise.
1760 2006-04-23 Bruno Haible <bruno@clisp.org>
1762 * fwriteerror.c (fwriteerror): Call fclose also when an error
1763 condition was already detected.
1764 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1766 2006-04-19 Derek Price <derek@ximbiot.com>
1767 Eric Blake <ebb9@byu.net>
1769 * inttypes.h: Correct grammar in comment.
1771 2006-04-18 Derek Price <derek@ximbiot.com>
1772 Paul Eggert <eggert@cs.ucla.edu>
1774 * inttypes.h: New file.
1775 * strtoimax.c: Assume <inttypes.h>.
1777 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1779 * utimens.c (futimens): glibc futimesat messes up if /proc
1780 isn't mounted. Problem reported by Kir Kolyshkin.
1782 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1784 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1785 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1786 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1788 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1790 Merge regex changes from libc, removing some of our
1791 POSIX-conformance changes that were rejected and redoing them in a
1794 * regcomp.c (re_compile_internal, init_dfa):
1795 Length arg is now size_t, not Idx. All uses changed.
1796 (peek_token): Forward decl now says internal_function.
1797 (__re_error_msgid, __re_error_msgid_idx):
1798 Now static rather than extern with attribute_hidden.
1799 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1800 For some reason libc prefers K&R style defns for external functions.
1801 (regerror) [!defined _LIBC]: Likewise.
1802 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1803 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1804 (build_range_exp, build_collating_symbol):
1806 (re_compile_fastmap): Use '\0' to memset, not 0.
1807 (utf8_sb_map): Make the calculations more obvious.
1808 (init_dfa, parse_bracket_exp, build_charclass_op):
1809 Call calloc and cast result, as glibc does.
1810 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1811 (build_range_exp, build_collating_symbol):
1812 Now internal functions.
1814 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1816 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1817 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1818 Don't depend on VMS; depend on __VMS instead, for POSIX
1819 namespace cleanness.
1820 (regoff_t): Define to ssize_t, not long int.
1822 Remove the REG_ macros named below. Instead, make the old names
1823 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1825 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1826 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1827 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1828 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1829 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1830 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1831 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1832 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1833 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1834 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1835 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1836 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1837 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1838 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1839 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1840 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1841 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1843 Remove. All uses replaced by the old RE_* names.
1844 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1845 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1846 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1847 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1848 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1849 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1850 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1851 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1852 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1853 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1854 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1855 Don't bother having these macros be independent of each others'
1856 values, since they no longer exist in the POSIX name space.
1858 Rename the following member names back to their old names,
1859 unless !__USE_GNU_REGEX. All uses changed back.
1860 (buffer): Renamed from re_buffer.
1861 (allocated): Renamed from re_allocated.
1862 (used): Renamed from re_used.
1863 (syntax): Renamed from re_syntax.
1864 (fastmap): Renamed from re_fastmap.
1865 (translate): Renamed from re_translate.
1866 (can_be_null): Renamed from re_can_be_null.
1867 (regs_allocated): Renamed from re_regs_allocated.
1868 (fastmap_accurate): Renamed from re_fastmap_accurate.
1869 (no_sub): Renamed from re_no_sub.
1870 (not_bol): Renamed from re_not_bol.
1871 (not_eol): Renamed from re_not_eol.
1872 (newline_anchor): Renamed from re_newline_anchor.
1873 (num_regs): Renamed from rm_num_regs.
1874 (start): Renamed from rm_start.
1875 (end): Renamed from rm_end.
1877 (free_state): Move up a bit.
1879 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1880 #define to be empty.
1881 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1882 when that is what is intended.
1883 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1884 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1886 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1887 All uses changed back to re_malloc, etc. It's now the caller's
1888 responsibility to check for overflow; all callers changed.
1889 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1890 (re_x2nrealloc): Remove.
1891 (free_state): Remove decl.
1893 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1894 (re_set_registers, re_exec):
1897 2006-01-31 Roland McGrath <roland@redhat.com>
1899 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1900 Reported by Mike Frysinger <vapier@gentoo.org>.
1902 2006-01-15 Andreas Jaeger <aj@suse.de>
1905 * regex_internal.c (re_string_reconstruct): Adjust for
1906 build_wcs_upper_buffer change.
1907 (build_wcs_upper_buffer): Change return type.
1909 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1911 * regex_internal.h: Include <stdint.h> if available.
1913 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1915 * regex_internal.h (SIZE_MAX): Provide a default definition.
1917 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1919 * regcomp.c: Adjust for changed secondary hash function.
1921 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1923 * regex.h: Pretty printing.
1924 Clean up namespace a bit.
1926 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1928 * regexec.c (update_cur_sifted_state, check_arrival,
1929 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1931 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1932 Ulrich Drepper <drepper@redhat.com>
1935 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1936 (bitset_word_t): Renamed from bitset_word. All uses changed.
1938 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1941 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1942 * regcomp.c: Remove unnecessary uses of
1943 unsigned RE_TRANSLATE_TYPE.
1944 * regex_internal.h: Likewise.
1945 * regex_internal.c: Likewise.
1946 * regexec.c: Likewise.
1947 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1949 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1951 * regexec.c (find_recover_state): Remove unnecessary
1953 (transit_state_bkref): Make DFA a const pointer.
1954 (get_subexp): Likewise.
1955 (check_arrival): Likewise.
1956 (update_cur_sifted_state): Likewise.
1957 (re_search_internal): Likewise.
1958 (prune_impossible_nodes): Likewise.
1959 (acquire_init_state_context): Likewise.
1960 (proceed_next_node): Likewise.
1961 (set_regs): Likewise.
1962 (free_fail_stack_return): Likewise.
1963 (check_arrival_expand_ecl): Mark DFA parameter as const.
1964 (check_arrival_expand_ecl_sub): Likewise.
1965 (check_subexp_limits): Likewise.
1966 (sub_epsilon_src_nodes): Likewise.
1967 (add_epsilon_src_nodes): Likewise.
1968 (merge_state_array): Likewise.
1969 (update_regs): Likewise.
1970 (build_trtable): Likewise.
1971 (sift_states_backward): Mark MCTX parameter as const.
1972 (build_sifted_states): Likewise.
1973 (update_cur_sifted_state): Likewise.
1974 (sift_states_mkref): Likewise.
1975 (check_arrival_expand_ecl): Mark eclosure as const.
1976 (check_dst_limits_calc_pos_1): Likewise.
1977 * regex_internal.h (re_match_context_t): Make dfa a const
1980 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1982 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1983 (transit_state_sb): Likewise.
1984 (transit_state_mb): Likewise.
1985 (sift_states_iter_mb): Likewise.
1986 (check_arrival_add_next_nodes): Likewise.
1987 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1988 [_LIBC] (re_search_2_stub): Use mempcpy.
1990 * regex_internal.c (re_string_reconstruct): Avoid calling
1991 mbrtowc for very simple UTF-8 case.
1993 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1995 (re_acquire_state_context): Likewise.
1996 * regex_internal.h: Adjust prototypes.
1998 * regex.c: Prevent using C++ compilers.
2000 * regex_internal.c (re_acquire_state): Minor code rearrangement.
2001 (re_acquire_state_context): Likewise.
2003 2006-03-29 Mark D. Baushke <mdb@gnu.org>
2004 Bruno Haible <bruno@clisp.org>
2006 * stdint_.h: On OpenBSD, don't redefine types already included in
2007 <sys/types.h> and <inttypes.h>.
2009 2006-03-24 Eric Blake <ebb9@byu.net>
2011 * time_r.c (copy_string_result): Remove, as it is no longer used.
2013 2006-03-24 Simon Josefsson <jas@extundo.com>
2015 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2016 including some doc fixes.
2017 (base64_encode_alloc): Fix +1 bug on allocation failures.
2019 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2021 * base64.c (base64_encode): Do not read past end of array with
2022 unsanitized input on systems with CHAR_BIT > 8.
2024 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2026 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2027 Typedef to long int, not to off_, as POSIX will likely change
2030 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
2032 * argp-help.c (validate_uparams): Fix typo
2033 * argp-parse.c (argp_default_options): Consistently begin help
2034 messages with a lowercase letter.
2036 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
2038 * time_r.h (asctime_r, ctime_r): Remove. These functions can
2039 overrun buffers and shouldn't be used (much as gets shouldn't be
2041 * time_r.c (asctime_r, ctime_r): Likewise.
2043 2006-03-08 Simon Josefsson <jas@extundo.com>
2045 * gc-gnulib.c (randomize): Don't open files called 'no', they
2046 signal that configure disabled the device.
2048 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
2050 * c-stack.c: Include unistd.h unconditionally, since we now assume
2052 * getlogin_r.c: Likewise.
2053 * getlogin_r.h: Likewise.
2055 * pagealign_alloc.c: Likewise.
2056 * unistd_.h: Remove; no longer needed.
2058 2006-03-07 Simon Josefsson <jas@extundo.com>
2060 * unistd_.h: New file.
2062 2006-03-07 Simon Josefsson <jas@extundo.com>
2064 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2066 2006-03-01 Simon Josefsson <jas@extundo.com>
2068 * readline.c: Fix typo, tiny patch from Stepan Kasal
2071 2006-02-28 Simon Josefsson <jas@extundo.com>
2073 * getopt.c: Protect #include of unistd.h, for MSVS.
2075 2006-02-27 Simon Josefsson <jas@extundo.com>
2077 * base64.h: Indent #define's. From Jim Meyering
2080 2006-02-27 Jim Meyering <jim@meyering.net>
2082 Revert the change of 2006-02-24, so these files can continue
2083 to be sync'd from gettext.
2084 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2087 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2089 * glob.c: Say "invalid" rather than "illegal" in comments.
2091 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2093 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2095 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2097 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2098 AT_FDCWD exceeds INT_MAX.
2099 * openat.h (AT_FDCWD): Likewise.
2101 2006-02-14 Jim Meyering <jim@meyering.net>
2103 Sync from coreutils.
2105 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2106 failure on deficient systems, and simplify gnulib lgpl dependencies.
2107 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2108 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2110 * xalloc-die.c: Remove unused definition of N_.
2112 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2114 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2116 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2118 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2119 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2121 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2123 * argp-namefrob.h: Restore changes accidentally lost during the
2124 "autoupdate" on 2005-12-12.
2126 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2128 * fnmatch.c (L_): Renamed from L, to work around a bug in
2129 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2130 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2133 2006-01-26 Simon Josefsson <jas@extundo.com>
2135 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2136 prototype is visible on mingw32.
2138 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2141 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2144 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2146 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2147 attempt to open for write; this always fails, at least on POSIX
2148 hosts. This reinstates the 2006-01-09 change, which was
2149 inadvertently removed.
2151 2006-01-26 Bruno Haible <bruno@clisp.org>
2152 Paul Eggert <eggert@cs.ucla.edu>
2154 * stdbool_.h (_Bool)
2155 [(! (defined __cplusplus || defined __BEOS__)
2156 && !defined __GNUC__
2157 && !(defined __HP_cc || defined __xlc__
2158 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2159 || defined __sgi))]:
2160 #define to signed char in these cases too; this simplifies
2161 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2162 etc., separately) and makes it more conservative.
2164 2006-01-21 Jim Meyering <jim@meyering.net>
2166 Sync from the stable (b5) branch of coreutils:
2168 * fts.c (fts_children): Don't let close() clobber errno from
2171 * fts.c (fts_stat): When following a symlink-to-directory,
2172 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2173 a dangling symlink. That can also happen at least for ELOOP.
2174 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2175 FYI, this bug predates the inclusion of fts.c in coreutils.
2177 * fts.c (fts_open): Put new maxarglen declaration and uses
2178 in their own block, so pre-c99 compilers don't object.
2180 Avoid the double-free (first in fts_read, second in fts_close) that
2181 would occur when an `active' directory is made inaccessible (e.g.,
2182 via chmod a-x) during a traversal.
2183 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2184 before returning. Reproduce this failure by
2185 mkdir -p a/b; cd a; chmod a-x . b
2186 Reported by Stavros Passas.
2188 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2190 * argp-namefrob.h: Bugfix. Remove stray #
2192 2006-01-25 Bruno Haible <bruno@clisp.org>
2194 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2196 Reported by Paul Eggert.
2198 2006-01-25 Jim Meyering <jim@meyering.net>
2200 * fileblocks.c: Remove more useless parentheses.
2201 * readutmp.h: Likewise.
2203 2006-01-24 Bruno Haible <bruno@clisp.org>
2205 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2207 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2210 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2211 to avoid problems with the built-in _Bool type.
2212 Reported by Paul Eggert on 2005-11-26.
2214 2006-01-24 Jim Meyering <jim@meyering.net>
2216 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2218 2006-01-24 Simon Josefsson <jas@extundo.com>
2220 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2223 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2225 Work around porting bugs reported by Dieter in
2226 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2227 * getopt.c (_NOPROTO): Remove; no longer needed.
2228 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2229 Include "getopt.h" first, to check interface.
2230 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2232 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2233 (__strndup): Revert to K&R-style function dfns, the glibc style.
2234 * strnlen.c: Don't claim it's taken from glibc; it's not.
2235 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2236 Include strnlen.h first, to get prototype properly.
2237 (strnlen): Renamed from __strnlen.
2240 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2242 These changes imported from libc.
2243 * getopt.c: Use __fxprintf instead of inline stream orientation
2244 test and two separate function calls.
2245 * strndup.c (__strndup): Add libc_hidden_def.
2247 2006-01-22 Bruno Haible <bruno@clisp.org>
2249 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2250 temporary buffer for sprintf, take into account the precision also
2251 for 'd', 'i', 'u', 'o', 'x', 'X'.
2253 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2255 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2256 to pacify gcc -Wswitch-default.
2258 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2260 * argp-help.c (usage_long_opt): Do not print DOC options.
2261 (__argp_base_name): Removed
2262 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2264 (__argp_base_name): Provide macro definition or extern declaration
2265 depending on the configuration
2267 2006-01-20 Simon Josefsson <jas@extundo.com>
2269 * inet_ntop.h: Unconditionally include sys/socket.h.
2271 2006-01-19 Simon Josefsson <jas@extundo.com>
2273 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2275 2006-01-12 Simon Josefsson <jas@extundo.com>
2277 * base64.c: Fix warning, reported by Bruno Haible
2278 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2280 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2282 Sync from coreutils.
2283 * md5.c: Fix commentary typos.
2284 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2285 * md5.h (__attribute__): Remove; unused.
2286 * sha1.c: Fix commentary to match md5 better.
2287 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2288 so that we don't need to worry about alignment. All uses changed.
2289 This merges the 2005-10-28 md5 change into sha1.
2291 2006-01-11 Jim Meyering <jim@meyering.net>
2293 Sync from coreutils.
2294 * md5.c (OP): Fix spacing.
2296 2006-01-11 Simon Josefsson <jas@extundo.com>
2298 * stdint_.h (SIZE_MAX): Add missing (.
2300 2006-01-10 Bruno Haible <bruno@clisp.org>
2302 * argp.h (__const): Remove macro. Use const instead.
2303 * argp-fmtstream.h (__const): Likewise.
2304 * glob_.h (__const): Remove macro.
2305 * glob-libc.h: Use const instead of __const.
2307 2006-01-10 Jim Meyering <jim@meyering.net>
2309 Avoid the double-free (first in fts_read, second in fts_close) that
2310 would occur when an `active' directory is made inaccessible (e.g.,
2311 via chmod a-x) during a traversal.
2312 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2313 before returning. Reproduce this failure by
2314 mkdir -p a/b; cd a; chmod a-x . b
2315 Reported by Stavros Passas.
2317 Sync from coreutils.
2318 * sha1.c: Tweak grammar in a comment.
2320 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2322 * regex_internal.h (BITSET_WORD_BITS):
2323 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2324 preprocessor mishandles large unsigned values as if they were signed.
2325 Problem reported by Claudio Fontana in
2326 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2328 2006-01-10 Simon Josefsson <jas@extundo.com>
2330 * socket_.h: New file.
2332 2006-01-10 Bruno Haible <bruno@clisp.org>
2334 * localcharset.c: Update from GNU gettext.
2336 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2338 Sync from coreutils.
2339 * chdir-long.c (cdb_free): Don't bother trying to open directory
2340 for write access: POSIX says that must fail.
2341 * fts.c (diropen): Likewise.
2342 * save-cwd.c (save_cwd): Likewise.
2343 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2344 well, for minor improvements on hosts that lack O_DIRECTORY.
2345 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2346 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2347 Fall back on chown if open failed with EACCES.
2349 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2350 Report an error at compile-time if only a 1-second nominal clock
2351 resolution is found.
2353 * lchmod.h: New file.
2354 * mkdir-p.c: Include lchmod.h, lchown.h.
2355 (make_dir_parents): Use lchown rather than chown, and
2356 lchmod rather than chmod.
2358 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2359 too. Problem with "none" reported by Bob Proulx. Problem with
2360 "proc" reported by n0dalus.
2362 * mountlist.c: Include <limits.h>.
2363 (dev_from_mount_options)
2364 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2365 New function. It no longer assumes "dev=" has the System V meaning
2366 on Linux (since it doesn't). It also parses "dev=" more carefully.
2367 (read_file_system_list)
2368 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2369 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2372 * posixtm.h (PDS_PRE_2000): New macro.
2373 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2374 All usages changed. Reject dates outside the range 1969-1999 if
2375 PDS_PRE_2000 is used.
2377 2006-01-09 Jim Meyering <jim@meyering.net>
2379 Sync from coreutils.
2381 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2383 * chdir-safer.h, chdir-safer.c: New files.
2385 * modechange.c (mode_compile): Reject an invalid mode string
2386 that starts with an octal digit. From Andreas Gruenbacher.
2388 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2389 and dup to open_safer and dup_safer, respectively.
2390 (openat_permissive): Fix typo in comment.
2392 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2393 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2394 (_): Remove; no longer needed.
2395 (openat): Renamed from rpl_openat; no need for rpl_openat
2396 since openat.h renames openat for us.
2397 Replace most of the body with a call to openat_permissive,
2398 to avoid duplicate code.
2399 Port to (probably hypothetical) environments were mode_t is
2401 (openat_permissive): Require mode arg, so that we can check
2402 types better. Put it just after flags. Change cwd failure
2403 indicator from pointer-to-bool to pointer-to-errno-value.
2404 All callers changed.
2405 Invoke openat_save_fail and/or openat_restore_fail if
2406 cwd_errno is null, so that openat can call us.
2407 (openat_permissive, fdopendir, fstatat, unlinkat):
2408 Simplify errno handling to avoid some duplicate code,
2409 as it's OK to set errno on success.
2410 * openat.h: Revamp code so that function macros depend on
2411 __OPENAT_PREFIX only, not also on AT_FDCWD.
2412 (openat_ro): Remove. Caller changed to use openat_permissive.
2413 (openat_permissive): Now a macro, if not a function.
2414 (openat_restore_fail, openat_save_fail): Now always functions,
2415 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2417 * openat-priv.h: New file, defining macros used by mkdirat.c
2419 * mkdirat.c: Include openat-priv.h.
2420 Remove definitions of macros defined therein.
2421 * openat.c: Likewise.
2423 * mkdirat.c (mkdirat): New file and function.
2424 * openat.h (mkdirat): Declare.
2426 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2428 * openat.h (openat_permissive): Declare.
2429 (openat_ro): Define.
2431 * openat.c (EXPECTED_ERRNO): New macro.
2432 (openat_permissive): New function -- used in remove.c rewrite.
2433 (all functions): Set errno just before returning, only if there
2434 was an actual failure.
2435 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2437 Emulate openat-family functions using Linux's procfs, if possible.
2438 Idea and some code based on Ulrich Drepper's glibc changes.
2440 * openat.c: (BUILD_PROC_NAME): New macro.
2441 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2442 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2443 before falling back on save_cwd and restore_cwd.
2444 (fdopendir, fstatat, unlinkat): Likewise.
2446 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2447 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2449 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2450 as second argument to va_arg. Otherwise, some versions of gcc
2451 warn that `if this code is reached, the program will abort'.
2453 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2455 Sync from coreutils.
2457 Add POSIX ACL support
2458 * acl.h (copy_acl, set_acl): Add declarations.
2459 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2460 systems other than Linux.
2461 (chmod_or_fchmod): New function: use fchmod when possible,
2462 and chmod otherwise.
2463 (file_has_acl): Add a POSIX ACL implementation, with a
2464 Linux-specific subcase.
2465 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2466 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2467 acls are unsupported.
2468 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2469 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2472 2006-01-09 Bruno Haible <bruno@clisp.org>
2474 * sysexit_.h (EX_OK): New macro.
2475 Suggested by Martin Lambers <marlam@marlam.de>.
2477 2006-01-09 Bruno Haible <bruno@clisp.org>
2479 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2480 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2481 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2482 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2484 2006-01-09 Bruno Haible <bruno@clisp.org>
2486 * stdint_.h (SIZE_MAX): Write the value without involving negative
2489 2005-10-16 Bruno Haible <bruno@clisp.org>
2491 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2492 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2494 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2496 * strftime.c (tzname): Don't declare if it is already #defined.
2497 Problem reported for Mingw by Mark Junker.
2499 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2501 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2502 long int, not int, for nanosecond counts, so that people who are
2503 used to POSIX struct timespec won't be surprised. Reported by Jim
2506 2005-12-16 Jim Meyering <jim@meyering.net>
2508 * fprintftime.c, fprintftime.h: New files.
2510 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2512 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2513 * argp-help.c (fill_in_uparams): Check if the constructed
2514 struct uparams is valid. Fall back to the default values if it is
2517 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2519 * argp-help.c (__argp_base_name): New function
2520 (__argp_short_program_name): Rewrite using __argp_base_name
2521 * argp-namefrob.h: Define program_invocation_name and
2522 program_invocation_short_name if requested
2523 (__argp_base_name): Add prototype
2524 * argp-parse.c (argp_def): Use gettext wrappers
2525 (argp_default_parser): Use __argp_base_name
2526 * argp-pin.c: New file. Defines program_invocation_name and
2527 program_invocation_short_name on systems that lack them.
2529 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2531 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2532 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2533 porting problem reported by Georg Schwarz in
2534 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2536 2005-07-09 Bruno Haible <bruno@clisp.org>
2538 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2539 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2540 Reported by Mark Junker <mjscod@gmx.de>.
2542 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2544 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2545 (uintmax_t) [defined uintmax_t]: Do not declare.
2546 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2547 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2548 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2549 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2550 sake of portability to weird hosts that C allows (though we don't
2551 know of any practical examples).
2553 * savedir.h (fdsavedir): New decl.
2554 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2555 contains most of the former guts of savedir.
2556 (savedir): Use savedirstream.
2559 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2561 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2562 coreutils no longer futzes with rounding modes.
2564 2005-11-14 Jim Meyering <jim@meyering.net>
2566 * mkstemp-safer.c: Include <config.h>, required for possible
2567 replacement of mkstemp.
2569 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2571 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2573 (gethrxtime) [! (HAVE_NANOUPTIME
2574 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2575 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2576 our own approximation.
2578 2005-11-10 Simon Josefsson <jas@extundo.com>
2580 * readline.c: Remove EOL.
2582 2005-11-08 Eric Blake <ebb9@byu.net>
2584 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2586 2005-11-08 Eric Blake <ebb9@byu.net>
2588 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2590 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2592 Fix porting problem reported by Theodoros V. Kalamatianos.
2593 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2594 Don't assume that futimes failing means we must fail.
2596 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2598 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2599 leave errno alone. Problem reported by Dmitry V. Levin.
2601 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2603 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2604 errno alone. Problem reported by Frederic Jolliton.
2606 2005-10-28 Simon Josefsson <jas@extundo.com>
2608 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2609 "restrict" keywords, as per POSIX. Protect the function
2610 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2611 Don't use K&R prototypes. Check the sprintf return values.
2612 Re-define EAFNOSUPPORT if not present. Indent.
2614 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2615 suggested by Bruno Haible <bruno@clisp.org>.
2617 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2619 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2621 * gc-libgcrypt.c: Add MD2 (which is not available through
2624 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2626 * md2.h, md2.c: New files.
2628 2005-10-24 Simon Josefsson <jas@extundo.com>
2630 * md4.h: Shrink buffer size, now that we changed the type.
2632 2005-10-22 Simon Josefsson <jas@extundo.com>
2634 * arcfour.h, arcfour.c: Use fixed size indices in the
2635 arcfour_context struct (simplify test vector testing in GNU
2638 2005-10-22 Simon Josefsson <jas@extundo.com>
2640 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2641 suggested by Bruno Haible <bruno@clisp.org>.
2643 2005-10-22 Simon Josefsson <jas@extundo.com>
2645 * crc.h: Include stddef.h, for size_t.
2647 2005-10-21 Simon Josefsson <jas@extundo.com>
2649 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2650 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2652 2005-10-21 Simon Josefsson <jas@extundo.com>
2654 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2657 2005-10-21 Simon Josefsson <jas@extundo.com>
2659 * gc-gnulib.c: Support ARCTWO in CBC mode.
2661 2005-10-21 Simon Josefsson <jas@extundo.com>
2663 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2666 * hmac-sha1.c (hmac_sha1): Likewise.
2668 * crc.c (crc32_update): Actually use crc parameter, suggested by
2669 Bruno Haible <bruno@clisp.org>.
2671 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2674 2005-10-21 Simon Josefsson <jas@extundo.com>
2676 * des.h, des.c: New files.
2678 * gc-gnulib.c: Support DES.c
2680 2005-10-21 Simon Josefsson <jas@extundo.com>
2682 * arctwo.h, arctwo.c: New files.
2684 * gc-gnulib.c: Support ARCTWO.
2686 2005-10-21 Simon Josefsson <jas@extundo.com>
2688 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2690 2005-10-19 Simon Josefsson <jas@extundo.com>
2692 * gc-gnulib.c: Support ARCFOUR.
2694 2005-10-19 Simon Josefsson <jas@extundo.com>
2696 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2699 * gc.h: Add ECB enum type.
2701 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2703 2005-10-19 Simon Josefsson <jas@extundo.com>
2705 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2707 2005-10-18 Simon Josefsson <jas@extundo.com>
2709 * md4.h, md4.c: New files, based on md5.?.
2711 2005-10-17 Simon Josefsson <jas@extundo.com>
2713 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2715 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2717 2005-10-17 Simon Josefsson <jas@extundo.com>
2719 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2721 2005-10-17 Simon Josefsson <jas@extundo.com>
2723 * gc.h, gc-libgcrypt.c: Add ciphers.
2725 2005-10-17 Simon Josefsson <jas@extundo.com>
2727 * sha1.c: Use uint32_t instead of md5_uint32.t
2729 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2732 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2734 * md5.h: Use stdint.h and uint32_t. Doc fix.
2736 2005-10-15 Simon Josefsson <jas@extundo.com>
2738 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2740 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2742 2005-10-14 Simon Josefsson <jas@extundo.com>
2744 * arcfour.h, arcfour.c: New files.
2746 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2748 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2749 include <wchar.h>; no longer needed.
2751 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2752 and Ulrich Drepper <drepper@redhat.com>
2755 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2756 instead of inline stream orientation test and two separate
2757 function calls. Pay no attention to USE_IN_LIBIO.
2759 2005-10-14 Roland McGrath <roland@redhat.com>
2761 Import from libc. [BZ #1331]
2762 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2764 Reported by Matej Vela <vela@debian.org>.
2766 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2768 * mkdir-p.c (make_dir_parents): Don't report an error if an
2769 intermediate directory is in a read-only file system. Problem
2770 reported by Eric Blake.
2772 2005-10-13 Simon Josefsson <jas@extundo.com>
2774 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2775 Move memory allocation outside of loop.
2777 2005-10-12 Simon Josefsson <jas@extundo.com>
2779 * gc-pbkdf2-sha1.c: New file.
2781 * gc.h: Add gc_pbkdf2_sha1 prototype.
2783 2005-10-12 Simon Josefsson <jas@extundo.com>
2785 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2786 suggested by Bruno Haible <bruno@clisp.org>.
2788 2005-10-12 Simon Josefsson <jas@extundo.com>
2790 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2792 * gc-gnulib.c (gc_hmac_sha1): New function.
2794 2005-10-12 Simon Josefsson <jas@extundo.com>
2796 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2798 2005-10-12 Simon Josefsson <jas@extundo.com>
2800 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2801 GC_USE_HMAC_MD5, respectively.
2803 * gc-libgcrypt.c (gc_md5): Fix assert call.
2806 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2808 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2810 * gc-gnulib.c (gc_hash_buffer): Ditto.
2812 2005-10-11 Bruno Haible <bruno@clisp.org>
2814 * c-strcasestr.h: New file, from GNU gettext.
2815 * c-strcasestr.c: New file, from GNU gettext.
2817 2005-10-11 Bruno Haible <bruno@clisp.org>
2819 * c-strcase.h: New file, from GNU gettext.
2820 * c-strcasecmp.c: New file, from GNU gettext.
2821 * c-strncasecmp.c: New file, from GNU gettext.
2823 2005-10-11 Simon Josefsson <jas@extundo.com>
2825 * crc.h, crc.c: New files.
2827 * gc.h (gc_hash_buffer): Add doc.
2829 2005-10-08 Simon Josefsson <jas@extundo.com>
2831 * gc.h: Add gc_hash and gc_hash_buffer.
2833 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2835 * gc-libgcrypt.c (gc_hash_buffer): Add.
2837 2005-10-11 Bruno Haible <bruno@clisp.org>
2839 * strcasecmp.c: Include limits.h.
2840 (strcasecmp): Avoid integer overflow on exotic platforms.
2841 * strncasecmp.c: Include limits.h.
2842 (strncasecmp): Avoid integer overflow on exotic platforms.
2843 Reported by Paul Eggert.
2845 2005-10-06 Simon Josefsson <jas@extundo.com>
2847 * hmac-md5.c: New file.
2851 2005-10-06 Simon Josefsson <jas@extundo.com>
2853 * memxor.c (memxor): Avoid casts and warnings.
2855 2005-10-05 Derek Price <derek@ximbiot.com>
2857 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2859 2005-10-05 Simon Josefsson <jas@extundo.com>
2861 * memxor.c (memxor): Fix compiler error.
2863 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2864 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2866 * memxor.h, memxor.c: New files.
2868 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2869 we assume all systems have it, suggested by Jim Meyering
2870 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2871 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2872 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2875 2005-10-04 Bruno Haible <bruno@clisp.org>
2877 * verify.h (verify_true): Provide alternative definition for C++.
2879 2005-10-04 Simon Josefsson <jas@extundo.com>
2881 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2882 D. Baushke" <mdb@gnu.org>.
2884 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2886 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2887 (SSIZE_MAX): New macro, if not already defined.
2888 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2891 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2893 * exclude.c: Include verify.h.
2894 (verify): Remove. All callers changed to use verify.h's version.
2895 * strtoimax.c: Likewise.
2896 * utimecmp.c: Likewis.e
2898 Sync from coreutils.
2899 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2900 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2901 * .cvsignore: Add fts.h, search.h, t-fpending.
2902 * settime.c (settime): Fix { typo in previous patch. Also, don't
2903 bother returning ENOSYS if settimeofday or stime fails; just let
2904 them return whatever errno they want to return.
2905 * utimens.c: Include unistd.h, for dup2.
2906 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2907 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2909 2005-10-02 Jim Meyering <jim@meyering.net>
2911 Sync from coreutils.
2912 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2913 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2914 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2915 Remove AT_FDCWD test.
2916 Do not consume the fd unless successful.
2917 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2918 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2919 block, so that we don't even try to compile it if settimeofday is
2920 available. This works around a compilation failure on OSF1 V5.1,
2921 due to stime requiring a `long int*' while tv_sec is `int'.
2923 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2925 * getdelim.c (getdelim): Remove unused variables.
2927 2005-10-01 Simon Josefsson <jas@extundo.com>
2929 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2930 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2931 AI_* and EAI_* definitions. Protect function declarations.
2933 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2935 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2936 so that the code works even with ancient cpp. Portability problem
2937 with GCC 2.7.2.1 reported by Thomas M.Ott.
2939 2005-09-27 Jim Meyering <jim@meyering.net>
2941 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2943 * intprops.h (signed_type_or_expr__): Define.
2944 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2947 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2949 * verify.h (verify_expr): Remove, replacing with:
2950 (verify_true): New macro that returns true instead of void.
2951 (verify_type__): Remove.
2952 (verify): Use verify_true rather than verify_type__.
2954 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2956 * utimens.c (ENOSYS): Define if not already defined.
2957 (futimens): Support having a null PATH if the file descriptor
2960 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2962 (__attribute): Define to empty unless GCC 3.1 or later.
2963 This works around a core dump on OpenBSD 3.4, which has GCC
2964 2.95.3, which dumps core when given __attribute__(()). It also
2965 simplifies other tests, since we really don't want to bother with
2966 worrying about which ancient version of GCC supported what.
2967 Original problem reported by Yoann Vandoorselaere, with part of
2968 the fix suggested by Derek Price.
2970 2005-09-24 Jim Meyering <jim@meyering.net>
2972 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2973 so we can once again use a positive bitfield width of 1 -- now we
2974 don't have to explain why we were using a bitfield width of 2.
2976 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2978 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2979 Problem reported by Eric Blake.
2980 (getaddrinfo): Initialize se so that it's not garbage.
2981 Redo internal storage allocation so that it doesn't make unportable
2982 assumptions about alignment.
2985 * utimens.c (futimens): Use futimesat if available.
2986 Prefer it to futimes since it doesn't have the futimes bug.
2988 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2989 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2990 Instead, declare a function that returns a pointer to an array,
2991 and use verify_type__ to declare the size of the array.
2992 Problem and germ of a solution reported by Bruno Haible.
2993 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2994 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2996 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2998 Sync from coreutils.
3000 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3002 * argmatch.h: Include verify.h
3003 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3004 (ARGMATCH_ASSERT): Remove; unused.
3005 * canonicalize.c: Assume STDC_HEADERS.
3006 * exclude.c: Include "strcase.h".
3007 * regex_internal.h [!defined _LIBC]: Likewise.
3008 * getusershell.c: Include stdio--.h rather than stdio.h
3010 (getusershell): Call fopen, not fopen_safer.
3011 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3012 Do not include unistd-safer.h.
3013 (save_cwd): Don't call fd_safer; no longer needed
3014 now that we include fcntl--.h.
3016 * getdate.y (relative_time): New type.
3017 (RELATIVE_TIME_0): New constant.
3018 (parser_control): Use relative_time instead of doing it ourselves.
3019 (%union): Add new relative_time rel member.
3020 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3022 (relunit, relunit_snumber): Now of type rel.
3023 (zone, rel, relunit, get_date): Adjust to above changes.
3025 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3026 Do not include unistd-safer.h.
3027 (getloadavg): Don't call fd_safer; no longer needed
3028 now that we include fcntl--.h.
3030 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3031 (make_dir_parents): Treat ENOSYS like EEXIST.
3033 Improve quality of diagnostics on restore_cwd failure.
3034 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
3035 (make_dir_parents): Last arg is now int * (for errno), not bool *.
3036 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3037 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3038 each time through the loop. Do not diagnose restore_cwd failure;
3039 that is the caller's job (and perhaps the caller does not care).
3041 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3042 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3043 If the file already exists but is not a directory, don't bother
3044 to try to make its parents.
3045 Close potential file descriptor leak if we can't chdir("/") (!).
3046 Don't always return true if chdir($PWD) fails; return true only
3047 if the requested action was done successfully (except for the
3049 Don't log final directory unless we actually made it.
3050 Refactor to avoid duplicate code to fix up permissions.
3051 Don't attempt to fix up parent permissions if chdir($PWD) fails.
3053 * strftime.c (my_strftime): Rewrite the previous change slightly,
3054 to make it a bit faster and (I hope) clearer.
3055 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3056 Fix bug in formats like %2N.
3058 * verify.h: New file.
3060 2005-09-22 Jim Meyering <jim@meyering.net>
3062 Sync from coreutils.
3064 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3066 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3067 the .tm_year member, since otherwise gcc-4.0 would now warn about
3068 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3070 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3071 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3073 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3074 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3075 when run in a time zone for which daylight savings time is in effect
3076 for the starting date.
3078 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3079 stop us from restricting permissions of just-created absolute-named
3081 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3082 to restore initial working directory.
3083 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3084 to tell caller if/when we change the working directory and are
3085 unable to return to the initial one.
3086 * mkdir-p.h (make_dir_parents): Update prototype.
3087 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3088 `return false'. This fixes a bug introduced on 2004-07-30.
3090 * openat.c (fdopendir): Be sure to close the supplied
3091 file descriptor before returning. This makes our replacement
3092 implementation a little closer to Solaris's, where fdopendir
3093 ties the file descriptor to the returned DIR* pointer.
3094 * openat.c (unlinkat): New function.
3095 * openat.h (unlinkat): Add prototype.
3096 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3097 (openat_restore_fail): Rename from openat_restore_die.
3098 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3100 Provide an alternative to exiting immediately upon save_cwd or
3101 restore_cwd failure. Now, an application can arrange e.g.,
3102 to perform a longjump in that case.
3103 * openat.c: Include dirname.h.
3104 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3105 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3106 and openat_restore_die rather than calling error directly.
3107 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3109 * openat-die.c (openat_save_die, openat_restore_die): New file.
3110 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3112 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3113 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3114 int utc, int nanoseconds);
3116 date should not have to allocate a megabyte of virtual memory to
3117 handle a format argument like +%1048575T. When implemented with
3118 strftime, it must allocate such a buffer, use strftime to fill it
3119 in, print it, then free it.
3120 With fprintftime, it simply prints everything and exits.
3121 With no need for memory allocation, that's one fewer way to fail.
3122 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3123 optional field width, not before, so we accept %9:z, not %:9z.
3124 (my_strftime): Be sure to use L_('x') for literals.
3126 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3127 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3128 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3129 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3130 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3131 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3132 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3133 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3134 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3136 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3137 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3138 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3139 and don't include <sys/file.h>).
3141 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3143 Sync from coreutils.
3145 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3146 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3147 [!LDAV_DONE]: Avoid unused variable warning.
3149 2005-09-21 Bruno Haible <bruno@clisp.org>
3151 * unicodeio.h (unicode_to_mb): New declaration.
3153 2005-09-20 Derek Price <derek@ximbiot.com>
3155 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3157 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3159 Use a consistent style for including <config.h>.
3160 * __fpending.c, acl.c, argmatch.c,
3161 argp-help.c, argp-parse.c,
3162 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3163 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3164 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3165 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3166 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3167 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3168 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3169 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3170 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3171 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3172 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3173 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3174 modechange.c, mountlist.c, open-safer.c, physmem.c,
3175 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3176 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3177 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3178 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3179 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3180 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3181 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3182 userspec.c, utimecmp.c, version-etc-fsf.c,
3183 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3184 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3185 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3186 Standardize inclusion of config.h.
3187 * __fpending.h, dirfd.h, getdate.h, human.h,
3188 inttostr.h: Removed inclusion of config.h from header files.
3189 * inttostr.c: Adjusted in-tree users.
3190 * timespec.h: Remove superfluous warning to include config.h.
3191 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3192 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3193 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3194 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3196 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3198 * stat-time.h: New file.
3199 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3200 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3202 (timespec_cmp): New function.
3203 * utimecmp.c: Include stat-time.h.
3204 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3205 members exist, not on the obsolescent ST_MTIM_NSEC.
3206 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3208 2005-09-15 Derek Price <derek@ximbiot.com>
3209 Paul Eggert <eggert@cs.ucla.edu>
3211 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3212 changes, consolidating in...
3213 * regex_internal.h: ...this file.
3215 2005-09-15 Derek Price <derek@ximbiot.com>
3217 * regex_internal.h: Blank `pure' for GNUC < 3.
3218 * regex_internal.c: Ditto, using this...
3219 (__GNUC_PREREQ): ...new macro.
3220 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3221 (__GNUC_PREREQ): ...this new macro.
3223 * strstr.h: Include string.h. Define strstr as a macro here.
3225 2005-09-13 Derek Price <derek@ximbiot.com>
3227 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3229 Reported by Jim Meyering <jim@meyering.net>.
3231 2005-09-13 Jim Meyering <jim@meyering.net>
3233 * canon-host.c: Filter through gnu indent and reword comments slightly.
3234 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3236 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3239 (base64_encode): Put b64str in initialized data section.
3241 2005-09-12 Derek Price <derek@ximbiot.com>
3243 Return usable errors from canon-host.
3244 * canon-host.h: New file.
3245 * canon-host.c (canon_host): Wrap...
3246 (canon_host_r): ...this new function, which now relies exclusively on
3248 (ch_strerror): New function.
3249 (last_cherror): New global.
3250 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3251 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3253 (freeaddrinfo): Free ai->ai_canonname when set.
3255 2005-09-12 Derek Price <derek@ximbiot.com>
3256 Paul Eggert <eggert@cs.ucla.edu>
3258 * glob-libc.h: Renamed from glob_.h. The new version is
3259 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3260 protecting things that should be done only in gnulib contexts.
3261 * glob_.h: New file, containing only the glob things needed for
3263 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3264 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3265 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3266 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3267 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3268 and to respect the namespace rules better.
3270 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3272 Merge glibc and coreutils changes into gnulib, plus a few
3274 * md5.c: Use #error rather than a string.
3275 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3276 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3277 (__attribute__): Define to empty for non recent-GCC.
3278 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3279 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3280 Renamed from their non-__ counterparts, with new macros replacing
3281 them if not _LIBC. Add __THROW attribute.
3283 (struct md5_ctx): Align buffer if using GCC.
3284 * sha1.h (struct sha1_ctx): Likewise.
3285 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3286 The old name was backwards.
3287 (NOTSWAP): Remove; not used.
3288 (rol): New macro, moved here from md5.h.
3289 (sha1_process_block): Remove a FIXME that doesn't make sense.
3291 2005-09-12 Derek Price <derek@ximbiot.com>
3293 * gai_strerror.c: Include config.h when available. Include
3294 getaddrinfo.h before other headers to test interface.
3295 Reported by Larry Jones <lawrence.jones@ugs.com>.
3297 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3299 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3300 definitions, since that's the preferred style in glibc.
3301 Fix a minor spacing issue, and update copyright notice to match glibc's.
3303 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3305 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3307 2005-09-06 Simon Josefsson <jas@extundo.com>
3309 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3310 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3312 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3314 Change bitset word type from unsigned int to unsigned long int,
3315 as this has better performance on typical 64-bit hosts.
3316 Port bitset code to hosts with unusual word sizes.
3317 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3318 (build_collating_symbol):
3319 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3320 argument is a bitset. This is merely a style issue, but it makes
3321 it clearer that an entire array is expected.
3322 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3323 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3324 Port to the case where bitset_word is not the same as unsigned int.
3325 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3326 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3328 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3329 (build_trtable, group_nodes_into_DFAstates):
3331 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3332 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3333 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3334 * regexec.c (group_nodes_into_DFAstates): Likewise.
3335 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3336 * regcomp.c (optimize_subexps, lower_subexp):
3337 Work even if bitset_word has holes in its bitwise representation.
3338 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3339 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3341 * regex_internal.c (re_string_reconstruct):
3342 Don't assume UCHAR_MAX == 255.
3343 * regex_internal.h (bitset_set_all): Likewise.
3344 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3346 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3347 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3349 (BITSET_WORD_MAX): New macro.
3350 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3351 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3352 (bitset_empty, bitset_copy):
3353 Prefer sizeof (bitset) to multiplying it out ourselves.
3354 (bitset_not_merge): Remove; unused.
3355 (bitset_contain): Return bool, not unsigned int with one bit on.
3356 All callers changed.
3357 * regexec.c (build_trtable): Don't assume bitset has no stricter
3358 alignment than re_node_set; do this by defining a new internal
3359 type struct dests_alloc and using it to allocate memory.
3361 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3363 Check for arithmetic overflow when calculating sizes, to prevent
3364 some buffer-overflow issues. These patches are conservative, in the
3365 sense that when I couldn't determine whether an overflow was possible,
3366 I inserted a run-time check.
3367 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3368 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3369 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3370 (re_xnrealloc, re_x2nrealloc): New inline functions.
3371 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3372 (build_equiv_class, build_charclass): Check for arithmetic overflow
3373 in size expression calculations.
3374 * regex_internal.c (re_string_realloc_buffers):
3375 (build_wcs_upper_buffer, re_node_set_add_intersect):
3376 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3377 (re_dfa_add_node, register_state): Likewise.
3378 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3379 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3380 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3381 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3383 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3385 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3386 to avoid a collision with bits/local_lim.h in glibc.
3387 All uses changed. Problem reported by Dmitry V. Levin in
3388 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3390 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3391 bugs in int versus size_t comparisons.
3392 (re_string_context_at): Fix bug where the code assumed that
3395 Use bool where appropriate.
3396 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3397 All callers changed.
3398 (calc_eclosure_iter): Likewise, for ROOT arg.
3399 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3400 (build_charclass_op): Likewise, for NON_MATCH arg.
3401 * regex_internal.c (re_string_allocate, re_string_construct):
3402 (re_string_construct_common): Likewise, for ICASE arg.
3403 * regexec.c (re_search_2_stub, re_search_stub):
3404 Likewise, for RET_LEN arg.
3405 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3406 (set_regs): Likewise, for FL_BACKTRACK arg.
3407 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3408 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3409 (calc_eclosure_iter, parse_bracket_exp):
3410 Use bool for internal variables that are booleans.
3411 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3412 (set_regs, build_sifted_states, sift_states_bkref):
3413 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3414 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3415 (find_collation_sequence_value):
3417 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3418 (re_node_set_compare):
3419 Return bool, not int. All callers changed.
3420 * regexec.c (check_halt_node_context, check_dst_limits):
3421 (build_trtable, check_node_accept): Likewise.
3422 * regex_internal.h: Include stdbool.h.
3424 Fix bugs uncovered when converting to bool.
3425 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3426 failure instead of charging ahead blindly.
3427 * regex_internal.c (register_state): Likewise.
3428 * regexec.c (re_search_2_stub): Use simpler method than boolean
3429 for freeing internal storage.
3430 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3431 bitset pieces used as boolean, to avoid undefined behavior
3432 on hosts that do int overflow checking.
3434 2005-08-31 Derek Price <derek@ximbiot.com>
3436 * getdelim.c (getdelim): Return EOF on EOF.
3437 Reported by Larry Jones <lawrence.jones@ugs.com>.
3439 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3441 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3442 lengths fit in regoff_t; this isn't true if regoff_t is the same
3444 * regex.c (re_search_internal): 5th arg is LAST_START
3445 (= START + RANGE) instead of RANGE. This avoids overflow
3446 problems when regoff_t is the same width as size_t.
3447 All callers changed.
3448 (re_search_2_stub): Check for overflow when adding the
3449 sizes of the two strings.
3450 (re_search_stub): Check for overflow when adding START
3451 to RANGE; if it occurs, substitute the extreme value.
3453 2005-08-31 Jim Meyering <jim@meyering.net>
3455 * regcomp.c (search_duplicated_node): Make first pointer arg
3457 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3458 (register_state): Likewise.
3459 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3460 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3461 (group_nodes_into_DFAstates): Likewise.
3463 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3465 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3466 old glibc regex code mishandles strings longer than 2**31 bytes.
3467 This patch fixes this when the regex code is used in gnulib
3468 (i.e., outside glibc).
3470 This patch should not affect the use of the regex code inside
3471 glibc. No doubt this problem also needs to be handled for glibc
3472 as well, but the result will be an incompatible change to the
3473 glibc ABI, and the old ABI will have to be supported too. That
3474 can be the the subject for another patch.
3476 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3477 governing whether the rest of this patch is active. By default,
3478 the macro is disabled and the patch has no effect.
3479 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3480 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3481 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3482 (re_match_2, re_set_registers): Use the new types.
3483 * regex_internal.h (Idx, re_hashval_t): New types.
3484 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3486 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3487 (re_string_context_at, bin_tree_t, re_dfastate_t):
3488 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3489 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3490 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3491 (re_string_char_size_at, re_string_wchar_at):
3492 (re_string_elem_size_at):
3493 Use the new types and macros to port to 64-bit hosts.
3494 Use unsigned types for internal values, so that the code
3495 mostly works even for arrays larger than SSIZE_MAX.
3496 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3497 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3498 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3499 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3500 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3501 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3502 (calc_inveclosure, parse_dup_op, build_range_exp):
3503 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3504 (fetch_number, create_token_tree, mark_opt_subexp):
3506 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3507 (create_cd_newstate, re_string_allocate, re_string_construct):
3508 (re_string_realloc_buffers, build_wcs_upper_buffer):
3509 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3510 (re_string_reconstruct, re_string_peek_byte_case):
3511 (re_string_fetch_byte_case, re_string_context_at):
3512 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3513 (re_node_set_init_copy, re_node_set_add_intersect):
3514 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3515 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3516 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3517 (re_acquire_state, re_acquire_state_context, register_state):
3519 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3520 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3521 (re_search_internal, re_search_2_stub, re_search_stub)
3522 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3523 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3524 (update_cur_sifted_state, check_dst_limits):
3525 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3526 (check_subexp_limits, sift_states_bkref, merge_state_array):
3527 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3528 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3529 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3530 (expand_bkref_cache, check_node_accept_bytes):
3531 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3532 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3533 (acquire_init_state_context, check_halt_node_context):
3534 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3535 (sift_states_backward, clean_state_log_if_needed):
3536 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3537 (find_recover_state, transit_state_sb, transit_state_mb):
3538 (transit_state_bkref, build_trtable, match_ctx_clean):
3540 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3541 to work around an assumption that REG_MISSING is negative.
3543 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3544 (seek_collating_symbol_entry) [defined _LIBC]:
3545 (lookup_collation_sequence_value) [defined _LIBC]:
3546 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3547 Use prototypes rather than old-style function definitions.
3548 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3549 (transit_state_sb) [0]:
3550 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3552 * regexec.c (re_search_internal): Simplify update of rm_so and
3555 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3556 (optimize_subexps, lower_subexp):
3557 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3558 since the signed shift might overflow. Use 1u<<31 instead.
3559 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3560 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3563 * regcomp.c (optimize_subexps, lower_subexp):
3564 Use CHAR_BIT rather than 8, for clarity.
3565 * regexec.c (check_dst_limits_calc_pos_1):
3566 (check_subexp_matching_top): Likewise.
3567 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3568 have to worry about portability issues when shifting it left.
3569 Remove no-longer-needed test for table_size > 0.
3570 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3571 in a word, as the resulting behavior is undefined.
3572 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3573 in one case, a <= should have been an <, and in another case the
3574 whole test was missing.
3575 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3576 the standard name CHAR_BIT.
3577 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3578 this is not true on one's complement and signed-magnitude hosts.
3580 * regex_internal.h (re_sub_match_top_t): Remove unused member
3582 (struct re_dfa_t): Remove unused member states_alloc.
3583 * regcomp.c (init_dfa): Don't initialize unused members.
3585 2005-08-31 Bruno Haible <bruno@clisp.org>
3587 * strstr.c: Include <stddef.h>, for NULL.
3588 * strcasestr.c: Likewise.
3589 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3591 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3593 * iconvme.h: Add prototype for iconv_alloc.
3595 2005-08-29 Simon Josefsson <jas@extundo.com>
3597 * iconvme.c: Fix errno.
3599 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3601 * iconvme.c: Split iconv_string into iconv_alloc.
3603 2005-08-27 Jim Meyering <jim@meyering.net>
3605 * fopen-safer.c: Merge minor changes from coreutils.
3606 * dup-safer.c: Likewise.
3607 * fd-safer.c: Likewise.
3609 Merge from coreutils.
3610 * stdio--.h: New file.
3611 * stdlib--.h: New file.
3612 * mkstemp-safer.c: New file.
3614 GNU tar needs these.
3615 * pipe-safer.c: New file.
3616 * creat-safer.c: New file.
3617 * fcntl--.h (creat): Define to creat_safer.
3618 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3619 * unistd--.h (pipe): Define to pipe_safer.
3620 * unistd-safer.h: Declare pipe_safer.
3622 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3624 * regex_internal.h: Remove all references to
3625 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3627 (bitset_not, bitset_merge, bitset_not_merge):
3628 (bitset_mask, re_string_allocate, re_string_construct):
3629 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3630 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3631 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3632 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3633 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3634 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3635 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3636 (re_acquire_state_context):
3637 Remove unnecessary forward decls.
3638 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3639 Put __attribute at function definition,
3640 now that the function decl has been removed.
3641 * regex_internal.c (re_string_peek_byte_case):
3642 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3645 2005-08-26 Simon Josefsson <jas@extundo.com>
3647 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3648 Haible <bruno@clisp.org>.
3650 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3652 * regexec.c (set_regs): Don't alloca with an unbounded size.
3654 alloca modernization/simplification for regex.
3655 * regex.c: Remove portability cruft for alloca. This no longer
3656 needs to be at the start of the file, and can be moved into
3657 regex_internal.h and simplified.
3658 * regex_internal.h: Include <alloca.h>.
3659 (__libc_use_alloca) [!defined _LIBC]: New macro.
3660 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3661 now works outside glibc.
3663 2005-08-24 Simon Josefsson <jas@extundo.com>
3665 * getpass.c: Add WIN32 implementation. Conditionalize use of
3666 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3667 GLIBC specific code.
3669 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3671 Make regex safe for g++. This fixes one real bug (an "err"
3672 that should have been "*err"). g++ problem reported by
3674 * regex_internal.h (re_calloc): New macro, consistent with
3675 re_malloc etc. All callers of calloc changed to use re_calloc.
3676 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3677 not int. All callers changed.
3678 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3679 just use an array of size MB_LEN_MAX.
3680 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3681 (find_recover_state): Change "err" to "*err"; this fixes what
3682 appears to be a real bug.
3683 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3686 2005-08-25 Jim Meyering <jim@meyering.net>
3688 * open-safer.c: Include <config.h>.
3689 Otherwise, we'd lose LARGEFILE support in any file using
3692 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3694 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3695 * regex.h (regerror): Likewise.
3697 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3698 requires this. (The code never needed it.)
3700 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3701 All uses of recently-renamed identifiers changed to use the new,
3702 POSIX-compliant names. The code will build and run just fine
3703 without these changes, but it's better to eat our own dog food
3704 and use the standard-conforming names.
3706 * regex.h: Fix a multitude of POSIX name space violations.
3707 These changes have an effect only for programs that define
3708 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3709 do not change anything for programs compiled in the normal way.
3710 Also, there is no effect on the ABI.
3712 (_REGEX_SOURCE): New macro.
3713 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3714 defined and _GNU_SOURCE is not; this fixes a name space violation.
3716 Rename the following macros to obey POSIX requirements.
3717 The old names are still visible as macros if _REGEX_SOURCE is defined.
3718 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3719 RE_BACKSLASH_ESCAPE_IN_LISTS.
3720 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3721 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3722 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3723 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3724 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3725 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3726 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3727 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3728 (REG_INTERVALS): renamed from RE_INTERVALS.
3729 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3730 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3731 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3732 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3733 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3734 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3735 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3736 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3737 RE_UNMATCHED_RIGHT_PAREN_ORD.
3738 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3739 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3740 (REG_DEBUG): renamed from RE_DEBUG.
3741 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3742 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3743 unusual, since we can't clash with the POSIX REG_ICASE.
3744 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3745 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3746 (REG_NO_SUB): renamed from RE_NO_SUB.
3747 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3748 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3749 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3750 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3751 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3752 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3753 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3754 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3755 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3756 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3757 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3758 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3759 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3760 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3761 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3762 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3763 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3764 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3765 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3766 (REG_FIXED): Renamed from REGS_FIXED.
3767 (REG_NREGS): Renamed from RE_NREGS.
3769 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3770 of other REG_* macros, since POSIX says the user is allowed to
3771 #undef these macros selectively.
3773 (reg_errcode_t): Update comment stating what other tables need
3776 Rename the following enum values to obey POSIX requirements.
3777 The old names are still visible as macros.
3778 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3779 is not defined, since GNU is supposed to be a superset of POSIX as
3780 much as possible, and since we want reg_errcode_t to be a signed
3781 type for implementation consistency.
3782 (_REG_NOERROR): Renamed from REG_NOERROR.
3783 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3784 (_REG_BADPAT): Renamed from REG_BADPAT.
3785 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3786 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3787 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3788 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3789 (_REG_EBRACK): Renamed from REG_EBRACK.
3790 (_REG_EPAREN): Renamed from REG_EPAREN.
3791 (_REG_EBRACE): Renamed from REG_EBRACE.
3792 (_REG_BADBR): Renamed from REG_BADBR.
3793 (_REG_ERANGE): Renamed from REG_ERANGE.
3794 (_REG_ESPACE): Renamed from REG_ESPACE.
3795 (_REG_BADRPT): Renamed from REG_BADRPT.
3796 (_REG_EEND): Renamed from REG_EEND.
3797 (_REG_ESIZE): Renamed from REG_ESIZE.
3798 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3799 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3800 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3801 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3802 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3804 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3805 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3806 changed. But support the old name if the new one is not defined
3807 and if _REGEX_SOURCE.
3809 Change the following member names in struct re_pattern_buffer.
3810 The old names are still supported if !_REGEX_SOURCE.
3811 The new names are always supported, regardless of _REGEX_SOURCE.
3812 (re_buffer): Renamed from buffer.
3813 (re_allocated): Renamed from allocated.
3814 (re_used): Renamed from used.
3815 (re_syntax): Renamed from syntax.
3816 (re_fastmap): Renamed from fastmap.
3817 (re_translate): Renamed from translate.
3818 (re_can_be_null): Renamed from can_be_null.
3819 (re_regs_allocated): Renamed from regs_allocated.
3820 (re_fastmap_accurate): Renamed from fastmap_accurate.
3821 (re_no_sub): Renamed from no_sub.
3822 (re_not_bol): Renamed from not_bol.
3823 (re_not_eol): Renamed from not_eol.
3824 (re_newline_anchor): Renamed from newline_anchor.
3826 Change the following member names in struct re_registers.
3827 The old names are still supported if !_REGEX_SOURCE.
3828 The new names are always supported, regardless of _REGEX_SOURCE.
3829 (rm_num_regs): Renamed from num_regs.
3830 (rm_start): Renamed from start.
3831 (rm_end): Renamed from end.
3833 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3834 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3835 Prepend __ to parameter names.
3837 Undo yesterday's changes.
3839 2005-08-24 Jim Meyering <jim@meyering.net>
3841 Sync from coreutils.
3842 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3844 2005-08-21 Bruno Haible <bruno@clisp.org>
3846 * lock.h: Add multiple inclusion guard.
3847 * tls.h: Add multiple inclusion guard.
3849 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3851 * regex.h (REG_NOSYS)
3852 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3853 Define, since POSIX requires it as of 2001.
3854 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3855 New private symbol, used to keep the enum signed in all cases.
3856 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3857 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3859 * regex_internal.c (re_string_skip_chars, register_state):
3861 Remove forward decls; no longer needed now that we use prototypes.
3862 * regexec.c (acquire_init_state_context, check_halt_node_context):
3863 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3864 (clean_state_log_if_needed): Likewise.
3866 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3868 Fix problems reported by Sam Steingold in
3869 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3870 * regexec.c (sift_states_bkref): Fix portability bug: the code
3871 assumed that reg_errcode_t is a signed type, which is not
3872 necessarily true if _XOPEN_SOURCE is not defined.
3873 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3874 some compilers warn about it otherwise.
3876 2005-08-20 Jim Meyering <jim@meyering.net>
3878 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3879 of unused local, dfa.
3881 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3883 * regcomp.c (create_initial_state): Remove duplicate decl.
3884 (init_word_char, create_initial_state, duplicate_node_closure):
3885 (fetch_token, peek_token_bracket, build_range_exp):
3886 (build_collating_symbol): Remove forward decls; no longer needed
3887 now that we use prototypes.
3890 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3891 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3892 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3893 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3894 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3895 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3896 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3897 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3898 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3899 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3900 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3901 (build_charclass, build_charclass_op, fetch_number, create_tree):
3902 (create_token_tree, mark_opt_subexp, duplicate_tree):
3903 Use prototypes rather than old-style definitions.
3906 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3907 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3908 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3909 (re_string_reconstruct, re_string_peek_byte_case):
3910 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3911 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3912 (re_node_set_init_copy, re_node_set_add_intersect):
3913 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3914 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3915 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3916 (re_acquire_state, re_acquire_state_context, register_state):
3917 (create_ci_newstate, create_cd_newstate, free_state):
3919 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3920 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3921 (re_search_internal, prune_impossible_nodes):
3922 (acquire_init_state_context, check_matching, static):
3923 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3924 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3925 (update_regs, sift_states_backward, build_sifted_states):
3926 (clean_state_log_if_needed, merge_state_array):
3927 (update_cur_sifted_state, add_epsilon_src_nodes):
3928 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3929 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3930 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3931 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3932 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3933 (check_arrival, check_arrival_add_next_nodes):
3934 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3935 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3936 (check_node_accept_bytes, check_node_accept, extend_buffers):
3937 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3938 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3943 (re_string_allocate, re_string_construct, re_string_reconstruct):
3944 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3945 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3946 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3947 (re_string_context_at, re_string_peek_byte_case):
3948 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3949 is defined, since we now use prototypes always.
3951 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3952 C89 or better. All uses removed.
3954 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3956 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3957 [defined lint]: Suppress bogus uninitialized-variable warnings.
3959 * regcomp.c (duplicate_node): Return new index, not an error code,
3960 and let the caller return REG_ESPACE if out of space. This
3961 removes an uninitialied-variable warning with GCC 4.0.1, and also
3962 avoids taking the address of a local variable. All callers
3965 2005-08-19 Jim Meyering <jim@meyering.net>
3967 * regexec.c (proceed_next_node): Redo local variables to
3968 avoid GCC shadowing warnings.
3970 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3972 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3973 (re_node_set_insert_last, re_dfa_add_node):
3974 Rename local variables to avoid GCC shadowing warnings.
3976 2005-08-18 Bruno Haible <bruno@clisp.org>
3978 * strstr.c (strstr): Fix return value in multibyte case.
3979 * strcasestr.c (strcasestr): Likewise.
3981 2005-08-17 Jim Meyering <jim@meyering.net>
3983 Make the %s format (seconds since the epoch) work for a negative
3984 number and when used with a zero-padded field width, e.g. %015s.
3986 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3987 label so that it precedes the code to set `digits'. Otherwise,
3988 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3989 print `00-22'. Now, it prints `-0022', as it should.
3991 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3993 * regex.h: Remove useless space-before-tab. From coreutils.
3995 2005-08-17 Bruno Haible <bruno@clisp.org>
3997 * strcasestr.h: New file.
3998 * strcasestr.c: New file.
4000 2005-08-17 Bruno Haible <bruno@clisp.org>
4002 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4003 * strstr.c: Completely rewritten, with multibyte locale support.
4005 2005-08-17 Bruno Haible <bruno@clisp.org>
4007 * strcasecmp.c: Use mbuiter.h.
4009 2005-08-17 Bruno Haible <bruno@clisp.org>
4011 * mbuiter.h: New file.
4013 2005-08-16 Bruno Haible <bruno@clisp.org>
4015 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4017 (mbi_avail, mbi_advance): Let the iteration end before the terminating
4018 NUL byte, not after it.
4020 2005-08-16 Bruno Haible <bruno@clisp.org>
4022 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4023 the valid ones. Makes the comparison operations transitive:
4024 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4025 * strcasecmp.c (strcasecmp): Use mb_casecmp.
4027 2005-08-16 Bruno Haible <bruno@clisp.org>
4029 * strcase.h (strcasecmp): Add note in comments.
4030 * strncasecmp.c: Use code from strcasecmp.c.
4031 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4032 (strcasecmp): Work correctly in multibyte locales.
4034 2005-08-16 Bruno Haible <bruno@clisp.org>
4036 * strnlen1.h: New file.
4037 * strnlen1.c: New file.
4039 2005-08-16 Bruno Haible <bruno@clisp.org>
4041 * mbfile.h: New file.
4043 2005-08-16 Bruno Haible <bruno@clisp.org>
4045 * mbiter.h: New file.
4047 2005-08-16 Bruno Haible <bruno@clisp.org>
4049 * mbchar.h: New file.
4050 * mbchar.c: New file.
4052 2005-08-16 Bruno Haible <bruno@clisp.org>
4054 * tls.h: New file, from GNU gettext.
4055 * tls.c: New file, from GNU gettext.
4057 2005-08-15 Bruno Haible <bruno@clisp.org>
4059 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4062 2005-08-14 Jim Meyering <jim@meyering.net>
4064 Sync from coreutils.
4066 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4067 Use the hash-table-based cycle-detection code not just when
4068 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4069 Reported by James Youngman in
4070 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4071 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4072 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4073 This lets us compile with -DFTS_DEBUG, once again.
4074 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4075 * fts.c (fd_safer): Remove decl.
4076 Include fcntl--.h rather than unistd-safer.h
4077 (fts_safe_changedir): Don't call fd_safer; no longer needed
4078 now that we include fcntl--.h.
4080 2005-08-11 Simon Josefsson <jas@extundo.com>
4082 * readline.h, readline.c: New file.
4084 2005-08-11 Bruno Haible <bruno@clisp.org>
4086 * strnlen.h (strnlen): Change parameter name to match comment.
4088 2005-08-10 Simon Josefsson <jas@extundo.com>
4090 * strndup.c: Use strnlen.h.
4092 * strnlen.h: New file.
4094 2005-08-02 Simon Josefsson <jas@extundo.com>
4096 * getline.h, getline.c: Rewrite.
4098 * getdelim.h, getdelim.c: New files, ported from glibc.
4100 2005-07-31 Bruno Haible <bruno@clisp.org>
4102 * lock.h (gl_lock_initializer): New macro.
4103 (gl_lock_define_initialized): Use it.
4104 (gl_rwlock_initializer): New macro.
4105 (gl_rwlock_define_initialized): Use it.
4106 (gl_recursive_lock_initializer): New macro.
4107 (gl_recursive_lock_define_initialized): Use it.
4109 2005-07-26 Bruno Haible <bruno@clisp.org>
4111 * lock.h: Update from GNU gettext.
4112 * lock.c: Update from GNU gettext.
4114 2005-07-18 Bruno Haible <bruno@clisp.org>
4116 * lock.h (gl_once_t): New type.
4117 (gl_once_define, gl_once): New macros.
4118 * lock.c (fresh_once): New variable.
4119 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4122 2005-07-18 Simon Josefsson <jas@extundo.com>
4124 * check-version.c (check_version): Accept identical versions too.
4126 2005-07-18 Bruno Haible <bruno@clisp.org>
4128 * lock.h: New file, from GNU gettext.
4129 * lock.c: New file, from GNU gettext.
4131 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4133 * quotearg.c: Add translator comment suggested by Bruno Haible,
4134 with a minor change.
4136 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4138 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4139 copyright symbol and the year.
4140 * version-etc.c (COPYRIGHT_YEAR): New constant.
4141 (version_etc_va): Use parameterized copyright notice.
4142 Reword to conform to the current GNU coding standards.
4144 2005-07-11 Simon Josefsson <jas@extundo.com>
4146 * size_max.h: New file.
4148 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4150 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4153 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4154 and Paul Eggert <eggert@cs.ucla.edu>
4156 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4157 in wint_t, not wchar_t. Remove now-unnecessary cast.
4159 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4161 * regex.c, regex.h: Sync from libc.
4162 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4163 New files, synced from libc, except that regex_internal.h
4164 currently has a small porting fix.
4166 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4168 Remove the dependency of the strftime module on the tzset module.
4169 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4170 Copy the input structure, to work around some of the bug with
4171 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4172 Solaris releases, you should also use the tzset module, but we won't
4173 require it as a dependency any more since we don't want LGPLed code
4174 to depend on GPLed code.
4176 2005-07-02 Jim Meyering <jim@meyering.net>
4178 * backupfile.c (backup_args): Change a `0' to NULL.
4180 2005-07-01 Jim Meyering <jim@meyering.net>
4182 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4183 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4184 * save-cwd.c, tempname.c:
4185 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4186 and don't include <sys/file.h>).
4188 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4190 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4191 declares only 'struct timespec;' (!).
4193 2005-06-29 Jim Meyering <jim@meyering.net>
4195 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4196 type name. Use the variable name instead.
4197 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4199 2005-06-28 Simon Josefsson <jas@extundo.com>
4201 * check-version.h, check-version.c: New files.
4203 2005-06-28 Simon Josefsson <jas@extundo.com>
4205 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4206 collision with global variable. Better indentation. Don't
4207 increment buffer pointer beyond buffer end. Based on comments
4208 from Paul Eggert <eggert@cs.ucla.edu>.
4212 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4214 * canon-host.c (canon-host): Append trailing "," to 0 in
4215 initializer of struct addrinfo, as an indication that we don't
4216 care how many members the structure has.
4218 2005-06-24 Derek Price <derek@ximbiot.com>
4219 and Bruno Haible <bruno@clisp.org>
4221 Remove stat module & update lstat.
4222 * stat.c: Remove this file...
4223 (slash_aware_lstat): ...moving this content and its support...
4224 * lstat.c (rpl_lstat): ...into here.
4225 * lstat.h: New file.
4227 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4229 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4230 (ranged_convert): Don't save conversion in a temporary struct.
4231 This causes a warning with GCC 4.0.0, and anyway in the typical
4232 case it's not worth the extra 100 bytes or so of code.
4233 (ranged_convert, __mktime_internal): When calling a function via a
4234 pointer P, use P () rather than (*P) (), as we now assume C89 or
4237 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4239 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4240 "who -r" failed to give output. Problem reported by Tim Waugh.
4242 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4243 (xcalloc): Use it to avoid needless tests.
4244 Problem reported by Jim Meyering.
4246 2005-06-16 Jim Meyering <jim@meyering.net>
4248 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4249 when either N or S is zero.
4251 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4253 * argp.h (__option_is_short): Check upper limit of
4254 __key. Isprint() requires its argument to have the value
4255 of an unsigned char or EOF.
4257 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4259 * fnmatch.c (fnmatch): If there is an encoding error in a
4260 multibyte string or pattern, fall back on unibyte matching.
4261 Problem reported by James Youngman.
4263 2005-06-08 Bruno Haible <bruno@clisp.org>
4265 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4268 2005-06-08 Bruno Haible <bruno@clisp.org>
4270 * csharpcomp.h: New file, from GNU gettext.
4271 * csharpcomp.c: New file, from GNU gettext.
4272 * csharpcomp.sh.in: New file, from GNU gettext.
4274 2005-06-07 Derek Price <derek@ximbiot.com>
4277 * glob_.h: Indent nested #ifdef.
4279 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4281 Sync from coreutils.
4282 Use "file name" when talking about file names, instead of "filename"
4283 or "path", as per the GNU coding standards.
4284 * mkdir-p.c: Renamed from makepath.c.
4285 (make_dir_parents): Renamed from make_path. All callers changed.
4286 * mkdir-p.h: Likewise. All includers changed.
4287 * filenamecat.c: Renamed from path-concat.c.
4288 (file_name_concat): Renamed from path_concat. All callers changed.
4289 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4290 * filenamecat.h: Likewise. All includers changed.
4291 * acl.c: Don't use "path" or "filename" to mean "file name"
4292 in comments or local variable names.
4293 * basename.c: Likewise.
4294 * canonicalize.c, canonicalize.h: Likewise.
4295 * dirname.c, dirname.h: Likewise.
4296 * euidaccess.c: Likewise.
4297 * exclude.c: Likewise
4298 * fnmatch_.h, fnmatch_loop.c: Likewise.
4299 * fsusage.c, fsuage.h: Likewise.
4300 * fts.c, fts_.h: Likewise.
4301 * getcwd.c: Likewise.
4302 * getloadavg.c: Likewise.
4303 * mkstemp.c: Likewise.
4304 * mountlist.c, mountlist.h: Likewise.
4305 * openat.c, openat.h: Likewise.
4306 * readlink-stub.c: Likewise.
4307 * readutmp.c, readutmp.h: Likewise.
4308 * rename.c: Likewise.
4309 * rmdir.c: Likewise.
4311 * savedir.c: Likewise.
4312 * stripslash.c: Likewise.
4313 * tempname.c: Likewise.
4314 * xreadlink.c: Likewise.
4315 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4317 * exclude.h: Likewise.
4319 * euidaccess.c (getuid, getgid, getuid, getegid)
4320 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4321 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4322 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4323 * pathmax.h: Include <limits.h> unconditionally, since other
4324 files have been getting away with it for years (MORE/BSD 4.3
4326 * userspec.c (getpwnam, getgrnam, getgrgid)
4327 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4329 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4330 Define to 256, not 255, as per modern POSIX.
4332 2005-06-01 Bruno Haible <bruno@clisp.org>
4334 * csharpexec.h: New file, from GNU gettext.
4335 * csharpexec.c: New file, from GNU gettext.
4336 * csharpexec.sh.in: New file, from GNU gettext.
4338 2005-05-31 Derek Price <derek@ximbiot.com>
4339 Paul Eggert <eggert@cs.ucla.edu>
4342 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4344 2005-05-29 Derek Price <derek@ximbiot.com>
4345 Paul Eggert <eggert@cs.ucla.edu>
4347 * glob_.h, glob.c: New files.
4349 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4351 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4353 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4354 the configuration hassle isn't worth it.
4355 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4356 (LONGEST_MODIFIER, PRIuMAX): Remove.
4358 2005-05-27 Bruno Haible <bruno@clisp.org>
4360 * getlogin_r.h: Remove second include of <stddef.h>.
4362 2005-05-25 Bruno Haible <bruno@clisp.org>
4363 Derek Price <derek@ximbiot.com>
4365 * getlogin_r.h: Simplify API documentation.
4367 2005-05-25 Derek Price <derek@ximbiot.com>
4368 Paul Eggert <eggert@cs.ucla.edu>
4370 * getlogin_r.c, getlogin_r.h: New files.
4372 2005-05-22 Bruno Haible <bruno@clisp.org>
4374 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4375 Also include <sys/param.h> if it defines MIN, MAX.
4376 Based on a patch by Derek Price <derek@ximbiot.com>.
4378 2005-05-22 Bruno Haible <bruno@clisp.org>
4380 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4381 (INT64_MIN): Fix definition.
4382 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4384 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4385 NEED_SIGNED_INT_TYPES.
4387 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4388 HAVE_SYSTEM_INTTYPES.
4390 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4392 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4393 so that unistd-safer.h (GPL'ed code) need not be included.
4395 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4398 * fts.c: Don't include "cycle-check.h" or "hash.h".
4399 (setup_dir, free_dir): New functions.
4400 (enter_dir, leave_dir): Define trivial
4401 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4402 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4403 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4404 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4405 Move to fts-cycle.c.
4406 (fts_open): Use setup_dir.
4407 (fts_close): Use free_dir.
4408 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4409 This adds a label and some gotos, but the alternatives were messier.
4410 Check for memory allocation failure when entering a dir.
4411 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4412 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4413 (FTS): New member fts_cycle, that is a union that contains the
4414 old active_dir_ht and cycle_state. All uses changed to mention
4415 fts_cycle.ht and fts_cycle.state.
4416 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4417 fts.c, with the following changes:
4418 (setup_dir, free_dir): New functions.
4419 (enter_dir): Now returns bool. Return true if successful, false
4420 if memory exhausted. All callers changed.
4421 Do not bother partly cleaning up on
4422 memory allocation failure; that is free_dir's job.
4423 However, free ad if hash_insert fails, to avoid memory leak.
4424 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4425 fts->fts_options to see which union member to use.
4427 2005-05-20 Jim Meyering <jim@meyering.net>
4429 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4430 Now a macro, to pacify GCC.
4432 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4434 * chown.c (rpl_chown): Return -1 on failure.
4436 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4438 * canonicalize.c: Include canonicalize.h first, to test interface.
4439 Include <stddef.h> unconditionally, since we assume C89 now.
4440 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4441 * fts.c: Include fts_.h first, to check interface.
4442 Do not include intprops.h; no longer needed.
4443 Include cycle-check.h and hash.h, since fts_.h no longer does.
4444 Remove unnecessary casts of closedir to void.
4445 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4446 decide whether to decrement nlinks.
4447 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4448 (FTS): Use struct hash_table * instead of Hash_table, so that
4449 we no longer need to include hash.h here.
4451 2005-05-17 Jim Meyering <jim@meyering.net>
4453 * fts.c, fts_.h: New files, from coreutils.
4455 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4457 Sync from coreutils.
4458 * unlinkdir.c, unlinkdir.h: New files.
4459 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4460 regex.h, unlocked-io.h, xtime.h:
4461 White space changes only.
4462 * makepath.c (make_path): Port to hosts where leading "//" is special.
4463 * yesno.c: Include getline.h, not ctype.h.
4464 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4465 Use getline to remove arbitrary restriction on response length.
4467 2005-05-13 Bruno Haible <bruno@clisp.org>
4469 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4470 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4471 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4472 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4473 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4474 Add support for 64-bit integers in the MSVC compiler.
4476 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4478 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4479 Change the initial comment to refer to GPL, not LGPL.
4480 gnulib-tool will change it to LGPL as needed.
4482 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4483 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4484 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4485 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4486 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4487 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4488 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4489 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4490 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4491 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4492 concatpath.c, config.charset, copy-file.c, copy-file.h,
4493 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4494 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4495 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4496 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4497 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4498 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4499 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4500 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4501 full-read.c, full-read.h, full-write.c, full-write.h,
4502 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4503 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4504 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4505 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4506 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4507 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4508 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4509 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4510 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4511 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4512 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4513 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4514 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4515 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4516 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4517 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4518 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4519 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4520 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4521 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4522 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4523 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4524 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4525 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4526 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4527 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4528 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4529 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4530 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4531 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4532 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4533 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4534 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4535 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4536 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4537 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4538 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4539 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4540 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4541 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4542 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4543 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4544 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4545 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4546 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4547 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4548 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4549 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4550 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4551 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4552 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4553 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4554 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4555 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4556 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4557 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4558 Update FSF postal mail address.
4560 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4562 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4563 specified in ai_socktype. Fix invalid ai_protocol
4564 check. ai_protocol is usually set to 0 or depending on
4565 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4566 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4567 ai_socktype / ai_protocol in the returned addrinfo structure.
4569 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4570 Bruno Haible <bruno@clisp.org>
4572 * inet_ntop.h: New file.
4573 * inet_ntop.c: New file, from glibc with modifications.
4575 2005-05-08 Jim Meyering <jim@meyering.net>
4577 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4579 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4581 Merge from coreutils. Among other things,
4582 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4583 * fd-safer.c: New file.
4584 * fcntl-safer.h, open-safer.c: Remove.
4585 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4586 * dup-safer.c: Include unistd-safer.h first.
4587 Don't include errno.h.
4588 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4589 * file-type.h: Don't assume invoker included sys/stat.h first.
4590 * file-type.c: Rely on file-type.h change.
4591 * getloadavg.c: Include unistd-safer.h.
4592 (getloadavg): Use safer open.
4593 * getusershell.c: Include "stdio-safer.h".
4594 (getusershell): Use safer fopen.
4595 * long-options.c (long_options): Use NULL rather than 0.
4596 * modechange.h (mode_free): Remove; all callers changed to invoke
4598 * modechange.c: Likewise.
4599 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4600 (MODE_DONE): New constant.
4601 (struct mode_change): Remove 'next' member.
4602 (make_node_op_equals): New function; like the old one of the
4603 same name, except it allocates an array.
4604 (mode_compile, mode_create_from_ref): Use it.
4605 (mode_compile): Allocate result as an array, not a linked list.
4606 Parse octal string ourself, so that we catch mistakes like "+0".
4607 (mode_adjust): Arg is an array, not a linked list.
4608 * modechange.c: Include stat-macros.h, xalloc.h.
4609 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4610 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4611 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4612 Remove. This is now stat-macros.h's job.
4613 (talloc): Remove. All callers replaced by xalloc, so that
4614 our invokers don't have to worry about reporting memory failures.
4615 (make_node_op_equals): Remove.
4616 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4618 (struct mode_change): Moved here from modechange.h.
4619 (mode_append_entry): Remove.
4620 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4621 apps to have incorrect behavior. Use simpler algorithm for head
4622 and tail. Don't futz with umask; that's now the job of mode_adjust.
4623 Detect more invalid usages rather than having somewhat-random behavior.
4624 Don't insert an "a=" action, as that leads to incorrect behavior.
4625 (mode_compile, mode_create_from_ref): Return NULL on error instead
4626 of an enum, since now there's only one way to have an error. All
4628 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4629 at the correct time. Simplify calculation of "+u" and its ilk.
4630 Don't mishandle "+X".
4631 (mode_free): Remove "register" and localize decls.
4632 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4633 (struct mode_change): Move to modechange.c; callers don't
4634 need to see this stuff.
4635 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4636 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4637 (mode_change, mode_adjust): Reflect the new signatures noted above.
4638 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4639 that might redefine system include files.
4640 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4641 (my_usleep): Use NULL rather than (void *) 0.
4642 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4643 Use siginterrupt to specify that system calls should be interrupted.
4644 (rpl_nanosleep): Move initialization of suspended closer to call of
4646 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4647 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4648 (desirable_utmp_entry): New function.
4649 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4650 using x2nrealloc, to simplify logic.
4651 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4652 size calculation. Do not assume utmp file is a regular file.
4653 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4654 (READ_UTMP_CHECK_PIDS): New constant.
4655 * save-cwd.c: Include unistd-safer.h.
4656 (save_cwd): Use fd_safer.
4657 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4658 [!_LIBC] Include "stat-macros.h" instead.
4659 * unistd-safer.h (fd_safer): New decl.
4661 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4663 * byteswap_.h: New file.
4665 2005-04-25 Albert Chin <china@thewrittenword.com>
4667 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4670 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4672 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4673 that "UTC +1 second" continues to work. Problem reported
4675 (relunit_snumber): New rule.
4678 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4680 * getdate.y (universal_time_zone_table): New constant.
4681 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4682 universal_time_zone_table.
4683 (lookup_zone): Prefer universal_time_zone_table to
4684 local_time_zone_table, so that "GMT" time stamps are allowed in
4685 London during the summer. Problem reported by Ian Abbott.
4687 2005-04-12 Jim Meyering <jim@meyering.net>
4689 * human.c (humblock): Set *options even when returning due to
4690 xstrtoumax conversion failure. Thanks to a used-uninitialized
4693 2005-04-09 Jim Meyering <jim@meyering.net>
4695 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4696 -Wuninitialized: initialize tm0.tm_year.
4698 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4700 * getdate.y (parser_control): rels_seen is now a boolean, not a
4701 count, since there's no maximum. All uses changed.
4702 Add member dsts_seen.
4703 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4705 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4706 Use pc_rels_seen to decide whther a date is absolute.
4708 * getdate.y (number): Don't overwrite year.
4709 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4712 2005-04-02 Simon Josefsson <jas@extundo.com>
4714 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4715 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4717 2005-03-27 Jim Meyering <jim@meyering.net>
4719 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4721 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4723 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4724 "one's complement" -> "ones' complement" in comment, as per Knuth.
4725 "value of type" -> "type or expression" in comment.
4726 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4728 2005-03-26 Jim Meyering <jim@meyering.net>
4731 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4732 Correct typos: s/or/of/.
4734 2005-03-23 Jim Meyering <jim@meyering.net>
4736 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4738 2005-03-21 Jim Meyering <jim@meyering.net>
4740 Changes imported from coreutils.
4742 * cycle-check.c: Don't include xalloc.h.
4744 * path-concat.c: Don't include assert.h.
4745 (path_concat): Remove assertion that would have triggered
4746 for ABASE starting with more than one slash.
4747 Reported by Andreas Schwab.
4749 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4750 properly when ABASE is an absolute file name.
4751 Correct the description of this function.
4753 Add an assertion and a test driver.
4754 This fixes a bug introduced on 2004-07-02.
4755 Andreas Schwab reported the resulting failure of cp --parents:
4756 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4758 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4760 * strftime.c (my_strftime): If the underlying strftime returns 0
4761 (which shouldn't happen), generate nothing instead of returning 0
4762 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4764 2005-03-16 Bruno Haible <bruno@clisp.org>
4766 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4768 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4770 * strftime.c (my_strftime): Prepend space to format so that we can
4771 reliably distinguish strftime failure from empty output on POSIX
4774 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4776 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4777 (iconv_string): Don't guess a size-zero buffer, as that might cause
4778 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4779 result would be 'too large', where 'too large' is (heuristically)
4780 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4781 overflow concerns. This will prevent some unwanted malloc failures
4782 when the inputs are very large.
4784 2005-03-15 Bruno Haible <bruno@clisp.org>
4786 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4789 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4792 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4794 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4796 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4797 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4799 * strtol.c: Likewise.
4801 2005-03-14 Simon Josefsson <jas@extundo.com>
4803 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4806 2005-03-14 Jim Meyering <jim@meyering.net>
4808 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4809 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4810 to be nonzero so that we (and caller) can detect the difference
4811 between a valid zero-length expansion and an error return, even
4812 when the underlying strftime fails before writing anything into
4815 2005-03-10 Jim Meyering <jim@meyering.net>
4817 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4818 so that this module works on systems without fchdir.
4820 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4822 Factor int-properties macros into a single file, except for
4823 glibc-related files.
4824 * intprops.h: New file.
4825 * getloadavg.c: Include it instead of limits.h.
4826 (INT_STRLEN_BOUND): Remove.
4827 * human.c: Include intprops.h.
4828 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4829 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4830 * inttostr.h: Include intprops.h instead of limits.h.
4831 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4832 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4833 for consistency with intprops.h.
4834 (time_t_is_integer, twos_complement_arithmetic): Use them.
4835 * sig2str.h: Include <signal.h>, intprops.h.
4836 (INT_STRLEN_BOUND): Remove.
4837 * strftime.c (TYPE_SIGNED): Remove.
4838 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4839 * strtol.c: Adjust comments to match intprops.h.
4840 * userspec.c: Include intprops.h.
4841 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4842 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4843 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4844 instead of rolling our own expressions.
4845 * xstrtol.c: Include xstrtol.h first, to test interface.
4847 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4849 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4850 the right thing even if adding 1900 would overflow. Similarly
4851 for tm_mon + 1 and tm_yday + 1.
4852 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4853 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4854 (DO_SIGNED_NUMBER): New macro.
4855 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4857 2005-03-07 Bruno Haible <bruno@clisp.org>
4859 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4861 2005-03-03 Derek R. Price <derek@ximbiot.com>
4862 Bruno Haible <bruno@clisp.org>
4864 * pagealign_alloc.h: New file.
4865 * pagealign_alloc.c: New file.
4867 2005-01-28 Bruno Haible <bruno@clisp.org>
4869 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4872 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4874 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4875 The workaround isn't strictly needed for POSIX conformance, and
4876 it's too much of a pain to configure and maintain. We'll ask
4877 people to fix their kernels instead.
4878 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4879 (NANOSLEEP_BUG_WORKAROUND): Remove.
4880 (xnanosleep): Remove the workaround.
4882 2005-02-12 Bruno Haible <bruno@clisp.org>
4884 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4886 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4888 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4889 * timespec.h (gettime): Return void, since it always
4890 succeeds now. All uses changed.
4891 * gettime.c (gettime) Likewise.
4892 [HAVE_NANOTIME]: Prefer nanotime.
4893 Assume gettimeofday succeeds, as POSIX requires.
4894 Assime time () succeeds, since other code already does.
4895 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4896 (timespec_subtract): Remove.
4897 (NANOSLEEP_BUG_WORKAROUND): New constant.
4898 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4899 things considerably. Use it only on GNU/Linux hosts, since the
4900 workaround shouldn't be needed elsewhere.
4902 2005-02-24 Bruno Haible <bruno@clisp.org>
4904 * gettext.h: Update from GNU gettext 0.14.2.
4906 2005-02-24 Bruno Haible <bruno@clisp.org>
4908 * localcharset.c: Update from GNU gettext 0.14.2.
4909 * config.charset: Update from GNU gettext 0.14.2.
4911 2005-02-22 Simon Josefsson <jas@extundo.com>
4913 * iconvme.h, iconvme.c: New files, from libc.
4915 2005-02-20 Neil Conway <neilc@samurai.com>
4917 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4918 returned by OSX/Darwin if the specified buffer is not large
4919 enough for the hostname.
4921 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4923 * memrchr.h: New file.
4924 * chdir-long.c: Include it.
4925 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4926 Don't bother including stddef.h.
4928 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4930 * argp-help.c (__argp_help): Create a fake struct argp_state and
4931 pass it to _help, otherwise the latter coredumps trying to
4932 dereference state.root_argp.
4934 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4936 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4938 Include <sys/types.h>, for dev_t.
4939 (ME_DUMMY, ME_REMOTE): Move from here....
4940 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4941 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4943 Include mountlist.h first, to test the interface.
4945 2005-01-29 Bruno Haible <bruno@clisp.org>
4947 * progname.c (program_name): Initialize.
4948 Needed when linking statically on MacOS X.
4950 2005-01-28 Bruno Haible <bruno@clisp.org>
4952 * javacomp.sh.in: New file, from GNU gettext.
4953 * javacomp.h: New file, from GNU gettext.
4954 * javacomp.c: New file, from GNU gettext.
4956 2005-01-26 Bruno Haible <bruno@clisp.org>
4958 * javaexec.sh.in: New file, from GNU gettext.
4959 * javaexec.h: New file, from GNU gettext.
4960 * javaexec.c: New file, from GNU gettext.
4962 2005-01-26 Simon Josefsson <jas@extundo.com>
4964 * gai_strerror.c: Use GPL in header.
4966 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4968 * argp-help.c (hol_entry_help): Avoid using non-constant
4969 initializers for struct pentry_state.
4970 (__argp_error): Check return value of __asprintf
4971 (__argp_failure): Translate error message
4973 * argp-parse.c: Removed braces around the expansion of N_()
4975 2005-01-21 Jim Meyering <jim@meyering.net>
4977 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4978 same value as for Solaris 9.
4980 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4981 component length. This included changing the parameter to be
4982 of type `char *' rather than `char const *'.
4983 * chdir-long.h (chdir_long): Update prototype.
4985 * openat.c (fdopendir, fstatat): New functions.
4986 * openat.h: Include headers required for use of DIR and struct stat.
4987 [AT_SYMLINK_NOFOLLOW]: Define.
4988 (fdopendir, fstatat): Add prototypes.
4990 2005-01-21 Bruno Haible <bruno@clisp.org>
4992 * classpath.h: New file, from GNU gettext.
4993 * classpath.c: New file, from GNU gettext.
4995 2005-01-20 Simon Josefsson <jas@extundo.com>
4997 * version-etc-fsf.c: New file, with version_etc_copyright.
4998 * version-etc.c: Remove version_etc_copyright.
4999 * version-etc.h (version_etc_copyright): Use [] instead of * in
5000 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5002 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
5004 * save-cwd.c (save_cwd): Remove code to support the case
5005 where fchdir is missing or flaky.
5007 2005-01-20 Simon Josefsson <jas@extundo.com>
5009 * base64.h (isbase64): Add.
5011 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5012 using a unsigned prototype, don't inline.
5013 (base64_decode): Use it.
5015 2005-01-19 Bruno Haible <bruno@clisp.org>
5017 * sh-quote.h: New file, from GNU gettext.
5018 * sh-quote.c: New file, from GNU gettext.
5020 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
5022 Merge changes from coreutils, as described below in several
5023 changelogs dated today.
5025 * save-cwd.c: Include "save-cwd.h" before other include files.
5026 (O_DIRECTORY): Remove; not needed here, since "." must be
5027 a directory. All uses removed.
5028 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
5029 universal on Suns, and we also need to test for IRIX.
5030 Revamp code to use 'if' rather than '#if'.
5031 Avoid unnecessary comparison of cwd->desc to 0.
5033 * utimens.c (futimens): Robustify the previous patch, by checking
5034 for known valid error numbers rather than observed invalid ones.
5036 2005-01-18 Jim Meyering <jim@meyering.net>
5038 * version-etc.c (version_etc_copyright): Update copyright date.
5040 * utimens.c (futimens): Account for the fact that futimes
5041 can also fail with errno == ENOSYS or errno == ENOENT.
5042 Patch from Dmitry V. Levin.
5044 Change the name of the robust chdir function from chdir to chdir_long.
5045 * save-cwd.c: Include chdir-long.h rather than chdir.h.
5046 (restore_cwd): Use chdir_long, not chdir.
5047 * chdir-long.c: Renamed from chdir.c.
5048 * chdir-long.h: Renamed from chdir.h.
5049 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5052 2005-01-18 Bob Proulx <bob@proulx.com>
5054 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5055 offsetof() macro construct to avoid compile failure with native HP-UX
5056 11.0 ANSI C compiler.
5058 2005-01-06 Bruno Haible <bruno@clisp.org>
5060 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5061 because stpncpy.m4 takes care of it.
5063 2004-01-24 Bruno Haible <bruno@clisp.org>
5065 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5067 2003-10-09 Bruno Haible <bruno@clisp.org>
5069 * progreloc.c: Include xalloc.h instead of xmalloc.h.
5071 2005-01-06 Bruno Haible <bruno@clisp.org>
5073 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5074 * fwriteerror.c: Include <stdbool.h>.
5075 (fwriteerror): At the end, close the file stream. Record whether
5076 stdout was already closed.
5078 2004-05-27 Bruno Haible <bruno@clisp.org>
5080 * execute.c (environ): Declare if needed.
5081 * pipe.c (environ): Likewise.
5082 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5084 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5086 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5087 definitions to be after all include files, to avoid collisions.
5088 Problem reported by Bob Proulx.
5090 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5092 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5093 not needed. This removes a dependency on the gettext module.
5094 [defined _LIBC]: Do not include <libintl.h>; not needed.
5096 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5098 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5101 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5103 * argp-parse.c: Include <stddef.h>.
5104 (alignof, alignto): New macros.
5105 (parser_init): Don't assume that void * is aligned sufficiently
5108 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5109 need to extend the stack.
5110 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5113 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5115 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5117 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5119 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5120 Remove now-obsolete comment about AIX.
5121 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5122 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5123 (YYMAXDEPTH): New macro.
5125 2004-12-18 Bruno Haible <bruno@clisp.org>
5127 * fatal-signal.c (fatal_signals): Make non-const.
5128 (init_fatal_signals): New function.
5129 (uninstall_handlers, install_handlers): Ignore signals that were set to
5131 (at_fatal_signal): Call init_fatal_signals.
5132 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5134 Reported by Paul Eggert.
5136 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5138 * getdate.y (textint): New member "negative".
5139 (time_zone_hhmm): New function.
5140 Expect 14 shift-reduce conflicts, not 13.
5141 (o_colon_minutes): New rule.
5142 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5143 (yylex): Set the "negative" member of signed numbers.
5145 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5147 Changes imported from coreutils.
5148 * hard-locale.c: Assume <locale.h> exists.
5150 (GLIBC_VERSION): New macro.
5151 (hard_locale): Assume setlocale exists.
5152 Rewrite to avoid #ifdef.
5153 Use strdup rather than malloc + strcpy.
5154 * human.c: Assume <locale.h> exists.
5155 (human_readable): Assume localeconv exists.
5157 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5159 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5160 convert T2, not T. (Imported from libc.)
5162 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5164 * getcwd.c (is_ENAMETOOLONG): New macro.
5165 (__getcwd.c): Don't restore errno; glibc doesn't.
5166 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5167 first, falling back to our code only if its results look suspicious.
5168 Ensure that the resulting buffer is only as large as necessary.
5170 * readutmp.c: Include readutmp.h first.
5171 Include <errno.h>, since readutmp.h no longer does that.
5172 * readutmp.h: Don't include <errno.h>,
5173 <sys/param.h>, <time.h>; not needed to establish interface.
5174 (errno): Remove decl.
5175 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5176 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5177 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5179 2004-11-28 Simon Josefsson <jas@extundo.com>
5181 * base64.h, base64.c: New file.
5183 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5185 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5187 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5189 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5190 HP's ANSI C compiler.
5191 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5192 Declaring int functions causes warnings on some modern systems and
5193 shouldn't be needed to compile on ancient ones.
5194 * same.c (MIN) [defined MIN]: Don't define, since it's already
5197 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5198 with the following changes.
5199 (__set_errno): Parenthesize properly.
5200 Include <stdbool.h>.
5201 (MIN, MAX, MATCHING_INO): New macros.
5202 (__getcwd): Define with prototype, not K&R form.
5203 Use heuristics to allocate default buffer on stack if possible.
5204 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5205 behavior, and to avoid the PATH_MAX limit when computing
5207 Use MATCHING_INO to compare inode number to file.
5208 Check for arithmetic overflow in size calculations.
5209 Fix bug in reallocation of dot array that caused getcwd to fail
5210 on directories nested deeper than 75.
5211 Be more careful about saving errno on error.
5212 Do not use realloc; use only free+malloc, as this is a bit
5213 more flexible and avoids a needless copy operation.
5214 Do not inspect st_dev and st_ino for symbolic links; POSIX
5215 doesn't specify the latter.
5216 Check for closedir errors.
5217 Avoid needless casts.
5218 Use "#ifdef weak_alias" around weak_alias, to be like other
5220 The following changes to getcwd.c have effect only when used in
5221 gnulib; they have no effect inside glibc proper.
5222 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5223 as alloca isn't used.
5224 (alloca, __alloca): Likewise.
5225 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5226 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5227 unconditionally, as gnulib assumes C89 or better.
5228 Do not include <sys/param.h>.
5229 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5230 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5232 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5233 Include <dirent.h> in a way that is compatible with modern Autoconf.
5234 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5235 New macros, if not already defined.
5236 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5237 Use "_LIBC", not "defined _LIBC", for consistency.
5238 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5240 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5241 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5242 * xgetcwd.c: David MacKenzie's old code was removed, so give
5243 credit only to Jim Meyering and adjust the copyright dates.
5244 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5245 <stdlib.h>, <unistd.h>, "pathmax.h".
5246 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5247 (INITIAL_BUFFER_SIZE): Remove.
5248 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5250 2004-11-23 Jim Meyering <jim@meyering.net>
5252 * getopt_.h: Remove trailing blanks.
5254 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5256 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5257 (futimens): New function, which uses futimes if available.
5258 (futimens, utimens): Support timespec==NULL, with same semantics
5259 as utime and utimens.
5260 * utimens.h (futimens): New decl.
5262 2004-11-23 Jim Meyering <jim@meyering.net>
5264 * __fpending.c: Add comment.
5266 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5268 * getopt_.h: Re-addition of __getopt_argv_const caused
5269 redefinition warnings. To avoid them, include the defines
5270 in `#if !defined __need_getopt ... #endif'. The only place
5271 where __getopt_argv_const is used is in definitions
5272 of getopt_long and getopt_long_only below, which are as well
5273 protected by `#ifndef __need_getopt'.
5274 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5275 __need_getopt after including <stdio.h> and <unistd.h> These
5276 headers might have defined it.
5278 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5280 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5282 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5283 optopt): Use them instead of invoking ## directly; otherwise, the
5284 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5286 2004-11-19 Bruno Haible <bruno@clisp.org>
5288 * strtok_r.c: Move comments from here...
5289 * strtok_r.h: ... to here.
5291 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5293 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5294 might fail. Problem reported by Yoann Vandoorselaere.
5295 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5296 that mishandle size_t overflow.
5298 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5300 * canon-host.c: Include "strdup.h".
5301 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5302 Use strdup instead of malloc/strcpy to duplicate strings.
5304 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5305 (human_space_before_unit): New constant.
5306 * human.c (human_readable): Support it.
5308 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5309 (xgetcwd): Set errno correctly when failing.
5310 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5311 the failure is actually due to a PATH_MAX problem.
5313 Further getopt changes to make it more likely that glibc will
5314 buy the changes back.
5315 * getopt.c (POSIXLY_CORRECT): New constant.
5316 (getopt): Use it, so to preserve glibc semantic
5317 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5318 when compiling for libc.
5319 * getopt_.h (__getopt_argv_const): Bring it back.
5320 (getopt_long, getopt_long_only): Use it.
5322 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5323 New arg POSIXLY_CORRECT. All callers changed.
5324 (getopt): Argv is now char * const *, as per standard.
5325 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5326 not char *__getopt_argv_const *.
5327 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5328 _getopt_long_only_r): Likewise.
5329 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5330 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5331 _getopt_long_r, _getopt_long_only_r): Likewise.
5332 * getopt_.h (__getopt_argv_const): Remove.
5333 (getopt): Argv is now char * const *, as per standard.
5335 * getdate.y (tORDINAL): New token.
5336 (day, relunit): Allow it for relative times.
5337 (relative_time_table): Use tORDINAL for ordinals.
5339 2004-11-15 Jim Meyering <jim@meyering.net>
5341 * closeout.c: Include "__fpending.h" once again.
5342 Include <stdbool.h>.
5343 (close_stdout): Don't fail just because stdout was closed initially,
5344 since some programs don't write to stdout in the normal course of
5345 operation (other than --version and --help), and we don't want this
5346 function to make e.g. `touch file >&-' fail.
5347 But do fail if it was closed and someone has tried to write to it.
5348 E.g., `printf foo >&-' must fail.
5350 2004-11-11 Simon Josefsson <jas@extundo.com>
5352 * strtok_r.h, strtok_r.c: New file.
5354 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5356 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5357 we can stop lying to compilers about the constness of argv when we
5358 are compiled outside glibc.
5359 (getopt, getopt_long, getopt_long_only): Use it.
5360 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5362 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5363 _getopt_long_only_r): Likewise.
5364 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5365 _getopt_long_only_r): Likewise.
5367 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5368 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5369 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5370 the other external symbols.
5371 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5372 declaration, since the above renaming now works around collisions.
5374 2004-11-11 Jim Meyering <jim@meyering.net>
5376 * linebreak.c: Remove trailing blanks.
5377 * alloca_.h: Likewise.
5378 * acosl.c: Likewise.
5379 * euidaccess.c: Likewise.
5380 * allocsa.h: Likewise.
5382 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5384 * mktime.c (SHR): New macro, which is a portable
5385 substitute for >> that should work even on Crays.
5386 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5387 Problem reported by Mark D. Baushke in
5388 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5389 * getdate.y (SHR): Likewise.
5391 * strftime.c (SHR): Likewise.
5393 * quotearg.c (struct quoting_options): Use unsigned int for
5394 quote_these_too, so that right shifts are well defined. All uses
5397 2004-11-10 Simon Josefsson <jas@extundo.com>
5399 * getaddrinfo.h, getaddrinfo.c: New files.
5401 2004-11-10 Jim Meyering <jim@meyering.net>
5403 Ensure that no close failure goes unreported.
5404 * closeout.c (close_stdout): Always close stdout. I.e., don't
5405 return early when it seems there's nothing to flush.
5406 Don't include __fpending.h.
5408 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5410 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5412 2004-11-05 Bruno Haible <bruno@clisp.org>
5414 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5415 Reported by Mark D. Baushke <mdb@cvshome.org>.
5417 2004-11-04 Bruno Haible <bruno@clisp.org>
5419 2004-09-11 Bruno Haible <bruno@clisp.org>
5420 * allocsa.valgrind: New file.
5421 2004-02-06 Bruno Haible <bruno@clisp.org>
5422 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5423 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5424 Reported by Christopher Seip <chris.seip@hp.com>.
5426 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5428 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5429 with errno == ERANGE if the buffer is too small.
5430 Problem reported by Mark D. Baushke.
5432 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5434 * xreadlink.c (MAXSIZE): New macro.
5435 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5436 size does not exceed MAXSIZE. Avoid cast.
5437 As suggested by Mark D. Baushke in
5438 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5439 if readlink fails with buffer size just under MAXSIZE, try again
5442 2004-11-02 Derek R. Price <derek@ximbiot.com>
5443 and Paul Eggert <eggert@cs.ucla.edu>
5445 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5446 (get_date): Overparenthesize to avoid GCC warning.
5448 2004-11-02 Bruno Haible <bruno@clisp.org>
5450 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5451 function returns void.
5453 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5455 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5456 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5459 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5461 * getdate.y: Add support for TZ="foo" within a date string.
5462 Fix some bugs near time_t boundaries. Reject dates with
5463 out-of-range components, e.g., "Sept 31".
5464 Include <stdlib.h>, "setenv.h", "xalloc.h".
5465 (ISDIGIT_LOCALE): Remove; unused.
5466 Note that the TZ and time functions used here are not reentrant.
5467 (mktime_ok, get_tz): New functions.
5468 (TZBUFSIZE): New constant.
5469 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5470 This requires that we sometimes generate our own TZ="XXX..." setting.
5472 2004-10-27 Derek R. Price <derek@ximbiot.com>
5474 * mktime.c (not_equal_tm): Remove redundant check.
5476 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5478 * getdate.y: Use Bison 1.875 features, and some minor
5479 code cleanups. This change does not affect semantics.
5480 Don't include <stdlib.h>; no longer needed.
5481 Don't include unlocked-io.h; only the "#if TEST" code uses
5482 stdio, and performance isn't crucial there.
5483 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5484 Bison 1.875 features as described below.
5485 All uses of "PC." replaced by "pc->".
5486 (YYSTYPE): Add a forward declaration.
5487 (yylex, yyerror): Use full prototypes in forward decls.
5488 Use "%pure-parser" rather than obsolescent "%pure_parser".
5489 Use %parse-param and %lex-param instead of obsolescent
5490 YYPARSE_PARAM and YYLEX_PARAM.
5491 (meridian_table, month_and_day_table, time_units_table,
5492 relative_time_table, time_zone_table, military_table,
5493 lookup_zone, lookup_word, get_date):
5494 Use NULL instead of 0 where appropriate.
5495 (to_hour): Avoid abort (), to avoid a dependency on
5497 (yyerror, yylex): Now accepts parser_control * arg.
5498 (main) [TEST]: Use '\0' rather than 0 for char.
5500 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5502 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5503 It's now the caller's responsibility to handle the case where
5504 !HAVE_GETPAGESIZE && !defined getpagesize.
5506 * mktime.c (leapyear): Arg is long int, not int.
5508 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5510 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5512 2004-10-12 Simon Josefsson <jas@extundo.com>
5514 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5515 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5518 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5520 * vsnprintf.h: New file.
5521 * vsnprintf.c: New file.
5523 2004-10-07 Bruno Haible <bruno@clisp.org>
5525 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5526 into the provided buffer.
5528 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5530 * diacrit.c, diacrit.h: Add GPL notice.
5532 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5533 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5534 * logl.c (logl): Keep the code as similar to glibc as possible.
5535 This avoids a potential constant-folding bug.
5537 2004-10-05 Bruno Haible <bruno@clisp.org>
5539 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5541 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5543 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5544 * xmalloc.c (xmemdup): Likewise.
5545 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5546 XFREE): Remove these long-obsolescent macros.
5547 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5548 * xstrdup.c: Remove.
5550 * regex.c (re_comp): Cast gettext return value to char *,
5551 Problem reported by Martin Neitzel via Mark D. Baushke.
5553 2004-10-04 Simon Josefsson <jas@extundo.com>
5555 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5556 '#ifdef USE_UNLOCKED_IO'.
5558 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5560 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5561 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5562 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5563 regex.c, sha1.c, version-etc.c, yesno.c:
5564 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5565 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5566 the includer's responsibility.
5568 Sync from coreutils.
5570 * modechange.c (mode_compile): Don't decrement a pointer that
5571 points to the start of a string, as the C Standard says the
5572 resulting behavior is undefined.
5574 * backupfile.h (enum backuptype): Rename none -> no_backups,
5575 simple -> simple_backups, numbered_existing ->
5576 numbered_existing_backups, numbered -> numbered_backups
5577 to avoid shadowing problems. All uses changed.
5578 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5579 * backupfile.c (check_extension, numbered_backup):
5580 Rename locals to avoid shadowing 'basename'.
5581 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5584 * .cppi-disable: Add getopt_.h, getopt_int.h.
5585 * .cvsignore: Add getopt.h.
5587 2004-10-04 Simon Josefsson <jas@extundo.com>
5589 * memmem.h: New file.
5590 * memmem.c: New file, taken from glibc.
5592 2004-10-02 Jim Meyering <jim@meyering.net>
5594 * dirfd.h, getpagesize.h: Add copyright notice.
5596 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5598 * snprintf.c: Remove comments as to why each header is needed.
5600 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5602 * strsep.h: New file.
5603 * strsep.c: New file.
5605 2004-10-01 Simon Josefsson <jas@extundo.com>
5607 * snprintf.c (snprintf): Handle size==0.
5609 2004-10-01 Simon Josefsson <jas@extundo.com>
5610 Bruno Haible <bruno@clisp.org>
5612 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5613 (snprintf): Declare 'args'.
5615 2004-09-30 Simon Josefsson <jas@extundo.com>
5617 * snprintf.h, snprintf.c: New files.
5619 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5621 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5622 (hol_entry_help): Never translate an empty string.
5623 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5624 * argp.h (OPTION_NO_TRANS): New option.
5626 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5628 * xvasprintf.c: Include xalloc.h.
5629 (xvasprintf): Use xalloc_die, not xmalloc_die.
5631 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5633 * dummy.c: Change copyright notice to FSF, and license to GPL.
5635 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5637 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5638 Problem reported by Bruno Haible in:
5639 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5641 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5643 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5644 in case some system header has #define'd it. Problem reported by
5645 Soeren D. Schulze in
5646 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5648 2004-09-08 Bruno Haible <bruno@clisp.org>
5650 * stdint_.h: New file, taken from GNU clisp.
5652 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5654 * xvasprintf.h: New file.
5655 * xvasprintf.c: New file.
5656 * xasprintf.c: New file.
5658 2004-09-08 Bruno Haible <bruno@clisp.org>
5660 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5662 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5664 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5666 Import from coreutils.
5667 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5668 strings on unbounded length. alloca's performance benefits aren't
5669 that important here.
5671 (parse_with_separator): New function, with most of the internals
5672 of the old parse_user_spec. Allow user to omit both user and group,
5673 for compatibility with FreeBSD.
5674 Clone only the user name, not the entire spec.
5675 Do not set *uid, *gid unless entirely successful.
5676 Avoid memory leak in some failing cases.
5677 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5678 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5679 (parse_user_spec): Rewrite to use parse_with_separator.
5681 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5683 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5684 its complicated substitute.
5685 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5686 and program_invocation_name.
5687 (__argp_basename) [!_LIBC]: Remove; the only use was
5688 replaced by its body.
5689 (__argp_short_program_name): Change condition from
5690 !defined __argp_short_program_name to
5691 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5692 to match argp-namefrob.h.
5693 (__argp_failure): Don't assume strerror_r returns char *.
5694 * argp-parse.c (N_): Define unconditionally.
5695 (argp_default_options): Fill out initializers with 0 to avoid
5698 2004-08-12 Simon Josefsson <jas@extundo.com>
5700 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5701 * getopt_.h: Renamed from getopt.h.
5703 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5705 Merge from coreutils.
5707 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5708 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5709 for Reliant Unix 5.43.
5711 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5712 (union fooround): Use uintmax_t, not long int.
5713 The rest is a merge from libc:
5714 [defined _LIBC]: Include <shlib-compat.h>.
5715 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5717 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5719 * strverscmp.c: Convert to UTF-8.
5721 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5723 * obstack.h (obstack_empty_p):
5724 Don't assume that chunk->contents is suitably aligned.
5725 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5726 Likewise. Problem reported by Benno in
5727 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5729 * chown.c (rpl_chown): Work even if the file is writeable but not
5730 readable. This could be improved further but it'd take some work.
5732 2004-08-08 Simon Josefsson <jas@extundo.com>
5734 * xgethostname.c: Don't include error.h (not used).
5737 * getpass.c: Include getpass.h first.
5739 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5741 * xalloc-die.c: New files.
5742 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5744 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5745 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5746 (_, N_, xalloc_die): Move to xalloc-die.c.
5747 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5748 so that we needn't mess with xalloc_msg_memory_exhausted.
5750 * sha1.h: Renamed from sha.h.
5751 (SHA1_H): Renamed from _SHA_H.
5752 (sha1_ctx): Renamed from sha_ctx.
5753 (sha1_init_ctx): Renamed from sha_init_ctx.
5754 (sha1_process_block): Renamed from sha_process_block.
5755 (sha1_process_bytes): Renamed from sha_process_bytes.
5756 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5757 (sha1_read_ctx): Renamed from sha_read_ctx.
5758 (sha1_stream): Renamed from sha_stream.
5759 (sha1_buffer): Renamed from sha_buffer.
5760 * sha1.c: Likewise; renamed from sha.c.
5761 Do not include <sys/types.h>.
5762 Include <stddef.h> rather than <stdlib.h>.
5764 2004-08-08 Bruno Haible <bruno@clisp.org>
5766 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5767 FILESYSTEM_PREFIX_LEN.
5768 * progreloc.c: Likewise.
5769 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5771 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5774 * argp-help.c (make_hol, hol_append): Don't assume that
5775 SIZE_MAX is a valid preprocessor constant.
5776 (__argp_basename): Change from "#ifndef _LIBC"
5777 to "#ifndef __argp_short_program_name", so that
5778 we don't compile these functions for tar.
5780 More merges from coreutils.
5781 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5782 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5784 * addext.c: Remove; no longer needed.
5785 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5786 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5787 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5788 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5789 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5790 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5791 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5792 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5793 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5794 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5795 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5796 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5797 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5798 Import changes from coreutils.
5800 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5802 Merge from coreutils.
5804 * .gdb-history: Remove; this doesn't belong here.
5806 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5807 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5808 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5810 * dirname.h: Include <stdbool.h>.
5811 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5812 for consistency with POSIX terminology. All uses changed.
5813 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5814 (strip_trailing_slashes): Use bool for booleans.
5815 * stripslash.c (strip_trailing_slashes): Likewise.
5817 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5818 sometimes returns a positive errno value even when it succeeds.
5819 (print_errno_message) [!LIBC]: Fall back on strerror if
5822 * path-concat.c (mempcpy): Don't define if a system header defines it.
5823 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5824 (longest_relative_suffix): New function.
5825 (path_concat): Use it. Assume first argument is not NULL.
5826 Port to DOS. Omit redundant separators.
5827 Report an error instead of returning NULL.
5828 Use mempcpy instead of memcpy.
5829 (xpath_concat): Remove: not declared or used.
5831 * same.h: Include <stdbool.h>
5832 (same_name): Return bool, not int.
5833 * same.c (same_name): Likewise.
5834 (errno): Don't declare; we assume C89 or better now.
5836 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5837 if not already defined.
5839 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5840 * dup-safer.c (errno): Likewise.
5842 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5844 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5847 2004-08-03 Simon Josefsson <jas@extundo.com>
5849 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5850 * progname.h: Don't include stdbool.h.
5852 2004-08-02 Simon Josefsson <jas@extundo.com>
5854 * getsubopt.h: New file, with comments from Bruno Haible.
5855 * getsubopt.c: New file, from glibc, but slightly modified based on
5856 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5858 2004-08-01 Simon Josefsson <jas@extundo.com>
5860 * xgetdomainname.c: Include stdlib.h, for free().
5862 2004-07-16 Simon Josefsson <jas@extundo.com>
5864 * dummy.c: New file.
5866 2004-07-16 Bruno Haible <bruno@clisp.org>
5868 * backupfile.h: Add extern "C" for C++.
5869 * closeout.h: Likewise.
5870 * copy-file.h: Likewise.
5871 * findprog.h: Likewise.
5872 * full-write.h: Likewise.
5873 * pathname.h: Likewise.
5874 * progname.h: Likewise.
5875 * stpcpy.h: Likewise.
5876 * stpncpy.h: Likewise.
5877 * strcase.h: Likewise.
5878 * strstr.h: Likewise.
5879 * xalloc.h: Likewise.
5881 * mbswidth.h: Add extern "C" for C++.
5882 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5884 2004-07-09 Simon Josefsson <jas@extundo.com>
5886 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5887 failed without this.)
5889 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5891 * fchown-stub.c: New file.
5893 2004-06-24 Jim Meyering <jim@meyering.net>
5895 * obstack.h (obstack_base): Cast to (void *), per documentation.
5897 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5899 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5901 2004-06-01 Jim Meyering <jim@meyering.net>
5903 * calloc.c: New file.
5905 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5907 * getdate.y (yylex): Allow space between sign and number.
5908 Problem reported by Dan Jacobson.
5910 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5911 and Jim Meyering <jim@meyering.net>
5913 Merge from coreutils CVS.
5915 * stat-macros.h: New file, with contents from file-type.h
5916 and coreutils' system.h.
5917 * file-type.c: Include "stat-macros.h".
5918 * file-type.h (file_type): Move all macro definitions to new file,
5921 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5922 Wrap old code with this conditional.
5923 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5924 function that does not dereference symlinks.
5925 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5927 * xreadlink.c: Include xreadlink.h first, to catch .h file
5928 dependency problems.
5929 (xreadlink): Accept new arg SIZE, for efficiency.
5930 All decls and uses changed.
5931 * xreadlink.h: Include <stddef.h>, for size_t.
5933 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5934 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5936 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5938 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5940 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5941 macros to be defined.
5942 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5943 the allocator returns NULL because the requested size is zero.
5945 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5947 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5948 var. Add comment explaining why libc still defines it. This
5949 merges the following patch from glibc:
5950 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5952 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5954 * obstack.c (_obstack): Remove unused variable. It hasn't been
5955 present in glibc since revision 1.1 of this file.
5956 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5957 obstack_alignment_mask, obstack_alloc, obstack_base,
5958 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5959 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5960 obstack_grow0, obstack_init, obstack_int_grow,
5961 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5962 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5963 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5964 nonexistent functions.
5966 2004-05-17 Derek R. Price <derek@ximbiot.com>
5967 Paul Eggert <eggert@cs.ucla.edu>
5969 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5971 2004-05-14 Bruno Haible <bruno@clisp.org>
5973 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5974 that consists of a '.' followed by an empty digit string.
5975 Patch by Tor Lillqvist <tml@iki.fi>.
5977 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5979 Port obstack to the AS/400, where pointers are 16 bytes wide and
5980 you cannot cast an integer to a valid pointer. This patch is
5981 currently waiting to be integrated into glibc; see
5982 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5984 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5985 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5986 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5987 (struct obstack): temp member is now a union of a pointer and
5988 an integer, instead of an integer. All integer uses changed.
5989 This does not affect the physical layout of struct obstack,
5990 except on hosts (like the AS/400) where the size or alignment of
5991 void * is greater than that of ptrdiff_t.
5992 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5993 __STDC__)]: Store temporary in pointer member of union, not
5995 * obstack.c: Include <stddef.h>, for offsetof.
5996 (struct fooalign): Remove; it doesn't need a name.
5997 (union fooround): Change double to long double, and add void *.
5998 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5999 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6000 not a macro. Hence the values are always int; so remove all
6001 casts-to-int in uses.
6003 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
6004 Derek Price <derek@ximbiot.com>
6006 * alloca.c: Include <alloca.h>, to get our interface.
6007 * alloca_.h: Use __alloca on AIX, so that we don't have to
6008 include <alloca.h> first. Use C89 prototype for alloca; this
6009 requires including <stddef.h> for size_t. Use extern "C" if C++.
6010 Use #elif for simplicity, since we can assume C89 now.
6011 Don't try to source the system alloca.h since it will not be found
6012 and to prevent recursively including its replacement.
6013 * fnmatch.c: Include <alloca.h> instead of opencoding.
6014 * regex.c: Likewise.
6016 2004-05-16 Derek Price <derek@ximbiot.com>
6017 Paul Eggert <eggert@cs.ucla.edu>
6019 getline cleanup. This changes the getndelim2 API: both order of
6020 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6023 * getline.c: Don't include stddef.h or stdio.h, since our
6024 interface does that.
6025 (getline): Always use getdelim, so that we don't have two
6026 copies of this code.
6027 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6029 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6030 (GETNDELIM2_MAXIMUM): New macro.
6031 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
6032 instead of the old practice of delim2==0. All callers changed.
6033 Return -1 on overflow, instead of returning junk.
6034 Do not set *linesize unless allocation succeeds.
6035 * getndelim2.h: Do not include stddef.h; no longer needed, now
6036 that we include sys/types.h.
6037 * getnline.h: Likewise.
6038 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6039 (getndelim2): Reorder arguments.
6040 * getnline.c (getnline, getndelim):
6041 Don't discard the NMAX argument.
6042 (getnline): Invoke getndelim, to avoid code duplication.
6043 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6044 of (size_t) -1 by callers of the getnline family.
6046 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
6048 * nanosleep.c (suspended): Change its type from int to
6049 sig_atomic_t volatile.
6050 (first_call): Make it private to rpl_nanosleep, and have it
6051 be zero initially as that's a bit faster.
6052 (my_usleep): Round up fractional times instead of truncating them,
6053 as this is the usual meaning for 'sleep'.
6055 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6057 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6058 (ENOSYS): Define if not defined.
6059 (settime): Fall back on stime if it exists and settimeofday fails.
6060 But don't bother with fallbacks if a method fails with errno == EPERM.
6062 2004-05-11 Jim Meyering <jim@meyering.net>
6064 Prior to this change, the save_cwd caller required read access to the
6065 current directory on most systems (ones with the fchdir function).
6067 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6068 fails, try write-only, and finally, resort to using xgetcwd.
6070 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6072 * obstack.c, obstack.h: Import changes from libc.
6074 2004-04-28 Bruno Haible <bruno@clisp.org>
6076 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6077 implicitly appends .exe to executables.
6078 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6079 accepts Windows pathnames.
6080 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6081 Cygwin like Windows, since it now accepts Windows pathnames.
6082 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6083 Cygwin like Windows, since it now accepts Windows pathnames.
6084 Reported by Derek Robert Price <derek@ximbiot.com>.
6086 2004-04-20 Jim Meyering <jim@meyering.net>
6088 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6090 2004-04-20 Jim Meyering <jim@meyering.net>
6091 Bruno Haible <bruno@clisp.org>
6093 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6094 memory when realloc fails.
6096 2004-04-18 Jim Meyering <jim@meyering.net>
6098 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6099 don't leak memory and do call END_UTMP_ENT.
6101 2004-04-11 Paul Eggert <eggert@twinsun.com>
6103 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6104 (CHAR_BIT): Remove, since we assume C89.
6105 Include <stdint.h> if available, as per current Autoconf CVS advice.
6107 2004-03-30 Paul Eggert <eggert@twinsun.com>
6109 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6110 not bool, to be more consistent with Unix conventions.
6111 Suggested by Bruno Haible.
6113 Merge from coreutils.
6115 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6118 * getdate.h: Include stdbool.h, and timespec.h instead of
6119 the usual <time.h> dance.
6120 (get_date): Change signature to support fractional time stamps.
6121 All callers changed.
6122 * getdate.y: Include "getdate.h" first, as we can now
6123 assume C89 and don't need to worry about 'const'.
6124 Similarly, include "unlocked-io.h" near start, not in middle.
6126 (textint.value): Use long int rather than int.
6127 (textint.digits): Use size_t rather than int.
6128 (BILLION, LOG10_BILLION): New constants.
6129 (parser_control): New member rel_ns. Members day_ordinal,
6130 time_zone, month, day, hour, minutes, rel_year, rel_month,
6131 rel_day, rel_hour, rel_minutes, rel_seconds
6132 are now long int, not int. Member seconds is now struct timespec,
6133 not int. New member timespec_seen. Members dates_seen, days_seen,
6134 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6136 (%union.intval): Now long int, not int.
6137 New member timespec.
6138 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6139 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6140 (spec): Now is a timespec or an item list.
6141 (timespec, items): New nonterminals.
6142 (time, rel, relunit, number, get_date):
6143 Add support for fractional seconds.
6144 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6145 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6146 (to_hour): First arg is now long int, not int.
6147 (to_year): Returns long int, not int.
6148 Don't treat year -70 like 70.
6149 (tm_diff): Returns long int, not int.
6150 (lookup_word): Use bool instead of int when appropriate.
6151 (yylex): Use size_t for count, not int.
6152 Detect overflow when parsing large integer constants.
6153 Add support for fractions.
6154 (get_date): Make pointers 'const' if possible.
6155 Use more-portable code to detect integer overflow.
6156 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6157 Don't use ctime; it's not reliable if the year has >4 digits.
6159 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6160 This is for compatibility with BSD.
6162 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6163 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6164 From coreutils' system.h.
6166 * userspec.c: Don't include "posixver.h".
6167 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6168 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6169 compatible extension. Simplify code by removing a boolean int
6170 that was always nonzero if a string was nonnull.
6172 2004-03-30 Jim Meyering <jim@meyering.net>
6174 Merge from coreutils.
6176 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6178 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6179 an empty input stream.
6181 * readtokens.c: Include <stdbool.h>.
6182 (readtoken): Use `size_t' rather than int/long.
6183 All callers adjusted.
6184 Use `bool' rather than `int' where appropriate.
6185 Use memset rather than an explicit loop.
6186 Use x2nrealloc rather than xrealloc.
6187 Allow the use of `\0' as a delimiter.
6188 (readtokens): Likewise.
6189 * readtokens.h (readtoken, readtokens): Update prototypes.
6191 2004-03-30 Bruno Haible <bruno@clisp.org>
6193 * getloadavg.c (getloadavg): Don't assume setlocale returns
6196 2004-03-29 Paul Eggert <eggert@twinsun.com>
6198 Merge changes to getloadavg.c from coreutils and Emacs.
6200 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6201 Define to an expression, not to the empty string.
6202 Include cloexec.h and xalloc.h.
6203 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6204 Use set_cloexec_flag rather than rolling our own.
6205 * cloexec.c, cloexec.h: New files.
6207 2004-03-18 Paul Eggert <eggert@twinsun.com>
6209 * getopt.h: Sync with libc CVS.
6211 2004-03-18 Paul Eggert <eggert@twinsun.com>
6212 Bruno Haible <bruno@clisp.org>
6214 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6215 not on all platforms that have <wchar.h>.
6216 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6218 2004-03-09 Paul Eggert <eggert@twinsun.com>
6220 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6222 * getopt_int.h: New file, also synced from libc.
6224 2004-03-07 Paul Eggert <eggert@twinsun.com>
6226 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6227 '#if' expressions. Unlike the code it replaces, it does not
6228 depend on (defined _SC_PAGESIZE). However, it does depend on
6229 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6230 first reported by Jason Andrade in
6231 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6233 2004-01-18 Simon Josefsson <jas@extundo.com>
6235 * strdup.h: New file.
6236 * strdup.c: Include it.
6237 * path-concat.c: Include strdup.h. Drop strdup declaration.
6238 * userspec.c: Include strdup.h. Drop strdup declaration.
6240 2004-02-06 Karl Berry <karl@gnu.org>
6242 * config.charset: update from gettext 0.14.1.
6244 2004-02-05 Paul Eggert <eggert@twinsun.com>
6246 Add comments and code, prompted by suggestions from Bruno Haible
6248 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6249 describing the enum quoting_style values.
6250 * quotearg.c (quotearg_alloc): New function.
6251 (quotearg_buffer_restyled): Treat lone { and } as special.
6252 Treat = as special. Work around bug with older shells
6253 that "see" a '\' that is really the 2nd byte of a multibyte char.
6254 Quote empty string with shell_quoting_style.
6256 2004-02-03 Bruno Haible <bruno@clisp.org>
6258 * pipe.h: New file, from GNU gettext.
6259 * pipe.c: New file, from GNU gettext.
6261 2004-01-27 Bruno Haible <bruno@clisp.org>
6263 * execute.h: New file, from GNU gettext.
6264 * execute.c: New file, from GNU gettext.
6265 * w32spawn.h: New file, from GNU gettext.
6267 2004-01-23 Paul Eggert <eggert@twinsun.com>
6269 Exit-status fix from coreutils.
6271 Use exit_failure consistently in place of EXIT_FAILURE,
6272 so that program exit statuses are consistent on failure.
6274 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6275 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6276 * argmatch.h: Comment fix to match the above.
6277 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6278 Now a macro referring to exit_failure, instead of a separate
6279 variable. Include "exitfail.h" to get it.
6280 * xstrtol.h: Include "exitfail.h".
6281 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6283 * long-options.c (parse_long_options): Use prototype
6284 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6287 2004-01-21 Jim Meyering <jim@meyering.net>
6289 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6290 so as not to conflict with a different-sized __mktime_internal
6291 function in GNU libc.
6292 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6293 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6295 2004-01-18 Paul Eggert <eggert@twinsun.com>
6297 Merge from diffutils.
6299 * file-type.c (file_type): Add typed memory objects.
6300 * file-type.h (S_TYPEISTMO): New macro.
6302 * c-stack.h (c_stack_action): Remove argv argument.
6303 * c-stack.c (c_stack_action): Likewise. All uses changed.
6304 (die): Don't calculate message unless segv_action returns.
6305 (get_stack_location, min_address_from_argv, max_address_from_argv,
6306 volatile stack_base, volatile_stack_size): Remove.
6307 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6308 that every segmentation violation is a stack overflow. (Ouch!)
6309 See Debian bug 136249 (still outstanding) for more info about why
6310 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6312 2003-11-30 Bruno Haible <bruno@clisp.org>
6314 Safer stack allocation.
6315 * setenv.c: Include allocsa.h.
6316 (alloca): Remove fallback definition.
6317 (freea): Remove macro.
6318 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6321 2003-10-17 Bruno Haible <bruno@clisp.org>
6323 * binary-io.h: Avoid warnings on Cygwin.
6325 2003-12-28 Bruno Haible <bruno@clisp.org>
6327 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6328 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6330 2003-11-28 Bruno Haible <bruno@clisp.org>
6332 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6334 2003-11-27 Bruno Haible <bruno@clisp.org>
6336 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6338 2003-11-17 Bruno Haible <bruno@clisp.org>
6340 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6342 2003-11-24 Bruno Haible <bruno@clisp.org>
6344 * xallocsa.h: New file, from GNU gettext.
6345 * xallocsa.c: New file, from GNU gettext.
6347 2003-11-24 Bruno Haible <bruno@clisp.org>
6349 * allocsa.h: New file, from GNU gettext.
6350 * allocsa.c: New file, from GNU gettext.
6352 2003-11-24 Bruno Haible <bruno@clisp.org>
6354 * eealloc.h: New file.
6356 2004-01-15 Jim Meyering <jim@meyering.net>
6358 Merge from coreutils.
6360 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6361 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6362 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6364 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6365 optional configure-time default.
6367 * version-etc.c (version_etc_copyright): Update copyright date.
6369 * xreadlink.c (xreadlink): Correct outdated comment.
6371 2004-01-15 Paul Eggert <eggert@twinsun.com>
6373 Merge from coreutils.
6375 * posixver.c: Include posixver.h.
6377 * same.c: Include <stdbool.h>, <limits.h>.
6378 (_POSIX_NAME_MAX): Define if not defined.
6380 (same_name): If file names are silently truncated, report
6381 that the file names are the same if they are the same after
6382 the silent truncation.
6384 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6385 conversion function.
6386 * xstrtod.c (xstrtod): Likewise. All callers changed to
6387 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6390 2004-01-14 Paul Eggert <eggert@twinsun.com>
6392 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6393 with like-named macro in fnmatch.c.
6394 (EXT): Use an internal constant instead.
6396 Merge fnmatch patches from glibc.
6397 * fnmatch.c (mbsinit): Remove define.
6398 Add libc_hidden_ver (__fnmatch, fnmatch).
6399 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6400 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6402 2003-12-14 Karl Berry <karl@gnu.org>
6404 * config.charset: update from gettext-runtime.
6406 2003-12-03 Paul Eggert <eggert@twinsun.com>
6408 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6409 Bug reported by Alfred M. Szmidt.
6411 2003-11-29 Karl Berry <karl@gnu.org>
6413 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6415 2003-11-23 Paul Eggert <eggert@twinsun.com>
6416 Bruno Haible <bruno@clisp.org>
6418 * printf-parse.h: Don't include sys/types.h.
6419 (ARG_NONE): New macro.
6420 (char_directive): Change type of *arg_index fields to size_t.
6421 * printf-parse.c: Don't include sys/types.h.
6422 (SSIZE_MAX): Remove macro.
6423 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6424 Remove unnecessary overflow check.
6425 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6428 2003-11-24 Paul Eggert <eggert@twinsun.com>
6430 * alloca.c: Remove dependency on xalloc module.
6431 (xalloc_die): Remove.
6432 (memory_full) [!defined emacs]: New macro.
6433 [!defined emacs]: Don't include xalloc.h.
6434 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6435 address arithmetic overflows. Change datatypes a bit to avoid
6438 2003-11-22 Jim Meyering <jim@meyering.net>
6440 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6442 2003-11-17 Bruno Haible <bruno@clisp.org>
6444 * vasnprintf.c (alloca): Remove fallback definition.
6445 (freea): Remove definition.
6446 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6447 Reported by Paul Eggert.
6449 2003-11-17 Jim Meyering <jim@meyering.net>
6451 On systems without utime and without a utimes function capable of
6452 dealing with a NULL struct utimbuf* argument, this utime replacement
6453 could -- in unusual circumstances -- leak a file descriptor.
6454 * utime.c: Include <unistd.h> and <errno.h>.
6455 (utime_null): Be sure to close `fd' and to preserve errno.
6456 Reported by Geoff Collyer via Arnold Robbins.
6458 2003-11-16 Paul Eggert <eggert@twinsun.com>
6459 Bruno Haible <bruno@clisp.org>
6461 Protect against address arithmetic overflow.
6462 * printf-args.h: Include stddef.h.
6463 (arguments): Change type of field 'count' to size_t.
6464 * printf-args.c (printf_fetchargs): Use size_t instead of
6465 'unsigned int' where appropriate.
6466 * printf-parse.h: Include sys/types.h.
6467 (char_directive): Change type of *arg_index fields to ssize_t.
6468 (char_directives): Change type of fields 'count', max_*_length to
6470 * printf-parse.c: Include sys/types.h and xsize.h.
6471 (SSIZE_MAX): Define fallback value.
6472 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6473 instead of 'int' where appropriate. Check a_allocated, d_allocated
6474 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6475 * vasnprintf.c: Include xsize.h.
6476 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6477 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6478 overflow. Avoid wraparound when converting a width or precision from
6481 2003-11-16 Bruno Haible <bruno@clisp.org>
6483 Update from GNU gettext.
6484 * printf-parse.c: Generalize to it can be compiled for wide strings.
6485 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6486 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6487 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6488 SNPRINTF): New macros.
6489 Don't include <alloca.h> if the file is used inside libintl.
6490 (local_wcslen): New function, for Solaris 2.5.1.
6491 (VASNPRINTF): Use it instead of wcslen.
6493 2003-11-16 Bruno Haible <bruno@clisp.org>
6495 * xsize.h (xmax): New function.
6496 (xsum, xsum3, xsum4): Declare as "pure" functions.
6498 2003-11-12 Paul Eggert <eggert@twinsun.com>
6500 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6501 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6502 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6503 heuristic is just as accurate as far as we know, and it removes a
6504 dependency on size_max.m4 and ptrdiff_max.m4.
6506 2003-11-12 Paul Eggert <eggert@twinsun.com>
6508 * xstrtol.c (__xstrtol): Remove "break" immediately after
6509 "return", to pacify some unknown compiler. Problem reported
6512 2003-11-11 Bruno Haible <bruno@clisp.org>
6514 * xsize.h (SIZE_MAX): Remove fallback definition.
6515 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6518 2003-11-10 Paul Eggert <eggert@twinsun.com>
6520 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6521 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6522 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6524 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6525 not (size_t) -1, since it's defined here.
6527 2003-11-06 Paul Eggert <eggert@twinsun.com>
6529 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6530 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6531 Reject sizes of exactly SIZE_MAX bytes.
6532 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6533 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6535 2003-11-05 Bruno Haible <bruno@clisp.org>
6537 * xsize.h: Include limits.h, to avoid a possible collision with
6538 SIZE_MAX defined in <limits.h> on Solaris.
6540 2003-11-04 Bruno Haible <bruno@clisp.org>
6542 * xsize.h: New file.
6543 * linebreak.c: Include xsize.h.
6544 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6545 argument for overflow.
6546 Suggested by Paul Eggert.
6548 2003-10-31 Bruno Haible <bruno@clisp.org>
6550 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6551 to avoid (extremely rare) race condition.
6552 Suggested by Paul Eggert.
6554 2003-11-03 Jim Meyering <jim@meyering.net>
6556 * userspec.c: Include "userspec.h".
6557 * userspec.h: New file.
6559 2003-10-31 Paul Eggert <eggert@twinsun.com>
6561 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6562 * mountlist.c (SIZE_MAX): Define if not defined already.
6563 (read_filesystem_list): Set and use me_type_malloced.
6564 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6565 whatever the type happens to be), for brevity and consistency.
6566 Check for size calculation overflow on Alphas running OSF/1.
6568 2003-10-31 Jim Meyering <jim@meyering.net>
6570 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6572 * linebuffer.c: Include <string.h> for declaration of memset.
6574 2003-10-30 Paul Eggert <eggert@twinsun.com>
6575 Bruno Haible <bruno@clisp.org>
6577 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6578 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6580 2003-10-29 Paul Eggert <eggert@twinsun.com>
6582 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6583 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6585 * quotearg.c (quotearg_n_options): Use it.
6586 * group-member.c: Include <stdbool.h>.
6587 (free_group_info): Arg is now const *; don't free arg.
6588 (get_group_info): Now returns bool and accepts struct group_info *,
6589 rather than returning a malloc'ed struct group_info *.
6590 All uses changed. Check for overflow in internal size calculation.
6592 * getusershell.c (readname): Simplify the code by using x2nrealloc
6593 rather than xmalloc/xrealloc.
6594 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6595 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6596 conformance bug: the old code used a pointer after freeing the
6597 storage that it addressed.
6598 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6599 rather than doing it by hand.
6600 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6601 the buffer preserved. Use free and xmalloc instead.
6602 * quotearg.c (quotearg_n_options): Likewise.
6603 Use a simpler test for size overflow. Don't use xalloc_oversized
6604 because unsigned int might be wider than size_t (!); this suggests
6605 that we should switch from unsigned int to size_t for slot numbers.
6607 2003-10-27 Bruno Haible <bruno@clisp.org>
6609 * stdbool_.h: Better support for BeOS.
6611 2003-10-27 Paul Eggert <eggert@twinsun.com>
6613 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6614 to allocate the returned structure. Do not allocate a subarray,
6615 as x2nrealloc will do that.
6616 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6617 instead of xnrealloc.
6618 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6620 2003-10-26 Paul Eggert <eggert@twinsun.com>
6622 * xalloc.h (xalloc_oversized): New static inline function, for
6623 callers that want to do their own size-overflow checking. Include
6624 <stdbool.h>, since xalloc_oversized returns bool.
6625 * xalloc.c (array_size_overflow): Remove. All callers changed
6626 to use xalloc_oversized.
6628 Add two functions x2realloc, x2nrealloc, for programs that grow
6629 arrays dynamically by doubling their sizes.
6630 * xalloc.h (x2realloc, x2nrealloc): New decls.
6631 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6634 Port to C99 semantics for 'inline' of external functions.
6635 Bug reported by Bruno Haible.
6636 * xmalloc.c (xnmalloc_inline): New static inline function,
6637 with the old contents of xnmalloc.
6638 (xnmalloc, xmalloc): Use it.
6639 (xnrealloc_inline): New static inline function,
6640 with the old contents of xnrealloc.
6641 (xnrealloc, xrealloc): Use it.
6643 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6645 2003-10-25 Paul Eggert <eggert@twinsun.com>
6647 Fix several address-calculation bugs in the hash modules,
6648 plus some minor code cleanup.
6650 * hash.h: Include <stdbool.h>, for bool.
6651 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6652 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6653 hash_get_n_entries, hash_get_max_bucket_length,
6654 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6655 hash_rehash): Use size_t rather than unsigned.
6656 * hash.c (struct hash_table, hash_get_n_buckets,
6657 hash_get_n_buckets_used, hash_get_n_entries,
6658 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6659 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6660 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6662 (SIZE_MAX): Define if not defined.
6663 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6664 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6666 Use const * when possible.
6667 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6668 (check_tuning): Fix bug: if tuning parameters were very close to
6669 0 or 1, rounding errors could have caused subscript violations.
6670 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6671 (hash_initialize): Add 'fail:' label
6672 to free table and return NULL, and use it to simplify code.
6673 Use calloc rather than clearing the storage ourself.
6674 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6675 buffer size calculations.
6676 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6677 Include <stddef.h>, for size_t.
6678 * hash-pjw.c (hash_pjw): Likewise.
6679 Switch to method described by Bruno Haible.
6680 Include <limits.h>, for CHAR_BIT.
6681 (SIZE_BITS): New macro.
6683 2003-10-21 Paul Eggert <eggert@twinsun.com>
6685 * getndelim2.c (getndelim2): When size calculation overflows,
6686 ceiling the allocation at NMAX bytes rather than silently
6687 discarding input bytes before NMAX is reached. This makes
6688 a difference only if NMAX exceeds SIZE_MAX / 2.
6690 * obstack.c: Merge from glibc.
6691 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6692 Add libc_hidden_def (_obstack_newchunk).
6693 (_obstack_free) [! defined _LIBC]: Remove.
6694 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6695 a clone of the function body.
6696 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6697 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6699 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6700 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6703 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6704 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6705 Don't use lvalue casts, as GCC plans to remove support for them
6706 in GCC 3.5. Reported by Joseph S. Myers. This bug
6707 was also present in the non-GCC version, indicating that this
6708 code had always been buggy and had never been widely used.
6709 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6710 Use the fast variant of each macro, rather than copying the
6711 definiens of the fast variant; that way, we'll be more likely to
6712 catch future bugs in the fast variants.
6714 2003-10-20 Bruno Haible <bruno@clisp.org>
6716 * wait-process.h: New file, from GNU gettext.
6717 * wait-process.c: New file, from GNU gettext.
6719 2003-10-19 Jim Meyering <jim@meyering.net>
6721 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6723 2003-10-16 Paul Eggert <eggert@twinsun.com>
6725 * getgroups.c: Include <errno.h>, <stdlib.h>.
6726 (getgroups): First arg is int, not size_t.
6727 Don't let 'free' mangle errno.
6729 2003-10-16 Jim Meyering <jim@meyering.net>
6731 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6733 2003-10-15 Paul Eggert <eggert@twinsun.com>
6735 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6737 (new_exclude, add_exclude_file): Initial size no longer needs to
6739 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6740 our own address arithmetic overflow checking.
6742 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6743 (fnmatch): Do not alloca more than 2000 wide characters;
6744 instead, use malloc for large buffers.
6745 Check for address arithmetic overflow, and return -1
6746 with errno set to ENOMEM in that case.
6747 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6748 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6749 instead, return -1. Check for address arithmetic overflow.
6751 2003-10-14 Paul Eggert <eggert@twinsun.com>
6753 Handle invalid suffixes and overflow independently, so that
6754 callers can treat them independently as needed. Fix some bugs in
6755 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6756 suffix for a human-readable blocksize. The major caller-visible
6757 change is the addition of a new
6758 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6759 that both overflow and suffix chars were found.
6761 * human.c (humblock): Don't check separately for invalid suffix
6762 char; that is xstrtoumax's job (now that its bug is fixed).
6763 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6764 INTMAX_MAX]: New macros.
6765 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6766 TYPE_MAXIMUM): New macros.
6767 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6768 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6769 if overflow occurs, as it's what __strtol does and it's more useful
6771 (__xstrtol): If __strtol reports some error other than ERANGE,
6772 reflect it to the caller as LONGINT_INVALID. If it reports
6773 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6774 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6775 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6777 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6778 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6779 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6780 [defined UINTMAX_MAX]: New macros.
6782 2003-10-14 Bruno Haible <bruno@clisp.org>
6784 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6785 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6786 Also use volatile where needed.
6788 2003-10-12 Paul Eggert <eggert@twinsun.com>
6790 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6791 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6792 and define in terms of the other primitives.
6793 * xmalloc.c: Include stdbool.h; do not include exit.h.
6794 (SIZE_MAX): Define if not already defined.
6795 (array_size_overflow): New function.
6796 (xalloc_die): Abort instead of exiting if 'error' returns.
6797 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6798 (xmalloc, xrealloc): Use them.
6799 (xcalloc): Check for address arithmetic overflow.
6800 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6801 a bit faster than strcpy.
6803 2003-10-08 Paul Eggert <eggert@twinsun.com>
6805 Merge getpass from libc, plus a few fixes.
6807 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6808 Include <stdbool.h>.
6809 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6810 __fsetlocking to empty.
6811 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6812 do include <bits/libc-lock.h>.
6813 Do not include <fcntl.h>; not needed.
6814 [_LIBC]: Include <wchar.h>.
6815 (NOTCANCEL_MODE): New macro.
6816 (flockfile, funlockfile) [_LIBC]: New macros.
6817 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6818 [!_LIBC]: New macros.
6819 (call_fclose): New function.
6820 (getpass): Use it. Save tty stream separately; this simplifies the
6821 code and makes it more reliable if stdin happens to equal stdout.
6822 Invoke __fsetlocking on tty.
6823 Handle thread cancellation if needed.
6824 Namespace cleanup (use __tcgetattr, __getline).
6825 Use bool for Booleans.
6826 [USE_IN_LIBIO]: Handle wide streams.
6827 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6828 stream might go where.
6830 * unlocked-io.h: Include <stdio.h>, so that the caller
6831 doesn't have to include <stdio.h> before us.
6832 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6833 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6834 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6835 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6836 if not declared, so that we can use getpass.c code from libc without
6838 (flockfile, ftrylockfile, funlockfile): New macros.
6840 2003-10-06 Bruno Haible <bruno@clisp.org>
6842 * version-etc-2.h: Remove file.
6843 * version-etc-2.c: Remove file.
6845 2003-09-25 Jim Meyering <jim@meyering.net>
6846 Bruno Haible <bruno@clisp.org>
6848 This lets translators provide better translations for the
6849 "Written by ..." part of --version output.
6850 * version-etc.h: Include stdarg.h.
6851 (version_etc_copyright): Declare as readonly.
6852 (version_etc): Make this function variadic with a NULL-terminated list
6853 of author name strings.
6854 (version_etc_va): New declaration.
6855 * version-etc.c: Include stdarg.h, stdlib.h.
6856 (version_etc_copyright): Declare as readonly.
6857 (version_etc_va): New function. Provide a different translatable string
6858 for each possible number of authors < 10. Abbreviate when there are 10
6860 (version_etc): Make this function variadic. Call version_etc_va.
6861 Suggestion from Gary V. Vaughan.
6863 * long-options.h (parse_long_options): Change prototype: the authors
6864 string is moved to the end and becomes variadic.
6865 * long-options.c: Include stdarg.h.
6866 (parse_long_options): Make this function variadic, too.
6867 Call version_etc_va, not version_etc.
6869 2003-10-06 Bruno Haible <bruno@clisp.org>
6871 * fatal-signal.h: New file, from GNU gettext.
6872 * fatal-signal.c: New file, from GNU gettext.
6874 2003-10-04 Karl Berry <karl@gnu.org>
6876 * argp*: update from libc.
6878 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6880 * getpass.c (getpass): Use a no-op fseek when switching from input to
6881 output mode on the same stream.
6883 2003-09-29 Paul Eggert <eggert@twinsun.com>
6885 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6886 Fix arg typo in previous patch.
6888 2003-09-28 Jim Meyering <jim@meyering.net>
6890 * error.c: Correct cpp indentation.
6892 2003-09-27 Paul Eggert <eggert@twinsun.com>
6894 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6895 Omit the special code that used __typeof__, since we worry that
6896 it could be more trouble than it's worth. See:
6897 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6898 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6902 2003-09-26 Jim Meyering <jim@meyering.net>
6904 * error.c (error_tail): Move some declarations
6905 into inner scope where the local variables are used.
6907 2003-09-26 Bruno Haible <bruno@clisp.org>
6909 * stpncpy.h (gnu_stpncpy): New declaration.
6910 (stpncpy): Define as alias for gnu_stpncpy.
6911 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6913 2003-09-26 Paul Eggert <eggert@twinsun.com>
6915 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6916 (error_tail): Do not loop, reallocating temporary buffer, since
6917 the output cannot contain more wide characters than the input
6918 contains bytes, the size must be big enough already. This avoids
6919 one potential size overflow calculation. Check for size overflow
6920 when calculating temporary buffer size. Free temporary buffer
6921 when done, if it was allocated with malloc; this plugs a memory
6922 leak. Remove casts from void * to pointers, that are no longer
6923 needed now that we're assuming C89 or better.
6925 Merge error changes from glibc.
6927 * error.c, error.h: Update copyright notice header to match glibc.
6928 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6929 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6930 Disable cancellation while printing error.
6931 * error.h: Prepend __ to parameter names.
6933 2003-09-25 Karl Berry <karl@gnu.org>
6935 * argp-fmtstream.c, argp-help.c: update from libc.
6937 2003-09-25 Bruno Haible <bruno@clisp.org>
6939 * version-etc-2.h: New file, from version-etc.h with modifications.
6940 * version-etc-2.c: New file, from version-etc.c with modifications.
6942 2003-09-25 Simon Josefsson <jas@extundo.com>
6944 * xgetdomainname.h: New file.
6945 * xgetdomainname.c: New file.
6947 2003-09-25 Simon Josefsson <jas@extundo.com>
6948 Bruno Haible <bruno@clisp.org>
6950 * getdomainname.h: New file.
6951 * getdomainname.c: New file.
6953 2003-09-24 Paul Eggert <eggert@twinsun.com>
6955 * linebuffer.c (freebuffer): Don't free the argument, just
6956 the buffer associated with the argument. Bug reported by
6959 2003-09-19 Karl Berry <karl@gnu.org>
6961 * argp.h: update from libc.
6963 2003-09-16 Paul Eggert <eggert@twinsun.com>
6965 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6966 input error, instead of returning NULL the next time we are called
6967 (and therefore losing track of errno).
6969 2003-09-15 Paul Eggert <eggert@twinsun.com>
6971 * getndelim2.c (getndelim2): Don't trash errno when a read
6972 fails, so that the caller gets the proper errno.
6974 * readutmp.c (read_utmp): Likewise.
6975 Check for fstat error. Close stream and free storage
6978 2003-09-14 Bruno Haible <bruno@clisp.org>
6980 * fwriteerror.h: New file.
6981 * fwriteerror.c: New file.
6983 2003-09-14 Jim Meyering <jim@meyering.net>
6985 * getloadavg.c: Correct cpp indentation.
6986 * strdup.c: Likewise.
6987 * vasnprintf.c: Likewise.
6989 2003-09-12 Paul Eggert <eggert@twinsun.com>
6991 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6992 * obstack.c [!defined _LIBC]: Likewise.
6993 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6994 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6995 * exitfail.c: Don't include stdlib.h; no longer needed.
6997 More changes to assume C89 or better.
6999 * error.c (error_tail): Assume vprintf.
7001 * argmatch.c (getenv): Remove decl.
7002 * progreloc.c (get_full_program_name): Define via prototype.
7003 * setenv.c (clearenv): Likewise.
7004 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7006 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7007 (malloc, memcpy): Remove decls.
7008 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7009 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7010 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7011 (memcpy): Remove macro.
7012 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7013 (__P): Remove. All uses removed.
7014 (PTR): Remove. All uses changed to void *.
7015 (CHAR_BIT, NULL): Remove.
7016 (spaces, zeros, memset_space, memset_zero)
7017 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7019 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7020 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7021 Define with prototype.
7022 Remove now-unnecessary prototype decl.
7023 (extra_args_spec): Assume ANSI C. All uses changed.
7024 (extra_args_spec_iso): Remove.
7025 (my_strftime, emacs_strftimeu): Define via prototype.
7026 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7028 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7029 * strtoimax.c: Include <stdlib.h> unconditionally.
7030 (strtoul, strtol): Remove decls.
7031 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7033 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7034 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
7035 (LOCALE_PARAM_PROTO): New macro.
7036 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7037 (INTERNAL (strtol), strtol): Define with a prototype.
7038 (PARAMS): Remove. All uses removed.
7039 * tempname.c: Include <string.h> unconditionally.
7040 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7041 * xgethostname.c (main): Define with a prototype.
7042 * xmalloc.c: Include "xalloc.h" first, to check interface.
7043 Include <stdlib.h> unconditionally.
7044 (calloc, malloc, realloc, free): Remove decls.
7045 * xstrtod.c: Include "xstrtod.h" first, to check interface.
7046 Include <stdlib.h> unconditionally. Sort include file names.
7048 (xstrtod): Define with a prototype.
7049 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7050 (strtol, strtoul): Remove decls.
7052 2003-09-11 Paul Eggert <eggert@twinsun.com>
7054 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7055 Include <stdlib.h>, <string.h> unconditionally.
7056 Remove now-unnecessary cast to char *.
7057 * strnlen.c: Include <string.h> unconditionally.
7058 * yesno.c (yesno): Define with a prototype.
7060 2003-09-10 Bruno Haible <bruno@clisp.org>
7062 * strcspn.c: Include <string.h> unconditionally.
7063 * strpbrk.c: Include <string.h> unconditionally.
7064 * strstr.c: Include <string.h> unconditionally.
7065 * unicodeio.c: Include <string.h> unconditionally.
7066 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7067 * unsetenv.c: Likewise.
7068 * xreadlink.c: Include <stdlib.h> unconditionally.
7069 * yesno.c: Include <stdlib.h> unconditionally.
7070 (rpmatch): Add prototype.
7072 2003-09-10 Jim Meyering <jim@meyering.net>
7074 * error.c: Correct indentation of cpp directives.
7076 2003-09-09 Paul Eggert <eggert@twinsun.com>
7080 * acosl.c (main): Use a prototype.
7081 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7084 * getloadavg.c (getloadavg, main): Define via prototypes.
7086 * getopt.h (struct option.name): Assume C89, and use 'const'.
7087 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7088 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7090 * getopt.c (const): Remove macro.
7091 Include <string.h> unconditionally.
7092 (my_index): Remove; all uses changed to strchr.
7093 (strlen): Remove decl.
7094 (exchange): Remove forward decl; no longer needed.
7095 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7096 Define with prototype.
7097 * getopt1.c (const): Remove macro.
7098 (getopt_long, getopt_long_only, main): Define with prototype.
7100 * getugroups.c: Include <string.h> unconditionally.
7102 * getusershell.c: Include <stdlib.h> unconditionally.
7103 (getusershell, setusershell, endusershell, readname, main):
7104 Define with prototypes.
7106 * group-member.c: Include group-member.h first.
7107 Include <stdlib.h> unconditionally.
7109 * hard-locale.c: Include hard-locale.h first.
7110 Include <stdlib.h>, <string.h> unconditionally.
7112 * hash.c (free, malloc): Remove decls.
7113 Include <stdlib.h> unconditionally.
7115 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7116 (getenv): Do not declare.
7118 * idcache.c: Include <string.h> unconditionally.
7120 * long-options.c: Include long-options.h first, to test interface.
7121 Include <stdlib.h> unconditionally.
7123 * makepath.c: Include makepath.h first, to test interface.
7124 Include <stdlib.h> and <string.h> unconditionally.
7126 * linebuffer.c: Include <stdlib.h>.
7127 (free): Remove decl.
7129 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7130 rpl_malloc returns void *, not char *.
7131 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7133 * md5.h: Include <limits.h> unconditionally.
7134 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7135 (__P): Remove; all uses removed.
7136 * md5.c: Include "md5.h" first.
7137 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7138 md5_buffer, md5_process_bytes, md5_process_block):
7139 Define with prototypes.
7140 * sha.h (__P): Remove all uses. (It wasn't defined??)
7141 * sha.c: Include "sha.h" first.
7142 Include <stdlib.h>, <string.h> unconditionally.
7144 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7145 * memcmp.c (__ptr_t): Likewise.
7146 * memrchr.c (__ptr_t): Likewise.
7147 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7148 Include <string.h> unconditionally.
7149 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7150 * memchr.c: Include <stdlib.h> unconditionally.
7151 * memchr.c (LONG_MAX): Remove.
7152 * memrchr.c (LONG_MAX): Likewise.
7153 * memchr.c (__memchr): Define via a prototype.
7154 * memrchr.c (__memrchr): Likewise.
7155 * memcmp.c (__P): Remove, and remove all uses.
7156 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7157 Remove forward decls; no longer needed.
7158 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7159 Use types required by C89 in prototype.
7161 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7162 * savedir.c: Likewise.
7163 * mkdir.c (free): Remove decl.
7164 * rmdir.c (rmdir): Define with a prototype.
7165 * savedir.c: Include savedir.h first, to test interface.
7167 * mktime.c (STDC_HEADERS): Remove.
7168 Include <stdlib.h>, <string.h> unconditionally.
7170 * modechange.c: Include <stdlib.h> unconditionally.
7171 (malloc): Remove decl.
7173 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7174 (free): Remove decl.
7176 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7177 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7178 (This type really should be intptr_t, but that's a C99ism.)
7179 (_obstack_memcpy): Remove: all uses changed to memcpy.
7180 Include <string.h> unconditionally.
7181 (struct obstack): Assume __STDC__ for types of members
7182 chunkfun, freefun, extra_arg.
7183 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7184 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7185 obstack_begin, obstack_specify_allocation,
7186 obstack_specify_allocation_with_arg, obstack_chunkfun,
7187 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7188 Remove unprototyped decls and the macros that use them.
7189 * obstack.c (POINTER): Remove. All uses changed to void *.
7190 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7191 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7192 (defined __STDC__ && __STDC__)]:
7193 Remove nonprototyped code.
7194 Include <stdlib.h> unconditionally.
7195 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7196 _obstack_allocated_p, _obstack_free, obstack_free,
7197 _obstack_memory_used, print_and_abort):
7198 Define using prototypes.
7199 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7200 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7201 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7202 obstack_next_free, obstack_object_size, obstack_room) [0]:
7203 Remove unused, unprototyped code.
7205 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7207 * physmem.c (physmem_total, physmem_available, main): Define
7210 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7211 (main): Define with a prototype.
7213 * posixver.c (getenv): Remove decl.
7215 * putenv.c (malloc): Returns void *, not char *.
7216 Include <string.h> unconditionally.
7217 (strchr, memcpy, NULL): Do not define.
7219 * readtokens.c: Include readtokens.h first, to test interface.
7220 Include <stdlib.h>, <string.h> unconditionally.
7221 (init_tokenbuffer): Define with a prototype.
7223 * regex.c (PARAMS): Remove. All uses removed.
7224 All uses of _RE_ARGS removed, too.
7225 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7227 (bzero): Assume memset exists.
7228 (memcmp, memcpy, NULL): Remove.
7229 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7230 char, or assignments to local vars of type signed char.
7231 (init_syntax_once, PREFIX(extract_number_and_incr),
7232 PREFIX(print_partial_compiled_pattern),
7233 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7234 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7235 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7236 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7237 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7238 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7239 wcs_compile_range, byte_compile_range, truncate_wchar,
7240 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7241 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7242 count_mbs_length, wcs_re_match_2_internal,
7243 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7244 PREFIX(alt_match_null_string_p),
7245 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7246 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7247 regfree, PREFIX(extract_number)): Define with prototype. Remove
7248 now-unnecessary declaration, if any.
7249 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7251 Remove now-unnecessary casts among pointer types.
7252 * regex.h (_RE_ARGS): Remove. All uses removed.
7254 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7255 (free): Remove decl.
7257 * rpmatch.c: Include <stdlib.h> unconditionally.
7259 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7260 (free): Remove decl.
7262 * save-cwd.c: Include <stdlib.h> unconditionally.
7263 * xgetcwd.c: Likewise.
7265 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7266 (free): Remove decl.
7268 * strchrnul.c (strchrnul): Define with a prototype.
7269 Fix bug: c_in was not converted to char before searching.
7271 The following changes are not K&R related:
7273 * group-member.h: Include <sys/types.h>, so that this file is
7275 * makepath.h: Likewise.
7277 * getusershell.c (readname, default_index, line_size, readname):
7278 Use size_t, not int, for sizes.
7279 (readname): If the size overflows, report an error instead of
7282 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7284 * getndelim2.c: Assume stdlib.h per the C89 spec.
7286 2003-09-08 Paul Eggert <eggert@twinsun.com>
7288 Assume C89 or better; remove K&R cruft.
7289 A few of these changes were first proposed by Derek Robert Price
7290 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7292 * addext.c: Include <string.h> unconditionally.
7293 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7294 Don't declare getenv or malloc.
7296 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7297 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7299 (find_stack_direction, alloca): Use prototypes.
7301 * atexit.c (atexit): Define using a prototype.
7303 * basename.c, dirname.c, stripslash.c:
7304 Include <string.h> unconditionally.
7306 * bcopy.c: Include <stddef.h>.
7307 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7309 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7311 * error.h (error, error_at_line, error_print_progname)
7312 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7313 * error.c: Include error.h first, to check interface.
7314 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7315 (VA_START): Remove; all uses changeed to va_start.
7316 (exit, strerror): Remove decls.
7317 (error_print_progname): Prototype uncondionally.
7318 Don't include <errno.h>; no longer needed.
7319 (private_strerror): Remove.
7320 (error_tail): Always define.
7321 (error, error_at_line): Assume C89 or better; always use prototypes.
7322 * fatal.c: Include "fatal.h" first, to test interface.
7323 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7324 (VA_START): Remove; all uses changed to va_start.
7325 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7327 (exit): Remove decl.
7328 (fatal): Prototype unconditionally. Assume va_start works.
7329 Abort at end, to pacify gcc.
7331 * euidaccess.c (main): Define with a prototype.
7333 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7335 * exitfail.c: Include <stdlib.h> unconditionally.
7337 * fnmatch_.h (__P): Remove. All uses changed to assume
7339 * fnmatch.c: Include fnmatch.h first, to test interface.
7340 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7341 (getenv): Remove decl.
7342 (fnmatch): Define using a prototype.
7343 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7344 (FCT): Define using a prototype.
7346 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7348 * gethostname.c: Include <stddef.h>.
7349 (gethostname): Define with prototype. Length is size_t, not int.
7351 2003-09-08 Paul Eggert <eggert@twinsun.com>
7353 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7354 getversion.c should have been removed then, but was accidentally
7357 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7358 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7360 2003-09-07 Paul Eggert <eggert@twinsun.com>
7362 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7363 copy_tm_result. Bug reported by Simon Josefsson in
7364 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7366 2003-09-06 Paul Eggert <eggert@twinsun.com>
7368 * time_r.c, time_r.h: New files.
7370 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7372 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7373 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7375 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7377 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7378 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7381 * timegm.c: Switch to glibc implementation, with the following changes:
7382 [defined HAVE_CONFIG_H]: Include <config.h>.
7383 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7384 (__mktime_internal) [!defined _LIBC]: New decl.
7385 (__gmtime_r) [!defined _LIBC]: New macro and function.
7386 (timegm): Use a prototype, since gnulib assumes C89.
7387 Do not bother declaring tmp to be const, as it's not really usefu.
7388 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7389 (timegm): Declare only if HAVE_DECL_TIMEGM.
7391 2003-09-03 Paul Eggert <eggert@twinsun.com>
7393 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7394 Bug reported by Lute Kamstra in
7395 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7397 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7398 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7399 course with correspondingly smaller numbers for tomorrow and
7400 yesterday. From Tadayoshi Funaba. Originally installed into
7401 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7404 2003-08-31 Simon Josefsson <jas@extundo.com>
7406 * timegm.h: New file.
7407 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7409 2003-08-31 Karl Berry <karl@gnu.org>
7411 * argp.h: update from libc.
7413 2003-08-28 Bruno Haible <bruno@clisp.org>
7415 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7416 warning on QNX, which defines O_BINARY to 000000.
7418 2003-08-24 Bruno Haible <bruno@clisp.org>
7420 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7421 MSVC7 <stdio.h> is included later.
7423 2003-08-20 Bruno Haible <bruno@clisp.org>
7425 * progname.h: New file, from GNU gettext.
7426 * progname.c: New file, from GNU gettext.
7427 * progreloc.c: New file, from GNU gettext.
7429 2003-08-19 Bruno Haible <bruno@clisp.org>
7431 * xstrdup.c: Assume <string.h> exists.
7433 2003-08-18 Jim Meyering <jim@meyering.net>
7435 * setenv.h: Indent nested cpp directive.
7436 * vasnprintf.c: Remove trailing blanks.
7438 2003-08-17 Simon Josefsson <jas@extundo.com>
7439 Bruno Haible <bruno@clisp.org>
7441 * xstrndup.h: New file.
7442 * xstrndup.c: New file.
7444 2003-08-17 Bruno Haible <bruno@clisp.org>
7446 * strndup.h: New file.
7448 2003-08-16 Paul Eggert <eggert@twinsun.com>
7450 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7451 space, undoing this 2003-08-12 change:
7452 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7454 2003-08-16 Jim Meyering <jim@meyering.net>
7456 Merge from coreutils.
7457 * xstrtoimax.c: #else #if -> #elif.
7458 * xstrtoumax.c: Likewise.
7460 2003-08-15 Paul Eggert <eggert@twinsun.com>
7462 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7463 rather than tab, after '#' in shell-script copyright notices.
7464 Suggested by Bruno Haible.
7466 2003-08-15 Jim Meyering <jim@meyering.net>
7467 and Paul Eggert <eggert@twinsun.com>
7469 Merge from coreutils.
7470 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7471 member but strut utmpx does not. Needed for AIX 4.3.3.
7472 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7474 2003-08-15 Jim Meyering <jim@meyering.net>
7476 Merge from coreutils.
7477 * xgethostname.c: Include <stdlib.h>.
7478 (xghostname): Don't exit for anything other than memory-related
7479 failure; just return NULL.
7480 * userspec.c: Include "posixver.h".
7481 (parse_user_spec): Accept `.' as a separator only
7482 in pre-POSIX-200112 mode.
7483 * strtoimax.c: Use #elif rather than #else #if.
7484 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7485 Remove function, now that we can rely on a working tzset function.
7486 [!_LIBC]: Ensure that the required autoconf test has been run.
7487 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7488 Use underlying_strftime for %r.
7489 * sha.c: Merge in some clean-up and optimization changes from glibc.
7490 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7491 Ensure that it is a multiple of 64.
7492 Rearrange loop exit tests so as to avoid performing an
7493 additional fread after encountering an error or EOF.
7494 * realloc.c: Update copyright date.
7496 2003-08-14 Jim Meyering <jim@meyering.net>
7498 Merge from coreutils.
7499 * obstack.h: Whitespace changes.
7500 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7501 and xcalloc return values.
7502 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7503 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7504 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7505 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7506 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7508 Use mntctl's return value to drive the entry-processing loop, since
7509 we can't rely on the value of the vmt_length member in the last
7510 entry. On some systems doing so could result in exhausting
7511 virtual memory. Based in part on a patch from Mike Jetzer.
7513 2003-08-14 Jim Meyering <jim@meyering.net>
7514 and Paul Eggert <eggert@twinsun.com>
7516 Merges from coreutils, plus other fixes.
7517 * physmem.c: Merge in portability changes from gcc/libiberty
7518 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7519 for credits and details. Thanks to Kaveh Ghazi for helping
7520 to keep these files in sync.
7521 (ARRAY_SIZE): Define it.
7522 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7523 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7524 (memcasecmp): Don't assume size_t fits in unsigned int.
7525 Remove casts and duplicate code.
7526 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7527 (memcpy): Remove definition.
7528 Merge in some clean-up and optimization changes from glibc.
7529 [BLOCKSIZE]: Move definition to top of file.
7530 Ensure that it is a multiple of 64.
7531 Rearrange loop exit tests so as to avoid performing an
7532 additional fread after encountering an error or EOF.
7533 * md5.h (md5_uintptr): Define.
7534 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7535 return to the initial working directory. Preserve errno
7537 * idcache.c: Include "xalloc.h".
7538 (xmalloc, xrealloc): Remove decls.
7539 (getuser): Remove casts no longer required in C89.
7540 * human.c: Include stdio.h, for sprintf.
7541 * group-member.c: Include "xalloc.h".
7542 (xmalloc, xrealloc): Remove decls.
7543 (get_group_info): Remove casts no longer required in C89.
7544 * getusershell.c (readname): Remove casts no longer required in C89.
7545 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7546 * getline.c: Whitespace fix, from coreutils.
7548 2003-08-13 Paul Eggert <eggert@twinsun.com>
7550 * exclude.c: Include <ctype.h>
7551 (IN_CTYPE_DOMAIN): New macro.
7553 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7556 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7557 Undo previous (whitespace-only) change.
7559 2003-08-12 Paul Eggert <eggert@twinsun.com>
7561 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7562 Normalize leading white space and remove trailing white space.
7563 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7564 notice, as per ../config/srclist-update.
7566 Merge from coreutils.
7567 * euidaccess.h: New file.
7568 * euidaccess.c: Include it.
7569 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7570 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7571 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7573 2003-08-11 Bruno Haible <bruno@clisp.org>
7575 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7576 (vasnprintf): Use it instead of wcslen.
7578 2003-08-11 Bruno Haible <bruno@clisp.org>
7580 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7581 value to ensure that _Bool promotes to int. Use #define for _Bool when
7582 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7584 2003-08-10 Karl Berry <karl@gnu.org>
7586 * regex.h: update from libc (whitespace fix).
7588 2003-08-09 Paul Eggert <eggert@twinsun.com>
7590 Merge some files from coreutils. These changes were
7591 originally made by Jim Meyering.
7592 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7593 many older Unixes require this.
7594 * alloca.c (alloca): Remove cast to argument of free;
7595 no longer needed in C89.
7596 * alloca_.h, regex.h: Fix white space to match
7597 what GNU indent does.
7599 2003-08-05 Paul Eggert <eggert@twinsun.com>
7601 * bumpalloc.h: Remove.
7603 2003-08-04 Paul Eggert <eggert@twinsun.com>
7605 * getloadavg.c: Change copyright notice and spacing to conform to
7608 Merge from coreutils.
7609 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7611 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7612 from Karl Berry, implemented by Jim Meyering.
7613 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7614 from Dmitry V. Levin.
7615 Remove anachronistic cast of xrealloc.
7616 * fnmatch_.h (__const): Remove. Use 'const'.
7617 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7618 type. Otherwise, it wouldn't compile with at least /bin/cc on
7619 ymp-cray-unicos9.0.2.X.
7620 Combine two mostly-identical uses of alloca into one.
7621 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7623 2003-08-04 Dave Love <d.love@dl.ac.uk>
7627 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7628 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7629 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7630 obsolete NLIST_NAME_UNION.
7631 [__GNU__]: Undef BSD and FSCALE.
7632 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7634 2003-08-03 Paul Eggert <eggert@twinsun.com>
7636 * stdbool_.h (_Bool): Make it signed char, instead of
7637 an enum type, so that it's guaranteed to promote to int. See:
7638 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7640 2003-07-31 Paul Eggert <eggert@twinsun.com>
7642 * strerror.c: Include config.h, limits.h. Declare sprintf.
7643 (strerror): Don't assume that a printable int fits in 14 bytes.
7645 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7646 Bruno Haible <bruno@clisp.org>
7648 * getline.h (getline, getdelim): Change return type to ssize_t.
7649 * getline.c (getline, getdelim): Likewise.
7650 Remove _GNU_SOURCE define; now it's defined in config.h through
7653 2003-07-22 Paul Eggert <eggert@twinsun.com>
7655 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7656 over-parenthesization in macros.
7658 Sync with coreutils.
7660 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7663 Use `exit_failure' for xalloc and xmemcoll instead of their own
7664 private exit-failure variables.
7665 * xalloc.h (xalloc_exit_failure): Remove.
7666 * xmalloc.c: Likewise. Include exitfail.h.
7667 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7668 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7669 * xmemcoll.c: Likewise. Include exitfail.h.
7670 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7672 2003-07-18 Paul Eggert <eggert@twinsun.com>
7674 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7675 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7676 to test that it can stand by itself. Include "exitfail.h".
7677 Clients should set exit_failure instead.
7678 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7680 2003-07-18 Andreas Schwab <schwab@suse.de>
7682 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7684 2003-07-18 Bruno Haible <bruno@clisp.org>
7686 * getndelim2.h: New file.
7687 * getndelim2.c: Make into a module of its own. Include config.h,
7689 (getndelim2): Make non-static. Change return type to ssize_t.
7690 * getline.h: Change argument names.
7691 * getline.c: Include getndelim2.h instead of getndelim2.c.
7692 * getnline.c: Include getndelim2.h.
7694 2003-07-17 Bruno Haible <bruno@clisp.org>
7696 * Makefile.am: Remove file.
7697 * Makefile.in: Remove file.
7699 2003-07-17 Bruno Haible <bruno@clisp.org>
7701 * getnline.h: New file.
7702 * getnline.c: New file.
7703 * getndelim2.c: New file, extracted from getline.c.
7704 (getndelim2): Renamed from getdelim2, with added nmax argument.
7705 * getline.c: Include getndelim2.c.
7706 (getdelim2): Moved out to getndelim2.c.
7707 (getline, getdelim): Update.
7709 2003-07-15 <karl@gnu.org>
7711 * vasnprintf.c: update from gettext.
7713 2003-07-15 Jim Meyering <jim@meyering.net>
7715 * makepath.c (make_path): Enclose diagnostic in _(...).
7717 2003-07-14 Paul Eggert <eggert@twinsun.com>
7719 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7720 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7721 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7722 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7723 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7724 updated automatically by ../config/srclist-update. This changes
7725 their license from LPGL to GPL.
7727 2003-07-14 Jim Meyering <jim@meyering.net>
7729 Don't emit diagnostics. Let callers do that.
7730 * save-cwd.c: Don't include "error.h".
7731 (save_cwd): Don't call error. Ensure that errno is valid
7732 when returning nonzero.
7734 * save-cwd.h (restore_cwd): Update prototype.
7735 * save-cwd.c (restore_cwd): Remove two parameters.
7736 Simplify. Don't call error upon failure. Let callers do that.
7737 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7738 when auditing is enabled. But don't bother updating the #if.
7740 2003-07-14 Simon Josefsson <jas@extundo.com>
7742 * mempcpy.h: New file.
7743 * mempcpy.c: New file.
7745 2003-07-14 Paul Eggert <eggert@twinsun.com>
7747 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7748 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7749 unicodeio.c, unicodeio.h, unlocked-io.h:
7750 Switch from LGPL to GPL.
7752 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7754 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7755 it breaks C++ compilation.
7756 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7758 2003-07-10 Jim Meyering <jim@meyering.net>
7760 * vasnprintf.c: Remove trailing blanks.
7761 Make cpp indentation consistent.
7763 2003-07-09 Paul Eggert <eggert@twinsun.com>
7765 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7766 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7767 Switch from LGPL to GPL.
7769 2003-07-07 Paul Eggert <eggert@twinsun.com>
7771 * mktime.c: Fix some boundary cases and remove need for floating point.
7773 Issue a compile-time diagnostic if time_t is floating point, or if
7774 two's complement arithmetic is not in effect, or if arithmetic
7775 right shift does not propagate the sign. These assumptions were
7776 all in the original code but they weren't checked.
7778 (TIME_T_MIDPOINT, verify): New macros.
7779 (__isleap): Remove; it has integer overflow problems.
7780 (leapyear): New function, without those problems.
7781 (ydhms_tm_diff): Remove; splitting into two parts.
7782 (ydhms_diff): New function, containing the arithmetic part of
7783 the old ydhms_tm_diff function. Issue a compile-time
7784 diagnostic if we are not using C99 integer division.
7785 Avoid casts when possible.
7786 (guess_time_tm): New function, containing the checking part of
7787 the old ydhms_tm_diff function. Return the new value, rather than
7788 the difference between it and the old. Accept a new argument T
7789 so that *T specifies the old value. Check for overflow in the result.
7791 (__mktime_internal): Use a time_t offset, not a long int offset.
7792 This undoes the 2003-06-04 change, which is no longer needed now
7793 that we have better overflow checking.
7794 (localtime_offset): Likewise.
7796 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7797 and long are 64-bit but int is only 32-bit.
7798 (ydhms_diff): Use long int to store year1 and yday1.
7799 Issue a compile-time diagnostic if long int is not wide enough.
7801 (__mktime_internal): Use long int to store adjusted year and yday.
7802 Use plain C rather than preprocessor commands, if that doesn't
7804 Check for overflow (and try to repair) after each probe
7805 rather than checking only at the very end. This avoids some bugs
7806 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7807 does not equal GMT offset at maximum time).
7808 Use integer to check for overflow rather than floating point; this
7809 is more portable to non-IEEE hosts, and is a tad faster.
7810 When we detect that we are oscillating between two values,
7811 don't check whether tm_isdst has the requested value, since
7812 we already know the answer. When tm_isdst has the wrong value,
7813 use a different heuristic to find the right one, based on the
7814 extreme values actually observed in practice in tz2003a,
7815 rather than the (overly optimistic) "previous 3 calendar quarters".
7817 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7818 "T const" to accommodate glibc style.
7819 (check_result): Use less-confusing report format. "long" -> "long int.
7821 Don't loop if the iteration overflows time_t.
7822 Allow a negative step in the iteration.
7824 2003-07-01 Paul Eggert <eggert@twinsun.com>
7826 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7827 having it depend on HAVE_SYS_TYPES_H.
7829 2003-06-25 Bruno Haible <bruno@clisp.org>
7831 * readlink.c: New file.
7833 2003-06-20 Bruno Haible <bruno@clisp.org>
7835 Assume C89, so PARAMS isn't needed.
7836 * unicodeio.h (PARAMS): Remove.
7837 * unicodeio.c: Don't use PARAMS.
7839 2003-06-18 Jim Meyering <jim@meyering.net>
7841 Merge changes from coreutils.
7842 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7843 Remove explicit declarations of xmalloc and realloc.
7845 (read_utmp): Remove anachronistic cast of xmalloc.
7847 2003-06-17 Paul Eggert <eggert@twinsun.com>
7849 Assume C89, so PARAMS isn't needed.
7850 * backupfile.h (PARAMS): Remove. All uses removed.
7851 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7852 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7853 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7854 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7855 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7856 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7857 xstrtol.h: Likewise.
7858 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7859 same.h, strverscmp.h: Do not include config.h; no longer needed.
7860 Anyway, config.h should always be included before any other file.
7862 2003-06-11 Simon Josefsson <jas@extundo.com>
7864 * sysexit_.h: New file.
7866 2003-05-20 Derek Price <derek@ximbiot.com>
7868 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7870 2003-06-10 Simon Josefsson <jas@extundo.com>
7872 * strchrnul.h: New file.
7873 * strchrnul.c: New file.
7875 2003-06-10 Simon Josefsson <jas@extundo.com>
7877 * argp.h: New file, from glibc.
7878 * argp-ba.c: New file, from glibc.
7879 * argp-eexst.c: New file, from glibc.
7880 * argp-fmtstream.c: New file, from glibc.
7881 * argp-fmtstream.h: New file, from glibc.
7882 * argp-fs-xinl.c: New file, from glibc.
7883 * argp-help.c: New file, from glibc.
7884 * argp-namefrob.h: New file, from glibc.
7885 * argp-parse.c: New file, from glibc.
7886 * argp-pv.c: New file, from glibc.
7887 * argp-pvh.c: New file, from glibc.
7888 * argp-xinl.c: New file, from glibc.
7890 2003-06-07 Jim Meyering <jim@meyering.net>
7892 * readtokens.h: Put `Free Software Foundation, Inc.'
7893 in place of my name in the copyright comment.
7894 Remove definition and uses of __P.
7897 * stat.c: Don't declare xmalloc explicitly.
7898 Instead, include "xalloc.h".
7899 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7900 xrealloc, and xcalloc return values.
7901 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7903 * xgetcwd.h: Remove definition/uses of PARAMS.
7905 2003-06-06 Jim Meyering <jim@meyering.net>
7907 * stdbool_.h: Renamed from stdbool.h.in.
7909 2003-06-06 Jim Meyering <jim@meyering.net>
7911 Merge from coreutils.
7912 * same.c: (same_name): Declare *_basename locals to be `const'.
7913 Consolidate declarations and initializations of *_base* locals.
7915 Merge from coreutils.
7916 This avoids a core dump on systems without GNU putenv,
7917 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7918 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7919 (unsetenv): New static function, from GNU libc.
7920 (rpl_putenv): Use it.
7922 * modechange.c: Remove trailing blanks.
7924 Merge from coreutils.
7925 * fsusage.c: Remove declaration of statfs.
7926 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7928 * posixtm.c: Include <stdbool.h> unconditionally.
7930 2003-06-05 Paul Eggert <eggert@twinsun.com>
7932 * mktime.c (__mktime_internal): When resolving a tm_isdst
7933 mismatch, look in future quarters as well as past. This fixes a
7934 bug when processing fall-backwards gaps immediately after a long
7935 period of daylight-saving time.
7937 * mktime.c: Assume freestanding C89 or better.
7938 (HAVE_LIMITS_H): Remove. Assume it's 1.
7939 (__P): Remove; not used.
7940 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7941 (mktime, not_equal_tm, print_tm, check_result,
7942 main): Use prototypes. Use const * where appropriate.
7943 (main): Fix typo in testing code that uncovered by above changes.
7944 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7946 2003-06-04 Paul Eggert <eggert@twinsun.com>
7948 * mktime.c: Fix Debian bug 177940
7949 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7950 (localtime_offset): Now long int, not time_t, because we want it
7951 to be guaranteed to be signed. All uses changed.
7952 (__mktime_internal): If overflow would occur when adding offset,
7955 Merge 'human' changes from coreutils. Rewrite to support
7956 locale-specific notations like thousands separators.
7957 * human.c: Simplify authorship notice.
7958 Include human.h immediately after config.h.
7959 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7960 <limits.h>: Do not include, since human.h does.
7961 (SIZE_MAX, UINTMAX_MAX): New macros.
7962 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7963 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7964 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7965 (power_letter): Renamed from suffixes.
7966 (generate_suffix_backwards): Remove.
7967 (adjust_value): Now takes int style (because of human.h changes)
7968 and long double value (for greater precision on some platforms).
7969 (group_number): New function.
7970 (human_readable): Use it. Use integer options, not enum.
7971 Put the options before the sizes in the arg list.
7972 Support all the new options.
7973 The old human_readable function has been removed;
7974 use inttostr.h instead.
7975 (human_readable, default_block_size, humblock):
7976 Use uintmax_t, not int, for block sizes.
7977 (human_readable_inexact, block_size_types): Remove.
7978 (block_size_opts): New constant.
7979 (human_options): Renamed from human_block_size, with new signature
7980 that allows block sizes up to UINTMAX_MAX. All callers changed.
7981 * human.h: Add copyright and authorship notice.
7982 Include <limits.h> and <stdbool.h> unconditionally.
7983 (PARAMS): Remove. All uses removed.
7984 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7985 (enum human_inexact_style): Remove tag; now a nameless enum.
7986 (human_floor, human_ceiling, human_round_to_even): Now have
7987 values 2, 0, 1 rather than -1, 1, 0.
7988 (human_group_digits, human_suppress_point_zero, human_autoscale,
7989 human_base_1024, human_SI, human_B): New constants.
7990 (human_readable_inexact, human_block_size): Remove.
7991 (human_readable): Size args are now uintmax_t, not int.
7992 (human_options): New decl.
7994 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7995 unnecessary now that we assume C89 or better. This change
7996 imported from coreutils.
7998 * mktime.c (__mktime_internal): Do not reject negative timestamps
7999 arbitrarily. This is the same patch as 2003-05-28, but it got lost
8000 in the 2003-05-30 sync from glibc.
8002 .h files should stand alone, but we shouldn't include <sys/types.h>
8003 if we can get away with just <stddef.h>.
8005 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8006 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8007 rather than <sys/types.h>, as we merely need size_t.
8008 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8010 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8011 Include <stdio.h>, to get FILE.
8012 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8013 memcasecmp.h has included <stddef.h> and all we need is size_t.
8014 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8015 our interface, instead of including <sys/types.h>
8017 2003-06-02 Paul Eggert <eggert@twinsun.com>
8020 Fix some minor time-related bugs with POSIX time arguments.
8021 Some valid time stamps were being rejected (notably -1, and
8022 time stamps before 1900 on 64-bit hosts). And some invalid
8023 time stamps were being accepted, e.g. September 31.
8025 * posixtm.h (posixtime): Return bool instead of time_t, so
8026 that we can return (time_t) -1 successfully.
8027 * posixtm.c: Likewise.
8028 [HAVE_STDBOOL_H]: Include <stdbool.h>.
8029 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8030 (t): Remove static var.
8031 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8032 of static var. All uses changed.
8033 (year): Do not reject years before 1900; they can occur with
8035 (posix_time_parse): Do not check for out-of-range components;
8036 that is now the caller's responsibility, since our checks were
8037 only approximations.
8038 (posixtime): Use mktime to check for out-of-range components,
8039 since it knows them exactly.
8040 If mktime returns (time_t) -1, check whether an error actually occurred
8041 by invoking localtime on -1.
8042 (main) [TEST_POSIXTIME]: Check for input data errors, and report
8043 posixtime failures better.
8044 Improve the test data (in comments only).
8046 2003-05-30 <karl@gnu.org>
8048 * mktime.c: update from libc.
8050 2003-05-30 Bruno Haible <bruno@clisp.org>
8052 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8053 * localcharset.h: Likewise.
8054 * localcharset.c: Likewise.
8056 2003-05-28 Paul Eggert <eggert@twinsun.com>
8058 Assume the headers required for C89 freestanding compilers.
8059 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8060 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8061 without checking for HAVE_LIMITS_H.
8062 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8063 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8065 * fatal.c: Include <stdarg.h> without checking for __STDC__.
8066 * exclude.c: Include <stdbool.h> unconditionally.
8067 * tempname.c: Include <stddef.h> unconditionally.
8068 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8069 * modechange.c, rpmatch.c (NULL): Don't define, since
8070 <stddef.h> does that.
8071 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8072 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8073 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8074 * xstrtol.c: Likewise.
8075 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8076 * savedir.c: Include <stddef.h> instead of defining NULL.
8078 * addext.c (addext): Use assignment rather than cast, to avoid
8079 warnings on some platforms.
8081 * mktime.c (__mktime_internal): Do not reject negative timestamps
8084 2003-05-10 Bruno Haible <bruno@clisp.org>
8086 * linebreak.c (iconv_string_length): Don't return -1 just because the
8087 string is longer than 4 KB.
8089 2003-05-12 Jim Meyering <jim@meyering.net>
8091 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8092 the space-padded-by-default conversion specifiers, %e, %k, %l.
8094 2003-05-03 Bruno Haible <bruno@clisp.org>
8096 Upgrade to Unicode-4.0.
8097 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8098 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8099 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8100 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8101 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8102 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8103 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8104 Change width of U+E0100..U+E01EF from 1 to 0.
8106 2003-04-25 Bruno Haible <bruno@clisp.org>
8108 * copy-file.c: Include <stddef.h>, for size_t.
8110 2003-04-25 Jim Meyering <jim@meyering.net>
8112 * copy-file.c (copy_file_preserving): Declare buf_size to be
8113 of type size_t, not int.
8115 2003-04-11 Jim Meyering <jim@meyering.net>
8117 Merge changes from Coreutils.
8119 2003-03-22 Jim Meyering <jim@meyering.net>
8121 * strftime.c (widen): Cast alloca return value to proper type.
8123 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8126 * strftime.c (my_strftime): Handle very large width
8127 specifications for numeric values correctly. Improve checks for
8130 2003-01-19 Jim Meyering <jim@meyering.net>
8132 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8133 (nl_get_alt_digit) [! defined my_strftime]: Define.
8134 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8135 _nl_get_alt_digit and _nl_get_walt_digit.
8137 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8138 These changes have no effect outside of _LIBC.
8140 2003-04-10 Bruno Haible <bruno@clisp.org>
8142 * findprog.h: New file, from GNU gettext.
8143 * findprog.c: New file, from GNU gettext.
8145 2003-04-05 Jim Meyering <jim@meyering.net>
8147 Merge changes from Coreutils.
8149 * exclude.h (PARAMS): Remove definition and uses.
8150 * exclude.c: Remove uses of `PARAMS'.
8152 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8153 Add test-cases for DOS filenames. Declare program_name.
8154 (main): Set up program_name. Patch by Rich Dawe.
8156 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8158 Use mntctl's return value to drive the entry-processing loop, since
8159 we can't rely on the value of the vmt_length member in the last
8160 entry. On some systems doing so could result in exhausting
8161 virtual memory. Based in part on a patch from Mike Jetzer.
8163 2003-04-04 Bruno Haible <bruno@clisp.org>
8165 * linebreak.h: New file, from GNU gettext.
8166 * linebreak.c: New file, from GNU gettext with slight modifications.
8167 * lbrkprop.h: New file, from GNU gettext.
8169 2003-04-03 Bruno Haible <bruno@clisp.org>
8171 * utf8-ucs4.h: New file, from GNU gettext.
8172 * utf16-ucs4.h: New file, from GNU gettext.
8173 * ucs4-utf8.h: New file, from GNU gettext.
8174 * ucs4-utf16.h: New file, from GNU gettext.
8176 2003-04-02 Bruno Haible <bruno@clisp.org>
8178 * binary-io.h: New file, from GNU gettext.
8180 2003-04-01 Bruno Haible <bruno@clisp.org>
8182 * pathname.h: New file, from GNU gettext.
8183 * concatpath.c: New file, from GNU gettext.
8185 2003-03-30 Bruno Haible <bruno@clisp.org>
8187 * copy-file.c (copy_file_preserving): Don't set owner if the function
8188 chown() doesn't exist.
8190 2003-03-28 Bruno Haible <bruno@clisp.org>
8192 * copy-file.h: New file, from GNU gettext.
8193 * copy-file.c: New file, from GNU gettext.
8195 2003-03-18 Jim Meyering <jim@meyering.net>
8197 * quote.c (quote_n): Fix typo in comment.
8199 2003-03-14 Jim Meyering <jim@meyering.net>
8201 Merge changes from Coreutils.
8202 * obstack.h (obstack_object_size): Declare temporary, __o,
8203 to be const, in order to avoid warnings.
8204 (obstack_room): Likewise.
8205 (obstack_empty_p): Likewise.
8207 2003-03-13 Paul Eggert <eggert@twinsun.com>
8209 Merge changes from Bison.
8210 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8211 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8212 when compiling Bison 1.875's `bitset bset = obstack_alloc
8213 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8214 * hash.c: Include <stdbool.h> unconditionally.
8216 2003-03-09 Paul Eggert <eggert@twinsun.com>
8218 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8219 Reported by Bruce Becker; see:
8220 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8222 2003-03-03 Paul Eggert <eggert@twinsun.com>
8223 Bruno Haible <bruno@clisp.org>
8225 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8226 Reported by John Hughes, see
8227 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8229 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8231 * poll_.h: New file.
8234 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8236 * mathl.h: New file.
8237 * acosl.c: New file.
8238 * asinl.c: New file.
8239 * atanl.c: New file.
8240 * ceill.c: New file.
8243 * floorl.c: New file.
8244 * frexpl.c: New file.
8245 * ldexpl.c: New file.
8247 * sincosl.c: New file.
8249 * sqrtl.c: New file.
8251 * trigl.c: New file.
8252 * trigl.h: New file.
8254 2003-02-17 Bruno Haible <bruno@clisp.org>
8256 * mkdtemp.h: New file, from GNU gettext.
8257 * mkdtemp.c: New file, from GNU gettext.
8259 2003-01-31 Bruno Haible <bruno@clisp.org>
8261 * rename.c: #undef rename before defining rpl_rename.
8262 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8264 2003-01-30 Bruno Haible <bruno@clisp.org>
8266 * printf-args.h: New file, from GNU gettext.
8267 * printf-args.c: New file, from GNU gettext.
8268 * printf-parse.h: New file, from GNU gettext.
8269 * printf-parse.c: New file, from GNU gettext.
8270 * vasnprintf.h: New file, from GNU gettext.
8271 * vasnprintf.c: New file, from GNU gettext.
8272 * asnprintf.c: New file, from GNU gettext.
8273 * vasprintf.h: New file, from GNU gettext with modifications.
8274 * vasprintf.c: New file, from GNU gettext.
8275 * asprintf.c: New file, from GNU gettext.
8277 2003-01-29 Bruno Haible <bruno@clisp.org>
8279 * stpncpy.h: New file, from GNU gettext with modifications.
8280 * stpncpy.c: New file, from GNU gettext with modifications.
8282 2003-01-28 Bruno Haible <bruno@clisp.org>
8284 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8286 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8289 2003-01-27 Bruno Haible <bruno@clisp.org>
8291 * xsetenv.h: New file, from GNU gettext.
8292 * xsetenv.c: New file, from GNU gettext.
8294 2003-01-23 Bruno Haible <bruno@clisp.org>
8296 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8298 2003-01-22 Bruno Haible <bruno@clisp.org>
8300 * exit.h: New file, from GNU gettext.
8302 2003-01-11 Bruno Haible <bruno@clisp.org>
8304 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8305 * strcase.h (strcasecmp, strncasecmp): Likewise.
8307 2003-01-14 Jim Meyering <jim@meyering.net>
8309 * same.c (same_name): Tweak a comment.
8311 2003-01-11 Bruno Haible <bruno@clisp.org>
8313 * same.c (same_name): Reorder tests so as to avoid calling stat()
8314 when a string comparison is sufficient.
8316 2003-01-11 Bruno Haible <bruno@clisp.org>
8318 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8321 2003-01-11 Bruno Haible <bruno@clisp.org>
8323 * hash-pjw.c: Add comment about low quality of this function.
8325 2003-01-12 Paul Eggert <eggert@twinsun.com>
8327 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8328 to avoid collisions with libcurses and libreadline.
8330 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8331 * getstr.h, getstr.c: Remove.
8332 * getline.c: Include "getline.h", to check interface.
8333 Move body of old getstr.c here: this defines MIN_CHUNK and
8334 declares getdelim2, which is renamed from getstr.
8335 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8337 * linebuffer.c (readlinebuffer): Renamed from readline.
8339 * linebuffer.h: Likewise.
8340 (readline): Remove backward-compatibility macro.
8342 2003-01-12 Jim Meyering <jim@meyering.net>
8344 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8346 2003-01-10 Bruno Haible <bruno@clisp.org>
8348 * alloca_.h: New file.
8349 * getdate.y: Unconditionally include alloca.h.
8350 * makepath.c: Likewise.
8351 * setenv.c: Likewise.
8352 * userspec.c: Likewise.
8354 2003-01-09 Bruno Haible <bruno@clisp.org>
8356 * stdbool.h.in: New file.
8358 2003-01-08 Bruno Haible <bruno@clisp.org>
8360 * safe-read.c: Include specification header first, to ensure its
8362 * full-write.c: Likewise.
8364 2003-01-08 Jim Meyering <jim@meyering.net>
8366 * full-write.c: Undefine and define-away `const' after inclusion
8367 of errno.h, not before. Suggestion from Bruno Haible.
8369 2003-01-07 Jim Meyering <jim@meyering.net>
8371 * full-write.c: Rework so that it may serve to define full_read, too.
8372 * full-read.c: Simply #define FULL_READ and include full-write.c.
8374 2003-01-06 Jim Meyering <jim@meyering.net>
8376 * version-etc.c: Update year in translatable copyright string.
8378 2002-12-25 Bruno Haible <bruno@clisp.org>
8380 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8381 * xstrtol.h: Likewise.
8382 * xstrtoimax.c: Likewise.
8383 * xstrtoumax.c: Likewise.
8384 * human.h: Likewise.
8386 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8387 on systems that have <inttypes.h> but not <stdint.h>.
8389 2002-12-31 Paul Eggert <eggert@twinsun.com>
8391 * memcoll.c (memcoll): Fall back on a simple algorithm using
8392 memcmp if strcoll doesn't work.
8394 2002-12-23 Bruno Haible <bruno@clisp.org>
8396 * localcharset.h: New file.
8397 * localcharset.c: Include it.
8398 * unicodeio.c: Likewise.
8400 2002-12-22 Bruno Haible <bruno@clisp.org>
8402 * utime.c (utime_null): No need to call ftruncate if the file was
8405 2002-12-23 Bruno Haible <bruno@clisp.org>
8407 * memcoll.c (STRCOLL): New macro.
8410 2002-12-22 Bruno Haible <bruno@clisp.org>
8412 * getstr.h (getstr): Define, to avoid clash with libcurses.
8413 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8415 2002-12-22 Bruno Haible <bruno@clisp.org>
8417 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8419 2002-12-23 Bruno Haible <bruno@clisp.org>
8421 * getline.h: Include <stddef.h>, for size_t.
8423 * unicodeio.h: Include <stddef.h>, for size_t.
8424 * unicodeio.c: Don't include <stddef.h>.
8426 2002-12-17 Bruno Haible <bruno@clisp.org>
8428 * canon-host.c (strdup): Remove unused declaration.
8430 * fsusage.c: Include full_read.h.
8431 (get_fs_usage): Use full_read instead of safe_read.
8433 * utime.c (utime_null): Use SAFE_READ_ERROR.
8435 2002-12-11 Bruno Haible <bruno@clisp.org>
8437 * setenv.h: Rewritten to cope with systems that have setenv() but not
8439 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8442 2002-12-11 Bruno Haible <bruno@clisp.org>
8444 * setenv.c (alloca): Fall back to malloc.
8446 (setenv): Use freea() to free memory allocated with alloca().
8448 2002-11-13 Bruno Haible <bruno@clisp.org>
8450 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8451 function declarations.
8452 * unsetenv.c (unsetenv): Likewise.
8454 2002-03-04 Bruno Haible <bruno@clisp.org>
8456 Portability to AIX 4.3.3.
8457 * unsetenv.c: New file, extracted from setenv.c.
8458 * setenv.c: Move the unsetenv() function to unsetenv.c.
8460 2001-12-20 Bruno Haible <bruno@clisp.org>
8462 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8463 use malloc instead. For SunOS 4.
8465 2001-12-11 Bruno Haible <bruno@clisp.org>
8467 * setenv.c: Declare alloca.
8468 (compar_fn_t): New typedef.
8469 (KNOWN_VALUE, STORE_VALUE): Use it.
8471 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8474 2002-12-10 Paul Eggert <eggert@twinsun.com>
8476 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8477 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8478 Choose values that are less likely to collide with system fnmatch
8480 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8481 defined (e.g., a pure POSIX system).
8482 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8483 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8485 2002-12-06 Jim Meyering <jim@meyering.net>
8487 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8489 Merge in changes from libc's misc/error.c, in preparation
8490 for the merge of gnulib's changes back into libc.
8492 * error.c (_): Define only if not already defined.
8493 Move definition to follow all #include directives.
8494 Include unlocked-io.h only if !_LIBC.
8495 [_LIBC]: Include <libio/libioP.h>.
8496 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8497 (fflush): Tweak definition to use INTUSE.
8500 2002-12-05 Paul Eggert <eggert@twinsun.com>
8502 * alloca.c [defined emacs]: Include "lisp.h".
8503 (xalloc_die) [defined emacs]: New macro.
8504 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8505 [! defined emacs]: Include <xalloc.h>.
8506 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8507 (pointer): Typedef to POINTER_TYPE *.
8508 (malloc): Remove decl; we now always use xmalloc.
8509 (alloca): Use old-style definition, since Emacs needs this.
8510 Check for arithmetic overflow when computing combined size.
8512 2002-12-04 Paul Eggert <eggert@twinsun.com>
8514 Do not generate unlocked-io.h automatically, since it's easier to
8515 maintain it by hand.
8517 * unlocked-io.h: New file, from GNU diffutils,
8518 but with proper copyright notice and attribution.
8520 * Makefile.am: Add copyright notice.
8521 (libfetish_a_SOURCES): Add unlocked-io.h.
8522 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8523 (DISTCLEANFILES, io_functions): Remove macros.
8524 (EXTRA_DIST): Remove gen_uio.
8525 (unlocked-io.h): Remove rule.
8527 2002-12-04 Jim Meyering <jim@meyering.net>
8529 Reflect the fact that stat.c and lstat.c are no longer generated.
8530 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8531 (DISTCLEANFILES): Likewise.
8532 (EXTRA_DIST): Likewise.
8533 (all_local): Don't depend on stat.c or lstat.c.
8534 (stat.c, lstat.c): Remove rules.
8535 (EXTRA_DIST): Remove xstat.in.
8537 * xstat.in: Remove file. Contents moved into stat.c.
8538 * stat.c: New file. Contents mostly from xstat.in.
8539 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8540 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8542 * safe-read.c: Rework so that it may serve to define safe_write, too.
8543 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8545 2002-12-03 Jim Meyering <jim@meyering.net>
8547 * safe-read.c, safe-write.c: Change variable names and comments, but
8548 not semantics, to minimize the differences between these two files.
8549 (safe_read): Change comment to mention SAFE_READ_ERROR.
8551 * safe-read.c (IS_EINTR): Define.
8552 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8554 2002-12-02 Bruno Haible <bruno@clisp.org>
8556 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8557 Define, taken from safe-read.c.
8558 (INT_MAX): Provide fallback.
8559 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8560 * safe-write.h (SAFE_WRITE_ERROR): Define.
8562 * safe-read.c (EINTR): Remove definition.
8563 (safe_read): Don't use EINTR if it is absent.
8565 2002-12-02 Jim Meyering <jim@meyering.net>
8567 * safe-read.c (EINTR): Define.
8568 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8569 (INT_MAX): Provide fallback.
8570 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8572 * safe-read.h (SAFE_READ_ERROR): Define.
8574 2002-12-01 Jim Meyering <jim@meyering.net>
8576 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8577 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8579 2002-11-27 Paul Eggert <eggert@twinsun.com>
8581 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8582 hash_rehash): Replace `if (limit <= value) abort ();' with
8583 `if (! (value < limit)) abort ();', for readability.
8585 2002-11-26 <karl@gnu.org>
8587 * strdup.c: copy from libc again, with jim's ok.
8588 * .cppi-disable: re-add strdup.c
8590 2002-11-25 <karl@gnu.org>
8592 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8593 instead of "strtol.c".
8595 2002-11-25 Jim Meyering <jim@meyering.net>
8597 * mktime.c: Sync from libc, now that it has the latest fix.
8599 2002-11-24 <karl@gnu.org>
8601 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8602 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8604 2002-11-24 Jim Meyering <jim@meyering.net>
8606 Update from coreutils:
8608 * mktime.c: Merge in changes from libc.
8610 Avoid a link-time failure on some Linux systems.
8611 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8612 (__mon_yday): Declare with the STATIC attribute.
8613 (__mktime_internal): Likewise.
8614 Based on a report from Greg Schafer.
8616 2002-11-23 Jim Meyering <jim@meyering.net>
8618 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8619 Use `unsigned', not `int', as type of index.
8621 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8623 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8625 2002-11-22 Paul Eggert <eggert@twinsun.com>
8627 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8628 hint that one should use `if (! x) abort ();' rather than `assert
8629 (x);', and anyway it's one less thing to worry about configuring.
8630 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8631 hash_rehash, hash_insert): Use abort rather than assert.
8633 2002-11-22 Paul Eggert <eggert@twinsun.com>
8635 * quotearg.h: Allow multiple inclusion by surrounding with
8636 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8637 so that we can be included first.
8638 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8639 * quotearg.c: Include quotearg.h immediately after config.h.
8640 No need to include stddef.h or sys/types.h any more.
8641 Surround local include files with "", not "<>".
8642 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8643 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8644 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8645 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8646 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8647 (ISPRINT): Remove; no longer needed now that we assume C89.
8649 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8652 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8653 quotearg_char): Use SIZE_MAX rather than
8654 (size_t) -1 when we are talking about "infinity".
8656 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8658 2002-11-22 Bruno Haible <bruno@clisp.org>
8660 * safe-read.h: Assume C89. Add comments.
8661 (safe_read): Change return type to size_t.
8662 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8663 counts > SSIZE_MAX correctly.
8664 * safe-write.h: New file.
8665 * safe-write.c: New file.
8666 * full-read.h: New file.
8667 * full-read.c: New file.
8668 * full-write.h: Assume C89. Add comments.
8669 * full-write.c: Include safe-write.h.
8670 (full_write): Rewritten to use safe_write.
8671 Suggested by Jim Meyering and Paul Eggert.
8673 2002-11-21 Bruno Haible <bruno@clisp.org>
8675 Remove case insensitive option matching.
8676 * argmatch.h (argcasematch): Remove declaration.
8677 (ARGCASEMATCH): Remove macro.
8678 (__xargmatch_internal): Remove case_sensitive argument.
8679 (XARGMATCH): Update.
8680 (XARGCASEMATCH): Remove macro.
8681 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8682 case_sensitive argument.
8683 (argcasematch): Remove function.
8684 (__xargmatch_internal): Remove case_sensitive argument.
8685 (main): Use XARGMATCH instead of XARGCASEMATCH.
8687 * xmalloc.c: Change compile-time error message. Add comment about
8688 required autoconf version.
8690 2002-11-21 Jim Meyering <jim@meyering.net>
8692 * strdup.c (strdup): Tweak comment and initial #if/#include.
8694 Merge in changes from the coreutils.
8696 2002-09-25 Paul Eggert <eggert@twinsun.com>
8697 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8698 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8699 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8700 int. Work more efficiently if X is the same width as uintmax_t.
8701 Do not compare X to -1, to avoid bogus compiler warning.
8702 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8703 Don't assume that f_frsize and f_bsize are the same type.
8705 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8708 * makepath.c (make_path): Restore umask *before* creating the final
8710 (make_path): Minor reformatting.
8712 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8713 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8715 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8716 ones. At least on GNU/Linux systems, `auto' means something else.
8719 2002-11-20 Paul Eggert <eggert@twinsun.com>
8721 Merge argmatch cleanups from Bison. Assume C89.
8723 * argmatch.c: Include config.h here, not in argmatch.h.
8724 Include stdlib.h, for EXIT_FAILURE.
8725 Always include <string.h>, since we assume C89.
8726 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8727 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8728 Include <stddef.h> instead, since it's all we need for size_t.
8729 (PARAMS): Remove. All uses removed.
8730 (ARRAY_CARDINALITY): Do not bother to #undef.
8731 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8732 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8733 Remove unnecessary parentheses.
8734 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8735 Insert necessary parentheses.
8736 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8737 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8739 2002-11-19 Bruno Haible <bruno@clisp.org>
8741 * mbswidth.c: Include mbswidth.h right at the beginning.
8742 * mbswidth.h: Include <stddef.h>, for size_t.
8744 * mbswidth.h (PARAMS): Remove macro.
8745 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8746 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8748 * gcd.h (PARAMS): Remove macro.
8749 (gcd): Use ANSI C function declarations.
8750 * gcd.c (gcd): Likewise.
8752 2002-11-15 Bruno Haible <bruno@clisp.org>
8754 * strcspn.c: Include <stddef.h>.
8755 (strcspn): Use ANSI C function declaration. Change return type to
8757 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8758 (strpbrk): Use NULL.
8759 * strpbrk.h (PARAMS): Remove macro.
8760 (strpbrk): Use ANSI C function declaration.
8761 * strstr.c: Don't include <sys/types.h>.
8762 * strstr.h (PARAMS): Remove macro.
8763 (strstr): Use ANSI C function declarations.
8765 2002-11-06 Bruno Haible <bruno@clisp.org>
8767 * gcd.h (gcd): Change argument type to 'unsigned long'.
8768 * gcd.c (gcd): Likewise.
8770 2002-11-05 Bruno Haible <bruno@clisp.org>
8772 * gcd.h: New file, from gettext-0.11.5.
8773 * gcd.c: New file, from gettext-0.11.5.
8775 2002-11-05 Bruno Haible <bruno@clisp.org>
8777 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8778 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8779 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8780 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8782 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8783 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8785 * closeout.c: Include gettext.h instead of <libintl.h>.
8786 * human.c: Include gettext.h instead of <libintl.h>.
8787 * quotearg.c: Include gettext.h instead of <libintl.h>.
8788 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8789 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8790 * userspec.c: Include gettext.h instead of <libintl.h>.
8791 * version-etc.c: Include gettext.h instead of <libintl.h>.
8792 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8793 (textdomain): Remove definition.
8794 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8796 * long-options.c: Remove include of <libintl.h> and definition of _.
8797 * same.c: Remove include of <libintl.h> and definition of _.
8799 2002-11-04 Bruno Haible <bruno@clisp.org>
8801 * stpcpy.h: New file, from GNU gettext-0.11.5.
8802 * strcase.h: New file, from GNU gettext-0.11.5.
8803 * strpbrk.h: New file, from GNU gettext-0.11.5.
8804 * strstr.h: New file, from GNU gettext-0.11.5.
8805 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8807 2002-05-09 Bruno Haible <bruno@clisp.org>
8809 * config.charset: Update for newest glibc. Add canonical names
8810 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8812 2002-05-09 Bruno Haible <bruno@clisp.org>
8814 * localcharset.c (get_charset_aliases): Add more Windows specific
8817 2002-05-08 Owen Taylor <otaylor@redhat.com>
8819 * config.charset: A few additions for Solaris.
8821 2001-12-05 Bruno Haible <bruno@clisp.org>
8823 * localcharset.c (locale_charset): Don't return an empty string.
8825 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8827 * config.charset: msdos in uk_UA uses CP1125.
8829 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8831 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8832 * localcharset.c (locale_charset): Declare as extern "C".
8834 2002-02-15 Bruno Haible <bruno@clisp.org>
8836 * config.charset [msdosdjgpp]: For Russian, use CP866.
8838 2002-02-11 Bruno Haible <bruno@clisp.org>
8840 * config.charset: Add support for NetBSD.
8842 2002-09-25 <karl@gnu.org>
8844 * strdup.c: copy from libc/string (via ../config/srclist*).
8845 * getopt*: copy from libc/posix.
8846 * gettext.h: copy from gettext.
8847 * .cppi-disable: add strdup.c, gettext.h.
8849 2002-07-01 Jim Meyering <meyering@lucent.com>
8851 * c-stack.c: Include sys/time.h.
8852 From Volker Borchert.
8854 2002-06-11 Paul Eggert <eggert@twinsun.com>
8856 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8857 New macro. Use it uniformly instead of
8858 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8859 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8860 reported by Vin Shelton.
8862 2002-06-22 Jim Meyering <meyering@lucent.com>
8864 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8865 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8867 2002-06-22 Paul Eggert <eggert@twinsun.com>
8869 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8870 Do not assume SA_SIGINFO behavior.
8871 Bug reported by Jim Meyering on NetBSD 1.5.2.
8873 2002-06-22 Jim Meyering <meyering@lucent.com>
8875 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8877 * exitfail.c, exitfail.h: Likewise.
8878 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8880 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8882 (EXTRA_DIST): Add fnmatch_loop.c.
8883 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8885 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8886 * fnmatch.c: Update from diffutils-2.8.2.
8887 * fnmatch_.h: New file. From diffutils-2.8.2.
8888 * fnmatch.h: Remove file.
8890 2002-06-18 Paul Eggert <eggert@twinsun.com>
8892 * file-type.h: Report an error if neither S_ISREG nor
8893 S_IFREG is defined, instead of using a test specific to glibc
8894 2.2. This should be safe, since POSIX requires S_ISREG and
8895 Unix Version 7 had S_IFREG. We don't need to check for
8896 <sys/types.h> since we don't use any symbols that it defines.
8898 2002-06-15 Jim Meyering <meyering@lucent.com>
8900 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8901 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8902 have been included before this file.
8904 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8906 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8907 so that each temporary file name is unique and valid in the first
8908 8 characters, for operation under DOS.
8910 2002-06-15 Jim Meyering <meyering@lucent.com>
8912 Work even with DJGPP 2.03, which lacks support for symlinks.
8914 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8916 * lchown.c (S_ISLNK): Likewise.
8918 2002-06-14 Jim Meyering <meyering@lucent.com>
8920 * file-type.h: Use the version from diffutils-2.8.2.
8921 * file-type.c: Likewise.
8923 2002-05-27 Jim Meyering <meyering@lucent.com>
8925 Fix a problem seen only on nonconforming systems whereby ls.c's
8926 use of localtime, and then of gettimeofday would cause trouble:
8927 the localtime call used to initialize rpl_gettimeofday's save
8928 mechanism would clobber ls's current local time information so
8929 that in any long listing the first file would always be listed
8930 with date 1970-01-01. Analysis by Volker Borchert.
8932 * gettimeofday.c (localtime): Undefine.
8933 (rpl_localtime): New function.
8935 2002-05-22 Jim Meyering <meyering@lucent.com>
8937 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8938 * file-type.h: New file.
8939 * file-type.c (file_type): New file/function. Extracted from diffutils.
8941 2002-04-29 Paul Eggert <eggert@twinsun.com>
8943 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8945 2002-04-28 Paul Eggert <eggert@twinsun.com>
8947 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8948 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8949 of 127, since 64 is the largest conceivable number for ancient
8951 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8953 2002-04-28 Jim Meyering <meyering@lucent.com>
8955 * sig2str.c (WTERMSIG): Remove definition (unused).
8957 2002-04-28 Paul Eggert <eggert@twinsun.com>
8959 * sig2str.h, sig2str.c: New files.
8960 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8962 2002-04-24 Jim Meyering <meyering@lucent.com>
8964 * gettext.h: New file, from Gettext.
8965 * Makefile.am (INCLUDES): Remove -I../intl.
8966 (libfetish_a_SOURCES): Add gettext.h.
8968 2002-04-16 Jim Meyering <meyering@lucent.com>
8970 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8971 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8972 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8974 2002-04-12 Jim Meyering <meyering@lucent.com>
8976 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8978 2002-03-10 Jim Meyering <meyering@lucent.com>
8980 * makepath.c (make_path): Remove a comma from a diagnostic.
8981 Suggestion from Santiago Vila.
8983 2002-03-08 Jim Meyering <meyering@lucent.com>
8985 * rename.c: Mention that this wrapper is needed also on
8986 mips-dec-ultrix4.4 systems.
8988 2002-03-02 Jim Meyering <meyering@lucent.com>
8990 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8991 not HAVE_CLOCK_SETTIME.
8993 2002-02-27 Paul Eggert <eggert@twinsun.com>
8995 * nanosleep.h: Rename to....
8996 * timespec.h: New name for nanosleep.h. All uses changed.
8998 * gettime.c: New file.
8999 * settime.c: New file.
9002 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9003 timespec.h. Remove nanosleep.h.
9005 2002-02-25 Paul Eggert <eggert@twinsun.com>
9007 * acl.c, acl.h: New files.
9008 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9010 2002-02-24 Jim Meyering <meyering@lucent.com>
9012 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9013 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9014 cause trouble. Reported by Nelson Beebe.
9016 2002-02-23 Paul Eggert <eggert@twinsun.com>
9018 * path-concat.c (xpath_concat): Reorder code to pacify
9019 compilers that don't know that xalloc_die never returns.
9021 2002-02-20 Jim Meyering <meyering@lucent.com>
9023 * getdate.c: Regenerate using bison-1.33.
9025 2002-02-15 Paul Eggert <eggert@twinsun.com>
9027 * posixver.c, posixver.h: New files.
9028 * Makefile.am (libfetish_a_SOURCES): Add them.
9030 2002-02-02 Paul Eggert <eggert@twinsun.com>
9031 Bruno Haible <bruno@clisp.org>
9033 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9034 (fwrite_success_callback): New declaration.
9035 * unicodeio.c (unicode_to_mb): New function, extracted from
9036 print_unicode_char. Call failure callback instead of error.
9037 (fwrite_success_callback): New function.
9038 (exit_failure_callback): New function.
9039 (fallback_failure_callback): New function.
9040 (print_unicode_char): Call unicode_to_mb.
9042 2002-01-26 Jim Meyering <meyering@lucent.com>
9044 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9046 2002-01-22 Jim Meyering <meyering@lucent.com>
9048 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9049 Otherwise, some versions of automake would omit the rule that makes
9050 Makefile from Makefile.in.
9052 2001-01-21 Paul Eggert <eggert@twinsun.com>
9054 * xmemcoll.h, xmemcoll.c: New files.
9055 * Makefile.am (libfetish_a_SOURCES): Add them.
9056 * memcoll.c: Include errno.h, and declare errno if not defined.
9057 (memcoll): Set errno to zero if there is no error.
9059 * quotearg.c (quotearg_buffer_restyled):
9060 Fix bug with quoting buffers containing NUL when backslashing escapes.
9061 This bug was exposed by the other changes in this patch.
9062 (quotearg_n_options): New arg ARGSIZE.
9063 All callers changed.
9064 (quoting_options_from_style): New function.
9065 (quotearg_n_style): Use it.
9066 (quotearg_n_style_mem): New function.
9068 * quotearg.h (quotearg_n_style_mem): New function.
9070 2002-01-16 Jim Meyering <meyering@lucent.com>
9072 * getdate.y: Add three semicolons, each just before a closing brace.
9073 Bison (as of version 1.31) no longer papers over that mistake.
9075 2002-02-14 Paul Eggert <eggert@twinsun.com>
9077 * backupfile.c (ISDIGIT): Comment fix.
9078 * getdate.y (ISDIGIT): Likewise.
9079 * posixtm.c (ISDIGIT, year): Likewise.
9080 * strverscmp.c (ISDIGIT): Likewise.
9081 * userspec.c (ISDIGIT): Likewise.
9083 2002-01-05 Jim Meyering <meyering@lucent.com>
9085 * version-etc.c (version_etc_copyright): Update copyright year.
9087 2001-01-19 Paul Eggert <eggert@twinsun.com>
9089 * closeout.c (close_stdout_status): If ferror (stdout), do
9090 not silently exit merely because the output buffer happens to
9091 have nothing pending.
9093 2001-12-18 Paul Eggert <eggert@twinsun.com>
9095 See the big note in ../ChangeLog.
9096 * human.c (suffixes): Prefer K to k for 1024.
9097 (generate_suffix_backwards): New function.
9098 (human_readable_inexact): Use it.
9099 * xstrtol.c (__xstrtol): If there is no number but there
9100 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9101 Accept 'K' as well as 'k'.
9103 2001-12-15 Jim Meyering <meyering@lucent.com>
9105 * regex.h (__restrict_arr): Update from libc.
9107 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9108 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9111 2001-12-10 Jim Meyering <meyering@lucent.com>
9113 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9114 Instead, include "xalloc.h".
9115 (initbuffer): Don't cast xmalloc return value to char*.
9116 (readline): Reword comment.
9117 Don't cast xrealloc return value to char*
9120 2001-12-09 Jim Meyering <meyering@lucent.com>
9122 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9123 `signed and unsigned type in conditional expression'.
9124 * posixtm.c (posix_time_parse): Likewise.
9126 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9128 * readtokens.c (readtoken): Declare an index to be of type unsigned
9129 to avoid a pedantic warning.
9131 * getstr.c: Don't include assert.h.
9132 (getstr): Remove warning-evoking assertions.
9133 Return -1 if offset parameter is out of bounds.
9134 Change the type of a local from int to size_t.
9136 * strftime.c (my_strftime_localtime_r): Include this function
9137 definition in the `#if ! HAVE_TM_GMTOFF' block.
9139 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9140 Include xalloc.h instead.
9142 2001-12-02 Jim Meyering <meyering@lucent.com>
9144 * tempname.c: Don't declare getenv, thus reverting the change of
9145 2001-11-18. It's no longer necessary, now that stdlib.h is always
9148 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9149 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9151 2001-11-30 Akim Demaille <akim@epita.fr>
9153 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9154 before being defined.
9156 2001-11-27 Paul Eggert <eggert@twinsun.com>
9158 * quotearg.h (quotearg_n, quotearg_n_style):
9159 First arg is int, not unsigned.
9160 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9161 (SIZE_MAX, UINT_MAX): New macros.
9162 (quotearg_n_options): Abort if N is negative.
9163 Avoid overflow check on hosts where size_t is 64 bits and int
9164 is 32 bits, as overflow is impossible there.
9165 Fix off-by-one typo that caused unnecessary reallocation.
9167 2001-11-27 Jim Meyering <meyering@lucent.com>
9169 * tempname.c: Merge with version from libc.
9170 * regex.c: Likewise.
9172 * tempname.c: Include stdlib.h unconditionally. On some old systems
9173 for which STDC_HEADERS is 0, it was not included, resulting in a
9174 warning about an integer-to-pointer conversion problem with getenv.
9175 Reported by Volker Borchert.
9177 2001-11-26 Jim Meyering <meyering@lucent.com>
9179 * gtod.h: Remove file.
9180 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9181 * gettimeofday.c: Don't include gtod.h.
9182 (GTOD_init): Remove function.
9183 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9184 Suggestion from Volker Borchert.
9186 2001-11-23 Jim Meyering <meyering@lucent.com>
9188 * hash.h (struct hash_table): Don't define here. Merely declare it.
9189 * hash.c (struct hash_table): Define it here instead.
9191 2001-11-22 Jim Meyering <meyering@lucent.com>
9193 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9195 2001-11-18 Paul Eggert <eggert@twinsun.com>
9197 * tempname.c (TMP_MAX): Remove; no longer needed.
9198 (TEMPORARIES): New macro.
9199 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9200 removes an artificial limitation (e.g. HP-UX 10.20, where
9203 2001-11-18 Jim Meyering <meyering@lucent.com>
9205 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9208 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9209 files will be created before anything else.
9211 2001-11-17 Jim Meyering <meyering@lucent.com>
9213 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9214 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9215 rather than group writable. Patch by Juan F. Codagnone.
9217 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9218 Instead, include "xalloc.h".
9220 * mountlist.c: Include unlocked-io.h after all system headers.
9221 Remove explicit declarations of xmalloc, xrealloc,
9222 and xstrdup. Instead, include "xalloc.h".
9224 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9225 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9226 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9228 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9229 Reported by Padraig Brady.
9231 * mkstemp.c: #undef mkstemp.
9233 (rpl_mkstemp): Rename from mkstemp.
9236 2001-11-16 Jim Meyering <meyering@lucent.com>
9238 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9239 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9240 determine the amount of total physical memory, use pstat_getstatic.
9241 HPUX-11 doesn't define _SC_PHYS_PAGES.
9242 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9243 If sysconf couldn't be used to determine the amount of available
9244 physical memory, use both pstat_getstatic and pstat_getdynamic.
9245 Based on a patch from Bob Proulx.
9247 2001-11-05 Jim Meyering <meyering@lucent.com>
9249 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9251 2001-11-03 Jim Meyering <meyering@lucent.com>
9253 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9254 in argmatch_to_argument call.
9256 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9259 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9260 e.g., a fault due to an attempt to free a NULL pointer.
9262 2001-11-01 Jim Meyering <meyering@lucent.com>
9264 * dirfd.c, dirfd.h: New files.
9265 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9267 * hash.c (hash_print) [TESTING]: Clean up.
9269 2001-10-22 Paul Eggert <eggert@twinsun.com>
9271 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9272 to avoid a warning if -Wall.
9274 2001-10-21 Paul Eggert <eggert@twinsun.com>
9276 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9278 2001-10-21 Jim Meyering <meyering@lucent.com>
9280 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9281 this code would end up calling gettext even in packages built
9283 * getopt.c (_): Likewise.
9284 * regex.c (_): Likewise.
9286 2001-10-20 Paul Eggert <eggert@twinsun.com>
9288 * error.c (strerror_r): Do not declare unless !_LIBC.
9289 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9290 Use strerror_r that is only a macro, even if it is not a function.
9291 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9292 (private_strerror): Use prototypes, not old-style function definition.
9293 (print_errno_message): New function.
9294 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9296 (error_tail, error, error_at_line): Use it.
9298 2001-10-11 Jim Meyering <meyering@lucent.com>
9300 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9301 and quote_n (1, ... to avoid clobbering a buffer.
9303 2001-10-05 Jim Meyering <meyering@lucent.com>
9305 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9306 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9307 * hash-pjw.h: New file.
9309 2001-09-30 Jim Meyering <meyering@lucent.com>
9311 * mountlist.c [MOUNTED_GETFSSTAT]:
9312 Include <sys/ucred.h>, for Apple Darwin.
9313 Include sys/mount.h and sys/fs_types.h only if available.
9315 (read_filesystem_list): Use FS_TYPE.
9317 2001-09-29 Paul Eggert <eggert@twinsun.com>
9319 * exclude.c (excluded_filename): 0 -> false, since it's
9322 2001-09-28 Paul Eggert <eggert@twinsun.com>
9324 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9325 #defines strtoimax. Also treat the other strto* functions
9328 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9329 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9330 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9332 2001-09-26 Jim Meyering <meyering@lucent.com>
9334 Most macros in unlocked-io.h had the wrong number of arguments.
9335 * gen-uio: New script.
9336 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9337 * unlocked-io.hin: Remove file.
9338 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9339 rather than trying to embed it here.
9340 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9341 Reported by Padraig Brady.
9343 2001-09-25 Volker Borchert <bt@teknon.de>
9345 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9347 2001-09-23 Jim Meyering <meyering@lucent.com>
9349 * mountlist.c: Remove useless parentheses in #if directives.
9350 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9351 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9353 2001-09-22 Jim Meyering <meyering@lucent.com>
9355 * localcharset.c: Update from latest gettext.
9356 * config.charset: Likewise.
9358 2001-09-20 Jim Meyering <meyering@lucent.com>
9360 * xstrtol.c (strtoimax): Guard declaration with
9361 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9362 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9363 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9364 (strtoumax): Likewise, for completeness (it wasn't necessary).
9366 2001-09-06 Paul Eggert <eggert@twinsun.com>
9368 * strtoimax.c (HAVE_LONG_LONG):
9369 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9370 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9371 to work around bug in IBM C compiler.
9373 2001-09-16 Jim Meyering <meyering@lucent.com>
9375 * mkdir.c: New file.
9377 2001-09-04 Paul Eggert <eggert@twinsun.com>
9379 * xgetcwd.c: Revert some of the previous change; intead,
9380 fix the HAVE_GETCWD_NULL code to behave more like the
9381 !HAVE_GETCWD_NULL code used to.
9384 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9387 2001-09-04 Paul Eggert <eggert@twinsun.com>
9389 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9390 Use ssize_t, not int, to store result of readlink.
9391 Check for ssize_t overflow as well as size_t overflow,
9392 as POSIX says the result of readlink is implementation-defined
9393 when ssize_t overflows.
9394 Remove unnecessary cast to char*.
9395 Use free+malloc instead of realloc, as the storage doesn't need
9396 to be preserved and it's clearer and can be more efficient that way.
9397 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9398 * xreadlink.h (xreadlink): Update prototype.
9400 2001-09-03 Paul Eggert <eggert@twinsun.com>
9402 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9403 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9404 spotted by Jim Meyering.
9406 2001-09-03 Jim Meyering <meyering@lucent.com>
9408 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9410 2001-09-03 Paul Eggert <eggert@twinsun.com>
9412 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9413 like the HAVE_GETCWD_NULL code.
9414 Include pathmax.h if not HAVE_GETCWD.
9415 Do not include xalloc.h.
9416 (INITIAL_BUFFER_SIZE): New symbol.
9417 Do not use xmalloc / xrealloc, since the caller is responsible for
9418 handling errors. Preserve errno around `free' during failure.
9419 Do not overrun buffer when using getwd.
9421 2001-09-03 Paul Eggert <eggert@twinsun.com>
9423 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9424 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9426 2001-09-02 Jim Meyering <meyering@lucent.com>
9428 * error.c: Update from GNU libc.
9430 2001-09-01 Jim Meyering <meyering@lucent.com>
9432 * xreadlink.c: New file.
9433 * xreadlink.h: New file.
9434 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9436 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9437 doesn't conflict with sparc Solaris 7's definition in
9438 /usr/include/sys/int_types.h.
9440 * exclude.c: Use `""', not `<>' to #include non-system header files.
9441 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9442 and strncasecmp as r-values. Unixware didn't have declarations.
9444 2001-08-31 Jim Meyering <meyering@lucent.com>
9446 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9447 Use an initial, malloc'd, buffer of length 128 rather than
9448 a statically allocated one of length 1024.
9450 2001-08-30 Paul Eggert <eggert@twinsun.com>
9452 * xgetcwd.c: Don't include pathmax.h.
9453 Include stdlib.h and unistd.h if available.
9455 (xmalloc, xstrdup, free): Remove decls.
9456 (xgetcwd): Don't assume sizes fit in unsigned.
9457 Check for overflow when computing sizes.
9458 Simplify reallocation code.
9460 2001-08-28 Paul Eggert <eggert@twinsun.com>
9462 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9464 * strtoimax.c: Renamed from strtoxmax.c, removing the
9467 Also, make the following further changes to make this file's
9468 configuration more similar to that of strtol.c:
9469 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9470 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9471 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9472 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9473 changed to signed values.
9475 And make the following changes as well:
9476 Fix copyright notice, as 1999 was missing.
9477 (verify): New macro.
9478 (strtoimax): Check sizes at compile-time, not run-time.
9479 Prefer strtol to strtoll if both work.
9480 (main): Remove; it was not that useful and was a pain to maintain.
9482 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9484 2001-08-30 Paul Eggert <eggert@twinsun.com>
9486 * savedir.c (savedir): Remove size parameter, as POSIX says that
9487 a directory's st_size can have an arbitrary value, so the old
9488 usage could waste an arbitrary amount of memory. All uses
9490 * savedir.h: Update prototype.
9492 2001-08-30 Paul Eggert <eggert@twinsun.com>
9494 * xstrtol.c (strtoimax): New decl.
9496 2001-08-28 Paul Eggert <eggert@twinsun.com>
9498 * xstrtol.h: Add copyright notice.
9499 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9500 LONGINT_INVALID_SUFFIX_CHAR.
9502 2001-08-30 Paul Eggert <eggert@twinsun.com>
9504 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9507 2001-08-30 Paul Eggert <eggert@twinsun.com>
9509 * hash.c: Remove '2001' from copyright notice.
9511 2001-08-30 Paul Eggert <eggert@twinsun.com>
9513 * full-write.h: New file.
9514 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9515 * full-write.c: Correct credits, as cccp.c no longer
9516 exists and anyway it was so heavily changed from the old cccp
9517 code as to be unrecognizable. Include full-write.h.
9518 (full_write) Return size_t, with short writes meaning failure.
9519 All callers changed. This fixes a bug with large buffers
9521 * utime.c: Include full-write.h.
9523 2001-08-30 Paul Eggert <eggert@twinsun.com>
9525 Merge 'exclude' changes from tar 1.13.22.
9526 This fixes one or two unlikely storage allocation overflow bugs,
9527 but doesn't change user-visible behavior otherwise.
9529 2001-08-30 Paul Eggert <eggert@twinsun.com>
9531 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9532 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9533 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9534 Include if available.
9535 (<xalloc.h>): Include
9536 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9537 (verify): New macro. Use it to verify that EXCLUDE macros do not
9538 collide with FNM macros.
9539 (struct patopts): New struct.
9540 (struct exclude): Use it, as exclude patterns now come with options.
9541 (new_exclude): Support above changes.
9542 (new_exclude, add_exclude_file):
9543 Initial size must now be a power of two to simplify overflow checking.
9544 (free_exclude, fnmatch_no_wildcards): New function.
9545 (excluded_filename): No longer requires options arg, as the options
9546 are determined by add_exclude. Now returns bool, not int.
9547 (excluded_filename, add_exclude):
9548 Add support for the fancy new exclusion options.
9549 (add_exclude, add_exclude_file): Now takes int options arg.
9550 Check for arithmetic overflow when computing sizes.
9551 (add_exclude_file): xrealloc might modify errno, so don't
9552 realloc until after errno might be used.
9554 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9556 (free_exclude): New decl.
9557 (add_exclude, add_exclude_file): Now takes int options arg.
9558 (excluded_filename): No longer requires options arg, as the options
9559 are determined by add_exclude. Now returns bool, not int.
9561 2001-08-30 Paul Eggert <eggert@twinsun.com>
9563 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9565 2001-08-27 Jim Meyering <meyering@lucent.com>
9567 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9569 * version-etc.c (N_): Remove definition.
9570 Revert most of last change.
9571 Instead, simply don't mark the `Copyright...' string for translation.
9572 Based on advice from Paul Eggert.
9574 * strtoxmax.c: Tweak comment.
9576 2001-08-26 Jim Meyering <meyering@lucent.com>
9578 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9579 of copyright with `%s' so translators don't get an untranslated
9581 (COPYRIGHT_YEAR): Define.
9582 (version_etc): Use fprintf rather than fputs.
9583 Suggestion from Ulrich Drepper.
9585 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9587 * strtoll.c: New file, from GNU libc.
9588 * xstrtoimax.c: New file.
9590 * xstrtol.h: Add xstrtoimax.
9591 * strtoumax.c: New file. Simply include "strtoumax.c".
9592 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9594 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9595 * strtoxmax.c: ... then renamed to this.
9597 2001-08-13 Paul Eggert <eggert@twinsun.com>
9599 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9600 Port to Solaris 8, where 'sed' requires a space after the 'r'
9601 command, and where sh dislikes "$/". Clean up the spacing a bit.
9602 Redirect output to $tmp just once.
9604 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9606 * addext.c (<errno.h>): Include.
9607 (errno): Declare if not defined.
9608 (addext): Work correctly when pathconf returns -1 and leaves
9609 errno alone because there is no limit. Also, work even if
9610 pathconf returns a value greater than SIZE_MAX.
9612 2001-08-12 Jim Meyering <meyering@lucent.com>
9614 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9615 Simply `return getcwd (NULL, 0);'.
9616 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9617 Use 1300 as initial value for length, not PATH_MAX.
9619 * pathmax.h: Clean up cpp syntax.
9621 2001-08-12 Jim Meyering <meyering@lucent.com>
9623 * gettimeofday.c: New file.
9625 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9627 2001-08-04 Jim Meyering <meyering@lucent.com>
9629 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9630 to get in sync with glibc.
9632 2001-08-03 Paul Eggert <eggert@twinsun.com>
9634 The following changes are from gettext 0.10.39 as maintained by
9637 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9638 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9639 with inverted sense. All uses changed.
9641 * mbswidth.c: Don't include <limits.h>.
9642 Include <stdlib.h> and <string.h> unconditionally.
9643 (iswcntrl, mbsinit, ISCNTRL): New macros.
9644 (mbsnwidth): Use K&R style function declarations.
9645 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9646 can optimize it when MB_CUR_MAX == 1.
9647 The width of control characters is zero, not 1.
9649 2001-07-15 Jim Meyering <meyering@lucent.com>
9651 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9652 (BUILT_SOURCES): Add unlocked-io.h.
9653 (io_functions): Define.
9654 (unlocked-io.h): New rule.
9655 (DISTCLEANFILES): Add unlocked-io.h.
9656 (all-local): Depend on unlocked-io.h, to ensure it is created.
9658 * unlocked-io.hin: New file
9660 * regex.c: Update from glibc.
9662 2001-07-05 Jim Meyering <meyering@lucent.com>
9664 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9666 (libfetish_a_SOURCES): Put all .h files here instead.
9667 Remove a thus-exposed (better checks in automake) duplicate and
9668 two unnecessary .h files.
9670 2001-06-11 Jim Meyering <meyering@lucent.com>
9672 * regex.c: Update from GNU libc.
9674 2001-05-27 Jim Meyering <meyering@lucent.com>
9676 * readutmp.h (UT_TYPE): Define.
9678 2001-05-24 Jim Meyering <meyering@lucent.com>
9680 * argmatch.c: Include "quote.h".
9681 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9682 quote function. Reported by Göran Uddeborg.
9684 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9686 * dirname.c (dir_name): Compute append_dot using path, not newpath
9687 which is not yet declared.
9689 2001-05-11 Paul Eggert <eggert@twinsun.com>
9691 * Makefile.am (libfetish_a_SOURCES):
9692 Add strftime.c, since we now compile it on all hosts.
9694 * strftime.c (my_strftime):
9695 Define to nstrftime if emacs, but only if my_strftime is not defined.
9696 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9697 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9698 Add one more extra argument: a nanoseconds value.
9701 (my_strftime function): Add %N format.
9702 (emacs_strftimeu): Renamed from emacs_strftime,
9703 with extra ut argument.
9705 2001-05-11 Paul Eggert <eggert@twinsun.com>
9707 dirname code cleanup. base_name now behaves more compatibly
9708 with POSIX basename when given file names that have trailing
9709 slashes, and similarly for dir_name. Add new primitives
9710 base_len and dir_len. Put the directory-name-related decls
9713 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9714 * backupfile.c (base_name): Likewise.
9715 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9716 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9717 * makepath.c (strip_trailing_slashes): Likewise.
9718 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9720 * rename.c (strip_trailing_slashes): Likewise.
9721 * same.c (base_name): Likewise.
9722 * stripslash.c (ISSLASH): Likewise.
9724 * addext.c: Include <dirname.h> after size_t is defined.
9725 * backupfile.c: Likewise.
9727 * addext.c (addext): Use base_len to trim redundant
9728 trailing slashes instead of doing it ourselves.
9729 But do not trim the last slash if it is not redundant.
9731 * backupfile.c (find_backup_file_name,
9732 max_backup_version): Use base_len instead of rolling it ourselves.
9733 Handle the case of "" and (on DOS) "C:" correctly.
9735 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9736 Include <string.h>, <dirname.h>.
9737 (base_name): Allow file names ending in slashes, other than names
9738 that are all slashes. In this case, return the basename followed
9739 by the slashes. This is more general, and can be used in places
9740 where the original base_name purposely had an assertion failure.
9741 (base_len): New function.
9743 * dirname.c: Include <string.h> instead of <stdlib.h>.
9744 Do not include <assert.h>; no longer needed.
9746 (memrchr): Remove decl.
9747 (dir_name_r): Remove.
9748 (dir_len): Renamed from dirlen. All callers changed.
9749 Rewrite in terms of base_name, for simplicity and consistency.
9750 (dir_name): Never return NULL. All callers changed.
9751 Do not include <stdlib.h> in test program; no longer needed.
9752 return 0; is fine for test program.
9754 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9756 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9758 * path-concat.c (path_concat): Use base_len to compute
9759 base length, not strlen; this means we cannot rely on memcpy
9762 * same.c (STREQ): Remove.
9763 (same_name): Handle the case where the basename ends in trailing '/'.
9765 * stripslash.c (strip_trailing_slashes): Return nonzero if
9766 a slash was stripped. Do not strip the last slash after a
9769 2001-04-08 Jim Meyering <meyering@lucent.com>
9771 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9772 recomputed; that's necessary when the offset spans a DST transition.
9773 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9775 2001-04-02 Jim Meyering <meyering@lucent.com>
9777 * regex.h, regex.c: Update from GNU libc.
9779 2001-03-19 Paul Eggert <eggert@twinsun.com>
9781 * version-etc.c (version_etc_copyright): Update to 2001.
9783 2001-03-16 Paul Eggert <eggert@twinsun.com>
9785 * tempname.c (uint64_t): Define to uintmax_t if
9786 not defined, and if UINT64_MAX is not defined.
9787 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9788 Reported by John David Anglin.
9790 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9792 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9793 alias if codeset is empty.
9794 * config.charset (BeOS): Use wildcard syntax.
9796 2001-03-13 Jim Meyering <meyering@lucent.com>
9798 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9799 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9802 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9804 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9806 * unicodeio.c (print_unicode_char): Simplify accordingly.
9808 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9810 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9811 support for DOS/DJGPP.
9813 2001-02-28 Paul Eggert <eggert@twinsun.com>
9815 * Makefile.am (libfetish_a_SOURCES):
9816 Add dup-safer.c, fopen-safer.c.
9817 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9819 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9821 2001-02-25 Paul Eggert <eggert@twinsun.com>
9823 The mkstemp replacement is taken from glibc 2.2.2, with some
9824 portability fixes for use outside glibc, as follows:
9826 * tempname.c (struct_stat64): New macro.
9827 (direxists, __gen_tempname): Use it.
9828 This avoids a portability problem with Solaris 8.
9830 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9831 (<stddef.h>, <stdint.h>, <string.h>):
9832 Include only if STDC_HEADERS || _LIBC.
9833 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9834 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9835 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9836 (__set_errno): Define this macro if <errno.h> doesn't.
9837 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9838 Define these macros if <stdio.h> doesn't.
9839 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9840 Define these macros if <sys/stat.h>
9841 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9842 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9843 __xstat64): Define if not _LIBC.
9844 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9845 (__gen_tempname): Invoke gettimeofday only if
9846 HAVE_GETTIMEOFDAY || _LIBC;
9847 otherwise, fall back on plain "time".
9848 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9850 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9852 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9854 2001-02-17 Jim Meyering <meyering@lucent.com>
9856 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9857 around included file name.
9859 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9861 * strftime.c: Update from GNU libc (the only changes were to comments).
9863 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9865 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9867 2001-02-17 Paul Eggert <eggert@twinsun.com>
9869 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9870 Remove workaround macros for hosts that have mbrtowc but not
9871 mbstate_t, as we now insist on proper declarations for both
9872 before using mbrtowc.
9874 2001-02-17 Jim Meyering <meyering@lucent.com>
9876 * regex.c: Update from libc.
9878 2001-02-16 Paul Eggert <eggert@twinsun.com>
9880 * alloca.c (malloc): Undef before defining, since stdlib.h
9881 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9882 Reported by Mark Hounschell via Paul Eggert.
9884 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9886 * config.charset: Update for FreeBSD 4.2.
9888 2001-01-26 Jim Meyering <meyering@lucent.com>
9890 * quotearg.c: Include stddef.h.
9891 * quote.c: Include stddef.h.
9892 Reported by Axel Kittenberger.
9894 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9895 line in double quotes so that it evokes a better diagnostic.
9896 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9897 Reported by Axel Kittenberger.
9899 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9901 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9902 to avoid a warning. Add back 'const' to inptr.
9904 2001-01-16 Jim Meyering <meyering@lucent.com>
9906 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9909 2001-01-14 Jim Meyering <meyering@lucent.com>
9911 * rename.c: New file. From Volker Borchert.
9912 Include stdlib.h, string.h or strings.h, and xalloc.h.
9913 Use strip_trailing_slashes rather than open-coding it.
9915 2001-01-03 Paul Eggert <eggert@twinsun.com>
9917 * strftime.c: Sync with glibc time/strftime.c 1.81.
9919 2001-01-03 Jim Meyering <meyering@lucent.com>
9921 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9922 local `inptr' to avoid warning with some system declarations of iconv.
9924 2000-12-29 Paul Eggert <eggert@twinsun.com>
9926 * modechange.c: Do not assume that mode_t uses the
9927 traditional octal encoding. E.g. "chmod 1 FOO" should set
9928 the other-execute bit of FOO even if S_IXOTH != 1.
9930 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9931 WOTH, XOTH, ALLM): New macros.
9932 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9933 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9935 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9936 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9938 No need to use uintmax_t; unsigned long is long enough.
9939 Don't bother to get suffix since we don't use it.
9941 2000-12-24 Jim Meyering <meyering@lucent.com>
9943 * hash.c (is_prime): Return explicit boolean values.
9944 (hash_get_first): Return NULL to appease Irix5.6's 89.
9945 Reported by Nelson Beebe.
9947 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9949 * localcharset.c (locale_charset): Add support for Win32.
9951 2000-12-18 Paul Eggert <eggert@twinsun.com>
9953 * physmem.h, physmem.c: New files.
9955 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9956 (noinst_HEADERS): Add physmem.h.
9958 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9959 't' for compatibility with Solaris 8 sort.
9961 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9963 * config.charset: Add support for BeOS.
9965 2000-12-16 Jim Meyering <meyering@lucent.com>
9967 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9968 SHELLS_FILE to a file name that's useful on djgpp systems.
9970 (ADDITIONAL_DEFAULT_SHELLS): Define.
9971 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9972 Based mostly on a patch from Prashant TR.
9974 2000-12-16 Jim Meyering <meyering@lucent.com>
9976 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9977 N and M) would have treated it like `chown N:N FILE'.
9979 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9981 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9983 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9984 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9985 to the list of canonical encodings. Rename EUC-CN to GB2312.
9987 2000-12-08 Andreas Schwab <schwab@suse.de>
9989 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9990 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9992 2000-12-07 Jim Meyering <meyering@lucent.com>
9994 * stripslash.c (ISSLASH): Define.
9995 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9998 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9999 (dir_name_r): Declare this function as static.
10000 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10001 manifest itself on a name containing a mix of slashes and
10003 Make this function work with names starting with a DOS-style
10004 drive letter and colon prefix.
10005 (dir_name): Append `.' if necessary.
10006 Based mostly on patches from Prashant TR and Eli Zaretskii.
10008 * dirname.h (dir_name_r): Remove prototype.
10010 2000-12-05 Jim Meyering <meyering@lucent.com>
10012 * dirname.c (dir_name_r): Add `const' in a few local declarations.
10014 2000-12-04 Jim Meyering <meyering@lucent.com>
10016 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10017 Also include memory.h, stdlib.h, unistd.h if appropriate.
10018 Reported by Andreas Jaeger (conflicting declaration of malloc).
10020 2000-12-02 Jim Meyering <meyering@lucent.com>
10022 * closeout.h: Make idempotent, to avoid some obscure warnings.
10024 2000-12-01 Paul Eggert <eggert@twinsun.com>
10026 * memrchr.c: Include <config.h> before any system include file.
10028 2000-11-29 Paul Eggert <eggert@twinsun.com>
10030 * dirname.c (dir_name_r): Fix typo: int -> size_t.
10032 2000-11-26 Jim Meyering <meyering@lucent.com>
10034 * memcoll.c: Include sys/types.h. From Werner Almesberger.
10036 2000-11-22 Paul Eggert <eggert@twinsun.com>
10038 * strftime.c (my_strftime): Do not invoke mbrlen with a
10039 size of (size_t) -1; it's not portable.
10041 2000-11-17 Akim Demaille <akim@epita.fr>
10043 * obstack.h: Formatting changes.
10044 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10045 prevent type checking.
10046 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10047 cast the value to (void *): assigning a `foo *' to a `void *'
10049 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10051 2000-11-17 Jim Meyering <meyering@lucent.com>
10053 * strstr.c: Update from GNU libc.
10055 2000-11-16 Jim Meyering <meyering@lucent.com>
10057 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10059 2000-11-11 Jim Meyering <meyering@lucent.com>
10061 * error.c: Add a couple #includes, merging from GNU libc version.
10063 2000-11-10 Jim Meyering <meyering@lucent.com>
10065 * obstack.h: Update from GNU libc.
10066 * obstack.c: Likewise.
10068 2000-11-06 Paul Eggert <eggert@twinsun.com>
10070 * getusershell.c (setusershell): Use rewind rather than
10071 fseek/fseeko, to avoid configuration hassles with fseeko.
10072 Don't bother opening SHELLS_FILE if shellstream is NULL;
10073 it's not necessary.
10075 2000-11-05 Jim Meyering <meyering@lucent.com>
10077 * makepath.h (make_dir): Declare.
10078 * makepath.c (make_dir): Remove `static' attribute.
10081 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10083 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10084 last one in a bucket, advance to the next bucket.
10086 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10088 * fnmatch.c: Do not comment out all the code if we are using
10089 the GNU C library, because in some cases we are replacing buggy
10090 code in the GNU C library itself.
10092 2000-10-30 Paul Eggert <eggert@twinsun.com>
10094 * error.h, getline.h, modechange.h:
10095 Remove "2000" from Copyright line, as the file hasn't been
10096 changed this year other than in the copyright notice.
10098 * xalloc.h: Add "2000" to Copyright line, as this file
10099 was changed this year.
10101 2000-10-30 Paul Eggert <eggert@twinsun.com>
10103 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10104 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10105 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10107 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10109 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10110 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10111 doesn't define __restrict_arr.
10113 2000-10-29 Jim Meyering <meyering@lucent.com>
10115 * xstat.in: Fix grammar in comment.
10117 2000-10-28 Jim Meyering <meyering@lucent.com>
10119 * memchr.c: Update from libc.
10120 Adjust for portability:
10121 [HAVE_STDLIB_H]: Include stdlib.h.
10122 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10123 Undef __memchr, too.
10124 [!weak_alias]: Define __memchr to memchr.
10126 * regex.c: Update from libc.
10127 * regex.h: Likewise.
10128 * getopt1.c: Likewise.
10129 * memcmp.c: Likewise.
10131 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10132 Avoid using fseek, when possible -- it's broken by design.
10133 Patch by Ulrich Drepper.
10135 2000-10-26 Jim Meyering <meyering@lucent.com>
10137 * strftime.c: Update from libc.
10139 2000-10-25 Jim Meyering <meyering@lucent.com>
10141 * obstack.c: Update from libc.
10143 2000-10-23 Jim Meyering <meyering@lucent.com>
10145 * hard-locale.c (hard_locale): Revert last change -- it was simply
10146 wrong. That set_locale call must not have any side effects.
10149 2000-10-22 Jim Meyering <meyering@lucent.com>
10151 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10152 [CYCLIC]: Remove now-unused definition.
10154 * save-cwd.c (O_DIRECTORY): Define, if needed.
10155 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10156 Suggestion from Ulrich Drepper.
10158 2000-10-21 Jim Meyering <meyering@lucent.com>
10160 * dirname.c (dir_name_r): New function, factored out of dir_name.
10161 (dir_name): Use dir_name_r.
10162 * dirname.h (dir_name_r): Declare it.
10164 2000-10-21 Jim Meyering <meyering@lucent.com>
10166 * dirname.c (memrchr): Declare if necessary.
10167 (dir_name): Remove the restriction that there be no
10168 trailing slashes. Now, this code skips past them, effectively
10170 [TEST_DIRNAME] (main): New unit tests.
10172 * memrchr.c: New file from GNU libc.
10173 Undef __memrchr, too.
10174 [!weak_alias]: Define __memrchr to memrchr.
10175 Guard weak_alias use with `#ifdef weak_alias'.
10177 2000-10-17 Jim Meyering <meyering@lucent.com>
10179 * quote.h (PARAMS): Define and use.
10180 Reported by Akim Demaille.
10182 * getopt.c: Update from libc.
10184 2000-10-16 Jim Meyering <meyering@lucent.com>
10186 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10189 2000-09-25 Jim Meyering <meyering@lucent.com>
10191 * md5.h (rol): Define (from GnuPG).
10193 * sha.c: Give credit (GnuPG) where due.
10194 (M): Use rol rather than open-coding it.
10195 Add a FIXME comment.
10197 2000-09-21 Jim Meyering <meyering@lucent.com>
10199 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10200 Reported by Michael Stone.
10202 2000-09-20 Jim Meyering <meyering@lucent.com>
10204 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10205 (noinst_HEADERS): Add sha.h.
10206 Based on code from Scott G. Miller and from GnuPG.
10208 2000-09-15 Jim Meyering <meyering@lucent.com>
10210 * regex.c: Update from libc.
10212 2000-09-10 Jim Meyering <meyering@lucent.com>
10214 * getopt.c (_getopt_internal): Update from glibc.
10216 2000-09-09 Jim Meyering <meyering@lucent.com>
10218 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10219 think it should be used as a general replacement for isascii.
10220 * fnmatch.c: Likewise.
10221 * mbswidth.c: Likewise
10222 * regex.c: Likewise.
10225 * userspec.c: Include sys/param.h and limits.h.
10227 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10228 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10229 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10230 UID, GID. Check range.
10232 2000-09-06 Jim Meyering <meyering@lucent.com>
10234 * getopt.c (_getopt_internal): Update from glibc.
10236 2000-08-30 Jim Meyering <meyering@lucent.com>
10238 * strftime.c: Merge in changes from GNU libc.
10240 2000-08-26 Jim Meyering <meyering@lucent.com>
10242 * closeout.c: Include "__fpending.h".
10243 (close_stdout_status): Return right away if there's nothing to flush.
10245 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10246 * __fpending.c: New file.
10247 * __fpending.h: New file.
10249 2000-08-07 Paul Eggert <eggert@twinsun.com>
10251 Standardize on "memory exhausted" instead of "Memory exhausted"
10252 or "virtual memory exhausted".
10253 * obstack.c (print_and_abort): Use "memory exhausted", not
10254 "virtual memory exhausted".
10255 * same.c (same_name): Invoke xalloc_die instead of printing
10257 * userspec.c (parse_user_spec): Likewise.
10258 * bumpalloc.h: comment fix
10259 * same.c, userspec.c: Include xalloc.h.
10261 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10262 not char *const and pointing to a constant array.
10263 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10264 (xrealloc): Comment fix.
10266 * userspec.c (parse_user_spec):
10267 Don't translate a message until just before returning,
10268 to avoid unnecessary translation.
10270 2000-08-07 Jim Meyering <meyering@lucent.com>
10272 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10273 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10274 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10275 getgroups.c, gethostname.c, getopt.h, group-member.c,
10276 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10277 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10278 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10279 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10280 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10281 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10282 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10283 yesno.c: Back out Copyright date changes for each file with no change
10284 this year. This eases coordination with other programs using the same
10285 source code modules. From Paul Eggert.
10287 2000-08-03 Greg McGary <greg@mcgary.org>
10289 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10290 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10291 (EXTEND_BUFFER): Use them.
10293 2000-08-01 Jim Meyering <meyering@lucent.com>
10295 * dirname.c (ISSLASH): Define.
10296 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10297 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10298 both `\' and `/' may be use as path separators.
10299 Based on a patch from Prashant TR.
10301 2000-07-31 Paul Eggert <eggert@twinsun.com>
10303 * quotearg.c (quotearg_n_options): Don't make the initial
10304 slot vector a constant, since it might get modified.
10306 2000-07-31 Jim Meyering <meyering@lucent.com>
10308 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10309 * obstack.c (print_and_abort): Likewise.
10311 2000-07-30 Paul Eggert <eggert@twinsun.com>
10313 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10314 buffer, so that the caller can always quote one small
10315 component of a "memory exhausted" message in slot 0.
10316 From a suggestion by Jim Meyering.
10318 2000-07-30 Jim Meyering <meyering@lucent.com>
10320 * makepath.c (make_path): Quote the other instance, too.
10322 * quotearg.c (N_STATIC_SLOTVECS): Define.
10323 (STATIC_BUF_SIZE): Define.
10324 (quotearg_n_options): Use only statically allocated storage when
10325 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10326 than STATIC_BUF_SIZE.
10328 2000-07-29 Jim Meyering <meyering@lucent.com>
10330 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10331 * dirname.c (dir_name): Likewise.
10333 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10335 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10336 (dir_name): Assert that there are no trailing slashes.
10338 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10340 * mbswidth.h (mbswidth): Add a flags argument.
10341 (mbswidth): New declaration.
10342 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10343 * mbswidth.c (mbswidth): Add a flags argument.
10344 (mbsnwidth): New function.
10346 2000-07-24 Jim Meyering <meyering@lucent.com>
10348 * mbswidth.c: Remove useless #else. From Bruno Haible.
10350 2000-07-23 Paul Eggert <eggert@twinsun.com>
10352 * mbswidth.c (_XOPEN_SOURCE):
10353 Don't define; this causes problems on Solaris 7.
10354 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10356 2000-07-23 Paul Eggert <eggert@twinsun.com>
10359 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10360 so that mbstate_t is always defined.
10362 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10363 be 1 in at least one GCC installation, and this configuration
10364 error is likely to be common. Ignoring MB_LEN_MAX hurts
10365 performance on hosts that have mbrtowc but have only unibyte
10366 locales, but I assume these hosts are rare.
10368 2000-07-23 Paul Eggert <eggert@twinsun.com>
10370 * quotearg.c: Streamline by invoking multibyte code only if needed.
10371 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10372 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10373 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10374 invoke multibyte primitives.
10376 2000-07-23 Jim Meyering <meyering@lucent.com>
10378 * basename.c (base_name): Add an assertion.
10380 2000-07-15 Bruno Haible <clisp.cons.org>
10382 * quotearg.c: When the system forces us to redefine mbstate_t,
10383 shadow its mbsinit function.
10385 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10387 * mbswidth.h: New file.
10388 * mbswidth.c: New file.
10389 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10390 (noinst_HEADERS): Add mbswidth.h.
10392 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10394 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10397 2000-07-15 Jim Meyering <meyering@lucent.com>
10399 * makepath.c: Include quote.h.
10400 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10401 corresponding argument in a `quote (...)' call.
10402 Give better diagnostics.
10404 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10405 (noinst_HEADERS): Add quote.h.
10407 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10408 from tar's src/misc.c.
10409 * quote.h: New file. Prototypes for same.
10411 2000-07-10 Paul Eggert <eggert@twinsun.com>
10413 From a suggestion by Bruno Haible.
10414 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10415 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10416 to decide whether to define the BeOS workaround macro;
10417 this adjusts to the change to AC_MBSTATE_T.
10419 2000-07-13 Paul Eggert <eggert@twinsun.com>
10421 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10423 * quotearg.c (quoting_style_args, quoting_style_vals,
10424 quotearg_buffer_restyled): Add support for
10425 clocale_quoting_style. Undo previous change to
10426 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10427 and "{RIGHT QUOTATION MARK}" msgids.
10429 2000-07-05 Paul Eggert <eggert@twinsun.com>
10431 The old behavior of quoting `like this' doesn't look good with
10432 newer, ISO-style fonts. See:
10433 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10435 Instead, quote "like this" by default. Let the translator
10436 tailor the locale-specific quoting behavior by providing
10437 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10439 * quotearg.c (N_): New macro.
10440 (gettext_default): New function.
10441 (quotearg_buffer_restyled): Use
10442 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10443 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10445 2000-07-09 Jim Meyering <meyering@lucent.com>
10447 * Most files: Update copyright dates to include 2000.
10449 2000-07-08 Jim Meyering <meyering@lucent.com>
10451 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10453 (xgethostname): Remove now-unnecessary #ifdef.
10454 Move declaration of `err' into loop where it's used.
10456 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10458 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10459 by allocating a larger buffer. Test the gethostname return value for
10460 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10461 returns an error and ENAMETOOLONG isn't defined.
10463 2000-07-05 Paul Eggert <eggert@twinsun.com>
10464 and Bruno Haible <haible@clisp.cons.org>
10466 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10468 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10470 * quotearg.c (struct quoting_options): Simplify quote_these_too
10473 2000-07-03 Jim Meyering <meyering@lucent.com>
10475 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10476 Reported by Bruno Haible.
10478 2000-07-04 Jim Meyering <meyering@lucent.com>
10480 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10481 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10484 2000-07-03 Paul Eggert <eggert@twinsun.com>
10485 and Bruno Haible <haible@clisp.cons.org>
10487 * quotearg.c (mbrtowc):
10488 Assign to *pwc, and return 1 only if result is nonzero.
10489 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10491 2000-07-03 Jim Meyering <meyering@lucent.com>
10493 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10494 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10497 2000-07-02 Jim Meyering <meyering@lucent.com>
10499 * quotearg.c (mbstate_t): Don't define here.
10501 2000-07-02 Jim Meyering <meyering@lucent.com>
10503 * nanosleep.c (SIGCONT): Define if not already defined.
10505 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10507 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10508 per change in ../m4/ls-mntd-fs.m4.
10509 (read_filesystem_list): Ignore symbolic links.
10511 2000-06-29 Jim Meyering <meyering@lucent.com>
10513 * same.c: Include <string.h> or <strings.h>, as appropriate,
10514 for declaration of strcmp.
10516 * long-options.c: Include <stdlib.h>, for declaration of exit.
10518 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10519 Avoid warning by casting result to `char *' to remove `const'.
10521 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10523 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10525 2000-06-26 Paul Eggert <eggert@twinsun.com>
10527 savedir now sets errno on failure and invokes xmalloc to get memory.
10528 Fix a couple of other minor bugs while we're at it.
10530 * savedir.c (<unistd.h>): Do not include; there's no need.
10531 (NAMLEN): Remove macro.
10532 (malloc, realloc): Remove decls.
10533 (stpcpy): Likewise.
10534 ("xalloc.h"): Include.
10535 (NAME_SIZE_DEFAULT): New macro.
10536 (savedir): Use xmalloc / xrealloc to allocate memory.
10537 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10538 Skip "" directory entries.
10539 Use strlen to calculate directory entry length, since the old method
10540 is rarely used these days and isn't worth supporting.
10541 Don't use a pointer after freeing it.
10542 Check for integer overflow when calculating allocation size.
10543 Use memcpy to copy entries, instead of stpcpy.
10544 Set errno properly when returning NULL.
10545 Check for readdir error.
10547 2000-06-26 Jim Meyering <meyering@lucent.com>
10549 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10551 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10553 * getusershell.c (xmalloc, xrealloc): Remove functions.
10555 Don't include <stdlib.h>. Don't declare malloc, realloc.
10557 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10559 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10561 2000-06-24 Jim Meyering <meyering@lucent.com>
10563 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10565 2000-06-21 Jim Meyering <meyering@lucent.com>
10567 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10569 2000-06-19 Paul Eggert <eggert@twinsun.com>
10571 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10572 (mbrtowc, mbstate_t): Define substitutes if
10573 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10574 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10575 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10577 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10579 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10580 than 1024, return a memory chunk of least possible size, instead
10581 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10582 Use free/xmalloc instead of xrealloc to avoid copying for very long
10585 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10587 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10588 address, not strdup. Include <stdlib.h> and don't declare free().
10590 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10592 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10595 2000-06-21 Jim Meyering <meyering@lucent.com>
10597 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10598 (noinst_HEADERS): Add getstr.h.
10600 * getline.c (getstr): Move into a separate file.
10601 * getstr.c (getstr): New file, extracted from getline.c, with
10602 the following changes: new parameter, delim2; both delim[12]
10603 parameters have type `int', not `char'. The latter would lose
10604 with 8-bit delimiters.
10605 * getstr.h: New file.
10607 2000-06-19 Jim Meyering <meyering@lucent.com>
10609 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10611 2000-06-18 Jim Meyering <meyering@lucent.com>
10613 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10614 Besides, these days every porting target provides a mkdir function.
10616 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10617 (this snippet comes from src/system.h).
10619 2000-06-15 Paul Eggert <eggert@twinsun.com>
10621 * human.c (adjust_value): New function.
10622 (human_readable_inexact): Apply rounding style even when
10623 printing approximate values.
10625 2000-06-14 Paul Eggert <eggert@twinsun.com>
10627 * human.c (human_readable_inexact): Allow an input block
10628 size that is not a multiple of the output block size, and vice versa.
10629 Reported by Piergiorgio Sartor.
10631 2000-06-14 Paul Eggert <eggert@twinsun.com>
10633 * getdate.y (get_date): Apply relative times after time
10634 zone indicator, not before. Reported by Todd A. Jacobs.
10636 2000-06-13 Jim Meyering <meyering@lucent.com>
10638 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10640 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10642 2000-06-12 Paul Eggert <eggert@twinsun.com>
10644 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10646 2000-06-04 Paul Eggert <eggert@twinsun.com>
10648 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10650 2000-06-04 Jim Meyering <meyering@lucent.com>
10652 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10653 SunOS 4.1.4 for which gid_t is an unsigned type.
10655 2000-06-03 Jim Meyering <meyering@lucent.com>
10657 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10659 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10661 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10662 newer, don't install charset.alias.
10663 * config.charset: Change the Linux/glibc rules so they become empty
10664 on glibc-2.1 or newer.
10666 2000-06-02 Jim Meyering <meyering@lucent.com>
10668 * mountlist.c: Back out last change. Instead, do this...
10669 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10670 member using the same `ignore'-testing code.
10671 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10675 2000-05-29 Jim Meyering <meyering@lucent.com>
10677 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10678 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10680 2000-05-22 Jim Meyering <meyering@lucent.com>
10682 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10684 2000-05-18 Jim Meyering <meyering@lucent.com>
10686 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10687 back, too, since it may have been modified by allocate_entry.
10688 (hash_delete): Rewrite to use neither the assignment operator
10689 nor the comma operator in an if-expression.
10691 2000-05-15 Paul Eggert <eggert@twinsun.com>
10694 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10695 Remove; no longer needed.
10696 "quotearg.h": Add include.
10697 (file_name): Do not bother to explicitly initialize to NULL; it's less
10698 efficient on some hosts.
10699 (close_stdout_status): Remove test as to whether stdout was already
10700 closed; it breaks for the case "echo x | sort >&-".
10701 Quote file name colons.
10702 Do not assume that _("write error") lacks format strings.
10704 2000-05-15 Jim Meyering <meyering@lucent.com>
10706 * version-etc.c (version_etc_copyright): Update the copyright string
10707 used in all --version output.
10709 2000-05-14 Jim Meyering <meyering@lucent.com>
10711 * closeout.c (close_stdout_set_file_name): New function.
10712 (close_stdout_status): Use new file-scoped global.
10713 Return right away if fstat says the stdout file descriptor is invalid.
10714 * closeout.h (close_stdout_set_file_name): Declare.
10716 2000-05-10 Jim Meyering <meyering@lucent.com>
10718 * closeout.c [default_exit_status]: New file-scoped variable.
10719 (close_stdout_set_status): New function.
10720 * closeout.h (close_stdout_set_status): Declare.
10722 2000-05-08 Jim Meyering <meyering@lucent.com>
10724 * long-options.c: Don't include closeout.h.
10725 (parse_long_options): Don't call close_stdout for --version.
10727 2000-05-06 Jim Meyering <meyering@lucent.com>
10729 * strnlen.c: Undefine __strnlen and strnlen.
10730 [!weak_alias]: Define __strnlen to strnlen.
10732 * atexit.c: New file, from libiberty.
10734 2000-05-06 Jim Meyering <meyering@lucent.com>
10736 * closeout.c (close_stdout_status): Also check for errors on the
10739 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10741 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10742 instead of xmalloc, xrealloc, path_concat.
10743 (locale_charset): Treat empty environment variables as absent.
10744 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10746 2000-05-04 Jim Meyering <meyering@lucent.com>
10748 * getopt.c: Update from glibc.
10749 * obstack.c: Likewise.
10750 * obstack.h: Likewise.
10751 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10753 * regex.h: Likewise.
10754 * strndup.c: Likewise.
10755 * strnlen.c: New file, from glibc.
10757 2000-05-01 Jim Meyering <meyering@lucent.com>
10759 * full-write.c (full_write): Remove `FIXME' part of comment.
10761 2000-04-29 Jim Meyering <meyering@lucent.com>
10763 * path-concat.c: Declare strdup only if it's not defined.
10764 * canon-host.c: Likewise.
10766 2000-04-28 Jim Meyering <meyering@lucent.com>
10768 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10769 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10770 included first, then limits.h is included by locale.h by libintl.h.
10771 From John David Anglin.
10773 2000-04-25 Jim Meyering <meyering@lucent.com>
10775 * makepath.c (S_IRWXUGO): Define.
10776 (make_path): Always perform explicit chmod if MODE specifies any
10777 of the `special' permission bits. Prompted by a bug report against
10778 install from Mate Wierdl and Joost van Baal.
10780 2000-04-18 Jim Meyering <meyering@lucent.com>
10782 * README: New file.
10784 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10785 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10787 2000-04-17 Jim Meyering <meyering@lucent.com>
10789 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10790 the definition of it to rpl_strftime also defined-away the system's
10793 2000-04-15 Jim Meyering <meyering@lucent.com>
10795 Use `C' to denote so-called `contiguous' files, the same way
10797 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10798 (ftypelet): Use S_ISCTG.
10799 From Michael Deutschmann.
10801 2000-04-14 Jim Meyering <meyering@lucent.com>
10803 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10805 2000-04-08 Jim Meyering <meyering@lucent.com>
10807 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10808 names don't conflict. Reported by Eli Zaretskii.
10810 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10812 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10813 bug. Deal with the different error behavior of Irix iconv.
10815 2000-04-07 Jim Meyering <meyering@lucent.com>
10817 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10818 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10820 2000-04-05 Jim Meyering <meyering@lucent.com>
10822 Portability tweaks required for ultrix4.3.
10823 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10824 * readutmp.c: Include sys/types.h before sys/stat.h.
10825 * canon-host.c: Declare strdup.
10826 * path-concat.c: Likewise.
10827 From John David Anglin.
10829 2000-04-04 Jim Meyering <meyering@lucent.com>
10831 Be more DOS 8.3-friendly.
10832 * ref-add.sin: Renamed from ref-add.sed.in.
10833 * ref-del.sin: Renamed from ref-del.sed.in.
10834 * Makefile.am: Reflect renaming.
10835 Reported by Eli Zaretskii.
10837 Use a temporary file name that won't clash with `charset.alias'
10838 in the DOS 8.3 name space.
10839 * Makefile.am (charset_tmp): Define.
10840 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10841 (uninstall-local): Likewise.
10842 Reported by Eli Zaretskii.
10844 2000-03-29 Paul Eggert <eggert@twinsun.com>
10846 * time/strftime.c (my_strftime): Make sure we call the system
10847 strftime, not ourselves, when invoking the underlying strftime.
10849 2000-03-24 Jim Meyering <meyering@lucent.com>
10851 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10852 (charset_alias): Define.
10853 (install-exec-local): Factor out common code.
10854 (uninstall-local): Split lines longer than 80.
10855 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10856 (SUFFIXES): Define.
10857 (.sed.in.sed): New rule. Don't redirect directly to $@.
10858 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10860 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10862 * config.charset: Output a line containing "Packages using this file".
10863 * ref-add.sed.in, ref-del.sed.in: New files.
10864 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10865 ref-del.sed): New rules.
10867 2000-03-17 Jim Meyering <meyering@lucent.com>
10869 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10870 Otherwise, include <strings.h>
10872 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10874 * unicodeio.c (utf8_wctomb): New function.
10875 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10876 format instead of in UCS-4 with platform dependent endianness.
10878 2000-03-07 Paul Eggert <eggert@twinsun.com>
10880 * savedir.c (savedir): Work even if directory size is
10881 negative; this can happen with some screwy NFS configurations.
10883 2000-03-06 Jim Meyering <meyering@lucent.com>
10885 * localcharset.c (get_charset_aliases): Don't try to free file_name
10886 if it's NULL (because we ran out of memory). From Bruno Haible.
10888 2000-03-05 Jim Meyering <meyering@lucent.com>
10890 * localcharset.c ("path-concat.h"): Include.
10891 (get_charset_aliases): Use path_concat instead of ANSI string
10894 * unicodeio.h (PARAMS): Define.
10895 Use it to guard prototype.
10897 2000-03-04 Jim Meyering <meyering@lucent.com>
10899 * Makefile.am (install-exec-local): Create $(libdir) before installing
10901 (uninstall-local): Uncomment this rule so `make distcheck' works
10904 * unicodeio.c (<errno.h>): Include it.
10905 (errno): Declare if not defined.
10907 * localcharset.c: Add Bruno's comment justifying use of volatile.
10909 * config.charset: New version, incorporating remarks from a linux
10910 i18n mailing list. From Bruno Haible.
10912 2000-03-02 Jim Meyering <meyering@lucent.com>
10914 * Makefile.am (EXTRA_DIST): Add config.charset.
10916 2000-03-01 Jim Meyering <meyering@lucent.com>
10918 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10919 * unicodeio.c: Likewise.
10921 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10923 * config.charset: New file.
10924 * localcharset.c: New file.
10925 * unicodeio.h, unicodeio.c: New files.
10926 * Makefile.am (DEFS): Add -DLIBDIR=...
10927 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10928 (noinst_HEADERS): Add unicodeio.h.
10929 (all-local, install-exec-local, charset.alias): New targets.
10931 2000-02-28 Paul Eggert <eggert@twinsun.com>
10933 * quotearg.c (ALERT_CHAR): New macro.
10934 (quotearg_buffer_restyled): Use it.
10936 2000-02-27 Jim Meyering <meyering@lucent.com>
10938 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10939 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10941 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10942 not `#if STDC_HEADERS'.
10943 Declare malloc if needed.
10945 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10946 now that autoconf always defines the HAVE_DECL_ symbols.
10947 * human.c: Likewise.
10948 * same.c: Likewise.
10949 * strtoumax.c: Likewise.
10951 * backupfile.c: Arrange for cpp to fail if the configure-time
10952 declaration check was not run.
10953 * hash.c: Likewise.
10954 * human.c: Likewise.
10955 * same.c: Likewise.
10956 * strtoumax.c: Likewise.
10958 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10959 then first look up the entire `.'-containing string as a login name.
10961 2000-02-18 Paul Eggert <eggert@twinsun.com>
10963 * getdate.y: Handle two-digit years with leading zeros correctly.
10964 (textint): New typedef.
10965 (parser_control): Member year changed from int to textint.
10967 (YYSTYPE): Removed; replaced by %union with int and textint members.
10968 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10969 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10970 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10971 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10972 (date, number, to_year): Use width of number in digits, not its value,
10973 to determine whether it's a 2-digit year, or a 2-digit time.
10974 (yylex): Store number of digits of numeric tokens.
10975 Reported by John Kendall.
10977 (parser_control): Changed from struct parser_control to typedef (for
10978 consistency). All uses changed.
10980 (tID): Removed; not used.
10981 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10983 2000-02-14 Paul Eggert <eggert@twinsun.com>
10985 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10986 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10988 2000-02-12 Jim Meyering <meyering@lucent.com>
10990 * userspec.c (ISDIGIT): Define it.
10991 (isdigit): Remove definition.
10992 (is_number): Use ISDIGIT, not isdigit.
10993 <libintl.h>: Include.
10994 (_ and N_): Define.
10995 (parse_user_spec): Mark translatable strings.
10997 2000-02-10 Jim Meyering <meyering@lucent.com>
10999 With these changes, nanosleep.[ch] are finally enough like the other
11000 lib/* replacement files to compile on a few more losing systems.
11002 * nanosleep.h: Don't include config.h.
11003 Remove prototype from declaration of nanosleep.
11004 (PARAMS): Remove now-unneeded definition.
11005 * nanosleep.c: #undef nanosleep.
11006 (rpl_nanosleep): Rename from nanosleep.
11008 2000-02-03 Jim Meyering <meyering@lucent.com>
11010 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11011 rather than with `#if HAVE_UTMPNAME'.
11013 2000-02-01 Jim Meyering <meyering@lucent.com>
11015 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
11017 2000-01-31 Jim Meyering <meyering@lucent.com>
11019 * nanosleep.h (nanosleep): Guard declaration with
11020 `#if ! HAVE_DECL_NANOSLEEP'.
11021 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11022 the declaration in that vendor's sys/timers.h.
11023 Reported by Christian Krackowizer.
11025 * quotearg.c (ISASCII): Add #undef and move definition to follow
11026 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11027 (ISPRINT): Likewise.
11028 Reported by Tom Tromey.
11030 2000-01-30 Jim Meyering <meyering@lucent.com>
11032 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11033 uses of ->ut_name. The latter doesn't work with new Linux header files
11034 where only utmpx.ut_user is declared.
11036 * readutmp.h (UT_USER): Define.
11038 2000-01-23 Jim Meyering <meyering@lucent.com>
11040 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11043 2000-01-22 Jim Meyering <meyering@lucent.com>
11045 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11046 [! HAVE_DECL_STRTOULL]: Declare strtoull.
11047 Required for some AIX systems. Reported by Christian Krackowizer.
11048 [TESTING] (main): New function.
11050 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
11051 * dirname.c (dir_name): Support for DOS-style file names with drive
11054 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11056 * strverscmp.c (ISDIGIT): Define.
11057 (strverscmp): Use ISDIGIT, not isdigit.
11059 2000-01-17 Paul Eggert <eggert@twinsun.com>
11061 * nanosleep.c (nanosleep):
11062 Don't use SA_INTERRUPT to decide whether to call sigaction, as
11063 POSIX.1 doesn't require SA_INTERRUPT and some systems
11064 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
11065 it's been part of POSIX.1 since day 1 (in 1988).
11067 2000-01-17 Jim Meyering <meyering@lucent.com>
11069 * interlock: Remove unused file. Reported by François Pinard.
11071 2000-01-16 Paul Eggert <eggert@twinsun.com>
11073 * quotearg.c (quotearg_buffer_restyled): Do not quote
11074 alert, backslash, formfeed, and vertical tab unnecessarily in
11075 shell quoting style.
11078 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11079 Free Software Foundation, Inc.
11080 Copying and distribution of this file, with or without modification,
11081 are permitted provided the copyright notice and this notice are preserved.