1 2006-10-03 Bruno Haible <bruno@clisp.org>
3 * gl_sublist.h: New file.
4 * gl_sublist.c: New file.
6 2006-10-06 Paul Eggert <eggert@cs.ucla.edu>
8 * mkancesdirs.c (mkancesdirs): Pass to MAKE_DIR both the full file
9 name (relative to the original working directory) and the file
10 name component (relative to the temporary working directory). All
12 * mkancesdirs.h (mkancesdirs): Adjust prototype to match.
13 * mkdir-p.c (make_dir_parents): Likewise.
14 * mkdir-p.h (make_dir_parents): Likewise.
16 2006-10-06 Eric Blake <ebb9@byu.net>
18 * clean-temp.h (close_stream_temp): New declaration.
19 * clean-temp.c (includes): Pull in headers according to what
20 other modules are in use.
21 (close_stream_temp) [GNULIB_CLOSE_STREAM]: New function.
23 2006-10-06 Bruno Haible <bruno@clisp.org>
25 * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
26 cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
28 * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
29 cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
30 Return an error indicator.
31 Suggested by Eric Blake.
33 2006-10-06 Bruno Haible <bruno@clisp.org>
35 * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
36 Reported by Eric Blake.
38 2006-10-06 Bruno Haible <bruno@clisp.org>
39 and Paul Eggert <eggert@cs.ucla.edu>
41 * closeout.c (close_stdout): Also close stderr.
42 * closeout.h: Update comment.
44 2006-10-06 Bruno Haible <bruno@clisp.org>
46 * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
47 instead of fopen, fwriteerror.
49 2006-10-05 Bruno Haible <bruno@clisp.org>
51 * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
52 fwriteerror_temp): New declarations.
53 * clean-temp.c (uintptr_t): Provide fallback definition.
54 (descriptors): New variable.
55 (cleanup): First, close the descriptors.
56 (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
57 fclose_temp, fwriteerror_temp): New functions.
59 2006-10-03 Bruno Haible
61 * gl_list.h (gl_sortedlist_search_from_to,
62 gl_sortedlist_indexof_from_to): New declarations.
63 (gl_list_implementation): New fields sortedlist_search_from_to,
64 sortedlist_indexof_from_to.
65 (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
67 * gl_list.c (gl_sortedlist_search_from_to,
68 gl_sortedlist_indexof_from_to): New functions.
69 * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
70 (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
71 (gl_array_sortedlist_search_from_to): New function.
72 (gl_array_list_implementation): Update.
73 * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
74 (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
75 (gl_carray_sortedlist_search_from_to): New function.
76 (gl_carray_list_implementation): Update.
77 * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
78 gl_linked_sortedlist_indexof_from_to): New functions.
79 * gl_linked_list.c (gl_linked_list_implementation): Update.
80 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
81 * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
82 gl_tree_sortedlist_indexof_from_to): New functions.
83 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
84 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
85 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
86 * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
88 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
90 Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
91 <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
92 * dirchownmod.c: Include lchown.h.
93 * lchown.c: Don't include files that lchown.h now includes.
94 Don't declare chown, since lchown.h now does that.
95 * lchown.h: Include errno.h, sys/types.h, unistd.h.
96 (lchown): Define to rpl_chown if lchown is declared but
97 does not exist. Declare using a prototype if lchown is not
98 declared. Add a copyright notice.
99 * mkstemp.h: Include <unistd.h>.
100 * openat.c: Include lchown.h.
102 * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
103 we now test for that separately.
104 * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
105 rather than O_NOFOLLOW, when testing whether it's possible to
106 avoid a race condition reliably.
107 * savewd.c (savewd_chdir): Likewise.
109 Remove macros that are no longer needed now that stdint.h is
111 * fsusage.c (UINTMAX_MAX): Remove.
112 * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
113 * utimecmp.c (SIZE_MAX): Remove.
115 2006-10-03 Bruno Haible <bruno@clisp.org>
117 * gl_list.h (gl_list_search_from, gl_list_search_from_to,
118 gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
119 (struct gl_list_implementation): Add fields search_from_to,
120 indexof_from_to. Remove fields search, indexof.
121 (gl_list_search): Use the search_from_to method.
122 (gl_list_search_from, gl_list_search_from_to): New functions.
123 (gl_list_indexof): Use the indexof_from_to method.
124 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
125 * gl_list.c (gl_list_search): Use the search_from_to method.
126 (gl_list_search_from, gl_list_search_from_to): New functions.
127 (gl_list_indexof): Use the indexof_from_to method.
128 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
129 * gl_array_list.c (gl_array_indexof_from_to): Renamed from
130 gl_array_indexof. Add start_index, end_index arguments.
131 (gl_array_search_from_to): Renamed from gl_array_search. Add
132 start_index, end_index arguments.
133 (gl_array_remove, gl_array_list_implementation): Update.
134 * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
135 gl_carray_indexof. Add start_index, end_index arguments.
136 (gl_carray_search_from_to): Renamed from gl_carray_search. Add
137 start_index, end_index arguments.
138 (gl_carray_remove, gl_carray_list_implementation): Update.
139 * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
140 gl_linked_search. Add start_index, end_index arguments.
141 (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
142 start_index, end_index arguments.
143 (gl_linked_remove): Update.
144 * gl_linked_list.c (gl_linked_list_implementation): Update.
145 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
146 * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
148 * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
149 gl_tree_search. Add start_index, end_index arguments.
150 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
151 start_index, end_index arguments.
152 (gl_tree_remove): Update.
153 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
154 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
155 * gl_anytreehash_list1.h (compare_position_threshold): New function.
156 * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
157 gl_tree_search. Add start_index, end_index arguments.
158 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
159 start_index, end_index arguments.
160 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
161 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
163 2006-10-04 Bruno Haible <bruno@clisp.org>
165 * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
167 2006-10-03 Bruno Haible <bruno@clisp.org>
169 * gl_oset.h (gl_setelement_threshold_fn): New type.
170 (gl_oset_search_atleast): New declaration.
171 (struct gl_oset_implementation): Add field 'search_atleast'.
172 (gl_oset_search_atleast): New inline function.
173 * gl_oset.c (gl_oset_search_atleast): New function.
174 * gl_array_oset.c (gl_array_search_atleast): New function.
175 (gl_array_oset_implementation): Update.
176 * gl_anytree_oset.h (gl_tree_search_atleast): New function.
177 * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
178 * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
180 2006-10-04 Jim Meyering <jim@meyering.net>
182 * fts.c (fts_open): Tiny comment change.
184 2006-10-03 Bruno Haible <bruno@clisp.org>
186 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
187 from gl_avltreehash_list_implementation.
189 2006-10-03 Bruno Haible <bruno@clisp.org>
191 * gl_oset.c (gl_oset_add): Fix return type.
193 2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
195 * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
197 2006-10-02 Paolo Bonzini <bonzini@gnu.org> (tiny change)
199 * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
201 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
203 Work around bug in Solaris 10 /proc file system:
204 /proc/self/fd/NNN/.. isn't the parent directory of
205 the directory whose file descriptor is NNN. This needs to
206 be worked around at run time, not compile time, since a
207 program might be built on Solaris 8, where things work, and
209 * openat-priv.h (BUILD_PROC_NAME): Remove. All callers changed
210 to use the following interface instead:
211 (OPENAT_BUFFER_SIZE): New macro.
212 (openat_proc_name): New function.
213 * at-func.c (AT_FUNC_NAME): Adjust to above changes.
214 * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
216 * openat-proc.c: New file.
218 2006-09-29 Bruno Haible <bruno@clisp.org>
220 * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
221 * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
222 argument. Set stdout_closed before testing for ferror, not after.
223 (fwriteerror, fwriteerror_no_ebadf): New functions.
225 2006-09-28 Bruno Haible <bruno@clisp.org>
227 * strndup.h: Simplify the redefinition of strndup.
228 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
230 2006-09-28 Bruno Haible <bruno@clisp.org>
232 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
233 * gl_linkedhash_list.c: Likewise.
234 * gl_rbtreehash_list.c: Likewise.
236 2006-09-28 Jim Meyering <jim@meyering.net>
238 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
241 2006-09-27 Jim Meyering <jim@meyering.net>
243 This file could end up with a definition for a function
244 named __strndup, rather than rpl_strndup on a system with
245 incomplete weak_alias support.
246 * strndup.c (strndup): Rename from __strndup.
247 Remove #defines that used to map __strndup to strndup.
248 Don't use K&R prototypes.
249 Remove LIBC-related code, since this file is not sync'd with glibc.
250 * strndup.h: Revamp, accordingly.
252 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
254 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
257 * __fpending.h: Don't include <stdio_ext.h> unless
258 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
259 it causes <stdio_ext.h> to cause a compile-time error.
260 Problem reported by Nelson H. F. Beebe.
261 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
262 of HAVE_DECL___PENDING.
264 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
266 * savewd.c: Include <signal.h>, for 'raise'.
268 2006-09-26 Eric Blake <ebb9@byu.net>
270 * verror.c: Include <config.h> unconditionally.
272 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
274 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
275 (gl_linked_iterator_from_to): Initialize struct completely.
276 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
277 (gl_tree_iterator_from_to): Likewise
278 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
279 * gl_array_list.c [lint] (gl_array_iterator)
280 (gl_array_iterator_from_to): Likewise.
281 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
282 * gl_carray_list.c [lint] (gl_carray_iterator)
283 (gl_carray_iterator_from_to): Likewise.
285 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
286 * md4.c (md4_process_block): Remove unused variable.
287 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
288 parentheses for clarity.
290 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
292 Import this patch from libc:
294 2006-09-06 Jakub Jelinek <jakub@redhat.com>
296 * regex_internal.c (re_string_reconstruct): Handle
297 offset < pstr->valid_raw_len && pstr->offsets_needed case.
298 Ensure no bytes read before raw_mbs array. Pass a saved copy of
299 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
300 re_string_context_at.
302 2006-09-20 Bruno Haible <bruno@clisp.org>
304 * mkdtemp.c: Import from libc.
305 2006-04-07 Ulrich Drepper <drepper@redhat.com>
306 * sysdeps/posix/tempname.c (__gen_tempname): Change
307 attempts_min into a macro. Use preprocessor to decide how to
308 initialize attempts [Coverity CID 67].
309 2001-11-27 Paul Eggert <eggert@twinsun.com>
310 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
311 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
313 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
315 * mkstemp.h: New file, since some standard headers
317 * mkstemp.c: Revamp to put the !_LIBC code together.
319 Make the _LIBC code resemble glibc original more,
321 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
322 (mkstemp): Remove, since mkstemp.h does this for us.
323 * stdlib--.h: Include mkstemp.h.
325 Import this patch from libc:
327 2006-04-07 Ulrich Drepper <drepper@redhat.com>
329 * tempname.c (__gen_tempname): Change attempts_min
330 into a macro. Use preprocessor to decide how to initialize
331 attempts [Coverity CID 67].
333 2006-09-18 Bruno Haible <bruno@clisp.org>
335 * javaversion.c: Include configmake.h.
337 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
339 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
340 that prevented coreutils 6.1 from building. Problem reported
341 by Petter Reinholdtsen.
343 2006-09-18 Jim Meyering <jim@meyering.net>
345 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
347 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
349 * dirchownmod.c: Don't include fcntl.h; no longer needed.
350 (dirchownmod): New arg FD. All callers changed.
351 Use FD rather than opening the directory ourself, as opening is
352 now the caller's responsibility.
353 * dirchownmod.h: Likewise.
354 * mkancesdirs.c: Include <sys/types.h>, for portability to older
355 hosts that require <sys/types.h> before <sys/stat.h>. Include
356 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
358 (mkancesdirs): Return length of prefix of FILE that has already
359 been made, or -2 if there is a child doing the work. Redo
360 algorithm so that it is O(N) rather than O(N**2). Optimize away
361 ".", and treat ".." specially since it might stray back into
362 already-created areas. Use a subprocess if necessary. New arg
363 WD; all users changed. MAKE_DIR function should now return 1
364 if it creates a directory that is not readable. Return -2 if
365 a child process is spun off.
366 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
367 Adjust signature to match code.
368 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
369 (make_dir_parents): Use a subprocess if necessary. New arg WD;
371 * savewd.c, savewd.h: New files.
373 2006-09-15 Jim Meyering <jim@meyering.net>
375 * rename-dest-slash.c (has_trailing_slash): Use
376 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
377 (rpl_rename_dest_slash): Perform the cheaper trailing slash
378 test before testing whether SRC is a directory.
379 Suggestions from Bruno Haible.
381 Avoid a warning about an unused variable.
382 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
383 into the #ifdef block where it's used.
385 * rename-dest-slash.c: New file.
387 2006-09-14 Bruno Haible <bruno@clisp.org>
389 * allocsa.c: Include <config.h> unconditionally.
390 * asnprintf.c: Likewise.
391 * asprintf.c: Likewise.
392 * c-strcasecmp.c: Likewise.
393 * c-strcasestr.c: Likewise.
394 * c-strncasecmp.c: Likewise.
395 * c-strstr.c: Likewise.
396 * classpath.c: Likewise.
397 * clean-temp.c: Likewise.
398 * concatpath.c: Likewise.
399 * copy-file.c: Likewise.
400 * csharpcomp.c: Likewise.
401 * csharpexec.c: Likewise.
402 * execute.c: Likewise.
403 * fatal-signal.c: Likewise.
404 * findprog.c: Likewise.
405 * fwriteerror.c: Likewise.
406 * gl_array_list.c: Likewise.
407 * gl_array_oset.c: Likewise.
408 * gl_avltree_list.c: Likewise.
409 * gl_avltree_oset.c: Likewise.
410 * gl_avltreehash_list.c: Likewise.
411 * gl_carray_list.c: Likewise.
412 * gl_linked_list.c: Likewise.
413 * gl_linkedhash_list.c: Likewise.
414 * gl_list.c: Likewise.
415 * gl_oset.c: Likewise.
416 * gl_rbtree_list.c: Likewise.
417 * gl_rbtree_oset.c: Likewise.
418 * gl_rbtreehash_list.c: Likewise.
419 * imaxabs.c: Likewise.
420 * imaxdiv.c: Likewise.
421 * javacomp.c: Likewise.
422 * javaexec.c: Likewise.
423 * javaversion.c: Likewise.
424 * linebreak.c: Likewise.
425 * localcharset.c: Likewise.
427 * mbchar.c: Likewise.
428 * mbswidth.c: Likewise.
429 * mkdtemp.c: Likewise.
431 * printf-args.c: Likewise.
432 * printf-parse.c: Likewise.
433 * progname.c: Likewise.
434 * progreloc.c: Likewise.
435 * readlink.c: Likewise.
436 * sh-quote.c: Likewise.
437 * stpcpy.c: Likewise.
438 * stpncpy.c: Likewise.
439 * strcasecmp.c: Likewise.
440 * strcasestr.c: Likewise.
441 * strcspn.c: Likewise.
442 * striconv.c: Likewise.
443 * strncasecmp.c: Likewise.
444 * strnlen1.c: Likewise.
445 * strstr.c: Likewise.
446 * strtok_r.c: Likewise.
448 * tmpdir.c: Likewise.
449 * unicodeio.c: Likewise.
450 * unsetenv.c: Likewise.
451 * vasnprintf.c: Likewise.
452 * vasprintf.c: Likewise.
453 * wait-process.c: Likewise.
454 * xallocsa.c: Likewise.
455 * xsetenv.c: Likewise.
456 * xstriconv.c: Likewise.
458 2006-09-13 Eric Blake <ebb9@byu.net>
460 * getopt.c: Fix typo in last commit.
462 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
464 * _fpending.c: Include <config.h> unconditionally, since we no
465 longer worry about uses that don't define HAVE_CONFIG_H.
466 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
467 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
468 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
469 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
470 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
471 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
472 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
473 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
474 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
475 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
476 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
477 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
478 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
479 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
480 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
481 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
482 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
483 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
484 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
485 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
486 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
487 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
488 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
489 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
490 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
491 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
492 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
493 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
494 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
495 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
496 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
497 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
498 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
499 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
502 2006-09-12 Jim Meyering <jim@meyering.net>
504 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
505 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
506 Reported by Nelson H. F. Beebe.
508 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
510 * argp-help.c (argp_doc): Make sure NULL is not passed to
513 2006-09-10 Bruno Haible <bruno@clisp.org>
515 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
517 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
519 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
520 program_invocation_name and program_invocation_short_name are
522 * argp-namefrob.h: Move declarations of program_invocation_name
523 and program_invocation_short_name to argp.h, so they are visible
527 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
529 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
530 convention. Text proposed by Bruno Haible.
531 (struct argp_option): Document the use of N_() wrappers.
533 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
534 and translate the two parts separately, instead of feeding
535 the whole string to gettext. This allows to exclude
536 '\v' from the strings visible to the translator by writing doc
537 strings as N_("..") "\v" N_("..").
539 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
541 * mktime.c (guess_time_tm): Fix bug where mktime
542 returned the maximum time_t value rather than (time_t) -1.
543 Problem originally reported by William Bardwell
544 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
546 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
548 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
551 2006-09-06 Bruno Haible <bruno@clisp.org>
553 * striconv.h: New file.
554 * striconv.c: New file, merging iconvme.c with GNU gettext's
556 * xstriconv.h: New file.
557 * xstriconv.c: New file.
559 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
561 * argz_.h: Sync from Libtool.
563 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
564 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
566 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
568 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
573 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
575 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
576 Problem reported by Ralf Wildenhues in
577 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
579 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
580 HAVE_STRUCT_STATFS_F_FSTYPENAME.
582 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
584 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
585 or stdbool.h, because they might not exist while configuring.
587 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
588 Don't include unistd.h or limits.h; not needed, since chdir-long.h
590 (O_DIRECTORY): Remove.
592 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
594 Work around a bug in both the Linux and SunOS 64-bit kernels:
595 nanosleep mishandles sleeps for longer than 2**31 seconds.
596 Problem reported by Frank v Waveren in
597 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
598 * nanosleep.c (BILLION): New constant.
599 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
600 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
602 2006-08-30 Jim Meyering <jim@meyering.net>
604 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
607 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
609 * isapipe.c, isapipe.h: New files.
611 2006-08-29 Eric Blake <ebb9@byu.net>
613 * error.c (error_at_line, print_errno_message): Match libc, after
614 resolution of upstream bug 3044.
616 2006-08-29 Bruno Haible <bruno@clisp.org>
618 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
620 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
624 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
626 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
627 sharing with gnulib. Report by Eric Blake.
629 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
631 * fcntl_.h: New file.
632 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
634 * dirchownmod.c: Likewise.
637 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
638 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
639 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
640 just before including <inttypes.h>, to avoid circular inclusion.
642 2006-08-28 Bruno Haible <bruno@clisp.org>
644 * inttypes_.h (SCNX*): Remove definitions.
645 Reported by Eric Blake.
647 2006-08-26 Bruno Haible <bruno@clisp.org>
649 * vasnprintf.c (EOVERFLOW): Remove definition.
650 (VASNPRINTF): Return a string of length > INT_MAX without failing.
651 * vasprintf.c: Include errno.h, limits.h.
652 (EOVERFLOW): New fallback definition.
653 (vasprintf): Test here whether the string length is > INT_MAX.
654 * vsnprintf.c: Include errno.h, limits.h.
655 (EOVERFLOW): New fallback definition.
656 (vsnprintf): Fix bug when generated string was too long for the buffer.
657 Test here whether the string length is > INT_MAX.
659 2006-08-26 Bruno Haible <bruno@clisp.org>
660 Simon Josefsson <jas@extundo.com>
663 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
665 2006-08-28 Bruno Haible <bruno@clisp.org>
667 * c-strstr.h: New file, from GNU gettext.
668 * c-strstr.c: New file, from GNU gettext.
670 2006-08-26 Bruno Haible <bruno@clisp.org>
672 * inttypes_.h: New file.
673 * inttypes.h: Remove file.
674 * stdint_.h: Include <inttypes.h> through its absolute filename.
676 * imaxabs.c: New file.
678 * imaxdiv.c: New file.
680 2006-08-22 Bruno Haible <bruno@clisp.org>
682 * readutmp.h: Skip most definitions if neither <utmp.h> nor
685 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
688 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
689 Problem reported by Bruno Haible.
691 2006-08-21 Bruno Haible <bruno@clisp.org>
694 * mbchar.h: Include <wctype.h> only if it exists.
696 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
698 * cycle-check.h: Include <stdint.h> unconditionally, since we
699 now assume the stdint module. Do not include inttypes.h.
700 * fsusage.h: Likewise.
701 * getndelim2.c: Likewise.
703 * inttostr.h: Likewise.
704 * obstack.c: Likewise.
705 * regex_internal.h: Likewise.
706 * tempname.c: Likewise.
707 * utimecmp.c: Likewise.
708 * xstrtol.h: Likewise.
710 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
712 * strtoimax.c: Adjust to macro name changes in Autoconf,
713 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
716 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
718 * fchmodat.c: New file, from coreutils. This was inadvertently
719 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
721 2006-08-18 Bruno Haible <bruno@clisp.org>
723 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
724 (ME_DUMMY): Treat "kernfs" as a dummy.
725 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
727 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
729 Update from coreutils.
731 * __fpending.h: Add copyright notice.
732 * fprintftime.h: Likewise.
733 * savedir.c: Use (C) in copyright notice.
734 * savedir.h: Likewise.
736 2006-08-15 Jim Meyering <jim@meyering.net>
738 * at-func.c: New file, with the logic of all emulated at-functions.
739 * openat-priv.h: Include <errno.h> and define ENOSYS,
740 in support of the EXPECTED_ERRNO macro.
741 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
742 Instead, define the appropriate symbols and include "at-func.c".
743 * mkdirat.c (mkdirat): Likewise.
744 * fchmodat.c (fchmodat): Likewise.
745 (ENOSYS): Remove definition.
746 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
747 Don't include "unistd--.h" -- it wasn't ever used.
749 2006-01-17 Jim Meyering <jim@meyering.net>
751 Rewrite fts.c not to change the current working directory,
752 by using openat, fstatat, fdopendir, etc..
754 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
755 (HAVE_OPENAT_SUPPORT): Define.
756 [_LIBC] (fchdir): Don't undef or define; no longer used.
757 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
758 Now, this `function' always succeeds, and consumes its file descriptor
759 parameter -- so callers must not close such FDs. Update callers.
760 (diropen_fd, opendirat, cwd_advance_fd): New functions.
761 (diropen): Add parameter, SP. Adjust all callers.
762 Implement using diropen_fd, rather than open.
763 (fts_open): Initialize new member, fts_cwd_fd.
764 Remove fts_rft-setting code.
765 (fts_close): Close fts_cwd_fd, if necessary.
766 (__opendir2): Define in terms of opendir or opendirat,
767 depending on whether the FST_NOCHDIR flag is set.
768 (fts_build): Since fts_safe_changedir consumes its FD, and since
769 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
770 and close the dup'd file descriptor upon failure.
771 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
772 (fts_safe_changedir): Tweak semantics to reflect that this function
773 now calls cwd_advance_fd and hence consumes its FD argument.
774 * fts_.h [struct FTS] (fts_cwd_fd): New member.
775 [struct FTS] (fts_rft): Remove now-unused member.
776 [struct FTS] (fts_cycle.state): Improve comment.
778 * openat.c (openat_needs_fchdir): New function.
779 * openat.h (openat_needs_fchdir): Declare it.
781 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
783 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
784 Problem and fix reported by Pádraig Brady in
785 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
787 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
789 * memcoll.c (memcoll): Optimize for the common case where the
790 arguments are bytewise equal.
792 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
794 Change copyright notice from LGPL 2 to GPL 2, since that's the
795 standard form used in the gnulib repository.
796 * lock.c: LGPL -> GPL.
798 * strnlen1.c: Likewise.
799 * strnlen1.h: Likewise.
802 * tmpdir.c: Likewise.
804 * TODO: Remove; this belongs only in coreutils.
806 2006-08-14 Eric Blake <ebb9@byu.net>
808 Import the following change from libc:
810 2006-08-12 Ulrich Drepper <drepper@redhat.com>
813 * misc/error.c: Add space between program name and message if file
816 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
818 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
819 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
821 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
822 in wchar_t. Problem reported by Eric Blake.
824 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
825 LEN is smaller than SIZE. Suggested by Bruno Haible.
826 Also, help the compiler to keep LEN in a register.
828 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
830 * .cppi-disable: Add snprintf.h, socket_.h.
831 * snprintf.c: Include <errno.h> and <limits.h>.
832 (EOVERFLOW): Define if the system does not.
833 Do not include "minmax.h"; it wasn't used.
834 (snprintf): Don't assume size_t promotes to an unsigned type.
835 Fix bug when generated string was too long for the buffer: the
836 buffer's contents are supposed to be the initial prefix of the
837 output. Don't assume vasnprintf returns EOVERFLOW if the size
838 exceeds INT_MAX; do the check ourselves.
840 Import the following changes from libc:
842 2006-06-02 Jakub Jelinek <jakub@redhat.com>
844 * posix/regex_internal.c (re_string_skip_chars): If no character has
845 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
846 to the byte which couldn't be converted.
847 (re_string_reconstruct): Don't clear valid_raw_len before calling
848 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
849 tip_context using re_string_context_at.
851 2006-05-02 Ulrich Drepper <drepper@redhat.com>
853 * posix/regex.h: g++ still cannot handled [restrict].
855 2006-04-21 Ulrich Drepper <drepper@redhat.com>
857 * posix/regex.h: Remove special handling for VMS.
859 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
863 2006-07-19 Mike Frysinger <vapier@gentoo.org>
865 * mountlist.c [ME_REMOTE]: Filter out cifs.
866 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
868 2006-08-08 Eric Blake <ebb9@byu.net>
870 * verror.c (verror_at_line): Work around glibc bug 2997, so that
871 verror_at_line output complies with GNU Coding Standards even when
874 2006-08-08 Eric Blake <ebb9@byu.net>
876 * verror.h, verror.c: New files.
878 2006-08-07 Bruno Haible <bruno@clisp.org>
880 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
882 Reported by Ralf Wildenhues.
884 2006-08-06 Eric Blake <ebb9@byu.net>
886 * error.h: Fold in some upstream changes from glibc.
889 2006-07-29 Bruno Haible <bruno@clisp.org>
891 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
893 2006-07-29 Bruno Haible <bruno@clisp.org>
895 * setenv.c: Undo unintended modification done on 2006-02-27.
897 2006-07-28 Eric Blake <ebb9@byu.net>
899 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
902 2006-07-28 Simon Josefsson <jas@extundo.com>
904 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
907 2006-07-28 Simon Josefsson <jas@extundo.com>
909 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
912 2006-07-28 Bruno Haible <bruno@clisp.org>
914 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
916 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
918 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
921 2006-07-28 Bruno Haible <bruno@clisp.org>
923 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
924 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
926 Avoids link error on FreeBSD 4.x.
927 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
929 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
931 * mbswidth.c (iswcntrl): Likewise.
933 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
935 * modechange.c (mode_compile): Numeric modes now affect setuid and
936 setgid on directories only if they set these bits.
937 * modechange.h: Remove obsolete comment about masks.
939 2006-07-27 Bruno Haible <bruno@clisp.org>
941 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
942 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
945 2006-07-26 Eric Blake <ebb9@byu.net>
947 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
948 like mingw that lack mkstemp.
949 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
950 avoid compilation warning on mingw.
952 2006-07-25 Bruno Haible <bruno@clisp.org>
954 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
955 <stdarg.h> or config.h.
957 2006-07-24 Bruno Haible <bruno@clisp.org>
959 * clean-temp.h: New file, from GNU gettext.
960 * clean-temp.c: New file, from GNU gettext.
962 2006-07-24 Bruno Haible <bruno@clisp.org>
964 * tmpdir.h: New file, from GNU gettext.
965 * tmpdir.c: New file, from GNU gettext.
967 2006-07-23 Bruno Haible <bruno@clisp.org>
969 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
970 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
971 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
972 gl_linked_remove_at): Use it.
974 2006-07-23 Eric Blake <ebb9@byu.net>
976 * tmpfile-safer.c: New file.
977 * stdio-safer.h (fopen_safer): Add prototype.
978 * stdio--.h (tmpfile): Make safer.
980 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
982 * close-stream.c, close-stream.h: New files.
984 2006-07-22 Bruno Haible <bruno@clisp.org>
986 Merge from GNU gettext 0.15.
988 2005-07-05 Bruno Haible <bruno@clisp.org>
990 * printf-args.c (printf_fetchargs): Work around broken
991 definition of wint_t on mingw.
993 2005-02-12 Bruno Haible <bruno@clisp.org>
995 * xallocsa.h: Add extern "C" for C++.
997 2006-05-17 Bruno Haible <bruno@clisp.org>
1000 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
1002 2006-04-30 Bruno Haible <bruno@clisp.org>
1004 * progreloc.c: Include <mach-o/dyld.h> if available.
1005 (find_executable): Use _NSGetExecutablePath when possible.
1007 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
1009 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
1012 2005-12-29 Bruno Haible <bruno@clisp.org>
1014 * progreloc.c (set_program_name_and_installdir): Fix
1017 2005-12-04 Bruno Haible <bruno@clisp.org>
1020 * progreloc.c: Include <windows.h> also on Cygwin.
1021 (find_executable): Add support for Cygwin.
1022 (set_program_name_and_installdir): Handle also platforms with
1025 2006-07-11 Bruno Haible <bruno@clisp.org>
1027 * javacomp.c: Fix a comment.
1028 Reported by Jim Meyering.
1030 2006-04-30 Bruno Haible <bruno@clisp.org>
1032 * javacomp.h (compile_java_class): Add source_version,
1033 target_version arguments.
1034 * javacomp.c: Rewritten to choose only a compiler that
1035 respects the specified source_version and target_version.
1037 2006-06-27 Bruno Haible <bruno@clisp.org>
1039 Assume correct S_ISDIR macro.
1040 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1042 2006-07-22 Bruno Haible <bruno@clisp.org>
1044 * javaversion.h: New file, from GNU gettext.
1045 * javaversion.c: New file, from GNU gettext.
1046 * javaversion.java: New file, from GNU gettext.
1047 * javaversion.class: New file, from GNU gettext.
1049 2006-05-17 Bruno Haible <bruno@clisp.org>
1052 * javaexec.c (execute_java_class): Test for jview program
1055 2006-04-09 Bruno Haible <bruno@clisp.org>
1057 * fatal-signal.c: Don't include string.h.
1058 (at_fatal_signal): Use a copying loop instead of memcpy.
1060 2005-12-04 Bruno Haible <bruno@clisp.org>
1062 * csharpexec.c: Add support for 'clix' launcher (untested).
1063 (execute_csharp_using_sscli): New function.
1064 (execute_csharp_program): Call it.
1066 2006-06-21 Bruno Haible <bruno@clisp.org>
1068 Avoid warnings from recent versions of mcs.
1069 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1070 -o, -L, -r any more. Use options documented since mcs-1.0
1071 instead. Similarly for -g.
1073 2005-07-09 Bruno Haible <bruno@clisp.org>
1075 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1077 Reported by Mark Junker <mjscod@gmx.de>.
1079 2006-06-17 Bruno Haible <bruno@clisp.org>
1081 * config.charset: Update for NetBSD 3.0.
1083 2006-05-17 Bruno Haible <bruno@clisp.org>
1086 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1088 2006-05-16 Bruno Haible <bruno@clisp.org>
1090 * localcharset.c [CYGWIN]: Include <windows.h>.
1091 (get_charset_aliases): For Cygwin, return the same CPxxx
1092 aliases list as under WIN32.
1093 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1094 the environment variables. Fall back to GetACP().
1096 2006-04-05 Bruno Haible <bruno@clisp.org>
1098 * config.charset: Update Juan Manuel Guerrero's address.
1100 2005-02-12 Bruno Haible <bruno@clisp.org>
1102 * allocsa.h: Add extern "C" for C++.
1104 2005-02-10 Bruno Haible <bruno@clisp.org>
1106 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1107 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1109 2006-07-22 Bruno Haible <bruno@clisp.org>
1111 * gettext.h: Update to GNU gettext-0.15.
1113 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1114 and Simon Josefsson <jas@extundo.com>
1116 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1118 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1120 2006-07-21 Eric Blake <ebb9@byu.net>
1122 * stdlib-safer.h: New file from coreutils, required by
1125 2006-07-19 Derek R. Price <derek@ximbiot.com>
1127 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1128 Reindent and repaginate.
1130 2006-07-17 Bruno Haible <bruno@clisp.org>
1132 * gl_list.h: New file.
1133 * gl_list.c: New file.
1134 * gl_array_list.h: New file.
1135 * gl_array_list.c: New file.
1136 * gl_carray_list.h: New file.
1137 * gl_carray_list.c: New file.
1138 * gl_linked_list.h: New file.
1139 * gl_linked_list.c: New file.
1140 * gl_anylinked_list1.h: New file.
1141 * gl_anylinked_list2.h: New file.
1142 * gl_avltree_list.h: New file.
1143 * gl_avltree_list.c: New file.
1144 * gl_anyavltree_list1.h: New file.
1145 * gl_anyavltree_list2.h: New file.
1146 * gl_rbtree_list.h: New file.
1147 * gl_rbtree_list.c: New file.
1148 * gl_anyrbtree_list1.h: New file.
1149 * gl_anyrbtree_list2.h: New file.
1150 * gl_anytree_list1.h: New file.
1151 * gl_anytree_list2.h: New file.
1152 * gl_linkedhash_list.h: New file.
1153 * gl_linkedhash_list.c: New file.
1154 * gl_anyhash_list1.h: New file.
1155 * gl_anyhash_list2.h: New file.
1156 * gl_avltreehash_list.h: New file.
1157 * gl_avltreehash_list.c: New file.
1158 * gl_rbtreehash_list.h: New file.
1159 * gl_rbtreehash_list.c: New file.
1160 * gl_anytreehash_list1.h: New file.
1161 * gl_anytreehash_list2.h: New file.
1163 * gl_oset.h: New file.
1164 * gl_oset.c: New file.
1165 * gl_array_oset.h: New file.
1166 * gl_array_oset.c: New file.
1167 * gl_avltree_oset.h: New file.
1168 * gl_avltree_oset.c: New file.
1169 * gl_rbtree_oset.h: New file.
1170 * gl_rbtree_oset.c: New file.
1171 * gl_anytree_oset.h: New file.
1173 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1175 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1177 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1178 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1179 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1180 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1181 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1182 callers changed. Revamp internals significantly, by not
1183 attempting to create directories that are temporarily more
1184 permissive than the final results. Do not attempt to use
1185 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1186 This removes some race conditions, fixes some bugs, and simplifies
1187 things. Use new dirchownmod function to do owner and mode changes.
1188 * mkdir-p.h: Likewise.
1189 * modechange.c (octal_to_mode): New function.
1190 (struct mode_change): New member mentioned.
1191 (make_node_op_equals): New arg mentioned. All callers changed.
1192 (mode_compile): Keep track of which mode bits the user has explicitly
1194 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1195 New arg PMODE_BITS, to keep track of which mode bits the user
1196 mentioned; it treats S_ISUID and S_ISGID speciall.
1197 All callers changed.
1198 * modechange.h: Likewise.
1200 2006-07-11 Derek R. Price <derek@ximbiot.com>
1202 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1204 2006-07-10 Derek R. Price <derek@ximbiot.com>
1206 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1207 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1208 macros into the GNU _D_EXACT_NAMLEN.
1209 * savedir.c: Likewise.
1210 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1212 2006-07-09 Jim Meyering <jim@meyering.net>
1214 * argp-pv.c: Remove a doubled word in a comment.
1215 * check-version.c (check_version): Likewise.
1216 * javacomp.c (compile_java_class): Likewise.
1218 2006-07-08 Jim Meyering <jim@meyering.net>
1220 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1222 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1224 * getaddrinfo.c: Changes to compile under MSVC6: changed
1225 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1226 brackets. Other minor changes to suppress some compiler
1229 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1231 * getloadavg.c: Use __VMS, not VMS.
1232 * getopt.c: Likewise.
1233 * getpagesize.h: Likewise.
1234 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1235 probably does not work.
1237 2006-07-06 Derek R. Price <derek@ximbiot.com>
1238 and Paul Eggert <eggert@cs.ucla.edu>
1240 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1241 Don't worry about this obsolete case any more.
1242 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1244 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1245 worry about this obsolete case any more.
1247 * getcwd.c: Likewise.
1249 * savedir.c: Likewise.
1251 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1253 * .cppi-disable: Add wcwidth.
1254 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1255 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1256 (ISGRAPH): Remove. All uses changed to isgraph.
1257 (FOLD) [!defined _LIBC]: Remove special case.
1258 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1259 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1261 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1263 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1265 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1267 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1269 * memcasecmp.c: Include <limits.h>.
1270 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1271 * strtod.c (strtod): Don't assume isspace works on negative chars.
1272 Don't assume isdigit succeeds only on '0' through '9'.
1274 2006-07-05 Derek R. Price <derek@ximbiot.com>
1276 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1277 All uses of is_space replaced by isspace.
1278 * exit.h: Don't talk about STDC_HEADERS.
1279 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1280 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1281 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1282 replaced by isprint etc.
1283 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1284 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1285 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1286 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1287 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1288 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1290 2006-07-05 Eric Blake <ebb9@byu.net>
1292 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1293 missing from netdb.h.
1294 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1296 2006-06-27 Bruno Haible <bruno@clisp.org>
1298 Assume ANSI C header files and <ctype.h> functions.
1299 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1300 (mbsnwidth): Use isprint, iscntrl instead.
1302 2006-07-03 Jim Meyering <jim@meyering.net>
1304 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1305 macro is used before the first cycle_check call.
1307 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1309 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1310 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1311 reported by Mark D. Baushke, one in
1312 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1314 Merge from coreutils.
1316 * .cppi-disable: Add stdint_.h.
1317 * .cvsignore: Add stdint.h.
1319 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1321 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1322 both double and long double versions.
1323 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1324 * xstrtold.c: New file.
1325 * xstrtod.h (xstrtold): New decl.
1327 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1329 * filemode.c (setst): Remove.
1330 (strmode): Rewrite to avoid setst. This makes the code shorter,
1331 (arguably) clearer, and the generated code is a bit smaller on my
1332 Debian GNU/Linux stable x86 host.
1334 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1336 * filemode.c: Include "filemode.h" first, to test the interface.
1337 Assume that filemode.h includes sys/types.h and sys/stat.h.
1338 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1339 (ftypelet): Reorder to put common cases first, for efficiency.
1340 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1342 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1343 of 10, for compatibility with FreeBSD. All callers changed.
1344 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1345 that can't be deduced solely from st_mode. First arg is now a const
1347 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1348 (strmode): Renamed from mode_string.
1349 (filemodestring): New decl.
1350 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1351 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1352 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1354 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1356 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1357 fsusage.h now does that. Include fsusage.h first, to test interface.
1358 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1359 at most one method (the old code could have generated decls that
1360 didn't conform to C89, not that this was ever exercised).
1361 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1363 2006-03-19 Jim Meyering <jim@meyering.net>
1365 Work even in a chroot where d_ino values for entries in "/"
1366 don't match the stat.st_ino values for the same names.
1367 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1368 number, iterate through all entries again, using lstat instead.
1369 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1370 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1372 * getcwd.c (__getcwd): Clarify a comment.
1373 Use memcpy in place of a call to strcpy.
1375 2006-03-12 Jim Meyering <jim@meyering.net>
1377 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1378 that of the current directory (which we're about to chdir ".." out of),
1379 then save the dev-ino of the parent, instead.
1381 * same-inode.h (SAME_INODE): New file/macro.
1382 * chdir-safer.c (SAME_INODE): Remove definition.
1383 Include "same-inode.h", instead.
1385 * cycle-check.h: Include "same-inode.h".
1386 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1387 * cycle-check.c (SAME_INODE): Remove definition.
1388 * root-dev-ino.h: Include "same-inode.h".
1390 2006-03-11 Eric Blake <ebb9@byu.net>
1392 * same.c (same_name): s/base_name/last_component/
1393 * backupfile.c (check_extension, numbered_backup): Likewise.
1394 * filenamecat.c (file_name_concat): Likewise.
1396 2006-03-11 Eric Blake <ebb9@byu.net>,
1397 Paul Eggert <eggert@cs.ucla.edu>
1399 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1400 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1402 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1403 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1404 (last_component): New method.
1405 * dirname.c (dir_len): Determine when drive letters need a
1406 subsequent slash. Preserve // when it is special.
1407 (dir_name): Don't append dot when drive letter is absolute.
1408 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1409 * basename.c (base_name): New semantics - malloc the result.
1410 Preserve // when it is special. Preserve relative files that look
1412 (base_len): Preserve // when it is special.
1413 (last_component): New method, similar to old base_name semantics.
1414 * stripslash.c (strip_trailing_slashes): Use last_component, not
1415 base_name. Strip redundant slashes from ///.
1417 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1419 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1420 both are 64 bits, since this seems to be the tradition, and this
1421 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1422 we ever run into a host that prefers long long to long in this
1423 case, we'll need another configure-time test. Problem reported by
1426 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1428 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1429 possible collision with system files.
1430 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1431 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1432 WCHAR_MIN and WCHAR_MAX in this case.
1433 (<stddef.h>): Do not include; no longer needed.
1434 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1435 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1436 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1437 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1438 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1439 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1440 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1441 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1442 !defined(__c99))]: Include in this case too, since it's harmless
1444 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1446 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1447 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1448 (_STDINT_MIN, _STDINT_MAX): New macros.
1449 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1450 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1451 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1452 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1453 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1454 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1455 macros, not typedefs; this simplifies things quite a bit.
1456 Use long int for all types narrower than int64_t.
1457 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1458 Define in terms of long long int or int64_t or long int,
1459 not int64_t or int32_t. This saves some compile-time testing.
1460 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1461 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1462 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1463 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1464 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1465 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1466 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1467 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1468 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1469 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1470 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1471 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1472 undef any previous version and define our own version, for
1473 simplicity and consistency with the new macros for types.
1474 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1475 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1476 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1477 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1478 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1479 @WINT_T_SUFFIX@ to keep things simple here.
1480 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1481 Simplify by assuming typical 8/16/32/64 host, since we're
1482 already doing that elsewhere anyway.
1483 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1484 and assume long long int is 64 bits if available. This
1485 speeds up 'configure'.
1487 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1489 * getaddrinfo.c: fixed typo
1491 2006-06-29 Eric Blake <ebb9@byu.net>
1493 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1494 unused static function.
1496 2006-06-29 Eric Blake <ebb9@byu.net>
1498 * stat_.h: New file.
1500 2006-06-29 Derek R. Price <derek@ximbiot.com>
1502 * strftime.c: Assume strftime() exists.
1504 2006-06-28 Bruno Haible <bruno@clisp.org>
1506 * getaddrinfo.h: Fix POSIX URL.
1507 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1508 (use_win32_p): Make static.
1509 (getaddrinfo): Reject service name if it is empty or does not consist
1510 solely of decimal digits, or if its value is > 65535.
1511 (getnameinfo): Remove useless casts.
1513 2006-06-28 Derek R. Price <derek@ximbiot.com>
1515 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1516 Autoconf 2.60 says this stuff was obsolete.
1518 2006-05-12 Bruno Haible <bruno@clisp.org>
1520 * mkdtemp.c [MINGW]: Include <io.h>.
1521 (mkdir): Define using _mkdir.
1523 2006-06-28 Bruno Haible <bruno@clisp.org>
1525 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1526 declaration for wcwidth.
1527 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1529 2006-06-28 Eric Blake <ebb9@byu.net>
1531 * xvasprintf.h: Fix comments.
1533 2006-06-28 Eric Blake <ebb9@byu.net>
1535 * mbchar.h (wcwidth): Include wcwidth.h.
1536 * mbswidth.c (wcwidth): Move from here...
1537 * wcwidth.h: ...to this new file.
1539 2006-06-28 Simon Josefsson <jas@extundo.com>
1541 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1542 functions there. It will succeed on Windows XP, but on Windows
1543 2000 and (presumably) earlier, it will fail, and use the internal
1545 (use_win32_p): New function.
1546 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1547 Support AI_NUMERICSERV to disable getservbyname.
1548 (getnameinfo): New function, only supports
1549 NI_NUMERICHOST|NI_NUMERICSERV for now.
1551 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1552 only have some of them. Add AI_NUMERICSERV. Add prototype for
1555 2006-06-27 Bruno Haible <bruno@clisp.org>
1557 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1559 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1561 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1562 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1563 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1565 2006-06-26 Bruno Haible <bruno@clisp.org>
1567 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1569 Reported by Mark D. Baushke and Larry Jones.
1571 2006-06-26 Bruno Haible <bruno@clisp.org>
1573 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1575 Suggested by Mark D. Baushke and Larry Jones.
1577 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1579 * stdint_.h: Treat BSD/OS like OpenBSD.
1581 2006-06-23 Bruno Haible <bruno@clisp.org>
1583 * stdint_.h: Treat IRIX like OpenBSD.
1585 2006-06-23 Bruno Haible <bruno@clisp.org>
1587 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1588 ISO C 99 Technical Corrigendum 1.
1590 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1592 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1593 Some compiler complained about some of them. Problem reported by
1595 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1597 2006-06-21 Simon Josefsson <jas@extundo.com>
1599 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1602 * socket_.h: Don't define WINVER.
1604 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1605 slightly modified to work in gnulib.
1607 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1609 * read-file.c (fread_file): Start with buffer allocation of
1610 0 bytes rather than 1 byte; this simplifies the code.
1611 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1612 code to free buffer and save/restore errno.
1613 (internal_read_file): Remove unused local.
1615 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1617 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1618 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1619 Problem reported by Denis Excoffier in
1620 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1622 2006-06-19 Simon Josefsson <jas@extundo.com>
1624 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1626 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1628 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1630 2006-06-17 Bruno Haible <bruno@clisp.org>
1632 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1634 2006-06-17 Bruno Haible <bruno@clisp.org>
1636 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1637 problem on Solaris 2.5.1.
1639 2006-06-16 Eric Blake <ebb9@byu.net>
1641 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1642 * unicodeio.c [!defined errno]: Likewise.
1643 * strtol.c [!defined errno]: Likewise.
1644 * strtod.c [!defined errno]: Likewise.
1646 2006-06-15 Bruno Haible <bruno@clisp.org>
1648 * stdint_.h: Rewritten to be fully auto-configured.
1649 Fixes bug on HP-UX/IA64.
1651 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1653 * getdate.y (__attribute__): Don't define if already defined.
1654 Problem reported by Larry Jones.
1655 * utimens.c (__attribute__): Likewise.
1657 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1659 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1660 reported by Andreas Schwab.
1662 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1663 Bruno Haible <bruno@clisp.org>
1665 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1667 2006-05-26 Martin Lambers <marlam@marlam.de>
1669 * getpass.c: Updates the test for the native W32 API, and adds
1670 missing includes, thus fixing compilation warnings.
1672 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1674 * tempname.c (small_open, large_open): New macros.
1675 (__open, __open64) [!_LIBC]: Remove.
1676 (__gen_tempname): Use small_open and large_open instead of __open
1677 and __open64. This fixes a portability bug on HP-UX 11.11i
1678 reported by Simon Wing-Tang in
1679 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1681 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1683 * exclude.c (exclude_fnmatch): New function.
1684 (excluded_file_name): Call exclude_fnmatch.
1685 * exclude.h (excluded_file_name): New prototype
1687 2006-05-24 Bruno Haible <bruno@clisp.org>
1689 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1690 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1691 Reported by Thorsten Maerz <torte@netztorte.de> via
1692 Aaron Stone <aaron@serendipity.cx>.
1694 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1696 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1697 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1698 (my_usleep): Don't mishandle maximum value.
1700 2006-05-19 Jim Meyering <jim@meyering.net>
1702 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1704 2006-05-17 Bruno Haible <bruno@clisp.org>
1707 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1709 2006-05-17 Bruno Haible <bruno@clisp.org>
1711 * stdint_.h: Fix recognition of Cygwin.
1713 2006-05-11 Jim Meyering <jim@meyering.net>
1715 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1717 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1719 * crc.c (crc32_update): Remove unnecessary L suffix.
1720 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1721 unwanted sign propagation, e.g., on hosts with 64-bit int.
1722 There still are some problems with reeelly weird theoretical hosts
1723 (e.g., 33-bit int) but it's not worth worrying about now.
1724 * sha1.c (rol): Likewise.
1725 (K1, K2, K3, K4): Remove unnecessary L suffix.
1727 2006-05-10 Bruno Haible <bruno@clisp.org>
1729 * des.c: Cast to avoid warnings.
1731 2006-05-10 Simon Josefsson <jas@extundo.com>
1733 * md4.c: Typo fix, update copyright years.
1734 (K1, K2): Don't use L because it turn computations into 64-bit on
1737 2006-05-09 Bruno Haible <bruno@clisp.org>
1739 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1740 (EOVERFLOW): Define fallback value.
1741 (xstrcat): New function.
1742 (xvasprintf): Recognize the special case of a string concatenation.
1744 2006-05-01 Bruno Haible <bruno@clisp.org>
1746 * stdint_.h: Shorter URL.
1747 * inttypes.h: Likewise.
1749 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1751 * verify.h: Document the internals better. Most of this change
1752 was written by Bruno Haible.
1754 2006-04-29 Bruno Haible <bruno@clisp.org>
1756 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1757 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1759 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1761 * getdate.y (get_date): When adding relative date, start with the
1762 initial time, not with the result of the first mktime call.
1764 2006-04-23 Bruno Haible <bruno@clisp.org>
1766 * copy-file.c: Include <unistd.h> unconditionally.
1767 * execute.c: Likewise.
1768 * fatal-signal.c: Likewise.
1769 * findprog.c: Likewise.
1770 * mkdtemp.c: Likewise.
1773 * wait-process.h: Likewise.
1775 2006-04-23 Bruno Haible <bruno@clisp.org>
1777 * fwriteerror.c (fwriteerror): Call fclose also when an error
1778 condition was already detected.
1779 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1781 2006-04-19 Derek Price <derek@ximbiot.com>
1782 Eric Blake <ebb9@byu.net>
1784 * inttypes.h: Correct grammar in comment.
1786 2006-04-18 Derek Price <derek@ximbiot.com>
1787 Paul Eggert <eggert@cs.ucla.edu>
1789 * inttypes.h: New file.
1790 * strtoimax.c: Assume <inttypes.h>.
1792 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1794 * utimens.c (futimens): glibc futimesat messes up if /proc
1795 isn't mounted. Problem reported by Kir Kolyshkin.
1797 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1799 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1800 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1801 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1803 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1805 Merge regex changes from libc, removing some of our
1806 POSIX-conformance changes that were rejected and redoing them in a
1809 * regcomp.c (re_compile_internal, init_dfa):
1810 Length arg is now size_t, not Idx. All uses changed.
1811 (peek_token): Forward decl now says internal_function.
1812 (__re_error_msgid, __re_error_msgid_idx):
1813 Now static rather than extern with attribute_hidden.
1814 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1815 For some reason libc prefers K&R style defns for external functions.
1816 (regerror) [!defined _LIBC]: Likewise.
1817 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1818 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1819 (build_range_exp, build_collating_symbol):
1821 (re_compile_fastmap): Use '\0' to memset, not 0.
1822 (utf8_sb_map): Make the calculations more obvious.
1823 (init_dfa, parse_bracket_exp, build_charclass_op):
1824 Call calloc and cast result, as glibc does.
1825 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1826 (build_range_exp, build_collating_symbol):
1827 Now internal functions.
1829 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1831 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1832 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1833 Don't depend on VMS; depend on __VMS instead, for POSIX
1834 namespace cleanness.
1835 (regoff_t): Define to ssize_t, not long int.
1837 Remove the REG_ macros named below. Instead, make the old names
1838 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1840 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1841 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1842 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1843 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1844 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1845 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1846 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1847 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1848 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1849 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1850 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1851 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1852 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1853 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1854 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1855 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1856 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1858 Remove. All uses replaced by the old RE_* names.
1859 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1860 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1861 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1862 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1863 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1864 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1865 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1866 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1867 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1868 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1869 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1870 Don't bother having these macros be independent of each others'
1871 values, since they no longer exist in the POSIX name space.
1873 Rename the following member names back to their old names,
1874 unless !__USE_GNU_REGEX. All uses changed back.
1875 (buffer): Renamed from re_buffer.
1876 (allocated): Renamed from re_allocated.
1877 (used): Renamed from re_used.
1878 (syntax): Renamed from re_syntax.
1879 (fastmap): Renamed from re_fastmap.
1880 (translate): Renamed from re_translate.
1881 (can_be_null): Renamed from re_can_be_null.
1882 (regs_allocated): Renamed from re_regs_allocated.
1883 (fastmap_accurate): Renamed from re_fastmap_accurate.
1884 (no_sub): Renamed from re_no_sub.
1885 (not_bol): Renamed from re_not_bol.
1886 (not_eol): Renamed from re_not_eol.
1887 (newline_anchor): Renamed from re_newline_anchor.
1888 (num_regs): Renamed from rm_num_regs.
1889 (start): Renamed from rm_start.
1890 (end): Renamed from rm_end.
1892 (free_state): Move up a bit.
1894 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1895 #define to be empty.
1896 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1897 when that is what is intended.
1898 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1899 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1901 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1902 All uses changed back to re_malloc, etc. It's now the caller's
1903 responsibility to check for overflow; all callers changed.
1904 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1905 (re_x2nrealloc): Remove.
1906 (free_state): Remove decl.
1908 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1909 (re_set_registers, re_exec):
1912 2006-01-31 Roland McGrath <roland@redhat.com>
1914 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1915 Reported by Mike Frysinger <vapier@gentoo.org>.
1917 2006-01-15 Andreas Jaeger <aj@suse.de>
1920 * regex_internal.c (re_string_reconstruct): Adjust for
1921 build_wcs_upper_buffer change.
1922 (build_wcs_upper_buffer): Change return type.
1924 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1926 * regex_internal.h: Include <stdint.h> if available.
1928 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1930 * regex_internal.h (SIZE_MAX): Provide a default definition.
1932 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1934 * regcomp.c: Adjust for changed secondary hash function.
1936 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1938 * regex.h: Pretty printing.
1939 Clean up namespace a bit.
1941 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1943 * regexec.c (update_cur_sifted_state, check_arrival,
1944 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1946 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1947 Ulrich Drepper <drepper@redhat.com>
1950 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1951 (bitset_word_t): Renamed from bitset_word. All uses changed.
1953 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1956 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1957 * regcomp.c: Remove unnecessary uses of
1958 unsigned RE_TRANSLATE_TYPE.
1959 * regex_internal.h: Likewise.
1960 * regex_internal.c: Likewise.
1961 * regexec.c: Likewise.
1962 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1964 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1966 * regexec.c (find_recover_state): Remove unnecessary
1968 (transit_state_bkref): Make DFA a const pointer.
1969 (get_subexp): Likewise.
1970 (check_arrival): Likewise.
1971 (update_cur_sifted_state): Likewise.
1972 (re_search_internal): Likewise.
1973 (prune_impossible_nodes): Likewise.
1974 (acquire_init_state_context): Likewise.
1975 (proceed_next_node): Likewise.
1976 (set_regs): Likewise.
1977 (free_fail_stack_return): Likewise.
1978 (check_arrival_expand_ecl): Mark DFA parameter as const.
1979 (check_arrival_expand_ecl_sub): Likewise.
1980 (check_subexp_limits): Likewise.
1981 (sub_epsilon_src_nodes): Likewise.
1982 (add_epsilon_src_nodes): Likewise.
1983 (merge_state_array): Likewise.
1984 (update_regs): Likewise.
1985 (build_trtable): Likewise.
1986 (sift_states_backward): Mark MCTX parameter as const.
1987 (build_sifted_states): Likewise.
1988 (update_cur_sifted_state): Likewise.
1989 (sift_states_mkref): Likewise.
1990 (check_arrival_expand_ecl): Mark eclosure as const.
1991 (check_dst_limits_calc_pos_1): Likewise.
1992 * regex_internal.h (re_match_context_t): Make dfa a const
1995 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1997 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1998 (transit_state_sb): Likewise.
1999 (transit_state_mb): Likewise.
2000 (sift_states_iter_mb): Likewise.
2001 (check_arrival_add_next_nodes): Likewise.
2002 (check_node_accept_bytes): Change first parameter to pointer-to-const.
2003 [_LIBC] (re_search_2_stub): Use mempcpy.
2005 * regex_internal.c (re_string_reconstruct): Avoid calling
2006 mbrtowc for very simple UTF-8 case.
2008 * regex_internal.c (re_acquire_state): Make DFA pointer arg
2010 (re_acquire_state_context): Likewise.
2011 * regex_internal.h: Adjust prototypes.
2013 * regex.c: Prevent using C++ compilers.
2015 * regex_internal.c (re_acquire_state): Minor code rearrangement.
2016 (re_acquire_state_context): Likewise.
2018 2006-03-29 Mark D. Baushke <mdb@gnu.org>
2019 Bruno Haible <bruno@clisp.org>
2021 * stdint_.h: On OpenBSD, don't redefine types already included in
2022 <sys/types.h> and <inttypes.h>.
2024 2006-03-24 Eric Blake <ebb9@byu.net>
2026 * time_r.c (copy_string_result): Remove, as it is no longer used.
2028 2006-03-24 Simon Josefsson <jas@extundo.com>
2030 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2031 including some doc fixes.
2032 (base64_encode_alloc): Fix +1 bug on allocation failures.
2034 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2036 * base64.c (base64_encode): Do not read past end of array with
2037 unsanitized input on systems with CHAR_BIT > 8.
2039 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2041 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2042 Typedef to long int, not to off_, as POSIX will likely change
2045 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
2047 * argp-help.c (validate_uparams): Fix typo
2048 * argp-parse.c (argp_default_options): Consistently begin help
2049 messages with a lowercase letter.
2051 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
2053 * time_r.h (asctime_r, ctime_r): Remove. These functions can
2054 overrun buffers and shouldn't be used (much as gets shouldn't be
2056 * time_r.c (asctime_r, ctime_r): Likewise.
2058 2006-03-08 Simon Josefsson <jas@extundo.com>
2060 * gc-gnulib.c (randomize): Don't open files called 'no', they
2061 signal that configure disabled the device.
2063 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
2065 * c-stack.c: Include unistd.h unconditionally, since we now assume
2067 * getlogin_r.c: Likewise.
2068 * getlogin_r.h: Likewise.
2070 * pagealign_alloc.c: Likewise.
2071 * unistd_.h: Remove; no longer needed.
2073 2006-03-07 Simon Josefsson <jas@extundo.com>
2075 * unistd_.h: New file.
2077 2006-03-07 Simon Josefsson <jas@extundo.com>
2079 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2081 2006-03-01 Simon Josefsson <jas@extundo.com>
2083 * readline.c: Fix typo, tiny patch from Stepan Kasal
2086 2006-02-28 Simon Josefsson <jas@extundo.com>
2088 * getopt.c: Protect #include of unistd.h, for MSVS.
2090 2006-02-27 Simon Josefsson <jas@extundo.com>
2092 * base64.h: Indent #define's. From Jim Meyering
2095 2006-02-27 Jim Meyering <jim@meyering.net>
2097 Revert the change of 2006-02-24, so these files can continue
2098 to be sync'd from gettext.
2099 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2102 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2104 * glob.c: Say "invalid" rather than "illegal" in comments.
2106 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2108 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2110 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2112 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2113 AT_FDCWD exceeds INT_MAX.
2114 * openat.h (AT_FDCWD): Likewise.
2116 2006-02-14 Jim Meyering <jim@meyering.net>
2118 Sync from coreutils.
2120 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2121 failure on deficient systems, and simplify gnulib lgpl dependencies.
2122 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2123 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2125 * xalloc-die.c: Remove unused definition of N_.
2127 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2129 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2131 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2133 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2134 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2136 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2138 * argp-namefrob.h: Restore changes accidentally lost during the
2139 "autoupdate" on 2005-12-12.
2141 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2143 * fnmatch.c (L_): Renamed from L, to work around a bug in
2144 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2145 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2148 2006-01-26 Simon Josefsson <jas@extundo.com>
2150 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2151 prototype is visible on mingw32.
2153 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2156 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2159 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2161 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2162 attempt to open for write; this always fails, at least on POSIX
2163 hosts. This reinstates the 2006-01-09 change, which was
2164 inadvertently removed.
2166 2006-01-26 Bruno Haible <bruno@clisp.org>
2167 Paul Eggert <eggert@cs.ucla.edu>
2169 * stdbool_.h (_Bool)
2170 [(! (defined __cplusplus || defined __BEOS__)
2171 && !defined __GNUC__
2172 && !(defined __HP_cc || defined __xlc__
2173 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2174 || defined __sgi))]:
2175 #define to signed char in these cases too; this simplifies
2176 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2177 etc., separately) and makes it more conservative.
2179 2006-01-21 Jim Meyering <jim@meyering.net>
2181 Sync from the stable (b5) branch of coreutils:
2183 * fts.c (fts_children): Don't let close() clobber errno from
2186 * fts.c (fts_stat): When following a symlink-to-directory,
2187 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2188 a dangling symlink. That can also happen at least for ELOOP.
2189 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2190 FYI, this bug predates the inclusion of fts.c in coreutils.
2192 * fts.c (fts_open): Put new maxarglen declaration and uses
2193 in their own block, so pre-c99 compilers don't object.
2195 Avoid the double-free (first in fts_read, second in fts_close) that
2196 would occur when an `active' directory is made inaccessible (e.g.,
2197 via chmod a-x) during a traversal.
2198 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2199 before returning. Reproduce this failure by
2200 mkdir -p a/b; cd a; chmod a-x . b
2201 Reported by Stavros Passas.
2203 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2205 * argp-namefrob.h: Bugfix. Remove stray #
2207 2006-01-25 Bruno Haible <bruno@clisp.org>
2209 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2211 Reported by Paul Eggert.
2213 2006-01-25 Jim Meyering <jim@meyering.net>
2215 * fileblocks.c: Remove more useless parentheses.
2216 * readutmp.h: Likewise.
2218 2006-01-24 Bruno Haible <bruno@clisp.org>
2220 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2222 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2225 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2226 to avoid problems with the built-in _Bool type.
2227 Reported by Paul Eggert on 2005-11-26.
2229 2006-01-24 Jim Meyering <jim@meyering.net>
2231 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2233 2006-01-24 Simon Josefsson <jas@extundo.com>
2235 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2238 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2240 Work around porting bugs reported by Dieter in
2241 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2242 * getopt.c (_NOPROTO): Remove; no longer needed.
2243 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2244 Include "getopt.h" first, to check interface.
2245 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2247 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2248 (__strndup): Revert to K&R-style function dfns, the glibc style.
2249 * strnlen.c: Don't claim it's taken from glibc; it's not.
2250 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2251 Include strnlen.h first, to get prototype properly.
2252 (strnlen): Renamed from __strnlen.
2255 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2257 These changes imported from libc.
2258 * getopt.c: Use __fxprintf instead of inline stream orientation
2259 test and two separate function calls.
2260 * strndup.c (__strndup): Add libc_hidden_def.
2262 2006-01-22 Bruno Haible <bruno@clisp.org>
2264 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2265 temporary buffer for sprintf, take into account the precision also
2266 for 'd', 'i', 'u', 'o', 'x', 'X'.
2268 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2270 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2271 to pacify gcc -Wswitch-default.
2273 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2275 * argp-help.c (usage_long_opt): Do not print DOC options.
2276 (__argp_base_name): Removed
2277 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2279 (__argp_base_name): Provide macro definition or extern declaration
2280 depending on the configuration
2282 2006-01-20 Simon Josefsson <jas@extundo.com>
2284 * inet_ntop.h: Unconditionally include sys/socket.h.
2286 2006-01-19 Simon Josefsson <jas@extundo.com>
2288 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2290 2006-01-12 Simon Josefsson <jas@extundo.com>
2292 * base64.c: Fix warning, reported by Bruno Haible
2293 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2295 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2297 Sync from coreutils.
2298 * md5.c: Fix commentary typos.
2299 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2300 * md5.h (__attribute__): Remove; unused.
2301 * sha1.c: Fix commentary to match md5 better.
2302 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2303 so that we don't need to worry about alignment. All uses changed.
2304 This merges the 2005-10-28 md5 change into sha1.
2306 2006-01-11 Jim Meyering <jim@meyering.net>
2308 Sync from coreutils.
2309 * md5.c (OP): Fix spacing.
2311 2006-01-11 Simon Josefsson <jas@extundo.com>
2313 * stdint_.h (SIZE_MAX): Add missing (.
2315 2006-01-10 Bruno Haible <bruno@clisp.org>
2317 * argp.h (__const): Remove macro. Use const instead.
2318 * argp-fmtstream.h (__const): Likewise.
2319 * glob_.h (__const): Remove macro.
2320 * glob-libc.h: Use const instead of __const.
2322 2006-01-10 Jim Meyering <jim@meyering.net>
2324 Avoid the double-free (first in fts_read, second in fts_close) that
2325 would occur when an `active' directory is made inaccessible (e.g.,
2326 via chmod a-x) during a traversal.
2327 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2328 before returning. Reproduce this failure by
2329 mkdir -p a/b; cd a; chmod a-x . b
2330 Reported by Stavros Passas.
2332 Sync from coreutils.
2333 * sha1.c: Tweak grammar in a comment.
2335 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2337 * regex_internal.h (BITSET_WORD_BITS):
2338 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2339 preprocessor mishandles large unsigned values as if they were signed.
2340 Problem reported by Claudio Fontana in
2341 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2343 2006-01-10 Simon Josefsson <jas@extundo.com>
2345 * socket_.h: New file.
2347 2006-01-10 Bruno Haible <bruno@clisp.org>
2349 * localcharset.c: Update from GNU gettext.
2351 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2353 Sync from coreutils.
2354 * chdir-long.c (cdb_free): Don't bother trying to open directory
2355 for write access: POSIX says that must fail.
2356 * fts.c (diropen): Likewise.
2357 * save-cwd.c (save_cwd): Likewise.
2358 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2359 well, for minor improvements on hosts that lack O_DIRECTORY.
2360 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2361 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2362 Fall back on chown if open failed with EACCES.
2364 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2365 Report an error at compile-time if only a 1-second nominal clock
2366 resolution is found.
2368 * lchmod.h: New file.
2369 * mkdir-p.c: Include lchmod.h, lchown.h.
2370 (make_dir_parents): Use lchown rather than chown, and
2371 lchmod rather than chmod.
2373 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2374 too. Problem with "none" reported by Bob Proulx. Problem with
2375 "proc" reported by n0dalus.
2377 * mountlist.c: Include <limits.h>.
2378 (dev_from_mount_options)
2379 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2380 New function. It no longer assumes "dev=" has the System V meaning
2381 on Linux (since it doesn't). It also parses "dev=" more carefully.
2382 (read_file_system_list)
2383 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2384 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2387 * posixtm.h (PDS_PRE_2000): New macro.
2388 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2389 All usages changed. Reject dates outside the range 1969-1999 if
2390 PDS_PRE_2000 is used.
2392 2006-01-09 Jim Meyering <jim@meyering.net>
2394 Sync from coreutils.
2396 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2398 * chdir-safer.h, chdir-safer.c: New files.
2400 * modechange.c (mode_compile): Reject an invalid mode string
2401 that starts with an octal digit. From Andreas Gruenbacher.
2403 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2404 and dup to open_safer and dup_safer, respectively.
2405 (openat_permissive): Fix typo in comment.
2407 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2408 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2409 (_): Remove; no longer needed.
2410 (openat): Renamed from rpl_openat; no need for rpl_openat
2411 since openat.h renames openat for us.
2412 Replace most of the body with a call to openat_permissive,
2413 to avoid duplicate code.
2414 Port to (probably hypothetical) environments were mode_t is
2416 (openat_permissive): Require mode arg, so that we can check
2417 types better. Put it just after flags. Change cwd failure
2418 indicator from pointer-to-bool to pointer-to-errno-value.
2419 All callers changed.
2420 Invoke openat_save_fail and/or openat_restore_fail if
2421 cwd_errno is null, so that openat can call us.
2422 (openat_permissive, fdopendir, fstatat, unlinkat):
2423 Simplify errno handling to avoid some duplicate code,
2424 as it's OK to set errno on success.
2425 * openat.h: Revamp code so that function macros depend on
2426 __OPENAT_PREFIX only, not also on AT_FDCWD.
2427 (openat_ro): Remove. Caller changed to use openat_permissive.
2428 (openat_permissive): Now a macro, if not a function.
2429 (openat_restore_fail, openat_save_fail): Now always functions,
2430 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2432 * openat-priv.h: New file, defining macros used by mkdirat.c
2434 * mkdirat.c: Include openat-priv.h.
2435 Remove definitions of macros defined therein.
2436 * openat.c: Likewise.
2438 * mkdirat.c (mkdirat): New file and function.
2439 * openat.h (mkdirat): Declare.
2441 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2443 * openat.h (openat_permissive): Declare.
2444 (openat_ro): Define.
2446 * openat.c (EXPECTED_ERRNO): New macro.
2447 (openat_permissive): New function -- used in remove.c rewrite.
2448 (all functions): Set errno just before returning, only if there
2449 was an actual failure.
2450 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2452 Emulate openat-family functions using Linux's procfs, if possible.
2453 Idea and some code based on Ulrich Drepper's glibc changes.
2455 * openat.c: (BUILD_PROC_NAME): New macro.
2456 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2457 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2458 before falling back on save_cwd and restore_cwd.
2459 (fdopendir, fstatat, unlinkat): Likewise.
2461 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2462 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2464 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2465 as second argument to va_arg. Otherwise, some versions of gcc
2466 warn that `if this code is reached, the program will abort'.
2468 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2470 Sync from coreutils.
2472 Add POSIX ACL support
2473 * acl.h (copy_acl, set_acl): Add declarations.
2474 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2475 systems other than Linux.
2476 (chmod_or_fchmod): New function: use fchmod when possible,
2477 and chmod otherwise.
2478 (file_has_acl): Add a POSIX ACL implementation, with a
2479 Linux-specific subcase.
2480 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2481 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2482 acls are unsupported.
2483 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2484 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2487 2006-01-09 Bruno Haible <bruno@clisp.org>
2489 * sysexit_.h (EX_OK): New macro.
2490 Suggested by Martin Lambers <marlam@marlam.de>.
2492 2006-01-09 Bruno Haible <bruno@clisp.org>
2494 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2495 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2496 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2497 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2499 2006-01-09 Bruno Haible <bruno@clisp.org>
2501 * stdint_.h (SIZE_MAX): Write the value without involving negative
2504 2005-10-16 Bruno Haible <bruno@clisp.org>
2506 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2507 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2509 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2511 * strftime.c (tzname): Don't declare if it is already #defined.
2512 Problem reported for Mingw by Mark Junker.
2514 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2516 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2517 long int, not int, for nanosecond counts, so that people who are
2518 used to POSIX struct timespec won't be surprised. Reported by Jim
2521 2005-12-16 Jim Meyering <jim@meyering.net>
2523 * fprintftime.c, fprintftime.h: New files.
2525 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2527 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2528 * argp-help.c (fill_in_uparams): Check if the constructed
2529 struct uparams is valid. Fall back to the default values if it is
2532 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2534 * argp-help.c (__argp_base_name): New function
2535 (__argp_short_program_name): Rewrite using __argp_base_name
2536 * argp-namefrob.h: Define program_invocation_name and
2537 program_invocation_short_name if requested
2538 (__argp_base_name): Add prototype
2539 * argp-parse.c (argp_def): Use gettext wrappers
2540 (argp_default_parser): Use __argp_base_name
2541 * argp-pin.c: New file. Defines program_invocation_name and
2542 program_invocation_short_name on systems that lack them.
2544 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2546 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2547 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2548 porting problem reported by Georg Schwarz in
2549 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2551 2005-07-09 Bruno Haible <bruno@clisp.org>
2553 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2554 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2555 Reported by Mark Junker <mjscod@gmx.de>.
2557 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2559 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2560 (uintmax_t) [defined uintmax_t]: Do not declare.
2561 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2562 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2563 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2564 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2565 sake of portability to weird hosts that C allows (though we don't
2566 know of any practical examples).
2568 * savedir.h (fdsavedir): New decl.
2569 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2570 contains most of the former guts of savedir.
2571 (savedir): Use savedirstream.
2574 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2576 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2577 coreutils no longer futzes with rounding modes.
2579 2005-11-14 Jim Meyering <jim@meyering.net>
2581 * mkstemp-safer.c: Include <config.h>, required for possible
2582 replacement of mkstemp.
2584 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2586 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2588 (gethrxtime) [! (HAVE_NANOUPTIME
2589 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2590 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2591 our own approximation.
2593 2005-11-10 Simon Josefsson <jas@extundo.com>
2595 * readline.c: Remove EOL.
2597 2005-11-08 Eric Blake <ebb9@byu.net>
2599 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2601 2005-11-08 Eric Blake <ebb9@byu.net>
2603 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2605 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2607 Fix porting problem reported by Theodoros V. Kalamatianos.
2608 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2609 Don't assume that futimes failing means we must fail.
2611 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2613 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2614 leave errno alone. Problem reported by Dmitry V. Levin.
2616 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2618 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2619 errno alone. Problem reported by Frederic Jolliton.
2621 2005-10-28 Simon Josefsson <jas@extundo.com>
2623 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2624 "restrict" keywords, as per POSIX. Protect the function
2625 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2626 Don't use K&R prototypes. Check the sprintf return values.
2627 Re-define EAFNOSUPPORT if not present. Indent.
2629 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2630 suggested by Bruno Haible <bruno@clisp.org>.
2632 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2634 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2636 * gc-libgcrypt.c: Add MD2 (which is not available through
2639 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2641 * md2.h, md2.c: New files.
2643 2005-10-24 Simon Josefsson <jas@extundo.com>
2645 * md4.h: Shrink buffer size, now that we changed the type.
2647 2005-10-22 Simon Josefsson <jas@extundo.com>
2649 * arcfour.h, arcfour.c: Use fixed size indices in the
2650 arcfour_context struct (simplify test vector testing in GNU
2653 2005-10-22 Simon Josefsson <jas@extundo.com>
2655 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2656 suggested by Bruno Haible <bruno@clisp.org>.
2658 2005-10-22 Simon Josefsson <jas@extundo.com>
2660 * crc.h: Include stddef.h, for size_t.
2662 2005-10-21 Simon Josefsson <jas@extundo.com>
2664 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2665 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2667 2005-10-21 Simon Josefsson <jas@extundo.com>
2669 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2672 2005-10-21 Simon Josefsson <jas@extundo.com>
2674 * gc-gnulib.c: Support ARCTWO in CBC mode.
2676 2005-10-21 Simon Josefsson <jas@extundo.com>
2678 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2681 * hmac-sha1.c (hmac_sha1): Likewise.
2683 * crc.c (crc32_update): Actually use crc parameter, suggested by
2684 Bruno Haible <bruno@clisp.org>.
2686 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2689 2005-10-21 Simon Josefsson <jas@extundo.com>
2691 * des.h, des.c: New files.
2693 * gc-gnulib.c: Support DES.c
2695 2005-10-21 Simon Josefsson <jas@extundo.com>
2697 * arctwo.h, arctwo.c: New files.
2699 * gc-gnulib.c: Support ARCTWO.
2701 2005-10-21 Simon Josefsson <jas@extundo.com>
2703 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2705 2005-10-19 Simon Josefsson <jas@extundo.com>
2707 * gc-gnulib.c: Support ARCFOUR.
2709 2005-10-19 Simon Josefsson <jas@extundo.com>
2711 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2714 * gc.h: Add ECB enum type.
2716 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2718 2005-10-19 Simon Josefsson <jas@extundo.com>
2720 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2722 2005-10-18 Simon Josefsson <jas@extundo.com>
2724 * md4.h, md4.c: New files, based on md5.?.
2726 2005-10-17 Simon Josefsson <jas@extundo.com>
2728 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2730 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2732 2005-10-17 Simon Josefsson <jas@extundo.com>
2734 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2736 2005-10-17 Simon Josefsson <jas@extundo.com>
2738 * gc.h, gc-libgcrypt.c: Add ciphers.
2740 2005-10-17 Simon Josefsson <jas@extundo.com>
2742 * sha1.c: Use uint32_t instead of md5_uint32.t
2744 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2747 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2749 * md5.h: Use stdint.h and uint32_t. Doc fix.
2751 2005-10-15 Simon Josefsson <jas@extundo.com>
2753 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2755 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2757 2005-10-14 Simon Josefsson <jas@extundo.com>
2759 * arcfour.h, arcfour.c: New files.
2761 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2763 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2764 include <wchar.h>; no longer needed.
2766 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2767 and Ulrich Drepper <drepper@redhat.com>
2770 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2771 instead of inline stream orientation test and two separate
2772 function calls. Pay no attention to USE_IN_LIBIO.
2774 2005-10-14 Roland McGrath <roland@redhat.com>
2776 Import from libc. [BZ #1331]
2777 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2779 Reported by Matej Vela <vela@debian.org>.
2781 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2783 * mkdir-p.c (make_dir_parents): Don't report an error if an
2784 intermediate directory is in a read-only file system. Problem
2785 reported by Eric Blake.
2787 2005-10-13 Simon Josefsson <jas@extundo.com>
2789 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2790 Move memory allocation outside of loop.
2792 2005-10-12 Simon Josefsson <jas@extundo.com>
2794 * gc-pbkdf2-sha1.c: New file.
2796 * gc.h: Add gc_pbkdf2_sha1 prototype.
2798 2005-10-12 Simon Josefsson <jas@extundo.com>
2800 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2801 suggested by Bruno Haible <bruno@clisp.org>.
2803 2005-10-12 Simon Josefsson <jas@extundo.com>
2805 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2807 * gc-gnulib.c (gc_hmac_sha1): New function.
2809 2005-10-12 Simon Josefsson <jas@extundo.com>
2811 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2813 2005-10-12 Simon Josefsson <jas@extundo.com>
2815 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2816 GC_USE_HMAC_MD5, respectively.
2818 * gc-libgcrypt.c (gc_md5): Fix assert call.
2821 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2823 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2825 * gc-gnulib.c (gc_hash_buffer): Ditto.
2827 2005-10-11 Bruno Haible <bruno@clisp.org>
2829 * c-strcasestr.h: New file, from GNU gettext.
2830 * c-strcasestr.c: New file, from GNU gettext.
2832 2005-10-11 Bruno Haible <bruno@clisp.org>
2834 * c-strcase.h: New file, from GNU gettext.
2835 * c-strcasecmp.c: New file, from GNU gettext.
2836 * c-strncasecmp.c: New file, from GNU gettext.
2838 2005-10-11 Simon Josefsson <jas@extundo.com>
2840 * crc.h, crc.c: New files.
2842 * gc.h (gc_hash_buffer): Add doc.
2844 2005-10-08 Simon Josefsson <jas@extundo.com>
2846 * gc.h: Add gc_hash and gc_hash_buffer.
2848 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2850 * gc-libgcrypt.c (gc_hash_buffer): Add.
2852 2005-10-11 Bruno Haible <bruno@clisp.org>
2854 * strcasecmp.c: Include limits.h.
2855 (strcasecmp): Avoid integer overflow on exotic platforms.
2856 * strncasecmp.c: Include limits.h.
2857 (strncasecmp): Avoid integer overflow on exotic platforms.
2858 Reported by Paul Eggert.
2860 2005-10-06 Simon Josefsson <jas@extundo.com>
2862 * hmac-md5.c: New file.
2866 2005-10-06 Simon Josefsson <jas@extundo.com>
2868 * memxor.c (memxor): Avoid casts and warnings.
2870 2005-10-05 Derek Price <derek@ximbiot.com>
2872 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2874 2005-10-05 Simon Josefsson <jas@extundo.com>
2876 * memxor.c (memxor): Fix compiler error.
2878 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2879 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2881 * memxor.h, memxor.c: New files.
2883 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2884 we assume all systems have it, suggested by Jim Meyering
2885 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2886 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2887 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2890 2005-10-04 Bruno Haible <bruno@clisp.org>
2892 * verify.h (verify_true): Provide alternative definition for C++.
2894 2005-10-04 Simon Josefsson <jas@extundo.com>
2896 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2897 D. Baushke" <mdb@gnu.org>.
2899 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2901 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2902 (SSIZE_MAX): New macro, if not already defined.
2903 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2906 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2908 * exclude.c: Include verify.h.
2909 (verify): Remove. All callers changed to use verify.h's version.
2910 * strtoimax.c: Likewise.
2911 * utimecmp.c: Likewis.e
2913 Sync from coreutils.
2914 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2915 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2916 * .cvsignore: Add fts.h, search.h, t-fpending.
2917 * settime.c (settime): Fix { typo in previous patch. Also, don't
2918 bother returning ENOSYS if settimeofday or stime fails; just let
2919 them return whatever errno they want to return.
2920 * utimens.c: Include unistd.h, for dup2.
2921 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2922 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2924 2005-10-02 Jim Meyering <jim@meyering.net>
2926 Sync from coreutils.
2927 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2928 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2929 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2930 Remove AT_FDCWD test.
2931 Do not consume the fd unless successful.
2932 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2933 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2934 block, so that we don't even try to compile it if settimeofday is
2935 available. This works around a compilation failure on OSF1 V5.1,
2936 due to stime requiring a `long int*' while tv_sec is `int'.
2938 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2940 * getdelim.c (getdelim): Remove unused variables.
2942 2005-10-01 Simon Josefsson <jas@extundo.com>
2944 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2945 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2946 AI_* and EAI_* definitions. Protect function declarations.
2948 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2950 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2951 so that the code works even with ancient cpp. Portability problem
2952 with GCC 2.7.2.1 reported by Thomas M.Ott.
2954 2005-09-27 Jim Meyering <jim@meyering.net>
2956 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2958 * intprops.h (signed_type_or_expr__): Define.
2959 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2962 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2964 * verify.h (verify_expr): Remove, replacing with:
2965 (verify_true): New macro that returns true instead of void.
2966 (verify_type__): Remove.
2967 (verify): Use verify_true rather than verify_type__.
2969 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2971 * utimens.c (ENOSYS): Define if not already defined.
2972 (futimens): Support having a null PATH if the file descriptor
2975 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2977 (__attribute): Define to empty unless GCC 3.1 or later.
2978 This works around a core dump on OpenBSD 3.4, which has GCC
2979 2.95.3, which dumps core when given __attribute__(()). It also
2980 simplifies other tests, since we really don't want to bother with
2981 worrying about which ancient version of GCC supported what.
2982 Original problem reported by Yoann Vandoorselaere, with part of
2983 the fix suggested by Derek Price.
2985 2005-09-24 Jim Meyering <jim@meyering.net>
2987 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2988 so we can once again use a positive bitfield width of 1 -- now we
2989 don't have to explain why we were using a bitfield width of 2.
2991 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2993 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2994 Problem reported by Eric Blake.
2995 (getaddrinfo): Initialize se so that it's not garbage.
2996 Redo internal storage allocation so that it doesn't make unportable
2997 assumptions about alignment.
3000 * utimens.c (futimens): Use futimesat if available.
3001 Prefer it to futimes since it doesn't have the futimes bug.
3003 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
3004 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
3005 Instead, declare a function that returns a pointer to an array,
3006 and use verify_type__ to declare the size of the array.
3007 Problem and germ of a solution reported by Bruno Haible.
3008 (verify_type__): Use 2, not 1, for bitfield size, to avoid
3009 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
3011 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
3013 Sync from coreutils.
3015 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3017 * argmatch.h: Include verify.h
3018 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3019 (ARGMATCH_ASSERT): Remove; unused.
3020 * canonicalize.c: Assume STDC_HEADERS.
3021 * exclude.c: Include "strcase.h".
3022 * regex_internal.h [!defined _LIBC]: Likewise.
3023 * getusershell.c: Include stdio--.h rather than stdio.h
3025 (getusershell): Call fopen, not fopen_safer.
3026 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3027 Do not include unistd-safer.h.
3028 (save_cwd): Don't call fd_safer; no longer needed
3029 now that we include fcntl--.h.
3031 * getdate.y (relative_time): New type.
3032 (RELATIVE_TIME_0): New constant.
3033 (parser_control): Use relative_time instead of doing it ourselves.
3034 (%union): Add new relative_time rel member.
3035 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3037 (relunit, relunit_snumber): Now of type rel.
3038 (zone, rel, relunit, get_date): Adjust to above changes.
3040 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3041 Do not include unistd-safer.h.
3042 (getloadavg): Don't call fd_safer; no longer needed
3043 now that we include fcntl--.h.
3045 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3046 (make_dir_parents): Treat ENOSYS like EEXIST.
3048 Improve quality of diagnostics on restore_cwd failure.
3049 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
3050 (make_dir_parents): Last arg is now int * (for errno), not bool *.
3051 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3052 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3053 each time through the loop. Do not diagnose restore_cwd failure;
3054 that is the caller's job (and perhaps the caller does not care).
3056 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3057 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3058 If the file already exists but is not a directory, don't bother
3059 to try to make its parents.
3060 Close potential file descriptor leak if we can't chdir("/") (!).
3061 Don't always return true if chdir($PWD) fails; return true only
3062 if the requested action was done successfully (except for the
3064 Don't log final directory unless we actually made it.
3065 Refactor to avoid duplicate code to fix up permissions.
3066 Don't attempt to fix up parent permissions if chdir($PWD) fails.
3068 * strftime.c (my_strftime): Rewrite the previous change slightly,
3069 to make it a bit faster and (I hope) clearer.
3070 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3071 Fix bug in formats like %2N.
3073 * verify.h: New file.
3075 2005-09-22 Jim Meyering <jim@meyering.net>
3077 Sync from coreutils.
3079 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3081 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3082 the .tm_year member, since otherwise gcc-4.0 would now warn about
3083 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3085 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3086 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3088 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3089 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3090 when run in a time zone for which daylight savings time is in effect
3091 for the starting date.
3093 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3094 stop us from restricting permissions of just-created absolute-named
3096 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3097 to restore initial working directory.
3098 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3099 to tell caller if/when we change the working directory and are
3100 unable to return to the initial one.
3101 * mkdir-p.h (make_dir_parents): Update prototype.
3102 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3103 `return false'. This fixes a bug introduced on 2004-07-30.
3105 * openat.c (fdopendir): Be sure to close the supplied
3106 file descriptor before returning. This makes our replacement
3107 implementation a little closer to Solaris's, where fdopendir
3108 ties the file descriptor to the returned DIR* pointer.
3109 * openat.c (unlinkat): New function.
3110 * openat.h (unlinkat): Add prototype.
3111 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3112 (openat_restore_fail): Rename from openat_restore_die.
3113 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3115 Provide an alternative to exiting immediately upon save_cwd or
3116 restore_cwd failure. Now, an application can arrange e.g.,
3117 to perform a longjump in that case.
3118 * openat.c: Include dirname.h.
3119 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3120 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3121 and openat_restore_die rather than calling error directly.
3122 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3124 * openat-die.c (openat_save_die, openat_restore_die): New file.
3125 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3127 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3128 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3129 int utc, int nanoseconds);
3131 date should not have to allocate a megabyte of virtual memory to
3132 handle a format argument like +%1048575T. When implemented with
3133 strftime, it must allocate such a buffer, use strftime to fill it
3134 in, print it, then free it.
3135 With fprintftime, it simply prints everything and exits.
3136 With no need for memory allocation, that's one fewer way to fail.
3137 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3138 optional field width, not before, so we accept %9:z, not %:9z.
3139 (my_strftime): Be sure to use L_('x') for literals.
3141 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3142 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3143 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3144 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3145 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3146 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3147 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3148 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3149 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3151 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3152 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3153 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3154 and don't include <sys/file.h>).
3156 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3158 Sync from coreutils.
3160 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3161 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3162 [!LDAV_DONE]: Avoid unused variable warning.
3164 2005-09-21 Bruno Haible <bruno@clisp.org>
3166 * unicodeio.h (unicode_to_mb): New declaration.
3168 2005-09-20 Derek Price <derek@ximbiot.com>
3170 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3172 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3174 Use a consistent style for including <config.h>.
3175 * __fpending.c, acl.c, argmatch.c,
3176 argp-help.c, argp-parse.c,
3177 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3178 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3179 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3180 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3181 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3182 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3183 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3184 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3185 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3186 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3187 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3188 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3189 modechange.c, mountlist.c, open-safer.c, physmem.c,
3190 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3191 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3192 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3193 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3194 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3195 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3196 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3197 userspec.c, utimecmp.c, version-etc-fsf.c,
3198 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3199 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3200 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3201 Standardize inclusion of config.h.
3202 * __fpending.h, dirfd.h, getdate.h, human.h,
3203 inttostr.h: Removed inclusion of config.h from header files.
3204 * inttostr.c: Adjusted in-tree users.
3205 * timespec.h: Remove superfluous warning to include config.h.
3206 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3207 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3208 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3209 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3211 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3213 * stat-time.h: New file.
3214 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3215 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3217 (timespec_cmp): New function.
3218 * utimecmp.c: Include stat-time.h.
3219 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3220 members exist, not on the obsolescent ST_MTIM_NSEC.
3221 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3223 2005-09-15 Derek Price <derek@ximbiot.com>
3224 Paul Eggert <eggert@cs.ucla.edu>
3226 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3227 changes, consolidating in...
3228 * regex_internal.h: ...this file.
3230 2005-09-15 Derek Price <derek@ximbiot.com>
3232 * regex_internal.h: Blank `pure' for GNUC < 3.
3233 * regex_internal.c: Ditto, using this...
3234 (__GNUC_PREREQ): ...new macro.
3235 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3236 (__GNUC_PREREQ): ...this new macro.
3238 * strstr.h: Include string.h. Define strstr as a macro here.
3240 2005-09-13 Derek Price <derek@ximbiot.com>
3242 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3244 Reported by Jim Meyering <jim@meyering.net>.
3246 2005-09-13 Jim Meyering <jim@meyering.net>
3248 * canon-host.c: Filter through gnu indent and reword comments slightly.
3249 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3251 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3254 (base64_encode): Put b64str in initialized data section.
3256 2005-09-12 Derek Price <derek@ximbiot.com>
3258 Return usable errors from canon-host.
3259 * canon-host.h: New file.
3260 * canon-host.c (canon_host): Wrap...
3261 (canon_host_r): ...this new function, which now relies exclusively on
3263 (ch_strerror): New function.
3264 (last_cherror): New global.
3265 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3266 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3268 (freeaddrinfo): Free ai->ai_canonname when set.
3270 2005-09-12 Derek Price <derek@ximbiot.com>
3271 Paul Eggert <eggert@cs.ucla.edu>
3273 * glob-libc.h: Renamed from glob_.h. The new version is
3274 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3275 protecting things that should be done only in gnulib contexts.
3276 * glob_.h: New file, containing only the glob things needed for
3278 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3279 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3280 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3281 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3282 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3283 and to respect the namespace rules better.
3285 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3287 Merge glibc and coreutils changes into gnulib, plus a few
3289 * md5.c: Use #error rather than a string.
3290 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3291 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3292 (__attribute__): Define to empty for non recent-GCC.
3293 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3294 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3295 Renamed from their non-__ counterparts, with new macros replacing
3296 them if not _LIBC. Add __THROW attribute.
3298 (struct md5_ctx): Align buffer if using GCC.
3299 * sha1.h (struct sha1_ctx): Likewise.
3300 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3301 The old name was backwards.
3302 (NOTSWAP): Remove; not used.
3303 (rol): New macro, moved here from md5.h.
3304 (sha1_process_block): Remove a FIXME that doesn't make sense.
3306 2005-09-12 Derek Price <derek@ximbiot.com>
3308 * gai_strerror.c: Include config.h when available. Include
3309 getaddrinfo.h before other headers to test interface.
3310 Reported by Larry Jones <lawrence.jones@ugs.com>.
3312 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3314 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3315 definitions, since that's the preferred style in glibc.
3316 Fix a minor spacing issue, and update copyright notice to match glibc's.
3318 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3320 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3322 2005-09-06 Simon Josefsson <jas@extundo.com>
3324 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3325 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3327 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3329 Change bitset word type from unsigned int to unsigned long int,
3330 as this has better performance on typical 64-bit hosts.
3331 Port bitset code to hosts with unusual word sizes.
3332 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3333 (build_collating_symbol):
3334 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3335 argument is a bitset. This is merely a style issue, but it makes
3336 it clearer that an entire array is expected.
3337 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3338 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3339 Port to the case where bitset_word is not the same as unsigned int.
3340 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3341 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3343 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3344 (build_trtable, group_nodes_into_DFAstates):
3346 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3347 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3348 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3349 * regexec.c (group_nodes_into_DFAstates): Likewise.
3350 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3351 * regcomp.c (optimize_subexps, lower_subexp):
3352 Work even if bitset_word has holes in its bitwise representation.
3353 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3354 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3356 * regex_internal.c (re_string_reconstruct):
3357 Don't assume UCHAR_MAX == 255.
3358 * regex_internal.h (bitset_set_all): Likewise.
3359 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3361 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3362 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3364 (BITSET_WORD_MAX): New macro.
3365 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3366 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3367 (bitset_empty, bitset_copy):
3368 Prefer sizeof (bitset) to multiplying it out ourselves.
3369 (bitset_not_merge): Remove; unused.
3370 (bitset_contain): Return bool, not unsigned int with one bit on.
3371 All callers changed.
3372 * regexec.c (build_trtable): Don't assume bitset has no stricter
3373 alignment than re_node_set; do this by defining a new internal
3374 type struct dests_alloc and using it to allocate memory.
3376 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3378 Check for arithmetic overflow when calculating sizes, to prevent
3379 some buffer-overflow issues. These patches are conservative, in the
3380 sense that when I couldn't determine whether an overflow was possible,
3381 I inserted a run-time check.
3382 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3383 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3384 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3385 (re_xnrealloc, re_x2nrealloc): New inline functions.
3386 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3387 (build_equiv_class, build_charclass): Check for arithmetic overflow
3388 in size expression calculations.
3389 * regex_internal.c (re_string_realloc_buffers):
3390 (build_wcs_upper_buffer, re_node_set_add_intersect):
3391 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3392 (re_dfa_add_node, register_state): Likewise.
3393 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3394 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3395 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3396 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3398 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3400 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3401 to avoid a collision with bits/local_lim.h in glibc.
3402 All uses changed. Problem reported by Dmitry V. Levin in
3403 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3405 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3406 bugs in int versus size_t comparisons.
3407 (re_string_context_at): Fix bug where the code assumed that
3410 Use bool where appropriate.
3411 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3412 All callers changed.
3413 (calc_eclosure_iter): Likewise, for ROOT arg.
3414 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3415 (build_charclass_op): Likewise, for NON_MATCH arg.
3416 * regex_internal.c (re_string_allocate, re_string_construct):
3417 (re_string_construct_common): Likewise, for ICASE arg.
3418 * regexec.c (re_search_2_stub, re_search_stub):
3419 Likewise, for RET_LEN arg.
3420 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3421 (set_regs): Likewise, for FL_BACKTRACK arg.
3422 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3423 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3424 (calc_eclosure_iter, parse_bracket_exp):
3425 Use bool for internal variables that are booleans.
3426 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3427 (set_regs, build_sifted_states, sift_states_bkref):
3428 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3429 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3430 (find_collation_sequence_value):
3432 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3433 (re_node_set_compare):
3434 Return bool, not int. All callers changed.
3435 * regexec.c (check_halt_node_context, check_dst_limits):
3436 (build_trtable, check_node_accept): Likewise.
3437 * regex_internal.h: Include stdbool.h.
3439 Fix bugs uncovered when converting to bool.
3440 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3441 failure instead of charging ahead blindly.
3442 * regex_internal.c (register_state): Likewise.
3443 * regexec.c (re_search_2_stub): Use simpler method than boolean
3444 for freeing internal storage.
3445 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3446 bitset pieces used as boolean, to avoid undefined behavior
3447 on hosts that do int overflow checking.
3449 2005-08-31 Derek Price <derek@ximbiot.com>
3451 * getdelim.c (getdelim): Return EOF on EOF.
3452 Reported by Larry Jones <lawrence.jones@ugs.com>.
3454 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3456 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3457 lengths fit in regoff_t; this isn't true if regoff_t is the same
3459 * regex.c (re_search_internal): 5th arg is LAST_START
3460 (= START + RANGE) instead of RANGE. This avoids overflow
3461 problems when regoff_t is the same width as size_t.
3462 All callers changed.
3463 (re_search_2_stub): Check for overflow when adding the
3464 sizes of the two strings.
3465 (re_search_stub): Check for overflow when adding START
3466 to RANGE; if it occurs, substitute the extreme value.
3468 2005-08-31 Jim Meyering <jim@meyering.net>
3470 * regcomp.c (search_duplicated_node): Make first pointer arg
3472 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3473 (register_state): Likewise.
3474 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3475 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3476 (group_nodes_into_DFAstates): Likewise.
3478 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3480 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3481 old glibc regex code mishandles strings longer than 2**31 bytes.
3482 This patch fixes this when the regex code is used in gnulib
3483 (i.e., outside glibc).
3485 This patch should not affect the use of the regex code inside
3486 glibc. No doubt this problem also needs to be handled for glibc
3487 as well, but the result will be an incompatible change to the
3488 glibc ABI, and the old ABI will have to be supported too. That
3489 can be the the subject for another patch.
3491 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3492 governing whether the rest of this patch is active. By default,
3493 the macro is disabled and the patch has no effect.
3494 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3495 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3496 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3497 (re_match_2, re_set_registers): Use the new types.
3498 * regex_internal.h (Idx, re_hashval_t): New types.
3499 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3501 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3502 (re_string_context_at, bin_tree_t, re_dfastate_t):
3503 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3504 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3505 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3506 (re_string_char_size_at, re_string_wchar_at):
3507 (re_string_elem_size_at):
3508 Use the new types and macros to port to 64-bit hosts.
3509 Use unsigned types for internal values, so that the code
3510 mostly works even for arrays larger than SSIZE_MAX.
3511 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3512 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3513 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3514 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3515 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3516 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3517 (calc_inveclosure, parse_dup_op, build_range_exp):
3518 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3519 (fetch_number, create_token_tree, mark_opt_subexp):
3521 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3522 (create_cd_newstate, re_string_allocate, re_string_construct):
3523 (re_string_realloc_buffers, build_wcs_upper_buffer):
3524 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3525 (re_string_reconstruct, re_string_peek_byte_case):
3526 (re_string_fetch_byte_case, re_string_context_at):
3527 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3528 (re_node_set_init_copy, re_node_set_add_intersect):
3529 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3530 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3531 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3532 (re_acquire_state, re_acquire_state_context, register_state):
3534 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3535 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3536 (re_search_internal, re_search_2_stub, re_search_stub)
3537 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3538 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3539 (update_cur_sifted_state, check_dst_limits):
3540 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3541 (check_subexp_limits, sift_states_bkref, merge_state_array):
3542 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3543 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3544 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3545 (expand_bkref_cache, check_node_accept_bytes):
3546 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3547 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3548 (acquire_init_state_context, check_halt_node_context):
3549 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3550 (sift_states_backward, clean_state_log_if_needed):
3551 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3552 (find_recover_state, transit_state_sb, transit_state_mb):
3553 (transit_state_bkref, build_trtable, match_ctx_clean):
3555 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3556 to work around an assumption that REG_MISSING is negative.
3558 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3559 (seek_collating_symbol_entry) [defined _LIBC]:
3560 (lookup_collation_sequence_value) [defined _LIBC]:
3561 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3562 Use prototypes rather than old-style function definitions.
3563 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3564 (transit_state_sb) [0]:
3565 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3567 * regexec.c (re_search_internal): Simplify update of rm_so and
3570 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3571 (optimize_subexps, lower_subexp):
3572 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3573 since the signed shift might overflow. Use 1u<<31 instead.
3574 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3575 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3578 * regcomp.c (optimize_subexps, lower_subexp):
3579 Use CHAR_BIT rather than 8, for clarity.
3580 * regexec.c (check_dst_limits_calc_pos_1):
3581 (check_subexp_matching_top): Likewise.
3582 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3583 have to worry about portability issues when shifting it left.
3584 Remove no-longer-needed test for table_size > 0.
3585 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3586 in a word, as the resulting behavior is undefined.
3587 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3588 in one case, a <= should have been an <, and in another case the
3589 whole test was missing.
3590 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3591 the standard name CHAR_BIT.
3592 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3593 this is not true on one's complement and signed-magnitude hosts.
3595 * regex_internal.h (re_sub_match_top_t): Remove unused member
3597 (struct re_dfa_t): Remove unused member states_alloc.
3598 * regcomp.c (init_dfa): Don't initialize unused members.
3600 2005-08-31 Bruno Haible <bruno@clisp.org>
3602 * strstr.c: Include <stddef.h>, for NULL.
3603 * strcasestr.c: Likewise.
3604 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3606 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3608 * iconvme.h: Add prototype for iconv_alloc.
3610 2005-08-29 Simon Josefsson <jas@extundo.com>
3612 * iconvme.c: Fix errno.
3614 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3616 * iconvme.c: Split iconv_string into iconv_alloc.
3618 2005-08-27 Jim Meyering <jim@meyering.net>
3620 * fopen-safer.c: Merge minor changes from coreutils.
3621 * dup-safer.c: Likewise.
3622 * fd-safer.c: Likewise.
3624 Merge from coreutils.
3625 * stdio--.h: New file.
3626 * stdlib--.h: New file.
3627 * mkstemp-safer.c: New file.
3629 GNU tar needs these.
3630 * pipe-safer.c: New file.
3631 * creat-safer.c: New file.
3632 * fcntl--.h (creat): Define to creat_safer.
3633 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3634 * unistd--.h (pipe): Define to pipe_safer.
3635 * unistd-safer.h: Declare pipe_safer.
3637 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3639 * regex_internal.h: Remove all references to
3640 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3642 (bitset_not, bitset_merge, bitset_not_merge):
3643 (bitset_mask, re_string_allocate, re_string_construct):
3644 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3645 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3646 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3647 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3648 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3649 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3650 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3651 (re_acquire_state_context):
3652 Remove unnecessary forward decls.
3653 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3654 Put __attribute at function definition,
3655 now that the function decl has been removed.
3656 * regex_internal.c (re_string_peek_byte_case):
3657 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3660 2005-08-26 Simon Josefsson <jas@extundo.com>
3662 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3663 Haible <bruno@clisp.org>.
3665 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3667 * regexec.c (set_regs): Don't alloca with an unbounded size.
3669 alloca modernization/simplification for regex.
3670 * regex.c: Remove portability cruft for alloca. This no longer
3671 needs to be at the start of the file, and can be moved into
3672 regex_internal.h and simplified.
3673 * regex_internal.h: Include <alloca.h>.
3674 (__libc_use_alloca) [!defined _LIBC]: New macro.
3675 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3676 now works outside glibc.
3678 2005-08-24 Simon Josefsson <jas@extundo.com>
3680 * getpass.c: Add WIN32 implementation. Conditionalize use of
3681 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3682 GLIBC specific code.
3684 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3686 Make regex safe for g++. This fixes one real bug (an "err"
3687 that should have been "*err"). g++ problem reported by
3689 * regex_internal.h (re_calloc): New macro, consistent with
3690 re_malloc etc. All callers of calloc changed to use re_calloc.
3691 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3692 not int. All callers changed.
3693 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3694 just use an array of size MB_LEN_MAX.
3695 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3696 (find_recover_state): Change "err" to "*err"; this fixes what
3697 appears to be a real bug.
3698 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3701 2005-08-25 Jim Meyering <jim@meyering.net>
3703 * open-safer.c: Include <config.h>.
3704 Otherwise, we'd lose LARGEFILE support in any file using
3707 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3709 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3710 * regex.h (regerror): Likewise.
3712 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3713 requires this. (The code never needed it.)
3715 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3716 All uses of recently-renamed identifiers changed to use the new,
3717 POSIX-compliant names. The code will build and run just fine
3718 without these changes, but it's better to eat our own dog food
3719 and use the standard-conforming names.
3721 * regex.h: Fix a multitude of POSIX name space violations.
3722 These changes have an effect only for programs that define
3723 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3724 do not change anything for programs compiled in the normal way.
3725 Also, there is no effect on the ABI.
3727 (_REGEX_SOURCE): New macro.
3728 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3729 defined and _GNU_SOURCE is not; this fixes a name space violation.
3731 Rename the following macros to obey POSIX requirements.
3732 The old names are still visible as macros if _REGEX_SOURCE is defined.
3733 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3734 RE_BACKSLASH_ESCAPE_IN_LISTS.
3735 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3736 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3737 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3738 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3739 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3740 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3741 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3742 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3743 (REG_INTERVALS): renamed from RE_INTERVALS.
3744 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3745 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3746 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3747 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3748 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3749 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3750 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3751 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3752 RE_UNMATCHED_RIGHT_PAREN_ORD.
3753 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3754 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3755 (REG_DEBUG): renamed from RE_DEBUG.
3756 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3757 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3758 unusual, since we can't clash with the POSIX REG_ICASE.
3759 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3760 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3761 (REG_NO_SUB): renamed from RE_NO_SUB.
3762 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3763 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3764 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3765 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3766 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3767 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3768 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3769 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3770 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3771 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3772 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3773 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3774 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3775 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3776 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3777 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3778 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3779 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3780 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3781 (REG_FIXED): Renamed from REGS_FIXED.
3782 (REG_NREGS): Renamed from RE_NREGS.
3784 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3785 of other REG_* macros, since POSIX says the user is allowed to
3786 #undef these macros selectively.
3788 (reg_errcode_t): Update comment stating what other tables need
3791 Rename the following enum values to obey POSIX requirements.
3792 The old names are still visible as macros.
3793 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3794 is not defined, since GNU is supposed to be a superset of POSIX as
3795 much as possible, and since we want reg_errcode_t to be a signed
3796 type for implementation consistency.
3797 (_REG_NOERROR): Renamed from REG_NOERROR.
3798 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3799 (_REG_BADPAT): Renamed from REG_BADPAT.
3800 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3801 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3802 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3803 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3804 (_REG_EBRACK): Renamed from REG_EBRACK.
3805 (_REG_EPAREN): Renamed from REG_EPAREN.
3806 (_REG_EBRACE): Renamed from REG_EBRACE.
3807 (_REG_BADBR): Renamed from REG_BADBR.
3808 (_REG_ERANGE): Renamed from REG_ERANGE.
3809 (_REG_ESPACE): Renamed from REG_ESPACE.
3810 (_REG_BADRPT): Renamed from REG_BADRPT.
3811 (_REG_EEND): Renamed from REG_EEND.
3812 (_REG_ESIZE): Renamed from REG_ESIZE.
3813 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3814 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3815 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3816 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3817 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3819 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3820 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3821 changed. But support the old name if the new one is not defined
3822 and if _REGEX_SOURCE.
3824 Change the following member names in struct re_pattern_buffer.
3825 The old names are still supported if !_REGEX_SOURCE.
3826 The new names are always supported, regardless of _REGEX_SOURCE.
3827 (re_buffer): Renamed from buffer.
3828 (re_allocated): Renamed from allocated.
3829 (re_used): Renamed from used.
3830 (re_syntax): Renamed from syntax.
3831 (re_fastmap): Renamed from fastmap.
3832 (re_translate): Renamed from translate.
3833 (re_can_be_null): Renamed from can_be_null.
3834 (re_regs_allocated): Renamed from regs_allocated.
3835 (re_fastmap_accurate): Renamed from fastmap_accurate.
3836 (re_no_sub): Renamed from no_sub.
3837 (re_not_bol): Renamed from not_bol.
3838 (re_not_eol): Renamed from not_eol.
3839 (re_newline_anchor): Renamed from newline_anchor.
3841 Change the following member names in struct re_registers.
3842 The old names are still supported if !_REGEX_SOURCE.
3843 The new names are always supported, regardless of _REGEX_SOURCE.
3844 (rm_num_regs): Renamed from num_regs.
3845 (rm_start): Renamed from start.
3846 (rm_end): Renamed from end.
3848 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3849 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3850 Prepend __ to parameter names.
3852 Undo yesterday's changes.
3854 2005-08-24 Jim Meyering <jim@meyering.net>
3856 Sync from coreutils.
3857 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3859 2005-08-21 Bruno Haible <bruno@clisp.org>
3861 * lock.h: Add multiple inclusion guard.
3862 * tls.h: Add multiple inclusion guard.
3864 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3866 * regex.h (REG_NOSYS)
3867 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3868 Define, since POSIX requires it as of 2001.
3869 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3870 New private symbol, used to keep the enum signed in all cases.
3871 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3872 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3874 * regex_internal.c (re_string_skip_chars, register_state):
3876 Remove forward decls; no longer needed now that we use prototypes.
3877 * regexec.c (acquire_init_state_context, check_halt_node_context):
3878 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3879 (clean_state_log_if_needed): Likewise.
3881 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3883 Fix problems reported by Sam Steingold in
3884 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3885 * regexec.c (sift_states_bkref): Fix portability bug: the code
3886 assumed that reg_errcode_t is a signed type, which is not
3887 necessarily true if _XOPEN_SOURCE is not defined.
3888 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3889 some compilers warn about it otherwise.
3891 2005-08-20 Jim Meyering <jim@meyering.net>
3893 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3894 of unused local, dfa.
3896 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3898 * regcomp.c (create_initial_state): Remove duplicate decl.
3899 (init_word_char, create_initial_state, duplicate_node_closure):
3900 (fetch_token, peek_token_bracket, build_range_exp):
3901 (build_collating_symbol): Remove forward decls; no longer needed
3902 now that we use prototypes.
3905 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3906 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3907 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3908 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3909 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3910 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3911 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3912 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3913 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3914 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3915 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3916 (build_charclass, build_charclass_op, fetch_number, create_tree):
3917 (create_token_tree, mark_opt_subexp, duplicate_tree):
3918 Use prototypes rather than old-style definitions.
3921 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3922 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3923 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3924 (re_string_reconstruct, re_string_peek_byte_case):
3925 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3926 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3927 (re_node_set_init_copy, re_node_set_add_intersect):
3928 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3929 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3930 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3931 (re_acquire_state, re_acquire_state_context, register_state):
3932 (create_ci_newstate, create_cd_newstate, free_state):
3934 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3935 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3936 (re_search_internal, prune_impossible_nodes):
3937 (acquire_init_state_context, check_matching, static):
3938 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3939 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3940 (update_regs, sift_states_backward, build_sifted_states):
3941 (clean_state_log_if_needed, merge_state_array):
3942 (update_cur_sifted_state, add_epsilon_src_nodes):
3943 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3944 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3945 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3946 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3947 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3948 (check_arrival, check_arrival_add_next_nodes):
3949 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3950 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3951 (check_node_accept_bytes, check_node_accept, extend_buffers):
3952 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3953 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3958 (re_string_allocate, re_string_construct, re_string_reconstruct):
3959 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3960 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3961 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3962 (re_string_context_at, re_string_peek_byte_case):
3963 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3964 is defined, since we now use prototypes always.
3966 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3967 C89 or better. All uses removed.
3969 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3971 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3972 [defined lint]: Suppress bogus uninitialized-variable warnings.
3974 * regcomp.c (duplicate_node): Return new index, not an error code,
3975 and let the caller return REG_ESPACE if out of space. This
3976 removes an uninitialied-variable warning with GCC 4.0.1, and also
3977 avoids taking the address of a local variable. All callers
3980 2005-08-19 Jim Meyering <jim@meyering.net>
3982 * regexec.c (proceed_next_node): Redo local variables to
3983 avoid GCC shadowing warnings.
3985 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3987 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3988 (re_node_set_insert_last, re_dfa_add_node):
3989 Rename local variables to avoid GCC shadowing warnings.
3991 2005-08-18 Bruno Haible <bruno@clisp.org>
3993 * strstr.c (strstr): Fix return value in multibyte case.
3994 * strcasestr.c (strcasestr): Likewise.
3996 2005-08-17 Jim Meyering <jim@meyering.net>
3998 Make the %s format (seconds since the epoch) work for a negative
3999 number and when used with a zero-padded field width, e.g. %015s.
4001 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
4002 label so that it precedes the code to set `digits'. Otherwise,
4003 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
4004 print `00-22'. Now, it prints `-0022', as it should.
4006 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
4008 * regex.h: Remove useless space-before-tab. From coreutils.
4010 2005-08-17 Bruno Haible <bruno@clisp.org>
4012 * strcasestr.h: New file.
4013 * strcasestr.c: New file.
4015 2005-08-17 Bruno Haible <bruno@clisp.org>
4017 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4018 * strstr.c: Completely rewritten, with multibyte locale support.
4020 2005-08-17 Bruno Haible <bruno@clisp.org>
4022 * strcasecmp.c: Use mbuiter.h.
4024 2005-08-17 Bruno Haible <bruno@clisp.org>
4026 * mbuiter.h: New file.
4028 2005-08-16 Bruno Haible <bruno@clisp.org>
4030 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4032 (mbi_avail, mbi_advance): Let the iteration end before the terminating
4033 NUL byte, not after it.
4035 2005-08-16 Bruno Haible <bruno@clisp.org>
4037 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4038 the valid ones. Makes the comparison operations transitive:
4039 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4040 * strcasecmp.c (strcasecmp): Use mb_casecmp.
4042 2005-08-16 Bruno Haible <bruno@clisp.org>
4044 * strcase.h (strcasecmp): Add note in comments.
4045 * strncasecmp.c: Use code from strcasecmp.c.
4046 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4047 (strcasecmp): Work correctly in multibyte locales.
4049 2005-08-16 Bruno Haible <bruno@clisp.org>
4051 * strnlen1.h: New file.
4052 * strnlen1.c: New file.
4054 2005-08-16 Bruno Haible <bruno@clisp.org>
4056 * mbfile.h: New file.
4058 2005-08-16 Bruno Haible <bruno@clisp.org>
4060 * mbiter.h: New file.
4062 2005-08-16 Bruno Haible <bruno@clisp.org>
4064 * mbchar.h: New file.
4065 * mbchar.c: New file.
4067 2005-08-16 Bruno Haible <bruno@clisp.org>
4069 * tls.h: New file, from GNU gettext.
4070 * tls.c: New file, from GNU gettext.
4072 2005-08-15 Bruno Haible <bruno@clisp.org>
4074 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4077 2005-08-14 Jim Meyering <jim@meyering.net>
4079 Sync from coreutils.
4081 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4082 Use the hash-table-based cycle-detection code not just when
4083 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4084 Reported by James Youngman in
4085 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4086 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4087 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4088 This lets us compile with -DFTS_DEBUG, once again.
4089 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4090 * fts.c (fd_safer): Remove decl.
4091 Include fcntl--.h rather than unistd-safer.h
4092 (fts_safe_changedir): Don't call fd_safer; no longer needed
4093 now that we include fcntl--.h.
4095 2005-08-11 Simon Josefsson <jas@extundo.com>
4097 * readline.h, readline.c: New file.
4099 2005-08-11 Bruno Haible <bruno@clisp.org>
4101 * strnlen.h (strnlen): Change parameter name to match comment.
4103 2005-08-10 Simon Josefsson <jas@extundo.com>
4105 * strndup.c: Use strnlen.h.
4107 * strnlen.h: New file.
4109 2005-08-02 Simon Josefsson <jas@extundo.com>
4111 * getline.h, getline.c: Rewrite.
4113 * getdelim.h, getdelim.c: New files, ported from glibc.
4115 2005-07-31 Bruno Haible <bruno@clisp.org>
4117 * lock.h (gl_lock_initializer): New macro.
4118 (gl_lock_define_initialized): Use it.
4119 (gl_rwlock_initializer): New macro.
4120 (gl_rwlock_define_initialized): Use it.
4121 (gl_recursive_lock_initializer): New macro.
4122 (gl_recursive_lock_define_initialized): Use it.
4124 2005-07-26 Bruno Haible <bruno@clisp.org>
4126 * lock.h: Update from GNU gettext.
4127 * lock.c: Update from GNU gettext.
4129 2005-07-18 Bruno Haible <bruno@clisp.org>
4131 * lock.h (gl_once_t): New type.
4132 (gl_once_define, gl_once): New macros.
4133 * lock.c (fresh_once): New variable.
4134 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4137 2005-07-18 Simon Josefsson <jas@extundo.com>
4139 * check-version.c (check_version): Accept identical versions too.
4141 2005-07-18 Bruno Haible <bruno@clisp.org>
4143 * lock.h: New file, from GNU gettext.
4144 * lock.c: New file, from GNU gettext.
4146 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4148 * quotearg.c: Add translator comment suggested by Bruno Haible,
4149 with a minor change.
4151 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4153 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4154 copyright symbol and the year.
4155 * version-etc.c (COPYRIGHT_YEAR): New constant.
4156 (version_etc_va): Use parameterized copyright notice.
4157 Reword to conform to the current GNU coding standards.
4159 2005-07-11 Simon Josefsson <jas@extundo.com>
4161 * size_max.h: New file.
4163 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4165 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4168 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4169 and Paul Eggert <eggert@cs.ucla.edu>
4171 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4172 in wint_t, not wchar_t. Remove now-unnecessary cast.
4174 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4176 * regex.c, regex.h: Sync from libc.
4177 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4178 New files, synced from libc, except that regex_internal.h
4179 currently has a small porting fix.
4181 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4183 Remove the dependency of the strftime module on the tzset module.
4184 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4185 Copy the input structure, to work around some of the bug with
4186 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4187 Solaris releases, you should also use the tzset module, but we won't
4188 require it as a dependency any more since we don't want LGPLed code
4189 to depend on GPLed code.
4191 2005-07-02 Jim Meyering <jim@meyering.net>
4193 * backupfile.c (backup_args): Change a `0' to NULL.
4195 2005-07-01 Jim Meyering <jim@meyering.net>
4197 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4198 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4199 * save-cwd.c, tempname.c:
4200 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4201 and don't include <sys/file.h>).
4203 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4205 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4206 declares only 'struct timespec;' (!).
4208 2005-06-29 Jim Meyering <jim@meyering.net>
4210 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4211 type name. Use the variable name instead.
4212 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4214 2005-06-28 Simon Josefsson <jas@extundo.com>
4216 * check-version.h, check-version.c: New files.
4218 2005-06-28 Simon Josefsson <jas@extundo.com>
4220 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4221 collision with global variable. Better indentation. Don't
4222 increment buffer pointer beyond buffer end. Based on comments
4223 from Paul Eggert <eggert@cs.ucla.edu>.
4227 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4229 * canon-host.c (canon-host): Append trailing "," to 0 in
4230 initializer of struct addrinfo, as an indication that we don't
4231 care how many members the structure has.
4233 2005-06-24 Derek Price <derek@ximbiot.com>
4234 and Bruno Haible <bruno@clisp.org>
4236 Remove stat module & update lstat.
4237 * stat.c: Remove this file...
4238 (slash_aware_lstat): ...moving this content and its support...
4239 * lstat.c (rpl_lstat): ...into here.
4240 * lstat.h: New file.
4242 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4244 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4245 (ranged_convert): Don't save conversion in a temporary struct.
4246 This causes a warning with GCC 4.0.0, and anyway in the typical
4247 case it's not worth the extra 100 bytes or so of code.
4248 (ranged_convert, __mktime_internal): When calling a function via a
4249 pointer P, use P () rather than (*P) (), as we now assume C89 or
4252 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4254 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4255 "who -r" failed to give output. Problem reported by Tim Waugh.
4257 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4258 (xcalloc): Use it to avoid needless tests.
4259 Problem reported by Jim Meyering.
4261 2005-06-16 Jim Meyering <jim@meyering.net>
4263 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4264 when either N or S is zero.
4266 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4268 * argp.h (__option_is_short): Check upper limit of
4269 __key. Isprint() requires its argument to have the value
4270 of an unsigned char or EOF.
4272 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4274 * fnmatch.c (fnmatch): If there is an encoding error in a
4275 multibyte string or pattern, fall back on unibyte matching.
4276 Problem reported by James Youngman.
4278 2005-06-08 Bruno Haible <bruno@clisp.org>
4280 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4283 2005-06-08 Bruno Haible <bruno@clisp.org>
4285 * csharpcomp.h: New file, from GNU gettext.
4286 * csharpcomp.c: New file, from GNU gettext.
4287 * csharpcomp.sh.in: New file, from GNU gettext.
4289 2005-06-07 Derek Price <derek@ximbiot.com>
4292 * glob_.h: Indent nested #ifdef.
4294 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4296 Sync from coreutils.
4297 Use "file name" when talking about file names, instead of "filename"
4298 or "path", as per the GNU coding standards.
4299 * mkdir-p.c: Renamed from makepath.c.
4300 (make_dir_parents): Renamed from make_path. All callers changed.
4301 * mkdir-p.h: Likewise. All includers changed.
4302 * filenamecat.c: Renamed from path-concat.c.
4303 (file_name_concat): Renamed from path_concat. All callers changed.
4304 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4305 * filenamecat.h: Likewise. All includers changed.
4306 * acl.c: Don't use "path" or "filename" to mean "file name"
4307 in comments or local variable names.
4308 * basename.c: Likewise.
4309 * canonicalize.c, canonicalize.h: Likewise.
4310 * dirname.c, dirname.h: Likewise.
4311 * euidaccess.c: Likewise.
4312 * exclude.c: Likewise
4313 * fnmatch_.h, fnmatch_loop.c: Likewise.
4314 * fsusage.c, fsuage.h: Likewise.
4315 * fts.c, fts_.h: Likewise.
4316 * getcwd.c: Likewise.
4317 * getloadavg.c: Likewise.
4318 * mkstemp.c: Likewise.
4319 * mountlist.c, mountlist.h: Likewise.
4320 * openat.c, openat.h: Likewise.
4321 * readlink-stub.c: Likewise.
4322 * readutmp.c, readutmp.h: Likewise.
4323 * rename.c: Likewise.
4324 * rmdir.c: Likewise.
4326 * savedir.c: Likewise.
4327 * stripslash.c: Likewise.
4328 * tempname.c: Likewise.
4329 * xreadlink.c: Likewise.
4330 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4332 * exclude.h: Likewise.
4334 * euidaccess.c (getuid, getgid, getuid, getegid)
4335 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4336 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4337 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4338 * pathmax.h: Include <limits.h> unconditionally, since other
4339 files have been getting away with it for years (MORE/BSD 4.3
4341 * userspec.c (getpwnam, getgrnam, getgrgid)
4342 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4344 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4345 Define to 256, not 255, as per modern POSIX.
4347 2005-06-01 Bruno Haible <bruno@clisp.org>
4349 * csharpexec.h: New file, from GNU gettext.
4350 * csharpexec.c: New file, from GNU gettext.
4351 * csharpexec.sh.in: New file, from GNU gettext.
4353 2005-05-31 Derek Price <derek@ximbiot.com>
4354 Paul Eggert <eggert@cs.ucla.edu>
4357 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4359 2005-05-29 Derek Price <derek@ximbiot.com>
4360 Paul Eggert <eggert@cs.ucla.edu>
4362 * glob_.h, glob.c: New files.
4364 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4366 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4368 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4369 the configuration hassle isn't worth it.
4370 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4371 (LONGEST_MODIFIER, PRIuMAX): Remove.
4373 2005-05-27 Bruno Haible <bruno@clisp.org>
4375 * getlogin_r.h: Remove second include of <stddef.h>.
4377 2005-05-25 Bruno Haible <bruno@clisp.org>
4378 Derek Price <derek@ximbiot.com>
4380 * getlogin_r.h: Simplify API documentation.
4382 2005-05-25 Derek Price <derek@ximbiot.com>
4383 Paul Eggert <eggert@cs.ucla.edu>
4385 * getlogin_r.c, getlogin_r.h: New files.
4387 2005-05-22 Bruno Haible <bruno@clisp.org>
4389 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4390 Also include <sys/param.h> if it defines MIN, MAX.
4391 Based on a patch by Derek Price <derek@ximbiot.com>.
4393 2005-05-22 Bruno Haible <bruno@clisp.org>
4395 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4396 (INT64_MIN): Fix definition.
4397 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4399 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4400 NEED_SIGNED_INT_TYPES.
4402 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4403 HAVE_SYSTEM_INTTYPES.
4405 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4407 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4408 so that unistd-safer.h (GPL'ed code) need not be included.
4410 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4413 * fts.c: Don't include "cycle-check.h" or "hash.h".
4414 (setup_dir, free_dir): New functions.
4415 (enter_dir, leave_dir): Define trivial
4416 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4417 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4418 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4419 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4420 Move to fts-cycle.c.
4421 (fts_open): Use setup_dir.
4422 (fts_close): Use free_dir.
4423 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4424 This adds a label and some gotos, but the alternatives were messier.
4425 Check for memory allocation failure when entering a dir.
4426 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4427 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4428 (FTS): New member fts_cycle, that is a union that contains the
4429 old active_dir_ht and cycle_state. All uses changed to mention
4430 fts_cycle.ht and fts_cycle.state.
4431 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4432 fts.c, with the following changes:
4433 (setup_dir, free_dir): New functions.
4434 (enter_dir): Now returns bool. Return true if successful, false
4435 if memory exhausted. All callers changed.
4436 Do not bother partly cleaning up on
4437 memory allocation failure; that is free_dir's job.
4438 However, free ad if hash_insert fails, to avoid memory leak.
4439 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4440 fts->fts_options to see which union member to use.
4442 2005-05-20 Jim Meyering <jim@meyering.net>
4444 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4445 Now a macro, to pacify GCC.
4447 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4449 * chown.c (rpl_chown): Return -1 on failure.
4451 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4453 * canonicalize.c: Include canonicalize.h first, to test interface.
4454 Include <stddef.h> unconditionally, since we assume C89 now.
4455 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4456 * fts.c: Include fts_.h first, to check interface.
4457 Do not include intprops.h; no longer needed.
4458 Include cycle-check.h and hash.h, since fts_.h no longer does.
4459 Remove unnecessary casts of closedir to void.
4460 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4461 decide whether to decrement nlinks.
4462 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4463 (FTS): Use struct hash_table * instead of Hash_table, so that
4464 we no longer need to include hash.h here.
4466 2005-05-17 Jim Meyering <jim@meyering.net>
4468 * fts.c, fts_.h: New files, from coreutils.
4470 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4472 Sync from coreutils.
4473 * unlinkdir.c, unlinkdir.h: New files.
4474 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4475 regex.h, unlocked-io.h, xtime.h:
4476 White space changes only.
4477 * makepath.c (make_path): Port to hosts where leading "//" is special.
4478 * yesno.c: Include getline.h, not ctype.h.
4479 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4480 Use getline to remove arbitrary restriction on response length.
4482 2005-05-13 Bruno Haible <bruno@clisp.org>
4484 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4485 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4486 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4487 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4488 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4489 Add support for 64-bit integers in the MSVC compiler.
4491 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4493 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4494 Change the initial comment to refer to GPL, not LGPL.
4495 gnulib-tool will change it to LGPL as needed.
4497 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4498 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4499 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4500 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4501 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4502 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4503 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4504 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4505 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4506 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4507 concatpath.c, config.charset, copy-file.c, copy-file.h,
4508 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4509 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4510 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4511 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4512 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4513 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4514 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4515 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4516 full-read.c, full-read.h, full-write.c, full-write.h,
4517 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4518 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4519 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4520 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4521 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4522 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4523 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4524 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4525 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4526 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4527 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4528 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4529 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4530 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4531 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4532 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4533 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4534 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4535 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4536 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4537 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4538 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4539 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4540 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4541 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4542 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4543 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4544 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4545 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4546 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4547 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4548 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4549 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4550 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4551 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4552 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4553 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4554 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4555 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4556 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4557 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4558 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4559 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4560 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4561 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4562 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4563 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4564 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4565 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4566 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4567 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4568 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4569 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4570 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4571 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4572 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4573 Update FSF postal mail address.
4575 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4577 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4578 specified in ai_socktype. Fix invalid ai_protocol
4579 check. ai_protocol is usually set to 0 or depending on
4580 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4581 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4582 ai_socktype / ai_protocol in the returned addrinfo structure.
4584 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4585 Bruno Haible <bruno@clisp.org>
4587 * inet_ntop.h: New file.
4588 * inet_ntop.c: New file, from glibc with modifications.
4590 2005-05-08 Jim Meyering <jim@meyering.net>
4592 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4594 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4596 Merge from coreutils. Among other things,
4597 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4598 * fd-safer.c: New file.
4599 * fcntl-safer.h, open-safer.c: Remove.
4600 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4601 * dup-safer.c: Include unistd-safer.h first.
4602 Don't include errno.h.
4603 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4604 * file-type.h: Don't assume invoker included sys/stat.h first.
4605 * file-type.c: Rely on file-type.h change.
4606 * getloadavg.c: Include unistd-safer.h.
4607 (getloadavg): Use safer open.
4608 * getusershell.c: Include "stdio-safer.h".
4609 (getusershell): Use safer fopen.
4610 * long-options.c (long_options): Use NULL rather than 0.
4611 * modechange.h (mode_free): Remove; all callers changed to invoke
4613 * modechange.c: Likewise.
4614 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4615 (MODE_DONE): New constant.
4616 (struct mode_change): Remove 'next' member.
4617 (make_node_op_equals): New function; like the old one of the
4618 same name, except it allocates an array.
4619 (mode_compile, mode_create_from_ref): Use it.
4620 (mode_compile): Allocate result as an array, not a linked list.
4621 Parse octal string ourself, so that we catch mistakes like "+0".
4622 (mode_adjust): Arg is an array, not a linked list.
4623 * modechange.c: Include stat-macros.h, xalloc.h.
4624 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4625 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4626 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4627 Remove. This is now stat-macros.h's job.
4628 (talloc): Remove. All callers replaced by xalloc, so that
4629 our invokers don't have to worry about reporting memory failures.
4630 (make_node_op_equals): Remove.
4631 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4633 (struct mode_change): Moved here from modechange.h.
4634 (mode_append_entry): Remove.
4635 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4636 apps to have incorrect behavior. Use simpler algorithm for head
4637 and tail. Don't futz with umask; that's now the job of mode_adjust.
4638 Detect more invalid usages rather than having somewhat-random behavior.
4639 Don't insert an "a=" action, as that leads to incorrect behavior.
4640 (mode_compile, mode_create_from_ref): Return NULL on error instead
4641 of an enum, since now there's only one way to have an error. All
4643 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4644 at the correct time. Simplify calculation of "+u" and its ilk.
4645 Don't mishandle "+X".
4646 (mode_free): Remove "register" and localize decls.
4647 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4648 (struct mode_change): Move to modechange.c; callers don't
4649 need to see this stuff.
4650 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4651 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4652 (mode_change, mode_adjust): Reflect the new signatures noted above.
4653 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4654 that might redefine system include files.
4655 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4656 (my_usleep): Use NULL rather than (void *) 0.
4657 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4658 Use siginterrupt to specify that system calls should be interrupted.
4659 (rpl_nanosleep): Move initialization of suspended closer to call of
4661 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4662 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4663 (desirable_utmp_entry): New function.
4664 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4665 using x2nrealloc, to simplify logic.
4666 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4667 size calculation. Do not assume utmp file is a regular file.
4668 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4669 (READ_UTMP_CHECK_PIDS): New constant.
4670 * save-cwd.c: Include unistd-safer.h.
4671 (save_cwd): Use fd_safer.
4672 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4673 [!_LIBC] Include "stat-macros.h" instead.
4674 * unistd-safer.h (fd_safer): New decl.
4676 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4678 * byteswap_.h: New file.
4680 2005-04-25 Albert Chin <china@thewrittenword.com>
4682 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4685 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4687 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4688 that "UTC +1 second" continues to work. Problem reported
4690 (relunit_snumber): New rule.
4693 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4695 * getdate.y (universal_time_zone_table): New constant.
4696 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4697 universal_time_zone_table.
4698 (lookup_zone): Prefer universal_time_zone_table to
4699 local_time_zone_table, so that "GMT" time stamps are allowed in
4700 London during the summer. Problem reported by Ian Abbott.
4702 2005-04-12 Jim Meyering <jim@meyering.net>
4704 * human.c (humblock): Set *options even when returning due to
4705 xstrtoumax conversion failure. Thanks to a used-uninitialized
4708 2005-04-09 Jim Meyering <jim@meyering.net>
4710 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4711 -Wuninitialized: initialize tm0.tm_year.
4713 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4715 * getdate.y (parser_control): rels_seen is now a boolean, not a
4716 count, since there's no maximum. All uses changed.
4717 Add member dsts_seen.
4718 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4720 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4721 Use pc_rels_seen to decide whther a date is absolute.
4723 * getdate.y (number): Don't overwrite year.
4724 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4727 2005-04-02 Simon Josefsson <jas@extundo.com>
4729 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4730 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4732 2005-03-27 Jim Meyering <jim@meyering.net>
4734 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4736 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4738 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4739 "one's complement" -> "ones' complement" in comment, as per Knuth.
4740 "value of type" -> "type or expression" in comment.
4741 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4743 2005-03-26 Jim Meyering <jim@meyering.net>
4746 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4747 Correct typos: s/or/of/.
4749 2005-03-23 Jim Meyering <jim@meyering.net>
4751 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4753 2005-03-21 Jim Meyering <jim@meyering.net>
4755 Changes imported from coreutils.
4757 * cycle-check.c: Don't include xalloc.h.
4759 * path-concat.c: Don't include assert.h.
4760 (path_concat): Remove assertion that would have triggered
4761 for ABASE starting with more than one slash.
4762 Reported by Andreas Schwab.
4764 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4765 properly when ABASE is an absolute file name.
4766 Correct the description of this function.
4768 Add an assertion and a test driver.
4769 This fixes a bug introduced on 2004-07-02.
4770 Andreas Schwab reported the resulting failure of cp --parents:
4771 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4773 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4775 * strftime.c (my_strftime): If the underlying strftime returns 0
4776 (which shouldn't happen), generate nothing instead of returning 0
4777 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4779 2005-03-16 Bruno Haible <bruno@clisp.org>
4781 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4783 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4785 * strftime.c (my_strftime): Prepend space to format so that we can
4786 reliably distinguish strftime failure from empty output on POSIX
4789 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4791 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4792 (iconv_string): Don't guess a size-zero buffer, as that might cause
4793 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4794 result would be 'too large', where 'too large' is (heuristically)
4795 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4796 overflow concerns. This will prevent some unwanted malloc failures
4797 when the inputs are very large.
4799 2005-03-15 Bruno Haible <bruno@clisp.org>
4801 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4804 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4807 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4809 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4811 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4812 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4814 * strtol.c: Likewise.
4816 2005-03-14 Simon Josefsson <jas@extundo.com>
4818 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4821 2005-03-14 Jim Meyering <jim@meyering.net>
4823 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4824 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4825 to be nonzero so that we (and caller) can detect the difference
4826 between a valid zero-length expansion and an error return, even
4827 when the underlying strftime fails before writing anything into
4830 2005-03-10 Jim Meyering <jim@meyering.net>
4832 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4833 so that this module works on systems without fchdir.
4835 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4837 Factor int-properties macros into a single file, except for
4838 glibc-related files.
4839 * intprops.h: New file.
4840 * getloadavg.c: Include it instead of limits.h.
4841 (INT_STRLEN_BOUND): Remove.
4842 * human.c: Include intprops.h.
4843 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4844 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4845 * inttostr.h: Include intprops.h instead of limits.h.
4846 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4847 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4848 for consistency with intprops.h.
4849 (time_t_is_integer, twos_complement_arithmetic): Use them.
4850 * sig2str.h: Include <signal.h>, intprops.h.
4851 (INT_STRLEN_BOUND): Remove.
4852 * strftime.c (TYPE_SIGNED): Remove.
4853 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4854 * strtol.c: Adjust comments to match intprops.h.
4855 * userspec.c: Include intprops.h.
4856 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4857 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4858 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4859 instead of rolling our own expressions.
4860 * xstrtol.c: Include xstrtol.h first, to test interface.
4862 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4864 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4865 the right thing even if adding 1900 would overflow. Similarly
4866 for tm_mon + 1 and tm_yday + 1.
4867 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4868 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4869 (DO_SIGNED_NUMBER): New macro.
4870 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4872 2005-03-07 Bruno Haible <bruno@clisp.org>
4874 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4876 2005-03-03 Derek R. Price <derek@ximbiot.com>
4877 Bruno Haible <bruno@clisp.org>
4879 * pagealign_alloc.h: New file.
4880 * pagealign_alloc.c: New file.
4882 2005-01-28 Bruno Haible <bruno@clisp.org>
4884 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4887 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4889 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4890 The workaround isn't strictly needed for POSIX conformance, and
4891 it's too much of a pain to configure and maintain. We'll ask
4892 people to fix their kernels instead.
4893 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4894 (NANOSLEEP_BUG_WORKAROUND): Remove.
4895 (xnanosleep): Remove the workaround.
4897 2005-02-12 Bruno Haible <bruno@clisp.org>
4899 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4901 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4903 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4904 * timespec.h (gettime): Return void, since it always
4905 succeeds now. All uses changed.
4906 * gettime.c (gettime) Likewise.
4907 [HAVE_NANOTIME]: Prefer nanotime.
4908 Assume gettimeofday succeeds, as POSIX requires.
4909 Assime time () succeeds, since other code already does.
4910 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4911 (timespec_subtract): Remove.
4912 (NANOSLEEP_BUG_WORKAROUND): New constant.
4913 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4914 things considerably. Use it only on GNU/Linux hosts, since the
4915 workaround shouldn't be needed elsewhere.
4917 2005-02-24 Bruno Haible <bruno@clisp.org>
4919 * gettext.h: Update from GNU gettext 0.14.2.
4921 2005-02-24 Bruno Haible <bruno@clisp.org>
4923 * localcharset.c: Update from GNU gettext 0.14.2.
4924 * config.charset: Update from GNU gettext 0.14.2.
4926 2005-02-22 Simon Josefsson <jas@extundo.com>
4928 * iconvme.h, iconvme.c: New files, from libc.
4930 2005-02-20 Neil Conway <neilc@samurai.com>
4932 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4933 returned by OSX/Darwin if the specified buffer is not large
4934 enough for the hostname.
4936 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4938 * memrchr.h: New file.
4939 * chdir-long.c: Include it.
4940 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4941 Don't bother including stddef.h.
4943 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4945 * argp-help.c (__argp_help): Create a fake struct argp_state and
4946 pass it to _help, otherwise the latter coredumps trying to
4947 dereference state.root_argp.
4949 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4951 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4953 Include <sys/types.h>, for dev_t.
4954 (ME_DUMMY, ME_REMOTE): Move from here....
4955 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4956 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4958 Include mountlist.h first, to test the interface.
4960 2005-01-29 Bruno Haible <bruno@clisp.org>
4962 * progname.c (program_name): Initialize.
4963 Needed when linking statically on MacOS X.
4965 2005-01-28 Bruno Haible <bruno@clisp.org>
4967 * javacomp.sh.in: New file, from GNU gettext.
4968 * javacomp.h: New file, from GNU gettext.
4969 * javacomp.c: New file, from GNU gettext.
4971 2005-01-26 Bruno Haible <bruno@clisp.org>
4973 * javaexec.sh.in: New file, from GNU gettext.
4974 * javaexec.h: New file, from GNU gettext.
4975 * javaexec.c: New file, from GNU gettext.
4977 2005-01-26 Simon Josefsson <jas@extundo.com>
4979 * gai_strerror.c: Use GPL in header.
4981 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4983 * argp-help.c (hol_entry_help): Avoid using non-constant
4984 initializers for struct pentry_state.
4985 (__argp_error): Check return value of __asprintf
4986 (__argp_failure): Translate error message
4988 * argp-parse.c: Removed braces around the expansion of N_()
4990 2005-01-21 Jim Meyering <jim@meyering.net>
4992 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4993 same value as for Solaris 9.
4995 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4996 component length. This included changing the parameter to be
4997 of type `char *' rather than `char const *'.
4998 * chdir-long.h (chdir_long): Update prototype.
5000 * openat.c (fdopendir, fstatat): New functions.
5001 * openat.h: Include headers required for use of DIR and struct stat.
5002 [AT_SYMLINK_NOFOLLOW]: Define.
5003 (fdopendir, fstatat): Add prototypes.
5005 2005-01-21 Bruno Haible <bruno@clisp.org>
5007 * classpath.h: New file, from GNU gettext.
5008 * classpath.c: New file, from GNU gettext.
5010 2005-01-20 Simon Josefsson <jas@extundo.com>
5012 * version-etc-fsf.c: New file, with version_etc_copyright.
5013 * version-etc.c: Remove version_etc_copyright.
5014 * version-etc.h (version_etc_copyright): Use [] instead of * in
5015 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5017 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
5019 * save-cwd.c (save_cwd): Remove code to support the case
5020 where fchdir is missing or flaky.
5022 2005-01-20 Simon Josefsson <jas@extundo.com>
5024 * base64.h (isbase64): Add.
5026 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5027 using a unsigned prototype, don't inline.
5028 (base64_decode): Use it.
5030 2005-01-19 Bruno Haible <bruno@clisp.org>
5032 * sh-quote.h: New file, from GNU gettext.
5033 * sh-quote.c: New file, from GNU gettext.
5035 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
5037 Merge changes from coreutils, as described below in several
5038 changelogs dated today.
5040 * save-cwd.c: Include "save-cwd.h" before other include files.
5041 (O_DIRECTORY): Remove; not needed here, since "." must be
5042 a directory. All uses removed.
5043 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
5044 universal on Suns, and we also need to test for IRIX.
5045 Revamp code to use 'if' rather than '#if'.
5046 Avoid unnecessary comparison of cwd->desc to 0.
5048 * utimens.c (futimens): Robustify the previous patch, by checking
5049 for known valid error numbers rather than observed invalid ones.
5051 2005-01-18 Jim Meyering <jim@meyering.net>
5053 * version-etc.c (version_etc_copyright): Update copyright date.
5055 * utimens.c (futimens): Account for the fact that futimes
5056 can also fail with errno == ENOSYS or errno == ENOENT.
5057 Patch from Dmitry V. Levin.
5059 Change the name of the robust chdir function from chdir to chdir_long.
5060 * save-cwd.c: Include chdir-long.h rather than chdir.h.
5061 (restore_cwd): Use chdir_long, not chdir.
5062 * chdir-long.c: Renamed from chdir.c.
5063 * chdir-long.h: Renamed from chdir.h.
5064 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5067 2005-01-18 Bob Proulx <bob@proulx.com>
5069 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5070 offsetof() macro construct to avoid compile failure with native HP-UX
5071 11.0 ANSI C compiler.
5073 2005-01-06 Bruno Haible <bruno@clisp.org>
5075 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5076 because stpncpy.m4 takes care of it.
5078 2004-01-24 Bruno Haible <bruno@clisp.org>
5080 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5082 2003-10-09 Bruno Haible <bruno@clisp.org>
5084 * progreloc.c: Include xalloc.h instead of xmalloc.h.
5086 2005-01-06 Bruno Haible <bruno@clisp.org>
5088 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5089 * fwriteerror.c: Include <stdbool.h>.
5090 (fwriteerror): At the end, close the file stream. Record whether
5091 stdout was already closed.
5093 2004-05-27 Bruno Haible <bruno@clisp.org>
5095 * execute.c (environ): Declare if needed.
5096 * pipe.c (environ): Likewise.
5097 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5099 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5101 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5102 definitions to be after all include files, to avoid collisions.
5103 Problem reported by Bob Proulx.
5105 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5107 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5108 not needed. This removes a dependency on the gettext module.
5109 [defined _LIBC]: Do not include <libintl.h>; not needed.
5111 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5113 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5116 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5118 * argp-parse.c: Include <stddef.h>.
5119 (alignof, alignto): New macros.
5120 (parser_init): Don't assume that void * is aligned sufficiently
5123 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5124 need to extend the stack.
5125 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5128 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5130 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5132 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5134 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5135 Remove now-obsolete comment about AIX.
5136 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5137 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5138 (YYMAXDEPTH): New macro.
5140 2004-12-18 Bruno Haible <bruno@clisp.org>
5142 * fatal-signal.c (fatal_signals): Make non-const.
5143 (init_fatal_signals): New function.
5144 (uninstall_handlers, install_handlers): Ignore signals that were set to
5146 (at_fatal_signal): Call init_fatal_signals.
5147 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5149 Reported by Paul Eggert.
5151 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5153 * getdate.y (textint): New member "negative".
5154 (time_zone_hhmm): New function.
5155 Expect 14 shift-reduce conflicts, not 13.
5156 (o_colon_minutes): New rule.
5157 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5158 (yylex): Set the "negative" member of signed numbers.
5160 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5162 Changes imported from coreutils.
5163 * hard-locale.c: Assume <locale.h> exists.
5165 (GLIBC_VERSION): New macro.
5166 (hard_locale): Assume setlocale exists.
5167 Rewrite to avoid #ifdef.
5168 Use strdup rather than malloc + strcpy.
5169 * human.c: Assume <locale.h> exists.
5170 (human_readable): Assume localeconv exists.
5172 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5174 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5175 convert T2, not T. (Imported from libc.)
5177 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5179 * getcwd.c (is_ENAMETOOLONG): New macro.
5180 (__getcwd.c): Don't restore errno; glibc doesn't.
5181 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5182 first, falling back to our code only if its results look suspicious.
5183 Ensure that the resulting buffer is only as large as necessary.
5185 * readutmp.c: Include readutmp.h first.
5186 Include <errno.h>, since readutmp.h no longer does that.
5187 * readutmp.h: Don't include <errno.h>,
5188 <sys/param.h>, <time.h>; not needed to establish interface.
5189 (errno): Remove decl.
5190 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5191 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5192 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5194 2004-11-28 Simon Josefsson <jas@extundo.com>
5196 * base64.h, base64.c: New file.
5198 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5200 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5202 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5204 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5205 HP's ANSI C compiler.
5206 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5207 Declaring int functions causes warnings on some modern systems and
5208 shouldn't be needed to compile on ancient ones.
5209 * same.c (MIN) [defined MIN]: Don't define, since it's already
5212 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5213 with the following changes.
5214 (__set_errno): Parenthesize properly.
5215 Include <stdbool.h>.
5216 (MIN, MAX, MATCHING_INO): New macros.
5217 (__getcwd): Define with prototype, not K&R form.
5218 Use heuristics to allocate default buffer on stack if possible.
5219 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5220 behavior, and to avoid the PATH_MAX limit when computing
5222 Use MATCHING_INO to compare inode number to file.
5223 Check for arithmetic overflow in size calculations.
5224 Fix bug in reallocation of dot array that caused getcwd to fail
5225 on directories nested deeper than 75.
5226 Be more careful about saving errno on error.
5227 Do not use realloc; use only free+malloc, as this is a bit
5228 more flexible and avoids a needless copy operation.
5229 Do not inspect st_dev and st_ino for symbolic links; POSIX
5230 doesn't specify the latter.
5231 Check for closedir errors.
5232 Avoid needless casts.
5233 Use "#ifdef weak_alias" around weak_alias, to be like other
5235 The following changes to getcwd.c have effect only when used in
5236 gnulib; they have no effect inside glibc proper.
5237 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5238 as alloca isn't used.
5239 (alloca, __alloca): Likewise.
5240 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5241 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5242 unconditionally, as gnulib assumes C89 or better.
5243 Do not include <sys/param.h>.
5244 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5245 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5247 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5248 Include <dirent.h> in a way that is compatible with modern Autoconf.
5249 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5250 New macros, if not already defined.
5251 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5252 Use "_LIBC", not "defined _LIBC", for consistency.
5253 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5255 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5256 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5257 * xgetcwd.c: David MacKenzie's old code was removed, so give
5258 credit only to Jim Meyering and adjust the copyright dates.
5259 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5260 <stdlib.h>, <unistd.h>, "pathmax.h".
5261 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5262 (INITIAL_BUFFER_SIZE): Remove.
5263 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5265 2004-11-23 Jim Meyering <jim@meyering.net>
5267 * getopt_.h: Remove trailing blanks.
5269 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5271 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5272 (futimens): New function, which uses futimes if available.
5273 (futimens, utimens): Support timespec==NULL, with same semantics
5274 as utime and utimens.
5275 * utimens.h (futimens): New decl.
5277 2004-11-23 Jim Meyering <jim@meyering.net>
5279 * __fpending.c: Add comment.
5281 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5283 * getopt_.h: Re-addition of __getopt_argv_const caused
5284 redefinition warnings. To avoid them, include the defines
5285 in `#if !defined __need_getopt ... #endif'. The only place
5286 where __getopt_argv_const is used is in definitions
5287 of getopt_long and getopt_long_only below, which are as well
5288 protected by `#ifndef __need_getopt'.
5289 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5290 __need_getopt after including <stdio.h> and <unistd.h> These
5291 headers might have defined it.
5293 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5295 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5297 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5298 optopt): Use them instead of invoking ## directly; otherwise, the
5299 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5301 2004-11-19 Bruno Haible <bruno@clisp.org>
5303 * strtok_r.c: Move comments from here...
5304 * strtok_r.h: ... to here.
5306 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5308 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5309 might fail. Problem reported by Yoann Vandoorselaere.
5310 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5311 that mishandle size_t overflow.
5313 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5315 * canon-host.c: Include "strdup.h".
5316 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5317 Use strdup instead of malloc/strcpy to duplicate strings.
5319 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5320 (human_space_before_unit): New constant.
5321 * human.c (human_readable): Support it.
5323 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5324 (xgetcwd): Set errno correctly when failing.
5325 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5326 the failure is actually due to a PATH_MAX problem.
5328 Further getopt changes to make it more likely that glibc will
5329 buy the changes back.
5330 * getopt.c (POSIXLY_CORRECT): New constant.
5331 (getopt): Use it, so to preserve glibc semantic
5332 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5333 when compiling for libc.
5334 * getopt_.h (__getopt_argv_const): Bring it back.
5335 (getopt_long, getopt_long_only): Use it.
5337 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5338 New arg POSIXLY_CORRECT. All callers changed.
5339 (getopt): Argv is now char * const *, as per standard.
5340 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5341 not char *__getopt_argv_const *.
5342 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5343 _getopt_long_only_r): Likewise.
5344 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5345 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5346 _getopt_long_r, _getopt_long_only_r): Likewise.
5347 * getopt_.h (__getopt_argv_const): Remove.
5348 (getopt): Argv is now char * const *, as per standard.
5350 * getdate.y (tORDINAL): New token.
5351 (day, relunit): Allow it for relative times.
5352 (relative_time_table): Use tORDINAL for ordinals.
5354 2004-11-15 Jim Meyering <jim@meyering.net>
5356 * closeout.c: Include "__fpending.h" once again.
5357 Include <stdbool.h>.
5358 (close_stdout): Don't fail just because stdout was closed initially,
5359 since some programs don't write to stdout in the normal course of
5360 operation (other than --version and --help), and we don't want this
5361 function to make e.g. `touch file >&-' fail.
5362 But do fail if it was closed and someone has tried to write to it.
5363 E.g., `printf foo >&-' must fail.
5365 2004-11-11 Simon Josefsson <jas@extundo.com>
5367 * strtok_r.h, strtok_r.c: New file.
5369 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5371 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5372 we can stop lying to compilers about the constness of argv when we
5373 are compiled outside glibc.
5374 (getopt, getopt_long, getopt_long_only): Use it.
5375 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5377 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5378 _getopt_long_only_r): Likewise.
5379 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5380 _getopt_long_only_r): Likewise.
5382 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5383 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5384 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5385 the other external symbols.
5386 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5387 declaration, since the above renaming now works around collisions.
5389 2004-11-11 Jim Meyering <jim@meyering.net>
5391 * linebreak.c: Remove trailing blanks.
5392 * alloca_.h: Likewise.
5393 * acosl.c: Likewise.
5394 * euidaccess.c: Likewise.
5395 * allocsa.h: Likewise.
5397 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5399 * mktime.c (SHR): New macro, which is a portable
5400 substitute for >> that should work even on Crays.
5401 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5402 Problem reported by Mark D. Baushke in
5403 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5404 * getdate.y (SHR): Likewise.
5406 * strftime.c (SHR): Likewise.
5408 * quotearg.c (struct quoting_options): Use unsigned int for
5409 quote_these_too, so that right shifts are well defined. All uses
5412 2004-11-10 Simon Josefsson <jas@extundo.com>
5414 * getaddrinfo.h, getaddrinfo.c: New files.
5416 2004-11-10 Jim Meyering <jim@meyering.net>
5418 Ensure that no close failure goes unreported.
5419 * closeout.c (close_stdout): Always close stdout. I.e., don't
5420 return early when it seems there's nothing to flush.
5421 Don't include __fpending.h.
5423 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5425 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5427 2004-11-05 Bruno Haible <bruno@clisp.org>
5429 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5430 Reported by Mark D. Baushke <mdb@cvshome.org>.
5432 2004-11-04 Bruno Haible <bruno@clisp.org>
5434 2004-09-11 Bruno Haible <bruno@clisp.org>
5435 * allocsa.valgrind: New file.
5436 2004-02-06 Bruno Haible <bruno@clisp.org>
5437 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5438 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5439 Reported by Christopher Seip <chris.seip@hp.com>.
5441 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5443 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5444 with errno == ERANGE if the buffer is too small.
5445 Problem reported by Mark D. Baushke.
5447 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5449 * xreadlink.c (MAXSIZE): New macro.
5450 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5451 size does not exceed MAXSIZE. Avoid cast.
5452 As suggested by Mark D. Baushke in
5453 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5454 if readlink fails with buffer size just under MAXSIZE, try again
5457 2004-11-02 Derek R. Price <derek@ximbiot.com>
5458 and Paul Eggert <eggert@cs.ucla.edu>
5460 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5461 (get_date): Overparenthesize to avoid GCC warning.
5463 2004-11-02 Bruno Haible <bruno@clisp.org>
5465 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5466 function returns void.
5468 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5470 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5471 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5474 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5476 * getdate.y: Add support for TZ="foo" within a date string.
5477 Fix some bugs near time_t boundaries. Reject dates with
5478 out-of-range components, e.g., "Sept 31".
5479 Include <stdlib.h>, "setenv.h", "xalloc.h".
5480 (ISDIGIT_LOCALE): Remove; unused.
5481 Note that the TZ and time functions used here are not reentrant.
5482 (mktime_ok, get_tz): New functions.
5483 (TZBUFSIZE): New constant.
5484 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5485 This requires that we sometimes generate our own TZ="XXX..." setting.
5487 2004-10-27 Derek R. Price <derek@ximbiot.com>
5489 * mktime.c (not_equal_tm): Remove redundant check.
5491 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5493 * getdate.y: Use Bison 1.875 features, and some minor
5494 code cleanups. This change does not affect semantics.
5495 Don't include <stdlib.h>; no longer needed.
5496 Don't include unlocked-io.h; only the "#if TEST" code uses
5497 stdio, and performance isn't crucial there.
5498 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5499 Bison 1.875 features as described below.
5500 All uses of "PC." replaced by "pc->".
5501 (YYSTYPE): Add a forward declaration.
5502 (yylex, yyerror): Use full prototypes in forward decls.
5503 Use "%pure-parser" rather than obsolescent "%pure_parser".
5504 Use %parse-param and %lex-param instead of obsolescent
5505 YYPARSE_PARAM and YYLEX_PARAM.
5506 (meridian_table, month_and_day_table, time_units_table,
5507 relative_time_table, time_zone_table, military_table,
5508 lookup_zone, lookup_word, get_date):
5509 Use NULL instead of 0 where appropriate.
5510 (to_hour): Avoid abort (), to avoid a dependency on
5512 (yyerror, yylex): Now accepts parser_control * arg.
5513 (main) [TEST]: Use '\0' rather than 0 for char.
5515 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5517 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5518 It's now the caller's responsibility to handle the case where
5519 !HAVE_GETPAGESIZE && !defined getpagesize.
5521 * mktime.c (leapyear): Arg is long int, not int.
5523 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5525 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5527 2004-10-12 Simon Josefsson <jas@extundo.com>
5529 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5530 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5533 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5535 * vsnprintf.h: New file.
5536 * vsnprintf.c: New file.
5538 2004-10-07 Bruno Haible <bruno@clisp.org>
5540 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5541 into the provided buffer.
5543 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5545 * diacrit.c, diacrit.h: Add GPL notice.
5547 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5548 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5549 * logl.c (logl): Keep the code as similar to glibc as possible.
5550 This avoids a potential constant-folding bug.
5552 2004-10-05 Bruno Haible <bruno@clisp.org>
5554 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5556 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5558 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5559 * xmalloc.c (xmemdup): Likewise.
5560 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5561 XFREE): Remove these long-obsolescent macros.
5562 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5563 * xstrdup.c: Remove.
5565 * regex.c (re_comp): Cast gettext return value to char *,
5566 Problem reported by Martin Neitzel via Mark D. Baushke.
5568 2004-10-04 Simon Josefsson <jas@extundo.com>
5570 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5571 '#ifdef USE_UNLOCKED_IO'.
5573 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5575 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5576 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5577 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5578 regex.c, sha1.c, version-etc.c, yesno.c:
5579 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5580 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5581 the includer's responsibility.
5583 Sync from coreutils.
5585 * modechange.c (mode_compile): Don't decrement a pointer that
5586 points to the start of a string, as the C Standard says the
5587 resulting behavior is undefined.
5589 * backupfile.h (enum backuptype): Rename none -> no_backups,
5590 simple -> simple_backups, numbered_existing ->
5591 numbered_existing_backups, numbered -> numbered_backups
5592 to avoid shadowing problems. All uses changed.
5593 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5594 * backupfile.c (check_extension, numbered_backup):
5595 Rename locals to avoid shadowing 'basename'.
5596 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5599 * .cppi-disable: Add getopt_.h, getopt_int.h.
5600 * .cvsignore: Add getopt.h.
5602 2004-10-04 Simon Josefsson <jas@extundo.com>
5604 * memmem.h: New file.
5605 * memmem.c: New file, taken from glibc.
5607 2004-10-02 Jim Meyering <jim@meyering.net>
5609 * dirfd.h, getpagesize.h: Add copyright notice.
5611 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5613 * snprintf.c: Remove comments as to why each header is needed.
5615 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5617 * strsep.h: New file.
5618 * strsep.c: New file.
5620 2004-10-01 Simon Josefsson <jas@extundo.com>
5622 * snprintf.c (snprintf): Handle size==0.
5624 2004-10-01 Simon Josefsson <jas@extundo.com>
5625 Bruno Haible <bruno@clisp.org>
5627 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5628 (snprintf): Declare 'args'.
5630 2004-09-30 Simon Josefsson <jas@extundo.com>
5632 * snprintf.h, snprintf.c: New files.
5634 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5636 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5637 (hol_entry_help): Never translate an empty string.
5638 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5639 * argp.h (OPTION_NO_TRANS): New option.
5641 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5643 * xvasprintf.c: Include xalloc.h.
5644 (xvasprintf): Use xalloc_die, not xmalloc_die.
5646 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5648 * dummy.c: Change copyright notice to FSF, and license to GPL.
5650 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5652 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5653 Problem reported by Bruno Haible in:
5654 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5656 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5658 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5659 in case some system header has #define'd it. Problem reported by
5660 Soeren D. Schulze in
5661 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5663 2004-09-08 Bruno Haible <bruno@clisp.org>
5665 * stdint_.h: New file, taken from GNU clisp.
5667 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5669 * xvasprintf.h: New file.
5670 * xvasprintf.c: New file.
5671 * xasprintf.c: New file.
5673 2004-09-08 Bruno Haible <bruno@clisp.org>
5675 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5677 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5679 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5681 Import from coreutils.
5682 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5683 strings on unbounded length. alloca's performance benefits aren't
5684 that important here.
5686 (parse_with_separator): New function, with most of the internals
5687 of the old parse_user_spec. Allow user to omit both user and group,
5688 for compatibility with FreeBSD.
5689 Clone only the user name, not the entire spec.
5690 Do not set *uid, *gid unless entirely successful.
5691 Avoid memory leak in some failing cases.
5692 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5693 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5694 (parse_user_spec): Rewrite to use parse_with_separator.
5696 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5698 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5699 its complicated substitute.
5700 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5701 and program_invocation_name.
5702 (__argp_basename) [!_LIBC]: Remove; the only use was
5703 replaced by its body.
5704 (__argp_short_program_name): Change condition from
5705 !defined __argp_short_program_name to
5706 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5707 to match argp-namefrob.h.
5708 (__argp_failure): Don't assume strerror_r returns char *.
5709 * argp-parse.c (N_): Define unconditionally.
5710 (argp_default_options): Fill out initializers with 0 to avoid
5713 2004-08-12 Simon Josefsson <jas@extundo.com>
5715 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5716 * getopt_.h: Renamed from getopt.h.
5718 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5720 Merge from coreutils.
5722 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5723 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5724 for Reliant Unix 5.43.
5726 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5727 (union fooround): Use uintmax_t, not long int.
5728 The rest is a merge from libc:
5729 [defined _LIBC]: Include <shlib-compat.h>.
5730 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5732 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5734 * strverscmp.c: Convert to UTF-8.
5736 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5738 * obstack.h (obstack_empty_p):
5739 Don't assume that chunk->contents is suitably aligned.
5740 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5741 Likewise. Problem reported by Benno in
5742 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5744 * chown.c (rpl_chown): Work even if the file is writeable but not
5745 readable. This could be improved further but it'd take some work.
5747 2004-08-08 Simon Josefsson <jas@extundo.com>
5749 * xgethostname.c: Don't include error.h (not used).
5752 * getpass.c: Include getpass.h first.
5754 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5756 * xalloc-die.c: New files.
5757 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5759 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5760 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5761 (_, N_, xalloc_die): Move to xalloc-die.c.
5762 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5763 so that we needn't mess with xalloc_msg_memory_exhausted.
5765 * sha1.h: Renamed from sha.h.
5766 (SHA1_H): Renamed from _SHA_H.
5767 (sha1_ctx): Renamed from sha_ctx.
5768 (sha1_init_ctx): Renamed from sha_init_ctx.
5769 (sha1_process_block): Renamed from sha_process_block.
5770 (sha1_process_bytes): Renamed from sha_process_bytes.
5771 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5772 (sha1_read_ctx): Renamed from sha_read_ctx.
5773 (sha1_stream): Renamed from sha_stream.
5774 (sha1_buffer): Renamed from sha_buffer.
5775 * sha1.c: Likewise; renamed from sha.c.
5776 Do not include <sys/types.h>.
5777 Include <stddef.h> rather than <stdlib.h>.
5779 2004-08-08 Bruno Haible <bruno@clisp.org>
5781 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5782 FILESYSTEM_PREFIX_LEN.
5783 * progreloc.c: Likewise.
5784 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5786 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5789 * argp-help.c (make_hol, hol_append): Don't assume that
5790 SIZE_MAX is a valid preprocessor constant.
5791 (__argp_basename): Change from "#ifndef _LIBC"
5792 to "#ifndef __argp_short_program_name", so that
5793 we don't compile these functions for tar.
5795 More merges from coreutils.
5796 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5797 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5799 * addext.c: Remove; no longer needed.
5800 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5801 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5802 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5803 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5804 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5805 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5806 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5807 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5808 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5809 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5810 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5811 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5812 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5813 Import changes from coreutils.
5815 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5817 Merge from coreutils.
5819 * .gdb-history: Remove; this doesn't belong here.
5821 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5822 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5823 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5825 * dirname.h: Include <stdbool.h>.
5826 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5827 for consistency with POSIX terminology. All uses changed.
5828 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5829 (strip_trailing_slashes): Use bool for booleans.
5830 * stripslash.c (strip_trailing_slashes): Likewise.
5832 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5833 sometimes returns a positive errno value even when it succeeds.
5834 (print_errno_message) [!LIBC]: Fall back on strerror if
5837 * path-concat.c (mempcpy): Don't define if a system header defines it.
5838 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5839 (longest_relative_suffix): New function.
5840 (path_concat): Use it. Assume first argument is not NULL.
5841 Port to DOS. Omit redundant separators.
5842 Report an error instead of returning NULL.
5843 Use mempcpy instead of memcpy.
5844 (xpath_concat): Remove: not declared or used.
5846 * same.h: Include <stdbool.h>
5847 (same_name): Return bool, not int.
5848 * same.c (same_name): Likewise.
5849 (errno): Don't declare; we assume C89 or better now.
5851 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5852 if not already defined.
5854 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5855 * dup-safer.c (errno): Likewise.
5857 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5859 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5862 2004-08-03 Simon Josefsson <jas@extundo.com>
5864 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5865 * progname.h: Don't include stdbool.h.
5867 2004-08-02 Simon Josefsson <jas@extundo.com>
5869 * getsubopt.h: New file, with comments from Bruno Haible.
5870 * getsubopt.c: New file, from glibc, but slightly modified based on
5871 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5873 2004-08-01 Simon Josefsson <jas@extundo.com>
5875 * xgetdomainname.c: Include stdlib.h, for free().
5877 2004-07-16 Simon Josefsson <jas@extundo.com>
5879 * dummy.c: New file.
5881 2004-07-16 Bruno Haible <bruno@clisp.org>
5883 * backupfile.h: Add extern "C" for C++.
5884 * closeout.h: Likewise.
5885 * copy-file.h: Likewise.
5886 * findprog.h: Likewise.
5887 * full-write.h: Likewise.
5888 * pathname.h: Likewise.
5889 * progname.h: Likewise.
5890 * stpcpy.h: Likewise.
5891 * stpncpy.h: Likewise.
5892 * strcase.h: Likewise.
5893 * strstr.h: Likewise.
5894 * xalloc.h: Likewise.
5896 * mbswidth.h: Add extern "C" for C++.
5897 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5899 2004-07-09 Simon Josefsson <jas@extundo.com>
5901 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5902 failed without this.)
5904 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5906 * fchown-stub.c: New file.
5908 2004-06-24 Jim Meyering <jim@meyering.net>
5910 * obstack.h (obstack_base): Cast to (void *), per documentation.
5912 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5914 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5916 2004-06-01 Jim Meyering <jim@meyering.net>
5918 * calloc.c: New file.
5920 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5922 * getdate.y (yylex): Allow space between sign and number.
5923 Problem reported by Dan Jacobson.
5925 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5926 and Jim Meyering <jim@meyering.net>
5928 Merge from coreutils CVS.
5930 * stat-macros.h: New file, with contents from file-type.h
5931 and coreutils' system.h.
5932 * file-type.c: Include "stat-macros.h".
5933 * file-type.h (file_type): Move all macro definitions to new file,
5936 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5937 Wrap old code with this conditional.
5938 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5939 function that does not dereference symlinks.
5940 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5942 * xreadlink.c: Include xreadlink.h first, to catch .h file
5943 dependency problems.
5944 (xreadlink): Accept new arg SIZE, for efficiency.
5945 All decls and uses changed.
5946 * xreadlink.h: Include <stddef.h>, for size_t.
5948 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5949 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5951 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5953 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5955 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5956 macros to be defined.
5957 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5958 the allocator returns NULL because the requested size is zero.
5960 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5962 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5963 var. Add comment explaining why libc still defines it. This
5964 merges the following patch from glibc:
5965 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5967 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5969 * obstack.c (_obstack): Remove unused variable. It hasn't been
5970 present in glibc since revision 1.1 of this file.
5971 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5972 obstack_alignment_mask, obstack_alloc, obstack_base,
5973 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5974 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5975 obstack_grow0, obstack_init, obstack_int_grow,
5976 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5977 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5978 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5979 nonexistent functions.
5981 2004-05-17 Derek R. Price <derek@ximbiot.com>
5982 Paul Eggert <eggert@cs.ucla.edu>
5984 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5986 2004-05-14 Bruno Haible <bruno@clisp.org>
5988 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5989 that consists of a '.' followed by an empty digit string.
5990 Patch by Tor Lillqvist <tml@iki.fi>.
5992 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5994 Port obstack to the AS/400, where pointers are 16 bytes wide and
5995 you cannot cast an integer to a valid pointer. This patch is
5996 currently waiting to be integrated into glibc; see
5997 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5999 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
6000 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
6001 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
6002 (struct obstack): temp member is now a union of a pointer and
6003 an integer, instead of an integer. All integer uses changed.
6004 This does not affect the physical layout of struct obstack,
6005 except on hosts (like the AS/400) where the size or alignment of
6006 void * is greater than that of ptrdiff_t.
6007 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
6008 __STDC__)]: Store temporary in pointer member of union, not
6010 * obstack.c: Include <stddef.h>, for offsetof.
6011 (struct fooalign): Remove; it doesn't need a name.
6012 (union fooround): Change double to long double, and add void *.
6013 (DEFAULT_ALIGNMENT): Use offsetof to compute.
6014 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6015 not a macro. Hence the values are always int; so remove all
6016 casts-to-int in uses.
6018 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
6019 Derek Price <derek@ximbiot.com>
6021 * alloca.c: Include <alloca.h>, to get our interface.
6022 * alloca_.h: Use __alloca on AIX, so that we don't have to
6023 include <alloca.h> first. Use C89 prototype for alloca; this
6024 requires including <stddef.h> for size_t. Use extern "C" if C++.
6025 Use #elif for simplicity, since we can assume C89 now.
6026 Don't try to source the system alloca.h since it will not be found
6027 and to prevent recursively including its replacement.
6028 * fnmatch.c: Include <alloca.h> instead of opencoding.
6029 * regex.c: Likewise.
6031 2004-05-16 Derek Price <derek@ximbiot.com>
6032 Paul Eggert <eggert@cs.ucla.edu>
6034 getline cleanup. This changes the getndelim2 API: both order of
6035 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6038 * getline.c: Don't include stddef.h or stdio.h, since our
6039 interface does that.
6040 (getline): Always use getdelim, so that we don't have two
6041 copies of this code.
6042 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6044 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6045 (GETNDELIM2_MAXIMUM): New macro.
6046 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
6047 instead of the old practice of delim2==0. All callers changed.
6048 Return -1 on overflow, instead of returning junk.
6049 Do not set *linesize unless allocation succeeds.
6050 * getndelim2.h: Do not include stddef.h; no longer needed, now
6051 that we include sys/types.h.
6052 * getnline.h: Likewise.
6053 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6054 (getndelim2): Reorder arguments.
6055 * getnline.c (getnline, getndelim):
6056 Don't discard the NMAX argument.
6057 (getnline): Invoke getndelim, to avoid code duplication.
6058 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6059 of (size_t) -1 by callers of the getnline family.
6061 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
6063 * nanosleep.c (suspended): Change its type from int to
6064 sig_atomic_t volatile.
6065 (first_call): Make it private to rpl_nanosleep, and have it
6066 be zero initially as that's a bit faster.
6067 (my_usleep): Round up fractional times instead of truncating them,
6068 as this is the usual meaning for 'sleep'.
6070 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6072 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6073 (ENOSYS): Define if not defined.
6074 (settime): Fall back on stime if it exists and settimeofday fails.
6075 But don't bother with fallbacks if a method fails with errno == EPERM.
6077 2004-05-11 Jim Meyering <jim@meyering.net>
6079 Prior to this change, the save_cwd caller required read access to the
6080 current directory on most systems (ones with the fchdir function).
6082 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6083 fails, try write-only, and finally, resort to using xgetcwd.
6085 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6087 * obstack.c, obstack.h: Import changes from libc.
6089 2004-04-28 Bruno Haible <bruno@clisp.org>
6091 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6092 implicitly appends .exe to executables.
6093 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6094 accepts Windows pathnames.
6095 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6096 Cygwin like Windows, since it now accepts Windows pathnames.
6097 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6098 Cygwin like Windows, since it now accepts Windows pathnames.
6099 Reported by Derek Robert Price <derek@ximbiot.com>.
6101 2004-04-20 Jim Meyering <jim@meyering.net>
6103 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6105 2004-04-20 Jim Meyering <jim@meyering.net>
6106 Bruno Haible <bruno@clisp.org>
6108 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6109 memory when realloc fails.
6111 2004-04-18 Jim Meyering <jim@meyering.net>
6113 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6114 don't leak memory and do call END_UTMP_ENT.
6116 2004-04-11 Paul Eggert <eggert@twinsun.com>
6118 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6119 (CHAR_BIT): Remove, since we assume C89.
6120 Include <stdint.h> if available, as per current Autoconf CVS advice.
6122 2004-03-30 Paul Eggert <eggert@twinsun.com>
6124 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6125 not bool, to be more consistent with Unix conventions.
6126 Suggested by Bruno Haible.
6128 Merge from coreutils.
6130 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6133 * getdate.h: Include stdbool.h, and timespec.h instead of
6134 the usual <time.h> dance.
6135 (get_date): Change signature to support fractional time stamps.
6136 All callers changed.
6137 * getdate.y: Include "getdate.h" first, as we can now
6138 assume C89 and don't need to worry about 'const'.
6139 Similarly, include "unlocked-io.h" near start, not in middle.
6141 (textint.value): Use long int rather than int.
6142 (textint.digits): Use size_t rather than int.
6143 (BILLION, LOG10_BILLION): New constants.
6144 (parser_control): New member rel_ns. Members day_ordinal,
6145 time_zone, month, day, hour, minutes, rel_year, rel_month,
6146 rel_day, rel_hour, rel_minutes, rel_seconds
6147 are now long int, not int. Member seconds is now struct timespec,
6148 not int. New member timespec_seen. Members dates_seen, days_seen,
6149 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6151 (%union.intval): Now long int, not int.
6152 New member timespec.
6153 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6154 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6155 (spec): Now is a timespec or an item list.
6156 (timespec, items): New nonterminals.
6157 (time, rel, relunit, number, get_date):
6158 Add support for fractional seconds.
6159 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6160 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6161 (to_hour): First arg is now long int, not int.
6162 (to_year): Returns long int, not int.
6163 Don't treat year -70 like 70.
6164 (tm_diff): Returns long int, not int.
6165 (lookup_word): Use bool instead of int when appropriate.
6166 (yylex): Use size_t for count, not int.
6167 Detect overflow when parsing large integer constants.
6168 Add support for fractions.
6169 (get_date): Make pointers 'const' if possible.
6170 Use more-portable code to detect integer overflow.
6171 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6172 Don't use ctime; it's not reliable if the year has >4 digits.
6174 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6175 This is for compatibility with BSD.
6177 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6178 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6179 From coreutils' system.h.
6181 * userspec.c: Don't include "posixver.h".
6182 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6183 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6184 compatible extension. Simplify code by removing a boolean int
6185 that was always nonzero if a string was nonnull.
6187 2004-03-30 Jim Meyering <jim@meyering.net>
6189 Merge from coreutils.
6191 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6193 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6194 an empty input stream.
6196 * readtokens.c: Include <stdbool.h>.
6197 (readtoken): Use `size_t' rather than int/long.
6198 All callers adjusted.
6199 Use `bool' rather than `int' where appropriate.
6200 Use memset rather than an explicit loop.
6201 Use x2nrealloc rather than xrealloc.
6202 Allow the use of `\0' as a delimiter.
6203 (readtokens): Likewise.
6204 * readtokens.h (readtoken, readtokens): Update prototypes.
6206 2004-03-30 Bruno Haible <bruno@clisp.org>
6208 * getloadavg.c (getloadavg): Don't assume setlocale returns
6211 2004-03-29 Paul Eggert <eggert@twinsun.com>
6213 Merge changes to getloadavg.c from coreutils and Emacs.
6215 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6216 Define to an expression, not to the empty string.
6217 Include cloexec.h and xalloc.h.
6218 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6219 Use set_cloexec_flag rather than rolling our own.
6220 * cloexec.c, cloexec.h: New files.
6222 2004-03-18 Paul Eggert <eggert@twinsun.com>
6224 * getopt.h: Sync with libc CVS.
6226 2004-03-18 Paul Eggert <eggert@twinsun.com>
6227 Bruno Haible <bruno@clisp.org>
6229 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6230 not on all platforms that have <wchar.h>.
6231 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6233 2004-03-09 Paul Eggert <eggert@twinsun.com>
6235 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6237 * getopt_int.h: New file, also synced from libc.
6239 2004-03-07 Paul Eggert <eggert@twinsun.com>
6241 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6242 '#if' expressions. Unlike the code it replaces, it does not
6243 depend on (defined _SC_PAGESIZE). However, it does depend on
6244 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6245 first reported by Jason Andrade in
6246 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6248 2004-01-18 Simon Josefsson <jas@extundo.com>
6250 * strdup.h: New file.
6251 * strdup.c: Include it.
6252 * path-concat.c: Include strdup.h. Drop strdup declaration.
6253 * userspec.c: Include strdup.h. Drop strdup declaration.
6255 2004-02-06 Karl Berry <karl@gnu.org>
6257 * config.charset: update from gettext 0.14.1.
6259 2004-02-05 Paul Eggert <eggert@twinsun.com>
6261 Add comments and code, prompted by suggestions from Bruno Haible
6263 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6264 describing the enum quoting_style values.
6265 * quotearg.c (quotearg_alloc): New function.
6266 (quotearg_buffer_restyled): Treat lone { and } as special.
6267 Treat = as special. Work around bug with older shells
6268 that "see" a '\' that is really the 2nd byte of a multibyte char.
6269 Quote empty string with shell_quoting_style.
6271 2004-02-03 Bruno Haible <bruno@clisp.org>
6273 * pipe.h: New file, from GNU gettext.
6274 * pipe.c: New file, from GNU gettext.
6276 2004-01-27 Bruno Haible <bruno@clisp.org>
6278 * execute.h: New file, from GNU gettext.
6279 * execute.c: New file, from GNU gettext.
6280 * w32spawn.h: New file, from GNU gettext.
6282 2004-01-23 Paul Eggert <eggert@twinsun.com>
6284 Exit-status fix from coreutils.
6286 Use exit_failure consistently in place of EXIT_FAILURE,
6287 so that program exit statuses are consistent on failure.
6289 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6290 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6291 * argmatch.h: Comment fix to match the above.
6292 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6293 Now a macro referring to exit_failure, instead of a separate
6294 variable. Include "exitfail.h" to get it.
6295 * xstrtol.h: Include "exitfail.h".
6296 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6298 * long-options.c (parse_long_options): Use prototype
6299 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6302 2004-01-21 Jim Meyering <jim@meyering.net>
6304 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6305 so as not to conflict with a different-sized __mktime_internal
6306 function in GNU libc.
6307 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6308 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6310 2004-01-18 Paul Eggert <eggert@twinsun.com>
6312 Merge from diffutils.
6314 * file-type.c (file_type): Add typed memory objects.
6315 * file-type.h (S_TYPEISTMO): New macro.
6317 * c-stack.h (c_stack_action): Remove argv argument.
6318 * c-stack.c (c_stack_action): Likewise. All uses changed.
6319 (die): Don't calculate message unless segv_action returns.
6320 (get_stack_location, min_address_from_argv, max_address_from_argv,
6321 volatile stack_base, volatile_stack_size): Remove.
6322 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6323 that every segmentation violation is a stack overflow. (Ouch!)
6324 See Debian bug 136249 (still outstanding) for more info about why
6325 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6327 2003-11-30 Bruno Haible <bruno@clisp.org>
6329 Safer stack allocation.
6330 * setenv.c: Include allocsa.h.
6331 (alloca): Remove fallback definition.
6332 (freea): Remove macro.
6333 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6336 2003-10-17 Bruno Haible <bruno@clisp.org>
6338 * binary-io.h: Avoid warnings on Cygwin.
6340 2003-12-28 Bruno Haible <bruno@clisp.org>
6342 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6343 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6345 2003-11-28 Bruno Haible <bruno@clisp.org>
6347 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6349 2003-11-27 Bruno Haible <bruno@clisp.org>
6351 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6353 2003-11-17 Bruno Haible <bruno@clisp.org>
6355 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6357 2003-11-24 Bruno Haible <bruno@clisp.org>
6359 * xallocsa.h: New file, from GNU gettext.
6360 * xallocsa.c: New file, from GNU gettext.
6362 2003-11-24 Bruno Haible <bruno@clisp.org>
6364 * allocsa.h: New file, from GNU gettext.
6365 * allocsa.c: New file, from GNU gettext.
6367 2003-11-24 Bruno Haible <bruno@clisp.org>
6369 * eealloc.h: New file.
6371 2004-01-15 Jim Meyering <jim@meyering.net>
6373 Merge from coreutils.
6375 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6376 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6377 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6379 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6380 optional configure-time default.
6382 * version-etc.c (version_etc_copyright): Update copyright date.
6384 * xreadlink.c (xreadlink): Correct outdated comment.
6386 2004-01-15 Paul Eggert <eggert@twinsun.com>
6388 Merge from coreutils.
6390 * posixver.c: Include posixver.h.
6392 * same.c: Include <stdbool.h>, <limits.h>.
6393 (_POSIX_NAME_MAX): Define if not defined.
6395 (same_name): If file names are silently truncated, report
6396 that the file names are the same if they are the same after
6397 the silent truncation.
6399 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6400 conversion function.
6401 * xstrtod.c (xstrtod): Likewise. All callers changed to
6402 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6405 2004-01-14 Paul Eggert <eggert@twinsun.com>
6407 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6408 with like-named macro in fnmatch.c.
6409 (EXT): Use an internal constant instead.
6411 Merge fnmatch patches from glibc.
6412 * fnmatch.c (mbsinit): Remove define.
6413 Add libc_hidden_ver (__fnmatch, fnmatch).
6414 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6415 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6417 2003-12-14 Karl Berry <karl@gnu.org>
6419 * config.charset: update from gettext-runtime.
6421 2003-12-03 Paul Eggert <eggert@twinsun.com>
6423 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6424 Bug reported by Alfred M. Szmidt.
6426 2003-11-29 Karl Berry <karl@gnu.org>
6428 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6430 2003-11-23 Paul Eggert <eggert@twinsun.com>
6431 Bruno Haible <bruno@clisp.org>
6433 * printf-parse.h: Don't include sys/types.h.
6434 (ARG_NONE): New macro.
6435 (char_directive): Change type of *arg_index fields to size_t.
6436 * printf-parse.c: Don't include sys/types.h.
6437 (SSIZE_MAX): Remove macro.
6438 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6439 Remove unnecessary overflow check.
6440 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6443 2003-11-24 Paul Eggert <eggert@twinsun.com>
6445 * alloca.c: Remove dependency on xalloc module.
6446 (xalloc_die): Remove.
6447 (memory_full) [!defined emacs]: New macro.
6448 [!defined emacs]: Don't include xalloc.h.
6449 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6450 address arithmetic overflows. Change datatypes a bit to avoid
6453 2003-11-22 Jim Meyering <jim@meyering.net>
6455 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6457 2003-11-17 Bruno Haible <bruno@clisp.org>
6459 * vasnprintf.c (alloca): Remove fallback definition.
6460 (freea): Remove definition.
6461 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6462 Reported by Paul Eggert.
6464 2003-11-17 Jim Meyering <jim@meyering.net>
6466 On systems without utime and without a utimes function capable of
6467 dealing with a NULL struct utimbuf* argument, this utime replacement
6468 could -- in unusual circumstances -- leak a file descriptor.
6469 * utime.c: Include <unistd.h> and <errno.h>.
6470 (utime_null): Be sure to close `fd' and to preserve errno.
6471 Reported by Geoff Collyer via Arnold Robbins.
6473 2003-11-16 Paul Eggert <eggert@twinsun.com>
6474 Bruno Haible <bruno@clisp.org>
6476 Protect against address arithmetic overflow.
6477 * printf-args.h: Include stddef.h.
6478 (arguments): Change type of field 'count' to size_t.
6479 * printf-args.c (printf_fetchargs): Use size_t instead of
6480 'unsigned int' where appropriate.
6481 * printf-parse.h: Include sys/types.h.
6482 (char_directive): Change type of *arg_index fields to ssize_t.
6483 (char_directives): Change type of fields 'count', max_*_length to
6485 * printf-parse.c: Include sys/types.h and xsize.h.
6486 (SSIZE_MAX): Define fallback value.
6487 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6488 instead of 'int' where appropriate. Check a_allocated, d_allocated
6489 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6490 * vasnprintf.c: Include xsize.h.
6491 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6492 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6493 overflow. Avoid wraparound when converting a width or precision from
6496 2003-11-16 Bruno Haible <bruno@clisp.org>
6498 Update from GNU gettext.
6499 * printf-parse.c: Generalize to it can be compiled for wide strings.
6500 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6501 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6502 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6503 SNPRINTF): New macros.
6504 Don't include <alloca.h> if the file is used inside libintl.
6505 (local_wcslen): New function, for Solaris 2.5.1.
6506 (VASNPRINTF): Use it instead of wcslen.
6508 2003-11-16 Bruno Haible <bruno@clisp.org>
6510 * xsize.h (xmax): New function.
6511 (xsum, xsum3, xsum4): Declare as "pure" functions.
6513 2003-11-12 Paul Eggert <eggert@twinsun.com>
6515 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6516 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6517 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6518 heuristic is just as accurate as far as we know, and it removes a
6519 dependency on size_max.m4 and ptrdiff_max.m4.
6521 2003-11-12 Paul Eggert <eggert@twinsun.com>
6523 * xstrtol.c (__xstrtol): Remove "break" immediately after
6524 "return", to pacify some unknown compiler. Problem reported
6527 2003-11-11 Bruno Haible <bruno@clisp.org>
6529 * xsize.h (SIZE_MAX): Remove fallback definition.
6530 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6533 2003-11-10 Paul Eggert <eggert@twinsun.com>
6535 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6536 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6537 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6539 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6540 not (size_t) -1, since it's defined here.
6542 2003-11-06 Paul Eggert <eggert@twinsun.com>
6544 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6545 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6546 Reject sizes of exactly SIZE_MAX bytes.
6547 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6548 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6550 2003-11-05 Bruno Haible <bruno@clisp.org>
6552 * xsize.h: Include limits.h, to avoid a possible collision with
6553 SIZE_MAX defined in <limits.h> on Solaris.
6555 2003-11-04 Bruno Haible <bruno@clisp.org>
6557 * xsize.h: New file.
6558 * linebreak.c: Include xsize.h.
6559 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6560 argument for overflow.
6561 Suggested by Paul Eggert.
6563 2003-10-31 Bruno Haible <bruno@clisp.org>
6565 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6566 to avoid (extremely rare) race condition.
6567 Suggested by Paul Eggert.
6569 2003-11-03 Jim Meyering <jim@meyering.net>
6571 * userspec.c: Include "userspec.h".
6572 * userspec.h: New file.
6574 2003-10-31 Paul Eggert <eggert@twinsun.com>
6576 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6577 * mountlist.c (SIZE_MAX): Define if not defined already.
6578 (read_filesystem_list): Set and use me_type_malloced.
6579 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6580 whatever the type happens to be), for brevity and consistency.
6581 Check for size calculation overflow on Alphas running OSF/1.
6583 2003-10-31 Jim Meyering <jim@meyering.net>
6585 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6587 * linebuffer.c: Include <string.h> for declaration of memset.
6589 2003-10-30 Paul Eggert <eggert@twinsun.com>
6590 Bruno Haible <bruno@clisp.org>
6592 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6593 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6595 2003-10-29 Paul Eggert <eggert@twinsun.com>
6597 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6598 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6600 * quotearg.c (quotearg_n_options): Use it.
6601 * group-member.c: Include <stdbool.h>.
6602 (free_group_info): Arg is now const *; don't free arg.
6603 (get_group_info): Now returns bool and accepts struct group_info *,
6604 rather than returning a malloc'ed struct group_info *.
6605 All uses changed. Check for overflow in internal size calculation.
6607 * getusershell.c (readname): Simplify the code by using x2nrealloc
6608 rather than xmalloc/xrealloc.
6609 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6610 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6611 conformance bug: the old code used a pointer after freeing the
6612 storage that it addressed.
6613 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6614 rather than doing it by hand.
6615 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6616 the buffer preserved. Use free and xmalloc instead.
6617 * quotearg.c (quotearg_n_options): Likewise.
6618 Use a simpler test for size overflow. Don't use xalloc_oversized
6619 because unsigned int might be wider than size_t (!); this suggests
6620 that we should switch from unsigned int to size_t for slot numbers.
6622 2003-10-27 Bruno Haible <bruno@clisp.org>
6624 * stdbool_.h: Better support for BeOS.
6626 2003-10-27 Paul Eggert <eggert@twinsun.com>
6628 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6629 to allocate the returned structure. Do not allocate a subarray,
6630 as x2nrealloc will do that.
6631 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6632 instead of xnrealloc.
6633 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6635 2003-10-26 Paul Eggert <eggert@twinsun.com>
6637 * xalloc.h (xalloc_oversized): New static inline function, for
6638 callers that want to do their own size-overflow checking. Include
6639 <stdbool.h>, since xalloc_oversized returns bool.
6640 * xalloc.c (array_size_overflow): Remove. All callers changed
6641 to use xalloc_oversized.
6643 Add two functions x2realloc, x2nrealloc, for programs that grow
6644 arrays dynamically by doubling their sizes.
6645 * xalloc.h (x2realloc, x2nrealloc): New decls.
6646 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6649 Port to C99 semantics for 'inline' of external functions.
6650 Bug reported by Bruno Haible.
6651 * xmalloc.c (xnmalloc_inline): New static inline function,
6652 with the old contents of xnmalloc.
6653 (xnmalloc, xmalloc): Use it.
6654 (xnrealloc_inline): New static inline function,
6655 with the old contents of xnrealloc.
6656 (xnrealloc, xrealloc): Use it.
6658 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6660 2003-10-25 Paul Eggert <eggert@twinsun.com>
6662 Fix several address-calculation bugs in the hash modules,
6663 plus some minor code cleanup.
6665 * hash.h: Include <stdbool.h>, for bool.
6666 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6667 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6668 hash_get_n_entries, hash_get_max_bucket_length,
6669 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6670 hash_rehash): Use size_t rather than unsigned.
6671 * hash.c (struct hash_table, hash_get_n_buckets,
6672 hash_get_n_buckets_used, hash_get_n_entries,
6673 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6674 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6675 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6677 (SIZE_MAX): Define if not defined.
6678 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6679 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6681 Use const * when possible.
6682 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6683 (check_tuning): Fix bug: if tuning parameters were very close to
6684 0 or 1, rounding errors could have caused subscript violations.
6685 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6686 (hash_initialize): Add 'fail:' label
6687 to free table and return NULL, and use it to simplify code.
6688 Use calloc rather than clearing the storage ourself.
6689 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6690 buffer size calculations.
6691 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6692 Include <stddef.h>, for size_t.
6693 * hash-pjw.c (hash_pjw): Likewise.
6694 Switch to method described by Bruno Haible.
6695 Include <limits.h>, for CHAR_BIT.
6696 (SIZE_BITS): New macro.
6698 2003-10-21 Paul Eggert <eggert@twinsun.com>
6700 * getndelim2.c (getndelim2): When size calculation overflows,
6701 ceiling the allocation at NMAX bytes rather than silently
6702 discarding input bytes before NMAX is reached. This makes
6703 a difference only if NMAX exceeds SIZE_MAX / 2.
6705 * obstack.c: Merge from glibc.
6706 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6707 Add libc_hidden_def (_obstack_newchunk).
6708 (_obstack_free) [! defined _LIBC]: Remove.
6709 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6710 a clone of the function body.
6711 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6712 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6714 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6715 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6718 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6719 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6720 Don't use lvalue casts, as GCC plans to remove support for them
6721 in GCC 3.5. Reported by Joseph S. Myers. This bug
6722 was also present in the non-GCC version, indicating that this
6723 code had always been buggy and had never been widely used.
6724 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6725 Use the fast variant of each macro, rather than copying the
6726 definiens of the fast variant; that way, we'll be more likely to
6727 catch future bugs in the fast variants.
6729 2003-10-20 Bruno Haible <bruno@clisp.org>
6731 * wait-process.h: New file, from GNU gettext.
6732 * wait-process.c: New file, from GNU gettext.
6734 2003-10-19 Jim Meyering <jim@meyering.net>
6736 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6738 2003-10-16 Paul Eggert <eggert@twinsun.com>
6740 * getgroups.c: Include <errno.h>, <stdlib.h>.
6741 (getgroups): First arg is int, not size_t.
6742 Don't let 'free' mangle errno.
6744 2003-10-16 Jim Meyering <jim@meyering.net>
6746 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6748 2003-10-15 Paul Eggert <eggert@twinsun.com>
6750 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6752 (new_exclude, add_exclude_file): Initial size no longer needs to
6754 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6755 our own address arithmetic overflow checking.
6757 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6758 (fnmatch): Do not alloca more than 2000 wide characters;
6759 instead, use malloc for large buffers.
6760 Check for address arithmetic overflow, and return -1
6761 with errno set to ENOMEM in that case.
6762 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6763 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6764 instead, return -1. Check for address arithmetic overflow.
6766 2003-10-14 Paul Eggert <eggert@twinsun.com>
6768 Handle invalid suffixes and overflow independently, so that
6769 callers can treat them independently as needed. Fix some bugs in
6770 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6771 suffix for a human-readable blocksize. The major caller-visible
6772 change is the addition of a new
6773 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6774 that both overflow and suffix chars were found.
6776 * human.c (humblock): Don't check separately for invalid suffix
6777 char; that is xstrtoumax's job (now that its bug is fixed).
6778 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6779 INTMAX_MAX]: New macros.
6780 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6781 TYPE_MAXIMUM): New macros.
6782 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6783 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6784 if overflow occurs, as it's what __strtol does and it's more useful
6786 (__xstrtol): If __strtol reports some error other than ERANGE,
6787 reflect it to the caller as LONGINT_INVALID. If it reports
6788 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6789 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6790 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6792 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6793 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6794 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6795 [defined UINTMAX_MAX]: New macros.
6797 2003-10-14 Bruno Haible <bruno@clisp.org>
6799 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6800 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6801 Also use volatile where needed.
6803 2003-10-12 Paul Eggert <eggert@twinsun.com>
6805 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6806 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6807 and define in terms of the other primitives.
6808 * xmalloc.c: Include stdbool.h; do not include exit.h.
6809 (SIZE_MAX): Define if not already defined.
6810 (array_size_overflow): New function.
6811 (xalloc_die): Abort instead of exiting if 'error' returns.
6812 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6813 (xmalloc, xrealloc): Use them.
6814 (xcalloc): Check for address arithmetic overflow.
6815 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6816 a bit faster than strcpy.
6818 2003-10-08 Paul Eggert <eggert@twinsun.com>
6820 Merge getpass from libc, plus a few fixes.
6822 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6823 Include <stdbool.h>.
6824 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6825 __fsetlocking to empty.
6826 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6827 do include <bits/libc-lock.h>.
6828 Do not include <fcntl.h>; not needed.
6829 [_LIBC]: Include <wchar.h>.
6830 (NOTCANCEL_MODE): New macro.
6831 (flockfile, funlockfile) [_LIBC]: New macros.
6832 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6833 [!_LIBC]: New macros.
6834 (call_fclose): New function.
6835 (getpass): Use it. Save tty stream separately; this simplifies the
6836 code and makes it more reliable if stdin happens to equal stdout.
6837 Invoke __fsetlocking on tty.
6838 Handle thread cancellation if needed.
6839 Namespace cleanup (use __tcgetattr, __getline).
6840 Use bool for Booleans.
6841 [USE_IN_LIBIO]: Handle wide streams.
6842 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6843 stream might go where.
6845 * unlocked-io.h: Include <stdio.h>, so that the caller
6846 doesn't have to include <stdio.h> before us.
6847 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6848 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6849 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6850 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6851 if not declared, so that we can use getpass.c code from libc without
6853 (flockfile, ftrylockfile, funlockfile): New macros.
6855 2003-10-06 Bruno Haible <bruno@clisp.org>
6857 * version-etc-2.h: Remove file.
6858 * version-etc-2.c: Remove file.
6860 2003-09-25 Jim Meyering <jim@meyering.net>
6861 Bruno Haible <bruno@clisp.org>
6863 This lets translators provide better translations for the
6864 "Written by ..." part of --version output.
6865 * version-etc.h: Include stdarg.h.
6866 (version_etc_copyright): Declare as readonly.
6867 (version_etc): Make this function variadic with a NULL-terminated list
6868 of author name strings.
6869 (version_etc_va): New declaration.
6870 * version-etc.c: Include stdarg.h, stdlib.h.
6871 (version_etc_copyright): Declare as readonly.
6872 (version_etc_va): New function. Provide a different translatable string
6873 for each possible number of authors < 10. Abbreviate when there are 10
6875 (version_etc): Make this function variadic. Call version_etc_va.
6876 Suggestion from Gary V. Vaughan.
6878 * long-options.h (parse_long_options): Change prototype: the authors
6879 string is moved to the end and becomes variadic.
6880 * long-options.c: Include stdarg.h.
6881 (parse_long_options): Make this function variadic, too.
6882 Call version_etc_va, not version_etc.
6884 2003-10-06 Bruno Haible <bruno@clisp.org>
6886 * fatal-signal.h: New file, from GNU gettext.
6887 * fatal-signal.c: New file, from GNU gettext.
6889 2003-10-04 Karl Berry <karl@gnu.org>
6891 * argp*: update from libc.
6893 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6895 * getpass.c (getpass): Use a no-op fseek when switching from input to
6896 output mode on the same stream.
6898 2003-09-29 Paul Eggert <eggert@twinsun.com>
6900 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6901 Fix arg typo in previous patch.
6903 2003-09-28 Jim Meyering <jim@meyering.net>
6905 * error.c: Correct cpp indentation.
6907 2003-09-27 Paul Eggert <eggert@twinsun.com>
6909 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6910 Omit the special code that used __typeof__, since we worry that
6911 it could be more trouble than it's worth. See:
6912 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6913 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6917 2003-09-26 Jim Meyering <jim@meyering.net>
6919 * error.c (error_tail): Move some declarations
6920 into inner scope where the local variables are used.
6922 2003-09-26 Bruno Haible <bruno@clisp.org>
6924 * stpncpy.h (gnu_stpncpy): New declaration.
6925 (stpncpy): Define as alias for gnu_stpncpy.
6926 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6928 2003-09-26 Paul Eggert <eggert@twinsun.com>
6930 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6931 (error_tail): Do not loop, reallocating temporary buffer, since
6932 the output cannot contain more wide characters than the input
6933 contains bytes, the size must be big enough already. This avoids
6934 one potential size overflow calculation. Check for size overflow
6935 when calculating temporary buffer size. Free temporary buffer
6936 when done, if it was allocated with malloc; this plugs a memory
6937 leak. Remove casts from void * to pointers, that are no longer
6938 needed now that we're assuming C89 or better.
6940 Merge error changes from glibc.
6942 * error.c, error.h: Update copyright notice header to match glibc.
6943 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6944 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6945 Disable cancellation while printing error.
6946 * error.h: Prepend __ to parameter names.
6948 2003-09-25 Karl Berry <karl@gnu.org>
6950 * argp-fmtstream.c, argp-help.c: update from libc.
6952 2003-09-25 Bruno Haible <bruno@clisp.org>
6954 * version-etc-2.h: New file, from version-etc.h with modifications.
6955 * version-etc-2.c: New file, from version-etc.c with modifications.
6957 2003-09-25 Simon Josefsson <jas@extundo.com>
6959 * xgetdomainname.h: New file.
6960 * xgetdomainname.c: New file.
6962 2003-09-25 Simon Josefsson <jas@extundo.com>
6963 Bruno Haible <bruno@clisp.org>
6965 * getdomainname.h: New file.
6966 * getdomainname.c: New file.
6968 2003-09-24 Paul Eggert <eggert@twinsun.com>
6970 * linebuffer.c (freebuffer): Don't free the argument, just
6971 the buffer associated with the argument. Bug reported by
6974 2003-09-19 Karl Berry <karl@gnu.org>
6976 * argp.h: update from libc.
6978 2003-09-16 Paul Eggert <eggert@twinsun.com>
6980 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6981 input error, instead of returning NULL the next time we are called
6982 (and therefore losing track of errno).
6984 2003-09-15 Paul Eggert <eggert@twinsun.com>
6986 * getndelim2.c (getndelim2): Don't trash errno when a read
6987 fails, so that the caller gets the proper errno.
6989 * readutmp.c (read_utmp): Likewise.
6990 Check for fstat error. Close stream and free storage
6993 2003-09-14 Bruno Haible <bruno@clisp.org>
6995 * fwriteerror.h: New file.
6996 * fwriteerror.c: New file.
6998 2003-09-14 Jim Meyering <jim@meyering.net>
7000 * getloadavg.c: Correct cpp indentation.
7001 * strdup.c: Likewise.
7002 * vasnprintf.c: Likewise.
7004 2003-09-12 Paul Eggert <eggert@twinsun.com>
7006 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
7007 * obstack.c [!defined _LIBC]: Likewise.
7008 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
7009 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
7010 * exitfail.c: Don't include stdlib.h; no longer needed.
7012 More changes to assume C89 or better.
7014 * error.c (error_tail): Assume vprintf.
7016 * argmatch.c (getenv): Remove decl.
7017 * progreloc.c (get_full_program_name): Define via prototype.
7018 * setenv.c (clearenv): Likewise.
7019 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7021 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7022 (malloc, memcpy): Remove decls.
7023 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7024 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7025 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7026 (memcpy): Remove macro.
7027 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7028 (__P): Remove. All uses removed.
7029 (PTR): Remove. All uses changed to void *.
7030 (CHAR_BIT, NULL): Remove.
7031 (spaces, zeros, memset_space, memset_zero)
7032 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7034 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7035 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7036 Define with prototype.
7037 Remove now-unnecessary prototype decl.
7038 (extra_args_spec): Assume ANSI C. All uses changed.
7039 (extra_args_spec_iso): Remove.
7040 (my_strftime, emacs_strftimeu): Define via prototype.
7041 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7043 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7044 * strtoimax.c: Include <stdlib.h> unconditionally.
7045 (strtoul, strtol): Remove decls.
7046 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7048 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7049 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
7050 (LOCALE_PARAM_PROTO): New macro.
7051 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7052 (INTERNAL (strtol), strtol): Define with a prototype.
7053 (PARAMS): Remove. All uses removed.
7054 * tempname.c: Include <string.h> unconditionally.
7055 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7056 * xgethostname.c (main): Define with a prototype.
7057 * xmalloc.c: Include "xalloc.h" first, to check interface.
7058 Include <stdlib.h> unconditionally.
7059 (calloc, malloc, realloc, free): Remove decls.
7060 * xstrtod.c: Include "xstrtod.h" first, to check interface.
7061 Include <stdlib.h> unconditionally. Sort include file names.
7063 (xstrtod): Define with a prototype.
7064 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7065 (strtol, strtoul): Remove decls.
7067 2003-09-11 Paul Eggert <eggert@twinsun.com>
7069 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7070 Include <stdlib.h>, <string.h> unconditionally.
7071 Remove now-unnecessary cast to char *.
7072 * strnlen.c: Include <string.h> unconditionally.
7073 * yesno.c (yesno): Define with a prototype.
7075 2003-09-10 Bruno Haible <bruno@clisp.org>
7077 * strcspn.c: Include <string.h> unconditionally.
7078 * strpbrk.c: Include <string.h> unconditionally.
7079 * strstr.c: Include <string.h> unconditionally.
7080 * unicodeio.c: Include <string.h> unconditionally.
7081 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7082 * unsetenv.c: Likewise.
7083 * xreadlink.c: Include <stdlib.h> unconditionally.
7084 * yesno.c: Include <stdlib.h> unconditionally.
7085 (rpmatch): Add prototype.
7087 2003-09-10 Jim Meyering <jim@meyering.net>
7089 * error.c: Correct indentation of cpp directives.
7091 2003-09-09 Paul Eggert <eggert@twinsun.com>
7095 * acosl.c (main): Use a prototype.
7096 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7099 * getloadavg.c (getloadavg, main): Define via prototypes.
7101 * getopt.h (struct option.name): Assume C89, and use 'const'.
7102 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7103 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7105 * getopt.c (const): Remove macro.
7106 Include <string.h> unconditionally.
7107 (my_index): Remove; all uses changed to strchr.
7108 (strlen): Remove decl.
7109 (exchange): Remove forward decl; no longer needed.
7110 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7111 Define with prototype.
7112 * getopt1.c (const): Remove macro.
7113 (getopt_long, getopt_long_only, main): Define with prototype.
7115 * getugroups.c: Include <string.h> unconditionally.
7117 * getusershell.c: Include <stdlib.h> unconditionally.
7118 (getusershell, setusershell, endusershell, readname, main):
7119 Define with prototypes.
7121 * group-member.c: Include group-member.h first.
7122 Include <stdlib.h> unconditionally.
7124 * hard-locale.c: Include hard-locale.h first.
7125 Include <stdlib.h>, <string.h> unconditionally.
7127 * hash.c (free, malloc): Remove decls.
7128 Include <stdlib.h> unconditionally.
7130 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7131 (getenv): Do not declare.
7133 * idcache.c: Include <string.h> unconditionally.
7135 * long-options.c: Include long-options.h first, to test interface.
7136 Include <stdlib.h> unconditionally.
7138 * makepath.c: Include makepath.h first, to test interface.
7139 Include <stdlib.h> and <string.h> unconditionally.
7141 * linebuffer.c: Include <stdlib.h>.
7142 (free): Remove decl.
7144 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7145 rpl_malloc returns void *, not char *.
7146 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7148 * md5.h: Include <limits.h> unconditionally.
7149 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7150 (__P): Remove; all uses removed.
7151 * md5.c: Include "md5.h" first.
7152 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7153 md5_buffer, md5_process_bytes, md5_process_block):
7154 Define with prototypes.
7155 * sha.h (__P): Remove all uses. (It wasn't defined??)
7156 * sha.c: Include "sha.h" first.
7157 Include <stdlib.h>, <string.h> unconditionally.
7159 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7160 * memcmp.c (__ptr_t): Likewise.
7161 * memrchr.c (__ptr_t): Likewise.
7162 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7163 Include <string.h> unconditionally.
7164 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7165 * memchr.c: Include <stdlib.h> unconditionally.
7166 * memchr.c (LONG_MAX): Remove.
7167 * memrchr.c (LONG_MAX): Likewise.
7168 * memchr.c (__memchr): Define via a prototype.
7169 * memrchr.c (__memrchr): Likewise.
7170 * memcmp.c (__P): Remove, and remove all uses.
7171 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7172 Remove forward decls; no longer needed.
7173 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7174 Use types required by C89 in prototype.
7176 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7177 * savedir.c: Likewise.
7178 * mkdir.c (free): Remove decl.
7179 * rmdir.c (rmdir): Define with a prototype.
7180 * savedir.c: Include savedir.h first, to test interface.
7182 * mktime.c (STDC_HEADERS): Remove.
7183 Include <stdlib.h>, <string.h> unconditionally.
7185 * modechange.c: Include <stdlib.h> unconditionally.
7186 (malloc): Remove decl.
7188 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7189 (free): Remove decl.
7191 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7192 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7193 (This type really should be intptr_t, but that's a C99ism.)
7194 (_obstack_memcpy): Remove: all uses changed to memcpy.
7195 Include <string.h> unconditionally.
7196 (struct obstack): Assume __STDC__ for types of members
7197 chunkfun, freefun, extra_arg.
7198 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7199 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7200 obstack_begin, obstack_specify_allocation,
7201 obstack_specify_allocation_with_arg, obstack_chunkfun,
7202 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7203 Remove unprototyped decls and the macros that use them.
7204 * obstack.c (POINTER): Remove. All uses changed to void *.
7205 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7206 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7207 (defined __STDC__ && __STDC__)]:
7208 Remove nonprototyped code.
7209 Include <stdlib.h> unconditionally.
7210 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7211 _obstack_allocated_p, _obstack_free, obstack_free,
7212 _obstack_memory_used, print_and_abort):
7213 Define using prototypes.
7214 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7215 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7216 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7217 obstack_next_free, obstack_object_size, obstack_room) [0]:
7218 Remove unused, unprototyped code.
7220 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7222 * physmem.c (physmem_total, physmem_available, main): Define
7225 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7226 (main): Define with a prototype.
7228 * posixver.c (getenv): Remove decl.
7230 * putenv.c (malloc): Returns void *, not char *.
7231 Include <string.h> unconditionally.
7232 (strchr, memcpy, NULL): Do not define.
7234 * readtokens.c: Include readtokens.h first, to test interface.
7235 Include <stdlib.h>, <string.h> unconditionally.
7236 (init_tokenbuffer): Define with a prototype.
7238 * regex.c (PARAMS): Remove. All uses removed.
7239 All uses of _RE_ARGS removed, too.
7240 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7242 (bzero): Assume memset exists.
7243 (memcmp, memcpy, NULL): Remove.
7244 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7245 char, or assignments to local vars of type signed char.
7246 (init_syntax_once, PREFIX(extract_number_and_incr),
7247 PREFIX(print_partial_compiled_pattern),
7248 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7249 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7250 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7251 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7252 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7253 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7254 wcs_compile_range, byte_compile_range, truncate_wchar,
7255 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7256 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7257 count_mbs_length, wcs_re_match_2_internal,
7258 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7259 PREFIX(alt_match_null_string_p),
7260 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7261 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7262 regfree, PREFIX(extract_number)): Define with prototype. Remove
7263 now-unnecessary declaration, if any.
7264 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7266 Remove now-unnecessary casts among pointer types.
7267 * regex.h (_RE_ARGS): Remove. All uses removed.
7269 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7270 (free): Remove decl.
7272 * rpmatch.c: Include <stdlib.h> unconditionally.
7274 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7275 (free): Remove decl.
7277 * save-cwd.c: Include <stdlib.h> unconditionally.
7278 * xgetcwd.c: Likewise.
7280 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7281 (free): Remove decl.
7283 * strchrnul.c (strchrnul): Define with a prototype.
7284 Fix bug: c_in was not converted to char before searching.
7286 The following changes are not K&R related:
7288 * group-member.h: Include <sys/types.h>, so that this file is
7290 * makepath.h: Likewise.
7292 * getusershell.c (readname, default_index, line_size, readname):
7293 Use size_t, not int, for sizes.
7294 (readname): If the size overflows, report an error instead of
7297 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7299 * getndelim2.c: Assume stdlib.h per the C89 spec.
7301 2003-09-08 Paul Eggert <eggert@twinsun.com>
7303 Assume C89 or better; remove K&R cruft.
7304 A few of these changes were first proposed by Derek Robert Price
7305 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7307 * addext.c: Include <string.h> unconditionally.
7308 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7309 Don't declare getenv or malloc.
7311 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7312 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7314 (find_stack_direction, alloca): Use prototypes.
7316 * atexit.c (atexit): Define using a prototype.
7318 * basename.c, dirname.c, stripslash.c:
7319 Include <string.h> unconditionally.
7321 * bcopy.c: Include <stddef.h>.
7322 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7324 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7326 * error.h (error, error_at_line, error_print_progname)
7327 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7328 * error.c: Include error.h first, to check interface.
7329 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7330 (VA_START): Remove; all uses changeed to va_start.
7331 (exit, strerror): Remove decls.
7332 (error_print_progname): Prototype uncondionally.
7333 Don't include <errno.h>; no longer needed.
7334 (private_strerror): Remove.
7335 (error_tail): Always define.
7336 (error, error_at_line): Assume C89 or better; always use prototypes.
7337 * fatal.c: Include "fatal.h" first, to test interface.
7338 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7339 (VA_START): Remove; all uses changed to va_start.
7340 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7342 (exit): Remove decl.
7343 (fatal): Prototype unconditionally. Assume va_start works.
7344 Abort at end, to pacify gcc.
7346 * euidaccess.c (main): Define with a prototype.
7348 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7350 * exitfail.c: Include <stdlib.h> unconditionally.
7352 * fnmatch_.h (__P): Remove. All uses changed to assume
7354 * fnmatch.c: Include fnmatch.h first, to test interface.
7355 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7356 (getenv): Remove decl.
7357 (fnmatch): Define using a prototype.
7358 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7359 (FCT): Define using a prototype.
7361 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7363 * gethostname.c: Include <stddef.h>.
7364 (gethostname): Define with prototype. Length is size_t, not int.
7366 2003-09-08 Paul Eggert <eggert@twinsun.com>
7368 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7369 getversion.c should have been removed then, but was accidentally
7372 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7373 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7375 2003-09-07 Paul Eggert <eggert@twinsun.com>
7377 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7378 copy_tm_result. Bug reported by Simon Josefsson in
7379 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7381 2003-09-06 Paul Eggert <eggert@twinsun.com>
7383 * time_r.c, time_r.h: New files.
7385 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7387 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7388 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7390 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7392 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7393 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7396 * timegm.c: Switch to glibc implementation, with the following changes:
7397 [defined HAVE_CONFIG_H]: Include <config.h>.
7398 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7399 (__mktime_internal) [!defined _LIBC]: New decl.
7400 (__gmtime_r) [!defined _LIBC]: New macro and function.
7401 (timegm): Use a prototype, since gnulib assumes C89.
7402 Do not bother declaring tmp to be const, as it's not really usefu.
7403 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7404 (timegm): Declare only if HAVE_DECL_TIMEGM.
7406 2003-09-03 Paul Eggert <eggert@twinsun.com>
7408 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7409 Bug reported by Lute Kamstra in
7410 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7412 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7413 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7414 course with correspondingly smaller numbers for tomorrow and
7415 yesterday. From Tadayoshi Funaba. Originally installed into
7416 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7419 2003-08-31 Simon Josefsson <jas@extundo.com>
7421 * timegm.h: New file.
7422 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7424 2003-08-31 Karl Berry <karl@gnu.org>
7426 * argp.h: update from libc.
7428 2003-08-28 Bruno Haible <bruno@clisp.org>
7430 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7431 warning on QNX, which defines O_BINARY to 000000.
7433 2003-08-24 Bruno Haible <bruno@clisp.org>
7435 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7436 MSVC7 <stdio.h> is included later.
7438 2003-08-20 Bruno Haible <bruno@clisp.org>
7440 * progname.h: New file, from GNU gettext.
7441 * progname.c: New file, from GNU gettext.
7442 * progreloc.c: New file, from GNU gettext.
7444 2003-08-19 Bruno Haible <bruno@clisp.org>
7446 * xstrdup.c: Assume <string.h> exists.
7448 2003-08-18 Jim Meyering <jim@meyering.net>
7450 * setenv.h: Indent nested cpp directive.
7451 * vasnprintf.c: Remove trailing blanks.
7453 2003-08-17 Simon Josefsson <jas@extundo.com>
7454 Bruno Haible <bruno@clisp.org>
7456 * xstrndup.h: New file.
7457 * xstrndup.c: New file.
7459 2003-08-17 Bruno Haible <bruno@clisp.org>
7461 * strndup.h: New file.
7463 2003-08-16 Paul Eggert <eggert@twinsun.com>
7465 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7466 space, undoing this 2003-08-12 change:
7467 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7469 2003-08-16 Jim Meyering <jim@meyering.net>
7471 Merge from coreutils.
7472 * xstrtoimax.c: #else #if -> #elif.
7473 * xstrtoumax.c: Likewise.
7475 2003-08-15 Paul Eggert <eggert@twinsun.com>
7477 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7478 rather than tab, after '#' in shell-script copyright notices.
7479 Suggested by Bruno Haible.
7481 2003-08-15 Jim Meyering <jim@meyering.net>
7482 and Paul Eggert <eggert@twinsun.com>
7484 Merge from coreutils.
7485 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7486 member but strut utmpx does not. Needed for AIX 4.3.3.
7487 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7489 2003-08-15 Jim Meyering <jim@meyering.net>
7491 Merge from coreutils.
7492 * xgethostname.c: Include <stdlib.h>.
7493 (xghostname): Don't exit for anything other than memory-related
7494 failure; just return NULL.
7495 * userspec.c: Include "posixver.h".
7496 (parse_user_spec): Accept `.' as a separator only
7497 in pre-POSIX-200112 mode.
7498 * strtoimax.c: Use #elif rather than #else #if.
7499 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7500 Remove function, now that we can rely on a working tzset function.
7501 [!_LIBC]: Ensure that the required autoconf test has been run.
7502 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7503 Use underlying_strftime for %r.
7504 * sha.c: Merge in some clean-up and optimization changes from glibc.
7505 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7506 Ensure that it is a multiple of 64.
7507 Rearrange loop exit tests so as to avoid performing an
7508 additional fread after encountering an error or EOF.
7509 * realloc.c: Update copyright date.
7511 2003-08-14 Jim Meyering <jim@meyering.net>
7513 Merge from coreutils.
7514 * obstack.h: Whitespace changes.
7515 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7516 and xcalloc return values.
7517 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7518 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7519 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7520 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7521 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7523 Use mntctl's return value to drive the entry-processing loop, since
7524 we can't rely on the value of the vmt_length member in the last
7525 entry. On some systems doing so could result in exhausting
7526 virtual memory. Based in part on a patch from Mike Jetzer.
7528 2003-08-14 Jim Meyering <jim@meyering.net>
7529 and Paul Eggert <eggert@twinsun.com>
7531 Merges from coreutils, plus other fixes.
7532 * physmem.c: Merge in portability changes from gcc/libiberty
7533 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7534 for credits and details. Thanks to Kaveh Ghazi for helping
7535 to keep these files in sync.
7536 (ARRAY_SIZE): Define it.
7537 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7538 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7539 (memcasecmp): Don't assume size_t fits in unsigned int.
7540 Remove casts and duplicate code.
7541 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7542 (memcpy): Remove definition.
7543 Merge in some clean-up and optimization changes from glibc.
7544 [BLOCKSIZE]: Move definition to top of file.
7545 Ensure that it is a multiple of 64.
7546 Rearrange loop exit tests so as to avoid performing an
7547 additional fread after encountering an error or EOF.
7548 * md5.h (md5_uintptr): Define.
7549 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7550 return to the initial working directory. Preserve errno
7552 * idcache.c: Include "xalloc.h".
7553 (xmalloc, xrealloc): Remove decls.
7554 (getuser): Remove casts no longer required in C89.
7555 * human.c: Include stdio.h, for sprintf.
7556 * group-member.c: Include "xalloc.h".
7557 (xmalloc, xrealloc): Remove decls.
7558 (get_group_info): Remove casts no longer required in C89.
7559 * getusershell.c (readname): Remove casts no longer required in C89.
7560 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7561 * getline.c: Whitespace fix, from coreutils.
7563 2003-08-13 Paul Eggert <eggert@twinsun.com>
7565 * exclude.c: Include <ctype.h>
7566 (IN_CTYPE_DOMAIN): New macro.
7568 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7571 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7572 Undo previous (whitespace-only) change.
7574 2003-08-12 Paul Eggert <eggert@twinsun.com>
7576 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7577 Normalize leading white space and remove trailing white space.
7578 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7579 notice, as per ../config/srclist-update.
7581 Merge from coreutils.
7582 * euidaccess.h: New file.
7583 * euidaccess.c: Include it.
7584 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7585 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7586 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7588 2003-08-11 Bruno Haible <bruno@clisp.org>
7590 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7591 (vasnprintf): Use it instead of wcslen.
7593 2003-08-11 Bruno Haible <bruno@clisp.org>
7595 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7596 value to ensure that _Bool promotes to int. Use #define for _Bool when
7597 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7599 2003-08-10 Karl Berry <karl@gnu.org>
7601 * regex.h: update from libc (whitespace fix).
7603 2003-08-09 Paul Eggert <eggert@twinsun.com>
7605 Merge some files from coreutils. These changes were
7606 originally made by Jim Meyering.
7607 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7608 many older Unixes require this.
7609 * alloca.c (alloca): Remove cast to argument of free;
7610 no longer needed in C89.
7611 * alloca_.h, regex.h: Fix white space to match
7612 what GNU indent does.
7614 2003-08-05 Paul Eggert <eggert@twinsun.com>
7616 * bumpalloc.h: Remove.
7618 2003-08-04 Paul Eggert <eggert@twinsun.com>
7620 * getloadavg.c: Change copyright notice and spacing to conform to
7623 Merge from coreutils.
7624 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7626 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7627 from Karl Berry, implemented by Jim Meyering.
7628 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7629 from Dmitry V. Levin.
7630 Remove anachronistic cast of xrealloc.
7631 * fnmatch_.h (__const): Remove. Use 'const'.
7632 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7633 type. Otherwise, it wouldn't compile with at least /bin/cc on
7634 ymp-cray-unicos9.0.2.X.
7635 Combine two mostly-identical uses of alloca into one.
7636 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7638 2003-08-04 Dave Love <d.love@dl.ac.uk>
7642 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7643 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7644 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7645 obsolete NLIST_NAME_UNION.
7646 [__GNU__]: Undef BSD and FSCALE.
7647 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7649 2003-08-03 Paul Eggert <eggert@twinsun.com>
7651 * stdbool_.h (_Bool): Make it signed char, instead of
7652 an enum type, so that it's guaranteed to promote to int. See:
7653 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7655 2003-07-31 Paul Eggert <eggert@twinsun.com>
7657 * strerror.c: Include config.h, limits.h. Declare sprintf.
7658 (strerror): Don't assume that a printable int fits in 14 bytes.
7660 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7661 Bruno Haible <bruno@clisp.org>
7663 * getline.h (getline, getdelim): Change return type to ssize_t.
7664 * getline.c (getline, getdelim): Likewise.
7665 Remove _GNU_SOURCE define; now it's defined in config.h through
7668 2003-07-22 Paul Eggert <eggert@twinsun.com>
7670 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7671 over-parenthesization in macros.
7673 Sync with coreutils.
7675 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7678 Use `exit_failure' for xalloc and xmemcoll instead of their own
7679 private exit-failure variables.
7680 * xalloc.h (xalloc_exit_failure): Remove.
7681 * xmalloc.c: Likewise. Include exitfail.h.
7682 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7683 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7684 * xmemcoll.c: Likewise. Include exitfail.h.
7685 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7687 2003-07-18 Paul Eggert <eggert@twinsun.com>
7689 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7690 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7691 to test that it can stand by itself. Include "exitfail.h".
7692 Clients should set exit_failure instead.
7693 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7695 2003-07-18 Andreas Schwab <schwab@suse.de>
7697 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7699 2003-07-18 Bruno Haible <bruno@clisp.org>
7701 * getndelim2.h: New file.
7702 * getndelim2.c: Make into a module of its own. Include config.h,
7704 (getndelim2): Make non-static. Change return type to ssize_t.
7705 * getline.h: Change argument names.
7706 * getline.c: Include getndelim2.h instead of getndelim2.c.
7707 * getnline.c: Include getndelim2.h.
7709 2003-07-17 Bruno Haible <bruno@clisp.org>
7711 * Makefile.am: Remove file.
7712 * Makefile.in: Remove file.
7714 2003-07-17 Bruno Haible <bruno@clisp.org>
7716 * getnline.h: New file.
7717 * getnline.c: New file.
7718 * getndelim2.c: New file, extracted from getline.c.
7719 (getndelim2): Renamed from getdelim2, with added nmax argument.
7720 * getline.c: Include getndelim2.c.
7721 (getdelim2): Moved out to getndelim2.c.
7722 (getline, getdelim): Update.
7724 2003-07-15 <karl@gnu.org>
7726 * vasnprintf.c: update from gettext.
7728 2003-07-15 Jim Meyering <jim@meyering.net>
7730 * makepath.c (make_path): Enclose diagnostic in _(...).
7732 2003-07-14 Paul Eggert <eggert@twinsun.com>
7734 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7735 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7736 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7737 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7738 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7739 updated automatically by ../config/srclist-update. This changes
7740 their license from LPGL to GPL.
7742 2003-07-14 Jim Meyering <jim@meyering.net>
7744 Don't emit diagnostics. Let callers do that.
7745 * save-cwd.c: Don't include "error.h".
7746 (save_cwd): Don't call error. Ensure that errno is valid
7747 when returning nonzero.
7749 * save-cwd.h (restore_cwd): Update prototype.
7750 * save-cwd.c (restore_cwd): Remove two parameters.
7751 Simplify. Don't call error upon failure. Let callers do that.
7752 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7753 when auditing is enabled. But don't bother updating the #if.
7755 2003-07-14 Simon Josefsson <jas@extundo.com>
7757 * mempcpy.h: New file.
7758 * mempcpy.c: New file.
7760 2003-07-14 Paul Eggert <eggert@twinsun.com>
7762 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7763 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7764 unicodeio.c, unicodeio.h, unlocked-io.h:
7765 Switch from LGPL to GPL.
7767 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7769 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7770 it breaks C++ compilation.
7771 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7773 2003-07-10 Jim Meyering <jim@meyering.net>
7775 * vasnprintf.c: Remove trailing blanks.
7776 Make cpp indentation consistent.
7778 2003-07-09 Paul Eggert <eggert@twinsun.com>
7780 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7781 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7782 Switch from LGPL to GPL.
7784 2003-07-07 Paul Eggert <eggert@twinsun.com>
7786 * mktime.c: Fix some boundary cases and remove need for floating point.
7788 Issue a compile-time diagnostic if time_t is floating point, or if
7789 two's complement arithmetic is not in effect, or if arithmetic
7790 right shift does not propagate the sign. These assumptions were
7791 all in the original code but they weren't checked.
7793 (TIME_T_MIDPOINT, verify): New macros.
7794 (__isleap): Remove; it has integer overflow problems.
7795 (leapyear): New function, without those problems.
7796 (ydhms_tm_diff): Remove; splitting into two parts.
7797 (ydhms_diff): New function, containing the arithmetic part of
7798 the old ydhms_tm_diff function. Issue a compile-time
7799 diagnostic if we are not using C99 integer division.
7800 Avoid casts when possible.
7801 (guess_time_tm): New function, containing the checking part of
7802 the old ydhms_tm_diff function. Return the new value, rather than
7803 the difference between it and the old. Accept a new argument T
7804 so that *T specifies the old value. Check for overflow in the result.
7806 (__mktime_internal): Use a time_t offset, not a long int offset.
7807 This undoes the 2003-06-04 change, which is no longer needed now
7808 that we have better overflow checking.
7809 (localtime_offset): Likewise.
7811 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7812 and long are 64-bit but int is only 32-bit.
7813 (ydhms_diff): Use long int to store year1 and yday1.
7814 Issue a compile-time diagnostic if long int is not wide enough.
7816 (__mktime_internal): Use long int to store adjusted year and yday.
7817 Use plain C rather than preprocessor commands, if that doesn't
7819 Check for overflow (and try to repair) after each probe
7820 rather than checking only at the very end. This avoids some bugs
7821 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7822 does not equal GMT offset at maximum time).
7823 Use integer to check for overflow rather than floating point; this
7824 is more portable to non-IEEE hosts, and is a tad faster.
7825 When we detect that we are oscillating between two values,
7826 don't check whether tm_isdst has the requested value, since
7827 we already know the answer. When tm_isdst has the wrong value,
7828 use a different heuristic to find the right one, based on the
7829 extreme values actually observed in practice in tz2003a,
7830 rather than the (overly optimistic) "previous 3 calendar quarters".
7832 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7833 "T const" to accommodate glibc style.
7834 (check_result): Use less-confusing report format. "long" -> "long int.
7836 Don't loop if the iteration overflows time_t.
7837 Allow a negative step in the iteration.
7839 2003-07-01 Paul Eggert <eggert@twinsun.com>
7841 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7842 having it depend on HAVE_SYS_TYPES_H.
7844 2003-06-25 Bruno Haible <bruno@clisp.org>
7846 * readlink.c: New file.
7848 2003-06-20 Bruno Haible <bruno@clisp.org>
7850 Assume C89, so PARAMS isn't needed.
7851 * unicodeio.h (PARAMS): Remove.
7852 * unicodeio.c: Don't use PARAMS.
7854 2003-06-18 Jim Meyering <jim@meyering.net>
7856 Merge changes from coreutils.
7857 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7858 Remove explicit declarations of xmalloc and realloc.
7860 (read_utmp): Remove anachronistic cast of xmalloc.
7862 2003-06-17 Paul Eggert <eggert@twinsun.com>
7864 Assume C89, so PARAMS isn't needed.
7865 * backupfile.h (PARAMS): Remove. All uses removed.
7866 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7867 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7868 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7869 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7870 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7871 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7872 xstrtol.h: Likewise.
7873 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7874 same.h, strverscmp.h: Do not include config.h; no longer needed.
7875 Anyway, config.h should always be included before any other file.
7877 2003-06-11 Simon Josefsson <jas@extundo.com>
7879 * sysexit_.h: New file.
7881 2003-05-20 Derek Price <derek@ximbiot.com>
7883 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7885 2003-06-10 Simon Josefsson <jas@extundo.com>
7887 * strchrnul.h: New file.
7888 * strchrnul.c: New file.
7890 2003-06-10 Simon Josefsson <jas@extundo.com>
7892 * argp.h: New file, from glibc.
7893 * argp-ba.c: New file, from glibc.
7894 * argp-eexst.c: New file, from glibc.
7895 * argp-fmtstream.c: New file, from glibc.
7896 * argp-fmtstream.h: New file, from glibc.
7897 * argp-fs-xinl.c: New file, from glibc.
7898 * argp-help.c: New file, from glibc.
7899 * argp-namefrob.h: New file, from glibc.
7900 * argp-parse.c: New file, from glibc.
7901 * argp-pv.c: New file, from glibc.
7902 * argp-pvh.c: New file, from glibc.
7903 * argp-xinl.c: New file, from glibc.
7905 2003-06-07 Jim Meyering <jim@meyering.net>
7907 * readtokens.h: Put `Free Software Foundation, Inc.'
7908 in place of my name in the copyright comment.
7909 Remove definition and uses of __P.
7912 * stat.c: Don't declare xmalloc explicitly.
7913 Instead, include "xalloc.h".
7914 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7915 xrealloc, and xcalloc return values.
7916 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7918 * xgetcwd.h: Remove definition/uses of PARAMS.
7920 2003-06-06 Jim Meyering <jim@meyering.net>
7922 * stdbool_.h: Renamed from stdbool.h.in.
7924 2003-06-06 Jim Meyering <jim@meyering.net>
7926 Merge from coreutils.
7927 * same.c: (same_name): Declare *_basename locals to be `const'.
7928 Consolidate declarations and initializations of *_base* locals.
7930 Merge from coreutils.
7931 This avoids a core dump on systems without GNU putenv,
7932 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7933 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7934 (unsetenv): New static function, from GNU libc.
7935 (rpl_putenv): Use it.
7937 * modechange.c: Remove trailing blanks.
7939 Merge from coreutils.
7940 * fsusage.c: Remove declaration of statfs.
7941 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7943 * posixtm.c: Include <stdbool.h> unconditionally.
7945 2003-06-05 Paul Eggert <eggert@twinsun.com>
7947 * mktime.c (__mktime_internal): When resolving a tm_isdst
7948 mismatch, look in future quarters as well as past. This fixes a
7949 bug when processing fall-backwards gaps immediately after a long
7950 period of daylight-saving time.
7952 * mktime.c: Assume freestanding C89 or better.
7953 (HAVE_LIMITS_H): Remove. Assume it's 1.
7954 (__P): Remove; not used.
7955 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7956 (mktime, not_equal_tm, print_tm, check_result,
7957 main): Use prototypes. Use const * where appropriate.
7958 (main): Fix typo in testing code that uncovered by above changes.
7959 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7961 2003-06-04 Paul Eggert <eggert@twinsun.com>
7963 * mktime.c: Fix Debian bug 177940
7964 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7965 (localtime_offset): Now long int, not time_t, because we want it
7966 to be guaranteed to be signed. All uses changed.
7967 (__mktime_internal): If overflow would occur when adding offset,
7970 Merge 'human' changes from coreutils. Rewrite to support
7971 locale-specific notations like thousands separators.
7972 * human.c: Simplify authorship notice.
7973 Include human.h immediately after config.h.
7974 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7975 <limits.h>: Do not include, since human.h does.
7976 (SIZE_MAX, UINTMAX_MAX): New macros.
7977 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7978 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7979 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7980 (power_letter): Renamed from suffixes.
7981 (generate_suffix_backwards): Remove.
7982 (adjust_value): Now takes int style (because of human.h changes)
7983 and long double value (for greater precision on some platforms).
7984 (group_number): New function.
7985 (human_readable): Use it. Use integer options, not enum.
7986 Put the options before the sizes in the arg list.
7987 Support all the new options.
7988 The old human_readable function has been removed;
7989 use inttostr.h instead.
7990 (human_readable, default_block_size, humblock):
7991 Use uintmax_t, not int, for block sizes.
7992 (human_readable_inexact, block_size_types): Remove.
7993 (block_size_opts): New constant.
7994 (human_options): Renamed from human_block_size, with new signature
7995 that allows block sizes up to UINTMAX_MAX. All callers changed.
7996 * human.h: Add copyright and authorship notice.
7997 Include <limits.h> and <stdbool.h> unconditionally.
7998 (PARAMS): Remove. All uses removed.
7999 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
8000 (enum human_inexact_style): Remove tag; now a nameless enum.
8001 (human_floor, human_ceiling, human_round_to_even): Now have
8002 values 2, 0, 1 rather than -1, 1, 0.
8003 (human_group_digits, human_suppress_point_zero, human_autoscale,
8004 human_base_1024, human_SI, human_B): New constants.
8005 (human_readable_inexact, human_block_size): Remove.
8006 (human_readable): Size args are now uintmax_t, not int.
8007 (human_options): New decl.
8009 * exclude.c: (new_exclude, add_exclude): Remove casts that are
8010 unnecessary now that we assume C89 or better. This change
8011 imported from coreutils.
8013 * mktime.c (__mktime_internal): Do not reject negative timestamps
8014 arbitrarily. This is the same patch as 2003-05-28, but it got lost
8015 in the 2003-05-30 sync from glibc.
8017 .h files should stand alone, but we shouldn't include <sys/types.h>
8018 if we can get away with just <stddef.h>.
8020 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8021 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8022 rather than <sys/types.h>, as we merely need size_t.
8023 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8025 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8026 Include <stdio.h>, to get FILE.
8027 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8028 memcasecmp.h has included <stddef.h> and all we need is size_t.
8029 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8030 our interface, instead of including <sys/types.h>
8032 2003-06-02 Paul Eggert <eggert@twinsun.com>
8035 Fix some minor time-related bugs with POSIX time arguments.
8036 Some valid time stamps were being rejected (notably -1, and
8037 time stamps before 1900 on 64-bit hosts). And some invalid
8038 time stamps were being accepted, e.g. September 31.
8040 * posixtm.h (posixtime): Return bool instead of time_t, so
8041 that we can return (time_t) -1 successfully.
8042 * posixtm.c: Likewise.
8043 [HAVE_STDBOOL_H]: Include <stdbool.h>.
8044 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8045 (t): Remove static var.
8046 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8047 of static var. All uses changed.
8048 (year): Do not reject years before 1900; they can occur with
8050 (posix_time_parse): Do not check for out-of-range components;
8051 that is now the caller's responsibility, since our checks were
8052 only approximations.
8053 (posixtime): Use mktime to check for out-of-range components,
8054 since it knows them exactly.
8055 If mktime returns (time_t) -1, check whether an error actually occurred
8056 by invoking localtime on -1.
8057 (main) [TEST_POSIXTIME]: Check for input data errors, and report
8058 posixtime failures better.
8059 Improve the test data (in comments only).
8061 2003-05-30 <karl@gnu.org>
8063 * mktime.c: update from libc.
8065 2003-05-30 Bruno Haible <bruno@clisp.org>
8067 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8068 * localcharset.h: Likewise.
8069 * localcharset.c: Likewise.
8071 2003-05-28 Paul Eggert <eggert@twinsun.com>
8073 Assume the headers required for C89 freestanding compilers.
8074 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8075 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8076 without checking for HAVE_LIMITS_H.
8077 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8078 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8080 * fatal.c: Include <stdarg.h> without checking for __STDC__.
8081 * exclude.c: Include <stdbool.h> unconditionally.
8082 * tempname.c: Include <stddef.h> unconditionally.
8083 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8084 * modechange.c, rpmatch.c (NULL): Don't define, since
8085 <stddef.h> does that.
8086 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8087 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8088 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8089 * xstrtol.c: Likewise.
8090 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8091 * savedir.c: Include <stddef.h> instead of defining NULL.
8093 * addext.c (addext): Use assignment rather than cast, to avoid
8094 warnings on some platforms.
8096 * mktime.c (__mktime_internal): Do not reject negative timestamps
8099 2003-05-10 Bruno Haible <bruno@clisp.org>
8101 * linebreak.c (iconv_string_length): Don't return -1 just because the
8102 string is longer than 4 KB.
8104 2003-05-12 Jim Meyering <jim@meyering.net>
8106 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8107 the space-padded-by-default conversion specifiers, %e, %k, %l.
8109 2003-05-03 Bruno Haible <bruno@clisp.org>
8111 Upgrade to Unicode-4.0.
8112 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8113 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8114 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8115 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8116 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8117 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8118 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8119 Change width of U+E0100..U+E01EF from 1 to 0.
8121 2003-04-25 Bruno Haible <bruno@clisp.org>
8123 * copy-file.c: Include <stddef.h>, for size_t.
8125 2003-04-25 Jim Meyering <jim@meyering.net>
8127 * copy-file.c (copy_file_preserving): Declare buf_size to be
8128 of type size_t, not int.
8130 2003-04-11 Jim Meyering <jim@meyering.net>
8132 Merge changes from Coreutils.
8134 2003-03-22 Jim Meyering <jim@meyering.net>
8136 * strftime.c (widen): Cast alloca return value to proper type.
8138 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8141 * strftime.c (my_strftime): Handle very large width
8142 specifications for numeric values correctly. Improve checks for
8145 2003-01-19 Jim Meyering <jim@meyering.net>
8147 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8148 (nl_get_alt_digit) [! defined my_strftime]: Define.
8149 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8150 _nl_get_alt_digit and _nl_get_walt_digit.
8152 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8153 These changes have no effect outside of _LIBC.
8155 2003-04-10 Bruno Haible <bruno@clisp.org>
8157 * findprog.h: New file, from GNU gettext.
8158 * findprog.c: New file, from GNU gettext.
8160 2003-04-05 Jim Meyering <jim@meyering.net>
8162 Merge changes from Coreutils.
8164 * exclude.h (PARAMS): Remove definition and uses.
8165 * exclude.c: Remove uses of `PARAMS'.
8167 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8168 Add test-cases for DOS filenames. Declare program_name.
8169 (main): Set up program_name. Patch by Rich Dawe.
8171 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8173 Use mntctl's return value to drive the entry-processing loop, since
8174 we can't rely on the value of the vmt_length member in the last
8175 entry. On some systems doing so could result in exhausting
8176 virtual memory. Based in part on a patch from Mike Jetzer.
8178 2003-04-04 Bruno Haible <bruno@clisp.org>
8180 * linebreak.h: New file, from GNU gettext.
8181 * linebreak.c: New file, from GNU gettext with slight modifications.
8182 * lbrkprop.h: New file, from GNU gettext.
8184 2003-04-03 Bruno Haible <bruno@clisp.org>
8186 * utf8-ucs4.h: New file, from GNU gettext.
8187 * utf16-ucs4.h: New file, from GNU gettext.
8188 * ucs4-utf8.h: New file, from GNU gettext.
8189 * ucs4-utf16.h: New file, from GNU gettext.
8191 2003-04-02 Bruno Haible <bruno@clisp.org>
8193 * binary-io.h: New file, from GNU gettext.
8195 2003-04-01 Bruno Haible <bruno@clisp.org>
8197 * pathname.h: New file, from GNU gettext.
8198 * concatpath.c: New file, from GNU gettext.
8200 2003-03-30 Bruno Haible <bruno@clisp.org>
8202 * copy-file.c (copy_file_preserving): Don't set owner if the function
8203 chown() doesn't exist.
8205 2003-03-28 Bruno Haible <bruno@clisp.org>
8207 * copy-file.h: New file, from GNU gettext.
8208 * copy-file.c: New file, from GNU gettext.
8210 2003-03-18 Jim Meyering <jim@meyering.net>
8212 * quote.c (quote_n): Fix typo in comment.
8214 2003-03-14 Jim Meyering <jim@meyering.net>
8216 Merge changes from Coreutils.
8217 * obstack.h (obstack_object_size): Declare temporary, __o,
8218 to be const, in order to avoid warnings.
8219 (obstack_room): Likewise.
8220 (obstack_empty_p): Likewise.
8222 2003-03-13 Paul Eggert <eggert@twinsun.com>
8224 Merge changes from Bison.
8225 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8226 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8227 when compiling Bison 1.875's `bitset bset = obstack_alloc
8228 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8229 * hash.c: Include <stdbool.h> unconditionally.
8231 2003-03-09 Paul Eggert <eggert@twinsun.com>
8233 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8234 Reported by Bruce Becker; see:
8235 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8237 2003-03-03 Paul Eggert <eggert@twinsun.com>
8238 Bruno Haible <bruno@clisp.org>
8240 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8241 Reported by John Hughes, see
8242 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8244 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8246 * poll_.h: New file.
8249 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8251 * mathl.h: New file.
8252 * acosl.c: New file.
8253 * asinl.c: New file.
8254 * atanl.c: New file.
8255 * ceill.c: New file.
8258 * floorl.c: New file.
8259 * frexpl.c: New file.
8260 * ldexpl.c: New file.
8262 * sincosl.c: New file.
8264 * sqrtl.c: New file.
8266 * trigl.c: New file.
8267 * trigl.h: New file.
8269 2003-02-17 Bruno Haible <bruno@clisp.org>
8271 * mkdtemp.h: New file, from GNU gettext.
8272 * mkdtemp.c: New file, from GNU gettext.
8274 2003-01-31 Bruno Haible <bruno@clisp.org>
8276 * rename.c: #undef rename before defining rpl_rename.
8277 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8279 2003-01-30 Bruno Haible <bruno@clisp.org>
8281 * printf-args.h: New file, from GNU gettext.
8282 * printf-args.c: New file, from GNU gettext.
8283 * printf-parse.h: New file, from GNU gettext.
8284 * printf-parse.c: New file, from GNU gettext.
8285 * vasnprintf.h: New file, from GNU gettext.
8286 * vasnprintf.c: New file, from GNU gettext.
8287 * asnprintf.c: New file, from GNU gettext.
8288 * vasprintf.h: New file, from GNU gettext with modifications.
8289 * vasprintf.c: New file, from GNU gettext.
8290 * asprintf.c: New file, from GNU gettext.
8292 2003-01-29 Bruno Haible <bruno@clisp.org>
8294 * stpncpy.h: New file, from GNU gettext with modifications.
8295 * stpncpy.c: New file, from GNU gettext with modifications.
8297 2003-01-28 Bruno Haible <bruno@clisp.org>
8299 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8301 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8304 2003-01-27 Bruno Haible <bruno@clisp.org>
8306 * xsetenv.h: New file, from GNU gettext.
8307 * xsetenv.c: New file, from GNU gettext.
8309 2003-01-23 Bruno Haible <bruno@clisp.org>
8311 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8313 2003-01-22 Bruno Haible <bruno@clisp.org>
8315 * exit.h: New file, from GNU gettext.
8317 2003-01-11 Bruno Haible <bruno@clisp.org>
8319 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8320 * strcase.h (strcasecmp, strncasecmp): Likewise.
8322 2003-01-14 Jim Meyering <jim@meyering.net>
8324 * same.c (same_name): Tweak a comment.
8326 2003-01-11 Bruno Haible <bruno@clisp.org>
8328 * same.c (same_name): Reorder tests so as to avoid calling stat()
8329 when a string comparison is sufficient.
8331 2003-01-11 Bruno Haible <bruno@clisp.org>
8333 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8336 2003-01-11 Bruno Haible <bruno@clisp.org>
8338 * hash-pjw.c: Add comment about low quality of this function.
8340 2003-01-12 Paul Eggert <eggert@twinsun.com>
8342 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8343 to avoid collisions with libcurses and libreadline.
8345 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8346 * getstr.h, getstr.c: Remove.
8347 * getline.c: Include "getline.h", to check interface.
8348 Move body of old getstr.c here: this defines MIN_CHUNK and
8349 declares getdelim2, which is renamed from getstr.
8350 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8352 * linebuffer.c (readlinebuffer): Renamed from readline.
8354 * linebuffer.h: Likewise.
8355 (readline): Remove backward-compatibility macro.
8357 2003-01-12 Jim Meyering <jim@meyering.net>
8359 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8361 2003-01-10 Bruno Haible <bruno@clisp.org>
8363 * alloca_.h: New file.
8364 * getdate.y: Unconditionally include alloca.h.
8365 * makepath.c: Likewise.
8366 * setenv.c: Likewise.
8367 * userspec.c: Likewise.
8369 2003-01-09 Bruno Haible <bruno@clisp.org>
8371 * stdbool.h.in: New file.
8373 2003-01-08 Bruno Haible <bruno@clisp.org>
8375 * safe-read.c: Include specification header first, to ensure its
8377 * full-write.c: Likewise.
8379 2003-01-08 Jim Meyering <jim@meyering.net>
8381 * full-write.c: Undefine and define-away `const' after inclusion
8382 of errno.h, not before. Suggestion from Bruno Haible.
8384 2003-01-07 Jim Meyering <jim@meyering.net>
8386 * full-write.c: Rework so that it may serve to define full_read, too.
8387 * full-read.c: Simply #define FULL_READ and include full-write.c.
8389 2003-01-06 Jim Meyering <jim@meyering.net>
8391 * version-etc.c: Update year in translatable copyright string.
8393 2002-12-25 Bruno Haible <bruno@clisp.org>
8395 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8396 * xstrtol.h: Likewise.
8397 * xstrtoimax.c: Likewise.
8398 * xstrtoumax.c: Likewise.
8399 * human.h: Likewise.
8401 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8402 on systems that have <inttypes.h> but not <stdint.h>.
8404 2002-12-31 Paul Eggert <eggert@twinsun.com>
8406 * memcoll.c (memcoll): Fall back on a simple algorithm using
8407 memcmp if strcoll doesn't work.
8409 2002-12-23 Bruno Haible <bruno@clisp.org>
8411 * localcharset.h: New file.
8412 * localcharset.c: Include it.
8413 * unicodeio.c: Likewise.
8415 2002-12-22 Bruno Haible <bruno@clisp.org>
8417 * utime.c (utime_null): No need to call ftruncate if the file was
8420 2002-12-23 Bruno Haible <bruno@clisp.org>
8422 * memcoll.c (STRCOLL): New macro.
8425 2002-12-22 Bruno Haible <bruno@clisp.org>
8427 * getstr.h (getstr): Define, to avoid clash with libcurses.
8428 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8430 2002-12-22 Bruno Haible <bruno@clisp.org>
8432 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8434 2002-12-23 Bruno Haible <bruno@clisp.org>
8436 * getline.h: Include <stddef.h>, for size_t.
8438 * unicodeio.h: Include <stddef.h>, for size_t.
8439 * unicodeio.c: Don't include <stddef.h>.
8441 2002-12-17 Bruno Haible <bruno@clisp.org>
8443 * canon-host.c (strdup): Remove unused declaration.
8445 * fsusage.c: Include full_read.h.
8446 (get_fs_usage): Use full_read instead of safe_read.
8448 * utime.c (utime_null): Use SAFE_READ_ERROR.
8450 2002-12-11 Bruno Haible <bruno@clisp.org>
8452 * setenv.h: Rewritten to cope with systems that have setenv() but not
8454 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8457 2002-12-11 Bruno Haible <bruno@clisp.org>
8459 * setenv.c (alloca): Fall back to malloc.
8461 (setenv): Use freea() to free memory allocated with alloca().
8463 2002-11-13 Bruno Haible <bruno@clisp.org>
8465 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8466 function declarations.
8467 * unsetenv.c (unsetenv): Likewise.
8469 2002-03-04 Bruno Haible <bruno@clisp.org>
8471 Portability to AIX 4.3.3.
8472 * unsetenv.c: New file, extracted from setenv.c.
8473 * setenv.c: Move the unsetenv() function to unsetenv.c.
8475 2001-12-20 Bruno Haible <bruno@clisp.org>
8477 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8478 use malloc instead. For SunOS 4.
8480 2001-12-11 Bruno Haible <bruno@clisp.org>
8482 * setenv.c: Declare alloca.
8483 (compar_fn_t): New typedef.
8484 (KNOWN_VALUE, STORE_VALUE): Use it.
8486 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8489 2002-12-10 Paul Eggert <eggert@twinsun.com>
8491 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8492 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8493 Choose values that are less likely to collide with system fnmatch
8495 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8496 defined (e.g., a pure POSIX system).
8497 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8498 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8500 2002-12-06 Jim Meyering <jim@meyering.net>
8502 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8504 Merge in changes from libc's misc/error.c, in preparation
8505 for the merge of gnulib's changes back into libc.
8507 * error.c (_): Define only if not already defined.
8508 Move definition to follow all #include directives.
8509 Include unlocked-io.h only if !_LIBC.
8510 [_LIBC]: Include <libio/libioP.h>.
8511 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8512 (fflush): Tweak definition to use INTUSE.
8515 2002-12-05 Paul Eggert <eggert@twinsun.com>
8517 * alloca.c [defined emacs]: Include "lisp.h".
8518 (xalloc_die) [defined emacs]: New macro.
8519 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8520 [! defined emacs]: Include <xalloc.h>.
8521 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8522 (pointer): Typedef to POINTER_TYPE *.
8523 (malloc): Remove decl; we now always use xmalloc.
8524 (alloca): Use old-style definition, since Emacs needs this.
8525 Check for arithmetic overflow when computing combined size.
8527 2002-12-04 Paul Eggert <eggert@twinsun.com>
8529 Do not generate unlocked-io.h automatically, since it's easier to
8530 maintain it by hand.
8532 * unlocked-io.h: New file, from GNU diffutils,
8533 but with proper copyright notice and attribution.
8535 * Makefile.am: Add copyright notice.
8536 (libfetish_a_SOURCES): Add unlocked-io.h.
8537 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8538 (DISTCLEANFILES, io_functions): Remove macros.
8539 (EXTRA_DIST): Remove gen_uio.
8540 (unlocked-io.h): Remove rule.
8542 2002-12-04 Jim Meyering <jim@meyering.net>
8544 Reflect the fact that stat.c and lstat.c are no longer generated.
8545 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8546 (DISTCLEANFILES): Likewise.
8547 (EXTRA_DIST): Likewise.
8548 (all_local): Don't depend on stat.c or lstat.c.
8549 (stat.c, lstat.c): Remove rules.
8550 (EXTRA_DIST): Remove xstat.in.
8552 * xstat.in: Remove file. Contents moved into stat.c.
8553 * stat.c: New file. Contents mostly from xstat.in.
8554 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8555 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8557 * safe-read.c: Rework so that it may serve to define safe_write, too.
8558 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8560 2002-12-03 Jim Meyering <jim@meyering.net>
8562 * safe-read.c, safe-write.c: Change variable names and comments, but
8563 not semantics, to minimize the differences between these two files.
8564 (safe_read): Change comment to mention SAFE_READ_ERROR.
8566 * safe-read.c (IS_EINTR): Define.
8567 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8569 2002-12-02 Bruno Haible <bruno@clisp.org>
8571 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8572 Define, taken from safe-read.c.
8573 (INT_MAX): Provide fallback.
8574 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8575 * safe-write.h (SAFE_WRITE_ERROR): Define.
8577 * safe-read.c (EINTR): Remove definition.
8578 (safe_read): Don't use EINTR if it is absent.
8580 2002-12-02 Jim Meyering <jim@meyering.net>
8582 * safe-read.c (EINTR): Define.
8583 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8584 (INT_MAX): Provide fallback.
8585 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8587 * safe-read.h (SAFE_READ_ERROR): Define.
8589 2002-12-01 Jim Meyering <jim@meyering.net>
8591 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8592 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8594 2002-11-27 Paul Eggert <eggert@twinsun.com>
8596 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8597 hash_rehash): Replace `if (limit <= value) abort ();' with
8598 `if (! (value < limit)) abort ();', for readability.
8600 2002-11-26 <karl@gnu.org>
8602 * strdup.c: copy from libc again, with jim's ok.
8603 * .cppi-disable: re-add strdup.c
8605 2002-11-25 <karl@gnu.org>
8607 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8608 instead of "strtol.c".
8610 2002-11-25 Jim Meyering <jim@meyering.net>
8612 * mktime.c: Sync from libc, now that it has the latest fix.
8614 2002-11-24 <karl@gnu.org>
8616 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8617 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8619 2002-11-24 Jim Meyering <jim@meyering.net>
8621 Update from coreutils:
8623 * mktime.c: Merge in changes from libc.
8625 Avoid a link-time failure on some Linux systems.
8626 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8627 (__mon_yday): Declare with the STATIC attribute.
8628 (__mktime_internal): Likewise.
8629 Based on a report from Greg Schafer.
8631 2002-11-23 Jim Meyering <jim@meyering.net>
8633 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8634 Use `unsigned', not `int', as type of index.
8636 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8638 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8640 2002-11-22 Paul Eggert <eggert@twinsun.com>
8642 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8643 hint that one should use `if (! x) abort ();' rather than `assert
8644 (x);', and anyway it's one less thing to worry about configuring.
8645 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8646 hash_rehash, hash_insert): Use abort rather than assert.
8648 2002-11-22 Paul Eggert <eggert@twinsun.com>
8650 * quotearg.h: Allow multiple inclusion by surrounding with
8651 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8652 so that we can be included first.
8653 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8654 * quotearg.c: Include quotearg.h immediately after config.h.
8655 No need to include stddef.h or sys/types.h any more.
8656 Surround local include files with "", not "<>".
8657 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8658 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8659 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8660 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8661 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8662 (ISPRINT): Remove; no longer needed now that we assume C89.
8664 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8667 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8668 quotearg_char): Use SIZE_MAX rather than
8669 (size_t) -1 when we are talking about "infinity".
8671 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8673 2002-11-22 Bruno Haible <bruno@clisp.org>
8675 * safe-read.h: Assume C89. Add comments.
8676 (safe_read): Change return type to size_t.
8677 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8678 counts > SSIZE_MAX correctly.
8679 * safe-write.h: New file.
8680 * safe-write.c: New file.
8681 * full-read.h: New file.
8682 * full-read.c: New file.
8683 * full-write.h: Assume C89. Add comments.
8684 * full-write.c: Include safe-write.h.
8685 (full_write): Rewritten to use safe_write.
8686 Suggested by Jim Meyering and Paul Eggert.
8688 2002-11-21 Bruno Haible <bruno@clisp.org>
8690 Remove case insensitive option matching.
8691 * argmatch.h (argcasematch): Remove declaration.
8692 (ARGCASEMATCH): Remove macro.
8693 (__xargmatch_internal): Remove case_sensitive argument.
8694 (XARGMATCH): Update.
8695 (XARGCASEMATCH): Remove macro.
8696 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8697 case_sensitive argument.
8698 (argcasematch): Remove function.
8699 (__xargmatch_internal): Remove case_sensitive argument.
8700 (main): Use XARGMATCH instead of XARGCASEMATCH.
8702 * xmalloc.c: Change compile-time error message. Add comment about
8703 required autoconf version.
8705 2002-11-21 Jim Meyering <jim@meyering.net>
8707 * strdup.c (strdup): Tweak comment and initial #if/#include.
8709 Merge in changes from the coreutils.
8711 2002-09-25 Paul Eggert <eggert@twinsun.com>
8712 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8713 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8714 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8715 int. Work more efficiently if X is the same width as uintmax_t.
8716 Do not compare X to -1, to avoid bogus compiler warning.
8717 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8718 Don't assume that f_frsize and f_bsize are the same type.
8720 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8723 * makepath.c (make_path): Restore umask *before* creating the final
8725 (make_path): Minor reformatting.
8727 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8728 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8730 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8731 ones. At least on GNU/Linux systems, `auto' means something else.
8734 2002-11-20 Paul Eggert <eggert@twinsun.com>
8736 Merge argmatch cleanups from Bison. Assume C89.
8738 * argmatch.c: Include config.h here, not in argmatch.h.
8739 Include stdlib.h, for EXIT_FAILURE.
8740 Always include <string.h>, since we assume C89.
8741 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8742 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8743 Include <stddef.h> instead, since it's all we need for size_t.
8744 (PARAMS): Remove. All uses removed.
8745 (ARRAY_CARDINALITY): Do not bother to #undef.
8746 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8747 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8748 Remove unnecessary parentheses.
8749 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8750 Insert necessary parentheses.
8751 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8752 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8754 2002-11-19 Bruno Haible <bruno@clisp.org>
8756 * mbswidth.c: Include mbswidth.h right at the beginning.
8757 * mbswidth.h: Include <stddef.h>, for size_t.
8759 * mbswidth.h (PARAMS): Remove macro.
8760 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8761 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8763 * gcd.h (PARAMS): Remove macro.
8764 (gcd): Use ANSI C function declarations.
8765 * gcd.c (gcd): Likewise.
8767 2002-11-15 Bruno Haible <bruno@clisp.org>
8769 * strcspn.c: Include <stddef.h>.
8770 (strcspn): Use ANSI C function declaration. Change return type to
8772 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8773 (strpbrk): Use NULL.
8774 * strpbrk.h (PARAMS): Remove macro.
8775 (strpbrk): Use ANSI C function declaration.
8776 * strstr.c: Don't include <sys/types.h>.
8777 * strstr.h (PARAMS): Remove macro.
8778 (strstr): Use ANSI C function declarations.
8780 2002-11-06 Bruno Haible <bruno@clisp.org>
8782 * gcd.h (gcd): Change argument type to 'unsigned long'.
8783 * gcd.c (gcd): Likewise.
8785 2002-11-05 Bruno Haible <bruno@clisp.org>
8787 * gcd.h: New file, from gettext-0.11.5.
8788 * gcd.c: New file, from gettext-0.11.5.
8790 2002-11-05 Bruno Haible <bruno@clisp.org>
8792 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8793 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8794 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8795 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8797 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8798 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8800 * closeout.c: Include gettext.h instead of <libintl.h>.
8801 * human.c: Include gettext.h instead of <libintl.h>.
8802 * quotearg.c: Include gettext.h instead of <libintl.h>.
8803 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8804 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8805 * userspec.c: Include gettext.h instead of <libintl.h>.
8806 * version-etc.c: Include gettext.h instead of <libintl.h>.
8807 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8808 (textdomain): Remove definition.
8809 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8811 * long-options.c: Remove include of <libintl.h> and definition of _.
8812 * same.c: Remove include of <libintl.h> and definition of _.
8814 2002-11-04 Bruno Haible <bruno@clisp.org>
8816 * stpcpy.h: New file, from GNU gettext-0.11.5.
8817 * strcase.h: New file, from GNU gettext-0.11.5.
8818 * strpbrk.h: New file, from GNU gettext-0.11.5.
8819 * strstr.h: New file, from GNU gettext-0.11.5.
8820 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8822 2002-05-09 Bruno Haible <bruno@clisp.org>
8824 * config.charset: Update for newest glibc. Add canonical names
8825 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8827 2002-05-09 Bruno Haible <bruno@clisp.org>
8829 * localcharset.c (get_charset_aliases): Add more Windows specific
8832 2002-05-08 Owen Taylor <otaylor@redhat.com>
8834 * config.charset: A few additions for Solaris.
8836 2001-12-05 Bruno Haible <bruno@clisp.org>
8838 * localcharset.c (locale_charset): Don't return an empty string.
8840 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8842 * config.charset: msdos in uk_UA uses CP1125.
8844 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8846 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8847 * localcharset.c (locale_charset): Declare as extern "C".
8849 2002-02-15 Bruno Haible <bruno@clisp.org>
8851 * config.charset [msdosdjgpp]: For Russian, use CP866.
8853 2002-02-11 Bruno Haible <bruno@clisp.org>
8855 * config.charset: Add support for NetBSD.
8857 2002-09-25 <karl@gnu.org>
8859 * strdup.c: copy from libc/string (via ../config/srclist*).
8860 * getopt*: copy from libc/posix.
8861 * gettext.h: copy from gettext.
8862 * .cppi-disable: add strdup.c, gettext.h.
8864 2002-07-01 Jim Meyering <meyering@lucent.com>
8866 * c-stack.c: Include sys/time.h.
8867 From Volker Borchert.
8869 2002-06-11 Paul Eggert <eggert@twinsun.com>
8871 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8872 New macro. Use it uniformly instead of
8873 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8874 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8875 reported by Vin Shelton.
8877 2002-06-22 Jim Meyering <meyering@lucent.com>
8879 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8880 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8882 2002-06-22 Paul Eggert <eggert@twinsun.com>
8884 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8885 Do not assume SA_SIGINFO behavior.
8886 Bug reported by Jim Meyering on NetBSD 1.5.2.
8888 2002-06-22 Jim Meyering <meyering@lucent.com>
8890 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8892 * exitfail.c, exitfail.h: Likewise.
8893 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8895 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8897 (EXTRA_DIST): Add fnmatch_loop.c.
8898 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8900 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8901 * fnmatch.c: Update from diffutils-2.8.2.
8902 * fnmatch_.h: New file. From diffutils-2.8.2.
8903 * fnmatch.h: Remove file.
8905 2002-06-18 Paul Eggert <eggert@twinsun.com>
8907 * file-type.h: Report an error if neither S_ISREG nor
8908 S_IFREG is defined, instead of using a test specific to glibc
8909 2.2. This should be safe, since POSIX requires S_ISREG and
8910 Unix Version 7 had S_IFREG. We don't need to check for
8911 <sys/types.h> since we don't use any symbols that it defines.
8913 2002-06-15 Jim Meyering <meyering@lucent.com>
8915 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8916 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8917 have been included before this file.
8919 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8921 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8922 so that each temporary file name is unique and valid in the first
8923 8 characters, for operation under DOS.
8925 2002-06-15 Jim Meyering <meyering@lucent.com>
8927 Work even with DJGPP 2.03, which lacks support for symlinks.
8929 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8931 * lchown.c (S_ISLNK): Likewise.
8933 2002-06-14 Jim Meyering <meyering@lucent.com>
8935 * file-type.h: Use the version from diffutils-2.8.2.
8936 * file-type.c: Likewise.
8938 2002-05-27 Jim Meyering <meyering@lucent.com>
8940 Fix a problem seen only on nonconforming systems whereby ls.c's
8941 use of localtime, and then of gettimeofday would cause trouble:
8942 the localtime call used to initialize rpl_gettimeofday's save
8943 mechanism would clobber ls's current local time information so
8944 that in any long listing the first file would always be listed
8945 with date 1970-01-01. Analysis by Volker Borchert.
8947 * gettimeofday.c (localtime): Undefine.
8948 (rpl_localtime): New function.
8950 2002-05-22 Jim Meyering <meyering@lucent.com>
8952 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8953 * file-type.h: New file.
8954 * file-type.c (file_type): New file/function. Extracted from diffutils.
8956 2002-04-29 Paul Eggert <eggert@twinsun.com>
8958 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8960 2002-04-28 Paul Eggert <eggert@twinsun.com>
8962 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8963 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8964 of 127, since 64 is the largest conceivable number for ancient
8966 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8968 2002-04-28 Jim Meyering <meyering@lucent.com>
8970 * sig2str.c (WTERMSIG): Remove definition (unused).
8972 2002-04-28 Paul Eggert <eggert@twinsun.com>
8974 * sig2str.h, sig2str.c: New files.
8975 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8977 2002-04-24 Jim Meyering <meyering@lucent.com>
8979 * gettext.h: New file, from Gettext.
8980 * Makefile.am (INCLUDES): Remove -I../intl.
8981 (libfetish_a_SOURCES): Add gettext.h.
8983 2002-04-16 Jim Meyering <meyering@lucent.com>
8985 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8986 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8987 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8989 2002-04-12 Jim Meyering <meyering@lucent.com>
8991 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8993 2002-03-10 Jim Meyering <meyering@lucent.com>
8995 * makepath.c (make_path): Remove a comma from a diagnostic.
8996 Suggestion from Santiago Vila.
8998 2002-03-08 Jim Meyering <meyering@lucent.com>
9000 * rename.c: Mention that this wrapper is needed also on
9001 mips-dec-ultrix4.4 systems.
9003 2002-03-02 Jim Meyering <meyering@lucent.com>
9005 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
9006 not HAVE_CLOCK_SETTIME.
9008 2002-02-27 Paul Eggert <eggert@twinsun.com>
9010 * nanosleep.h: Rename to....
9011 * timespec.h: New name for nanosleep.h. All uses changed.
9013 * gettime.c: New file.
9014 * settime.c: New file.
9017 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9018 timespec.h. Remove nanosleep.h.
9020 2002-02-25 Paul Eggert <eggert@twinsun.com>
9022 * acl.c, acl.h: New files.
9023 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9025 2002-02-24 Jim Meyering <meyering@lucent.com>
9027 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9028 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9029 cause trouble. Reported by Nelson Beebe.
9031 2002-02-23 Paul Eggert <eggert@twinsun.com>
9033 * path-concat.c (xpath_concat): Reorder code to pacify
9034 compilers that don't know that xalloc_die never returns.
9036 2002-02-20 Jim Meyering <meyering@lucent.com>
9038 * getdate.c: Regenerate using bison-1.33.
9040 2002-02-15 Paul Eggert <eggert@twinsun.com>
9042 * posixver.c, posixver.h: New files.
9043 * Makefile.am (libfetish_a_SOURCES): Add them.
9045 2002-02-02 Paul Eggert <eggert@twinsun.com>
9046 Bruno Haible <bruno@clisp.org>
9048 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9049 (fwrite_success_callback): New declaration.
9050 * unicodeio.c (unicode_to_mb): New function, extracted from
9051 print_unicode_char. Call failure callback instead of error.
9052 (fwrite_success_callback): New function.
9053 (exit_failure_callback): New function.
9054 (fallback_failure_callback): New function.
9055 (print_unicode_char): Call unicode_to_mb.
9057 2002-01-26 Jim Meyering <meyering@lucent.com>
9059 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9061 2002-01-22 Jim Meyering <meyering@lucent.com>
9063 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9064 Otherwise, some versions of automake would omit the rule that makes
9065 Makefile from Makefile.in.
9067 2001-01-21 Paul Eggert <eggert@twinsun.com>
9069 * xmemcoll.h, xmemcoll.c: New files.
9070 * Makefile.am (libfetish_a_SOURCES): Add them.
9071 * memcoll.c: Include errno.h, and declare errno if not defined.
9072 (memcoll): Set errno to zero if there is no error.
9074 * quotearg.c (quotearg_buffer_restyled):
9075 Fix bug with quoting buffers containing NUL when backslashing escapes.
9076 This bug was exposed by the other changes in this patch.
9077 (quotearg_n_options): New arg ARGSIZE.
9078 All callers changed.
9079 (quoting_options_from_style): New function.
9080 (quotearg_n_style): Use it.
9081 (quotearg_n_style_mem): New function.
9083 * quotearg.h (quotearg_n_style_mem): New function.
9085 2002-01-16 Jim Meyering <meyering@lucent.com>
9087 * getdate.y: Add three semicolons, each just before a closing brace.
9088 Bison (as of version 1.31) no longer papers over that mistake.
9090 2002-02-14 Paul Eggert <eggert@twinsun.com>
9092 * backupfile.c (ISDIGIT): Comment fix.
9093 * getdate.y (ISDIGIT): Likewise.
9094 * posixtm.c (ISDIGIT, year): Likewise.
9095 * strverscmp.c (ISDIGIT): Likewise.
9096 * userspec.c (ISDIGIT): Likewise.
9098 2002-01-05 Jim Meyering <meyering@lucent.com>
9100 * version-etc.c (version_etc_copyright): Update copyright year.
9102 2001-01-19 Paul Eggert <eggert@twinsun.com>
9104 * closeout.c (close_stdout_status): If ferror (stdout), do
9105 not silently exit merely because the output buffer happens to
9106 have nothing pending.
9108 2001-12-18 Paul Eggert <eggert@twinsun.com>
9110 See the big note in ../ChangeLog.
9111 * human.c (suffixes): Prefer K to k for 1024.
9112 (generate_suffix_backwards): New function.
9113 (human_readable_inexact): Use it.
9114 * xstrtol.c (__xstrtol): If there is no number but there
9115 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9116 Accept 'K' as well as 'k'.
9118 2001-12-15 Jim Meyering <meyering@lucent.com>
9120 * regex.h (__restrict_arr): Update from libc.
9122 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9123 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9126 2001-12-10 Jim Meyering <meyering@lucent.com>
9128 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9129 Instead, include "xalloc.h".
9130 (initbuffer): Don't cast xmalloc return value to char*.
9131 (readline): Reword comment.
9132 Don't cast xrealloc return value to char*
9135 2001-12-09 Jim Meyering <meyering@lucent.com>
9137 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9138 `signed and unsigned type in conditional expression'.
9139 * posixtm.c (posix_time_parse): Likewise.
9141 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9143 * readtokens.c (readtoken): Declare an index to be of type unsigned
9144 to avoid a pedantic warning.
9146 * getstr.c: Don't include assert.h.
9147 (getstr): Remove warning-evoking assertions.
9148 Return -1 if offset parameter is out of bounds.
9149 Change the type of a local from int to size_t.
9151 * strftime.c (my_strftime_localtime_r): Include this function
9152 definition in the `#if ! HAVE_TM_GMTOFF' block.
9154 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9155 Include xalloc.h instead.
9157 2001-12-02 Jim Meyering <meyering@lucent.com>
9159 * tempname.c: Don't declare getenv, thus reverting the change of
9160 2001-11-18. It's no longer necessary, now that stdlib.h is always
9163 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9164 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9166 2001-11-30 Akim Demaille <akim@epita.fr>
9168 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9169 before being defined.
9171 2001-11-27 Paul Eggert <eggert@twinsun.com>
9173 * quotearg.h (quotearg_n, quotearg_n_style):
9174 First arg is int, not unsigned.
9175 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9176 (SIZE_MAX, UINT_MAX): New macros.
9177 (quotearg_n_options): Abort if N is negative.
9178 Avoid overflow check on hosts where size_t is 64 bits and int
9179 is 32 bits, as overflow is impossible there.
9180 Fix off-by-one typo that caused unnecessary reallocation.
9182 2001-11-27 Jim Meyering <meyering@lucent.com>
9184 * tempname.c: Merge with version from libc.
9185 * regex.c: Likewise.
9187 * tempname.c: Include stdlib.h unconditionally. On some old systems
9188 for which STDC_HEADERS is 0, it was not included, resulting in a
9189 warning about an integer-to-pointer conversion problem with getenv.
9190 Reported by Volker Borchert.
9192 2001-11-26 Jim Meyering <meyering@lucent.com>
9194 * gtod.h: Remove file.
9195 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9196 * gettimeofday.c: Don't include gtod.h.
9197 (GTOD_init): Remove function.
9198 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9199 Suggestion from Volker Borchert.
9201 2001-11-23 Jim Meyering <meyering@lucent.com>
9203 * hash.h (struct hash_table): Don't define here. Merely declare it.
9204 * hash.c (struct hash_table): Define it here instead.
9206 2001-11-22 Jim Meyering <meyering@lucent.com>
9208 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9210 2001-11-18 Paul Eggert <eggert@twinsun.com>
9212 * tempname.c (TMP_MAX): Remove; no longer needed.
9213 (TEMPORARIES): New macro.
9214 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9215 removes an artificial limitation (e.g. HP-UX 10.20, where
9218 2001-11-18 Jim Meyering <meyering@lucent.com>
9220 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9223 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9224 files will be created before anything else.
9226 2001-11-17 Jim Meyering <meyering@lucent.com>
9228 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9229 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9230 rather than group writable. Patch by Juan F. Codagnone.
9232 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9233 Instead, include "xalloc.h".
9235 * mountlist.c: Include unlocked-io.h after all system headers.
9236 Remove explicit declarations of xmalloc, xrealloc,
9237 and xstrdup. Instead, include "xalloc.h".
9239 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9240 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9241 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9243 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9244 Reported by Padraig Brady.
9246 * mkstemp.c: #undef mkstemp.
9248 (rpl_mkstemp): Rename from mkstemp.
9251 2001-11-16 Jim Meyering <meyering@lucent.com>
9253 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9254 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9255 determine the amount of total physical memory, use pstat_getstatic.
9256 HPUX-11 doesn't define _SC_PHYS_PAGES.
9257 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9258 If sysconf couldn't be used to determine the amount of available
9259 physical memory, use both pstat_getstatic and pstat_getdynamic.
9260 Based on a patch from Bob Proulx.
9262 2001-11-05 Jim Meyering <meyering@lucent.com>
9264 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9266 2001-11-03 Jim Meyering <meyering@lucent.com>
9268 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9269 in argmatch_to_argument call.
9271 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9274 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9275 e.g., a fault due to an attempt to free a NULL pointer.
9277 2001-11-01 Jim Meyering <meyering@lucent.com>
9279 * dirfd.c, dirfd.h: New files.
9280 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9282 * hash.c (hash_print) [TESTING]: Clean up.
9284 2001-10-22 Paul Eggert <eggert@twinsun.com>
9286 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9287 to avoid a warning if -Wall.
9289 2001-10-21 Paul Eggert <eggert@twinsun.com>
9291 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9293 2001-10-21 Jim Meyering <meyering@lucent.com>
9295 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9296 this code would end up calling gettext even in packages built
9298 * getopt.c (_): Likewise.
9299 * regex.c (_): Likewise.
9301 2001-10-20 Paul Eggert <eggert@twinsun.com>
9303 * error.c (strerror_r): Do not declare unless !_LIBC.
9304 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9305 Use strerror_r that is only a macro, even if it is not a function.
9306 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9307 (private_strerror): Use prototypes, not old-style function definition.
9308 (print_errno_message): New function.
9309 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9311 (error_tail, error, error_at_line): Use it.
9313 2001-10-11 Jim Meyering <meyering@lucent.com>
9315 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9316 and quote_n (1, ... to avoid clobbering a buffer.
9318 2001-10-05 Jim Meyering <meyering@lucent.com>
9320 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9321 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9322 * hash-pjw.h: New file.
9324 2001-09-30 Jim Meyering <meyering@lucent.com>
9326 * mountlist.c [MOUNTED_GETFSSTAT]:
9327 Include <sys/ucred.h>, for Apple Darwin.
9328 Include sys/mount.h and sys/fs_types.h only if available.
9330 (read_filesystem_list): Use FS_TYPE.
9332 2001-09-29 Paul Eggert <eggert@twinsun.com>
9334 * exclude.c (excluded_filename): 0 -> false, since it's
9337 2001-09-28 Paul Eggert <eggert@twinsun.com>
9339 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9340 #defines strtoimax. Also treat the other strto* functions
9343 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9344 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9345 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9347 2001-09-26 Jim Meyering <meyering@lucent.com>
9349 Most macros in unlocked-io.h had the wrong number of arguments.
9350 * gen-uio: New script.
9351 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9352 * unlocked-io.hin: Remove file.
9353 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9354 rather than trying to embed it here.
9355 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9356 Reported by Padraig Brady.
9358 2001-09-25 Volker Borchert <bt@teknon.de>
9360 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9362 2001-09-23 Jim Meyering <meyering@lucent.com>
9364 * mountlist.c: Remove useless parentheses in #if directives.
9365 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9366 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9368 2001-09-22 Jim Meyering <meyering@lucent.com>
9370 * localcharset.c: Update from latest gettext.
9371 * config.charset: Likewise.
9373 2001-09-20 Jim Meyering <meyering@lucent.com>
9375 * xstrtol.c (strtoimax): Guard declaration with
9376 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9377 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9378 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9379 (strtoumax): Likewise, for completeness (it wasn't necessary).
9381 2001-09-06 Paul Eggert <eggert@twinsun.com>
9383 * strtoimax.c (HAVE_LONG_LONG):
9384 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9385 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9386 to work around bug in IBM C compiler.
9388 2001-09-16 Jim Meyering <meyering@lucent.com>
9390 * mkdir.c: New file.
9392 2001-09-04 Paul Eggert <eggert@twinsun.com>
9394 * xgetcwd.c: Revert some of the previous change; intead,
9395 fix the HAVE_GETCWD_NULL code to behave more like the
9396 !HAVE_GETCWD_NULL code used to.
9399 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9402 2001-09-04 Paul Eggert <eggert@twinsun.com>
9404 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9405 Use ssize_t, not int, to store result of readlink.
9406 Check for ssize_t overflow as well as size_t overflow,
9407 as POSIX says the result of readlink is implementation-defined
9408 when ssize_t overflows.
9409 Remove unnecessary cast to char*.
9410 Use free+malloc instead of realloc, as the storage doesn't need
9411 to be preserved and it's clearer and can be more efficient that way.
9412 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9413 * xreadlink.h (xreadlink): Update prototype.
9415 2001-09-03 Paul Eggert <eggert@twinsun.com>
9417 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9418 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9419 spotted by Jim Meyering.
9421 2001-09-03 Jim Meyering <meyering@lucent.com>
9423 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9425 2001-09-03 Paul Eggert <eggert@twinsun.com>
9427 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9428 like the HAVE_GETCWD_NULL code.
9429 Include pathmax.h if not HAVE_GETCWD.
9430 Do not include xalloc.h.
9431 (INITIAL_BUFFER_SIZE): New symbol.
9432 Do not use xmalloc / xrealloc, since the caller is responsible for
9433 handling errors. Preserve errno around `free' during failure.
9434 Do not overrun buffer when using getwd.
9436 2001-09-03 Paul Eggert <eggert@twinsun.com>
9438 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9439 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9441 2001-09-02 Jim Meyering <meyering@lucent.com>
9443 * error.c: Update from GNU libc.
9445 2001-09-01 Jim Meyering <meyering@lucent.com>
9447 * xreadlink.c: New file.
9448 * xreadlink.h: New file.
9449 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9451 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9452 doesn't conflict with sparc Solaris 7's definition in
9453 /usr/include/sys/int_types.h.
9455 * exclude.c: Use `""', not `<>' to #include non-system header files.
9456 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9457 and strncasecmp as r-values. Unixware didn't have declarations.
9459 2001-08-31 Jim Meyering <meyering@lucent.com>
9461 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9462 Use an initial, malloc'd, buffer of length 128 rather than
9463 a statically allocated one of length 1024.
9465 2001-08-30 Paul Eggert <eggert@twinsun.com>
9467 * xgetcwd.c: Don't include pathmax.h.
9468 Include stdlib.h and unistd.h if available.
9470 (xmalloc, xstrdup, free): Remove decls.
9471 (xgetcwd): Don't assume sizes fit in unsigned.
9472 Check for overflow when computing sizes.
9473 Simplify reallocation code.
9475 2001-08-28 Paul Eggert <eggert@twinsun.com>
9477 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9479 * strtoimax.c: Renamed from strtoxmax.c, removing the
9482 Also, make the following further changes to make this file's
9483 configuration more similar to that of strtol.c:
9484 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9485 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9486 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9487 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9488 changed to signed values.
9490 And make the following changes as well:
9491 Fix copyright notice, as 1999 was missing.
9492 (verify): New macro.
9493 (strtoimax): Check sizes at compile-time, not run-time.
9494 Prefer strtol to strtoll if both work.
9495 (main): Remove; it was not that useful and was a pain to maintain.
9497 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9499 2001-08-30 Paul Eggert <eggert@twinsun.com>
9501 * savedir.c (savedir): Remove size parameter, as POSIX says that
9502 a directory's st_size can have an arbitrary value, so the old
9503 usage could waste an arbitrary amount of memory. All uses
9505 * savedir.h: Update prototype.
9507 2001-08-30 Paul Eggert <eggert@twinsun.com>
9509 * xstrtol.c (strtoimax): New decl.
9511 2001-08-28 Paul Eggert <eggert@twinsun.com>
9513 * xstrtol.h: Add copyright notice.
9514 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9515 LONGINT_INVALID_SUFFIX_CHAR.
9517 2001-08-30 Paul Eggert <eggert@twinsun.com>
9519 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9522 2001-08-30 Paul Eggert <eggert@twinsun.com>
9524 * hash.c: Remove '2001' from copyright notice.
9526 2001-08-30 Paul Eggert <eggert@twinsun.com>
9528 * full-write.h: New file.
9529 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9530 * full-write.c: Correct credits, as cccp.c no longer
9531 exists and anyway it was so heavily changed from the old cccp
9532 code as to be unrecognizable. Include full-write.h.
9533 (full_write) Return size_t, with short writes meaning failure.
9534 All callers changed. This fixes a bug with large buffers
9536 * utime.c: Include full-write.h.
9538 2001-08-30 Paul Eggert <eggert@twinsun.com>
9540 Merge 'exclude' changes from tar 1.13.22.
9541 This fixes one or two unlikely storage allocation overflow bugs,
9542 but doesn't change user-visible behavior otherwise.
9544 2001-08-30 Paul Eggert <eggert@twinsun.com>
9546 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9547 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9548 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9549 Include if available.
9550 (<xalloc.h>): Include
9551 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9552 (verify): New macro. Use it to verify that EXCLUDE macros do not
9553 collide with FNM macros.
9554 (struct patopts): New struct.
9555 (struct exclude): Use it, as exclude patterns now come with options.
9556 (new_exclude): Support above changes.
9557 (new_exclude, add_exclude_file):
9558 Initial size must now be a power of two to simplify overflow checking.
9559 (free_exclude, fnmatch_no_wildcards): New function.
9560 (excluded_filename): No longer requires options arg, as the options
9561 are determined by add_exclude. Now returns bool, not int.
9562 (excluded_filename, add_exclude):
9563 Add support for the fancy new exclusion options.
9564 (add_exclude, add_exclude_file): Now takes int options arg.
9565 Check for arithmetic overflow when computing sizes.
9566 (add_exclude_file): xrealloc might modify errno, so don't
9567 realloc until after errno might be used.
9569 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9571 (free_exclude): New decl.
9572 (add_exclude, add_exclude_file): Now takes int options arg.
9573 (excluded_filename): No longer requires options arg, as the options
9574 are determined by add_exclude. Now returns bool, not int.
9576 2001-08-30 Paul Eggert <eggert@twinsun.com>
9578 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9580 2001-08-27 Jim Meyering <meyering@lucent.com>
9582 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9584 * version-etc.c (N_): Remove definition.
9585 Revert most of last change.
9586 Instead, simply don't mark the `Copyright...' string for translation.
9587 Based on advice from Paul Eggert.
9589 * strtoxmax.c: Tweak comment.
9591 2001-08-26 Jim Meyering <meyering@lucent.com>
9593 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9594 of copyright with `%s' so translators don't get an untranslated
9596 (COPYRIGHT_YEAR): Define.
9597 (version_etc): Use fprintf rather than fputs.
9598 Suggestion from Ulrich Drepper.
9600 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9602 * strtoll.c: New file, from GNU libc.
9603 * xstrtoimax.c: New file.
9605 * xstrtol.h: Add xstrtoimax.
9606 * strtoumax.c: New file. Simply include "strtoumax.c".
9607 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9609 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9610 * strtoxmax.c: ... then renamed to this.
9612 2001-08-13 Paul Eggert <eggert@twinsun.com>
9614 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9615 Port to Solaris 8, where 'sed' requires a space after the 'r'
9616 command, and where sh dislikes "$/". Clean up the spacing a bit.
9617 Redirect output to $tmp just once.
9619 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9621 * addext.c (<errno.h>): Include.
9622 (errno): Declare if not defined.
9623 (addext): Work correctly when pathconf returns -1 and leaves
9624 errno alone because there is no limit. Also, work even if
9625 pathconf returns a value greater than SIZE_MAX.
9627 2001-08-12 Jim Meyering <meyering@lucent.com>
9629 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9630 Simply `return getcwd (NULL, 0);'.
9631 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9632 Use 1300 as initial value for length, not PATH_MAX.
9634 * pathmax.h: Clean up cpp syntax.
9636 2001-08-12 Jim Meyering <meyering@lucent.com>
9638 * gettimeofday.c: New file.
9640 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9642 2001-08-04 Jim Meyering <meyering@lucent.com>
9644 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9645 to get in sync with glibc.
9647 2001-08-03 Paul Eggert <eggert@twinsun.com>
9649 The following changes are from gettext 0.10.39 as maintained by
9652 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9653 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9654 with inverted sense. All uses changed.
9656 * mbswidth.c: Don't include <limits.h>.
9657 Include <stdlib.h> and <string.h> unconditionally.
9658 (iswcntrl, mbsinit, ISCNTRL): New macros.
9659 (mbsnwidth): Use K&R style function declarations.
9660 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9661 can optimize it when MB_CUR_MAX == 1.
9662 The width of control characters is zero, not 1.
9664 2001-07-15 Jim Meyering <meyering@lucent.com>
9666 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9667 (BUILT_SOURCES): Add unlocked-io.h.
9668 (io_functions): Define.
9669 (unlocked-io.h): New rule.
9670 (DISTCLEANFILES): Add unlocked-io.h.
9671 (all-local): Depend on unlocked-io.h, to ensure it is created.
9673 * unlocked-io.hin: New file
9675 * regex.c: Update from glibc.
9677 2001-07-05 Jim Meyering <meyering@lucent.com>
9679 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9681 (libfetish_a_SOURCES): Put all .h files here instead.
9682 Remove a thus-exposed (better checks in automake) duplicate and
9683 two unnecessary .h files.
9685 2001-06-11 Jim Meyering <meyering@lucent.com>
9687 * regex.c: Update from GNU libc.
9689 2001-05-27 Jim Meyering <meyering@lucent.com>
9691 * readutmp.h (UT_TYPE): Define.
9693 2001-05-24 Jim Meyering <meyering@lucent.com>
9695 * argmatch.c: Include "quote.h".
9696 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9697 quote function. Reported by Göran Uddeborg.
9699 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9701 * dirname.c (dir_name): Compute append_dot using path, not newpath
9702 which is not yet declared.
9704 2001-05-11 Paul Eggert <eggert@twinsun.com>
9706 * Makefile.am (libfetish_a_SOURCES):
9707 Add strftime.c, since we now compile it on all hosts.
9709 * strftime.c (my_strftime):
9710 Define to nstrftime if emacs, but only if my_strftime is not defined.
9711 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9712 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9713 Add one more extra argument: a nanoseconds value.
9716 (my_strftime function): Add %N format.
9717 (emacs_strftimeu): Renamed from emacs_strftime,
9718 with extra ut argument.
9720 2001-05-11 Paul Eggert <eggert@twinsun.com>
9722 dirname code cleanup. base_name now behaves more compatibly
9723 with POSIX basename when given file names that have trailing
9724 slashes, and similarly for dir_name. Add new primitives
9725 base_len and dir_len. Put the directory-name-related decls
9728 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9729 * backupfile.c (base_name): Likewise.
9730 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9731 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9732 * makepath.c (strip_trailing_slashes): Likewise.
9733 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9735 * rename.c (strip_trailing_slashes): Likewise.
9736 * same.c (base_name): Likewise.
9737 * stripslash.c (ISSLASH): Likewise.
9739 * addext.c: Include <dirname.h> after size_t is defined.
9740 * backupfile.c: Likewise.
9742 * addext.c (addext): Use base_len to trim redundant
9743 trailing slashes instead of doing it ourselves.
9744 But do not trim the last slash if it is not redundant.
9746 * backupfile.c (find_backup_file_name,
9747 max_backup_version): Use base_len instead of rolling it ourselves.
9748 Handle the case of "" and (on DOS) "C:" correctly.
9750 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9751 Include <string.h>, <dirname.h>.
9752 (base_name): Allow file names ending in slashes, other than names
9753 that are all slashes. In this case, return the basename followed
9754 by the slashes. This is more general, and can be used in places
9755 where the original base_name purposely had an assertion failure.
9756 (base_len): New function.
9758 * dirname.c: Include <string.h> instead of <stdlib.h>.
9759 Do not include <assert.h>; no longer needed.
9761 (memrchr): Remove decl.
9762 (dir_name_r): Remove.
9763 (dir_len): Renamed from dirlen. All callers changed.
9764 Rewrite in terms of base_name, for simplicity and consistency.
9765 (dir_name): Never return NULL. All callers changed.
9766 Do not include <stdlib.h> in test program; no longer needed.
9767 return 0; is fine for test program.
9769 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9771 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9773 * path-concat.c (path_concat): Use base_len to compute
9774 base length, not strlen; this means we cannot rely on memcpy
9777 * same.c (STREQ): Remove.
9778 (same_name): Handle the case where the basename ends in trailing '/'.
9780 * stripslash.c (strip_trailing_slashes): Return nonzero if
9781 a slash was stripped. Do not strip the last slash after a
9784 2001-04-08 Jim Meyering <meyering@lucent.com>
9786 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9787 recomputed; that's necessary when the offset spans a DST transition.
9788 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9790 2001-04-02 Jim Meyering <meyering@lucent.com>
9792 * regex.h, regex.c: Update from GNU libc.
9794 2001-03-19 Paul Eggert <eggert@twinsun.com>
9796 * version-etc.c (version_etc_copyright): Update to 2001.
9798 2001-03-16 Paul Eggert <eggert@twinsun.com>
9800 * tempname.c (uint64_t): Define to uintmax_t if
9801 not defined, and if UINT64_MAX is not defined.
9802 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9803 Reported by John David Anglin.
9805 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9807 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9808 alias if codeset is empty.
9809 * config.charset (BeOS): Use wildcard syntax.
9811 2001-03-13 Jim Meyering <meyering@lucent.com>
9813 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9814 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9817 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9819 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9821 * unicodeio.c (print_unicode_char): Simplify accordingly.
9823 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9825 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9826 support for DOS/DJGPP.
9828 2001-02-28 Paul Eggert <eggert@twinsun.com>
9830 * Makefile.am (libfetish_a_SOURCES):
9831 Add dup-safer.c, fopen-safer.c.
9832 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9834 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9836 2001-02-25 Paul Eggert <eggert@twinsun.com>
9838 The mkstemp replacement is taken from glibc 2.2.2, with some
9839 portability fixes for use outside glibc, as follows:
9841 * tempname.c (struct_stat64): New macro.
9842 (direxists, __gen_tempname): Use it.
9843 This avoids a portability problem with Solaris 8.
9845 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9846 (<stddef.h>, <stdint.h>, <string.h>):
9847 Include only if STDC_HEADERS || _LIBC.
9848 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9849 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9850 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9851 (__set_errno): Define this macro if <errno.h> doesn't.
9852 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9853 Define these macros if <stdio.h> doesn't.
9854 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9855 Define these macros if <sys/stat.h>
9856 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9857 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9858 __xstat64): Define if not _LIBC.
9859 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9860 (__gen_tempname): Invoke gettimeofday only if
9861 HAVE_GETTIMEOFDAY || _LIBC;
9862 otherwise, fall back on plain "time".
9863 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9865 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9867 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9869 2001-02-17 Jim Meyering <meyering@lucent.com>
9871 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9872 around included file name.
9874 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9876 * strftime.c: Update from GNU libc (the only changes were to comments).
9878 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9880 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9882 2001-02-17 Paul Eggert <eggert@twinsun.com>
9884 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9885 Remove workaround macros for hosts that have mbrtowc but not
9886 mbstate_t, as we now insist on proper declarations for both
9887 before using mbrtowc.
9889 2001-02-17 Jim Meyering <meyering@lucent.com>
9891 * regex.c: Update from libc.
9893 2001-02-16 Paul Eggert <eggert@twinsun.com>
9895 * alloca.c (malloc): Undef before defining, since stdlib.h
9896 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9897 Reported by Mark Hounschell via Paul Eggert.
9899 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9901 * config.charset: Update for FreeBSD 4.2.
9903 2001-01-26 Jim Meyering <meyering@lucent.com>
9905 * quotearg.c: Include stddef.h.
9906 * quote.c: Include stddef.h.
9907 Reported by Axel Kittenberger.
9909 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9910 line in double quotes so that it evokes a better diagnostic.
9911 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9912 Reported by Axel Kittenberger.
9914 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9916 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9917 to avoid a warning. Add back 'const' to inptr.
9919 2001-01-16 Jim Meyering <meyering@lucent.com>
9921 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9924 2001-01-14 Jim Meyering <meyering@lucent.com>
9926 * rename.c: New file. From Volker Borchert.
9927 Include stdlib.h, string.h or strings.h, and xalloc.h.
9928 Use strip_trailing_slashes rather than open-coding it.
9930 2001-01-03 Paul Eggert <eggert@twinsun.com>
9932 * strftime.c: Sync with glibc time/strftime.c 1.81.
9934 2001-01-03 Jim Meyering <meyering@lucent.com>
9936 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9937 local `inptr' to avoid warning with some system declarations of iconv.
9939 2000-12-29 Paul Eggert <eggert@twinsun.com>
9941 * modechange.c: Do not assume that mode_t uses the
9942 traditional octal encoding. E.g. "chmod 1 FOO" should set
9943 the other-execute bit of FOO even if S_IXOTH != 1.
9945 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9946 WOTH, XOTH, ALLM): New macros.
9947 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9948 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9950 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9951 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9953 No need to use uintmax_t; unsigned long is long enough.
9954 Don't bother to get suffix since we don't use it.
9956 2000-12-24 Jim Meyering <meyering@lucent.com>
9958 * hash.c (is_prime): Return explicit boolean values.
9959 (hash_get_first): Return NULL to appease Irix5.6's 89.
9960 Reported by Nelson Beebe.
9962 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9964 * localcharset.c (locale_charset): Add support for Win32.
9966 2000-12-18 Paul Eggert <eggert@twinsun.com>
9968 * physmem.h, physmem.c: New files.
9970 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9971 (noinst_HEADERS): Add physmem.h.
9973 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9974 't' for compatibility with Solaris 8 sort.
9976 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9978 * config.charset: Add support for BeOS.
9980 2000-12-16 Jim Meyering <meyering@lucent.com>
9982 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9983 SHELLS_FILE to a file name that's useful on djgpp systems.
9985 (ADDITIONAL_DEFAULT_SHELLS): Define.
9986 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9987 Based mostly on a patch from Prashant TR.
9989 2000-12-16 Jim Meyering <meyering@lucent.com>
9991 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9992 N and M) would have treated it like `chown N:N FILE'.
9994 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9996 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9998 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9999 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
10000 to the list of canonical encodings. Rename EUC-CN to GB2312.
10002 2000-12-08 Andreas Schwab <schwab@suse.de>
10004 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
10005 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
10007 2000-12-07 Jim Meyering <meyering@lucent.com>
10009 * stripslash.c (ISSLASH): Define.
10010 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
10013 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
10014 (dir_name_r): Declare this function as static.
10015 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10016 manifest itself on a name containing a mix of slashes and
10018 Make this function work with names starting with a DOS-style
10019 drive letter and colon prefix.
10020 (dir_name): Append `.' if necessary.
10021 Based mostly on patches from Prashant TR and Eli Zaretskii.
10023 * dirname.h (dir_name_r): Remove prototype.
10025 2000-12-05 Jim Meyering <meyering@lucent.com>
10027 * dirname.c (dir_name_r): Add `const' in a few local declarations.
10029 2000-12-04 Jim Meyering <meyering@lucent.com>
10031 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10032 Also include memory.h, stdlib.h, unistd.h if appropriate.
10033 Reported by Andreas Jaeger (conflicting declaration of malloc).
10035 2000-12-02 Jim Meyering <meyering@lucent.com>
10037 * closeout.h: Make idempotent, to avoid some obscure warnings.
10039 2000-12-01 Paul Eggert <eggert@twinsun.com>
10041 * memrchr.c: Include <config.h> before any system include file.
10043 2000-11-29 Paul Eggert <eggert@twinsun.com>
10045 * dirname.c (dir_name_r): Fix typo: int -> size_t.
10047 2000-11-26 Jim Meyering <meyering@lucent.com>
10049 * memcoll.c: Include sys/types.h. From Werner Almesberger.
10051 2000-11-22 Paul Eggert <eggert@twinsun.com>
10053 * strftime.c (my_strftime): Do not invoke mbrlen with a
10054 size of (size_t) -1; it's not portable.
10056 2000-11-17 Akim Demaille <akim@epita.fr>
10058 * obstack.h: Formatting changes.
10059 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10060 prevent type checking.
10061 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10062 cast the value to (void *): assigning a `foo *' to a `void *'
10064 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10066 2000-11-17 Jim Meyering <meyering@lucent.com>
10068 * strstr.c: Update from GNU libc.
10070 2000-11-16 Jim Meyering <meyering@lucent.com>
10072 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10074 2000-11-11 Jim Meyering <meyering@lucent.com>
10076 * error.c: Add a couple #includes, merging from GNU libc version.
10078 2000-11-10 Jim Meyering <meyering@lucent.com>
10080 * obstack.h: Update from GNU libc.
10081 * obstack.c: Likewise.
10083 2000-11-06 Paul Eggert <eggert@twinsun.com>
10085 * getusershell.c (setusershell): Use rewind rather than
10086 fseek/fseeko, to avoid configuration hassles with fseeko.
10087 Don't bother opening SHELLS_FILE if shellstream is NULL;
10088 it's not necessary.
10090 2000-11-05 Jim Meyering <meyering@lucent.com>
10092 * makepath.h (make_dir): Declare.
10093 * makepath.c (make_dir): Remove `static' attribute.
10096 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10098 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10099 last one in a bucket, advance to the next bucket.
10101 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10103 * fnmatch.c: Do not comment out all the code if we are using
10104 the GNU C library, because in some cases we are replacing buggy
10105 code in the GNU C library itself.
10107 2000-10-30 Paul Eggert <eggert@twinsun.com>
10109 * error.h, getline.h, modechange.h:
10110 Remove "2000" from Copyright line, as the file hasn't been
10111 changed this year other than in the copyright notice.
10113 * xalloc.h: Add "2000" to Copyright line, as this file
10114 was changed this year.
10116 2000-10-30 Paul Eggert <eggert@twinsun.com>
10118 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10119 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10120 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10122 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10124 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10125 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10126 doesn't define __restrict_arr.
10128 2000-10-29 Jim Meyering <meyering@lucent.com>
10130 * xstat.in: Fix grammar in comment.
10132 2000-10-28 Jim Meyering <meyering@lucent.com>
10134 * memchr.c: Update from libc.
10135 Adjust for portability:
10136 [HAVE_STDLIB_H]: Include stdlib.h.
10137 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10138 Undef __memchr, too.
10139 [!weak_alias]: Define __memchr to memchr.
10141 * regex.c: Update from libc.
10142 * regex.h: Likewise.
10143 * getopt1.c: Likewise.
10144 * memcmp.c: Likewise.
10146 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10147 Avoid using fseek, when possible -- it's broken by design.
10148 Patch by Ulrich Drepper.
10150 2000-10-26 Jim Meyering <meyering@lucent.com>
10152 * strftime.c: Update from libc.
10154 2000-10-25 Jim Meyering <meyering@lucent.com>
10156 * obstack.c: Update from libc.
10158 2000-10-23 Jim Meyering <meyering@lucent.com>
10160 * hard-locale.c (hard_locale): Revert last change -- it was simply
10161 wrong. That set_locale call must not have any side effects.
10164 2000-10-22 Jim Meyering <meyering@lucent.com>
10166 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10167 [CYCLIC]: Remove now-unused definition.
10169 * save-cwd.c (O_DIRECTORY): Define, if needed.
10170 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10171 Suggestion from Ulrich Drepper.
10173 2000-10-21 Jim Meyering <meyering@lucent.com>
10175 * dirname.c (dir_name_r): New function, factored out of dir_name.
10176 (dir_name): Use dir_name_r.
10177 * dirname.h (dir_name_r): Declare it.
10179 2000-10-21 Jim Meyering <meyering@lucent.com>
10181 * dirname.c (memrchr): Declare if necessary.
10182 (dir_name): Remove the restriction that there be no
10183 trailing slashes. Now, this code skips past them, effectively
10185 [TEST_DIRNAME] (main): New unit tests.
10187 * memrchr.c: New file from GNU libc.
10188 Undef __memrchr, too.
10189 [!weak_alias]: Define __memrchr to memrchr.
10190 Guard weak_alias use with `#ifdef weak_alias'.
10192 2000-10-17 Jim Meyering <meyering@lucent.com>
10194 * quote.h (PARAMS): Define and use.
10195 Reported by Akim Demaille.
10197 * getopt.c: Update from libc.
10199 2000-10-16 Jim Meyering <meyering@lucent.com>
10201 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10204 2000-09-25 Jim Meyering <meyering@lucent.com>
10206 * md5.h (rol): Define (from GnuPG).
10208 * sha.c: Give credit (GnuPG) where due.
10209 (M): Use rol rather than open-coding it.
10210 Add a FIXME comment.
10212 2000-09-21 Jim Meyering <meyering@lucent.com>
10214 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10215 Reported by Michael Stone.
10217 2000-09-20 Jim Meyering <meyering@lucent.com>
10219 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10220 (noinst_HEADERS): Add sha.h.
10221 Based on code from Scott G. Miller and from GnuPG.
10223 2000-09-15 Jim Meyering <meyering@lucent.com>
10225 * regex.c: Update from libc.
10227 2000-09-10 Jim Meyering <meyering@lucent.com>
10229 * getopt.c (_getopt_internal): Update from glibc.
10231 2000-09-09 Jim Meyering <meyering@lucent.com>
10233 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10234 think it should be used as a general replacement for isascii.
10235 * fnmatch.c: Likewise.
10236 * mbswidth.c: Likewise
10237 * regex.c: Likewise.
10240 * userspec.c: Include sys/param.h and limits.h.
10242 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10243 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10244 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10245 UID, GID. Check range.
10247 2000-09-06 Jim Meyering <meyering@lucent.com>
10249 * getopt.c (_getopt_internal): Update from glibc.
10251 2000-08-30 Jim Meyering <meyering@lucent.com>
10253 * strftime.c: Merge in changes from GNU libc.
10255 2000-08-26 Jim Meyering <meyering@lucent.com>
10257 * closeout.c: Include "__fpending.h".
10258 (close_stdout_status): Return right away if there's nothing to flush.
10260 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10261 * __fpending.c: New file.
10262 * __fpending.h: New file.
10264 2000-08-07 Paul Eggert <eggert@twinsun.com>
10266 Standardize on "memory exhausted" instead of "Memory exhausted"
10267 or "virtual memory exhausted".
10268 * obstack.c (print_and_abort): Use "memory exhausted", not
10269 "virtual memory exhausted".
10270 * same.c (same_name): Invoke xalloc_die instead of printing
10272 * userspec.c (parse_user_spec): Likewise.
10273 * bumpalloc.h: comment fix
10274 * same.c, userspec.c: Include xalloc.h.
10276 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10277 not char *const and pointing to a constant array.
10278 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10279 (xrealloc): Comment fix.
10281 * userspec.c (parse_user_spec):
10282 Don't translate a message until just before returning,
10283 to avoid unnecessary translation.
10285 2000-08-07 Jim Meyering <meyering@lucent.com>
10287 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10288 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10289 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10290 getgroups.c, gethostname.c, getopt.h, group-member.c,
10291 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10292 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10293 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10294 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10295 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10296 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10297 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10298 yesno.c: Back out Copyright date changes for each file with no change
10299 this year. This eases coordination with other programs using the same
10300 source code modules. From Paul Eggert.
10302 2000-08-03 Greg McGary <greg@mcgary.org>
10304 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10305 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10306 (EXTEND_BUFFER): Use them.
10308 2000-08-01 Jim Meyering <meyering@lucent.com>
10310 * dirname.c (ISSLASH): Define.
10311 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10312 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10313 both `\' and `/' may be use as path separators.
10314 Based on a patch from Prashant TR.
10316 2000-07-31 Paul Eggert <eggert@twinsun.com>
10318 * quotearg.c (quotearg_n_options): Don't make the initial
10319 slot vector a constant, since it might get modified.
10321 2000-07-31 Jim Meyering <meyering@lucent.com>
10323 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10324 * obstack.c (print_and_abort): Likewise.
10326 2000-07-30 Paul Eggert <eggert@twinsun.com>
10328 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10329 buffer, so that the caller can always quote one small
10330 component of a "memory exhausted" message in slot 0.
10331 From a suggestion by Jim Meyering.
10333 2000-07-30 Jim Meyering <meyering@lucent.com>
10335 * makepath.c (make_path): Quote the other instance, too.
10337 * quotearg.c (N_STATIC_SLOTVECS): Define.
10338 (STATIC_BUF_SIZE): Define.
10339 (quotearg_n_options): Use only statically allocated storage when
10340 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10341 than STATIC_BUF_SIZE.
10343 2000-07-29 Jim Meyering <meyering@lucent.com>
10345 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10346 * dirname.c (dir_name): Likewise.
10348 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10350 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10351 (dir_name): Assert that there are no trailing slashes.
10353 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10355 * mbswidth.h (mbswidth): Add a flags argument.
10356 (mbswidth): New declaration.
10357 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10358 * mbswidth.c (mbswidth): Add a flags argument.
10359 (mbsnwidth): New function.
10361 2000-07-24 Jim Meyering <meyering@lucent.com>
10363 * mbswidth.c: Remove useless #else. From Bruno Haible.
10365 2000-07-23 Paul Eggert <eggert@twinsun.com>
10367 * mbswidth.c (_XOPEN_SOURCE):
10368 Don't define; this causes problems on Solaris 7.
10369 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10371 2000-07-23 Paul Eggert <eggert@twinsun.com>
10374 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10375 so that mbstate_t is always defined.
10377 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10378 be 1 in at least one GCC installation, and this configuration
10379 error is likely to be common. Ignoring MB_LEN_MAX hurts
10380 performance on hosts that have mbrtowc but have only unibyte
10381 locales, but I assume these hosts are rare.
10383 2000-07-23 Paul Eggert <eggert@twinsun.com>
10385 * quotearg.c: Streamline by invoking multibyte code only if needed.
10386 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10387 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10388 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10389 invoke multibyte primitives.
10391 2000-07-23 Jim Meyering <meyering@lucent.com>
10393 * basename.c (base_name): Add an assertion.
10395 2000-07-15 Bruno Haible <clisp.cons.org>
10397 * quotearg.c: When the system forces us to redefine mbstate_t,
10398 shadow its mbsinit function.
10400 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10402 * mbswidth.h: New file.
10403 * mbswidth.c: New file.
10404 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10405 (noinst_HEADERS): Add mbswidth.h.
10407 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10409 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10412 2000-07-15 Jim Meyering <meyering@lucent.com>
10414 * makepath.c: Include quote.h.
10415 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10416 corresponding argument in a `quote (...)' call.
10417 Give better diagnostics.
10419 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10420 (noinst_HEADERS): Add quote.h.
10422 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10423 from tar's src/misc.c.
10424 * quote.h: New file. Prototypes for same.
10426 2000-07-10 Paul Eggert <eggert@twinsun.com>
10428 From a suggestion by Bruno Haible.
10429 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10430 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10431 to decide whether to define the BeOS workaround macro;
10432 this adjusts to the change to AC_MBSTATE_T.
10434 2000-07-13 Paul Eggert <eggert@twinsun.com>
10436 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10438 * quotearg.c (quoting_style_args, quoting_style_vals,
10439 quotearg_buffer_restyled): Add support for
10440 clocale_quoting_style. Undo previous change to
10441 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10442 and "{RIGHT QUOTATION MARK}" msgids.
10444 2000-07-05 Paul Eggert <eggert@twinsun.com>
10446 The old behavior of quoting `like this' doesn't look good with
10447 newer, ISO-style fonts. See:
10448 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10450 Instead, quote "like this" by default. Let the translator
10451 tailor the locale-specific quoting behavior by providing
10452 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10454 * quotearg.c (N_): New macro.
10455 (gettext_default): New function.
10456 (quotearg_buffer_restyled): Use
10457 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10458 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10460 2000-07-09 Jim Meyering <meyering@lucent.com>
10462 * Most files: Update copyright dates to include 2000.
10464 2000-07-08 Jim Meyering <meyering@lucent.com>
10466 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10468 (xgethostname): Remove now-unnecessary #ifdef.
10469 Move declaration of `err' into loop where it's used.
10471 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10473 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10474 by allocating a larger buffer. Test the gethostname return value for
10475 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10476 returns an error and ENAMETOOLONG isn't defined.
10478 2000-07-05 Paul Eggert <eggert@twinsun.com>
10479 and Bruno Haible <haible@clisp.cons.org>
10481 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10483 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10485 * quotearg.c (struct quoting_options): Simplify quote_these_too
10488 2000-07-03 Jim Meyering <meyering@lucent.com>
10490 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10491 Reported by Bruno Haible.
10493 2000-07-04 Jim Meyering <meyering@lucent.com>
10495 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10496 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10499 2000-07-03 Paul Eggert <eggert@twinsun.com>
10500 and Bruno Haible <haible@clisp.cons.org>
10502 * quotearg.c (mbrtowc):
10503 Assign to *pwc, and return 1 only if result is nonzero.
10504 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10506 2000-07-03 Jim Meyering <meyering@lucent.com>
10508 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10509 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10512 2000-07-02 Jim Meyering <meyering@lucent.com>
10514 * quotearg.c (mbstate_t): Don't define here.
10516 2000-07-02 Jim Meyering <meyering@lucent.com>
10518 * nanosleep.c (SIGCONT): Define if not already defined.
10520 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10522 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10523 per change in ../m4/ls-mntd-fs.m4.
10524 (read_filesystem_list): Ignore symbolic links.
10526 2000-06-29 Jim Meyering <meyering@lucent.com>
10528 * same.c: Include <string.h> or <strings.h>, as appropriate,
10529 for declaration of strcmp.
10531 * long-options.c: Include <stdlib.h>, for declaration of exit.
10533 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10534 Avoid warning by casting result to `char *' to remove `const'.
10536 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10538 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10540 2000-06-26 Paul Eggert <eggert@twinsun.com>
10542 savedir now sets errno on failure and invokes xmalloc to get memory.
10543 Fix a couple of other minor bugs while we're at it.
10545 * savedir.c (<unistd.h>): Do not include; there's no need.
10546 (NAMLEN): Remove macro.
10547 (malloc, realloc): Remove decls.
10548 (stpcpy): Likewise.
10549 ("xalloc.h"): Include.
10550 (NAME_SIZE_DEFAULT): New macro.
10551 (savedir): Use xmalloc / xrealloc to allocate memory.
10552 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10553 Skip "" directory entries.
10554 Use strlen to calculate directory entry length, since the old method
10555 is rarely used these days and isn't worth supporting.
10556 Don't use a pointer after freeing it.
10557 Check for integer overflow when calculating allocation size.
10558 Use memcpy to copy entries, instead of stpcpy.
10559 Set errno properly when returning NULL.
10560 Check for readdir error.
10562 2000-06-26 Jim Meyering <meyering@lucent.com>
10564 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10566 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10568 * getusershell.c (xmalloc, xrealloc): Remove functions.
10570 Don't include <stdlib.h>. Don't declare malloc, realloc.
10572 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10574 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10576 2000-06-24 Jim Meyering <meyering@lucent.com>
10578 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10580 2000-06-21 Jim Meyering <meyering@lucent.com>
10582 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10584 2000-06-19 Paul Eggert <eggert@twinsun.com>
10586 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10587 (mbrtowc, mbstate_t): Define substitutes if
10588 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10589 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10590 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10592 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10594 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10595 than 1024, return a memory chunk of least possible size, instead
10596 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10597 Use free/xmalloc instead of xrealloc to avoid copying for very long
10600 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10602 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10603 address, not strdup. Include <stdlib.h> and don't declare free().
10605 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10607 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10610 2000-06-21 Jim Meyering <meyering@lucent.com>
10612 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10613 (noinst_HEADERS): Add getstr.h.
10615 * getline.c (getstr): Move into a separate file.
10616 * getstr.c (getstr): New file, extracted from getline.c, with
10617 the following changes: new parameter, delim2; both delim[12]
10618 parameters have type `int', not `char'. The latter would lose
10619 with 8-bit delimiters.
10620 * getstr.h: New file.
10622 2000-06-19 Jim Meyering <meyering@lucent.com>
10624 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10626 2000-06-18 Jim Meyering <meyering@lucent.com>
10628 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10629 Besides, these days every porting target provides a mkdir function.
10631 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10632 (this snippet comes from src/system.h).
10634 2000-06-15 Paul Eggert <eggert@twinsun.com>
10636 * human.c (adjust_value): New function.
10637 (human_readable_inexact): Apply rounding style even when
10638 printing approximate values.
10640 2000-06-14 Paul Eggert <eggert@twinsun.com>
10642 * human.c (human_readable_inexact): Allow an input block
10643 size that is not a multiple of the output block size, and vice versa.
10644 Reported by Piergiorgio Sartor.
10646 2000-06-14 Paul Eggert <eggert@twinsun.com>
10648 * getdate.y (get_date): Apply relative times after time
10649 zone indicator, not before. Reported by Todd A. Jacobs.
10651 2000-06-13 Jim Meyering <meyering@lucent.com>
10653 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10655 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10657 2000-06-12 Paul Eggert <eggert@twinsun.com>
10659 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10661 2000-06-04 Paul Eggert <eggert@twinsun.com>
10663 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10665 2000-06-04 Jim Meyering <meyering@lucent.com>
10667 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10668 SunOS 4.1.4 for which gid_t is an unsigned type.
10670 2000-06-03 Jim Meyering <meyering@lucent.com>
10672 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10674 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10676 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10677 newer, don't install charset.alias.
10678 * config.charset: Change the Linux/glibc rules so they become empty
10679 on glibc-2.1 or newer.
10681 2000-06-02 Jim Meyering <meyering@lucent.com>
10683 * mountlist.c: Back out last change. Instead, do this...
10684 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10685 member using the same `ignore'-testing code.
10686 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10690 2000-05-29 Jim Meyering <meyering@lucent.com>
10692 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10693 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10695 2000-05-22 Jim Meyering <meyering@lucent.com>
10697 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10699 2000-05-18 Jim Meyering <meyering@lucent.com>
10701 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10702 back, too, since it may have been modified by allocate_entry.
10703 (hash_delete): Rewrite to use neither the assignment operator
10704 nor the comma operator in an if-expression.
10706 2000-05-15 Paul Eggert <eggert@twinsun.com>
10709 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10710 Remove; no longer needed.
10711 "quotearg.h": Add include.
10712 (file_name): Do not bother to explicitly initialize to NULL; it's less
10713 efficient on some hosts.
10714 (close_stdout_status): Remove test as to whether stdout was already
10715 closed; it breaks for the case "echo x | sort >&-".
10716 Quote file name colons.
10717 Do not assume that _("write error") lacks format strings.
10719 2000-05-15 Jim Meyering <meyering@lucent.com>
10721 * version-etc.c (version_etc_copyright): Update the copyright string
10722 used in all --version output.
10724 2000-05-14 Jim Meyering <meyering@lucent.com>
10726 * closeout.c (close_stdout_set_file_name): New function.
10727 (close_stdout_status): Use new file-scoped global.
10728 Return right away if fstat says the stdout file descriptor is invalid.
10729 * closeout.h (close_stdout_set_file_name): Declare.
10731 2000-05-10 Jim Meyering <meyering@lucent.com>
10733 * closeout.c [default_exit_status]: New file-scoped variable.
10734 (close_stdout_set_status): New function.
10735 * closeout.h (close_stdout_set_status): Declare.
10737 2000-05-08 Jim Meyering <meyering@lucent.com>
10739 * long-options.c: Don't include closeout.h.
10740 (parse_long_options): Don't call close_stdout for --version.
10742 2000-05-06 Jim Meyering <meyering@lucent.com>
10744 * strnlen.c: Undefine __strnlen and strnlen.
10745 [!weak_alias]: Define __strnlen to strnlen.
10747 * atexit.c: New file, from libiberty.
10749 2000-05-06 Jim Meyering <meyering@lucent.com>
10751 * closeout.c (close_stdout_status): Also check for errors on the
10754 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10756 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10757 instead of xmalloc, xrealloc, path_concat.
10758 (locale_charset): Treat empty environment variables as absent.
10759 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10761 2000-05-04 Jim Meyering <meyering@lucent.com>
10763 * getopt.c: Update from glibc.
10764 * obstack.c: Likewise.
10765 * obstack.h: Likewise.
10766 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10768 * regex.h: Likewise.
10769 * strndup.c: Likewise.
10770 * strnlen.c: New file, from glibc.
10772 2000-05-01 Jim Meyering <meyering@lucent.com>
10774 * full-write.c (full_write): Remove `FIXME' part of comment.
10776 2000-04-29 Jim Meyering <meyering@lucent.com>
10778 * path-concat.c: Declare strdup only if it's not defined.
10779 * canon-host.c: Likewise.
10781 2000-04-28 Jim Meyering <meyering@lucent.com>
10783 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10784 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10785 included first, then limits.h is included by locale.h by libintl.h.
10786 From John David Anglin.
10788 2000-04-25 Jim Meyering <meyering@lucent.com>
10790 * makepath.c (S_IRWXUGO): Define.
10791 (make_path): Always perform explicit chmod if MODE specifies any
10792 of the `special' permission bits. Prompted by a bug report against
10793 install from Mate Wierdl and Joost van Baal.
10795 2000-04-18 Jim Meyering <meyering@lucent.com>
10797 * README: New file.
10799 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10800 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10802 2000-04-17 Jim Meyering <meyering@lucent.com>
10804 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10805 the definition of it to rpl_strftime also defined-away the system's
10808 2000-04-15 Jim Meyering <meyering@lucent.com>
10810 Use `C' to denote so-called `contiguous' files, the same way
10812 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10813 (ftypelet): Use S_ISCTG.
10814 From Michael Deutschmann.
10816 2000-04-14 Jim Meyering <meyering@lucent.com>
10818 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10820 2000-04-08 Jim Meyering <meyering@lucent.com>
10822 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10823 names don't conflict. Reported by Eli Zaretskii.
10825 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10827 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10828 bug. Deal with the different error behavior of Irix iconv.
10830 2000-04-07 Jim Meyering <meyering@lucent.com>
10832 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10833 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10835 2000-04-05 Jim Meyering <meyering@lucent.com>
10837 Portability tweaks required for ultrix4.3.
10838 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10839 * readutmp.c: Include sys/types.h before sys/stat.h.
10840 * canon-host.c: Declare strdup.
10841 * path-concat.c: Likewise.
10842 From John David Anglin.
10844 2000-04-04 Jim Meyering <meyering@lucent.com>
10846 Be more DOS 8.3-friendly.
10847 * ref-add.sin: Renamed from ref-add.sed.in.
10848 * ref-del.sin: Renamed from ref-del.sed.in.
10849 * Makefile.am: Reflect renaming.
10850 Reported by Eli Zaretskii.
10852 Use a temporary file name that won't clash with `charset.alias'
10853 in the DOS 8.3 name space.
10854 * Makefile.am (charset_tmp): Define.
10855 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10856 (uninstall-local): Likewise.
10857 Reported by Eli Zaretskii.
10859 2000-03-29 Paul Eggert <eggert@twinsun.com>
10861 * time/strftime.c (my_strftime): Make sure we call the system
10862 strftime, not ourselves, when invoking the underlying strftime.
10864 2000-03-24 Jim Meyering <meyering@lucent.com>
10866 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10867 (charset_alias): Define.
10868 (install-exec-local): Factor out common code.
10869 (uninstall-local): Split lines longer than 80.
10870 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10871 (SUFFIXES): Define.
10872 (.sed.in.sed): New rule. Don't redirect directly to $@.
10873 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10875 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10877 * config.charset: Output a line containing "Packages using this file".
10878 * ref-add.sed.in, ref-del.sed.in: New files.
10879 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10880 ref-del.sed): New rules.
10882 2000-03-17 Jim Meyering <meyering@lucent.com>
10884 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10885 Otherwise, include <strings.h>
10887 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10889 * unicodeio.c (utf8_wctomb): New function.
10890 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10891 format instead of in UCS-4 with platform dependent endianness.
10893 2000-03-07 Paul Eggert <eggert@twinsun.com>
10895 * savedir.c (savedir): Work even if directory size is
10896 negative; this can happen with some screwy NFS configurations.
10898 2000-03-06 Jim Meyering <meyering@lucent.com>
10900 * localcharset.c (get_charset_aliases): Don't try to free file_name
10901 if it's NULL (because we ran out of memory). From Bruno Haible.
10903 2000-03-05 Jim Meyering <meyering@lucent.com>
10905 * localcharset.c ("path-concat.h"): Include.
10906 (get_charset_aliases): Use path_concat instead of ANSI string
10909 * unicodeio.h (PARAMS): Define.
10910 Use it to guard prototype.
10912 2000-03-04 Jim Meyering <meyering@lucent.com>
10914 * Makefile.am (install-exec-local): Create $(libdir) before installing
10916 (uninstall-local): Uncomment this rule so `make distcheck' works
10919 * unicodeio.c (<errno.h>): Include it.
10920 (errno): Declare if not defined.
10922 * localcharset.c: Add Bruno's comment justifying use of volatile.
10924 * config.charset: New version, incorporating remarks from a linux
10925 i18n mailing list. From Bruno Haible.
10927 2000-03-02 Jim Meyering <meyering@lucent.com>
10929 * Makefile.am (EXTRA_DIST): Add config.charset.
10931 2000-03-01 Jim Meyering <meyering@lucent.com>
10933 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10934 * unicodeio.c: Likewise.
10936 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10938 * config.charset: New file.
10939 * localcharset.c: New file.
10940 * unicodeio.h, unicodeio.c: New files.
10941 * Makefile.am (DEFS): Add -DLIBDIR=...
10942 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10943 (noinst_HEADERS): Add unicodeio.h.
10944 (all-local, install-exec-local, charset.alias): New targets.
10946 2000-02-28 Paul Eggert <eggert@twinsun.com>
10948 * quotearg.c (ALERT_CHAR): New macro.
10949 (quotearg_buffer_restyled): Use it.
10951 2000-02-27 Jim Meyering <meyering@lucent.com>
10953 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10954 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10956 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10957 not `#if STDC_HEADERS'.
10958 Declare malloc if needed.
10960 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10961 now that autoconf always defines the HAVE_DECL_ symbols.
10962 * human.c: Likewise.
10963 * same.c: Likewise.
10964 * strtoumax.c: Likewise.
10966 * backupfile.c: Arrange for cpp to fail if the configure-time
10967 declaration check was not run.
10968 * hash.c: Likewise.
10969 * human.c: Likewise.
10970 * same.c: Likewise.
10971 * strtoumax.c: Likewise.
10973 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10974 then first look up the entire `.'-containing string as a login name.
10976 2000-02-18 Paul Eggert <eggert@twinsun.com>
10978 * getdate.y: Handle two-digit years with leading zeros correctly.
10979 (textint): New typedef.
10980 (parser_control): Member year changed from int to textint.
10982 (YYSTYPE): Removed; replaced by %union with int and textint members.
10983 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10984 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10985 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10986 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10987 (date, number, to_year): Use width of number in digits, not its value,
10988 to determine whether it's a 2-digit year, or a 2-digit time.
10989 (yylex): Store number of digits of numeric tokens.
10990 Reported by John Kendall.
10992 (parser_control): Changed from struct parser_control to typedef (for
10993 consistency). All uses changed.
10995 (tID): Removed; not used.
10996 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10998 2000-02-14 Paul Eggert <eggert@twinsun.com>
11000 * getpagesize.h (getpagesize): Port to VMS for Alpha;
11001 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
11003 2000-02-12 Jim Meyering <meyering@lucent.com>
11005 * userspec.c (ISDIGIT): Define it.
11006 (isdigit): Remove definition.
11007 (is_number): Use ISDIGIT, not isdigit.
11008 <libintl.h>: Include.
11009 (_ and N_): Define.
11010 (parse_user_spec): Mark translatable strings.
11012 2000-02-10 Jim Meyering <meyering@lucent.com>
11014 With these changes, nanosleep.[ch] are finally enough like the other
11015 lib/* replacement files to compile on a few more losing systems.
11017 * nanosleep.h: Don't include config.h.
11018 Remove prototype from declaration of nanosleep.
11019 (PARAMS): Remove now-unneeded definition.
11020 * nanosleep.c: #undef nanosleep.
11021 (rpl_nanosleep): Rename from nanosleep.
11023 2000-02-03 Jim Meyering <meyering@lucent.com>
11025 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11026 rather than with `#if HAVE_UTMPNAME'.
11028 2000-02-01 Jim Meyering <meyering@lucent.com>
11030 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
11032 2000-01-31 Jim Meyering <meyering@lucent.com>
11034 * nanosleep.h (nanosleep): Guard declaration with
11035 `#if ! HAVE_DECL_NANOSLEEP'.
11036 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11037 the declaration in that vendor's sys/timers.h.
11038 Reported by Christian Krackowizer.
11040 * quotearg.c (ISASCII): Add #undef and move definition to follow
11041 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11042 (ISPRINT): Likewise.
11043 Reported by Tom Tromey.
11045 2000-01-30 Jim Meyering <meyering@lucent.com>
11047 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11048 uses of ->ut_name. The latter doesn't work with new Linux header files
11049 where only utmpx.ut_user is declared.
11051 * readutmp.h (UT_USER): Define.
11053 2000-01-23 Jim Meyering <meyering@lucent.com>
11055 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11058 2000-01-22 Jim Meyering <meyering@lucent.com>
11060 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11061 [! HAVE_DECL_STRTOULL]: Declare strtoull.
11062 Required for some AIX systems. Reported by Christian Krackowizer.
11063 [TESTING] (main): New function.
11065 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
11066 * dirname.c (dir_name): Support for DOS-style file names with drive
11069 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11071 * strverscmp.c (ISDIGIT): Define.
11072 (strverscmp): Use ISDIGIT, not isdigit.
11074 2000-01-17 Paul Eggert <eggert@twinsun.com>
11076 * nanosleep.c (nanosleep):
11077 Don't use SA_INTERRUPT to decide whether to call sigaction, as
11078 POSIX.1 doesn't require SA_INTERRUPT and some systems
11079 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
11080 it's been part of POSIX.1 since day 1 (in 1988).
11082 2000-01-17 Jim Meyering <meyering@lucent.com>
11084 * interlock: Remove unused file. Reported by François Pinard.
11086 2000-01-16 Paul Eggert <eggert@twinsun.com>
11088 * quotearg.c (quotearg_buffer_restyled): Do not quote
11089 alert, backslash, formfeed, and vertical tab unnecessarily in
11090 shell quoting style.
11093 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11094 Free Software Foundation, Inc.
11095 Copying and distribution of this file, with or without modification,
11096 are permitted provided the copyright notice and this notice are preserved.