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 Paolo Bonzini <bonzini@gnu.org>
227 * poll.c (rpl_poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK.
229 2006-09-28 Bruno Haible <bruno@clisp.org>
231 * strndup.h: Simplify the redefinition of strndup.
232 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
234 2006-09-28 Bruno Haible <bruno@clisp.org>
236 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
237 * gl_linkedhash_list.c: Likewise.
238 * gl_rbtreehash_list.c: Likewise.
240 2006-09-28 Jim Meyering <jim@meyering.net>
242 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
245 2006-09-27 Jim Meyering <jim@meyering.net>
247 This file could end up with a definition for a function
248 named __strndup, rather than rpl_strndup on a system with
249 incomplete weak_alias support.
250 * strndup.c (strndup): Rename from __strndup.
251 Remove #defines that used to map __strndup to strndup.
252 Don't use K&R prototypes.
253 Remove LIBC-related code, since this file is not sync'd with glibc.
254 * strndup.h: Revamp, accordingly.
256 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
258 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
261 * __fpending.h: Don't include <stdio_ext.h> unless
262 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
263 it causes <stdio_ext.h> to cause a compile-time error.
264 Problem reported by Nelson H. F. Beebe.
265 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
266 of HAVE_DECL___PENDING.
268 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
270 * savewd.c: Include <signal.h>, for 'raise'.
272 2006-09-26 Eric Blake <ebb9@byu.net>
274 * verror.c: Include <config.h> unconditionally.
276 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
278 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
279 (gl_linked_iterator_from_to): Initialize struct completely.
280 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
281 (gl_tree_iterator_from_to): Likewise
282 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
283 * gl_array_list.c [lint] (gl_array_iterator)
284 (gl_array_iterator_from_to): Likewise.
285 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
286 * gl_carray_list.c [lint] (gl_carray_iterator)
287 (gl_carray_iterator_from_to): Likewise.
289 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
290 * md4.c (md4_process_block): Remove unused variable.
291 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
292 parentheses for clarity.
294 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
296 Import this patch from libc:
298 2006-09-06 Jakub Jelinek <jakub@redhat.com>
300 * regex_internal.c (re_string_reconstruct): Handle
301 offset < pstr->valid_raw_len && pstr->offsets_needed case.
302 Ensure no bytes read before raw_mbs array. Pass a saved copy of
303 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
304 re_string_context_at.
306 2006-09-20 Bruno Haible <bruno@clisp.org>
308 * mkdtemp.c: Import from libc.
309 2006-04-07 Ulrich Drepper <drepper@redhat.com>
310 * sysdeps/posix/tempname.c (__gen_tempname): Change
311 attempts_min into a macro. Use preprocessor to decide how to
312 initialize attempts [Coverity CID 67].
313 2001-11-27 Paul Eggert <eggert@twinsun.com>
314 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
315 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
317 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
319 * mkstemp.h: New file, since some standard headers
321 * mkstemp.c: Revamp to put the !_LIBC code together.
323 Make the _LIBC code resemble glibc original more,
325 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
326 (mkstemp): Remove, since mkstemp.h does this for us.
327 * stdlib--.h: Include mkstemp.h.
329 Import this patch from libc:
331 2006-04-07 Ulrich Drepper <drepper@redhat.com>
333 * tempname.c (__gen_tempname): Change attempts_min
334 into a macro. Use preprocessor to decide how to initialize
335 attempts [Coverity CID 67].
337 2006-09-18 Bruno Haible <bruno@clisp.org>
339 * javaversion.c: Include configmake.h.
341 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
343 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
344 that prevented coreutils 6.1 from building. Problem reported
345 by Petter Reinholdtsen.
347 2006-09-18 Jim Meyering <jim@meyering.net>
349 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
351 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
353 * dirchownmod.c: Don't include fcntl.h; no longer needed.
354 (dirchownmod): New arg FD. All callers changed.
355 Use FD rather than opening the directory ourself, as opening is
356 now the caller's responsibility.
357 * dirchownmod.h: Likewise.
358 * mkancesdirs.c: Include <sys/types.h>, for portability to older
359 hosts that require <sys/types.h> before <sys/stat.h>. Include
360 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
362 (mkancesdirs): Return length of prefix of FILE that has already
363 been made, or -2 if there is a child doing the work. Redo
364 algorithm so that it is O(N) rather than O(N**2). Optimize away
365 ".", and treat ".." specially since it might stray back into
366 already-created areas. Use a subprocess if necessary. New arg
367 WD; all users changed. MAKE_DIR function should now return 1
368 if it creates a directory that is not readable. Return -2 if
369 a child process is spun off.
370 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
371 Adjust signature to match code.
372 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
373 (make_dir_parents): Use a subprocess if necessary. New arg WD;
375 * savewd.c, savewd.h: New files.
377 2006-09-15 Jim Meyering <jim@meyering.net>
379 * rename-dest-slash.c (has_trailing_slash): Use
380 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
381 (rpl_rename_dest_slash): Perform the cheaper trailing slash
382 test before testing whether SRC is a directory.
383 Suggestions from Bruno Haible.
385 Avoid a warning about an unused variable.
386 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
387 into the #ifdef block where it's used.
389 * rename-dest-slash.c: New file.
391 2006-09-14 Bruno Haible <bruno@clisp.org>
393 * allocsa.c: Include <config.h> unconditionally.
394 * asnprintf.c: Likewise.
395 * asprintf.c: Likewise.
396 * c-strcasecmp.c: Likewise.
397 * c-strcasestr.c: Likewise.
398 * c-strncasecmp.c: Likewise.
399 * c-strstr.c: Likewise.
400 * classpath.c: Likewise.
401 * clean-temp.c: Likewise.
402 * concatpath.c: Likewise.
403 * copy-file.c: Likewise.
404 * csharpcomp.c: Likewise.
405 * csharpexec.c: Likewise.
406 * execute.c: Likewise.
407 * fatal-signal.c: Likewise.
408 * findprog.c: Likewise.
409 * fwriteerror.c: Likewise.
410 * gl_array_list.c: Likewise.
411 * gl_array_oset.c: Likewise.
412 * gl_avltree_list.c: Likewise.
413 * gl_avltree_oset.c: Likewise.
414 * gl_avltreehash_list.c: Likewise.
415 * gl_carray_list.c: Likewise.
416 * gl_linked_list.c: Likewise.
417 * gl_linkedhash_list.c: Likewise.
418 * gl_list.c: Likewise.
419 * gl_oset.c: Likewise.
420 * gl_rbtree_list.c: Likewise.
421 * gl_rbtree_oset.c: Likewise.
422 * gl_rbtreehash_list.c: Likewise.
423 * imaxabs.c: Likewise.
424 * imaxdiv.c: Likewise.
425 * javacomp.c: Likewise.
426 * javaexec.c: Likewise.
427 * javaversion.c: Likewise.
428 * linebreak.c: Likewise.
429 * localcharset.c: Likewise.
431 * mbchar.c: Likewise.
432 * mbswidth.c: Likewise.
433 * mkdtemp.c: Likewise.
435 * printf-args.c: Likewise.
436 * printf-parse.c: Likewise.
437 * progname.c: Likewise.
438 * progreloc.c: Likewise.
439 * readlink.c: Likewise.
440 * sh-quote.c: Likewise.
441 * stpcpy.c: Likewise.
442 * stpncpy.c: Likewise.
443 * strcasecmp.c: Likewise.
444 * strcasestr.c: Likewise.
445 * strcspn.c: Likewise.
446 * striconv.c: Likewise.
447 * strncasecmp.c: Likewise.
448 * strnlen1.c: Likewise.
449 * strstr.c: Likewise.
450 * strtok_r.c: Likewise.
452 * tmpdir.c: Likewise.
453 * unicodeio.c: Likewise.
454 * unsetenv.c: Likewise.
455 * vasnprintf.c: Likewise.
456 * vasprintf.c: Likewise.
457 * wait-process.c: Likewise.
458 * xallocsa.c: Likewise.
459 * xsetenv.c: Likewise.
460 * xstriconv.c: Likewise.
462 2006-09-13 Eric Blake <ebb9@byu.net>
464 * getopt.c: Fix typo in last commit.
466 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
468 * _fpending.c: Include <config.h> unconditionally, since we no
469 longer worry about uses that don't define HAVE_CONFIG_H.
470 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
471 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
472 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
473 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
474 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
475 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
476 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
477 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
478 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
479 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
480 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
481 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
482 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
483 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
484 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
485 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
486 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
487 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
488 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
489 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
490 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
491 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
492 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
493 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
494 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
495 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
496 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
497 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
498 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
499 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
500 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
501 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
502 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
503 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
506 2006-09-12 Jim Meyering <jim@meyering.net>
508 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
509 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
510 Reported by Nelson H. F. Beebe.
512 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
514 * argp-help.c (argp_doc): Make sure NULL is not passed to
517 2006-09-10 Bruno Haible <bruno@clisp.org>
519 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
521 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
523 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
524 program_invocation_name and program_invocation_short_name are
526 * argp-namefrob.h: Move declarations of program_invocation_name
527 and program_invocation_short_name to argp.h, so they are visible
531 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
533 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
534 convention. Text proposed by Bruno Haible.
535 (struct argp_option): Document the use of N_() wrappers.
537 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
538 and translate the two parts separately, instead of feeding
539 the whole string to gettext. This allows to exclude
540 '\v' from the strings visible to the translator by writing doc
541 strings as N_("..") "\v" N_("..").
543 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
545 * mktime.c (guess_time_tm): Fix bug where mktime
546 returned the maximum time_t value rather than (time_t) -1.
547 Problem originally reported by William Bardwell
548 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
550 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
552 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
555 2006-09-06 Bruno Haible <bruno@clisp.org>
557 * striconv.h: New file.
558 * striconv.c: New file, merging iconvme.c with GNU gettext's
560 * xstriconv.h: New file.
561 * xstriconv.c: New file.
563 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
565 * argz_.h: Sync from Libtool.
567 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
568 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
570 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
572 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
577 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
579 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
580 Problem reported by Ralf Wildenhues in
581 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
583 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
584 HAVE_STRUCT_STATFS_F_FSTYPENAME.
586 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
588 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
589 or stdbool.h, because they might not exist while configuring.
591 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
592 Don't include unistd.h or limits.h; not needed, since chdir-long.h
594 (O_DIRECTORY): Remove.
596 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
598 Work around a bug in both the Linux and SunOS 64-bit kernels:
599 nanosleep mishandles sleeps for longer than 2**31 seconds.
600 Problem reported by Frank v Waveren in
601 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
602 * nanosleep.c (BILLION): New constant.
603 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
604 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
606 2006-08-30 Jim Meyering <jim@meyering.net>
608 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
611 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
613 * isapipe.c, isapipe.h: New files.
615 2006-08-29 Eric Blake <ebb9@byu.net>
617 * error.c (error_at_line, print_errno_message): Match libc, after
618 resolution of upstream bug 3044.
620 2006-08-29 Bruno Haible <bruno@clisp.org>
622 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
624 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
628 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
630 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
631 sharing with gnulib. Report by Eric Blake.
633 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
635 * fcntl_.h: New file.
636 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
638 * dirchownmod.c: Likewise.
641 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
642 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
643 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
644 just before including <inttypes.h>, to avoid circular inclusion.
646 2006-08-28 Bruno Haible <bruno@clisp.org>
648 * inttypes_.h (SCNX*): Remove definitions.
649 Reported by Eric Blake.
651 2006-08-26 Bruno Haible <bruno@clisp.org>
653 * vasnprintf.c (EOVERFLOW): Remove definition.
654 (VASNPRINTF): Return a string of length > INT_MAX without failing.
655 * vasprintf.c: Include errno.h, limits.h.
656 (EOVERFLOW): New fallback definition.
657 (vasprintf): Test here whether the string length is > INT_MAX.
658 * vsnprintf.c: Include errno.h, limits.h.
659 (EOVERFLOW): New fallback definition.
660 (vsnprintf): Fix bug when generated string was too long for the buffer.
661 Test here whether the string length is > INT_MAX.
663 2006-08-26 Bruno Haible <bruno@clisp.org>
664 Simon Josefsson <jas@extundo.com>
667 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
669 2006-08-28 Bruno Haible <bruno@clisp.org>
671 * c-strstr.h: New file, from GNU gettext.
672 * c-strstr.c: New file, from GNU gettext.
674 2006-08-26 Bruno Haible <bruno@clisp.org>
676 * inttypes_.h: New file.
677 * inttypes.h: Remove file.
678 * stdint_.h: Include <inttypes.h> through its absolute filename.
680 * imaxabs.c: New file.
682 * imaxdiv.c: New file.
684 2006-08-22 Bruno Haible <bruno@clisp.org>
686 * readutmp.h: Skip most definitions if neither <utmp.h> nor
689 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
692 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
693 Problem reported by Bruno Haible.
695 2006-08-21 Bruno Haible <bruno@clisp.org>
698 * mbchar.h: Include <wctype.h> only if it exists.
700 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
702 * cycle-check.h: Include <stdint.h> unconditionally, since we
703 now assume the stdint module. Do not include inttypes.h.
704 * fsusage.h: Likewise.
705 * getndelim2.c: Likewise.
707 * inttostr.h: Likewise.
708 * obstack.c: Likewise.
709 * regex_internal.h: Likewise.
710 * tempname.c: Likewise.
711 * utimecmp.c: Likewise.
712 * xstrtol.h: Likewise.
714 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
716 * strtoimax.c: Adjust to macro name changes in Autoconf,
717 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
720 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
722 * fchmodat.c: New file, from coreutils. This was inadvertently
723 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
725 2006-08-18 Bruno Haible <bruno@clisp.org>
727 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
728 (ME_DUMMY): Treat "kernfs" as a dummy.
729 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
731 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
733 Update from coreutils.
735 * __fpending.h: Add copyright notice.
736 * fprintftime.h: Likewise.
737 * savedir.c: Use (C) in copyright notice.
738 * savedir.h: Likewise.
740 2006-08-15 Jim Meyering <jim@meyering.net>
742 * at-func.c: New file, with the logic of all emulated at-functions.
743 * openat-priv.h: Include <errno.h> and define ENOSYS,
744 in support of the EXPECTED_ERRNO macro.
745 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
746 Instead, define the appropriate symbols and include "at-func.c".
747 * mkdirat.c (mkdirat): Likewise.
748 * fchmodat.c (fchmodat): Likewise.
749 (ENOSYS): Remove definition.
750 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
751 Don't include "unistd--.h" -- it wasn't ever used.
753 2006-01-17 Jim Meyering <jim@meyering.net>
755 Rewrite fts.c not to change the current working directory,
756 by using openat, fstatat, fdopendir, etc..
758 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
759 (HAVE_OPENAT_SUPPORT): Define.
760 [_LIBC] (fchdir): Don't undef or define; no longer used.
761 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
762 Now, this `function' always succeeds, and consumes its file descriptor
763 parameter -- so callers must not close such FDs. Update callers.
764 (diropen_fd, opendirat, cwd_advance_fd): New functions.
765 (diropen): Add parameter, SP. Adjust all callers.
766 Implement using diropen_fd, rather than open.
767 (fts_open): Initialize new member, fts_cwd_fd.
768 Remove fts_rft-setting code.
769 (fts_close): Close fts_cwd_fd, if necessary.
770 (__opendir2): Define in terms of opendir or opendirat,
771 depending on whether the FST_NOCHDIR flag is set.
772 (fts_build): Since fts_safe_changedir consumes its FD, and since
773 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
774 and close the dup'd file descriptor upon failure.
775 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
776 (fts_safe_changedir): Tweak semantics to reflect that this function
777 now calls cwd_advance_fd and hence consumes its FD argument.
778 * fts_.h [struct FTS] (fts_cwd_fd): New member.
779 [struct FTS] (fts_rft): Remove now-unused member.
780 [struct FTS] (fts_cycle.state): Improve comment.
782 * openat.c (openat_needs_fchdir): New function.
783 * openat.h (openat_needs_fchdir): Declare it.
785 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
787 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
788 Problem and fix reported by Pádraig Brady in
789 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
791 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
793 * memcoll.c (memcoll): Optimize for the common case where the
794 arguments are bytewise equal.
796 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
798 Change copyright notice from LGPL 2 to GPL 2, since that's the
799 standard form used in the gnulib repository.
800 * lock.c: LGPL -> GPL.
802 * strnlen1.c: Likewise.
803 * strnlen1.h: Likewise.
806 * tmpdir.c: Likewise.
808 * TODO: Remove; this belongs only in coreutils.
810 2006-08-14 Eric Blake <ebb9@byu.net>
812 Import the following change from libc:
814 2006-08-12 Ulrich Drepper <drepper@redhat.com>
817 * misc/error.c: Add space between program name and message if file
820 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
822 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
823 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
825 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
826 in wchar_t. Problem reported by Eric Blake.
828 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
829 LEN is smaller than SIZE. Suggested by Bruno Haible.
830 Also, help the compiler to keep LEN in a register.
832 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
834 * .cppi-disable: Add snprintf.h, socket_.h.
835 * snprintf.c: Include <errno.h> and <limits.h>.
836 (EOVERFLOW): Define if the system does not.
837 Do not include "minmax.h"; it wasn't used.
838 (snprintf): Don't assume size_t promotes to an unsigned type.
839 Fix bug when generated string was too long for the buffer: the
840 buffer's contents are supposed to be the initial prefix of the
841 output. Don't assume vasnprintf returns EOVERFLOW if the size
842 exceeds INT_MAX; do the check ourselves.
844 Import the following changes from libc:
846 2006-06-02 Jakub Jelinek <jakub@redhat.com>
848 * posix/regex_internal.c (re_string_skip_chars): If no character has
849 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
850 to the byte which couldn't be converted.
851 (re_string_reconstruct): Don't clear valid_raw_len before calling
852 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
853 tip_context using re_string_context_at.
855 2006-05-02 Ulrich Drepper <drepper@redhat.com>
857 * posix/regex.h: g++ still cannot handled [restrict].
859 2006-04-21 Ulrich Drepper <drepper@redhat.com>
861 * posix/regex.h: Remove special handling for VMS.
863 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
867 2006-07-19 Mike Frysinger <vapier@gentoo.org>
869 * mountlist.c [ME_REMOTE]: Filter out cifs.
870 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
872 2006-08-08 Eric Blake <ebb9@byu.net>
874 * verror.c (verror_at_line): Work around glibc bug 2997, so that
875 verror_at_line output complies with GNU Coding Standards even when
878 2006-08-08 Eric Blake <ebb9@byu.net>
880 * verror.h, verror.c: New files.
882 2006-08-07 Bruno Haible <bruno@clisp.org>
884 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
886 Reported by Ralf Wildenhues.
888 2006-08-06 Eric Blake <ebb9@byu.net>
890 * error.h: Fold in some upstream changes from glibc.
893 2006-07-29 Bruno Haible <bruno@clisp.org>
895 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
897 2006-07-29 Bruno Haible <bruno@clisp.org>
899 * setenv.c: Undo unintended modification done on 2006-02-27.
901 2006-07-28 Eric Blake <ebb9@byu.net>
903 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
906 2006-07-28 Simon Josefsson <jas@extundo.com>
908 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
911 2006-07-28 Simon Josefsson <jas@extundo.com>
913 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
916 2006-07-28 Bruno Haible <bruno@clisp.org>
918 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
920 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
922 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
925 2006-07-28 Bruno Haible <bruno@clisp.org>
927 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
928 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
930 Avoids link error on FreeBSD 4.x.
931 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
933 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
935 * mbswidth.c (iswcntrl): Likewise.
937 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
939 * modechange.c (mode_compile): Numeric modes now affect setuid and
940 setgid on directories only if they set these bits.
941 * modechange.h: Remove obsolete comment about masks.
943 2006-07-27 Bruno Haible <bruno@clisp.org>
945 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
946 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
949 2006-07-26 Eric Blake <ebb9@byu.net>
951 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
952 like mingw that lack mkstemp.
953 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
954 avoid compilation warning on mingw.
956 2006-07-25 Bruno Haible <bruno@clisp.org>
958 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
959 <stdarg.h> or config.h.
961 2006-07-24 Bruno Haible <bruno@clisp.org>
963 * clean-temp.h: New file, from GNU gettext.
964 * clean-temp.c: New file, from GNU gettext.
966 2006-07-24 Bruno Haible <bruno@clisp.org>
968 * tmpdir.h: New file, from GNU gettext.
969 * tmpdir.c: New file, from GNU gettext.
971 2006-07-23 Bruno Haible <bruno@clisp.org>
973 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
974 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
975 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
976 gl_linked_remove_at): Use it.
978 2006-07-23 Eric Blake <ebb9@byu.net>
980 * tmpfile-safer.c: New file.
981 * stdio-safer.h (fopen_safer): Add prototype.
982 * stdio--.h (tmpfile): Make safer.
984 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
986 * close-stream.c, close-stream.h: New files.
988 2006-07-22 Bruno Haible <bruno@clisp.org>
990 Merge from GNU gettext 0.15.
992 2005-07-05 Bruno Haible <bruno@clisp.org>
994 * printf-args.c (printf_fetchargs): Work around broken
995 definition of wint_t on mingw.
997 2005-02-12 Bruno Haible <bruno@clisp.org>
999 * xallocsa.h: Add extern "C" for C++.
1001 2006-05-17 Bruno Haible <bruno@clisp.org>
1004 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
1006 2006-04-30 Bruno Haible <bruno@clisp.org>
1008 * progreloc.c: Include <mach-o/dyld.h> if available.
1009 (find_executable): Use _NSGetExecutablePath when possible.
1011 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
1013 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
1016 2005-12-29 Bruno Haible <bruno@clisp.org>
1018 * progreloc.c (set_program_name_and_installdir): Fix
1021 2005-12-04 Bruno Haible <bruno@clisp.org>
1024 * progreloc.c: Include <windows.h> also on Cygwin.
1025 (find_executable): Add support for Cygwin.
1026 (set_program_name_and_installdir): Handle also platforms with
1029 2006-07-11 Bruno Haible <bruno@clisp.org>
1031 * javacomp.c: Fix a comment.
1032 Reported by Jim Meyering.
1034 2006-04-30 Bruno Haible <bruno@clisp.org>
1036 * javacomp.h (compile_java_class): Add source_version,
1037 target_version arguments.
1038 * javacomp.c: Rewritten to choose only a compiler that
1039 respects the specified source_version and target_version.
1041 2006-06-27 Bruno Haible <bruno@clisp.org>
1043 Assume correct S_ISDIR macro.
1044 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1046 2006-07-22 Bruno Haible <bruno@clisp.org>
1048 * javaversion.h: New file, from GNU gettext.
1049 * javaversion.c: New file, from GNU gettext.
1050 * javaversion.java: New file, from GNU gettext.
1051 * javaversion.class: New file, from GNU gettext.
1053 2006-05-17 Bruno Haible <bruno@clisp.org>
1056 * javaexec.c (execute_java_class): Test for jview program
1059 2006-04-09 Bruno Haible <bruno@clisp.org>
1061 * fatal-signal.c: Don't include string.h.
1062 (at_fatal_signal): Use a copying loop instead of memcpy.
1064 2005-12-04 Bruno Haible <bruno@clisp.org>
1066 * csharpexec.c: Add support for 'clix' launcher (untested).
1067 (execute_csharp_using_sscli): New function.
1068 (execute_csharp_program): Call it.
1070 2006-06-21 Bruno Haible <bruno@clisp.org>
1072 Avoid warnings from recent versions of mcs.
1073 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1074 -o, -L, -r any more. Use options documented since mcs-1.0
1075 instead. Similarly for -g.
1077 2005-07-09 Bruno Haible <bruno@clisp.org>
1079 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1081 Reported by Mark Junker <mjscod@gmx.de>.
1083 2006-06-17 Bruno Haible <bruno@clisp.org>
1085 * config.charset: Update for NetBSD 3.0.
1087 2006-05-17 Bruno Haible <bruno@clisp.org>
1090 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1092 2006-05-16 Bruno Haible <bruno@clisp.org>
1094 * localcharset.c [CYGWIN]: Include <windows.h>.
1095 (get_charset_aliases): For Cygwin, return the same CPxxx
1096 aliases list as under WIN32.
1097 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1098 the environment variables. Fall back to GetACP().
1100 2006-04-05 Bruno Haible <bruno@clisp.org>
1102 * config.charset: Update Juan Manuel Guerrero's address.
1104 2005-02-12 Bruno Haible <bruno@clisp.org>
1106 * allocsa.h: Add extern "C" for C++.
1108 2005-02-10 Bruno Haible <bruno@clisp.org>
1110 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1111 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1113 2006-07-22 Bruno Haible <bruno@clisp.org>
1115 * gettext.h: Update to GNU gettext-0.15.
1117 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1118 and Simon Josefsson <jas@extundo.com>
1120 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1122 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1124 2006-07-21 Eric Blake <ebb9@byu.net>
1126 * stdlib-safer.h: New file from coreutils, required by
1129 2006-07-19 Derek R. Price <derek@ximbiot.com>
1131 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1132 Reindent and repaginate.
1134 2006-07-17 Bruno Haible <bruno@clisp.org>
1136 * gl_list.h: New file.
1137 * gl_list.c: New file.
1138 * gl_array_list.h: New file.
1139 * gl_array_list.c: New file.
1140 * gl_carray_list.h: New file.
1141 * gl_carray_list.c: New file.
1142 * gl_linked_list.h: New file.
1143 * gl_linked_list.c: New file.
1144 * gl_anylinked_list1.h: New file.
1145 * gl_anylinked_list2.h: New file.
1146 * gl_avltree_list.h: New file.
1147 * gl_avltree_list.c: New file.
1148 * gl_anyavltree_list1.h: New file.
1149 * gl_anyavltree_list2.h: New file.
1150 * gl_rbtree_list.h: New file.
1151 * gl_rbtree_list.c: New file.
1152 * gl_anyrbtree_list1.h: New file.
1153 * gl_anyrbtree_list2.h: New file.
1154 * gl_anytree_list1.h: New file.
1155 * gl_anytree_list2.h: New file.
1156 * gl_linkedhash_list.h: New file.
1157 * gl_linkedhash_list.c: New file.
1158 * gl_anyhash_list1.h: New file.
1159 * gl_anyhash_list2.h: New file.
1160 * gl_avltreehash_list.h: New file.
1161 * gl_avltreehash_list.c: New file.
1162 * gl_rbtreehash_list.h: New file.
1163 * gl_rbtreehash_list.c: New file.
1164 * gl_anytreehash_list1.h: New file.
1165 * gl_anytreehash_list2.h: New file.
1167 * gl_oset.h: New file.
1168 * gl_oset.c: New file.
1169 * gl_array_oset.h: New file.
1170 * gl_array_oset.c: New file.
1171 * gl_avltree_oset.h: New file.
1172 * gl_avltree_oset.c: New file.
1173 * gl_rbtree_oset.h: New file.
1174 * gl_rbtree_oset.c: New file.
1175 * gl_anytree_oset.h: New file.
1177 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1179 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1181 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1182 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1183 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1184 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1185 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1186 callers changed. Revamp internals significantly, by not
1187 attempting to create directories that are temporarily more
1188 permissive than the final results. Do not attempt to use
1189 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1190 This removes some race conditions, fixes some bugs, and simplifies
1191 things. Use new dirchownmod function to do owner and mode changes.
1192 * mkdir-p.h: Likewise.
1193 * modechange.c (octal_to_mode): New function.
1194 (struct mode_change): New member mentioned.
1195 (make_node_op_equals): New arg mentioned. All callers changed.
1196 (mode_compile): Keep track of which mode bits the user has explicitly
1198 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1199 New arg PMODE_BITS, to keep track of which mode bits the user
1200 mentioned; it treats S_ISUID and S_ISGID speciall.
1201 All callers changed.
1202 * modechange.h: Likewise.
1204 2006-07-11 Derek R. Price <derek@ximbiot.com>
1206 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1208 2006-07-10 Derek R. Price <derek@ximbiot.com>
1210 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1211 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1212 macros into the GNU _D_EXACT_NAMLEN.
1213 * savedir.c: Likewise.
1214 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1216 2006-07-09 Jim Meyering <jim@meyering.net>
1218 * argp-pv.c: Remove a doubled word in a comment.
1219 * check-version.c (check_version): Likewise.
1220 * javacomp.c (compile_java_class): Likewise.
1222 2006-07-08 Jim Meyering <jim@meyering.net>
1224 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1226 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1228 * getaddrinfo.c: Changes to compile under MSVC6: changed
1229 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1230 brackets. Other minor changes to suppress some compiler
1233 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1235 * getloadavg.c: Use __VMS, not VMS.
1236 * getopt.c: Likewise.
1237 * getpagesize.h: Likewise.
1238 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1239 probably does not work.
1241 2006-07-06 Derek R. Price <derek@ximbiot.com>
1242 and Paul Eggert <eggert@cs.ucla.edu>
1244 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1245 Don't worry about this obsolete case any more.
1246 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1248 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1249 worry about this obsolete case any more.
1251 * getcwd.c: Likewise.
1253 * savedir.c: Likewise.
1255 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1257 * .cppi-disable: Add wcwidth.
1258 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1259 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1260 (ISGRAPH): Remove. All uses changed to isgraph.
1261 (FOLD) [!defined _LIBC]: Remove special case.
1262 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1263 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1265 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1267 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1269 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1271 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1273 * memcasecmp.c: Include <limits.h>.
1274 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1275 * strtod.c (strtod): Don't assume isspace works on negative chars.
1276 Don't assume isdigit succeeds only on '0' through '9'.
1278 2006-07-05 Derek R. Price <derek@ximbiot.com>
1280 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1281 All uses of is_space replaced by isspace.
1282 * exit.h: Don't talk about STDC_HEADERS.
1283 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1284 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1285 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1286 replaced by isprint etc.
1287 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1288 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1289 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1290 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1291 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1292 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1294 2006-07-05 Eric Blake <ebb9@byu.net>
1296 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1297 missing from netdb.h.
1298 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1300 2006-06-27 Bruno Haible <bruno@clisp.org>
1302 Assume ANSI C header files and <ctype.h> functions.
1303 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1304 (mbsnwidth): Use isprint, iscntrl instead.
1306 2006-07-03 Jim Meyering <jim@meyering.net>
1308 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1309 macro is used before the first cycle_check call.
1311 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1313 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1314 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1315 reported by Mark D. Baushke, one in
1316 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1318 Merge from coreutils.
1320 * .cppi-disable: Add stdint_.h.
1321 * .cvsignore: Add stdint.h.
1323 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1325 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1326 both double and long double versions.
1327 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1328 * xstrtold.c: New file.
1329 * xstrtod.h (xstrtold): New decl.
1331 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1333 * filemode.c (setst): Remove.
1334 (strmode): Rewrite to avoid setst. This makes the code shorter,
1335 (arguably) clearer, and the generated code is a bit smaller on my
1336 Debian GNU/Linux stable x86 host.
1338 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1340 * filemode.c: Include "filemode.h" first, to test the interface.
1341 Assume that filemode.h includes sys/types.h and sys/stat.h.
1342 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1343 (ftypelet): Reorder to put common cases first, for efficiency.
1344 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1346 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1347 of 10, for compatibility with FreeBSD. All callers changed.
1348 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1349 that can't be deduced solely from st_mode. First arg is now a const
1351 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1352 (strmode): Renamed from mode_string.
1353 (filemodestring): New decl.
1354 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1355 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1356 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1358 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1360 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1361 fsusage.h now does that. Include fsusage.h first, to test interface.
1362 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1363 at most one method (the old code could have generated decls that
1364 didn't conform to C89, not that this was ever exercised).
1365 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1367 2006-03-19 Jim Meyering <jim@meyering.net>
1369 Work even in a chroot where d_ino values for entries in "/"
1370 don't match the stat.st_ino values for the same names.
1371 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1372 number, iterate through all entries again, using lstat instead.
1373 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1374 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1376 * getcwd.c (__getcwd): Clarify a comment.
1377 Use memcpy in place of a call to strcpy.
1379 2006-03-12 Jim Meyering <jim@meyering.net>
1381 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1382 that of the current directory (which we're about to chdir ".." out of),
1383 then save the dev-ino of the parent, instead.
1385 * same-inode.h (SAME_INODE): New file/macro.
1386 * chdir-safer.c (SAME_INODE): Remove definition.
1387 Include "same-inode.h", instead.
1389 * cycle-check.h: Include "same-inode.h".
1390 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1391 * cycle-check.c (SAME_INODE): Remove definition.
1392 * root-dev-ino.h: Include "same-inode.h".
1394 2006-03-11 Eric Blake <ebb9@byu.net>
1396 * same.c (same_name): s/base_name/last_component/
1397 * backupfile.c (check_extension, numbered_backup): Likewise.
1398 * filenamecat.c (file_name_concat): Likewise.
1400 2006-03-11 Eric Blake <ebb9@byu.net>,
1401 Paul Eggert <eggert@cs.ucla.edu>
1403 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1404 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1406 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1407 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1408 (last_component): New method.
1409 * dirname.c (dir_len): Determine when drive letters need a
1410 subsequent slash. Preserve // when it is special.
1411 (dir_name): Don't append dot when drive letter is absolute.
1412 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1413 * basename.c (base_name): New semantics - malloc the result.
1414 Preserve // when it is special. Preserve relative files that look
1416 (base_len): Preserve // when it is special.
1417 (last_component): New method, similar to old base_name semantics.
1418 * stripslash.c (strip_trailing_slashes): Use last_component, not
1419 base_name. Strip redundant slashes from ///.
1421 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1423 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1424 both are 64 bits, since this seems to be the tradition, and this
1425 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1426 we ever run into a host that prefers long long to long in this
1427 case, we'll need another configure-time test. Problem reported by
1430 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1432 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1433 possible collision with system files.
1434 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1435 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1436 WCHAR_MIN and WCHAR_MAX in this case.
1437 (<stddef.h>): Do not include; no longer needed.
1438 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1439 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1440 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1441 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1442 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1443 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1444 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1445 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1446 !defined(__c99))]: Include in this case too, since it's harmless
1448 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1450 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1451 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1452 (_STDINT_MIN, _STDINT_MAX): New macros.
1453 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1454 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1455 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1456 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1457 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1458 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1459 macros, not typedefs; this simplifies things quite a bit.
1460 Use long int for all types narrower than int64_t.
1461 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1462 Define in terms of long long int or int64_t or long int,
1463 not int64_t or int32_t. This saves some compile-time testing.
1464 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1465 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1466 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1467 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1468 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1469 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1470 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1471 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1472 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1473 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1474 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1475 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1476 undef any previous version and define our own version, for
1477 simplicity and consistency with the new macros for types.
1478 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1479 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1480 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1481 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1482 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1483 @WINT_T_SUFFIX@ to keep things simple here.
1484 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1485 Simplify by assuming typical 8/16/32/64 host, since we're
1486 already doing that elsewhere anyway.
1487 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1488 and assume long long int is 64 bits if available. This
1489 speeds up 'configure'.
1491 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1493 * getaddrinfo.c: fixed typo
1495 2006-06-29 Eric Blake <ebb9@byu.net>
1497 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1498 unused static function.
1500 2006-06-29 Eric Blake <ebb9@byu.net>
1502 * stat_.h: New file.
1504 2006-06-29 Derek R. Price <derek@ximbiot.com>
1506 * strftime.c: Assume strftime() exists.
1508 2006-06-28 Bruno Haible <bruno@clisp.org>
1510 * getaddrinfo.h: Fix POSIX URL.
1511 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1512 (use_win32_p): Make static.
1513 (getaddrinfo): Reject service name if it is empty or does not consist
1514 solely of decimal digits, or if its value is > 65535.
1515 (getnameinfo): Remove useless casts.
1517 2006-06-28 Derek R. Price <derek@ximbiot.com>
1519 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1520 Autoconf 2.60 says this stuff was obsolete.
1522 2006-05-12 Bruno Haible <bruno@clisp.org>
1524 * mkdtemp.c [MINGW]: Include <io.h>.
1525 (mkdir): Define using _mkdir.
1527 2006-06-28 Bruno Haible <bruno@clisp.org>
1529 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1530 declaration for wcwidth.
1531 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1533 2006-06-28 Eric Blake <ebb9@byu.net>
1535 * xvasprintf.h: Fix comments.
1537 2006-06-28 Eric Blake <ebb9@byu.net>
1539 * mbchar.h (wcwidth): Include wcwidth.h.
1540 * mbswidth.c (wcwidth): Move from here...
1541 * wcwidth.h: ...to this new file.
1543 2006-06-28 Simon Josefsson <jas@extundo.com>
1545 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1546 functions there. It will succeed on Windows XP, but on Windows
1547 2000 and (presumably) earlier, it will fail, and use the internal
1549 (use_win32_p): New function.
1550 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1551 Support AI_NUMERICSERV to disable getservbyname.
1552 (getnameinfo): New function, only supports
1553 NI_NUMERICHOST|NI_NUMERICSERV for now.
1555 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1556 only have some of them. Add AI_NUMERICSERV. Add prototype for
1559 2006-06-27 Bruno Haible <bruno@clisp.org>
1561 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1563 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1565 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1566 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1567 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1569 2006-06-26 Bruno Haible <bruno@clisp.org>
1571 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1573 Reported by Mark D. Baushke and Larry Jones.
1575 2006-06-26 Bruno Haible <bruno@clisp.org>
1577 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1579 Suggested by Mark D. Baushke and Larry Jones.
1581 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1583 * stdint_.h: Treat BSD/OS like OpenBSD.
1585 2006-06-23 Bruno Haible <bruno@clisp.org>
1587 * stdint_.h: Treat IRIX like OpenBSD.
1589 2006-06-23 Bruno Haible <bruno@clisp.org>
1591 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1592 ISO C 99 Technical Corrigendum 1.
1594 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1596 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1597 Some compiler complained about some of them. Problem reported by
1599 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1601 2006-06-21 Simon Josefsson <jas@extundo.com>
1603 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1606 * socket_.h: Don't define WINVER.
1608 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1609 slightly modified to work in gnulib.
1611 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1613 * read-file.c (fread_file): Start with buffer allocation of
1614 0 bytes rather than 1 byte; this simplifies the code.
1615 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1616 code to free buffer and save/restore errno.
1617 (internal_read_file): Remove unused local.
1619 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1621 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1622 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1623 Problem reported by Denis Excoffier in
1624 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1626 2006-06-19 Simon Josefsson <jas@extundo.com>
1628 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1630 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1632 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1634 2006-06-17 Bruno Haible <bruno@clisp.org>
1636 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1638 2006-06-17 Bruno Haible <bruno@clisp.org>
1640 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1641 problem on Solaris 2.5.1.
1643 2006-06-16 Eric Blake <ebb9@byu.net>
1645 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1646 * unicodeio.c [!defined errno]: Likewise.
1647 * strtol.c [!defined errno]: Likewise.
1648 * strtod.c [!defined errno]: Likewise.
1650 2006-06-15 Bruno Haible <bruno@clisp.org>
1652 * stdint_.h: Rewritten to be fully auto-configured.
1653 Fixes bug on HP-UX/IA64.
1655 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1657 * getdate.y (__attribute__): Don't define if already defined.
1658 Problem reported by Larry Jones.
1659 * utimens.c (__attribute__): Likewise.
1661 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1663 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1664 reported by Andreas Schwab.
1666 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1667 Bruno Haible <bruno@clisp.org>
1669 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1671 2006-05-26 Martin Lambers <marlam@marlam.de>
1673 * getpass.c: Updates the test for the native W32 API, and adds
1674 missing includes, thus fixing compilation warnings.
1676 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1678 * tempname.c (small_open, large_open): New macros.
1679 (__open, __open64) [!_LIBC]: Remove.
1680 (__gen_tempname): Use small_open and large_open instead of __open
1681 and __open64. This fixes a portability bug on HP-UX 11.11i
1682 reported by Simon Wing-Tang in
1683 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1685 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1687 * exclude.c (exclude_fnmatch): New function.
1688 (excluded_file_name): Call exclude_fnmatch.
1689 * exclude.h (excluded_file_name): New prototype
1691 2006-05-24 Bruno Haible <bruno@clisp.org>
1693 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1694 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1695 Reported by Thorsten Maerz <torte@netztorte.de> via
1696 Aaron Stone <aaron@serendipity.cx>.
1698 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1700 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1701 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1702 (my_usleep): Don't mishandle maximum value.
1704 2006-05-19 Jim Meyering <jim@meyering.net>
1706 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1708 2006-05-17 Bruno Haible <bruno@clisp.org>
1711 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1713 2006-05-17 Bruno Haible <bruno@clisp.org>
1715 * stdint_.h: Fix recognition of Cygwin.
1717 2006-05-11 Jim Meyering <jim@meyering.net>
1719 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1721 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1723 * crc.c (crc32_update): Remove unnecessary L suffix.
1724 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1725 unwanted sign propagation, e.g., on hosts with 64-bit int.
1726 There still are some problems with reeelly weird theoretical hosts
1727 (e.g., 33-bit int) but it's not worth worrying about now.
1728 * sha1.c (rol): Likewise.
1729 (K1, K2, K3, K4): Remove unnecessary L suffix.
1731 2006-05-10 Bruno Haible <bruno@clisp.org>
1733 * des.c: Cast to avoid warnings.
1735 2006-05-10 Simon Josefsson <jas@extundo.com>
1737 * md4.c: Typo fix, update copyright years.
1738 (K1, K2): Don't use L because it turn computations into 64-bit on
1741 2006-05-09 Bruno Haible <bruno@clisp.org>
1743 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1744 (EOVERFLOW): Define fallback value.
1745 (xstrcat): New function.
1746 (xvasprintf): Recognize the special case of a string concatenation.
1748 2006-05-01 Bruno Haible <bruno@clisp.org>
1750 * stdint_.h: Shorter URL.
1751 * inttypes.h: Likewise.
1753 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1755 * verify.h: Document the internals better. Most of this change
1756 was written by Bruno Haible.
1758 2006-04-29 Bruno Haible <bruno@clisp.org>
1760 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1761 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1763 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1765 * getdate.y (get_date): When adding relative date, start with the
1766 initial time, not with the result of the first mktime call.
1768 2006-04-23 Bruno Haible <bruno@clisp.org>
1770 * copy-file.c: Include <unistd.h> unconditionally.
1771 * execute.c: Likewise.
1772 * fatal-signal.c: Likewise.
1773 * findprog.c: Likewise.
1774 * mkdtemp.c: Likewise.
1777 * wait-process.h: Likewise.
1779 2006-04-23 Bruno Haible <bruno@clisp.org>
1781 * fwriteerror.c (fwriteerror): Call fclose also when an error
1782 condition was already detected.
1783 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1785 2006-04-19 Derek Price <derek@ximbiot.com>
1786 Eric Blake <ebb9@byu.net>
1788 * inttypes.h: Correct grammar in comment.
1790 2006-04-18 Derek Price <derek@ximbiot.com>
1791 Paul Eggert <eggert@cs.ucla.edu>
1793 * inttypes.h: New file.
1794 * strtoimax.c: Assume <inttypes.h>.
1796 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1798 * utimens.c (futimens): glibc futimesat messes up if /proc
1799 isn't mounted. Problem reported by Kir Kolyshkin.
1801 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1803 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1804 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1805 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1807 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1809 Merge regex changes from libc, removing some of our
1810 POSIX-conformance changes that were rejected and redoing them in a
1813 * regcomp.c (re_compile_internal, init_dfa):
1814 Length arg is now size_t, not Idx. All uses changed.
1815 (peek_token): Forward decl now says internal_function.
1816 (__re_error_msgid, __re_error_msgid_idx):
1817 Now static rather than extern with attribute_hidden.
1818 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1819 For some reason libc prefers K&R style defns for external functions.
1820 (regerror) [!defined _LIBC]: Likewise.
1821 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1822 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1823 (build_range_exp, build_collating_symbol):
1825 (re_compile_fastmap): Use '\0' to memset, not 0.
1826 (utf8_sb_map): Make the calculations more obvious.
1827 (init_dfa, parse_bracket_exp, build_charclass_op):
1828 Call calloc and cast result, as glibc does.
1829 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1830 (build_range_exp, build_collating_symbol):
1831 Now internal functions.
1833 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1835 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1836 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1837 Don't depend on VMS; depend on __VMS instead, for POSIX
1838 namespace cleanness.
1839 (regoff_t): Define to ssize_t, not long int.
1841 Remove the REG_ macros named below. Instead, make the old names
1842 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1844 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1845 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1846 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1847 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1848 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1849 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1850 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1851 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1852 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1853 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1854 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1855 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1856 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1857 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1858 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1859 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1860 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1862 Remove. All uses replaced by the old RE_* names.
1863 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1864 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1865 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1866 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1867 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1868 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1869 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1870 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1871 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1872 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1873 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1874 Don't bother having these macros be independent of each others'
1875 values, since they no longer exist in the POSIX name space.
1877 Rename the following member names back to their old names,
1878 unless !__USE_GNU_REGEX. All uses changed back.
1879 (buffer): Renamed from re_buffer.
1880 (allocated): Renamed from re_allocated.
1881 (used): Renamed from re_used.
1882 (syntax): Renamed from re_syntax.
1883 (fastmap): Renamed from re_fastmap.
1884 (translate): Renamed from re_translate.
1885 (can_be_null): Renamed from re_can_be_null.
1886 (regs_allocated): Renamed from re_regs_allocated.
1887 (fastmap_accurate): Renamed from re_fastmap_accurate.
1888 (no_sub): Renamed from re_no_sub.
1889 (not_bol): Renamed from re_not_bol.
1890 (not_eol): Renamed from re_not_eol.
1891 (newline_anchor): Renamed from re_newline_anchor.
1892 (num_regs): Renamed from rm_num_regs.
1893 (start): Renamed from rm_start.
1894 (end): Renamed from rm_end.
1896 (free_state): Move up a bit.
1898 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1899 #define to be empty.
1900 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1901 when that is what is intended.
1902 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1903 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1905 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1906 All uses changed back to re_malloc, etc. It's now the caller's
1907 responsibility to check for overflow; all callers changed.
1908 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1909 (re_x2nrealloc): Remove.
1910 (free_state): Remove decl.
1912 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1913 (re_set_registers, re_exec):
1916 2006-01-31 Roland McGrath <roland@redhat.com>
1918 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1919 Reported by Mike Frysinger <vapier@gentoo.org>.
1921 2006-01-15 Andreas Jaeger <aj@suse.de>
1924 * regex_internal.c (re_string_reconstruct): Adjust for
1925 build_wcs_upper_buffer change.
1926 (build_wcs_upper_buffer): Change return type.
1928 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1930 * regex_internal.h: Include <stdint.h> if available.
1932 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1934 * regex_internal.h (SIZE_MAX): Provide a default definition.
1936 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1938 * regcomp.c: Adjust for changed secondary hash function.
1940 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1942 * regex.h: Pretty printing.
1943 Clean up namespace a bit.
1945 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1947 * regexec.c (update_cur_sifted_state, check_arrival,
1948 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1950 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1951 Ulrich Drepper <drepper@redhat.com>
1954 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1955 (bitset_word_t): Renamed from bitset_word. All uses changed.
1957 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1960 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1961 * regcomp.c: Remove unnecessary uses of
1962 unsigned RE_TRANSLATE_TYPE.
1963 * regex_internal.h: Likewise.
1964 * regex_internal.c: Likewise.
1965 * regexec.c: Likewise.
1966 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1968 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1970 * regexec.c (find_recover_state): Remove unnecessary
1972 (transit_state_bkref): Make DFA a const pointer.
1973 (get_subexp): Likewise.
1974 (check_arrival): Likewise.
1975 (update_cur_sifted_state): Likewise.
1976 (re_search_internal): Likewise.
1977 (prune_impossible_nodes): Likewise.
1978 (acquire_init_state_context): Likewise.
1979 (proceed_next_node): Likewise.
1980 (set_regs): Likewise.
1981 (free_fail_stack_return): Likewise.
1982 (check_arrival_expand_ecl): Mark DFA parameter as const.
1983 (check_arrival_expand_ecl_sub): Likewise.
1984 (check_subexp_limits): Likewise.
1985 (sub_epsilon_src_nodes): Likewise.
1986 (add_epsilon_src_nodes): Likewise.
1987 (merge_state_array): Likewise.
1988 (update_regs): Likewise.
1989 (build_trtable): Likewise.
1990 (sift_states_backward): Mark MCTX parameter as const.
1991 (build_sifted_states): Likewise.
1992 (update_cur_sifted_state): Likewise.
1993 (sift_states_mkref): Likewise.
1994 (check_arrival_expand_ecl): Mark eclosure as const.
1995 (check_dst_limits_calc_pos_1): Likewise.
1996 * regex_internal.h (re_match_context_t): Make dfa a const
1999 2005-09-06 Ulrich Drepper <drepper@redhat.com>
2001 * regexec.c (merge_state_with_log): Define dfa as const pointer.
2002 (transit_state_sb): Likewise.
2003 (transit_state_mb): Likewise.
2004 (sift_states_iter_mb): Likewise.
2005 (check_arrival_add_next_nodes): Likewise.
2006 (check_node_accept_bytes): Change first parameter to pointer-to-const.
2007 [_LIBC] (re_search_2_stub): Use mempcpy.
2009 * regex_internal.c (re_string_reconstruct): Avoid calling
2010 mbrtowc for very simple UTF-8 case.
2012 * regex_internal.c (re_acquire_state): Make DFA pointer arg
2014 (re_acquire_state_context): Likewise.
2015 * regex_internal.h: Adjust prototypes.
2017 * regex.c: Prevent using C++ compilers.
2019 * regex_internal.c (re_acquire_state): Minor code rearrangement.
2020 (re_acquire_state_context): Likewise.
2022 2006-03-29 Mark D. Baushke <mdb@gnu.org>
2023 Bruno Haible <bruno@clisp.org>
2025 * stdint_.h: On OpenBSD, don't redefine types already included in
2026 <sys/types.h> and <inttypes.h>.
2028 2006-03-24 Eric Blake <ebb9@byu.net>
2030 * time_r.c (copy_string_result): Remove, as it is no longer used.
2032 2006-03-24 Simon Josefsson <jas@extundo.com>
2034 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2035 including some doc fixes.
2036 (base64_encode_alloc): Fix +1 bug on allocation failures.
2038 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2040 * base64.c (base64_encode): Do not read past end of array with
2041 unsanitized input on systems with CHAR_BIT > 8.
2043 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2045 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2046 Typedef to long int, not to off_, as POSIX will likely change
2049 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
2051 * argp-help.c (validate_uparams): Fix typo
2052 * argp-parse.c (argp_default_options): Consistently begin help
2053 messages with a lowercase letter.
2055 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
2057 * time_r.h (asctime_r, ctime_r): Remove. These functions can
2058 overrun buffers and shouldn't be used (much as gets shouldn't be
2060 * time_r.c (asctime_r, ctime_r): Likewise.
2062 2006-03-08 Simon Josefsson <jas@extundo.com>
2064 * gc-gnulib.c (randomize): Don't open files called 'no', they
2065 signal that configure disabled the device.
2067 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
2069 * c-stack.c: Include unistd.h unconditionally, since we now assume
2071 * getlogin_r.c: Likewise.
2072 * getlogin_r.h: Likewise.
2074 * pagealign_alloc.c: Likewise.
2075 * unistd_.h: Remove; no longer needed.
2077 2006-03-07 Simon Josefsson <jas@extundo.com>
2079 * unistd_.h: New file.
2081 2006-03-07 Simon Josefsson <jas@extundo.com>
2083 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2085 2006-03-01 Simon Josefsson <jas@extundo.com>
2087 * readline.c: Fix typo, tiny patch from Stepan Kasal
2090 2006-02-28 Simon Josefsson <jas@extundo.com>
2092 * getopt.c: Protect #include of unistd.h, for MSVS.
2094 2006-02-27 Simon Josefsson <jas@extundo.com>
2096 * base64.h: Indent #define's. From Jim Meyering
2099 2006-02-27 Jim Meyering <jim@meyering.net>
2101 Revert the change of 2006-02-24, so these files can continue
2102 to be sync'd from gettext.
2103 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2106 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2108 * glob.c: Say "invalid" rather than "illegal" in comments.
2110 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2112 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2114 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2116 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2117 AT_FDCWD exceeds INT_MAX.
2118 * openat.h (AT_FDCWD): Likewise.
2120 2006-02-14 Jim Meyering <jim@meyering.net>
2122 Sync from coreutils.
2124 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2125 failure on deficient systems, and simplify gnulib lgpl dependencies.
2126 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2127 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2129 * xalloc-die.c: Remove unused definition of N_.
2131 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2133 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2135 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2137 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2138 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2140 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2142 * argp-namefrob.h: Restore changes accidentally lost during the
2143 "autoupdate" on 2005-12-12.
2145 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2147 * fnmatch.c (L_): Renamed from L, to work around a bug in
2148 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2149 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2152 2006-01-26 Simon Josefsson <jas@extundo.com>
2154 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2155 prototype is visible on mingw32.
2157 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2160 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2163 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2165 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2166 attempt to open for write; this always fails, at least on POSIX
2167 hosts. This reinstates the 2006-01-09 change, which was
2168 inadvertently removed.
2170 2006-01-26 Bruno Haible <bruno@clisp.org>
2171 Paul Eggert <eggert@cs.ucla.edu>
2173 * stdbool_.h (_Bool)
2174 [(! (defined __cplusplus || defined __BEOS__)
2175 && !defined __GNUC__
2176 && !(defined __HP_cc || defined __xlc__
2177 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2178 || defined __sgi))]:
2179 #define to signed char in these cases too; this simplifies
2180 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2181 etc., separately) and makes it more conservative.
2183 2006-01-21 Jim Meyering <jim@meyering.net>
2185 Sync from the stable (b5) branch of coreutils:
2187 * fts.c (fts_children): Don't let close() clobber errno from
2190 * fts.c (fts_stat): When following a symlink-to-directory,
2191 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2192 a dangling symlink. That can also happen at least for ELOOP.
2193 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2194 FYI, this bug predates the inclusion of fts.c in coreutils.
2196 * fts.c (fts_open): Put new maxarglen declaration and uses
2197 in their own block, so pre-c99 compilers don't object.
2199 Avoid the double-free (first in fts_read, second in fts_close) that
2200 would occur when an `active' directory is made inaccessible (e.g.,
2201 via chmod a-x) during a traversal.
2202 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2203 before returning. Reproduce this failure by
2204 mkdir -p a/b; cd a; chmod a-x . b
2205 Reported by Stavros Passas.
2207 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2209 * argp-namefrob.h: Bugfix. Remove stray #
2211 2006-01-25 Bruno Haible <bruno@clisp.org>
2213 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2215 Reported by Paul Eggert.
2217 2006-01-25 Jim Meyering <jim@meyering.net>
2219 * fileblocks.c: Remove more useless parentheses.
2220 * readutmp.h: Likewise.
2222 2006-01-24 Bruno Haible <bruno@clisp.org>
2224 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2226 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2229 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2230 to avoid problems with the built-in _Bool type.
2231 Reported by Paul Eggert on 2005-11-26.
2233 2006-01-24 Jim Meyering <jim@meyering.net>
2235 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2237 2006-01-24 Simon Josefsson <jas@extundo.com>
2239 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2242 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2244 Work around porting bugs reported by Dieter in
2245 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2246 * getopt.c (_NOPROTO): Remove; no longer needed.
2247 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2248 Include "getopt.h" first, to check interface.
2249 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2251 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2252 (__strndup): Revert to K&R-style function dfns, the glibc style.
2253 * strnlen.c: Don't claim it's taken from glibc; it's not.
2254 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2255 Include strnlen.h first, to get prototype properly.
2256 (strnlen): Renamed from __strnlen.
2259 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2261 These changes imported from libc.
2262 * getopt.c: Use __fxprintf instead of inline stream orientation
2263 test and two separate function calls.
2264 * strndup.c (__strndup): Add libc_hidden_def.
2266 2006-01-22 Bruno Haible <bruno@clisp.org>
2268 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2269 temporary buffer for sprintf, take into account the precision also
2270 for 'd', 'i', 'u', 'o', 'x', 'X'.
2272 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2274 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2275 to pacify gcc -Wswitch-default.
2277 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2279 * argp-help.c (usage_long_opt): Do not print DOC options.
2280 (__argp_base_name): Removed
2281 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2283 (__argp_base_name): Provide macro definition or extern declaration
2284 depending on the configuration
2286 2006-01-20 Simon Josefsson <jas@extundo.com>
2288 * inet_ntop.h: Unconditionally include sys/socket.h.
2290 2006-01-19 Simon Josefsson <jas@extundo.com>
2292 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2294 2006-01-12 Simon Josefsson <jas@extundo.com>
2296 * base64.c: Fix warning, reported by Bruno Haible
2297 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2299 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2301 Sync from coreutils.
2302 * md5.c: Fix commentary typos.
2303 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2304 * md5.h (__attribute__): Remove; unused.
2305 * sha1.c: Fix commentary to match md5 better.
2306 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2307 so that we don't need to worry about alignment. All uses changed.
2308 This merges the 2005-10-28 md5 change into sha1.
2310 2006-01-11 Jim Meyering <jim@meyering.net>
2312 Sync from coreutils.
2313 * md5.c (OP): Fix spacing.
2315 2006-01-11 Simon Josefsson <jas@extundo.com>
2317 * stdint_.h (SIZE_MAX): Add missing (.
2319 2006-01-10 Bruno Haible <bruno@clisp.org>
2321 * argp.h (__const): Remove macro. Use const instead.
2322 * argp-fmtstream.h (__const): Likewise.
2323 * glob_.h (__const): Remove macro.
2324 * glob-libc.h: Use const instead of __const.
2326 2006-01-10 Jim Meyering <jim@meyering.net>
2328 Avoid the double-free (first in fts_read, second in fts_close) that
2329 would occur when an `active' directory is made inaccessible (e.g.,
2330 via chmod a-x) during a traversal.
2331 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2332 before returning. Reproduce this failure by
2333 mkdir -p a/b; cd a; chmod a-x . b
2334 Reported by Stavros Passas.
2336 Sync from coreutils.
2337 * sha1.c: Tweak grammar in a comment.
2339 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2341 * regex_internal.h (BITSET_WORD_BITS):
2342 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2343 preprocessor mishandles large unsigned values as if they were signed.
2344 Problem reported by Claudio Fontana in
2345 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2347 2006-01-10 Simon Josefsson <jas@extundo.com>
2349 * socket_.h: New file.
2351 2006-01-10 Bruno Haible <bruno@clisp.org>
2353 * localcharset.c: Update from GNU gettext.
2355 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2357 Sync from coreutils.
2358 * chdir-long.c (cdb_free): Don't bother trying to open directory
2359 for write access: POSIX says that must fail.
2360 * fts.c (diropen): Likewise.
2361 * save-cwd.c (save_cwd): Likewise.
2362 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2363 well, for minor improvements on hosts that lack O_DIRECTORY.
2364 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2365 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2366 Fall back on chown if open failed with EACCES.
2368 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2369 Report an error at compile-time if only a 1-second nominal clock
2370 resolution is found.
2372 * lchmod.h: New file.
2373 * mkdir-p.c: Include lchmod.h, lchown.h.
2374 (make_dir_parents): Use lchown rather than chown, and
2375 lchmod rather than chmod.
2377 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2378 too. Problem with "none" reported by Bob Proulx. Problem with
2379 "proc" reported by n0dalus.
2381 * mountlist.c: Include <limits.h>.
2382 (dev_from_mount_options)
2383 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2384 New function. It no longer assumes "dev=" has the System V meaning
2385 on Linux (since it doesn't). It also parses "dev=" more carefully.
2386 (read_file_system_list)
2387 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2388 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2391 * posixtm.h (PDS_PRE_2000): New macro.
2392 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2393 All usages changed. Reject dates outside the range 1969-1999 if
2394 PDS_PRE_2000 is used.
2396 2006-01-09 Jim Meyering <jim@meyering.net>
2398 Sync from coreutils.
2400 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2402 * chdir-safer.h, chdir-safer.c: New files.
2404 * modechange.c (mode_compile): Reject an invalid mode string
2405 that starts with an octal digit. From Andreas Gruenbacher.
2407 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2408 and dup to open_safer and dup_safer, respectively.
2409 (openat_permissive): Fix typo in comment.
2411 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2412 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2413 (_): Remove; no longer needed.
2414 (openat): Renamed from rpl_openat; no need for rpl_openat
2415 since openat.h renames openat for us.
2416 Replace most of the body with a call to openat_permissive,
2417 to avoid duplicate code.
2418 Port to (probably hypothetical) environments were mode_t is
2420 (openat_permissive): Require mode arg, so that we can check
2421 types better. Put it just after flags. Change cwd failure
2422 indicator from pointer-to-bool to pointer-to-errno-value.
2423 All callers changed.
2424 Invoke openat_save_fail and/or openat_restore_fail if
2425 cwd_errno is null, so that openat can call us.
2426 (openat_permissive, fdopendir, fstatat, unlinkat):
2427 Simplify errno handling to avoid some duplicate code,
2428 as it's OK to set errno on success.
2429 * openat.h: Revamp code so that function macros depend on
2430 __OPENAT_PREFIX only, not also on AT_FDCWD.
2431 (openat_ro): Remove. Caller changed to use openat_permissive.
2432 (openat_permissive): Now a macro, if not a function.
2433 (openat_restore_fail, openat_save_fail): Now always functions,
2434 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2436 * openat-priv.h: New file, defining macros used by mkdirat.c
2438 * mkdirat.c: Include openat-priv.h.
2439 Remove definitions of macros defined therein.
2440 * openat.c: Likewise.
2442 * mkdirat.c (mkdirat): New file and function.
2443 * openat.h (mkdirat): Declare.
2445 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2447 * openat.h (openat_permissive): Declare.
2448 (openat_ro): Define.
2450 * openat.c (EXPECTED_ERRNO): New macro.
2451 (openat_permissive): New function -- used in remove.c rewrite.
2452 (all functions): Set errno just before returning, only if there
2453 was an actual failure.
2454 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2456 Emulate openat-family functions using Linux's procfs, if possible.
2457 Idea and some code based on Ulrich Drepper's glibc changes.
2459 * openat.c: (BUILD_PROC_NAME): New macro.
2460 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2461 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2462 before falling back on save_cwd and restore_cwd.
2463 (fdopendir, fstatat, unlinkat): Likewise.
2465 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2466 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2468 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2469 as second argument to va_arg. Otherwise, some versions of gcc
2470 warn that `if this code is reached, the program will abort'.
2472 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2474 Sync from coreutils.
2476 Add POSIX ACL support
2477 * acl.h (copy_acl, set_acl): Add declarations.
2478 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2479 systems other than Linux.
2480 (chmod_or_fchmod): New function: use fchmod when possible,
2481 and chmod otherwise.
2482 (file_has_acl): Add a POSIX ACL implementation, with a
2483 Linux-specific subcase.
2484 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2485 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2486 acls are unsupported.
2487 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2488 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2491 2006-01-09 Bruno Haible <bruno@clisp.org>
2493 * sysexit_.h (EX_OK): New macro.
2494 Suggested by Martin Lambers <marlam@marlam.de>.
2496 2006-01-09 Bruno Haible <bruno@clisp.org>
2498 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2499 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2500 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2501 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2503 2006-01-09 Bruno Haible <bruno@clisp.org>
2505 * stdint_.h (SIZE_MAX): Write the value without involving negative
2508 2005-10-16 Bruno Haible <bruno@clisp.org>
2510 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2511 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2513 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2515 * strftime.c (tzname): Don't declare if it is already #defined.
2516 Problem reported for Mingw by Mark Junker.
2518 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2520 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2521 long int, not int, for nanosecond counts, so that people who are
2522 used to POSIX struct timespec won't be surprised. Reported by Jim
2525 2005-12-16 Jim Meyering <jim@meyering.net>
2527 * fprintftime.c, fprintftime.h: New files.
2529 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2531 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2532 * argp-help.c (fill_in_uparams): Check if the constructed
2533 struct uparams is valid. Fall back to the default values if it is
2536 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2538 * argp-help.c (__argp_base_name): New function
2539 (__argp_short_program_name): Rewrite using __argp_base_name
2540 * argp-namefrob.h: Define program_invocation_name and
2541 program_invocation_short_name if requested
2542 (__argp_base_name): Add prototype
2543 * argp-parse.c (argp_def): Use gettext wrappers
2544 (argp_default_parser): Use __argp_base_name
2545 * argp-pin.c: New file. Defines program_invocation_name and
2546 program_invocation_short_name on systems that lack them.
2548 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2550 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2551 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2552 porting problem reported by Georg Schwarz in
2553 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2555 2005-07-09 Bruno Haible <bruno@clisp.org>
2557 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2558 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2559 Reported by Mark Junker <mjscod@gmx.de>.
2561 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2563 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2564 (uintmax_t) [defined uintmax_t]: Do not declare.
2565 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2566 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2567 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2568 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2569 sake of portability to weird hosts that C allows (though we don't
2570 know of any practical examples).
2572 * savedir.h (fdsavedir): New decl.
2573 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2574 contains most of the former guts of savedir.
2575 (savedir): Use savedirstream.
2578 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2580 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2581 coreutils no longer futzes with rounding modes.
2583 2005-11-14 Jim Meyering <jim@meyering.net>
2585 * mkstemp-safer.c: Include <config.h>, required for possible
2586 replacement of mkstemp.
2588 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2590 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2592 (gethrxtime) [! (HAVE_NANOUPTIME
2593 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2594 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2595 our own approximation.
2597 2005-11-10 Simon Josefsson <jas@extundo.com>
2599 * readline.c: Remove EOL.
2601 2005-11-08 Eric Blake <ebb9@byu.net>
2603 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2605 2005-11-08 Eric Blake <ebb9@byu.net>
2607 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2609 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2611 Fix porting problem reported by Theodoros V. Kalamatianos.
2612 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2613 Don't assume that futimes failing means we must fail.
2615 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2617 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2618 leave errno alone. Problem reported by Dmitry V. Levin.
2620 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2622 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2623 errno alone. Problem reported by Frederic Jolliton.
2625 2005-10-28 Simon Josefsson <jas@extundo.com>
2627 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2628 "restrict" keywords, as per POSIX. Protect the function
2629 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2630 Don't use K&R prototypes. Check the sprintf return values.
2631 Re-define EAFNOSUPPORT if not present. Indent.
2633 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2634 suggested by Bruno Haible <bruno@clisp.org>.
2636 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2638 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2640 * gc-libgcrypt.c: Add MD2 (which is not available through
2643 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2645 * md2.h, md2.c: New files.
2647 2005-10-24 Simon Josefsson <jas@extundo.com>
2649 * md4.h: Shrink buffer size, now that we changed the type.
2651 2005-10-22 Simon Josefsson <jas@extundo.com>
2653 * arcfour.h, arcfour.c: Use fixed size indices in the
2654 arcfour_context struct (simplify test vector testing in GNU
2657 2005-10-22 Simon Josefsson <jas@extundo.com>
2659 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2660 suggested by Bruno Haible <bruno@clisp.org>.
2662 2005-10-22 Simon Josefsson <jas@extundo.com>
2664 * crc.h: Include stddef.h, for size_t.
2666 2005-10-21 Simon Josefsson <jas@extundo.com>
2668 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2669 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2671 2005-10-21 Simon Josefsson <jas@extundo.com>
2673 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2676 2005-10-21 Simon Josefsson <jas@extundo.com>
2678 * gc-gnulib.c: Support ARCTWO in CBC mode.
2680 2005-10-21 Simon Josefsson <jas@extundo.com>
2682 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2685 * hmac-sha1.c (hmac_sha1): Likewise.
2687 * crc.c (crc32_update): Actually use crc parameter, suggested by
2688 Bruno Haible <bruno@clisp.org>.
2690 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2693 2005-10-21 Simon Josefsson <jas@extundo.com>
2695 * des.h, des.c: New files.
2697 * gc-gnulib.c: Support DES.c
2699 2005-10-21 Simon Josefsson <jas@extundo.com>
2701 * arctwo.h, arctwo.c: New files.
2703 * gc-gnulib.c: Support ARCTWO.
2705 2005-10-21 Simon Josefsson <jas@extundo.com>
2707 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2709 2005-10-19 Simon Josefsson <jas@extundo.com>
2711 * gc-gnulib.c: Support ARCFOUR.
2713 2005-10-19 Simon Josefsson <jas@extundo.com>
2715 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2718 * gc.h: Add ECB enum type.
2720 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2722 2005-10-19 Simon Josefsson <jas@extundo.com>
2724 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2726 2005-10-18 Simon Josefsson <jas@extundo.com>
2728 * md4.h, md4.c: New files, based on md5.?.
2730 2005-10-17 Simon Josefsson <jas@extundo.com>
2732 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2734 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2736 2005-10-17 Simon Josefsson <jas@extundo.com>
2738 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2740 2005-10-17 Simon Josefsson <jas@extundo.com>
2742 * gc.h, gc-libgcrypt.c: Add ciphers.
2744 2005-10-17 Simon Josefsson <jas@extundo.com>
2746 * sha1.c: Use uint32_t instead of md5_uint32.t
2748 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2751 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2753 * md5.h: Use stdint.h and uint32_t. Doc fix.
2755 2005-10-15 Simon Josefsson <jas@extundo.com>
2757 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2759 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2761 2005-10-14 Simon Josefsson <jas@extundo.com>
2763 * arcfour.h, arcfour.c: New files.
2765 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2767 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2768 include <wchar.h>; no longer needed.
2770 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2771 and Ulrich Drepper <drepper@redhat.com>
2774 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2775 instead of inline stream orientation test and two separate
2776 function calls. Pay no attention to USE_IN_LIBIO.
2778 2005-10-14 Roland McGrath <roland@redhat.com>
2780 Import from libc. [BZ #1331]
2781 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2783 Reported by Matej Vela <vela@debian.org>.
2785 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2787 * mkdir-p.c (make_dir_parents): Don't report an error if an
2788 intermediate directory is in a read-only file system. Problem
2789 reported by Eric Blake.
2791 2005-10-13 Simon Josefsson <jas@extundo.com>
2793 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2794 Move memory allocation outside of loop.
2796 2005-10-12 Simon Josefsson <jas@extundo.com>
2798 * gc-pbkdf2-sha1.c: New file.
2800 * gc.h: Add gc_pbkdf2_sha1 prototype.
2802 2005-10-12 Simon Josefsson <jas@extundo.com>
2804 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2805 suggested by Bruno Haible <bruno@clisp.org>.
2807 2005-10-12 Simon Josefsson <jas@extundo.com>
2809 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2811 * gc-gnulib.c (gc_hmac_sha1): New function.
2813 2005-10-12 Simon Josefsson <jas@extundo.com>
2815 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2817 2005-10-12 Simon Josefsson <jas@extundo.com>
2819 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2820 GC_USE_HMAC_MD5, respectively.
2822 * gc-libgcrypt.c (gc_md5): Fix assert call.
2825 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2827 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2829 * gc-gnulib.c (gc_hash_buffer): Ditto.
2831 2005-10-11 Bruno Haible <bruno@clisp.org>
2833 * c-strcasestr.h: New file, from GNU gettext.
2834 * c-strcasestr.c: New file, from GNU gettext.
2836 2005-10-11 Bruno Haible <bruno@clisp.org>
2838 * c-strcase.h: New file, from GNU gettext.
2839 * c-strcasecmp.c: New file, from GNU gettext.
2840 * c-strncasecmp.c: New file, from GNU gettext.
2842 2005-10-11 Simon Josefsson <jas@extundo.com>
2844 * crc.h, crc.c: New files.
2846 * gc.h (gc_hash_buffer): Add doc.
2848 2005-10-08 Simon Josefsson <jas@extundo.com>
2850 * gc.h: Add gc_hash and gc_hash_buffer.
2852 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2854 * gc-libgcrypt.c (gc_hash_buffer): Add.
2856 2005-10-11 Bruno Haible <bruno@clisp.org>
2858 * strcasecmp.c: Include limits.h.
2859 (strcasecmp): Avoid integer overflow on exotic platforms.
2860 * strncasecmp.c: Include limits.h.
2861 (strncasecmp): Avoid integer overflow on exotic platforms.
2862 Reported by Paul Eggert.
2864 2005-10-06 Simon Josefsson <jas@extundo.com>
2866 * hmac-md5.c: New file.
2870 2005-10-06 Simon Josefsson <jas@extundo.com>
2872 * memxor.c (memxor): Avoid casts and warnings.
2874 2005-10-05 Derek Price <derek@ximbiot.com>
2876 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2878 2005-10-05 Simon Josefsson <jas@extundo.com>
2880 * memxor.c (memxor): Fix compiler error.
2882 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2883 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2885 * memxor.h, memxor.c: New files.
2887 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2888 we assume all systems have it, suggested by Jim Meyering
2889 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2890 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2891 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2894 2005-10-04 Bruno Haible <bruno@clisp.org>
2896 * verify.h (verify_true): Provide alternative definition for C++.
2898 2005-10-04 Simon Josefsson <jas@extundo.com>
2900 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2901 D. Baushke" <mdb@gnu.org>.
2903 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2905 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2906 (SSIZE_MAX): New macro, if not already defined.
2907 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2910 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2912 * exclude.c: Include verify.h.
2913 (verify): Remove. All callers changed to use verify.h's version.
2914 * strtoimax.c: Likewise.
2915 * utimecmp.c: Likewis.e
2917 Sync from coreutils.
2918 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2919 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2920 * .cvsignore: Add fts.h, search.h, t-fpending.
2921 * settime.c (settime): Fix { typo in previous patch. Also, don't
2922 bother returning ENOSYS if settimeofday or stime fails; just let
2923 them return whatever errno they want to return.
2924 * utimens.c: Include unistd.h, for dup2.
2925 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2926 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2928 2005-10-02 Jim Meyering <jim@meyering.net>
2930 Sync from coreutils.
2931 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2932 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2933 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2934 Remove AT_FDCWD test.
2935 Do not consume the fd unless successful.
2936 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2937 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2938 block, so that we don't even try to compile it if settimeofday is
2939 available. This works around a compilation failure on OSF1 V5.1,
2940 due to stime requiring a `long int*' while tv_sec is `int'.
2942 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2944 * getdelim.c (getdelim): Remove unused variables.
2946 2005-10-01 Simon Josefsson <jas@extundo.com>
2948 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2949 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2950 AI_* and EAI_* definitions. Protect function declarations.
2952 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2954 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2955 so that the code works even with ancient cpp. Portability problem
2956 with GCC 2.7.2.1 reported by Thomas M.Ott.
2958 2005-09-27 Jim Meyering <jim@meyering.net>
2960 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2962 * intprops.h (signed_type_or_expr__): Define.
2963 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2966 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2968 * verify.h (verify_expr): Remove, replacing with:
2969 (verify_true): New macro that returns true instead of void.
2970 (verify_type__): Remove.
2971 (verify): Use verify_true rather than verify_type__.
2973 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2975 * utimens.c (ENOSYS): Define if not already defined.
2976 (futimens): Support having a null PATH if the file descriptor
2979 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2981 (__attribute): Define to empty unless GCC 3.1 or later.
2982 This works around a core dump on OpenBSD 3.4, which has GCC
2983 2.95.3, which dumps core when given __attribute__(()). It also
2984 simplifies other tests, since we really don't want to bother with
2985 worrying about which ancient version of GCC supported what.
2986 Original problem reported by Yoann Vandoorselaere, with part of
2987 the fix suggested by Derek Price.
2989 2005-09-24 Jim Meyering <jim@meyering.net>
2991 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2992 so we can once again use a positive bitfield width of 1 -- now we
2993 don't have to explain why we were using a bitfield width of 2.
2995 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2997 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2998 Problem reported by Eric Blake.
2999 (getaddrinfo): Initialize se so that it's not garbage.
3000 Redo internal storage allocation so that it doesn't make unportable
3001 assumptions about alignment.
3004 * utimens.c (futimens): Use futimesat if available.
3005 Prefer it to futimes since it doesn't have the futimes bug.
3007 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
3008 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
3009 Instead, declare a function that returns a pointer to an array,
3010 and use verify_type__ to declare the size of the array.
3011 Problem and germ of a solution reported by Bruno Haible.
3012 (verify_type__): Use 2, not 1, for bitfield size, to avoid
3013 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
3015 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
3017 Sync from coreutils.
3019 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3021 * argmatch.h: Include verify.h
3022 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3023 (ARGMATCH_ASSERT): Remove; unused.
3024 * canonicalize.c: Assume STDC_HEADERS.
3025 * exclude.c: Include "strcase.h".
3026 * regex_internal.h [!defined _LIBC]: Likewise.
3027 * getusershell.c: Include stdio--.h rather than stdio.h
3029 (getusershell): Call fopen, not fopen_safer.
3030 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3031 Do not include unistd-safer.h.
3032 (save_cwd): Don't call fd_safer; no longer needed
3033 now that we include fcntl--.h.
3035 * getdate.y (relative_time): New type.
3036 (RELATIVE_TIME_0): New constant.
3037 (parser_control): Use relative_time instead of doing it ourselves.
3038 (%union): Add new relative_time rel member.
3039 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3041 (relunit, relunit_snumber): Now of type rel.
3042 (zone, rel, relunit, get_date): Adjust to above changes.
3044 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3045 Do not include unistd-safer.h.
3046 (getloadavg): Don't call fd_safer; no longer needed
3047 now that we include fcntl--.h.
3049 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3050 (make_dir_parents): Treat ENOSYS like EEXIST.
3052 Improve quality of diagnostics on restore_cwd failure.
3053 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
3054 (make_dir_parents): Last arg is now int * (for errno), not bool *.
3055 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3056 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3057 each time through the loop. Do not diagnose restore_cwd failure;
3058 that is the caller's job (and perhaps the caller does not care).
3060 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3061 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3062 If the file already exists but is not a directory, don't bother
3063 to try to make its parents.
3064 Close potential file descriptor leak if we can't chdir("/") (!).
3065 Don't always return true if chdir($PWD) fails; return true only
3066 if the requested action was done successfully (except for the
3068 Don't log final directory unless we actually made it.
3069 Refactor to avoid duplicate code to fix up permissions.
3070 Don't attempt to fix up parent permissions if chdir($PWD) fails.
3072 * strftime.c (my_strftime): Rewrite the previous change slightly,
3073 to make it a bit faster and (I hope) clearer.
3074 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3075 Fix bug in formats like %2N.
3077 * verify.h: New file.
3079 2005-09-22 Jim Meyering <jim@meyering.net>
3081 Sync from coreutils.
3083 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3085 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3086 the .tm_year member, since otherwise gcc-4.0 would now warn about
3087 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3089 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3090 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3092 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3093 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3094 when run in a time zone for which daylight savings time is in effect
3095 for the starting date.
3097 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3098 stop us from restricting permissions of just-created absolute-named
3100 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3101 to restore initial working directory.
3102 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3103 to tell caller if/when we change the working directory and are
3104 unable to return to the initial one.
3105 * mkdir-p.h (make_dir_parents): Update prototype.
3106 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3107 `return false'. This fixes a bug introduced on 2004-07-30.
3109 * openat.c (fdopendir): Be sure to close the supplied
3110 file descriptor before returning. This makes our replacement
3111 implementation a little closer to Solaris's, where fdopendir
3112 ties the file descriptor to the returned DIR* pointer.
3113 * openat.c (unlinkat): New function.
3114 * openat.h (unlinkat): Add prototype.
3115 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3116 (openat_restore_fail): Rename from openat_restore_die.
3117 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3119 Provide an alternative to exiting immediately upon save_cwd or
3120 restore_cwd failure. Now, an application can arrange e.g.,
3121 to perform a longjump in that case.
3122 * openat.c: Include dirname.h.
3123 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3124 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3125 and openat_restore_die rather than calling error directly.
3126 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3128 * openat-die.c (openat_save_die, openat_restore_die): New file.
3129 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3131 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3132 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3133 int utc, int nanoseconds);
3135 date should not have to allocate a megabyte of virtual memory to
3136 handle a format argument like +%1048575T. When implemented with
3137 strftime, it must allocate such a buffer, use strftime to fill it
3138 in, print it, then free it.
3139 With fprintftime, it simply prints everything and exits.
3140 With no need for memory allocation, that's one fewer way to fail.
3141 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3142 optional field width, not before, so we accept %9:z, not %:9z.
3143 (my_strftime): Be sure to use L_('x') for literals.
3145 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3146 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3147 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3148 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3149 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3150 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3151 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3152 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3153 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3155 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3156 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3157 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3158 and don't include <sys/file.h>).
3160 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3162 Sync from coreutils.
3164 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3165 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3166 [!LDAV_DONE]: Avoid unused variable warning.
3168 2005-09-21 Bruno Haible <bruno@clisp.org>
3170 * unicodeio.h (unicode_to_mb): New declaration.
3172 2005-09-20 Derek Price <derek@ximbiot.com>
3174 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3176 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3178 Use a consistent style for including <config.h>.
3179 * __fpending.c, acl.c, argmatch.c,
3180 argp-help.c, argp-parse.c,
3181 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3182 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3183 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3184 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3185 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3186 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3187 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3188 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3189 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3190 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3191 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3192 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3193 modechange.c, mountlist.c, open-safer.c, physmem.c,
3194 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3195 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3196 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3197 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3198 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3199 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3200 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3201 userspec.c, utimecmp.c, version-etc-fsf.c,
3202 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3203 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3204 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3205 Standardize inclusion of config.h.
3206 * __fpending.h, dirfd.h, getdate.h, human.h,
3207 inttostr.h: Removed inclusion of config.h from header files.
3208 * inttostr.c: Adjusted in-tree users.
3209 * timespec.h: Remove superfluous warning to include config.h.
3210 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3211 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3212 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3213 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3215 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3217 * stat-time.h: New file.
3218 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3219 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3221 (timespec_cmp): New function.
3222 * utimecmp.c: Include stat-time.h.
3223 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3224 members exist, not on the obsolescent ST_MTIM_NSEC.
3225 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3227 2005-09-15 Derek Price <derek@ximbiot.com>
3228 Paul Eggert <eggert@cs.ucla.edu>
3230 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3231 changes, consolidating in...
3232 * regex_internal.h: ...this file.
3234 2005-09-15 Derek Price <derek@ximbiot.com>
3236 * regex_internal.h: Blank `pure' for GNUC < 3.
3237 * regex_internal.c: Ditto, using this...
3238 (__GNUC_PREREQ): ...new macro.
3239 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3240 (__GNUC_PREREQ): ...this new macro.
3242 * strstr.h: Include string.h. Define strstr as a macro here.
3244 2005-09-13 Derek Price <derek@ximbiot.com>
3246 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3248 Reported by Jim Meyering <jim@meyering.net>.
3250 2005-09-13 Jim Meyering <jim@meyering.net>
3252 * canon-host.c: Filter through gnu indent and reword comments slightly.
3253 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3255 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3258 (base64_encode): Put b64str in initialized data section.
3260 2005-09-12 Derek Price <derek@ximbiot.com>
3262 Return usable errors from canon-host.
3263 * canon-host.h: New file.
3264 * canon-host.c (canon_host): Wrap...
3265 (canon_host_r): ...this new function, which now relies exclusively on
3267 (ch_strerror): New function.
3268 (last_cherror): New global.
3269 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3270 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3272 (freeaddrinfo): Free ai->ai_canonname when set.
3274 2005-09-12 Derek Price <derek@ximbiot.com>
3275 Paul Eggert <eggert@cs.ucla.edu>
3277 * glob-libc.h: Renamed from glob_.h. The new version is
3278 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3279 protecting things that should be done only in gnulib contexts.
3280 * glob_.h: New file, containing only the glob things needed for
3282 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3283 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3284 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3285 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3286 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3287 and to respect the namespace rules better.
3289 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3291 Merge glibc and coreutils changes into gnulib, plus a few
3293 * md5.c: Use #error rather than a string.
3294 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3295 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3296 (__attribute__): Define to empty for non recent-GCC.
3297 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3298 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3299 Renamed from their non-__ counterparts, with new macros replacing
3300 them if not _LIBC. Add __THROW attribute.
3302 (struct md5_ctx): Align buffer if using GCC.
3303 * sha1.h (struct sha1_ctx): Likewise.
3304 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3305 The old name was backwards.
3306 (NOTSWAP): Remove; not used.
3307 (rol): New macro, moved here from md5.h.
3308 (sha1_process_block): Remove a FIXME that doesn't make sense.
3310 2005-09-12 Derek Price <derek@ximbiot.com>
3312 * gai_strerror.c: Include config.h when available. Include
3313 getaddrinfo.h before other headers to test interface.
3314 Reported by Larry Jones <lawrence.jones@ugs.com>.
3316 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3318 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3319 definitions, since that's the preferred style in glibc.
3320 Fix a minor spacing issue, and update copyright notice to match glibc's.
3322 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3324 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3326 2005-09-06 Simon Josefsson <jas@extundo.com>
3328 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3329 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3331 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3333 Change bitset word type from unsigned int to unsigned long int,
3334 as this has better performance on typical 64-bit hosts.
3335 Port bitset code to hosts with unusual word sizes.
3336 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3337 (build_collating_symbol):
3338 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3339 argument is a bitset. This is merely a style issue, but it makes
3340 it clearer that an entire array is expected.
3341 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3342 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3343 Port to the case where bitset_word is not the same as unsigned int.
3344 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3345 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3347 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3348 (build_trtable, group_nodes_into_DFAstates):
3350 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3351 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3352 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3353 * regexec.c (group_nodes_into_DFAstates): Likewise.
3354 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3355 * regcomp.c (optimize_subexps, lower_subexp):
3356 Work even if bitset_word has holes in its bitwise representation.
3357 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3358 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3360 * regex_internal.c (re_string_reconstruct):
3361 Don't assume UCHAR_MAX == 255.
3362 * regex_internal.h (bitset_set_all): Likewise.
3363 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3365 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3366 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3368 (BITSET_WORD_MAX): New macro.
3369 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3370 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3371 (bitset_empty, bitset_copy):
3372 Prefer sizeof (bitset) to multiplying it out ourselves.
3373 (bitset_not_merge): Remove; unused.
3374 (bitset_contain): Return bool, not unsigned int with one bit on.
3375 All callers changed.
3376 * regexec.c (build_trtable): Don't assume bitset has no stricter
3377 alignment than re_node_set; do this by defining a new internal
3378 type struct dests_alloc and using it to allocate memory.
3380 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3382 Check for arithmetic overflow when calculating sizes, to prevent
3383 some buffer-overflow issues. These patches are conservative, in the
3384 sense that when I couldn't determine whether an overflow was possible,
3385 I inserted a run-time check.
3386 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3387 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3388 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3389 (re_xnrealloc, re_x2nrealloc): New inline functions.
3390 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3391 (build_equiv_class, build_charclass): Check for arithmetic overflow
3392 in size expression calculations.
3393 * regex_internal.c (re_string_realloc_buffers):
3394 (build_wcs_upper_buffer, re_node_set_add_intersect):
3395 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3396 (re_dfa_add_node, register_state): Likewise.
3397 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3398 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3399 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3400 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3402 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3404 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3405 to avoid a collision with bits/local_lim.h in glibc.
3406 All uses changed. Problem reported by Dmitry V. Levin in
3407 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3409 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3410 bugs in int versus size_t comparisons.
3411 (re_string_context_at): Fix bug where the code assumed that
3414 Use bool where appropriate.
3415 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3416 All callers changed.
3417 (calc_eclosure_iter): Likewise, for ROOT arg.
3418 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3419 (build_charclass_op): Likewise, for NON_MATCH arg.
3420 * regex_internal.c (re_string_allocate, re_string_construct):
3421 (re_string_construct_common): Likewise, for ICASE arg.
3422 * regexec.c (re_search_2_stub, re_search_stub):
3423 Likewise, for RET_LEN arg.
3424 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3425 (set_regs): Likewise, for FL_BACKTRACK arg.
3426 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3427 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3428 (calc_eclosure_iter, parse_bracket_exp):
3429 Use bool for internal variables that are booleans.
3430 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3431 (set_regs, build_sifted_states, sift_states_bkref):
3432 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3433 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3434 (find_collation_sequence_value):
3436 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3437 (re_node_set_compare):
3438 Return bool, not int. All callers changed.
3439 * regexec.c (check_halt_node_context, check_dst_limits):
3440 (build_trtable, check_node_accept): Likewise.
3441 * regex_internal.h: Include stdbool.h.
3443 Fix bugs uncovered when converting to bool.
3444 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3445 failure instead of charging ahead blindly.
3446 * regex_internal.c (register_state): Likewise.
3447 * regexec.c (re_search_2_stub): Use simpler method than boolean
3448 for freeing internal storage.
3449 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3450 bitset pieces used as boolean, to avoid undefined behavior
3451 on hosts that do int overflow checking.
3453 2005-08-31 Derek Price <derek@ximbiot.com>
3455 * getdelim.c (getdelim): Return EOF on EOF.
3456 Reported by Larry Jones <lawrence.jones@ugs.com>.
3458 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3460 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3461 lengths fit in regoff_t; this isn't true if regoff_t is the same
3463 * regex.c (re_search_internal): 5th arg is LAST_START
3464 (= START + RANGE) instead of RANGE. This avoids overflow
3465 problems when regoff_t is the same width as size_t.
3466 All callers changed.
3467 (re_search_2_stub): Check for overflow when adding the
3468 sizes of the two strings.
3469 (re_search_stub): Check for overflow when adding START
3470 to RANGE; if it occurs, substitute the extreme value.
3472 2005-08-31 Jim Meyering <jim@meyering.net>
3474 * regcomp.c (search_duplicated_node): Make first pointer arg
3476 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3477 (register_state): Likewise.
3478 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3479 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3480 (group_nodes_into_DFAstates): Likewise.
3482 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3484 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3485 old glibc regex code mishandles strings longer than 2**31 bytes.
3486 This patch fixes this when the regex code is used in gnulib
3487 (i.e., outside glibc).
3489 This patch should not affect the use of the regex code inside
3490 glibc. No doubt this problem also needs to be handled for glibc
3491 as well, but the result will be an incompatible change to the
3492 glibc ABI, and the old ABI will have to be supported too. That
3493 can be the the subject for another patch.
3495 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3496 governing whether the rest of this patch is active. By default,
3497 the macro is disabled and the patch has no effect.
3498 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3499 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3500 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3501 (re_match_2, re_set_registers): Use the new types.
3502 * regex_internal.h (Idx, re_hashval_t): New types.
3503 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3505 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3506 (re_string_context_at, bin_tree_t, re_dfastate_t):
3507 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3508 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3509 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3510 (re_string_char_size_at, re_string_wchar_at):
3511 (re_string_elem_size_at):
3512 Use the new types and macros to port to 64-bit hosts.
3513 Use unsigned types for internal values, so that the code
3514 mostly works even for arrays larger than SSIZE_MAX.
3515 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3516 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3517 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3518 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3519 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3520 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3521 (calc_inveclosure, parse_dup_op, build_range_exp):
3522 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3523 (fetch_number, create_token_tree, mark_opt_subexp):
3525 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3526 (create_cd_newstate, re_string_allocate, re_string_construct):
3527 (re_string_realloc_buffers, build_wcs_upper_buffer):
3528 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3529 (re_string_reconstruct, re_string_peek_byte_case):
3530 (re_string_fetch_byte_case, re_string_context_at):
3531 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3532 (re_node_set_init_copy, re_node_set_add_intersect):
3533 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3534 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3535 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3536 (re_acquire_state, re_acquire_state_context, register_state):
3538 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3539 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3540 (re_search_internal, re_search_2_stub, re_search_stub)
3541 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3542 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3543 (update_cur_sifted_state, check_dst_limits):
3544 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3545 (check_subexp_limits, sift_states_bkref, merge_state_array):
3546 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3547 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3548 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3549 (expand_bkref_cache, check_node_accept_bytes):
3550 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3551 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3552 (acquire_init_state_context, check_halt_node_context):
3553 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3554 (sift_states_backward, clean_state_log_if_needed):
3555 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3556 (find_recover_state, transit_state_sb, transit_state_mb):
3557 (transit_state_bkref, build_trtable, match_ctx_clean):
3559 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3560 to work around an assumption that REG_MISSING is negative.
3562 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3563 (seek_collating_symbol_entry) [defined _LIBC]:
3564 (lookup_collation_sequence_value) [defined _LIBC]:
3565 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3566 Use prototypes rather than old-style function definitions.
3567 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3568 (transit_state_sb) [0]:
3569 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3571 * regexec.c (re_search_internal): Simplify update of rm_so and
3574 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3575 (optimize_subexps, lower_subexp):
3576 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3577 since the signed shift might overflow. Use 1u<<31 instead.
3578 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3579 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3582 * regcomp.c (optimize_subexps, lower_subexp):
3583 Use CHAR_BIT rather than 8, for clarity.
3584 * regexec.c (check_dst_limits_calc_pos_1):
3585 (check_subexp_matching_top): Likewise.
3586 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3587 have to worry about portability issues when shifting it left.
3588 Remove no-longer-needed test for table_size > 0.
3589 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3590 in a word, as the resulting behavior is undefined.
3591 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3592 in one case, a <= should have been an <, and in another case the
3593 whole test was missing.
3594 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3595 the standard name CHAR_BIT.
3596 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3597 this is not true on one's complement and signed-magnitude hosts.
3599 * regex_internal.h (re_sub_match_top_t): Remove unused member
3601 (struct re_dfa_t): Remove unused member states_alloc.
3602 * regcomp.c (init_dfa): Don't initialize unused members.
3604 2005-08-31 Bruno Haible <bruno@clisp.org>
3606 * strstr.c: Include <stddef.h>, for NULL.
3607 * strcasestr.c: Likewise.
3608 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3610 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3612 * iconvme.h: Add prototype for iconv_alloc.
3614 2005-08-29 Simon Josefsson <jas@extundo.com>
3616 * iconvme.c: Fix errno.
3618 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3620 * iconvme.c: Split iconv_string into iconv_alloc.
3622 2005-08-27 Jim Meyering <jim@meyering.net>
3624 * fopen-safer.c: Merge minor changes from coreutils.
3625 * dup-safer.c: Likewise.
3626 * fd-safer.c: Likewise.
3628 Merge from coreutils.
3629 * stdio--.h: New file.
3630 * stdlib--.h: New file.
3631 * mkstemp-safer.c: New file.
3633 GNU tar needs these.
3634 * pipe-safer.c: New file.
3635 * creat-safer.c: New file.
3636 * fcntl--.h (creat): Define to creat_safer.
3637 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3638 * unistd--.h (pipe): Define to pipe_safer.
3639 * unistd-safer.h: Declare pipe_safer.
3641 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3643 * regex_internal.h: Remove all references to
3644 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3646 (bitset_not, bitset_merge, bitset_not_merge):
3647 (bitset_mask, re_string_allocate, re_string_construct):
3648 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3649 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3650 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3651 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3652 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3653 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3654 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3655 (re_acquire_state_context):
3656 Remove unnecessary forward decls.
3657 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3658 Put __attribute at function definition,
3659 now that the function decl has been removed.
3660 * regex_internal.c (re_string_peek_byte_case):
3661 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3664 2005-08-26 Simon Josefsson <jas@extundo.com>
3666 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3667 Haible <bruno@clisp.org>.
3669 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3671 * regexec.c (set_regs): Don't alloca with an unbounded size.
3673 alloca modernization/simplification for regex.
3674 * regex.c: Remove portability cruft for alloca. This no longer
3675 needs to be at the start of the file, and can be moved into
3676 regex_internal.h and simplified.
3677 * regex_internal.h: Include <alloca.h>.
3678 (__libc_use_alloca) [!defined _LIBC]: New macro.
3679 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3680 now works outside glibc.
3682 2005-08-24 Simon Josefsson <jas@extundo.com>
3684 * getpass.c: Add WIN32 implementation. Conditionalize use of
3685 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3686 GLIBC specific code.
3688 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3690 Make regex safe for g++. This fixes one real bug (an "err"
3691 that should have been "*err"). g++ problem reported by
3693 * regex_internal.h (re_calloc): New macro, consistent with
3694 re_malloc etc. All callers of calloc changed to use re_calloc.
3695 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3696 not int. All callers changed.
3697 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3698 just use an array of size MB_LEN_MAX.
3699 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3700 (find_recover_state): Change "err" to "*err"; this fixes what
3701 appears to be a real bug.
3702 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3705 2005-08-25 Jim Meyering <jim@meyering.net>
3707 * open-safer.c: Include <config.h>.
3708 Otherwise, we'd lose LARGEFILE support in any file using
3711 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3713 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3714 * regex.h (regerror): Likewise.
3716 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3717 requires this. (The code never needed it.)
3719 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3720 All uses of recently-renamed identifiers changed to use the new,
3721 POSIX-compliant names. The code will build and run just fine
3722 without these changes, but it's better to eat our own dog food
3723 and use the standard-conforming names.
3725 * regex.h: Fix a multitude of POSIX name space violations.
3726 These changes have an effect only for programs that define
3727 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3728 do not change anything for programs compiled in the normal way.
3729 Also, there is no effect on the ABI.
3731 (_REGEX_SOURCE): New macro.
3732 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3733 defined and _GNU_SOURCE is not; this fixes a name space violation.
3735 Rename the following macros to obey POSIX requirements.
3736 The old names are still visible as macros if _REGEX_SOURCE is defined.
3737 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3738 RE_BACKSLASH_ESCAPE_IN_LISTS.
3739 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3740 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3741 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3742 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3743 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3744 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3745 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3746 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3747 (REG_INTERVALS): renamed from RE_INTERVALS.
3748 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3749 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3750 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3751 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3752 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3753 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3754 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3755 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3756 RE_UNMATCHED_RIGHT_PAREN_ORD.
3757 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3758 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3759 (REG_DEBUG): renamed from RE_DEBUG.
3760 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3761 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3762 unusual, since we can't clash with the POSIX REG_ICASE.
3763 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3764 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3765 (REG_NO_SUB): renamed from RE_NO_SUB.
3766 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3767 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3768 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3769 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3770 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3771 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3772 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3773 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3774 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3775 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3776 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3777 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3778 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3779 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3780 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3781 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3782 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3783 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3784 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3785 (REG_FIXED): Renamed from REGS_FIXED.
3786 (REG_NREGS): Renamed from RE_NREGS.
3788 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3789 of other REG_* macros, since POSIX says the user is allowed to
3790 #undef these macros selectively.
3792 (reg_errcode_t): Update comment stating what other tables need
3795 Rename the following enum values to obey POSIX requirements.
3796 The old names are still visible as macros.
3797 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3798 is not defined, since GNU is supposed to be a superset of POSIX as
3799 much as possible, and since we want reg_errcode_t to be a signed
3800 type for implementation consistency.
3801 (_REG_NOERROR): Renamed from REG_NOERROR.
3802 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3803 (_REG_BADPAT): Renamed from REG_BADPAT.
3804 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3805 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3806 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3807 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3808 (_REG_EBRACK): Renamed from REG_EBRACK.
3809 (_REG_EPAREN): Renamed from REG_EPAREN.
3810 (_REG_EBRACE): Renamed from REG_EBRACE.
3811 (_REG_BADBR): Renamed from REG_BADBR.
3812 (_REG_ERANGE): Renamed from REG_ERANGE.
3813 (_REG_ESPACE): Renamed from REG_ESPACE.
3814 (_REG_BADRPT): Renamed from REG_BADRPT.
3815 (_REG_EEND): Renamed from REG_EEND.
3816 (_REG_ESIZE): Renamed from REG_ESIZE.
3817 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3818 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3819 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3820 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3821 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3823 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3824 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3825 changed. But support the old name if the new one is not defined
3826 and if _REGEX_SOURCE.
3828 Change the following member names in struct re_pattern_buffer.
3829 The old names are still supported if !_REGEX_SOURCE.
3830 The new names are always supported, regardless of _REGEX_SOURCE.
3831 (re_buffer): Renamed from buffer.
3832 (re_allocated): Renamed from allocated.
3833 (re_used): Renamed from used.
3834 (re_syntax): Renamed from syntax.
3835 (re_fastmap): Renamed from fastmap.
3836 (re_translate): Renamed from translate.
3837 (re_can_be_null): Renamed from can_be_null.
3838 (re_regs_allocated): Renamed from regs_allocated.
3839 (re_fastmap_accurate): Renamed from fastmap_accurate.
3840 (re_no_sub): Renamed from no_sub.
3841 (re_not_bol): Renamed from not_bol.
3842 (re_not_eol): Renamed from not_eol.
3843 (re_newline_anchor): Renamed from newline_anchor.
3845 Change the following member names in struct re_registers.
3846 The old names are still supported if !_REGEX_SOURCE.
3847 The new names are always supported, regardless of _REGEX_SOURCE.
3848 (rm_num_regs): Renamed from num_regs.
3849 (rm_start): Renamed from start.
3850 (rm_end): Renamed from end.
3852 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3853 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3854 Prepend __ to parameter names.
3856 Undo yesterday's changes.
3858 2005-08-24 Jim Meyering <jim@meyering.net>
3860 Sync from coreutils.
3861 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3863 2005-08-21 Bruno Haible <bruno@clisp.org>
3865 * lock.h: Add multiple inclusion guard.
3866 * tls.h: Add multiple inclusion guard.
3868 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3870 * regex.h (REG_NOSYS)
3871 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3872 Define, since POSIX requires it as of 2001.
3873 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3874 New private symbol, used to keep the enum signed in all cases.
3875 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3876 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3878 * regex_internal.c (re_string_skip_chars, register_state):
3880 Remove forward decls; no longer needed now that we use prototypes.
3881 * regexec.c (acquire_init_state_context, check_halt_node_context):
3882 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3883 (clean_state_log_if_needed): Likewise.
3885 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3887 Fix problems reported by Sam Steingold in
3888 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3889 * regexec.c (sift_states_bkref): Fix portability bug: the code
3890 assumed that reg_errcode_t is a signed type, which is not
3891 necessarily true if _XOPEN_SOURCE is not defined.
3892 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3893 some compilers warn about it otherwise.
3895 2005-08-20 Jim Meyering <jim@meyering.net>
3897 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3898 of unused local, dfa.
3900 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3902 * regcomp.c (create_initial_state): Remove duplicate decl.
3903 (init_word_char, create_initial_state, duplicate_node_closure):
3904 (fetch_token, peek_token_bracket, build_range_exp):
3905 (build_collating_symbol): Remove forward decls; no longer needed
3906 now that we use prototypes.
3909 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3910 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3911 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3912 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3913 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3914 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3915 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3916 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3917 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3918 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3919 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3920 (build_charclass, build_charclass_op, fetch_number, create_tree):
3921 (create_token_tree, mark_opt_subexp, duplicate_tree):
3922 Use prototypes rather than old-style definitions.
3925 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3926 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3927 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3928 (re_string_reconstruct, re_string_peek_byte_case):
3929 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3930 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3931 (re_node_set_init_copy, re_node_set_add_intersect):
3932 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3933 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3934 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3935 (re_acquire_state, re_acquire_state_context, register_state):
3936 (create_ci_newstate, create_cd_newstate, free_state):
3938 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3939 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3940 (re_search_internal, prune_impossible_nodes):
3941 (acquire_init_state_context, check_matching, static):
3942 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3943 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3944 (update_regs, sift_states_backward, build_sifted_states):
3945 (clean_state_log_if_needed, merge_state_array):
3946 (update_cur_sifted_state, add_epsilon_src_nodes):
3947 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3948 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3949 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3950 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3951 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3952 (check_arrival, check_arrival_add_next_nodes):
3953 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3954 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3955 (check_node_accept_bytes, check_node_accept, extend_buffers):
3956 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3957 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3962 (re_string_allocate, re_string_construct, re_string_reconstruct):
3963 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3964 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3965 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3966 (re_string_context_at, re_string_peek_byte_case):
3967 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3968 is defined, since we now use prototypes always.
3970 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3971 C89 or better. All uses removed.
3973 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3975 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3976 [defined lint]: Suppress bogus uninitialized-variable warnings.
3978 * regcomp.c (duplicate_node): Return new index, not an error code,
3979 and let the caller return REG_ESPACE if out of space. This
3980 removes an uninitialied-variable warning with GCC 4.0.1, and also
3981 avoids taking the address of a local variable. All callers
3984 2005-08-19 Jim Meyering <jim@meyering.net>
3986 * regexec.c (proceed_next_node): Redo local variables to
3987 avoid GCC shadowing warnings.
3989 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3991 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3992 (re_node_set_insert_last, re_dfa_add_node):
3993 Rename local variables to avoid GCC shadowing warnings.
3995 2005-08-18 Bruno Haible <bruno@clisp.org>
3997 * strstr.c (strstr): Fix return value in multibyte case.
3998 * strcasestr.c (strcasestr): Likewise.
4000 2005-08-17 Jim Meyering <jim@meyering.net>
4002 Make the %s format (seconds since the epoch) work for a negative
4003 number and when used with a zero-padded field width, e.g. %015s.
4005 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
4006 label so that it precedes the code to set `digits'. Otherwise,
4007 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
4008 print `00-22'. Now, it prints `-0022', as it should.
4010 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
4012 * regex.h: Remove useless space-before-tab. From coreutils.
4014 2005-08-17 Bruno Haible <bruno@clisp.org>
4016 * strcasestr.h: New file.
4017 * strcasestr.c: New file.
4019 2005-08-17 Bruno Haible <bruno@clisp.org>
4021 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4022 * strstr.c: Completely rewritten, with multibyte locale support.
4024 2005-08-17 Bruno Haible <bruno@clisp.org>
4026 * strcasecmp.c: Use mbuiter.h.
4028 2005-08-17 Bruno Haible <bruno@clisp.org>
4030 * mbuiter.h: New file.
4032 2005-08-16 Bruno Haible <bruno@clisp.org>
4034 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4036 (mbi_avail, mbi_advance): Let the iteration end before the terminating
4037 NUL byte, not after it.
4039 2005-08-16 Bruno Haible <bruno@clisp.org>
4041 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4042 the valid ones. Makes the comparison operations transitive:
4043 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4044 * strcasecmp.c (strcasecmp): Use mb_casecmp.
4046 2005-08-16 Bruno Haible <bruno@clisp.org>
4048 * strcase.h (strcasecmp): Add note in comments.
4049 * strncasecmp.c: Use code from strcasecmp.c.
4050 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4051 (strcasecmp): Work correctly in multibyte locales.
4053 2005-08-16 Bruno Haible <bruno@clisp.org>
4055 * strnlen1.h: New file.
4056 * strnlen1.c: New file.
4058 2005-08-16 Bruno Haible <bruno@clisp.org>
4060 * mbfile.h: New file.
4062 2005-08-16 Bruno Haible <bruno@clisp.org>
4064 * mbiter.h: New file.
4066 2005-08-16 Bruno Haible <bruno@clisp.org>
4068 * mbchar.h: New file.
4069 * mbchar.c: New file.
4071 2005-08-16 Bruno Haible <bruno@clisp.org>
4073 * tls.h: New file, from GNU gettext.
4074 * tls.c: New file, from GNU gettext.
4076 2005-08-15 Bruno Haible <bruno@clisp.org>
4078 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4081 2005-08-14 Jim Meyering <jim@meyering.net>
4083 Sync from coreutils.
4085 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4086 Use the hash-table-based cycle-detection code not just when
4087 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4088 Reported by James Youngman in
4089 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4090 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4091 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4092 This lets us compile with -DFTS_DEBUG, once again.
4093 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4094 * fts.c (fd_safer): Remove decl.
4095 Include fcntl--.h rather than unistd-safer.h
4096 (fts_safe_changedir): Don't call fd_safer; no longer needed
4097 now that we include fcntl--.h.
4099 2005-08-11 Simon Josefsson <jas@extundo.com>
4101 * readline.h, readline.c: New file.
4103 2005-08-11 Bruno Haible <bruno@clisp.org>
4105 * strnlen.h (strnlen): Change parameter name to match comment.
4107 2005-08-10 Simon Josefsson <jas@extundo.com>
4109 * strndup.c: Use strnlen.h.
4111 * strnlen.h: New file.
4113 2005-08-02 Simon Josefsson <jas@extundo.com>
4115 * getline.h, getline.c: Rewrite.
4117 * getdelim.h, getdelim.c: New files, ported from glibc.
4119 2005-07-31 Bruno Haible <bruno@clisp.org>
4121 * lock.h (gl_lock_initializer): New macro.
4122 (gl_lock_define_initialized): Use it.
4123 (gl_rwlock_initializer): New macro.
4124 (gl_rwlock_define_initialized): Use it.
4125 (gl_recursive_lock_initializer): New macro.
4126 (gl_recursive_lock_define_initialized): Use it.
4128 2005-07-26 Bruno Haible <bruno@clisp.org>
4130 * lock.h: Update from GNU gettext.
4131 * lock.c: Update from GNU gettext.
4133 2005-07-18 Bruno Haible <bruno@clisp.org>
4135 * lock.h (gl_once_t): New type.
4136 (gl_once_define, gl_once): New macros.
4137 * lock.c (fresh_once): New variable.
4138 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4141 2005-07-18 Simon Josefsson <jas@extundo.com>
4143 * check-version.c (check_version): Accept identical versions too.
4145 2005-07-18 Bruno Haible <bruno@clisp.org>
4147 * lock.h: New file, from GNU gettext.
4148 * lock.c: New file, from GNU gettext.
4150 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4152 * quotearg.c: Add translator comment suggested by Bruno Haible,
4153 with a minor change.
4155 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4157 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4158 copyright symbol and the year.
4159 * version-etc.c (COPYRIGHT_YEAR): New constant.
4160 (version_etc_va): Use parameterized copyright notice.
4161 Reword to conform to the current GNU coding standards.
4163 2005-07-11 Simon Josefsson <jas@extundo.com>
4165 * size_max.h: New file.
4167 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4169 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4172 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4173 and Paul Eggert <eggert@cs.ucla.edu>
4175 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4176 in wint_t, not wchar_t. Remove now-unnecessary cast.
4178 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4180 * regex.c, regex.h: Sync from libc.
4181 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4182 New files, synced from libc, except that regex_internal.h
4183 currently has a small porting fix.
4185 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4187 Remove the dependency of the strftime module on the tzset module.
4188 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4189 Copy the input structure, to work around some of the bug with
4190 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4191 Solaris releases, you should also use the tzset module, but we won't
4192 require it as a dependency any more since we don't want LGPLed code
4193 to depend on GPLed code.
4195 2005-07-02 Jim Meyering <jim@meyering.net>
4197 * backupfile.c (backup_args): Change a `0' to NULL.
4199 2005-07-01 Jim Meyering <jim@meyering.net>
4201 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4202 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4203 * save-cwd.c, tempname.c:
4204 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4205 and don't include <sys/file.h>).
4207 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4209 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4210 declares only 'struct timespec;' (!).
4212 2005-06-29 Jim Meyering <jim@meyering.net>
4214 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4215 type name. Use the variable name instead.
4216 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4218 2005-06-28 Simon Josefsson <jas@extundo.com>
4220 * check-version.h, check-version.c: New files.
4222 2005-06-28 Simon Josefsson <jas@extundo.com>
4224 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4225 collision with global variable. Better indentation. Don't
4226 increment buffer pointer beyond buffer end. Based on comments
4227 from Paul Eggert <eggert@cs.ucla.edu>.
4231 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4233 * canon-host.c (canon-host): Append trailing "," to 0 in
4234 initializer of struct addrinfo, as an indication that we don't
4235 care how many members the structure has.
4237 2005-06-24 Derek Price <derek@ximbiot.com>
4238 and Bruno Haible <bruno@clisp.org>
4240 Remove stat module & update lstat.
4241 * stat.c: Remove this file...
4242 (slash_aware_lstat): ...moving this content and its support...
4243 * lstat.c (rpl_lstat): ...into here.
4244 * lstat.h: New file.
4246 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4248 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4249 (ranged_convert): Don't save conversion in a temporary struct.
4250 This causes a warning with GCC 4.0.0, and anyway in the typical
4251 case it's not worth the extra 100 bytes or so of code.
4252 (ranged_convert, __mktime_internal): When calling a function via a
4253 pointer P, use P () rather than (*P) (), as we now assume C89 or
4256 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4258 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4259 "who -r" failed to give output. Problem reported by Tim Waugh.
4261 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4262 (xcalloc): Use it to avoid needless tests.
4263 Problem reported by Jim Meyering.
4265 2005-06-16 Jim Meyering <jim@meyering.net>
4267 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4268 when either N or S is zero.
4270 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4272 * argp.h (__option_is_short): Check upper limit of
4273 __key. Isprint() requires its argument to have the value
4274 of an unsigned char or EOF.
4276 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4278 * fnmatch.c (fnmatch): If there is an encoding error in a
4279 multibyte string or pattern, fall back on unibyte matching.
4280 Problem reported by James Youngman.
4282 2005-06-08 Bruno Haible <bruno@clisp.org>
4284 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4287 2005-06-08 Bruno Haible <bruno@clisp.org>
4289 * csharpcomp.h: New file, from GNU gettext.
4290 * csharpcomp.c: New file, from GNU gettext.
4291 * csharpcomp.sh.in: New file, from GNU gettext.
4293 2005-06-07 Derek Price <derek@ximbiot.com>
4296 * glob_.h: Indent nested #ifdef.
4298 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4300 Sync from coreutils.
4301 Use "file name" when talking about file names, instead of "filename"
4302 or "path", as per the GNU coding standards.
4303 * mkdir-p.c: Renamed from makepath.c.
4304 (make_dir_parents): Renamed from make_path. All callers changed.
4305 * mkdir-p.h: Likewise. All includers changed.
4306 * filenamecat.c: Renamed from path-concat.c.
4307 (file_name_concat): Renamed from path_concat. All callers changed.
4308 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4309 * filenamecat.h: Likewise. All includers changed.
4310 * acl.c: Don't use "path" or "filename" to mean "file name"
4311 in comments or local variable names.
4312 * basename.c: Likewise.
4313 * canonicalize.c, canonicalize.h: Likewise.
4314 * dirname.c, dirname.h: Likewise.
4315 * euidaccess.c: Likewise.
4316 * exclude.c: Likewise
4317 * fnmatch_.h, fnmatch_loop.c: Likewise.
4318 * fsusage.c, fsuage.h: Likewise.
4319 * fts.c, fts_.h: Likewise.
4320 * getcwd.c: Likewise.
4321 * getloadavg.c: Likewise.
4322 * mkstemp.c: Likewise.
4323 * mountlist.c, mountlist.h: Likewise.
4324 * openat.c, openat.h: Likewise.
4325 * readlink-stub.c: Likewise.
4326 * readutmp.c, readutmp.h: Likewise.
4327 * rename.c: Likewise.
4328 * rmdir.c: Likewise.
4330 * savedir.c: Likewise.
4331 * stripslash.c: Likewise.
4332 * tempname.c: Likewise.
4333 * xreadlink.c: Likewise.
4334 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4336 * exclude.h: Likewise.
4338 * euidaccess.c (getuid, getgid, getuid, getegid)
4339 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4340 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4341 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4342 * pathmax.h: Include <limits.h> unconditionally, since other
4343 files have been getting away with it for years (MORE/BSD 4.3
4345 * userspec.c (getpwnam, getgrnam, getgrgid)
4346 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4348 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4349 Define to 256, not 255, as per modern POSIX.
4351 2005-06-01 Bruno Haible <bruno@clisp.org>
4353 * csharpexec.h: New file, from GNU gettext.
4354 * csharpexec.c: New file, from GNU gettext.
4355 * csharpexec.sh.in: New file, from GNU gettext.
4357 2005-05-31 Derek Price <derek@ximbiot.com>
4358 Paul Eggert <eggert@cs.ucla.edu>
4361 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4363 2005-05-29 Derek Price <derek@ximbiot.com>
4364 Paul Eggert <eggert@cs.ucla.edu>
4366 * glob_.h, glob.c: New files.
4368 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4370 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4372 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4373 the configuration hassle isn't worth it.
4374 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4375 (LONGEST_MODIFIER, PRIuMAX): Remove.
4377 2005-05-27 Bruno Haible <bruno@clisp.org>
4379 * getlogin_r.h: Remove second include of <stddef.h>.
4381 2005-05-25 Bruno Haible <bruno@clisp.org>
4382 Derek Price <derek@ximbiot.com>
4384 * getlogin_r.h: Simplify API documentation.
4386 2005-05-25 Derek Price <derek@ximbiot.com>
4387 Paul Eggert <eggert@cs.ucla.edu>
4389 * getlogin_r.c, getlogin_r.h: New files.
4391 2005-05-22 Bruno Haible <bruno@clisp.org>
4393 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4394 Also include <sys/param.h> if it defines MIN, MAX.
4395 Based on a patch by Derek Price <derek@ximbiot.com>.
4397 2005-05-22 Bruno Haible <bruno@clisp.org>
4399 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4400 (INT64_MIN): Fix definition.
4401 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4403 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4404 NEED_SIGNED_INT_TYPES.
4406 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4407 HAVE_SYSTEM_INTTYPES.
4409 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4411 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4412 so that unistd-safer.h (GPL'ed code) need not be included.
4414 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4417 * fts.c: Don't include "cycle-check.h" or "hash.h".
4418 (setup_dir, free_dir): New functions.
4419 (enter_dir, leave_dir): Define trivial
4420 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4421 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4422 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4423 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4424 Move to fts-cycle.c.
4425 (fts_open): Use setup_dir.
4426 (fts_close): Use free_dir.
4427 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4428 This adds a label and some gotos, but the alternatives were messier.
4429 Check for memory allocation failure when entering a dir.
4430 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4431 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4432 (FTS): New member fts_cycle, that is a union that contains the
4433 old active_dir_ht and cycle_state. All uses changed to mention
4434 fts_cycle.ht and fts_cycle.state.
4435 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4436 fts.c, with the following changes:
4437 (setup_dir, free_dir): New functions.
4438 (enter_dir): Now returns bool. Return true if successful, false
4439 if memory exhausted. All callers changed.
4440 Do not bother partly cleaning up on
4441 memory allocation failure; that is free_dir's job.
4442 However, free ad if hash_insert fails, to avoid memory leak.
4443 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4444 fts->fts_options to see which union member to use.
4446 2005-05-20 Jim Meyering <jim@meyering.net>
4448 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4449 Now a macro, to pacify GCC.
4451 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4453 * chown.c (rpl_chown): Return -1 on failure.
4455 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4457 * canonicalize.c: Include canonicalize.h first, to test interface.
4458 Include <stddef.h> unconditionally, since we assume C89 now.
4459 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4460 * fts.c: Include fts_.h first, to check interface.
4461 Do not include intprops.h; no longer needed.
4462 Include cycle-check.h and hash.h, since fts_.h no longer does.
4463 Remove unnecessary casts of closedir to void.
4464 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4465 decide whether to decrement nlinks.
4466 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4467 (FTS): Use struct hash_table * instead of Hash_table, so that
4468 we no longer need to include hash.h here.
4470 2005-05-17 Jim Meyering <jim@meyering.net>
4472 * fts.c, fts_.h: New files, from coreutils.
4474 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4476 Sync from coreutils.
4477 * unlinkdir.c, unlinkdir.h: New files.
4478 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4479 regex.h, unlocked-io.h, xtime.h:
4480 White space changes only.
4481 * makepath.c (make_path): Port to hosts where leading "//" is special.
4482 * yesno.c: Include getline.h, not ctype.h.
4483 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4484 Use getline to remove arbitrary restriction on response length.
4486 2005-05-13 Bruno Haible <bruno@clisp.org>
4488 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4489 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4490 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4491 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4492 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4493 Add support for 64-bit integers in the MSVC compiler.
4495 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4497 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4498 Change the initial comment to refer to GPL, not LGPL.
4499 gnulib-tool will change it to LGPL as needed.
4501 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4502 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4503 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4504 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4505 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4506 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4507 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4508 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4509 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4510 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4511 concatpath.c, config.charset, copy-file.c, copy-file.h,
4512 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4513 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4514 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4515 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4516 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4517 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4518 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4519 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4520 full-read.c, full-read.h, full-write.c, full-write.h,
4521 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4522 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4523 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4524 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4525 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4526 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4527 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4528 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4529 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4530 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4531 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4532 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4533 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4534 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4535 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4536 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4537 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4538 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4539 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4540 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4541 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4542 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4543 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4544 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4545 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4546 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4547 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4548 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4549 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4550 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4551 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4552 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4553 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4554 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4555 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4556 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4557 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4558 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4559 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4560 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4561 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4562 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4563 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4564 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4565 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4566 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4567 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4568 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4569 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4570 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4571 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4572 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4573 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4574 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4575 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4576 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4577 Update FSF postal mail address.
4579 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4581 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4582 specified in ai_socktype. Fix invalid ai_protocol
4583 check. ai_protocol is usually set to 0 or depending on
4584 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4585 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4586 ai_socktype / ai_protocol in the returned addrinfo structure.
4588 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4589 Bruno Haible <bruno@clisp.org>
4591 * inet_ntop.h: New file.
4592 * inet_ntop.c: New file, from glibc with modifications.
4594 2005-05-08 Jim Meyering <jim@meyering.net>
4596 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4598 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4600 Merge from coreutils. Among other things,
4601 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4602 * fd-safer.c: New file.
4603 * fcntl-safer.h, open-safer.c: Remove.
4604 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4605 * dup-safer.c: Include unistd-safer.h first.
4606 Don't include errno.h.
4607 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4608 * file-type.h: Don't assume invoker included sys/stat.h first.
4609 * file-type.c: Rely on file-type.h change.
4610 * getloadavg.c: Include unistd-safer.h.
4611 (getloadavg): Use safer open.
4612 * getusershell.c: Include "stdio-safer.h".
4613 (getusershell): Use safer fopen.
4614 * long-options.c (long_options): Use NULL rather than 0.
4615 * modechange.h (mode_free): Remove; all callers changed to invoke
4617 * modechange.c: Likewise.
4618 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4619 (MODE_DONE): New constant.
4620 (struct mode_change): Remove 'next' member.
4621 (make_node_op_equals): New function; like the old one of the
4622 same name, except it allocates an array.
4623 (mode_compile, mode_create_from_ref): Use it.
4624 (mode_compile): Allocate result as an array, not a linked list.
4625 Parse octal string ourself, so that we catch mistakes like "+0".
4626 (mode_adjust): Arg is an array, not a linked list.
4627 * modechange.c: Include stat-macros.h, xalloc.h.
4628 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4629 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4630 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4631 Remove. This is now stat-macros.h's job.
4632 (talloc): Remove. All callers replaced by xalloc, so that
4633 our invokers don't have to worry about reporting memory failures.
4634 (make_node_op_equals): Remove.
4635 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4637 (struct mode_change): Moved here from modechange.h.
4638 (mode_append_entry): Remove.
4639 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4640 apps to have incorrect behavior. Use simpler algorithm for head
4641 and tail. Don't futz with umask; that's now the job of mode_adjust.
4642 Detect more invalid usages rather than having somewhat-random behavior.
4643 Don't insert an "a=" action, as that leads to incorrect behavior.
4644 (mode_compile, mode_create_from_ref): Return NULL on error instead
4645 of an enum, since now there's only one way to have an error. All
4647 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4648 at the correct time. Simplify calculation of "+u" and its ilk.
4649 Don't mishandle "+X".
4650 (mode_free): Remove "register" and localize decls.
4651 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4652 (struct mode_change): Move to modechange.c; callers don't
4653 need to see this stuff.
4654 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4655 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4656 (mode_change, mode_adjust): Reflect the new signatures noted above.
4657 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4658 that might redefine system include files.
4659 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4660 (my_usleep): Use NULL rather than (void *) 0.
4661 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4662 Use siginterrupt to specify that system calls should be interrupted.
4663 (rpl_nanosleep): Move initialization of suspended closer to call of
4665 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4666 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4667 (desirable_utmp_entry): New function.
4668 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4669 using x2nrealloc, to simplify logic.
4670 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4671 size calculation. Do not assume utmp file is a regular file.
4672 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4673 (READ_UTMP_CHECK_PIDS): New constant.
4674 * save-cwd.c: Include unistd-safer.h.
4675 (save_cwd): Use fd_safer.
4676 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4677 [!_LIBC] Include "stat-macros.h" instead.
4678 * unistd-safer.h (fd_safer): New decl.
4680 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4682 * byteswap_.h: New file.
4684 2005-04-25 Albert Chin <china@thewrittenword.com>
4686 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4689 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4691 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4692 that "UTC +1 second" continues to work. Problem reported
4694 (relunit_snumber): New rule.
4697 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4699 * getdate.y (universal_time_zone_table): New constant.
4700 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4701 universal_time_zone_table.
4702 (lookup_zone): Prefer universal_time_zone_table to
4703 local_time_zone_table, so that "GMT" time stamps are allowed in
4704 London during the summer. Problem reported by Ian Abbott.
4706 2005-04-12 Jim Meyering <jim@meyering.net>
4708 * human.c (humblock): Set *options even when returning due to
4709 xstrtoumax conversion failure. Thanks to a used-uninitialized
4712 2005-04-09 Jim Meyering <jim@meyering.net>
4714 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4715 -Wuninitialized: initialize tm0.tm_year.
4717 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4719 * getdate.y (parser_control): rels_seen is now a boolean, not a
4720 count, since there's no maximum. All uses changed.
4721 Add member dsts_seen.
4722 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4724 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4725 Use pc_rels_seen to decide whther a date is absolute.
4727 * getdate.y (number): Don't overwrite year.
4728 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4731 2005-04-02 Simon Josefsson <jas@extundo.com>
4733 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4734 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4736 2005-03-27 Jim Meyering <jim@meyering.net>
4738 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4740 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4742 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4743 "one's complement" -> "ones' complement" in comment, as per Knuth.
4744 "value of type" -> "type or expression" in comment.
4745 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4747 2005-03-26 Jim Meyering <jim@meyering.net>
4750 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4751 Correct typos: s/or/of/.
4753 2005-03-23 Jim Meyering <jim@meyering.net>
4755 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4757 2005-03-21 Jim Meyering <jim@meyering.net>
4759 Changes imported from coreutils.
4761 * cycle-check.c: Don't include xalloc.h.
4763 * path-concat.c: Don't include assert.h.
4764 (path_concat): Remove assertion that would have triggered
4765 for ABASE starting with more than one slash.
4766 Reported by Andreas Schwab.
4768 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4769 properly when ABASE is an absolute file name.
4770 Correct the description of this function.
4772 Add an assertion and a test driver.
4773 This fixes a bug introduced on 2004-07-02.
4774 Andreas Schwab reported the resulting failure of cp --parents:
4775 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4777 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4779 * strftime.c (my_strftime): If the underlying strftime returns 0
4780 (which shouldn't happen), generate nothing instead of returning 0
4781 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4783 2005-03-16 Bruno Haible <bruno@clisp.org>
4785 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4787 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4789 * strftime.c (my_strftime): Prepend space to format so that we can
4790 reliably distinguish strftime failure from empty output on POSIX
4793 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4795 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4796 (iconv_string): Don't guess a size-zero buffer, as that might cause
4797 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4798 result would be 'too large', where 'too large' is (heuristically)
4799 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4800 overflow concerns. This will prevent some unwanted malloc failures
4801 when the inputs are very large.
4803 2005-03-15 Bruno Haible <bruno@clisp.org>
4805 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4808 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4811 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4813 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4815 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4816 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4818 * strtol.c: Likewise.
4820 2005-03-14 Simon Josefsson <jas@extundo.com>
4822 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4825 2005-03-14 Jim Meyering <jim@meyering.net>
4827 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4828 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4829 to be nonzero so that we (and caller) can detect the difference
4830 between a valid zero-length expansion and an error return, even
4831 when the underlying strftime fails before writing anything into
4834 2005-03-10 Jim Meyering <jim@meyering.net>
4836 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4837 so that this module works on systems without fchdir.
4839 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4841 Factor int-properties macros into a single file, except for
4842 glibc-related files.
4843 * intprops.h: New file.
4844 * getloadavg.c: Include it instead of limits.h.
4845 (INT_STRLEN_BOUND): Remove.
4846 * human.c: Include intprops.h.
4847 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4848 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4849 * inttostr.h: Include intprops.h instead of limits.h.
4850 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4851 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4852 for consistency with intprops.h.
4853 (time_t_is_integer, twos_complement_arithmetic): Use them.
4854 * sig2str.h: Include <signal.h>, intprops.h.
4855 (INT_STRLEN_BOUND): Remove.
4856 * strftime.c (TYPE_SIGNED): Remove.
4857 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4858 * strtol.c: Adjust comments to match intprops.h.
4859 * userspec.c: Include intprops.h.
4860 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4861 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4862 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4863 instead of rolling our own expressions.
4864 * xstrtol.c: Include xstrtol.h first, to test interface.
4866 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4868 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4869 the right thing even if adding 1900 would overflow. Similarly
4870 for tm_mon + 1 and tm_yday + 1.
4871 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4872 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4873 (DO_SIGNED_NUMBER): New macro.
4874 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4876 2005-03-07 Bruno Haible <bruno@clisp.org>
4878 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4880 2005-03-03 Derek R. Price <derek@ximbiot.com>
4881 Bruno Haible <bruno@clisp.org>
4883 * pagealign_alloc.h: New file.
4884 * pagealign_alloc.c: New file.
4886 2005-01-28 Bruno Haible <bruno@clisp.org>
4888 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4891 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4893 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4894 The workaround isn't strictly needed for POSIX conformance, and
4895 it's too much of a pain to configure and maintain. We'll ask
4896 people to fix their kernels instead.
4897 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4898 (NANOSLEEP_BUG_WORKAROUND): Remove.
4899 (xnanosleep): Remove the workaround.
4901 2005-02-12 Bruno Haible <bruno@clisp.org>
4903 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4905 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4907 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4908 * timespec.h (gettime): Return void, since it always
4909 succeeds now. All uses changed.
4910 * gettime.c (gettime) Likewise.
4911 [HAVE_NANOTIME]: Prefer nanotime.
4912 Assume gettimeofday succeeds, as POSIX requires.
4913 Assime time () succeeds, since other code already does.
4914 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4915 (timespec_subtract): Remove.
4916 (NANOSLEEP_BUG_WORKAROUND): New constant.
4917 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4918 things considerably. Use it only on GNU/Linux hosts, since the
4919 workaround shouldn't be needed elsewhere.
4921 2005-02-24 Bruno Haible <bruno@clisp.org>
4923 * gettext.h: Update from GNU gettext 0.14.2.
4925 2005-02-24 Bruno Haible <bruno@clisp.org>
4927 * localcharset.c: Update from GNU gettext 0.14.2.
4928 * config.charset: Update from GNU gettext 0.14.2.
4930 2005-02-22 Simon Josefsson <jas@extundo.com>
4932 * iconvme.h, iconvme.c: New files, from libc.
4934 2005-02-20 Neil Conway <neilc@samurai.com>
4936 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4937 returned by OSX/Darwin if the specified buffer is not large
4938 enough for the hostname.
4940 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4942 * memrchr.h: New file.
4943 * chdir-long.c: Include it.
4944 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4945 Don't bother including stddef.h.
4947 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4949 * argp-help.c (__argp_help): Create a fake struct argp_state and
4950 pass it to _help, otherwise the latter coredumps trying to
4951 dereference state.root_argp.
4953 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4955 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4957 Include <sys/types.h>, for dev_t.
4958 (ME_DUMMY, ME_REMOTE): Move from here....
4959 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4960 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4962 Include mountlist.h first, to test the interface.
4964 2005-01-29 Bruno Haible <bruno@clisp.org>
4966 * progname.c (program_name): Initialize.
4967 Needed when linking statically on MacOS X.
4969 2005-01-28 Bruno Haible <bruno@clisp.org>
4971 * javacomp.sh.in: New file, from GNU gettext.
4972 * javacomp.h: New file, from GNU gettext.
4973 * javacomp.c: New file, from GNU gettext.
4975 2005-01-26 Bruno Haible <bruno@clisp.org>
4977 * javaexec.sh.in: New file, from GNU gettext.
4978 * javaexec.h: New file, from GNU gettext.
4979 * javaexec.c: New file, from GNU gettext.
4981 2005-01-26 Simon Josefsson <jas@extundo.com>
4983 * gai_strerror.c: Use GPL in header.
4985 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4987 * argp-help.c (hol_entry_help): Avoid using non-constant
4988 initializers for struct pentry_state.
4989 (__argp_error): Check return value of __asprintf
4990 (__argp_failure): Translate error message
4992 * argp-parse.c: Removed braces around the expansion of N_()
4994 2005-01-21 Jim Meyering <jim@meyering.net>
4996 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4997 same value as for Solaris 9.
4999 * chdir-long.c (chdir_long): Rewrite to remove limitation on
5000 component length. This included changing the parameter to be
5001 of type `char *' rather than `char const *'.
5002 * chdir-long.h (chdir_long): Update prototype.
5004 * openat.c (fdopendir, fstatat): New functions.
5005 * openat.h: Include headers required for use of DIR and struct stat.
5006 [AT_SYMLINK_NOFOLLOW]: Define.
5007 (fdopendir, fstatat): Add prototypes.
5009 2005-01-21 Bruno Haible <bruno@clisp.org>
5011 * classpath.h: New file, from GNU gettext.
5012 * classpath.c: New file, from GNU gettext.
5014 2005-01-20 Simon Josefsson <jas@extundo.com>
5016 * version-etc-fsf.c: New file, with version_etc_copyright.
5017 * version-etc.c: Remove version_etc_copyright.
5018 * version-etc.h (version_etc_copyright): Use [] instead of * in
5019 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5021 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
5023 * save-cwd.c (save_cwd): Remove code to support the case
5024 where fchdir is missing or flaky.
5026 2005-01-20 Simon Josefsson <jas@extundo.com>
5028 * base64.h (isbase64): Add.
5030 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5031 using a unsigned prototype, don't inline.
5032 (base64_decode): Use it.
5034 2005-01-19 Bruno Haible <bruno@clisp.org>
5036 * sh-quote.h: New file, from GNU gettext.
5037 * sh-quote.c: New file, from GNU gettext.
5039 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
5041 Merge changes from coreutils, as described below in several
5042 changelogs dated today.
5044 * save-cwd.c: Include "save-cwd.h" before other include files.
5045 (O_DIRECTORY): Remove; not needed here, since "." must be
5046 a directory. All uses removed.
5047 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
5048 universal on Suns, and we also need to test for IRIX.
5049 Revamp code to use 'if' rather than '#if'.
5050 Avoid unnecessary comparison of cwd->desc to 0.
5052 * utimens.c (futimens): Robustify the previous patch, by checking
5053 for known valid error numbers rather than observed invalid ones.
5055 2005-01-18 Jim Meyering <jim@meyering.net>
5057 * version-etc.c (version_etc_copyright): Update copyright date.
5059 * utimens.c (futimens): Account for the fact that futimes
5060 can also fail with errno == ENOSYS or errno == ENOENT.
5061 Patch from Dmitry V. Levin.
5063 Change the name of the robust chdir function from chdir to chdir_long.
5064 * save-cwd.c: Include chdir-long.h rather than chdir.h.
5065 (restore_cwd): Use chdir_long, not chdir.
5066 * chdir-long.c: Renamed from chdir.c.
5067 * chdir-long.h: Renamed from chdir.h.
5068 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5071 2005-01-18 Bob Proulx <bob@proulx.com>
5073 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5074 offsetof() macro construct to avoid compile failure with native HP-UX
5075 11.0 ANSI C compiler.
5077 2005-01-06 Bruno Haible <bruno@clisp.org>
5079 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5080 because stpncpy.m4 takes care of it.
5082 2004-01-24 Bruno Haible <bruno@clisp.org>
5084 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5086 2003-10-09 Bruno Haible <bruno@clisp.org>
5088 * progreloc.c: Include xalloc.h instead of xmalloc.h.
5090 2005-01-06 Bruno Haible <bruno@clisp.org>
5092 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5093 * fwriteerror.c: Include <stdbool.h>.
5094 (fwriteerror): At the end, close the file stream. Record whether
5095 stdout was already closed.
5097 2004-05-27 Bruno Haible <bruno@clisp.org>
5099 * execute.c (environ): Declare if needed.
5100 * pipe.c (environ): Likewise.
5101 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5103 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5105 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5106 definitions to be after all include files, to avoid collisions.
5107 Problem reported by Bob Proulx.
5109 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5111 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5112 not needed. This removes a dependency on the gettext module.
5113 [defined _LIBC]: Do not include <libintl.h>; not needed.
5115 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5117 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5120 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5122 * argp-parse.c: Include <stddef.h>.
5123 (alignof, alignto): New macros.
5124 (parser_init): Don't assume that void * is aligned sufficiently
5127 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5128 need to extend the stack.
5129 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5132 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5134 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5136 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5138 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5139 Remove now-obsolete comment about AIX.
5140 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5141 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5142 (YYMAXDEPTH): New macro.
5144 2004-12-18 Bruno Haible <bruno@clisp.org>
5146 * fatal-signal.c (fatal_signals): Make non-const.
5147 (init_fatal_signals): New function.
5148 (uninstall_handlers, install_handlers): Ignore signals that were set to
5150 (at_fatal_signal): Call init_fatal_signals.
5151 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5153 Reported by Paul Eggert.
5155 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5157 * getdate.y (textint): New member "negative".
5158 (time_zone_hhmm): New function.
5159 Expect 14 shift-reduce conflicts, not 13.
5160 (o_colon_minutes): New rule.
5161 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5162 (yylex): Set the "negative" member of signed numbers.
5164 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5166 Changes imported from coreutils.
5167 * hard-locale.c: Assume <locale.h> exists.
5169 (GLIBC_VERSION): New macro.
5170 (hard_locale): Assume setlocale exists.
5171 Rewrite to avoid #ifdef.
5172 Use strdup rather than malloc + strcpy.
5173 * human.c: Assume <locale.h> exists.
5174 (human_readable): Assume localeconv exists.
5176 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5178 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5179 convert T2, not T. (Imported from libc.)
5181 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5183 * getcwd.c (is_ENAMETOOLONG): New macro.
5184 (__getcwd.c): Don't restore errno; glibc doesn't.
5185 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5186 first, falling back to our code only if its results look suspicious.
5187 Ensure that the resulting buffer is only as large as necessary.
5189 * readutmp.c: Include readutmp.h first.
5190 Include <errno.h>, since readutmp.h no longer does that.
5191 * readutmp.h: Don't include <errno.h>,
5192 <sys/param.h>, <time.h>; not needed to establish interface.
5193 (errno): Remove decl.
5194 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5195 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5196 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5198 2004-11-28 Simon Josefsson <jas@extundo.com>
5200 * base64.h, base64.c: New file.
5202 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5204 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5206 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5208 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5209 HP's ANSI C compiler.
5210 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5211 Declaring int functions causes warnings on some modern systems and
5212 shouldn't be needed to compile on ancient ones.
5213 * same.c (MIN) [defined MIN]: Don't define, since it's already
5216 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5217 with the following changes.
5218 (__set_errno): Parenthesize properly.
5219 Include <stdbool.h>.
5220 (MIN, MAX, MATCHING_INO): New macros.
5221 (__getcwd): Define with prototype, not K&R form.
5222 Use heuristics to allocate default buffer on stack if possible.
5223 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5224 behavior, and to avoid the PATH_MAX limit when computing
5226 Use MATCHING_INO to compare inode number to file.
5227 Check for arithmetic overflow in size calculations.
5228 Fix bug in reallocation of dot array that caused getcwd to fail
5229 on directories nested deeper than 75.
5230 Be more careful about saving errno on error.
5231 Do not use realloc; use only free+malloc, as this is a bit
5232 more flexible and avoids a needless copy operation.
5233 Do not inspect st_dev and st_ino for symbolic links; POSIX
5234 doesn't specify the latter.
5235 Check for closedir errors.
5236 Avoid needless casts.
5237 Use "#ifdef weak_alias" around weak_alias, to be like other
5239 The following changes to getcwd.c have effect only when used in
5240 gnulib; they have no effect inside glibc proper.
5241 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5242 as alloca isn't used.
5243 (alloca, __alloca): Likewise.
5244 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5245 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5246 unconditionally, as gnulib assumes C89 or better.
5247 Do not include <sys/param.h>.
5248 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5249 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5251 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5252 Include <dirent.h> in a way that is compatible with modern Autoconf.
5253 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5254 New macros, if not already defined.
5255 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5256 Use "_LIBC", not "defined _LIBC", for consistency.
5257 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5259 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5260 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5261 * xgetcwd.c: David MacKenzie's old code was removed, so give
5262 credit only to Jim Meyering and adjust the copyright dates.
5263 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5264 <stdlib.h>, <unistd.h>, "pathmax.h".
5265 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5266 (INITIAL_BUFFER_SIZE): Remove.
5267 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5269 2004-11-23 Jim Meyering <jim@meyering.net>
5271 * getopt_.h: Remove trailing blanks.
5273 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5275 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5276 (futimens): New function, which uses futimes if available.
5277 (futimens, utimens): Support timespec==NULL, with same semantics
5278 as utime and utimens.
5279 * utimens.h (futimens): New decl.
5281 2004-11-23 Jim Meyering <jim@meyering.net>
5283 * __fpending.c: Add comment.
5285 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5287 * getopt_.h: Re-addition of __getopt_argv_const caused
5288 redefinition warnings. To avoid them, include the defines
5289 in `#if !defined __need_getopt ... #endif'. The only place
5290 where __getopt_argv_const is used is in definitions
5291 of getopt_long and getopt_long_only below, which are as well
5292 protected by `#ifndef __need_getopt'.
5293 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5294 __need_getopt after including <stdio.h> and <unistd.h> These
5295 headers might have defined it.
5297 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5299 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5301 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5302 optopt): Use them instead of invoking ## directly; otherwise, the
5303 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5305 2004-11-19 Bruno Haible <bruno@clisp.org>
5307 * strtok_r.c: Move comments from here...
5308 * strtok_r.h: ... to here.
5310 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5312 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5313 might fail. Problem reported by Yoann Vandoorselaere.
5314 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5315 that mishandle size_t overflow.
5317 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5319 * canon-host.c: Include "strdup.h".
5320 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5321 Use strdup instead of malloc/strcpy to duplicate strings.
5323 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5324 (human_space_before_unit): New constant.
5325 * human.c (human_readable): Support it.
5327 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5328 (xgetcwd): Set errno correctly when failing.
5329 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5330 the failure is actually due to a PATH_MAX problem.
5332 Further getopt changes to make it more likely that glibc will
5333 buy the changes back.
5334 * getopt.c (POSIXLY_CORRECT): New constant.
5335 (getopt): Use it, so to preserve glibc semantic
5336 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5337 when compiling for libc.
5338 * getopt_.h (__getopt_argv_const): Bring it back.
5339 (getopt_long, getopt_long_only): Use it.
5341 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5342 New arg POSIXLY_CORRECT. All callers changed.
5343 (getopt): Argv is now char * const *, as per standard.
5344 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5345 not char *__getopt_argv_const *.
5346 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5347 _getopt_long_only_r): Likewise.
5348 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5349 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5350 _getopt_long_r, _getopt_long_only_r): Likewise.
5351 * getopt_.h (__getopt_argv_const): Remove.
5352 (getopt): Argv is now char * const *, as per standard.
5354 * getdate.y (tORDINAL): New token.
5355 (day, relunit): Allow it for relative times.
5356 (relative_time_table): Use tORDINAL for ordinals.
5358 2004-11-15 Jim Meyering <jim@meyering.net>
5360 * closeout.c: Include "__fpending.h" once again.
5361 Include <stdbool.h>.
5362 (close_stdout): Don't fail just because stdout was closed initially,
5363 since some programs don't write to stdout in the normal course of
5364 operation (other than --version and --help), and we don't want this
5365 function to make e.g. `touch file >&-' fail.
5366 But do fail if it was closed and someone has tried to write to it.
5367 E.g., `printf foo >&-' must fail.
5369 2004-11-11 Simon Josefsson <jas@extundo.com>
5371 * strtok_r.h, strtok_r.c: New file.
5373 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5375 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5376 we can stop lying to compilers about the constness of argv when we
5377 are compiled outside glibc.
5378 (getopt, getopt_long, getopt_long_only): Use it.
5379 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5381 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5382 _getopt_long_only_r): Likewise.
5383 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5384 _getopt_long_only_r): Likewise.
5386 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5387 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5388 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5389 the other external symbols.
5390 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5391 declaration, since the above renaming now works around collisions.
5393 2004-11-11 Jim Meyering <jim@meyering.net>
5395 * linebreak.c: Remove trailing blanks.
5396 * alloca_.h: Likewise.
5397 * acosl.c: Likewise.
5398 * euidaccess.c: Likewise.
5399 * allocsa.h: Likewise.
5401 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5403 * mktime.c (SHR): New macro, which is a portable
5404 substitute for >> that should work even on Crays.
5405 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5406 Problem reported by Mark D. Baushke in
5407 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5408 * getdate.y (SHR): Likewise.
5410 * strftime.c (SHR): Likewise.
5412 * quotearg.c (struct quoting_options): Use unsigned int for
5413 quote_these_too, so that right shifts are well defined. All uses
5416 2004-11-10 Simon Josefsson <jas@extundo.com>
5418 * getaddrinfo.h, getaddrinfo.c: New files.
5420 2004-11-10 Jim Meyering <jim@meyering.net>
5422 Ensure that no close failure goes unreported.
5423 * closeout.c (close_stdout): Always close stdout. I.e., don't
5424 return early when it seems there's nothing to flush.
5425 Don't include __fpending.h.
5427 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5429 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5431 2004-11-05 Bruno Haible <bruno@clisp.org>
5433 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5434 Reported by Mark D. Baushke <mdb@cvshome.org>.
5436 2004-11-04 Bruno Haible <bruno@clisp.org>
5438 2004-09-11 Bruno Haible <bruno@clisp.org>
5439 * allocsa.valgrind: New file.
5440 2004-02-06 Bruno Haible <bruno@clisp.org>
5441 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5442 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5443 Reported by Christopher Seip <chris.seip@hp.com>.
5445 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5447 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5448 with errno == ERANGE if the buffer is too small.
5449 Problem reported by Mark D. Baushke.
5451 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5453 * xreadlink.c (MAXSIZE): New macro.
5454 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5455 size does not exceed MAXSIZE. Avoid cast.
5456 As suggested by Mark D. Baushke in
5457 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5458 if readlink fails with buffer size just under MAXSIZE, try again
5461 2004-11-02 Derek R. Price <derek@ximbiot.com>
5462 and Paul Eggert <eggert@cs.ucla.edu>
5464 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5465 (get_date): Overparenthesize to avoid GCC warning.
5467 2004-11-02 Bruno Haible <bruno@clisp.org>
5469 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5470 function returns void.
5472 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5474 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5475 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5478 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5480 * getdate.y: Add support for TZ="foo" within a date string.
5481 Fix some bugs near time_t boundaries. Reject dates with
5482 out-of-range components, e.g., "Sept 31".
5483 Include <stdlib.h>, "setenv.h", "xalloc.h".
5484 (ISDIGIT_LOCALE): Remove; unused.
5485 Note that the TZ and time functions used here are not reentrant.
5486 (mktime_ok, get_tz): New functions.
5487 (TZBUFSIZE): New constant.
5488 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5489 This requires that we sometimes generate our own TZ="XXX..." setting.
5491 2004-10-27 Derek R. Price <derek@ximbiot.com>
5493 * mktime.c (not_equal_tm): Remove redundant check.
5495 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5497 * getdate.y: Use Bison 1.875 features, and some minor
5498 code cleanups. This change does not affect semantics.
5499 Don't include <stdlib.h>; no longer needed.
5500 Don't include unlocked-io.h; only the "#if TEST" code uses
5501 stdio, and performance isn't crucial there.
5502 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5503 Bison 1.875 features as described below.
5504 All uses of "PC." replaced by "pc->".
5505 (YYSTYPE): Add a forward declaration.
5506 (yylex, yyerror): Use full prototypes in forward decls.
5507 Use "%pure-parser" rather than obsolescent "%pure_parser".
5508 Use %parse-param and %lex-param instead of obsolescent
5509 YYPARSE_PARAM and YYLEX_PARAM.
5510 (meridian_table, month_and_day_table, time_units_table,
5511 relative_time_table, time_zone_table, military_table,
5512 lookup_zone, lookup_word, get_date):
5513 Use NULL instead of 0 where appropriate.
5514 (to_hour): Avoid abort (), to avoid a dependency on
5516 (yyerror, yylex): Now accepts parser_control * arg.
5517 (main) [TEST]: Use '\0' rather than 0 for char.
5519 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5521 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5522 It's now the caller's responsibility to handle the case where
5523 !HAVE_GETPAGESIZE && !defined getpagesize.
5525 * mktime.c (leapyear): Arg is long int, not int.
5527 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5529 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5531 2004-10-12 Simon Josefsson <jas@extundo.com>
5533 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5534 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5537 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5539 * vsnprintf.h: New file.
5540 * vsnprintf.c: New file.
5542 2004-10-07 Bruno Haible <bruno@clisp.org>
5544 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5545 into the provided buffer.
5547 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5549 * diacrit.c, diacrit.h: Add GPL notice.
5551 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5552 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5553 * logl.c (logl): Keep the code as similar to glibc as possible.
5554 This avoids a potential constant-folding bug.
5556 2004-10-05 Bruno Haible <bruno@clisp.org>
5558 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5560 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5562 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5563 * xmalloc.c (xmemdup): Likewise.
5564 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5565 XFREE): Remove these long-obsolescent macros.
5566 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5567 * xstrdup.c: Remove.
5569 * regex.c (re_comp): Cast gettext return value to char *,
5570 Problem reported by Martin Neitzel via Mark D. Baushke.
5572 2004-10-04 Simon Josefsson <jas@extundo.com>
5574 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5575 '#ifdef USE_UNLOCKED_IO'.
5577 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5579 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5580 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5581 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5582 regex.c, sha1.c, version-etc.c, yesno.c:
5583 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5584 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5585 the includer's responsibility.
5587 Sync from coreutils.
5589 * modechange.c (mode_compile): Don't decrement a pointer that
5590 points to the start of a string, as the C Standard says the
5591 resulting behavior is undefined.
5593 * backupfile.h (enum backuptype): Rename none -> no_backups,
5594 simple -> simple_backups, numbered_existing ->
5595 numbered_existing_backups, numbered -> numbered_backups
5596 to avoid shadowing problems. All uses changed.
5597 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5598 * backupfile.c (check_extension, numbered_backup):
5599 Rename locals to avoid shadowing 'basename'.
5600 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5603 * .cppi-disable: Add getopt_.h, getopt_int.h.
5604 * .cvsignore: Add getopt.h.
5606 2004-10-04 Simon Josefsson <jas@extundo.com>
5608 * memmem.h: New file.
5609 * memmem.c: New file, taken from glibc.
5611 2004-10-02 Jim Meyering <jim@meyering.net>
5613 * dirfd.h, getpagesize.h: Add copyright notice.
5615 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5617 * snprintf.c: Remove comments as to why each header is needed.
5619 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5621 * strsep.h: New file.
5622 * strsep.c: New file.
5624 2004-10-01 Simon Josefsson <jas@extundo.com>
5626 * snprintf.c (snprintf): Handle size==0.
5628 2004-10-01 Simon Josefsson <jas@extundo.com>
5629 Bruno Haible <bruno@clisp.org>
5631 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5632 (snprintf): Declare 'args'.
5634 2004-09-30 Simon Josefsson <jas@extundo.com>
5636 * snprintf.h, snprintf.c: New files.
5638 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5640 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5641 (hol_entry_help): Never translate an empty string.
5642 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5643 * argp.h (OPTION_NO_TRANS): New option.
5645 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5647 * xvasprintf.c: Include xalloc.h.
5648 (xvasprintf): Use xalloc_die, not xmalloc_die.
5650 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5652 * dummy.c: Change copyright notice to FSF, and license to GPL.
5654 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5656 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5657 Problem reported by Bruno Haible in:
5658 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5660 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5662 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5663 in case some system header has #define'd it. Problem reported by
5664 Soeren D. Schulze in
5665 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5667 2004-09-08 Bruno Haible <bruno@clisp.org>
5669 * stdint_.h: New file, taken from GNU clisp.
5671 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5673 * xvasprintf.h: New file.
5674 * xvasprintf.c: New file.
5675 * xasprintf.c: New file.
5677 2004-09-08 Bruno Haible <bruno@clisp.org>
5679 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5681 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5683 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5685 Import from coreutils.
5686 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5687 strings on unbounded length. alloca's performance benefits aren't
5688 that important here.
5690 (parse_with_separator): New function, with most of the internals
5691 of the old parse_user_spec. Allow user to omit both user and group,
5692 for compatibility with FreeBSD.
5693 Clone only the user name, not the entire spec.
5694 Do not set *uid, *gid unless entirely successful.
5695 Avoid memory leak in some failing cases.
5696 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5697 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5698 (parse_user_spec): Rewrite to use parse_with_separator.
5700 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5702 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5703 its complicated substitute.
5704 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5705 and program_invocation_name.
5706 (__argp_basename) [!_LIBC]: Remove; the only use was
5707 replaced by its body.
5708 (__argp_short_program_name): Change condition from
5709 !defined __argp_short_program_name to
5710 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5711 to match argp-namefrob.h.
5712 (__argp_failure): Don't assume strerror_r returns char *.
5713 * argp-parse.c (N_): Define unconditionally.
5714 (argp_default_options): Fill out initializers with 0 to avoid
5717 2004-08-12 Simon Josefsson <jas@extundo.com>
5719 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5720 * getopt_.h: Renamed from getopt.h.
5722 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5724 Merge from coreutils.
5726 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5727 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5728 for Reliant Unix 5.43.
5730 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5731 (union fooround): Use uintmax_t, not long int.
5732 The rest is a merge from libc:
5733 [defined _LIBC]: Include <shlib-compat.h>.
5734 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5736 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5738 * strverscmp.c: Convert to UTF-8.
5740 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5742 * obstack.h (obstack_empty_p):
5743 Don't assume that chunk->contents is suitably aligned.
5744 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5745 Likewise. Problem reported by Benno in
5746 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5748 * chown.c (rpl_chown): Work even if the file is writeable but not
5749 readable. This could be improved further but it'd take some work.
5751 2004-08-08 Simon Josefsson <jas@extundo.com>
5753 * xgethostname.c: Don't include error.h (not used).
5756 * getpass.c: Include getpass.h first.
5758 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5760 * xalloc-die.c: New files.
5761 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5763 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5764 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5765 (_, N_, xalloc_die): Move to xalloc-die.c.
5766 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5767 so that we needn't mess with xalloc_msg_memory_exhausted.
5769 * sha1.h: Renamed from sha.h.
5770 (SHA1_H): Renamed from _SHA_H.
5771 (sha1_ctx): Renamed from sha_ctx.
5772 (sha1_init_ctx): Renamed from sha_init_ctx.
5773 (sha1_process_block): Renamed from sha_process_block.
5774 (sha1_process_bytes): Renamed from sha_process_bytes.
5775 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5776 (sha1_read_ctx): Renamed from sha_read_ctx.
5777 (sha1_stream): Renamed from sha_stream.
5778 (sha1_buffer): Renamed from sha_buffer.
5779 * sha1.c: Likewise; renamed from sha.c.
5780 Do not include <sys/types.h>.
5781 Include <stddef.h> rather than <stdlib.h>.
5783 2004-08-08 Bruno Haible <bruno@clisp.org>
5785 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5786 FILESYSTEM_PREFIX_LEN.
5787 * progreloc.c: Likewise.
5788 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5790 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5793 * argp-help.c (make_hol, hol_append): Don't assume that
5794 SIZE_MAX is a valid preprocessor constant.
5795 (__argp_basename): Change from "#ifndef _LIBC"
5796 to "#ifndef __argp_short_program_name", so that
5797 we don't compile these functions for tar.
5799 More merges from coreutils.
5800 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5801 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5803 * addext.c: Remove; no longer needed.
5804 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5805 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5806 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5807 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5808 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5809 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5810 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5811 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5812 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5813 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5814 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5815 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5816 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5817 Import changes from coreutils.
5819 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5821 Merge from coreutils.
5823 * .gdb-history: Remove; this doesn't belong here.
5825 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5826 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5827 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5829 * dirname.h: Include <stdbool.h>.
5830 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5831 for consistency with POSIX terminology. All uses changed.
5832 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5833 (strip_trailing_slashes): Use bool for booleans.
5834 * stripslash.c (strip_trailing_slashes): Likewise.
5836 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5837 sometimes returns a positive errno value even when it succeeds.
5838 (print_errno_message) [!LIBC]: Fall back on strerror if
5841 * path-concat.c (mempcpy): Don't define if a system header defines it.
5842 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5843 (longest_relative_suffix): New function.
5844 (path_concat): Use it. Assume first argument is not NULL.
5845 Port to DOS. Omit redundant separators.
5846 Report an error instead of returning NULL.
5847 Use mempcpy instead of memcpy.
5848 (xpath_concat): Remove: not declared or used.
5850 * same.h: Include <stdbool.h>
5851 (same_name): Return bool, not int.
5852 * same.c (same_name): Likewise.
5853 (errno): Don't declare; we assume C89 or better now.
5855 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5856 if not already defined.
5858 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5859 * dup-safer.c (errno): Likewise.
5861 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5863 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5866 2004-08-03 Simon Josefsson <jas@extundo.com>
5868 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5869 * progname.h: Don't include stdbool.h.
5871 2004-08-02 Simon Josefsson <jas@extundo.com>
5873 * getsubopt.h: New file, with comments from Bruno Haible.
5874 * getsubopt.c: New file, from glibc, but slightly modified based on
5875 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5877 2004-08-01 Simon Josefsson <jas@extundo.com>
5879 * xgetdomainname.c: Include stdlib.h, for free().
5881 2004-07-16 Simon Josefsson <jas@extundo.com>
5883 * dummy.c: New file.
5885 2004-07-16 Bruno Haible <bruno@clisp.org>
5887 * backupfile.h: Add extern "C" for C++.
5888 * closeout.h: Likewise.
5889 * copy-file.h: Likewise.
5890 * findprog.h: Likewise.
5891 * full-write.h: Likewise.
5892 * pathname.h: Likewise.
5893 * progname.h: Likewise.
5894 * stpcpy.h: Likewise.
5895 * stpncpy.h: Likewise.
5896 * strcase.h: Likewise.
5897 * strstr.h: Likewise.
5898 * xalloc.h: Likewise.
5900 * mbswidth.h: Add extern "C" for C++.
5901 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5903 2004-07-09 Simon Josefsson <jas@extundo.com>
5905 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5906 failed without this.)
5908 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5910 * fchown-stub.c: New file.
5912 2004-06-24 Jim Meyering <jim@meyering.net>
5914 * obstack.h (obstack_base): Cast to (void *), per documentation.
5916 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5918 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5920 2004-06-01 Jim Meyering <jim@meyering.net>
5922 * calloc.c: New file.
5924 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5926 * getdate.y (yylex): Allow space between sign and number.
5927 Problem reported by Dan Jacobson.
5929 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5930 and Jim Meyering <jim@meyering.net>
5932 Merge from coreutils CVS.
5934 * stat-macros.h: New file, with contents from file-type.h
5935 and coreutils' system.h.
5936 * file-type.c: Include "stat-macros.h".
5937 * file-type.h (file_type): Move all macro definitions to new file,
5940 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5941 Wrap old code with this conditional.
5942 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5943 function that does not dereference symlinks.
5944 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5946 * xreadlink.c: Include xreadlink.h first, to catch .h file
5947 dependency problems.
5948 (xreadlink): Accept new arg SIZE, for efficiency.
5949 All decls and uses changed.
5950 * xreadlink.h: Include <stddef.h>, for size_t.
5952 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5953 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5955 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5957 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5959 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5960 macros to be defined.
5961 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5962 the allocator returns NULL because the requested size is zero.
5964 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5966 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5967 var. Add comment explaining why libc still defines it. This
5968 merges the following patch from glibc:
5969 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5971 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5973 * obstack.c (_obstack): Remove unused variable. It hasn't been
5974 present in glibc since revision 1.1 of this file.
5975 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5976 obstack_alignment_mask, obstack_alloc, obstack_base,
5977 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5978 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5979 obstack_grow0, obstack_init, obstack_int_grow,
5980 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5981 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5982 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5983 nonexistent functions.
5985 2004-05-17 Derek R. Price <derek@ximbiot.com>
5986 Paul Eggert <eggert@cs.ucla.edu>
5988 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5990 2004-05-14 Bruno Haible <bruno@clisp.org>
5992 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5993 that consists of a '.' followed by an empty digit string.
5994 Patch by Tor Lillqvist <tml@iki.fi>.
5996 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5998 Port obstack to the AS/400, where pointers are 16 bytes wide and
5999 you cannot cast an integer to a valid pointer. This patch is
6000 currently waiting to be integrated into glibc; see
6001 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
6003 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
6004 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
6005 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
6006 (struct obstack): temp member is now a union of a pointer and
6007 an integer, instead of an integer. All integer uses changed.
6008 This does not affect the physical layout of struct obstack,
6009 except on hosts (like the AS/400) where the size or alignment of
6010 void * is greater than that of ptrdiff_t.
6011 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
6012 __STDC__)]: Store temporary in pointer member of union, not
6014 * obstack.c: Include <stddef.h>, for offsetof.
6015 (struct fooalign): Remove; it doesn't need a name.
6016 (union fooround): Change double to long double, and add void *.
6017 (DEFAULT_ALIGNMENT): Use offsetof to compute.
6018 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6019 not a macro. Hence the values are always int; so remove all
6020 casts-to-int in uses.
6022 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
6023 Derek Price <derek@ximbiot.com>
6025 * alloca.c: Include <alloca.h>, to get our interface.
6026 * alloca_.h: Use __alloca on AIX, so that we don't have to
6027 include <alloca.h> first. Use C89 prototype for alloca; this
6028 requires including <stddef.h> for size_t. Use extern "C" if C++.
6029 Use #elif for simplicity, since we can assume C89 now.
6030 Don't try to source the system alloca.h since it will not be found
6031 and to prevent recursively including its replacement.
6032 * fnmatch.c: Include <alloca.h> instead of opencoding.
6033 * regex.c: Likewise.
6035 2004-05-16 Derek Price <derek@ximbiot.com>
6036 Paul Eggert <eggert@cs.ucla.edu>
6038 getline cleanup. This changes the getndelim2 API: both order of
6039 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6042 * getline.c: Don't include stddef.h or stdio.h, since our
6043 interface does that.
6044 (getline): Always use getdelim, so that we don't have two
6045 copies of this code.
6046 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6048 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6049 (GETNDELIM2_MAXIMUM): New macro.
6050 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
6051 instead of the old practice of delim2==0. All callers changed.
6052 Return -1 on overflow, instead of returning junk.
6053 Do not set *linesize unless allocation succeeds.
6054 * getndelim2.h: Do not include stddef.h; no longer needed, now
6055 that we include sys/types.h.
6056 * getnline.h: Likewise.
6057 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6058 (getndelim2): Reorder arguments.
6059 * getnline.c (getnline, getndelim):
6060 Don't discard the NMAX argument.
6061 (getnline): Invoke getndelim, to avoid code duplication.
6062 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6063 of (size_t) -1 by callers of the getnline family.
6065 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
6067 * nanosleep.c (suspended): Change its type from int to
6068 sig_atomic_t volatile.
6069 (first_call): Make it private to rpl_nanosleep, and have it
6070 be zero initially as that's a bit faster.
6071 (my_usleep): Round up fractional times instead of truncating them,
6072 as this is the usual meaning for 'sleep'.
6074 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6076 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6077 (ENOSYS): Define if not defined.
6078 (settime): Fall back on stime if it exists and settimeofday fails.
6079 But don't bother with fallbacks if a method fails with errno == EPERM.
6081 2004-05-11 Jim Meyering <jim@meyering.net>
6083 Prior to this change, the save_cwd caller required read access to the
6084 current directory on most systems (ones with the fchdir function).
6086 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6087 fails, try write-only, and finally, resort to using xgetcwd.
6089 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6091 * obstack.c, obstack.h: Import changes from libc.
6093 2004-04-28 Bruno Haible <bruno@clisp.org>
6095 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6096 implicitly appends .exe to executables.
6097 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6098 accepts Windows pathnames.
6099 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6100 Cygwin like Windows, since it now accepts Windows pathnames.
6101 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6102 Cygwin like Windows, since it now accepts Windows pathnames.
6103 Reported by Derek Robert Price <derek@ximbiot.com>.
6105 2004-04-20 Jim Meyering <jim@meyering.net>
6107 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6109 2004-04-20 Jim Meyering <jim@meyering.net>
6110 Bruno Haible <bruno@clisp.org>
6112 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6113 memory when realloc fails.
6115 2004-04-18 Jim Meyering <jim@meyering.net>
6117 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6118 don't leak memory and do call END_UTMP_ENT.
6120 2004-04-11 Paul Eggert <eggert@twinsun.com>
6122 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6123 (CHAR_BIT): Remove, since we assume C89.
6124 Include <stdint.h> if available, as per current Autoconf CVS advice.
6126 2004-03-30 Paul Eggert <eggert@twinsun.com>
6128 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6129 not bool, to be more consistent with Unix conventions.
6130 Suggested by Bruno Haible.
6132 Merge from coreutils.
6134 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6137 * getdate.h: Include stdbool.h, and timespec.h instead of
6138 the usual <time.h> dance.
6139 (get_date): Change signature to support fractional time stamps.
6140 All callers changed.
6141 * getdate.y: Include "getdate.h" first, as we can now
6142 assume C89 and don't need to worry about 'const'.
6143 Similarly, include "unlocked-io.h" near start, not in middle.
6145 (textint.value): Use long int rather than int.
6146 (textint.digits): Use size_t rather than int.
6147 (BILLION, LOG10_BILLION): New constants.
6148 (parser_control): New member rel_ns. Members day_ordinal,
6149 time_zone, month, day, hour, minutes, rel_year, rel_month,
6150 rel_day, rel_hour, rel_minutes, rel_seconds
6151 are now long int, not int. Member seconds is now struct timespec,
6152 not int. New member timespec_seen. Members dates_seen, days_seen,
6153 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6155 (%union.intval): Now long int, not int.
6156 New member timespec.
6157 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6158 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6159 (spec): Now is a timespec or an item list.
6160 (timespec, items): New nonterminals.
6161 (time, rel, relunit, number, get_date):
6162 Add support for fractional seconds.
6163 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6164 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6165 (to_hour): First arg is now long int, not int.
6166 (to_year): Returns long int, not int.
6167 Don't treat year -70 like 70.
6168 (tm_diff): Returns long int, not int.
6169 (lookup_word): Use bool instead of int when appropriate.
6170 (yylex): Use size_t for count, not int.
6171 Detect overflow when parsing large integer constants.
6172 Add support for fractions.
6173 (get_date): Make pointers 'const' if possible.
6174 Use more-portable code to detect integer overflow.
6175 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6176 Don't use ctime; it's not reliable if the year has >4 digits.
6178 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6179 This is for compatibility with BSD.
6181 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6182 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6183 From coreutils' system.h.
6185 * userspec.c: Don't include "posixver.h".
6186 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6187 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6188 compatible extension. Simplify code by removing a boolean int
6189 that was always nonzero if a string was nonnull.
6191 2004-03-30 Jim Meyering <jim@meyering.net>
6193 Merge from coreutils.
6195 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6197 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6198 an empty input stream.
6200 * readtokens.c: Include <stdbool.h>.
6201 (readtoken): Use `size_t' rather than int/long.
6202 All callers adjusted.
6203 Use `bool' rather than `int' where appropriate.
6204 Use memset rather than an explicit loop.
6205 Use x2nrealloc rather than xrealloc.
6206 Allow the use of `\0' as a delimiter.
6207 (readtokens): Likewise.
6208 * readtokens.h (readtoken, readtokens): Update prototypes.
6210 2004-03-30 Bruno Haible <bruno@clisp.org>
6212 * getloadavg.c (getloadavg): Don't assume setlocale returns
6215 2004-03-29 Paul Eggert <eggert@twinsun.com>
6217 Merge changes to getloadavg.c from coreutils and Emacs.
6219 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6220 Define to an expression, not to the empty string.
6221 Include cloexec.h and xalloc.h.
6222 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6223 Use set_cloexec_flag rather than rolling our own.
6224 * cloexec.c, cloexec.h: New files.
6226 2004-03-18 Paul Eggert <eggert@twinsun.com>
6228 * getopt.h: Sync with libc CVS.
6230 2004-03-18 Paul Eggert <eggert@twinsun.com>
6231 Bruno Haible <bruno@clisp.org>
6233 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6234 not on all platforms that have <wchar.h>.
6235 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6237 2004-03-09 Paul Eggert <eggert@twinsun.com>
6239 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6241 * getopt_int.h: New file, also synced from libc.
6243 2004-03-07 Paul Eggert <eggert@twinsun.com>
6245 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6246 '#if' expressions. Unlike the code it replaces, it does not
6247 depend on (defined _SC_PAGESIZE). However, it does depend on
6248 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6249 first reported by Jason Andrade in
6250 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6252 2004-01-18 Simon Josefsson <jas@extundo.com>
6254 * strdup.h: New file.
6255 * strdup.c: Include it.
6256 * path-concat.c: Include strdup.h. Drop strdup declaration.
6257 * userspec.c: Include strdup.h. Drop strdup declaration.
6259 2004-02-06 Karl Berry <karl@gnu.org>
6261 * config.charset: update from gettext 0.14.1.
6263 2004-02-05 Paul Eggert <eggert@twinsun.com>
6265 Add comments and code, prompted by suggestions from Bruno Haible
6267 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6268 describing the enum quoting_style values.
6269 * quotearg.c (quotearg_alloc): New function.
6270 (quotearg_buffer_restyled): Treat lone { and } as special.
6271 Treat = as special. Work around bug with older shells
6272 that "see" a '\' that is really the 2nd byte of a multibyte char.
6273 Quote empty string with shell_quoting_style.
6275 2004-02-03 Bruno Haible <bruno@clisp.org>
6277 * pipe.h: New file, from GNU gettext.
6278 * pipe.c: New file, from GNU gettext.
6280 2004-01-27 Bruno Haible <bruno@clisp.org>
6282 * execute.h: New file, from GNU gettext.
6283 * execute.c: New file, from GNU gettext.
6284 * w32spawn.h: New file, from GNU gettext.
6286 2004-01-23 Paul Eggert <eggert@twinsun.com>
6288 Exit-status fix from coreutils.
6290 Use exit_failure consistently in place of EXIT_FAILURE,
6291 so that program exit statuses are consistent on failure.
6293 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6294 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6295 * argmatch.h: Comment fix to match the above.
6296 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6297 Now a macro referring to exit_failure, instead of a separate
6298 variable. Include "exitfail.h" to get it.
6299 * xstrtol.h: Include "exitfail.h".
6300 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6302 * long-options.c (parse_long_options): Use prototype
6303 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6306 2004-01-21 Jim Meyering <jim@meyering.net>
6308 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6309 so as not to conflict with a different-sized __mktime_internal
6310 function in GNU libc.
6311 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6312 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6314 2004-01-18 Paul Eggert <eggert@twinsun.com>
6316 Merge from diffutils.
6318 * file-type.c (file_type): Add typed memory objects.
6319 * file-type.h (S_TYPEISTMO): New macro.
6321 * c-stack.h (c_stack_action): Remove argv argument.
6322 * c-stack.c (c_stack_action): Likewise. All uses changed.
6323 (die): Don't calculate message unless segv_action returns.
6324 (get_stack_location, min_address_from_argv, max_address_from_argv,
6325 volatile stack_base, volatile_stack_size): Remove.
6326 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6327 that every segmentation violation is a stack overflow. (Ouch!)
6328 See Debian bug 136249 (still outstanding) for more info about why
6329 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6331 2003-11-30 Bruno Haible <bruno@clisp.org>
6333 Safer stack allocation.
6334 * setenv.c: Include allocsa.h.
6335 (alloca): Remove fallback definition.
6336 (freea): Remove macro.
6337 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6340 2003-10-17 Bruno Haible <bruno@clisp.org>
6342 * binary-io.h: Avoid warnings on Cygwin.
6344 2003-12-28 Bruno Haible <bruno@clisp.org>
6346 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6347 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6349 2003-11-28 Bruno Haible <bruno@clisp.org>
6351 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6353 2003-11-27 Bruno Haible <bruno@clisp.org>
6355 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6357 2003-11-17 Bruno Haible <bruno@clisp.org>
6359 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6361 2003-11-24 Bruno Haible <bruno@clisp.org>
6363 * xallocsa.h: New file, from GNU gettext.
6364 * xallocsa.c: New file, from GNU gettext.
6366 2003-11-24 Bruno Haible <bruno@clisp.org>
6368 * allocsa.h: New file, from GNU gettext.
6369 * allocsa.c: New file, from GNU gettext.
6371 2003-11-24 Bruno Haible <bruno@clisp.org>
6373 * eealloc.h: New file.
6375 2004-01-15 Jim Meyering <jim@meyering.net>
6377 Merge from coreutils.
6379 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6380 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6381 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6383 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6384 optional configure-time default.
6386 * version-etc.c (version_etc_copyright): Update copyright date.
6388 * xreadlink.c (xreadlink): Correct outdated comment.
6390 2004-01-15 Paul Eggert <eggert@twinsun.com>
6392 Merge from coreutils.
6394 * posixver.c: Include posixver.h.
6396 * same.c: Include <stdbool.h>, <limits.h>.
6397 (_POSIX_NAME_MAX): Define if not defined.
6399 (same_name): If file names are silently truncated, report
6400 that the file names are the same if they are the same after
6401 the silent truncation.
6403 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6404 conversion function.
6405 * xstrtod.c (xstrtod): Likewise. All callers changed to
6406 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6409 2004-01-14 Paul Eggert <eggert@twinsun.com>
6411 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6412 with like-named macro in fnmatch.c.
6413 (EXT): Use an internal constant instead.
6415 Merge fnmatch patches from glibc.
6416 * fnmatch.c (mbsinit): Remove define.
6417 Add libc_hidden_ver (__fnmatch, fnmatch).
6418 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6419 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6421 2003-12-14 Karl Berry <karl@gnu.org>
6423 * config.charset: update from gettext-runtime.
6425 2003-12-03 Paul Eggert <eggert@twinsun.com>
6427 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6428 Bug reported by Alfred M. Szmidt.
6430 2003-11-29 Karl Berry <karl@gnu.org>
6432 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6434 2003-11-23 Paul Eggert <eggert@twinsun.com>
6435 Bruno Haible <bruno@clisp.org>
6437 * printf-parse.h: Don't include sys/types.h.
6438 (ARG_NONE): New macro.
6439 (char_directive): Change type of *arg_index fields to size_t.
6440 * printf-parse.c: Don't include sys/types.h.
6441 (SSIZE_MAX): Remove macro.
6442 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6443 Remove unnecessary overflow check.
6444 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6447 2003-11-24 Paul Eggert <eggert@twinsun.com>
6449 * alloca.c: Remove dependency on xalloc module.
6450 (xalloc_die): Remove.
6451 (memory_full) [!defined emacs]: New macro.
6452 [!defined emacs]: Don't include xalloc.h.
6453 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6454 address arithmetic overflows. Change datatypes a bit to avoid
6457 2003-11-22 Jim Meyering <jim@meyering.net>
6459 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6461 2003-11-17 Bruno Haible <bruno@clisp.org>
6463 * vasnprintf.c (alloca): Remove fallback definition.
6464 (freea): Remove definition.
6465 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6466 Reported by Paul Eggert.
6468 2003-11-17 Jim Meyering <jim@meyering.net>
6470 On systems without utime and without a utimes function capable of
6471 dealing with a NULL struct utimbuf* argument, this utime replacement
6472 could -- in unusual circumstances -- leak a file descriptor.
6473 * utime.c: Include <unistd.h> and <errno.h>.
6474 (utime_null): Be sure to close `fd' and to preserve errno.
6475 Reported by Geoff Collyer via Arnold Robbins.
6477 2003-11-16 Paul Eggert <eggert@twinsun.com>
6478 Bruno Haible <bruno@clisp.org>
6480 Protect against address arithmetic overflow.
6481 * printf-args.h: Include stddef.h.
6482 (arguments): Change type of field 'count' to size_t.
6483 * printf-args.c (printf_fetchargs): Use size_t instead of
6484 'unsigned int' where appropriate.
6485 * printf-parse.h: Include sys/types.h.
6486 (char_directive): Change type of *arg_index fields to ssize_t.
6487 (char_directives): Change type of fields 'count', max_*_length to
6489 * printf-parse.c: Include sys/types.h and xsize.h.
6490 (SSIZE_MAX): Define fallback value.
6491 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6492 instead of 'int' where appropriate. Check a_allocated, d_allocated
6493 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6494 * vasnprintf.c: Include xsize.h.
6495 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6496 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6497 overflow. Avoid wraparound when converting a width or precision from
6500 2003-11-16 Bruno Haible <bruno@clisp.org>
6502 Update from GNU gettext.
6503 * printf-parse.c: Generalize to it can be compiled for wide strings.
6504 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6505 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6506 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6507 SNPRINTF): New macros.
6508 Don't include <alloca.h> if the file is used inside libintl.
6509 (local_wcslen): New function, for Solaris 2.5.1.
6510 (VASNPRINTF): Use it instead of wcslen.
6512 2003-11-16 Bruno Haible <bruno@clisp.org>
6514 * xsize.h (xmax): New function.
6515 (xsum, xsum3, xsum4): Declare as "pure" functions.
6517 2003-11-12 Paul Eggert <eggert@twinsun.com>
6519 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6520 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6521 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6522 heuristic is just as accurate as far as we know, and it removes a
6523 dependency on size_max.m4 and ptrdiff_max.m4.
6525 2003-11-12 Paul Eggert <eggert@twinsun.com>
6527 * xstrtol.c (__xstrtol): Remove "break" immediately after
6528 "return", to pacify some unknown compiler. Problem reported
6531 2003-11-11 Bruno Haible <bruno@clisp.org>
6533 * xsize.h (SIZE_MAX): Remove fallback definition.
6534 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6537 2003-11-10 Paul Eggert <eggert@twinsun.com>
6539 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6540 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6541 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6543 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6544 not (size_t) -1, since it's defined here.
6546 2003-11-06 Paul Eggert <eggert@twinsun.com>
6548 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6549 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6550 Reject sizes of exactly SIZE_MAX bytes.
6551 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6552 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6554 2003-11-05 Bruno Haible <bruno@clisp.org>
6556 * xsize.h: Include limits.h, to avoid a possible collision with
6557 SIZE_MAX defined in <limits.h> on Solaris.
6559 2003-11-04 Bruno Haible <bruno@clisp.org>
6561 * xsize.h: New file.
6562 * linebreak.c: Include xsize.h.
6563 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6564 argument for overflow.
6565 Suggested by Paul Eggert.
6567 2003-10-31 Bruno Haible <bruno@clisp.org>
6569 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6570 to avoid (extremely rare) race condition.
6571 Suggested by Paul Eggert.
6573 2003-11-03 Jim Meyering <jim@meyering.net>
6575 * userspec.c: Include "userspec.h".
6576 * userspec.h: New file.
6578 2003-10-31 Paul Eggert <eggert@twinsun.com>
6580 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6581 * mountlist.c (SIZE_MAX): Define if not defined already.
6582 (read_filesystem_list): Set and use me_type_malloced.
6583 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6584 whatever the type happens to be), for brevity and consistency.
6585 Check for size calculation overflow on Alphas running OSF/1.
6587 2003-10-31 Jim Meyering <jim@meyering.net>
6589 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6591 * linebuffer.c: Include <string.h> for declaration of memset.
6593 2003-10-30 Paul Eggert <eggert@twinsun.com>
6594 Bruno Haible <bruno@clisp.org>
6596 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6597 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6599 2003-10-29 Paul Eggert <eggert@twinsun.com>
6601 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6602 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6604 * quotearg.c (quotearg_n_options): Use it.
6605 * group-member.c: Include <stdbool.h>.
6606 (free_group_info): Arg is now const *; don't free arg.
6607 (get_group_info): Now returns bool and accepts struct group_info *,
6608 rather than returning a malloc'ed struct group_info *.
6609 All uses changed. Check for overflow in internal size calculation.
6611 * getusershell.c (readname): Simplify the code by using x2nrealloc
6612 rather than xmalloc/xrealloc.
6613 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6614 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6615 conformance bug: the old code used a pointer after freeing the
6616 storage that it addressed.
6617 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6618 rather than doing it by hand.
6619 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6620 the buffer preserved. Use free and xmalloc instead.
6621 * quotearg.c (quotearg_n_options): Likewise.
6622 Use a simpler test for size overflow. Don't use xalloc_oversized
6623 because unsigned int might be wider than size_t (!); this suggests
6624 that we should switch from unsigned int to size_t for slot numbers.
6626 2003-10-27 Bruno Haible <bruno@clisp.org>
6628 * stdbool_.h: Better support for BeOS.
6630 2003-10-27 Paul Eggert <eggert@twinsun.com>
6632 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6633 to allocate the returned structure. Do not allocate a subarray,
6634 as x2nrealloc will do that.
6635 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6636 instead of xnrealloc.
6637 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6639 2003-10-26 Paul Eggert <eggert@twinsun.com>
6641 * xalloc.h (xalloc_oversized): New static inline function, for
6642 callers that want to do their own size-overflow checking. Include
6643 <stdbool.h>, since xalloc_oversized returns bool.
6644 * xalloc.c (array_size_overflow): Remove. All callers changed
6645 to use xalloc_oversized.
6647 Add two functions x2realloc, x2nrealloc, for programs that grow
6648 arrays dynamically by doubling their sizes.
6649 * xalloc.h (x2realloc, x2nrealloc): New decls.
6650 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6653 Port to C99 semantics for 'inline' of external functions.
6654 Bug reported by Bruno Haible.
6655 * xmalloc.c (xnmalloc_inline): New static inline function,
6656 with the old contents of xnmalloc.
6657 (xnmalloc, xmalloc): Use it.
6658 (xnrealloc_inline): New static inline function,
6659 with the old contents of xnrealloc.
6660 (xnrealloc, xrealloc): Use it.
6662 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6664 2003-10-25 Paul Eggert <eggert@twinsun.com>
6666 Fix several address-calculation bugs in the hash modules,
6667 plus some minor code cleanup.
6669 * hash.h: Include <stdbool.h>, for bool.
6670 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6671 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6672 hash_get_n_entries, hash_get_max_bucket_length,
6673 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6674 hash_rehash): Use size_t rather than unsigned.
6675 * hash.c (struct hash_table, hash_get_n_buckets,
6676 hash_get_n_buckets_used, hash_get_n_entries,
6677 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6678 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6679 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6681 (SIZE_MAX): Define if not defined.
6682 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6683 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6685 Use const * when possible.
6686 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6687 (check_tuning): Fix bug: if tuning parameters were very close to
6688 0 or 1, rounding errors could have caused subscript violations.
6689 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6690 (hash_initialize): Add 'fail:' label
6691 to free table and return NULL, and use it to simplify code.
6692 Use calloc rather than clearing the storage ourself.
6693 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6694 buffer size calculations.
6695 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6696 Include <stddef.h>, for size_t.
6697 * hash-pjw.c (hash_pjw): Likewise.
6698 Switch to method described by Bruno Haible.
6699 Include <limits.h>, for CHAR_BIT.
6700 (SIZE_BITS): New macro.
6702 2003-10-21 Paul Eggert <eggert@twinsun.com>
6704 * getndelim2.c (getndelim2): When size calculation overflows,
6705 ceiling the allocation at NMAX bytes rather than silently
6706 discarding input bytes before NMAX is reached. This makes
6707 a difference only if NMAX exceeds SIZE_MAX / 2.
6709 * obstack.c: Merge from glibc.
6710 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6711 Add libc_hidden_def (_obstack_newchunk).
6712 (_obstack_free) [! defined _LIBC]: Remove.
6713 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6714 a clone of the function body.
6715 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6716 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6718 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6719 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6722 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6723 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6724 Don't use lvalue casts, as GCC plans to remove support for them
6725 in GCC 3.5. Reported by Joseph S. Myers. This bug
6726 was also present in the non-GCC version, indicating that this
6727 code had always been buggy and had never been widely used.
6728 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6729 Use the fast variant of each macro, rather than copying the
6730 definiens of the fast variant; that way, we'll be more likely to
6731 catch future bugs in the fast variants.
6733 2003-10-20 Bruno Haible <bruno@clisp.org>
6735 * wait-process.h: New file, from GNU gettext.
6736 * wait-process.c: New file, from GNU gettext.
6738 2003-10-19 Jim Meyering <jim@meyering.net>
6740 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6742 2003-10-16 Paul Eggert <eggert@twinsun.com>
6744 * getgroups.c: Include <errno.h>, <stdlib.h>.
6745 (getgroups): First arg is int, not size_t.
6746 Don't let 'free' mangle errno.
6748 2003-10-16 Jim Meyering <jim@meyering.net>
6750 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6752 2003-10-15 Paul Eggert <eggert@twinsun.com>
6754 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6756 (new_exclude, add_exclude_file): Initial size no longer needs to
6758 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6759 our own address arithmetic overflow checking.
6761 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6762 (fnmatch): Do not alloca more than 2000 wide characters;
6763 instead, use malloc for large buffers.
6764 Check for address arithmetic overflow, and return -1
6765 with errno set to ENOMEM in that case.
6766 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6767 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6768 instead, return -1. Check for address arithmetic overflow.
6770 2003-10-14 Paul Eggert <eggert@twinsun.com>
6772 Handle invalid suffixes and overflow independently, so that
6773 callers can treat them independently as needed. Fix some bugs in
6774 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6775 suffix for a human-readable blocksize. The major caller-visible
6776 change is the addition of a new
6777 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6778 that both overflow and suffix chars were found.
6780 * human.c (humblock): Don't check separately for invalid suffix
6781 char; that is xstrtoumax's job (now that its bug is fixed).
6782 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6783 INTMAX_MAX]: New macros.
6784 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6785 TYPE_MAXIMUM): New macros.
6786 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6787 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6788 if overflow occurs, as it's what __strtol does and it's more useful
6790 (__xstrtol): If __strtol reports some error other than ERANGE,
6791 reflect it to the caller as LONGINT_INVALID. If it reports
6792 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6793 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6794 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6796 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6797 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6798 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6799 [defined UINTMAX_MAX]: New macros.
6801 2003-10-14 Bruno Haible <bruno@clisp.org>
6803 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6804 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6805 Also use volatile where needed.
6807 2003-10-12 Paul Eggert <eggert@twinsun.com>
6809 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6810 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6811 and define in terms of the other primitives.
6812 * xmalloc.c: Include stdbool.h; do not include exit.h.
6813 (SIZE_MAX): Define if not already defined.
6814 (array_size_overflow): New function.
6815 (xalloc_die): Abort instead of exiting if 'error' returns.
6816 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6817 (xmalloc, xrealloc): Use them.
6818 (xcalloc): Check for address arithmetic overflow.
6819 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6820 a bit faster than strcpy.
6822 2003-10-08 Paul Eggert <eggert@twinsun.com>
6824 Merge getpass from libc, plus a few fixes.
6826 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6827 Include <stdbool.h>.
6828 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6829 __fsetlocking to empty.
6830 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6831 do include <bits/libc-lock.h>.
6832 Do not include <fcntl.h>; not needed.
6833 [_LIBC]: Include <wchar.h>.
6834 (NOTCANCEL_MODE): New macro.
6835 (flockfile, funlockfile) [_LIBC]: New macros.
6836 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6837 [!_LIBC]: New macros.
6838 (call_fclose): New function.
6839 (getpass): Use it. Save tty stream separately; this simplifies the
6840 code and makes it more reliable if stdin happens to equal stdout.
6841 Invoke __fsetlocking on tty.
6842 Handle thread cancellation if needed.
6843 Namespace cleanup (use __tcgetattr, __getline).
6844 Use bool for Booleans.
6845 [USE_IN_LIBIO]: Handle wide streams.
6846 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6847 stream might go where.
6849 * unlocked-io.h: Include <stdio.h>, so that the caller
6850 doesn't have to include <stdio.h> before us.
6851 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6852 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6853 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6854 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6855 if not declared, so that we can use getpass.c code from libc without
6857 (flockfile, ftrylockfile, funlockfile): New macros.
6859 2003-10-06 Bruno Haible <bruno@clisp.org>
6861 * version-etc-2.h: Remove file.
6862 * version-etc-2.c: Remove file.
6864 2003-09-25 Jim Meyering <jim@meyering.net>
6865 Bruno Haible <bruno@clisp.org>
6867 This lets translators provide better translations for the
6868 "Written by ..." part of --version output.
6869 * version-etc.h: Include stdarg.h.
6870 (version_etc_copyright): Declare as readonly.
6871 (version_etc): Make this function variadic with a NULL-terminated list
6872 of author name strings.
6873 (version_etc_va): New declaration.
6874 * version-etc.c: Include stdarg.h, stdlib.h.
6875 (version_etc_copyright): Declare as readonly.
6876 (version_etc_va): New function. Provide a different translatable string
6877 for each possible number of authors < 10. Abbreviate when there are 10
6879 (version_etc): Make this function variadic. Call version_etc_va.
6880 Suggestion from Gary V. Vaughan.
6882 * long-options.h (parse_long_options): Change prototype: the authors
6883 string is moved to the end and becomes variadic.
6884 * long-options.c: Include stdarg.h.
6885 (parse_long_options): Make this function variadic, too.
6886 Call version_etc_va, not version_etc.
6888 2003-10-06 Bruno Haible <bruno@clisp.org>
6890 * fatal-signal.h: New file, from GNU gettext.
6891 * fatal-signal.c: New file, from GNU gettext.
6893 2003-10-04 Karl Berry <karl@gnu.org>
6895 * argp*: update from libc.
6897 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6899 * getpass.c (getpass): Use a no-op fseek when switching from input to
6900 output mode on the same stream.
6902 2003-09-29 Paul Eggert <eggert@twinsun.com>
6904 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6905 Fix arg typo in previous patch.
6907 2003-09-28 Jim Meyering <jim@meyering.net>
6909 * error.c: Correct cpp indentation.
6911 2003-09-27 Paul Eggert <eggert@twinsun.com>
6913 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6914 Omit the special code that used __typeof__, since we worry that
6915 it could be more trouble than it's worth. See:
6916 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6917 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6921 2003-09-26 Jim Meyering <jim@meyering.net>
6923 * error.c (error_tail): Move some declarations
6924 into inner scope where the local variables are used.
6926 2003-09-26 Bruno Haible <bruno@clisp.org>
6928 * stpncpy.h (gnu_stpncpy): New declaration.
6929 (stpncpy): Define as alias for gnu_stpncpy.
6930 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6932 2003-09-26 Paul Eggert <eggert@twinsun.com>
6934 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6935 (error_tail): Do not loop, reallocating temporary buffer, since
6936 the output cannot contain more wide characters than the input
6937 contains bytes, the size must be big enough already. This avoids
6938 one potential size overflow calculation. Check for size overflow
6939 when calculating temporary buffer size. Free temporary buffer
6940 when done, if it was allocated with malloc; this plugs a memory
6941 leak. Remove casts from void * to pointers, that are no longer
6942 needed now that we're assuming C89 or better.
6944 Merge error changes from glibc.
6946 * error.c, error.h: Update copyright notice header to match glibc.
6947 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6948 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6949 Disable cancellation while printing error.
6950 * error.h: Prepend __ to parameter names.
6952 2003-09-25 Karl Berry <karl@gnu.org>
6954 * argp-fmtstream.c, argp-help.c: update from libc.
6956 2003-09-25 Bruno Haible <bruno@clisp.org>
6958 * version-etc-2.h: New file, from version-etc.h with modifications.
6959 * version-etc-2.c: New file, from version-etc.c with modifications.
6961 2003-09-25 Simon Josefsson <jas@extundo.com>
6963 * xgetdomainname.h: New file.
6964 * xgetdomainname.c: New file.
6966 2003-09-25 Simon Josefsson <jas@extundo.com>
6967 Bruno Haible <bruno@clisp.org>
6969 * getdomainname.h: New file.
6970 * getdomainname.c: New file.
6972 2003-09-24 Paul Eggert <eggert@twinsun.com>
6974 * linebuffer.c (freebuffer): Don't free the argument, just
6975 the buffer associated with the argument. Bug reported by
6978 2003-09-19 Karl Berry <karl@gnu.org>
6980 * argp.h: update from libc.
6982 2003-09-16 Paul Eggert <eggert@twinsun.com>
6984 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6985 input error, instead of returning NULL the next time we are called
6986 (and therefore losing track of errno).
6988 2003-09-15 Paul Eggert <eggert@twinsun.com>
6990 * getndelim2.c (getndelim2): Don't trash errno when a read
6991 fails, so that the caller gets the proper errno.
6993 * readutmp.c (read_utmp): Likewise.
6994 Check for fstat error. Close stream and free storage
6997 2003-09-14 Bruno Haible <bruno@clisp.org>
6999 * fwriteerror.h: New file.
7000 * fwriteerror.c: New file.
7002 2003-09-14 Jim Meyering <jim@meyering.net>
7004 * getloadavg.c: Correct cpp indentation.
7005 * strdup.c: Likewise.
7006 * vasnprintf.c: Likewise.
7008 2003-09-12 Paul Eggert <eggert@twinsun.com>
7010 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
7011 * obstack.c [!defined _LIBC]: Likewise.
7012 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
7013 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
7014 * exitfail.c: Don't include stdlib.h; no longer needed.
7016 More changes to assume C89 or better.
7018 * error.c (error_tail): Assume vprintf.
7020 * argmatch.c (getenv): Remove decl.
7021 * progreloc.c (get_full_program_name): Define via prototype.
7022 * setenv.c (clearenv): Likewise.
7023 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7025 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7026 (malloc, memcpy): Remove decls.
7027 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7028 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7029 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7030 (memcpy): Remove macro.
7031 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7032 (__P): Remove. All uses removed.
7033 (PTR): Remove. All uses changed to void *.
7034 (CHAR_BIT, NULL): Remove.
7035 (spaces, zeros, memset_space, memset_zero)
7036 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7038 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7039 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7040 Define with prototype.
7041 Remove now-unnecessary prototype decl.
7042 (extra_args_spec): Assume ANSI C. All uses changed.
7043 (extra_args_spec_iso): Remove.
7044 (my_strftime, emacs_strftimeu): Define via prototype.
7045 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7047 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7048 * strtoimax.c: Include <stdlib.h> unconditionally.
7049 (strtoul, strtol): Remove decls.
7050 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7052 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7053 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
7054 (LOCALE_PARAM_PROTO): New macro.
7055 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7056 (INTERNAL (strtol), strtol): Define with a prototype.
7057 (PARAMS): Remove. All uses removed.
7058 * tempname.c: Include <string.h> unconditionally.
7059 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7060 * xgethostname.c (main): Define with a prototype.
7061 * xmalloc.c: Include "xalloc.h" first, to check interface.
7062 Include <stdlib.h> unconditionally.
7063 (calloc, malloc, realloc, free): Remove decls.
7064 * xstrtod.c: Include "xstrtod.h" first, to check interface.
7065 Include <stdlib.h> unconditionally. Sort include file names.
7067 (xstrtod): Define with a prototype.
7068 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7069 (strtol, strtoul): Remove decls.
7071 2003-09-11 Paul Eggert <eggert@twinsun.com>
7073 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7074 Include <stdlib.h>, <string.h> unconditionally.
7075 Remove now-unnecessary cast to char *.
7076 * strnlen.c: Include <string.h> unconditionally.
7077 * yesno.c (yesno): Define with a prototype.
7079 2003-09-10 Bruno Haible <bruno@clisp.org>
7081 * strcspn.c: Include <string.h> unconditionally.
7082 * strpbrk.c: Include <string.h> unconditionally.
7083 * strstr.c: Include <string.h> unconditionally.
7084 * unicodeio.c: Include <string.h> unconditionally.
7085 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7086 * unsetenv.c: Likewise.
7087 * xreadlink.c: Include <stdlib.h> unconditionally.
7088 * yesno.c: Include <stdlib.h> unconditionally.
7089 (rpmatch): Add prototype.
7091 2003-09-10 Jim Meyering <jim@meyering.net>
7093 * error.c: Correct indentation of cpp directives.
7095 2003-09-09 Paul Eggert <eggert@twinsun.com>
7099 * acosl.c (main): Use a prototype.
7100 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7103 * getloadavg.c (getloadavg, main): Define via prototypes.
7105 * getopt.h (struct option.name): Assume C89, and use 'const'.
7106 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7107 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7109 * getopt.c (const): Remove macro.
7110 Include <string.h> unconditionally.
7111 (my_index): Remove; all uses changed to strchr.
7112 (strlen): Remove decl.
7113 (exchange): Remove forward decl; no longer needed.
7114 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7115 Define with prototype.
7116 * getopt1.c (const): Remove macro.
7117 (getopt_long, getopt_long_only, main): Define with prototype.
7119 * getugroups.c: Include <string.h> unconditionally.
7121 * getusershell.c: Include <stdlib.h> unconditionally.
7122 (getusershell, setusershell, endusershell, readname, main):
7123 Define with prototypes.
7125 * group-member.c: Include group-member.h first.
7126 Include <stdlib.h> unconditionally.
7128 * hard-locale.c: Include hard-locale.h first.
7129 Include <stdlib.h>, <string.h> unconditionally.
7131 * hash.c (free, malloc): Remove decls.
7132 Include <stdlib.h> unconditionally.
7134 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7135 (getenv): Do not declare.
7137 * idcache.c: Include <string.h> unconditionally.
7139 * long-options.c: Include long-options.h first, to test interface.
7140 Include <stdlib.h> unconditionally.
7142 * makepath.c: Include makepath.h first, to test interface.
7143 Include <stdlib.h> and <string.h> unconditionally.
7145 * linebuffer.c: Include <stdlib.h>.
7146 (free): Remove decl.
7148 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7149 rpl_malloc returns void *, not char *.
7150 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7152 * md5.h: Include <limits.h> unconditionally.
7153 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7154 (__P): Remove; all uses removed.
7155 * md5.c: Include "md5.h" first.
7156 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7157 md5_buffer, md5_process_bytes, md5_process_block):
7158 Define with prototypes.
7159 * sha.h (__P): Remove all uses. (It wasn't defined??)
7160 * sha.c: Include "sha.h" first.
7161 Include <stdlib.h>, <string.h> unconditionally.
7163 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7164 * memcmp.c (__ptr_t): Likewise.
7165 * memrchr.c (__ptr_t): Likewise.
7166 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7167 Include <string.h> unconditionally.
7168 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7169 * memchr.c: Include <stdlib.h> unconditionally.
7170 * memchr.c (LONG_MAX): Remove.
7171 * memrchr.c (LONG_MAX): Likewise.
7172 * memchr.c (__memchr): Define via a prototype.
7173 * memrchr.c (__memrchr): Likewise.
7174 * memcmp.c (__P): Remove, and remove all uses.
7175 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7176 Remove forward decls; no longer needed.
7177 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7178 Use types required by C89 in prototype.
7180 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7181 * savedir.c: Likewise.
7182 * mkdir.c (free): Remove decl.
7183 * rmdir.c (rmdir): Define with a prototype.
7184 * savedir.c: Include savedir.h first, to test interface.
7186 * mktime.c (STDC_HEADERS): Remove.
7187 Include <stdlib.h>, <string.h> unconditionally.
7189 * modechange.c: Include <stdlib.h> unconditionally.
7190 (malloc): Remove decl.
7192 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7193 (free): Remove decl.
7195 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7196 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7197 (This type really should be intptr_t, but that's a C99ism.)
7198 (_obstack_memcpy): Remove: all uses changed to memcpy.
7199 Include <string.h> unconditionally.
7200 (struct obstack): Assume __STDC__ for types of members
7201 chunkfun, freefun, extra_arg.
7202 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7203 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7204 obstack_begin, obstack_specify_allocation,
7205 obstack_specify_allocation_with_arg, obstack_chunkfun,
7206 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7207 Remove unprototyped decls and the macros that use them.
7208 * obstack.c (POINTER): Remove. All uses changed to void *.
7209 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7210 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7211 (defined __STDC__ && __STDC__)]:
7212 Remove nonprototyped code.
7213 Include <stdlib.h> unconditionally.
7214 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7215 _obstack_allocated_p, _obstack_free, obstack_free,
7216 _obstack_memory_used, print_and_abort):
7217 Define using prototypes.
7218 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7219 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7220 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7221 obstack_next_free, obstack_object_size, obstack_room) [0]:
7222 Remove unused, unprototyped code.
7224 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7226 * physmem.c (physmem_total, physmem_available, main): Define
7229 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7230 (main): Define with a prototype.
7232 * posixver.c (getenv): Remove decl.
7234 * putenv.c (malloc): Returns void *, not char *.
7235 Include <string.h> unconditionally.
7236 (strchr, memcpy, NULL): Do not define.
7238 * readtokens.c: Include readtokens.h first, to test interface.
7239 Include <stdlib.h>, <string.h> unconditionally.
7240 (init_tokenbuffer): Define with a prototype.
7242 * regex.c (PARAMS): Remove. All uses removed.
7243 All uses of _RE_ARGS removed, too.
7244 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7246 (bzero): Assume memset exists.
7247 (memcmp, memcpy, NULL): Remove.
7248 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7249 char, or assignments to local vars of type signed char.
7250 (init_syntax_once, PREFIX(extract_number_and_incr),
7251 PREFIX(print_partial_compiled_pattern),
7252 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7253 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7254 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7255 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7256 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7257 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7258 wcs_compile_range, byte_compile_range, truncate_wchar,
7259 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7260 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7261 count_mbs_length, wcs_re_match_2_internal,
7262 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7263 PREFIX(alt_match_null_string_p),
7264 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7265 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7266 regfree, PREFIX(extract_number)): Define with prototype. Remove
7267 now-unnecessary declaration, if any.
7268 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7270 Remove now-unnecessary casts among pointer types.
7271 * regex.h (_RE_ARGS): Remove. All uses removed.
7273 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7274 (free): Remove decl.
7276 * rpmatch.c: Include <stdlib.h> unconditionally.
7278 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7279 (free): Remove decl.
7281 * save-cwd.c: Include <stdlib.h> unconditionally.
7282 * xgetcwd.c: Likewise.
7284 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7285 (free): Remove decl.
7287 * strchrnul.c (strchrnul): Define with a prototype.
7288 Fix bug: c_in was not converted to char before searching.
7290 The following changes are not K&R related:
7292 * group-member.h: Include <sys/types.h>, so that this file is
7294 * makepath.h: Likewise.
7296 * getusershell.c (readname, default_index, line_size, readname):
7297 Use size_t, not int, for sizes.
7298 (readname): If the size overflows, report an error instead of
7301 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7303 * getndelim2.c: Assume stdlib.h per the C89 spec.
7305 2003-09-08 Paul Eggert <eggert@twinsun.com>
7307 Assume C89 or better; remove K&R cruft.
7308 A few of these changes were first proposed by Derek Robert Price
7309 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7311 * addext.c: Include <string.h> unconditionally.
7312 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7313 Don't declare getenv or malloc.
7315 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7316 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7318 (find_stack_direction, alloca): Use prototypes.
7320 * atexit.c (atexit): Define using a prototype.
7322 * basename.c, dirname.c, stripslash.c:
7323 Include <string.h> unconditionally.
7325 * bcopy.c: Include <stddef.h>.
7326 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7328 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7330 * error.h (error, error_at_line, error_print_progname)
7331 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7332 * error.c: Include error.h first, to check interface.
7333 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7334 (VA_START): Remove; all uses changeed to va_start.
7335 (exit, strerror): Remove decls.
7336 (error_print_progname): Prototype uncondionally.
7337 Don't include <errno.h>; no longer needed.
7338 (private_strerror): Remove.
7339 (error_tail): Always define.
7340 (error, error_at_line): Assume C89 or better; always use prototypes.
7341 * fatal.c: Include "fatal.h" first, to test interface.
7342 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7343 (VA_START): Remove; all uses changed to va_start.
7344 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7346 (exit): Remove decl.
7347 (fatal): Prototype unconditionally. Assume va_start works.
7348 Abort at end, to pacify gcc.
7350 * euidaccess.c (main): Define with a prototype.
7352 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7354 * exitfail.c: Include <stdlib.h> unconditionally.
7356 * fnmatch_.h (__P): Remove. All uses changed to assume
7358 * fnmatch.c: Include fnmatch.h first, to test interface.
7359 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7360 (getenv): Remove decl.
7361 (fnmatch): Define using a prototype.
7362 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7363 (FCT): Define using a prototype.
7365 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7367 * gethostname.c: Include <stddef.h>.
7368 (gethostname): Define with prototype. Length is size_t, not int.
7370 2003-09-08 Paul Eggert <eggert@twinsun.com>
7372 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7373 getversion.c should have been removed then, but was accidentally
7376 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7377 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7379 2003-09-07 Paul Eggert <eggert@twinsun.com>
7381 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7382 copy_tm_result. Bug reported by Simon Josefsson in
7383 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7385 2003-09-06 Paul Eggert <eggert@twinsun.com>
7387 * time_r.c, time_r.h: New files.
7389 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7391 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7392 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7394 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7396 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7397 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7400 * timegm.c: Switch to glibc implementation, with the following changes:
7401 [defined HAVE_CONFIG_H]: Include <config.h>.
7402 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7403 (__mktime_internal) [!defined _LIBC]: New decl.
7404 (__gmtime_r) [!defined _LIBC]: New macro and function.
7405 (timegm): Use a prototype, since gnulib assumes C89.
7406 Do not bother declaring tmp to be const, as it's not really usefu.
7407 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7408 (timegm): Declare only if HAVE_DECL_TIMEGM.
7410 2003-09-03 Paul Eggert <eggert@twinsun.com>
7412 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7413 Bug reported by Lute Kamstra in
7414 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7416 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7417 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7418 course with correspondingly smaller numbers for tomorrow and
7419 yesterday. From Tadayoshi Funaba. Originally installed into
7420 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7423 2003-08-31 Simon Josefsson <jas@extundo.com>
7425 * timegm.h: New file.
7426 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7428 2003-08-31 Karl Berry <karl@gnu.org>
7430 * argp.h: update from libc.
7432 2003-08-28 Bruno Haible <bruno@clisp.org>
7434 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7435 warning on QNX, which defines O_BINARY to 000000.
7437 2003-08-24 Bruno Haible <bruno@clisp.org>
7439 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7440 MSVC7 <stdio.h> is included later.
7442 2003-08-20 Bruno Haible <bruno@clisp.org>
7444 * progname.h: New file, from GNU gettext.
7445 * progname.c: New file, from GNU gettext.
7446 * progreloc.c: New file, from GNU gettext.
7448 2003-08-19 Bruno Haible <bruno@clisp.org>
7450 * xstrdup.c: Assume <string.h> exists.
7452 2003-08-18 Jim Meyering <jim@meyering.net>
7454 * setenv.h: Indent nested cpp directive.
7455 * vasnprintf.c: Remove trailing blanks.
7457 2003-08-17 Simon Josefsson <jas@extundo.com>
7458 Bruno Haible <bruno@clisp.org>
7460 * xstrndup.h: New file.
7461 * xstrndup.c: New file.
7463 2003-08-17 Bruno Haible <bruno@clisp.org>
7465 * strndup.h: New file.
7467 2003-08-16 Paul Eggert <eggert@twinsun.com>
7469 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7470 space, undoing this 2003-08-12 change:
7471 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7473 2003-08-16 Jim Meyering <jim@meyering.net>
7475 Merge from coreutils.
7476 * xstrtoimax.c: #else #if -> #elif.
7477 * xstrtoumax.c: Likewise.
7479 2003-08-15 Paul Eggert <eggert@twinsun.com>
7481 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7482 rather than tab, after '#' in shell-script copyright notices.
7483 Suggested by Bruno Haible.
7485 2003-08-15 Jim Meyering <jim@meyering.net>
7486 and Paul Eggert <eggert@twinsun.com>
7488 Merge from coreutils.
7489 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7490 member but strut utmpx does not. Needed for AIX 4.3.3.
7491 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7493 2003-08-15 Jim Meyering <jim@meyering.net>
7495 Merge from coreutils.
7496 * xgethostname.c: Include <stdlib.h>.
7497 (xghostname): Don't exit for anything other than memory-related
7498 failure; just return NULL.
7499 * userspec.c: Include "posixver.h".
7500 (parse_user_spec): Accept `.' as a separator only
7501 in pre-POSIX-200112 mode.
7502 * strtoimax.c: Use #elif rather than #else #if.
7503 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7504 Remove function, now that we can rely on a working tzset function.
7505 [!_LIBC]: Ensure that the required autoconf test has been run.
7506 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7507 Use underlying_strftime for %r.
7508 * sha.c: Merge in some clean-up and optimization changes from glibc.
7509 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7510 Ensure that it is a multiple of 64.
7511 Rearrange loop exit tests so as to avoid performing an
7512 additional fread after encountering an error or EOF.
7513 * realloc.c: Update copyright date.
7515 2003-08-14 Jim Meyering <jim@meyering.net>
7517 Merge from coreutils.
7518 * obstack.h: Whitespace changes.
7519 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7520 and xcalloc return values.
7521 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7522 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7523 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7524 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7525 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7527 Use mntctl's return value to drive the entry-processing loop, since
7528 we can't rely on the value of the vmt_length member in the last
7529 entry. On some systems doing so could result in exhausting
7530 virtual memory. Based in part on a patch from Mike Jetzer.
7532 2003-08-14 Jim Meyering <jim@meyering.net>
7533 and Paul Eggert <eggert@twinsun.com>
7535 Merges from coreutils, plus other fixes.
7536 * physmem.c: Merge in portability changes from gcc/libiberty
7537 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7538 for credits and details. Thanks to Kaveh Ghazi for helping
7539 to keep these files in sync.
7540 (ARRAY_SIZE): Define it.
7541 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7542 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7543 (memcasecmp): Don't assume size_t fits in unsigned int.
7544 Remove casts and duplicate code.
7545 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7546 (memcpy): Remove definition.
7547 Merge in some clean-up and optimization changes from glibc.
7548 [BLOCKSIZE]: Move definition to top of file.
7549 Ensure that it is a multiple of 64.
7550 Rearrange loop exit tests so as to avoid performing an
7551 additional fread after encountering an error or EOF.
7552 * md5.h (md5_uintptr): Define.
7553 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7554 return to the initial working directory. Preserve errno
7556 * idcache.c: Include "xalloc.h".
7557 (xmalloc, xrealloc): Remove decls.
7558 (getuser): Remove casts no longer required in C89.
7559 * human.c: Include stdio.h, for sprintf.
7560 * group-member.c: Include "xalloc.h".
7561 (xmalloc, xrealloc): Remove decls.
7562 (get_group_info): Remove casts no longer required in C89.
7563 * getusershell.c (readname): Remove casts no longer required in C89.
7564 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7565 * getline.c: Whitespace fix, from coreutils.
7567 2003-08-13 Paul Eggert <eggert@twinsun.com>
7569 * exclude.c: Include <ctype.h>
7570 (IN_CTYPE_DOMAIN): New macro.
7572 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7575 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7576 Undo previous (whitespace-only) change.
7578 2003-08-12 Paul Eggert <eggert@twinsun.com>
7580 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7581 Normalize leading white space and remove trailing white space.
7582 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7583 notice, as per ../config/srclist-update.
7585 Merge from coreutils.
7586 * euidaccess.h: New file.
7587 * euidaccess.c: Include it.
7588 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7589 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7590 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7592 2003-08-11 Bruno Haible <bruno@clisp.org>
7594 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7595 (vasnprintf): Use it instead of wcslen.
7597 2003-08-11 Bruno Haible <bruno@clisp.org>
7599 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7600 value to ensure that _Bool promotes to int. Use #define for _Bool when
7601 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7603 2003-08-10 Karl Berry <karl@gnu.org>
7605 * regex.h: update from libc (whitespace fix).
7607 2003-08-09 Paul Eggert <eggert@twinsun.com>
7609 Merge some files from coreutils. These changes were
7610 originally made by Jim Meyering.
7611 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7612 many older Unixes require this.
7613 * alloca.c (alloca): Remove cast to argument of free;
7614 no longer needed in C89.
7615 * alloca_.h, regex.h: Fix white space to match
7616 what GNU indent does.
7618 2003-08-05 Paul Eggert <eggert@twinsun.com>
7620 * bumpalloc.h: Remove.
7622 2003-08-04 Paul Eggert <eggert@twinsun.com>
7624 * getloadavg.c: Change copyright notice and spacing to conform to
7627 Merge from coreutils.
7628 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7630 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7631 from Karl Berry, implemented by Jim Meyering.
7632 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7633 from Dmitry V. Levin.
7634 Remove anachronistic cast of xrealloc.
7635 * fnmatch_.h (__const): Remove. Use 'const'.
7636 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7637 type. Otherwise, it wouldn't compile with at least /bin/cc on
7638 ymp-cray-unicos9.0.2.X.
7639 Combine two mostly-identical uses of alloca into one.
7640 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7642 2003-08-04 Dave Love <d.love@dl.ac.uk>
7646 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7647 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7648 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7649 obsolete NLIST_NAME_UNION.
7650 [__GNU__]: Undef BSD and FSCALE.
7651 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7653 2003-08-03 Paul Eggert <eggert@twinsun.com>
7655 * stdbool_.h (_Bool): Make it signed char, instead of
7656 an enum type, so that it's guaranteed to promote to int. See:
7657 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7659 2003-07-31 Paul Eggert <eggert@twinsun.com>
7661 * strerror.c: Include config.h, limits.h. Declare sprintf.
7662 (strerror): Don't assume that a printable int fits in 14 bytes.
7664 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7665 Bruno Haible <bruno@clisp.org>
7667 * getline.h (getline, getdelim): Change return type to ssize_t.
7668 * getline.c (getline, getdelim): Likewise.
7669 Remove _GNU_SOURCE define; now it's defined in config.h through
7672 2003-07-22 Paul Eggert <eggert@twinsun.com>
7674 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7675 over-parenthesization in macros.
7677 Sync with coreutils.
7679 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7682 Use `exit_failure' for xalloc and xmemcoll instead of their own
7683 private exit-failure variables.
7684 * xalloc.h (xalloc_exit_failure): Remove.
7685 * xmalloc.c: Likewise. Include exitfail.h.
7686 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7687 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7688 * xmemcoll.c: Likewise. Include exitfail.h.
7689 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7691 2003-07-18 Paul Eggert <eggert@twinsun.com>
7693 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7694 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7695 to test that it can stand by itself. Include "exitfail.h".
7696 Clients should set exit_failure instead.
7697 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7699 2003-07-18 Andreas Schwab <schwab@suse.de>
7701 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7703 2003-07-18 Bruno Haible <bruno@clisp.org>
7705 * getndelim2.h: New file.
7706 * getndelim2.c: Make into a module of its own. Include config.h,
7708 (getndelim2): Make non-static. Change return type to ssize_t.
7709 * getline.h: Change argument names.
7710 * getline.c: Include getndelim2.h instead of getndelim2.c.
7711 * getnline.c: Include getndelim2.h.
7713 2003-07-17 Bruno Haible <bruno@clisp.org>
7715 * Makefile.am: Remove file.
7716 * Makefile.in: Remove file.
7718 2003-07-17 Bruno Haible <bruno@clisp.org>
7720 * getnline.h: New file.
7721 * getnline.c: New file.
7722 * getndelim2.c: New file, extracted from getline.c.
7723 (getndelim2): Renamed from getdelim2, with added nmax argument.
7724 * getline.c: Include getndelim2.c.
7725 (getdelim2): Moved out to getndelim2.c.
7726 (getline, getdelim): Update.
7728 2003-07-15 <karl@gnu.org>
7730 * vasnprintf.c: update from gettext.
7732 2003-07-15 Jim Meyering <jim@meyering.net>
7734 * makepath.c (make_path): Enclose diagnostic in _(...).
7736 2003-07-14 Paul Eggert <eggert@twinsun.com>
7738 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7739 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7740 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7741 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7742 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7743 updated automatically by ../config/srclist-update. This changes
7744 their license from LPGL to GPL.
7746 2003-07-14 Jim Meyering <jim@meyering.net>
7748 Don't emit diagnostics. Let callers do that.
7749 * save-cwd.c: Don't include "error.h".
7750 (save_cwd): Don't call error. Ensure that errno is valid
7751 when returning nonzero.
7753 * save-cwd.h (restore_cwd): Update prototype.
7754 * save-cwd.c (restore_cwd): Remove two parameters.
7755 Simplify. Don't call error upon failure. Let callers do that.
7756 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7757 when auditing is enabled. But don't bother updating the #if.
7759 2003-07-14 Simon Josefsson <jas@extundo.com>
7761 * mempcpy.h: New file.
7762 * mempcpy.c: New file.
7764 2003-07-14 Paul Eggert <eggert@twinsun.com>
7766 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7767 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7768 unicodeio.c, unicodeio.h, unlocked-io.h:
7769 Switch from LGPL to GPL.
7771 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7773 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7774 it breaks C++ compilation.
7775 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7777 2003-07-10 Jim Meyering <jim@meyering.net>
7779 * vasnprintf.c: Remove trailing blanks.
7780 Make cpp indentation consistent.
7782 2003-07-09 Paul Eggert <eggert@twinsun.com>
7784 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7785 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7786 Switch from LGPL to GPL.
7788 2003-07-07 Paul Eggert <eggert@twinsun.com>
7790 * mktime.c: Fix some boundary cases and remove need for floating point.
7792 Issue a compile-time diagnostic if time_t is floating point, or if
7793 two's complement arithmetic is not in effect, or if arithmetic
7794 right shift does not propagate the sign. These assumptions were
7795 all in the original code but they weren't checked.
7797 (TIME_T_MIDPOINT, verify): New macros.
7798 (__isleap): Remove; it has integer overflow problems.
7799 (leapyear): New function, without those problems.
7800 (ydhms_tm_diff): Remove; splitting into two parts.
7801 (ydhms_diff): New function, containing the arithmetic part of
7802 the old ydhms_tm_diff function. Issue a compile-time
7803 diagnostic if we are not using C99 integer division.
7804 Avoid casts when possible.
7805 (guess_time_tm): New function, containing the checking part of
7806 the old ydhms_tm_diff function. Return the new value, rather than
7807 the difference between it and the old. Accept a new argument T
7808 so that *T specifies the old value. Check for overflow in the result.
7810 (__mktime_internal): Use a time_t offset, not a long int offset.
7811 This undoes the 2003-06-04 change, which is no longer needed now
7812 that we have better overflow checking.
7813 (localtime_offset): Likewise.
7815 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7816 and long are 64-bit but int is only 32-bit.
7817 (ydhms_diff): Use long int to store year1 and yday1.
7818 Issue a compile-time diagnostic if long int is not wide enough.
7820 (__mktime_internal): Use long int to store adjusted year and yday.
7821 Use plain C rather than preprocessor commands, if that doesn't
7823 Check for overflow (and try to repair) after each probe
7824 rather than checking only at the very end. This avoids some bugs
7825 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7826 does not equal GMT offset at maximum time).
7827 Use integer to check for overflow rather than floating point; this
7828 is more portable to non-IEEE hosts, and is a tad faster.
7829 When we detect that we are oscillating between two values,
7830 don't check whether tm_isdst has the requested value, since
7831 we already know the answer. When tm_isdst has the wrong value,
7832 use a different heuristic to find the right one, based on the
7833 extreme values actually observed in practice in tz2003a,
7834 rather than the (overly optimistic) "previous 3 calendar quarters".
7836 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7837 "T const" to accommodate glibc style.
7838 (check_result): Use less-confusing report format. "long" -> "long int.
7840 Don't loop if the iteration overflows time_t.
7841 Allow a negative step in the iteration.
7843 2003-07-01 Paul Eggert <eggert@twinsun.com>
7845 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7846 having it depend on HAVE_SYS_TYPES_H.
7848 2003-06-25 Bruno Haible <bruno@clisp.org>
7850 * readlink.c: New file.
7852 2003-06-20 Bruno Haible <bruno@clisp.org>
7854 Assume C89, so PARAMS isn't needed.
7855 * unicodeio.h (PARAMS): Remove.
7856 * unicodeio.c: Don't use PARAMS.
7858 2003-06-18 Jim Meyering <jim@meyering.net>
7860 Merge changes from coreutils.
7861 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7862 Remove explicit declarations of xmalloc and realloc.
7864 (read_utmp): Remove anachronistic cast of xmalloc.
7866 2003-06-17 Paul Eggert <eggert@twinsun.com>
7868 Assume C89, so PARAMS isn't needed.
7869 * backupfile.h (PARAMS): Remove. All uses removed.
7870 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7871 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7872 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7873 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7874 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7875 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7876 xstrtol.h: Likewise.
7877 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7878 same.h, strverscmp.h: Do not include config.h; no longer needed.
7879 Anyway, config.h should always be included before any other file.
7881 2003-06-11 Simon Josefsson <jas@extundo.com>
7883 * sysexit_.h: New file.
7885 2003-05-20 Derek Price <derek@ximbiot.com>
7887 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7889 2003-06-10 Simon Josefsson <jas@extundo.com>
7891 * strchrnul.h: New file.
7892 * strchrnul.c: New file.
7894 2003-06-10 Simon Josefsson <jas@extundo.com>
7896 * argp.h: New file, from glibc.
7897 * argp-ba.c: New file, from glibc.
7898 * argp-eexst.c: New file, from glibc.
7899 * argp-fmtstream.c: New file, from glibc.
7900 * argp-fmtstream.h: New file, from glibc.
7901 * argp-fs-xinl.c: New file, from glibc.
7902 * argp-help.c: New file, from glibc.
7903 * argp-namefrob.h: New file, from glibc.
7904 * argp-parse.c: New file, from glibc.
7905 * argp-pv.c: New file, from glibc.
7906 * argp-pvh.c: New file, from glibc.
7907 * argp-xinl.c: New file, from glibc.
7909 2003-06-07 Jim Meyering <jim@meyering.net>
7911 * readtokens.h: Put `Free Software Foundation, Inc.'
7912 in place of my name in the copyright comment.
7913 Remove definition and uses of __P.
7916 * stat.c: Don't declare xmalloc explicitly.
7917 Instead, include "xalloc.h".
7918 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7919 xrealloc, and xcalloc return values.
7920 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7922 * xgetcwd.h: Remove definition/uses of PARAMS.
7924 2003-06-06 Jim Meyering <jim@meyering.net>
7926 * stdbool_.h: Renamed from stdbool.h.in.
7928 2003-06-06 Jim Meyering <jim@meyering.net>
7930 Merge from coreutils.
7931 * same.c: (same_name): Declare *_basename locals to be `const'.
7932 Consolidate declarations and initializations of *_base* locals.
7934 Merge from coreutils.
7935 This avoids a core dump on systems without GNU putenv,
7936 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7937 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7938 (unsetenv): New static function, from GNU libc.
7939 (rpl_putenv): Use it.
7941 * modechange.c: Remove trailing blanks.
7943 Merge from coreutils.
7944 * fsusage.c: Remove declaration of statfs.
7945 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7947 * posixtm.c: Include <stdbool.h> unconditionally.
7949 2003-06-05 Paul Eggert <eggert@twinsun.com>
7951 * mktime.c (__mktime_internal): When resolving a tm_isdst
7952 mismatch, look in future quarters as well as past. This fixes a
7953 bug when processing fall-backwards gaps immediately after a long
7954 period of daylight-saving time.
7956 * mktime.c: Assume freestanding C89 or better.
7957 (HAVE_LIMITS_H): Remove. Assume it's 1.
7958 (__P): Remove; not used.
7959 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7960 (mktime, not_equal_tm, print_tm, check_result,
7961 main): Use prototypes. Use const * where appropriate.
7962 (main): Fix typo in testing code that uncovered by above changes.
7963 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7965 2003-06-04 Paul Eggert <eggert@twinsun.com>
7967 * mktime.c: Fix Debian bug 177940
7968 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7969 (localtime_offset): Now long int, not time_t, because we want it
7970 to be guaranteed to be signed. All uses changed.
7971 (__mktime_internal): If overflow would occur when adding offset,
7974 Merge 'human' changes from coreutils. Rewrite to support
7975 locale-specific notations like thousands separators.
7976 * human.c: Simplify authorship notice.
7977 Include human.h immediately after config.h.
7978 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7979 <limits.h>: Do not include, since human.h does.
7980 (SIZE_MAX, UINTMAX_MAX): New macros.
7981 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7982 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7983 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7984 (power_letter): Renamed from suffixes.
7985 (generate_suffix_backwards): Remove.
7986 (adjust_value): Now takes int style (because of human.h changes)
7987 and long double value (for greater precision on some platforms).
7988 (group_number): New function.
7989 (human_readable): Use it. Use integer options, not enum.
7990 Put the options before the sizes in the arg list.
7991 Support all the new options.
7992 The old human_readable function has been removed;
7993 use inttostr.h instead.
7994 (human_readable, default_block_size, humblock):
7995 Use uintmax_t, not int, for block sizes.
7996 (human_readable_inexact, block_size_types): Remove.
7997 (block_size_opts): New constant.
7998 (human_options): Renamed from human_block_size, with new signature
7999 that allows block sizes up to UINTMAX_MAX. All callers changed.
8000 * human.h: Add copyright and authorship notice.
8001 Include <limits.h> and <stdbool.h> unconditionally.
8002 (PARAMS): Remove. All uses removed.
8003 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
8004 (enum human_inexact_style): Remove tag; now a nameless enum.
8005 (human_floor, human_ceiling, human_round_to_even): Now have
8006 values 2, 0, 1 rather than -1, 1, 0.
8007 (human_group_digits, human_suppress_point_zero, human_autoscale,
8008 human_base_1024, human_SI, human_B): New constants.
8009 (human_readable_inexact, human_block_size): Remove.
8010 (human_readable): Size args are now uintmax_t, not int.
8011 (human_options): New decl.
8013 * exclude.c: (new_exclude, add_exclude): Remove casts that are
8014 unnecessary now that we assume C89 or better. This change
8015 imported from coreutils.
8017 * mktime.c (__mktime_internal): Do not reject negative timestamps
8018 arbitrarily. This is the same patch as 2003-05-28, but it got lost
8019 in the 2003-05-30 sync from glibc.
8021 .h files should stand alone, but we shouldn't include <sys/types.h>
8022 if we can get away with just <stddef.h>.
8024 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8025 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8026 rather than <sys/types.h>, as we merely need size_t.
8027 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8029 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8030 Include <stdio.h>, to get FILE.
8031 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8032 memcasecmp.h has included <stddef.h> and all we need is size_t.
8033 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8034 our interface, instead of including <sys/types.h>
8036 2003-06-02 Paul Eggert <eggert@twinsun.com>
8039 Fix some minor time-related bugs with POSIX time arguments.
8040 Some valid time stamps were being rejected (notably -1, and
8041 time stamps before 1900 on 64-bit hosts). And some invalid
8042 time stamps were being accepted, e.g. September 31.
8044 * posixtm.h (posixtime): Return bool instead of time_t, so
8045 that we can return (time_t) -1 successfully.
8046 * posixtm.c: Likewise.
8047 [HAVE_STDBOOL_H]: Include <stdbool.h>.
8048 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8049 (t): Remove static var.
8050 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8051 of static var. All uses changed.
8052 (year): Do not reject years before 1900; they can occur with
8054 (posix_time_parse): Do not check for out-of-range components;
8055 that is now the caller's responsibility, since our checks were
8056 only approximations.
8057 (posixtime): Use mktime to check for out-of-range components,
8058 since it knows them exactly.
8059 If mktime returns (time_t) -1, check whether an error actually occurred
8060 by invoking localtime on -1.
8061 (main) [TEST_POSIXTIME]: Check for input data errors, and report
8062 posixtime failures better.
8063 Improve the test data (in comments only).
8065 2003-05-30 <karl@gnu.org>
8067 * mktime.c: update from libc.
8069 2003-05-30 Bruno Haible <bruno@clisp.org>
8071 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8072 * localcharset.h: Likewise.
8073 * localcharset.c: Likewise.
8075 2003-05-28 Paul Eggert <eggert@twinsun.com>
8077 Assume the headers required for C89 freestanding compilers.
8078 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8079 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8080 without checking for HAVE_LIMITS_H.
8081 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8082 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8084 * fatal.c: Include <stdarg.h> without checking for __STDC__.
8085 * exclude.c: Include <stdbool.h> unconditionally.
8086 * tempname.c: Include <stddef.h> unconditionally.
8087 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8088 * modechange.c, rpmatch.c (NULL): Don't define, since
8089 <stddef.h> does that.
8090 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8091 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8092 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8093 * xstrtol.c: Likewise.
8094 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8095 * savedir.c: Include <stddef.h> instead of defining NULL.
8097 * addext.c (addext): Use assignment rather than cast, to avoid
8098 warnings on some platforms.
8100 * mktime.c (__mktime_internal): Do not reject negative timestamps
8103 2003-05-10 Bruno Haible <bruno@clisp.org>
8105 * linebreak.c (iconv_string_length): Don't return -1 just because the
8106 string is longer than 4 KB.
8108 2003-05-12 Jim Meyering <jim@meyering.net>
8110 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8111 the space-padded-by-default conversion specifiers, %e, %k, %l.
8113 2003-05-03 Bruno Haible <bruno@clisp.org>
8115 Upgrade to Unicode-4.0.
8116 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8117 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8118 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8119 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8120 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8121 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8122 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8123 Change width of U+E0100..U+E01EF from 1 to 0.
8125 2003-04-25 Bruno Haible <bruno@clisp.org>
8127 * copy-file.c: Include <stddef.h>, for size_t.
8129 2003-04-25 Jim Meyering <jim@meyering.net>
8131 * copy-file.c (copy_file_preserving): Declare buf_size to be
8132 of type size_t, not int.
8134 2003-04-11 Jim Meyering <jim@meyering.net>
8136 Merge changes from Coreutils.
8138 2003-03-22 Jim Meyering <jim@meyering.net>
8140 * strftime.c (widen): Cast alloca return value to proper type.
8142 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8145 * strftime.c (my_strftime): Handle very large width
8146 specifications for numeric values correctly. Improve checks for
8149 2003-01-19 Jim Meyering <jim@meyering.net>
8151 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8152 (nl_get_alt_digit) [! defined my_strftime]: Define.
8153 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8154 _nl_get_alt_digit and _nl_get_walt_digit.
8156 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8157 These changes have no effect outside of _LIBC.
8159 2003-04-10 Bruno Haible <bruno@clisp.org>
8161 * findprog.h: New file, from GNU gettext.
8162 * findprog.c: New file, from GNU gettext.
8164 2003-04-05 Jim Meyering <jim@meyering.net>
8166 Merge changes from Coreutils.
8168 * exclude.h (PARAMS): Remove definition and uses.
8169 * exclude.c: Remove uses of `PARAMS'.
8171 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8172 Add test-cases for DOS filenames. Declare program_name.
8173 (main): Set up program_name. Patch by Rich Dawe.
8175 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8177 Use mntctl's return value to drive the entry-processing loop, since
8178 we can't rely on the value of the vmt_length member in the last
8179 entry. On some systems doing so could result in exhausting
8180 virtual memory. Based in part on a patch from Mike Jetzer.
8182 2003-04-04 Bruno Haible <bruno@clisp.org>
8184 * linebreak.h: New file, from GNU gettext.
8185 * linebreak.c: New file, from GNU gettext with slight modifications.
8186 * lbrkprop.h: New file, from GNU gettext.
8188 2003-04-03 Bruno Haible <bruno@clisp.org>
8190 * utf8-ucs4.h: New file, from GNU gettext.
8191 * utf16-ucs4.h: New file, from GNU gettext.
8192 * ucs4-utf8.h: New file, from GNU gettext.
8193 * ucs4-utf16.h: New file, from GNU gettext.
8195 2003-04-02 Bruno Haible <bruno@clisp.org>
8197 * binary-io.h: New file, from GNU gettext.
8199 2003-04-01 Bruno Haible <bruno@clisp.org>
8201 * pathname.h: New file, from GNU gettext.
8202 * concatpath.c: New file, from GNU gettext.
8204 2003-03-30 Bruno Haible <bruno@clisp.org>
8206 * copy-file.c (copy_file_preserving): Don't set owner if the function
8207 chown() doesn't exist.
8209 2003-03-28 Bruno Haible <bruno@clisp.org>
8211 * copy-file.h: New file, from GNU gettext.
8212 * copy-file.c: New file, from GNU gettext.
8214 2003-03-18 Jim Meyering <jim@meyering.net>
8216 * quote.c (quote_n): Fix typo in comment.
8218 2003-03-14 Jim Meyering <jim@meyering.net>
8220 Merge changes from Coreutils.
8221 * obstack.h (obstack_object_size): Declare temporary, __o,
8222 to be const, in order to avoid warnings.
8223 (obstack_room): Likewise.
8224 (obstack_empty_p): Likewise.
8226 2003-03-13 Paul Eggert <eggert@twinsun.com>
8228 Merge changes from Bison.
8229 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8230 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8231 when compiling Bison 1.875's `bitset bset = obstack_alloc
8232 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8233 * hash.c: Include <stdbool.h> unconditionally.
8235 2003-03-09 Paul Eggert <eggert@twinsun.com>
8237 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8238 Reported by Bruce Becker; see:
8239 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8241 2003-03-03 Paul Eggert <eggert@twinsun.com>
8242 Bruno Haible <bruno@clisp.org>
8244 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8245 Reported by John Hughes, see
8246 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8248 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8250 * poll_.h: New file.
8253 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8255 * mathl.h: New file.
8256 * acosl.c: New file.
8257 * asinl.c: New file.
8258 * atanl.c: New file.
8259 * ceill.c: New file.
8262 * floorl.c: New file.
8263 * frexpl.c: New file.
8264 * ldexpl.c: New file.
8266 * sincosl.c: New file.
8268 * sqrtl.c: New file.
8270 * trigl.c: New file.
8271 * trigl.h: New file.
8273 2003-02-17 Bruno Haible <bruno@clisp.org>
8275 * mkdtemp.h: New file, from GNU gettext.
8276 * mkdtemp.c: New file, from GNU gettext.
8278 2003-01-31 Bruno Haible <bruno@clisp.org>
8280 * rename.c: #undef rename before defining rpl_rename.
8281 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8283 2003-01-30 Bruno Haible <bruno@clisp.org>
8285 * printf-args.h: New file, from GNU gettext.
8286 * printf-args.c: New file, from GNU gettext.
8287 * printf-parse.h: New file, from GNU gettext.
8288 * printf-parse.c: New file, from GNU gettext.
8289 * vasnprintf.h: New file, from GNU gettext.
8290 * vasnprintf.c: New file, from GNU gettext.
8291 * asnprintf.c: New file, from GNU gettext.
8292 * vasprintf.h: New file, from GNU gettext with modifications.
8293 * vasprintf.c: New file, from GNU gettext.
8294 * asprintf.c: New file, from GNU gettext.
8296 2003-01-29 Bruno Haible <bruno@clisp.org>
8298 * stpncpy.h: New file, from GNU gettext with modifications.
8299 * stpncpy.c: New file, from GNU gettext with modifications.
8301 2003-01-28 Bruno Haible <bruno@clisp.org>
8303 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8305 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8308 2003-01-27 Bruno Haible <bruno@clisp.org>
8310 * xsetenv.h: New file, from GNU gettext.
8311 * xsetenv.c: New file, from GNU gettext.
8313 2003-01-23 Bruno Haible <bruno@clisp.org>
8315 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8317 2003-01-22 Bruno Haible <bruno@clisp.org>
8319 * exit.h: New file, from GNU gettext.
8321 2003-01-11 Bruno Haible <bruno@clisp.org>
8323 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8324 * strcase.h (strcasecmp, strncasecmp): Likewise.
8326 2003-01-14 Jim Meyering <jim@meyering.net>
8328 * same.c (same_name): Tweak a comment.
8330 2003-01-11 Bruno Haible <bruno@clisp.org>
8332 * same.c (same_name): Reorder tests so as to avoid calling stat()
8333 when a string comparison is sufficient.
8335 2003-01-11 Bruno Haible <bruno@clisp.org>
8337 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8340 2003-01-11 Bruno Haible <bruno@clisp.org>
8342 * hash-pjw.c: Add comment about low quality of this function.
8344 2003-01-12 Paul Eggert <eggert@twinsun.com>
8346 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8347 to avoid collisions with libcurses and libreadline.
8349 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8350 * getstr.h, getstr.c: Remove.
8351 * getline.c: Include "getline.h", to check interface.
8352 Move body of old getstr.c here: this defines MIN_CHUNK and
8353 declares getdelim2, which is renamed from getstr.
8354 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8356 * linebuffer.c (readlinebuffer): Renamed from readline.
8358 * linebuffer.h: Likewise.
8359 (readline): Remove backward-compatibility macro.
8361 2003-01-12 Jim Meyering <jim@meyering.net>
8363 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8365 2003-01-10 Bruno Haible <bruno@clisp.org>
8367 * alloca_.h: New file.
8368 * getdate.y: Unconditionally include alloca.h.
8369 * makepath.c: Likewise.
8370 * setenv.c: Likewise.
8371 * userspec.c: Likewise.
8373 2003-01-09 Bruno Haible <bruno@clisp.org>
8375 * stdbool.h.in: New file.
8377 2003-01-08 Bruno Haible <bruno@clisp.org>
8379 * safe-read.c: Include specification header first, to ensure its
8381 * full-write.c: Likewise.
8383 2003-01-08 Jim Meyering <jim@meyering.net>
8385 * full-write.c: Undefine and define-away `const' after inclusion
8386 of errno.h, not before. Suggestion from Bruno Haible.
8388 2003-01-07 Jim Meyering <jim@meyering.net>
8390 * full-write.c: Rework so that it may serve to define full_read, too.
8391 * full-read.c: Simply #define FULL_READ and include full-write.c.
8393 2003-01-06 Jim Meyering <jim@meyering.net>
8395 * version-etc.c: Update year in translatable copyright string.
8397 2002-12-25 Bruno Haible <bruno@clisp.org>
8399 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8400 * xstrtol.h: Likewise.
8401 * xstrtoimax.c: Likewise.
8402 * xstrtoumax.c: Likewise.
8403 * human.h: Likewise.
8405 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8406 on systems that have <inttypes.h> but not <stdint.h>.
8408 2002-12-31 Paul Eggert <eggert@twinsun.com>
8410 * memcoll.c (memcoll): Fall back on a simple algorithm using
8411 memcmp if strcoll doesn't work.
8413 2002-12-23 Bruno Haible <bruno@clisp.org>
8415 * localcharset.h: New file.
8416 * localcharset.c: Include it.
8417 * unicodeio.c: Likewise.
8419 2002-12-22 Bruno Haible <bruno@clisp.org>
8421 * utime.c (utime_null): No need to call ftruncate if the file was
8424 2002-12-23 Bruno Haible <bruno@clisp.org>
8426 * memcoll.c (STRCOLL): New macro.
8429 2002-12-22 Bruno Haible <bruno@clisp.org>
8431 * getstr.h (getstr): Define, to avoid clash with libcurses.
8432 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8434 2002-12-22 Bruno Haible <bruno@clisp.org>
8436 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8438 2002-12-23 Bruno Haible <bruno@clisp.org>
8440 * getline.h: Include <stddef.h>, for size_t.
8442 * unicodeio.h: Include <stddef.h>, for size_t.
8443 * unicodeio.c: Don't include <stddef.h>.
8445 2002-12-17 Bruno Haible <bruno@clisp.org>
8447 * canon-host.c (strdup): Remove unused declaration.
8449 * fsusage.c: Include full_read.h.
8450 (get_fs_usage): Use full_read instead of safe_read.
8452 * utime.c (utime_null): Use SAFE_READ_ERROR.
8454 2002-12-11 Bruno Haible <bruno@clisp.org>
8456 * setenv.h: Rewritten to cope with systems that have setenv() but not
8458 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8461 2002-12-11 Bruno Haible <bruno@clisp.org>
8463 * setenv.c (alloca): Fall back to malloc.
8465 (setenv): Use freea() to free memory allocated with alloca().
8467 2002-11-13 Bruno Haible <bruno@clisp.org>
8469 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8470 function declarations.
8471 * unsetenv.c (unsetenv): Likewise.
8473 2002-03-04 Bruno Haible <bruno@clisp.org>
8475 Portability to AIX 4.3.3.
8476 * unsetenv.c: New file, extracted from setenv.c.
8477 * setenv.c: Move the unsetenv() function to unsetenv.c.
8479 2001-12-20 Bruno Haible <bruno@clisp.org>
8481 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8482 use malloc instead. For SunOS 4.
8484 2001-12-11 Bruno Haible <bruno@clisp.org>
8486 * setenv.c: Declare alloca.
8487 (compar_fn_t): New typedef.
8488 (KNOWN_VALUE, STORE_VALUE): Use it.
8490 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8493 2002-12-10 Paul Eggert <eggert@twinsun.com>
8495 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8496 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8497 Choose values that are less likely to collide with system fnmatch
8499 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8500 defined (e.g., a pure POSIX system).
8501 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8502 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8504 2002-12-06 Jim Meyering <jim@meyering.net>
8506 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8508 Merge in changes from libc's misc/error.c, in preparation
8509 for the merge of gnulib's changes back into libc.
8511 * error.c (_): Define only if not already defined.
8512 Move definition to follow all #include directives.
8513 Include unlocked-io.h only if !_LIBC.
8514 [_LIBC]: Include <libio/libioP.h>.
8515 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8516 (fflush): Tweak definition to use INTUSE.
8519 2002-12-05 Paul Eggert <eggert@twinsun.com>
8521 * alloca.c [defined emacs]: Include "lisp.h".
8522 (xalloc_die) [defined emacs]: New macro.
8523 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8524 [! defined emacs]: Include <xalloc.h>.
8525 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8526 (pointer): Typedef to POINTER_TYPE *.
8527 (malloc): Remove decl; we now always use xmalloc.
8528 (alloca): Use old-style definition, since Emacs needs this.
8529 Check for arithmetic overflow when computing combined size.
8531 2002-12-04 Paul Eggert <eggert@twinsun.com>
8533 Do not generate unlocked-io.h automatically, since it's easier to
8534 maintain it by hand.
8536 * unlocked-io.h: New file, from GNU diffutils,
8537 but with proper copyright notice and attribution.
8539 * Makefile.am: Add copyright notice.
8540 (libfetish_a_SOURCES): Add unlocked-io.h.
8541 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8542 (DISTCLEANFILES, io_functions): Remove macros.
8543 (EXTRA_DIST): Remove gen_uio.
8544 (unlocked-io.h): Remove rule.
8546 2002-12-04 Jim Meyering <jim@meyering.net>
8548 Reflect the fact that stat.c and lstat.c are no longer generated.
8549 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8550 (DISTCLEANFILES): Likewise.
8551 (EXTRA_DIST): Likewise.
8552 (all_local): Don't depend on stat.c or lstat.c.
8553 (stat.c, lstat.c): Remove rules.
8554 (EXTRA_DIST): Remove xstat.in.
8556 * xstat.in: Remove file. Contents moved into stat.c.
8557 * stat.c: New file. Contents mostly from xstat.in.
8558 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8559 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8561 * safe-read.c: Rework so that it may serve to define safe_write, too.
8562 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8564 2002-12-03 Jim Meyering <jim@meyering.net>
8566 * safe-read.c, safe-write.c: Change variable names and comments, but
8567 not semantics, to minimize the differences between these two files.
8568 (safe_read): Change comment to mention SAFE_READ_ERROR.
8570 * safe-read.c (IS_EINTR): Define.
8571 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8573 2002-12-02 Bruno Haible <bruno@clisp.org>
8575 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8576 Define, taken from safe-read.c.
8577 (INT_MAX): Provide fallback.
8578 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8579 * safe-write.h (SAFE_WRITE_ERROR): Define.
8581 * safe-read.c (EINTR): Remove definition.
8582 (safe_read): Don't use EINTR if it is absent.
8584 2002-12-02 Jim Meyering <jim@meyering.net>
8586 * safe-read.c (EINTR): Define.
8587 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8588 (INT_MAX): Provide fallback.
8589 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8591 * safe-read.h (SAFE_READ_ERROR): Define.
8593 2002-12-01 Jim Meyering <jim@meyering.net>
8595 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8596 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8598 2002-11-27 Paul Eggert <eggert@twinsun.com>
8600 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8601 hash_rehash): Replace `if (limit <= value) abort ();' with
8602 `if (! (value < limit)) abort ();', for readability.
8604 2002-11-26 <karl@gnu.org>
8606 * strdup.c: copy from libc again, with jim's ok.
8607 * .cppi-disable: re-add strdup.c
8609 2002-11-25 <karl@gnu.org>
8611 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8612 instead of "strtol.c".
8614 2002-11-25 Jim Meyering <jim@meyering.net>
8616 * mktime.c: Sync from libc, now that it has the latest fix.
8618 2002-11-24 <karl@gnu.org>
8620 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8621 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8623 2002-11-24 Jim Meyering <jim@meyering.net>
8625 Update from coreutils:
8627 * mktime.c: Merge in changes from libc.
8629 Avoid a link-time failure on some Linux systems.
8630 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8631 (__mon_yday): Declare with the STATIC attribute.
8632 (__mktime_internal): Likewise.
8633 Based on a report from Greg Schafer.
8635 2002-11-23 Jim Meyering <jim@meyering.net>
8637 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8638 Use `unsigned', not `int', as type of index.
8640 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8642 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8644 2002-11-22 Paul Eggert <eggert@twinsun.com>
8646 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8647 hint that one should use `if (! x) abort ();' rather than `assert
8648 (x);', and anyway it's one less thing to worry about configuring.
8649 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8650 hash_rehash, hash_insert): Use abort rather than assert.
8652 2002-11-22 Paul Eggert <eggert@twinsun.com>
8654 * quotearg.h: Allow multiple inclusion by surrounding with
8655 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8656 so that we can be included first.
8657 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8658 * quotearg.c: Include quotearg.h immediately after config.h.
8659 No need to include stddef.h or sys/types.h any more.
8660 Surround local include files with "", not "<>".
8661 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8662 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8663 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8664 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8665 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8666 (ISPRINT): Remove; no longer needed now that we assume C89.
8668 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8671 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8672 quotearg_char): Use SIZE_MAX rather than
8673 (size_t) -1 when we are talking about "infinity".
8675 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8677 2002-11-22 Bruno Haible <bruno@clisp.org>
8679 * safe-read.h: Assume C89. Add comments.
8680 (safe_read): Change return type to size_t.
8681 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8682 counts > SSIZE_MAX correctly.
8683 * safe-write.h: New file.
8684 * safe-write.c: New file.
8685 * full-read.h: New file.
8686 * full-read.c: New file.
8687 * full-write.h: Assume C89. Add comments.
8688 * full-write.c: Include safe-write.h.
8689 (full_write): Rewritten to use safe_write.
8690 Suggested by Jim Meyering and Paul Eggert.
8692 2002-11-21 Bruno Haible <bruno@clisp.org>
8694 Remove case insensitive option matching.
8695 * argmatch.h (argcasematch): Remove declaration.
8696 (ARGCASEMATCH): Remove macro.
8697 (__xargmatch_internal): Remove case_sensitive argument.
8698 (XARGMATCH): Update.
8699 (XARGCASEMATCH): Remove macro.
8700 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8701 case_sensitive argument.
8702 (argcasematch): Remove function.
8703 (__xargmatch_internal): Remove case_sensitive argument.
8704 (main): Use XARGMATCH instead of XARGCASEMATCH.
8706 * xmalloc.c: Change compile-time error message. Add comment about
8707 required autoconf version.
8709 2002-11-21 Jim Meyering <jim@meyering.net>
8711 * strdup.c (strdup): Tweak comment and initial #if/#include.
8713 Merge in changes from the coreutils.
8715 2002-09-25 Paul Eggert <eggert@twinsun.com>
8716 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8717 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8718 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8719 int. Work more efficiently if X is the same width as uintmax_t.
8720 Do not compare X to -1, to avoid bogus compiler warning.
8721 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8722 Don't assume that f_frsize and f_bsize are the same type.
8724 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8727 * makepath.c (make_path): Restore umask *before* creating the final
8729 (make_path): Minor reformatting.
8731 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8732 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8734 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8735 ones. At least on GNU/Linux systems, `auto' means something else.
8738 2002-11-20 Paul Eggert <eggert@twinsun.com>
8740 Merge argmatch cleanups from Bison. Assume C89.
8742 * argmatch.c: Include config.h here, not in argmatch.h.
8743 Include stdlib.h, for EXIT_FAILURE.
8744 Always include <string.h>, since we assume C89.
8745 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8746 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8747 Include <stddef.h> instead, since it's all we need for size_t.
8748 (PARAMS): Remove. All uses removed.
8749 (ARRAY_CARDINALITY): Do not bother to #undef.
8750 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8751 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8752 Remove unnecessary parentheses.
8753 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8754 Insert necessary parentheses.
8755 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8756 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8758 2002-11-19 Bruno Haible <bruno@clisp.org>
8760 * mbswidth.c: Include mbswidth.h right at the beginning.
8761 * mbswidth.h: Include <stddef.h>, for size_t.
8763 * mbswidth.h (PARAMS): Remove macro.
8764 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8765 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8767 * gcd.h (PARAMS): Remove macro.
8768 (gcd): Use ANSI C function declarations.
8769 * gcd.c (gcd): Likewise.
8771 2002-11-15 Bruno Haible <bruno@clisp.org>
8773 * strcspn.c: Include <stddef.h>.
8774 (strcspn): Use ANSI C function declaration. Change return type to
8776 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8777 (strpbrk): Use NULL.
8778 * strpbrk.h (PARAMS): Remove macro.
8779 (strpbrk): Use ANSI C function declaration.
8780 * strstr.c: Don't include <sys/types.h>.
8781 * strstr.h (PARAMS): Remove macro.
8782 (strstr): Use ANSI C function declarations.
8784 2002-11-06 Bruno Haible <bruno@clisp.org>
8786 * gcd.h (gcd): Change argument type to 'unsigned long'.
8787 * gcd.c (gcd): Likewise.
8789 2002-11-05 Bruno Haible <bruno@clisp.org>
8791 * gcd.h: New file, from gettext-0.11.5.
8792 * gcd.c: New file, from gettext-0.11.5.
8794 2002-11-05 Bruno Haible <bruno@clisp.org>
8796 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8797 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8798 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8799 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8801 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8802 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8804 * closeout.c: Include gettext.h instead of <libintl.h>.
8805 * human.c: Include gettext.h instead of <libintl.h>.
8806 * quotearg.c: Include gettext.h instead of <libintl.h>.
8807 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8808 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8809 * userspec.c: Include gettext.h instead of <libintl.h>.
8810 * version-etc.c: Include gettext.h instead of <libintl.h>.
8811 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8812 (textdomain): Remove definition.
8813 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8815 * long-options.c: Remove include of <libintl.h> and definition of _.
8816 * same.c: Remove include of <libintl.h> and definition of _.
8818 2002-11-04 Bruno Haible <bruno@clisp.org>
8820 * stpcpy.h: New file, from GNU gettext-0.11.5.
8821 * strcase.h: New file, from GNU gettext-0.11.5.
8822 * strpbrk.h: New file, from GNU gettext-0.11.5.
8823 * strstr.h: New file, from GNU gettext-0.11.5.
8824 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8826 2002-05-09 Bruno Haible <bruno@clisp.org>
8828 * config.charset: Update for newest glibc. Add canonical names
8829 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8831 2002-05-09 Bruno Haible <bruno@clisp.org>
8833 * localcharset.c (get_charset_aliases): Add more Windows specific
8836 2002-05-08 Owen Taylor <otaylor@redhat.com>
8838 * config.charset: A few additions for Solaris.
8840 2001-12-05 Bruno Haible <bruno@clisp.org>
8842 * localcharset.c (locale_charset): Don't return an empty string.
8844 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8846 * config.charset: msdos in uk_UA uses CP1125.
8848 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8850 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8851 * localcharset.c (locale_charset): Declare as extern "C".
8853 2002-02-15 Bruno Haible <bruno@clisp.org>
8855 * config.charset [msdosdjgpp]: For Russian, use CP866.
8857 2002-02-11 Bruno Haible <bruno@clisp.org>
8859 * config.charset: Add support for NetBSD.
8861 2002-09-25 <karl@gnu.org>
8863 * strdup.c: copy from libc/string (via ../config/srclist*).
8864 * getopt*: copy from libc/posix.
8865 * gettext.h: copy from gettext.
8866 * .cppi-disable: add strdup.c, gettext.h.
8868 2002-07-01 Jim Meyering <meyering@lucent.com>
8870 * c-stack.c: Include sys/time.h.
8871 From Volker Borchert.
8873 2002-06-11 Paul Eggert <eggert@twinsun.com>
8875 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8876 New macro. Use it uniformly instead of
8877 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8878 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8879 reported by Vin Shelton.
8881 2002-06-22 Jim Meyering <meyering@lucent.com>
8883 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8884 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8886 2002-06-22 Paul Eggert <eggert@twinsun.com>
8888 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8889 Do not assume SA_SIGINFO behavior.
8890 Bug reported by Jim Meyering on NetBSD 1.5.2.
8892 2002-06-22 Jim Meyering <meyering@lucent.com>
8894 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8896 * exitfail.c, exitfail.h: Likewise.
8897 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8899 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8901 (EXTRA_DIST): Add fnmatch_loop.c.
8902 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8904 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8905 * fnmatch.c: Update from diffutils-2.8.2.
8906 * fnmatch_.h: New file. From diffutils-2.8.2.
8907 * fnmatch.h: Remove file.
8909 2002-06-18 Paul Eggert <eggert@twinsun.com>
8911 * file-type.h: Report an error if neither S_ISREG nor
8912 S_IFREG is defined, instead of using a test specific to glibc
8913 2.2. This should be safe, since POSIX requires S_ISREG and
8914 Unix Version 7 had S_IFREG. We don't need to check for
8915 <sys/types.h> since we don't use any symbols that it defines.
8917 2002-06-15 Jim Meyering <meyering@lucent.com>
8919 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8920 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8921 have been included before this file.
8923 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8925 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8926 so that each temporary file name is unique and valid in the first
8927 8 characters, for operation under DOS.
8929 2002-06-15 Jim Meyering <meyering@lucent.com>
8931 Work even with DJGPP 2.03, which lacks support for symlinks.
8933 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8935 * lchown.c (S_ISLNK): Likewise.
8937 2002-06-14 Jim Meyering <meyering@lucent.com>
8939 * file-type.h: Use the version from diffutils-2.8.2.
8940 * file-type.c: Likewise.
8942 2002-05-27 Jim Meyering <meyering@lucent.com>
8944 Fix a problem seen only on nonconforming systems whereby ls.c's
8945 use of localtime, and then of gettimeofday would cause trouble:
8946 the localtime call used to initialize rpl_gettimeofday's save
8947 mechanism would clobber ls's current local time information so
8948 that in any long listing the first file would always be listed
8949 with date 1970-01-01. Analysis by Volker Borchert.
8951 * gettimeofday.c (localtime): Undefine.
8952 (rpl_localtime): New function.
8954 2002-05-22 Jim Meyering <meyering@lucent.com>
8956 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8957 * file-type.h: New file.
8958 * file-type.c (file_type): New file/function. Extracted from diffutils.
8960 2002-04-29 Paul Eggert <eggert@twinsun.com>
8962 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8964 2002-04-28 Paul Eggert <eggert@twinsun.com>
8966 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8967 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8968 of 127, since 64 is the largest conceivable number for ancient
8970 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8972 2002-04-28 Jim Meyering <meyering@lucent.com>
8974 * sig2str.c (WTERMSIG): Remove definition (unused).
8976 2002-04-28 Paul Eggert <eggert@twinsun.com>
8978 * sig2str.h, sig2str.c: New files.
8979 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8981 2002-04-24 Jim Meyering <meyering@lucent.com>
8983 * gettext.h: New file, from Gettext.
8984 * Makefile.am (INCLUDES): Remove -I../intl.
8985 (libfetish_a_SOURCES): Add gettext.h.
8987 2002-04-16 Jim Meyering <meyering@lucent.com>
8989 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8990 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8991 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8993 2002-04-12 Jim Meyering <meyering@lucent.com>
8995 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8997 2002-03-10 Jim Meyering <meyering@lucent.com>
8999 * makepath.c (make_path): Remove a comma from a diagnostic.
9000 Suggestion from Santiago Vila.
9002 2002-03-08 Jim Meyering <meyering@lucent.com>
9004 * rename.c: Mention that this wrapper is needed also on
9005 mips-dec-ultrix4.4 systems.
9007 2002-03-02 Jim Meyering <meyering@lucent.com>
9009 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
9010 not HAVE_CLOCK_SETTIME.
9012 2002-02-27 Paul Eggert <eggert@twinsun.com>
9014 * nanosleep.h: Rename to....
9015 * timespec.h: New name for nanosleep.h. All uses changed.
9017 * gettime.c: New file.
9018 * settime.c: New file.
9021 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9022 timespec.h. Remove nanosleep.h.
9024 2002-02-25 Paul Eggert <eggert@twinsun.com>
9026 * acl.c, acl.h: New files.
9027 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9029 2002-02-24 Jim Meyering <meyering@lucent.com>
9031 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9032 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9033 cause trouble. Reported by Nelson Beebe.
9035 2002-02-23 Paul Eggert <eggert@twinsun.com>
9037 * path-concat.c (xpath_concat): Reorder code to pacify
9038 compilers that don't know that xalloc_die never returns.
9040 2002-02-20 Jim Meyering <meyering@lucent.com>
9042 * getdate.c: Regenerate using bison-1.33.
9044 2002-02-15 Paul Eggert <eggert@twinsun.com>
9046 * posixver.c, posixver.h: New files.
9047 * Makefile.am (libfetish_a_SOURCES): Add them.
9049 2002-02-02 Paul Eggert <eggert@twinsun.com>
9050 Bruno Haible <bruno@clisp.org>
9052 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9053 (fwrite_success_callback): New declaration.
9054 * unicodeio.c (unicode_to_mb): New function, extracted from
9055 print_unicode_char. Call failure callback instead of error.
9056 (fwrite_success_callback): New function.
9057 (exit_failure_callback): New function.
9058 (fallback_failure_callback): New function.
9059 (print_unicode_char): Call unicode_to_mb.
9061 2002-01-26 Jim Meyering <meyering@lucent.com>
9063 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9065 2002-01-22 Jim Meyering <meyering@lucent.com>
9067 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9068 Otherwise, some versions of automake would omit the rule that makes
9069 Makefile from Makefile.in.
9071 2001-01-21 Paul Eggert <eggert@twinsun.com>
9073 * xmemcoll.h, xmemcoll.c: New files.
9074 * Makefile.am (libfetish_a_SOURCES): Add them.
9075 * memcoll.c: Include errno.h, and declare errno if not defined.
9076 (memcoll): Set errno to zero if there is no error.
9078 * quotearg.c (quotearg_buffer_restyled):
9079 Fix bug with quoting buffers containing NUL when backslashing escapes.
9080 This bug was exposed by the other changes in this patch.
9081 (quotearg_n_options): New arg ARGSIZE.
9082 All callers changed.
9083 (quoting_options_from_style): New function.
9084 (quotearg_n_style): Use it.
9085 (quotearg_n_style_mem): New function.
9087 * quotearg.h (quotearg_n_style_mem): New function.
9089 2002-01-16 Jim Meyering <meyering@lucent.com>
9091 * getdate.y: Add three semicolons, each just before a closing brace.
9092 Bison (as of version 1.31) no longer papers over that mistake.
9094 2002-02-14 Paul Eggert <eggert@twinsun.com>
9096 * backupfile.c (ISDIGIT): Comment fix.
9097 * getdate.y (ISDIGIT): Likewise.
9098 * posixtm.c (ISDIGIT, year): Likewise.
9099 * strverscmp.c (ISDIGIT): Likewise.
9100 * userspec.c (ISDIGIT): Likewise.
9102 2002-01-05 Jim Meyering <meyering@lucent.com>
9104 * version-etc.c (version_etc_copyright): Update copyright year.
9106 2001-01-19 Paul Eggert <eggert@twinsun.com>
9108 * closeout.c (close_stdout_status): If ferror (stdout), do
9109 not silently exit merely because the output buffer happens to
9110 have nothing pending.
9112 2001-12-18 Paul Eggert <eggert@twinsun.com>
9114 See the big note in ../ChangeLog.
9115 * human.c (suffixes): Prefer K to k for 1024.
9116 (generate_suffix_backwards): New function.
9117 (human_readable_inexact): Use it.
9118 * xstrtol.c (__xstrtol): If there is no number but there
9119 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9120 Accept 'K' as well as 'k'.
9122 2001-12-15 Jim Meyering <meyering@lucent.com>
9124 * regex.h (__restrict_arr): Update from libc.
9126 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9127 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9130 2001-12-10 Jim Meyering <meyering@lucent.com>
9132 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9133 Instead, include "xalloc.h".
9134 (initbuffer): Don't cast xmalloc return value to char*.
9135 (readline): Reword comment.
9136 Don't cast xrealloc return value to char*
9139 2001-12-09 Jim Meyering <meyering@lucent.com>
9141 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9142 `signed and unsigned type in conditional expression'.
9143 * posixtm.c (posix_time_parse): Likewise.
9145 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9147 * readtokens.c (readtoken): Declare an index to be of type unsigned
9148 to avoid a pedantic warning.
9150 * getstr.c: Don't include assert.h.
9151 (getstr): Remove warning-evoking assertions.
9152 Return -1 if offset parameter is out of bounds.
9153 Change the type of a local from int to size_t.
9155 * strftime.c (my_strftime_localtime_r): Include this function
9156 definition in the `#if ! HAVE_TM_GMTOFF' block.
9158 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9159 Include xalloc.h instead.
9161 2001-12-02 Jim Meyering <meyering@lucent.com>
9163 * tempname.c: Don't declare getenv, thus reverting the change of
9164 2001-11-18. It's no longer necessary, now that stdlib.h is always
9167 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9168 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9170 2001-11-30 Akim Demaille <akim@epita.fr>
9172 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9173 before being defined.
9175 2001-11-27 Paul Eggert <eggert@twinsun.com>
9177 * quotearg.h (quotearg_n, quotearg_n_style):
9178 First arg is int, not unsigned.
9179 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9180 (SIZE_MAX, UINT_MAX): New macros.
9181 (quotearg_n_options): Abort if N is negative.
9182 Avoid overflow check on hosts where size_t is 64 bits and int
9183 is 32 bits, as overflow is impossible there.
9184 Fix off-by-one typo that caused unnecessary reallocation.
9186 2001-11-27 Jim Meyering <meyering@lucent.com>
9188 * tempname.c: Merge with version from libc.
9189 * regex.c: Likewise.
9191 * tempname.c: Include stdlib.h unconditionally. On some old systems
9192 for which STDC_HEADERS is 0, it was not included, resulting in a
9193 warning about an integer-to-pointer conversion problem with getenv.
9194 Reported by Volker Borchert.
9196 2001-11-26 Jim Meyering <meyering@lucent.com>
9198 * gtod.h: Remove file.
9199 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9200 * gettimeofday.c: Don't include gtod.h.
9201 (GTOD_init): Remove function.
9202 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9203 Suggestion from Volker Borchert.
9205 2001-11-23 Jim Meyering <meyering@lucent.com>
9207 * hash.h (struct hash_table): Don't define here. Merely declare it.
9208 * hash.c (struct hash_table): Define it here instead.
9210 2001-11-22 Jim Meyering <meyering@lucent.com>
9212 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9214 2001-11-18 Paul Eggert <eggert@twinsun.com>
9216 * tempname.c (TMP_MAX): Remove; no longer needed.
9217 (TEMPORARIES): New macro.
9218 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9219 removes an artificial limitation (e.g. HP-UX 10.20, where
9222 2001-11-18 Jim Meyering <meyering@lucent.com>
9224 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9227 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9228 files will be created before anything else.
9230 2001-11-17 Jim Meyering <meyering@lucent.com>
9232 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9233 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9234 rather than group writable. Patch by Juan F. Codagnone.
9236 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9237 Instead, include "xalloc.h".
9239 * mountlist.c: Include unlocked-io.h after all system headers.
9240 Remove explicit declarations of xmalloc, xrealloc,
9241 and xstrdup. Instead, include "xalloc.h".
9243 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9244 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9245 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9247 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9248 Reported by Padraig Brady.
9250 * mkstemp.c: #undef mkstemp.
9252 (rpl_mkstemp): Rename from mkstemp.
9255 2001-11-16 Jim Meyering <meyering@lucent.com>
9257 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9258 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9259 determine the amount of total physical memory, use pstat_getstatic.
9260 HPUX-11 doesn't define _SC_PHYS_PAGES.
9261 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9262 If sysconf couldn't be used to determine the amount of available
9263 physical memory, use both pstat_getstatic and pstat_getdynamic.
9264 Based on a patch from Bob Proulx.
9266 2001-11-05 Jim Meyering <meyering@lucent.com>
9268 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9270 2001-11-03 Jim Meyering <meyering@lucent.com>
9272 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9273 in argmatch_to_argument call.
9275 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9278 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9279 e.g., a fault due to an attempt to free a NULL pointer.
9281 2001-11-01 Jim Meyering <meyering@lucent.com>
9283 * dirfd.c, dirfd.h: New files.
9284 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9286 * hash.c (hash_print) [TESTING]: Clean up.
9288 2001-10-22 Paul Eggert <eggert@twinsun.com>
9290 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9291 to avoid a warning if -Wall.
9293 2001-10-21 Paul Eggert <eggert@twinsun.com>
9295 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9297 2001-10-21 Jim Meyering <meyering@lucent.com>
9299 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9300 this code would end up calling gettext even in packages built
9302 * getopt.c (_): Likewise.
9303 * regex.c (_): Likewise.
9305 2001-10-20 Paul Eggert <eggert@twinsun.com>
9307 * error.c (strerror_r): Do not declare unless !_LIBC.
9308 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9309 Use strerror_r that is only a macro, even if it is not a function.
9310 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9311 (private_strerror): Use prototypes, not old-style function definition.
9312 (print_errno_message): New function.
9313 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9315 (error_tail, error, error_at_line): Use it.
9317 2001-10-11 Jim Meyering <meyering@lucent.com>
9319 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9320 and quote_n (1, ... to avoid clobbering a buffer.
9322 2001-10-05 Jim Meyering <meyering@lucent.com>
9324 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9325 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9326 * hash-pjw.h: New file.
9328 2001-09-30 Jim Meyering <meyering@lucent.com>
9330 * mountlist.c [MOUNTED_GETFSSTAT]:
9331 Include <sys/ucred.h>, for Apple Darwin.
9332 Include sys/mount.h and sys/fs_types.h only if available.
9334 (read_filesystem_list): Use FS_TYPE.
9336 2001-09-29 Paul Eggert <eggert@twinsun.com>
9338 * exclude.c (excluded_filename): 0 -> false, since it's
9341 2001-09-28 Paul Eggert <eggert@twinsun.com>
9343 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9344 #defines strtoimax. Also treat the other strto* functions
9347 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9348 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9349 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9351 2001-09-26 Jim Meyering <meyering@lucent.com>
9353 Most macros in unlocked-io.h had the wrong number of arguments.
9354 * gen-uio: New script.
9355 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9356 * unlocked-io.hin: Remove file.
9357 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9358 rather than trying to embed it here.
9359 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9360 Reported by Padraig Brady.
9362 2001-09-25 Volker Borchert <bt@teknon.de>
9364 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9366 2001-09-23 Jim Meyering <meyering@lucent.com>
9368 * mountlist.c: Remove useless parentheses in #if directives.
9369 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9370 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9372 2001-09-22 Jim Meyering <meyering@lucent.com>
9374 * localcharset.c: Update from latest gettext.
9375 * config.charset: Likewise.
9377 2001-09-20 Jim Meyering <meyering@lucent.com>
9379 * xstrtol.c (strtoimax): Guard declaration with
9380 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9381 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9382 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9383 (strtoumax): Likewise, for completeness (it wasn't necessary).
9385 2001-09-06 Paul Eggert <eggert@twinsun.com>
9387 * strtoimax.c (HAVE_LONG_LONG):
9388 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9389 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9390 to work around bug in IBM C compiler.
9392 2001-09-16 Jim Meyering <meyering@lucent.com>
9394 * mkdir.c: New file.
9396 2001-09-04 Paul Eggert <eggert@twinsun.com>
9398 * xgetcwd.c: Revert some of the previous change; intead,
9399 fix the HAVE_GETCWD_NULL code to behave more like the
9400 !HAVE_GETCWD_NULL code used to.
9403 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9406 2001-09-04 Paul Eggert <eggert@twinsun.com>
9408 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9409 Use ssize_t, not int, to store result of readlink.
9410 Check for ssize_t overflow as well as size_t overflow,
9411 as POSIX says the result of readlink is implementation-defined
9412 when ssize_t overflows.
9413 Remove unnecessary cast to char*.
9414 Use free+malloc instead of realloc, as the storage doesn't need
9415 to be preserved and it's clearer and can be more efficient that way.
9416 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9417 * xreadlink.h (xreadlink): Update prototype.
9419 2001-09-03 Paul Eggert <eggert@twinsun.com>
9421 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9422 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9423 spotted by Jim Meyering.
9425 2001-09-03 Jim Meyering <meyering@lucent.com>
9427 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9429 2001-09-03 Paul Eggert <eggert@twinsun.com>
9431 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9432 like the HAVE_GETCWD_NULL code.
9433 Include pathmax.h if not HAVE_GETCWD.
9434 Do not include xalloc.h.
9435 (INITIAL_BUFFER_SIZE): New symbol.
9436 Do not use xmalloc / xrealloc, since the caller is responsible for
9437 handling errors. Preserve errno around `free' during failure.
9438 Do not overrun buffer when using getwd.
9440 2001-09-03 Paul Eggert <eggert@twinsun.com>
9442 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9443 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9445 2001-09-02 Jim Meyering <meyering@lucent.com>
9447 * error.c: Update from GNU libc.
9449 2001-09-01 Jim Meyering <meyering@lucent.com>
9451 * xreadlink.c: New file.
9452 * xreadlink.h: New file.
9453 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9455 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9456 doesn't conflict with sparc Solaris 7's definition in
9457 /usr/include/sys/int_types.h.
9459 * exclude.c: Use `""', not `<>' to #include non-system header files.
9460 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9461 and strncasecmp as r-values. Unixware didn't have declarations.
9463 2001-08-31 Jim Meyering <meyering@lucent.com>
9465 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9466 Use an initial, malloc'd, buffer of length 128 rather than
9467 a statically allocated one of length 1024.
9469 2001-08-30 Paul Eggert <eggert@twinsun.com>
9471 * xgetcwd.c: Don't include pathmax.h.
9472 Include stdlib.h and unistd.h if available.
9474 (xmalloc, xstrdup, free): Remove decls.
9475 (xgetcwd): Don't assume sizes fit in unsigned.
9476 Check for overflow when computing sizes.
9477 Simplify reallocation code.
9479 2001-08-28 Paul Eggert <eggert@twinsun.com>
9481 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9483 * strtoimax.c: Renamed from strtoxmax.c, removing the
9486 Also, make the following further changes to make this file's
9487 configuration more similar to that of strtol.c:
9488 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9489 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9490 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9491 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9492 changed to signed values.
9494 And make the following changes as well:
9495 Fix copyright notice, as 1999 was missing.
9496 (verify): New macro.
9497 (strtoimax): Check sizes at compile-time, not run-time.
9498 Prefer strtol to strtoll if both work.
9499 (main): Remove; it was not that useful and was a pain to maintain.
9501 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9503 2001-08-30 Paul Eggert <eggert@twinsun.com>
9505 * savedir.c (savedir): Remove size parameter, as POSIX says that
9506 a directory's st_size can have an arbitrary value, so the old
9507 usage could waste an arbitrary amount of memory. All uses
9509 * savedir.h: Update prototype.
9511 2001-08-30 Paul Eggert <eggert@twinsun.com>
9513 * xstrtol.c (strtoimax): New decl.
9515 2001-08-28 Paul Eggert <eggert@twinsun.com>
9517 * xstrtol.h: Add copyright notice.
9518 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9519 LONGINT_INVALID_SUFFIX_CHAR.
9521 2001-08-30 Paul Eggert <eggert@twinsun.com>
9523 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9526 2001-08-30 Paul Eggert <eggert@twinsun.com>
9528 * hash.c: Remove '2001' from copyright notice.
9530 2001-08-30 Paul Eggert <eggert@twinsun.com>
9532 * full-write.h: New file.
9533 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9534 * full-write.c: Correct credits, as cccp.c no longer
9535 exists and anyway it was so heavily changed from the old cccp
9536 code as to be unrecognizable. Include full-write.h.
9537 (full_write) Return size_t, with short writes meaning failure.
9538 All callers changed. This fixes a bug with large buffers
9540 * utime.c: Include full-write.h.
9542 2001-08-30 Paul Eggert <eggert@twinsun.com>
9544 Merge 'exclude' changes from tar 1.13.22.
9545 This fixes one or two unlikely storage allocation overflow bugs,
9546 but doesn't change user-visible behavior otherwise.
9548 2001-08-30 Paul Eggert <eggert@twinsun.com>
9550 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9551 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9552 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9553 Include if available.
9554 (<xalloc.h>): Include
9555 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9556 (verify): New macro. Use it to verify that EXCLUDE macros do not
9557 collide with FNM macros.
9558 (struct patopts): New struct.
9559 (struct exclude): Use it, as exclude patterns now come with options.
9560 (new_exclude): Support above changes.
9561 (new_exclude, add_exclude_file):
9562 Initial size must now be a power of two to simplify overflow checking.
9563 (free_exclude, fnmatch_no_wildcards): New function.
9564 (excluded_filename): No longer requires options arg, as the options
9565 are determined by add_exclude. Now returns bool, not int.
9566 (excluded_filename, add_exclude):
9567 Add support for the fancy new exclusion options.
9568 (add_exclude, add_exclude_file): Now takes int options arg.
9569 Check for arithmetic overflow when computing sizes.
9570 (add_exclude_file): xrealloc might modify errno, so don't
9571 realloc until after errno might be used.
9573 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9575 (free_exclude): New decl.
9576 (add_exclude, add_exclude_file): Now takes int options arg.
9577 (excluded_filename): No longer requires options arg, as the options
9578 are determined by add_exclude. Now returns bool, not int.
9580 2001-08-30 Paul Eggert <eggert@twinsun.com>
9582 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9584 2001-08-27 Jim Meyering <meyering@lucent.com>
9586 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9588 * version-etc.c (N_): Remove definition.
9589 Revert most of last change.
9590 Instead, simply don't mark the `Copyright...' string for translation.
9591 Based on advice from Paul Eggert.
9593 * strtoxmax.c: Tweak comment.
9595 2001-08-26 Jim Meyering <meyering@lucent.com>
9597 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9598 of copyright with `%s' so translators don't get an untranslated
9600 (COPYRIGHT_YEAR): Define.
9601 (version_etc): Use fprintf rather than fputs.
9602 Suggestion from Ulrich Drepper.
9604 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9606 * strtoll.c: New file, from GNU libc.
9607 * xstrtoimax.c: New file.
9609 * xstrtol.h: Add xstrtoimax.
9610 * strtoumax.c: New file. Simply include "strtoumax.c".
9611 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9613 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9614 * strtoxmax.c: ... then renamed to this.
9616 2001-08-13 Paul Eggert <eggert@twinsun.com>
9618 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9619 Port to Solaris 8, where 'sed' requires a space after the 'r'
9620 command, and where sh dislikes "$/". Clean up the spacing a bit.
9621 Redirect output to $tmp just once.
9623 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9625 * addext.c (<errno.h>): Include.
9626 (errno): Declare if not defined.
9627 (addext): Work correctly when pathconf returns -1 and leaves
9628 errno alone because there is no limit. Also, work even if
9629 pathconf returns a value greater than SIZE_MAX.
9631 2001-08-12 Jim Meyering <meyering@lucent.com>
9633 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9634 Simply `return getcwd (NULL, 0);'.
9635 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9636 Use 1300 as initial value for length, not PATH_MAX.
9638 * pathmax.h: Clean up cpp syntax.
9640 2001-08-12 Jim Meyering <meyering@lucent.com>
9642 * gettimeofday.c: New file.
9644 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9646 2001-08-04 Jim Meyering <meyering@lucent.com>
9648 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9649 to get in sync with glibc.
9651 2001-08-03 Paul Eggert <eggert@twinsun.com>
9653 The following changes are from gettext 0.10.39 as maintained by
9656 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9657 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9658 with inverted sense. All uses changed.
9660 * mbswidth.c: Don't include <limits.h>.
9661 Include <stdlib.h> and <string.h> unconditionally.
9662 (iswcntrl, mbsinit, ISCNTRL): New macros.
9663 (mbsnwidth): Use K&R style function declarations.
9664 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9665 can optimize it when MB_CUR_MAX == 1.
9666 The width of control characters is zero, not 1.
9668 2001-07-15 Jim Meyering <meyering@lucent.com>
9670 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9671 (BUILT_SOURCES): Add unlocked-io.h.
9672 (io_functions): Define.
9673 (unlocked-io.h): New rule.
9674 (DISTCLEANFILES): Add unlocked-io.h.
9675 (all-local): Depend on unlocked-io.h, to ensure it is created.
9677 * unlocked-io.hin: New file
9679 * regex.c: Update from glibc.
9681 2001-07-05 Jim Meyering <meyering@lucent.com>
9683 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9685 (libfetish_a_SOURCES): Put all .h files here instead.
9686 Remove a thus-exposed (better checks in automake) duplicate and
9687 two unnecessary .h files.
9689 2001-06-11 Jim Meyering <meyering@lucent.com>
9691 * regex.c: Update from GNU libc.
9693 2001-05-27 Jim Meyering <meyering@lucent.com>
9695 * readutmp.h (UT_TYPE): Define.
9697 2001-05-24 Jim Meyering <meyering@lucent.com>
9699 * argmatch.c: Include "quote.h".
9700 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9701 quote function. Reported by Göran Uddeborg.
9703 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9705 * dirname.c (dir_name): Compute append_dot using path, not newpath
9706 which is not yet declared.
9708 2001-05-11 Paul Eggert <eggert@twinsun.com>
9710 * Makefile.am (libfetish_a_SOURCES):
9711 Add strftime.c, since we now compile it on all hosts.
9713 * strftime.c (my_strftime):
9714 Define to nstrftime if emacs, but only if my_strftime is not defined.
9715 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9716 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9717 Add one more extra argument: a nanoseconds value.
9720 (my_strftime function): Add %N format.
9721 (emacs_strftimeu): Renamed from emacs_strftime,
9722 with extra ut argument.
9724 2001-05-11 Paul Eggert <eggert@twinsun.com>
9726 dirname code cleanup. base_name now behaves more compatibly
9727 with POSIX basename when given file names that have trailing
9728 slashes, and similarly for dir_name. Add new primitives
9729 base_len and dir_len. Put the directory-name-related decls
9732 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9733 * backupfile.c (base_name): Likewise.
9734 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9735 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9736 * makepath.c (strip_trailing_slashes): Likewise.
9737 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9739 * rename.c (strip_trailing_slashes): Likewise.
9740 * same.c (base_name): Likewise.
9741 * stripslash.c (ISSLASH): Likewise.
9743 * addext.c: Include <dirname.h> after size_t is defined.
9744 * backupfile.c: Likewise.
9746 * addext.c (addext): Use base_len to trim redundant
9747 trailing slashes instead of doing it ourselves.
9748 But do not trim the last slash if it is not redundant.
9750 * backupfile.c (find_backup_file_name,
9751 max_backup_version): Use base_len instead of rolling it ourselves.
9752 Handle the case of "" and (on DOS) "C:" correctly.
9754 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9755 Include <string.h>, <dirname.h>.
9756 (base_name): Allow file names ending in slashes, other than names
9757 that are all slashes. In this case, return the basename followed
9758 by the slashes. This is more general, and can be used in places
9759 where the original base_name purposely had an assertion failure.
9760 (base_len): New function.
9762 * dirname.c: Include <string.h> instead of <stdlib.h>.
9763 Do not include <assert.h>; no longer needed.
9765 (memrchr): Remove decl.
9766 (dir_name_r): Remove.
9767 (dir_len): Renamed from dirlen. All callers changed.
9768 Rewrite in terms of base_name, for simplicity and consistency.
9769 (dir_name): Never return NULL. All callers changed.
9770 Do not include <stdlib.h> in test program; no longer needed.
9771 return 0; is fine for test program.
9773 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9775 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9777 * path-concat.c (path_concat): Use base_len to compute
9778 base length, not strlen; this means we cannot rely on memcpy
9781 * same.c (STREQ): Remove.
9782 (same_name): Handle the case where the basename ends in trailing '/'.
9784 * stripslash.c (strip_trailing_slashes): Return nonzero if
9785 a slash was stripped. Do not strip the last slash after a
9788 2001-04-08 Jim Meyering <meyering@lucent.com>
9790 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9791 recomputed; that's necessary when the offset spans a DST transition.
9792 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9794 2001-04-02 Jim Meyering <meyering@lucent.com>
9796 * regex.h, regex.c: Update from GNU libc.
9798 2001-03-19 Paul Eggert <eggert@twinsun.com>
9800 * version-etc.c (version_etc_copyright): Update to 2001.
9802 2001-03-16 Paul Eggert <eggert@twinsun.com>
9804 * tempname.c (uint64_t): Define to uintmax_t if
9805 not defined, and if UINT64_MAX is not defined.
9806 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9807 Reported by John David Anglin.
9809 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9811 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9812 alias if codeset is empty.
9813 * config.charset (BeOS): Use wildcard syntax.
9815 2001-03-13 Jim Meyering <meyering@lucent.com>
9817 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9818 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9821 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9823 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9825 * unicodeio.c (print_unicode_char): Simplify accordingly.
9827 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9829 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9830 support for DOS/DJGPP.
9832 2001-02-28 Paul Eggert <eggert@twinsun.com>
9834 * Makefile.am (libfetish_a_SOURCES):
9835 Add dup-safer.c, fopen-safer.c.
9836 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9838 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9840 2001-02-25 Paul Eggert <eggert@twinsun.com>
9842 The mkstemp replacement is taken from glibc 2.2.2, with some
9843 portability fixes for use outside glibc, as follows:
9845 * tempname.c (struct_stat64): New macro.
9846 (direxists, __gen_tempname): Use it.
9847 This avoids a portability problem with Solaris 8.
9849 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9850 (<stddef.h>, <stdint.h>, <string.h>):
9851 Include only if STDC_HEADERS || _LIBC.
9852 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9853 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9854 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9855 (__set_errno): Define this macro if <errno.h> doesn't.
9856 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9857 Define these macros if <stdio.h> doesn't.
9858 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9859 Define these macros if <sys/stat.h>
9860 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9861 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9862 __xstat64): Define if not _LIBC.
9863 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9864 (__gen_tempname): Invoke gettimeofday only if
9865 HAVE_GETTIMEOFDAY || _LIBC;
9866 otherwise, fall back on plain "time".
9867 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9869 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9871 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9873 2001-02-17 Jim Meyering <meyering@lucent.com>
9875 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9876 around included file name.
9878 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9880 * strftime.c: Update from GNU libc (the only changes were to comments).
9882 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9884 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9886 2001-02-17 Paul Eggert <eggert@twinsun.com>
9888 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9889 Remove workaround macros for hosts that have mbrtowc but not
9890 mbstate_t, as we now insist on proper declarations for both
9891 before using mbrtowc.
9893 2001-02-17 Jim Meyering <meyering@lucent.com>
9895 * regex.c: Update from libc.
9897 2001-02-16 Paul Eggert <eggert@twinsun.com>
9899 * alloca.c (malloc): Undef before defining, since stdlib.h
9900 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9901 Reported by Mark Hounschell via Paul Eggert.
9903 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9905 * config.charset: Update for FreeBSD 4.2.
9907 2001-01-26 Jim Meyering <meyering@lucent.com>
9909 * quotearg.c: Include stddef.h.
9910 * quote.c: Include stddef.h.
9911 Reported by Axel Kittenberger.
9913 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9914 line in double quotes so that it evokes a better diagnostic.
9915 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9916 Reported by Axel Kittenberger.
9918 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9920 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9921 to avoid a warning. Add back 'const' to inptr.
9923 2001-01-16 Jim Meyering <meyering@lucent.com>
9925 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9928 2001-01-14 Jim Meyering <meyering@lucent.com>
9930 * rename.c: New file. From Volker Borchert.
9931 Include stdlib.h, string.h or strings.h, and xalloc.h.
9932 Use strip_trailing_slashes rather than open-coding it.
9934 2001-01-03 Paul Eggert <eggert@twinsun.com>
9936 * strftime.c: Sync with glibc time/strftime.c 1.81.
9938 2001-01-03 Jim Meyering <meyering@lucent.com>
9940 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9941 local `inptr' to avoid warning with some system declarations of iconv.
9943 2000-12-29 Paul Eggert <eggert@twinsun.com>
9945 * modechange.c: Do not assume that mode_t uses the
9946 traditional octal encoding. E.g. "chmod 1 FOO" should set
9947 the other-execute bit of FOO even if S_IXOTH != 1.
9949 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9950 WOTH, XOTH, ALLM): New macros.
9951 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9952 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9954 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9955 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9957 No need to use uintmax_t; unsigned long is long enough.
9958 Don't bother to get suffix since we don't use it.
9960 2000-12-24 Jim Meyering <meyering@lucent.com>
9962 * hash.c (is_prime): Return explicit boolean values.
9963 (hash_get_first): Return NULL to appease Irix5.6's 89.
9964 Reported by Nelson Beebe.
9966 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9968 * localcharset.c (locale_charset): Add support for Win32.
9970 2000-12-18 Paul Eggert <eggert@twinsun.com>
9972 * physmem.h, physmem.c: New files.
9974 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9975 (noinst_HEADERS): Add physmem.h.
9977 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9978 't' for compatibility with Solaris 8 sort.
9980 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9982 * config.charset: Add support for BeOS.
9984 2000-12-16 Jim Meyering <meyering@lucent.com>
9986 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9987 SHELLS_FILE to a file name that's useful on djgpp systems.
9989 (ADDITIONAL_DEFAULT_SHELLS): Define.
9990 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9991 Based mostly on a patch from Prashant TR.
9993 2000-12-16 Jim Meyering <meyering@lucent.com>
9995 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9996 N and M) would have treated it like `chown N:N FILE'.
9998 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
10000 2000-10-31 Bruno Haible <haible@clisp.cons.org>
10002 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
10003 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
10004 to the list of canonical encodings. Rename EUC-CN to GB2312.
10006 2000-12-08 Andreas Schwab <schwab@suse.de>
10008 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
10009 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
10011 2000-12-07 Jim Meyering <meyering@lucent.com>
10013 * stripslash.c (ISSLASH): Define.
10014 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
10017 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
10018 (dir_name_r): Declare this function as static.
10019 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10020 manifest itself on a name containing a mix of slashes and
10022 Make this function work with names starting with a DOS-style
10023 drive letter and colon prefix.
10024 (dir_name): Append `.' if necessary.
10025 Based mostly on patches from Prashant TR and Eli Zaretskii.
10027 * dirname.h (dir_name_r): Remove prototype.
10029 2000-12-05 Jim Meyering <meyering@lucent.com>
10031 * dirname.c (dir_name_r): Add `const' in a few local declarations.
10033 2000-12-04 Jim Meyering <meyering@lucent.com>
10035 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10036 Also include memory.h, stdlib.h, unistd.h if appropriate.
10037 Reported by Andreas Jaeger (conflicting declaration of malloc).
10039 2000-12-02 Jim Meyering <meyering@lucent.com>
10041 * closeout.h: Make idempotent, to avoid some obscure warnings.
10043 2000-12-01 Paul Eggert <eggert@twinsun.com>
10045 * memrchr.c: Include <config.h> before any system include file.
10047 2000-11-29 Paul Eggert <eggert@twinsun.com>
10049 * dirname.c (dir_name_r): Fix typo: int -> size_t.
10051 2000-11-26 Jim Meyering <meyering@lucent.com>
10053 * memcoll.c: Include sys/types.h. From Werner Almesberger.
10055 2000-11-22 Paul Eggert <eggert@twinsun.com>
10057 * strftime.c (my_strftime): Do not invoke mbrlen with a
10058 size of (size_t) -1; it's not portable.
10060 2000-11-17 Akim Demaille <akim@epita.fr>
10062 * obstack.h: Formatting changes.
10063 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10064 prevent type checking.
10065 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10066 cast the value to (void *): assigning a `foo *' to a `void *'
10068 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10070 2000-11-17 Jim Meyering <meyering@lucent.com>
10072 * strstr.c: Update from GNU libc.
10074 2000-11-16 Jim Meyering <meyering@lucent.com>
10076 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10078 2000-11-11 Jim Meyering <meyering@lucent.com>
10080 * error.c: Add a couple #includes, merging from GNU libc version.
10082 2000-11-10 Jim Meyering <meyering@lucent.com>
10084 * obstack.h: Update from GNU libc.
10085 * obstack.c: Likewise.
10087 2000-11-06 Paul Eggert <eggert@twinsun.com>
10089 * getusershell.c (setusershell): Use rewind rather than
10090 fseek/fseeko, to avoid configuration hassles with fseeko.
10091 Don't bother opening SHELLS_FILE if shellstream is NULL;
10092 it's not necessary.
10094 2000-11-05 Jim Meyering <meyering@lucent.com>
10096 * makepath.h (make_dir): Declare.
10097 * makepath.c (make_dir): Remove `static' attribute.
10100 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10102 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10103 last one in a bucket, advance to the next bucket.
10105 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10107 * fnmatch.c: Do not comment out all the code if we are using
10108 the GNU C library, because in some cases we are replacing buggy
10109 code in the GNU C library itself.
10111 2000-10-30 Paul Eggert <eggert@twinsun.com>
10113 * error.h, getline.h, modechange.h:
10114 Remove "2000" from Copyright line, as the file hasn't been
10115 changed this year other than in the copyright notice.
10117 * xalloc.h: Add "2000" to Copyright line, as this file
10118 was changed this year.
10120 2000-10-30 Paul Eggert <eggert@twinsun.com>
10122 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10123 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10124 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10126 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10128 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10129 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10130 doesn't define __restrict_arr.
10132 2000-10-29 Jim Meyering <meyering@lucent.com>
10134 * xstat.in: Fix grammar in comment.
10136 2000-10-28 Jim Meyering <meyering@lucent.com>
10138 * memchr.c: Update from libc.
10139 Adjust for portability:
10140 [HAVE_STDLIB_H]: Include stdlib.h.
10141 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10142 Undef __memchr, too.
10143 [!weak_alias]: Define __memchr to memchr.
10145 * regex.c: Update from libc.
10146 * regex.h: Likewise.
10147 * getopt1.c: Likewise.
10148 * memcmp.c: Likewise.
10150 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10151 Avoid using fseek, when possible -- it's broken by design.
10152 Patch by Ulrich Drepper.
10154 2000-10-26 Jim Meyering <meyering@lucent.com>
10156 * strftime.c: Update from libc.
10158 2000-10-25 Jim Meyering <meyering@lucent.com>
10160 * obstack.c: Update from libc.
10162 2000-10-23 Jim Meyering <meyering@lucent.com>
10164 * hard-locale.c (hard_locale): Revert last change -- it was simply
10165 wrong. That set_locale call must not have any side effects.
10168 2000-10-22 Jim Meyering <meyering@lucent.com>
10170 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10171 [CYCLIC]: Remove now-unused definition.
10173 * save-cwd.c (O_DIRECTORY): Define, if needed.
10174 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10175 Suggestion from Ulrich Drepper.
10177 2000-10-21 Jim Meyering <meyering@lucent.com>
10179 * dirname.c (dir_name_r): New function, factored out of dir_name.
10180 (dir_name): Use dir_name_r.
10181 * dirname.h (dir_name_r): Declare it.
10183 2000-10-21 Jim Meyering <meyering@lucent.com>
10185 * dirname.c (memrchr): Declare if necessary.
10186 (dir_name): Remove the restriction that there be no
10187 trailing slashes. Now, this code skips past them, effectively
10189 [TEST_DIRNAME] (main): New unit tests.
10191 * memrchr.c: New file from GNU libc.
10192 Undef __memrchr, too.
10193 [!weak_alias]: Define __memrchr to memrchr.
10194 Guard weak_alias use with `#ifdef weak_alias'.
10196 2000-10-17 Jim Meyering <meyering@lucent.com>
10198 * quote.h (PARAMS): Define and use.
10199 Reported by Akim Demaille.
10201 * getopt.c: Update from libc.
10203 2000-10-16 Jim Meyering <meyering@lucent.com>
10205 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10208 2000-09-25 Jim Meyering <meyering@lucent.com>
10210 * md5.h (rol): Define (from GnuPG).
10212 * sha.c: Give credit (GnuPG) where due.
10213 (M): Use rol rather than open-coding it.
10214 Add a FIXME comment.
10216 2000-09-21 Jim Meyering <meyering@lucent.com>
10218 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10219 Reported by Michael Stone.
10221 2000-09-20 Jim Meyering <meyering@lucent.com>
10223 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10224 (noinst_HEADERS): Add sha.h.
10225 Based on code from Scott G. Miller and from GnuPG.
10227 2000-09-15 Jim Meyering <meyering@lucent.com>
10229 * regex.c: Update from libc.
10231 2000-09-10 Jim Meyering <meyering@lucent.com>
10233 * getopt.c (_getopt_internal): Update from glibc.
10235 2000-09-09 Jim Meyering <meyering@lucent.com>
10237 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10238 think it should be used as a general replacement for isascii.
10239 * fnmatch.c: Likewise.
10240 * mbswidth.c: Likewise
10241 * regex.c: Likewise.
10244 * userspec.c: Include sys/param.h and limits.h.
10246 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10247 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10248 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10249 UID, GID. Check range.
10251 2000-09-06 Jim Meyering <meyering@lucent.com>
10253 * getopt.c (_getopt_internal): Update from glibc.
10255 2000-08-30 Jim Meyering <meyering@lucent.com>
10257 * strftime.c: Merge in changes from GNU libc.
10259 2000-08-26 Jim Meyering <meyering@lucent.com>
10261 * closeout.c: Include "__fpending.h".
10262 (close_stdout_status): Return right away if there's nothing to flush.
10264 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10265 * __fpending.c: New file.
10266 * __fpending.h: New file.
10268 2000-08-07 Paul Eggert <eggert@twinsun.com>
10270 Standardize on "memory exhausted" instead of "Memory exhausted"
10271 or "virtual memory exhausted".
10272 * obstack.c (print_and_abort): Use "memory exhausted", not
10273 "virtual memory exhausted".
10274 * same.c (same_name): Invoke xalloc_die instead of printing
10276 * userspec.c (parse_user_spec): Likewise.
10277 * bumpalloc.h: comment fix
10278 * same.c, userspec.c: Include xalloc.h.
10280 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10281 not char *const and pointing to a constant array.
10282 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10283 (xrealloc): Comment fix.
10285 * userspec.c (parse_user_spec):
10286 Don't translate a message until just before returning,
10287 to avoid unnecessary translation.
10289 2000-08-07 Jim Meyering <meyering@lucent.com>
10291 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10292 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10293 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10294 getgroups.c, gethostname.c, getopt.h, group-member.c,
10295 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10296 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10297 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10298 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10299 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10300 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10301 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10302 yesno.c: Back out Copyright date changes for each file with no change
10303 this year. This eases coordination with other programs using the same
10304 source code modules. From Paul Eggert.
10306 2000-08-03 Greg McGary <greg@mcgary.org>
10308 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10309 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10310 (EXTEND_BUFFER): Use them.
10312 2000-08-01 Jim Meyering <meyering@lucent.com>
10314 * dirname.c (ISSLASH): Define.
10315 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10316 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10317 both `\' and `/' may be use as path separators.
10318 Based on a patch from Prashant TR.
10320 2000-07-31 Paul Eggert <eggert@twinsun.com>
10322 * quotearg.c (quotearg_n_options): Don't make the initial
10323 slot vector a constant, since it might get modified.
10325 2000-07-31 Jim Meyering <meyering@lucent.com>
10327 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10328 * obstack.c (print_and_abort): Likewise.
10330 2000-07-30 Paul Eggert <eggert@twinsun.com>
10332 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10333 buffer, so that the caller can always quote one small
10334 component of a "memory exhausted" message in slot 0.
10335 From a suggestion by Jim Meyering.
10337 2000-07-30 Jim Meyering <meyering@lucent.com>
10339 * makepath.c (make_path): Quote the other instance, too.
10341 * quotearg.c (N_STATIC_SLOTVECS): Define.
10342 (STATIC_BUF_SIZE): Define.
10343 (quotearg_n_options): Use only statically allocated storage when
10344 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10345 than STATIC_BUF_SIZE.
10347 2000-07-29 Jim Meyering <meyering@lucent.com>
10349 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10350 * dirname.c (dir_name): Likewise.
10352 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10354 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10355 (dir_name): Assert that there are no trailing slashes.
10357 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10359 * mbswidth.h (mbswidth): Add a flags argument.
10360 (mbswidth): New declaration.
10361 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10362 * mbswidth.c (mbswidth): Add a flags argument.
10363 (mbsnwidth): New function.
10365 2000-07-24 Jim Meyering <meyering@lucent.com>
10367 * mbswidth.c: Remove useless #else. From Bruno Haible.
10369 2000-07-23 Paul Eggert <eggert@twinsun.com>
10371 * mbswidth.c (_XOPEN_SOURCE):
10372 Don't define; this causes problems on Solaris 7.
10373 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10375 2000-07-23 Paul Eggert <eggert@twinsun.com>
10378 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10379 so that mbstate_t is always defined.
10381 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10382 be 1 in at least one GCC installation, and this configuration
10383 error is likely to be common. Ignoring MB_LEN_MAX hurts
10384 performance on hosts that have mbrtowc but have only unibyte
10385 locales, but I assume these hosts are rare.
10387 2000-07-23 Paul Eggert <eggert@twinsun.com>
10389 * quotearg.c: Streamline by invoking multibyte code only if needed.
10390 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10391 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10392 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10393 invoke multibyte primitives.
10395 2000-07-23 Jim Meyering <meyering@lucent.com>
10397 * basename.c (base_name): Add an assertion.
10399 2000-07-15 Bruno Haible <clisp.cons.org>
10401 * quotearg.c: When the system forces us to redefine mbstate_t,
10402 shadow its mbsinit function.
10404 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10406 * mbswidth.h: New file.
10407 * mbswidth.c: New file.
10408 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10409 (noinst_HEADERS): Add mbswidth.h.
10411 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10413 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10416 2000-07-15 Jim Meyering <meyering@lucent.com>
10418 * makepath.c: Include quote.h.
10419 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10420 corresponding argument in a `quote (...)' call.
10421 Give better diagnostics.
10423 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10424 (noinst_HEADERS): Add quote.h.
10426 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10427 from tar's src/misc.c.
10428 * quote.h: New file. Prototypes for same.
10430 2000-07-10 Paul Eggert <eggert@twinsun.com>
10432 From a suggestion by Bruno Haible.
10433 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10434 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10435 to decide whether to define the BeOS workaround macro;
10436 this adjusts to the change to AC_MBSTATE_T.
10438 2000-07-13 Paul Eggert <eggert@twinsun.com>
10440 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10442 * quotearg.c (quoting_style_args, quoting_style_vals,
10443 quotearg_buffer_restyled): Add support for
10444 clocale_quoting_style. Undo previous change to
10445 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10446 and "{RIGHT QUOTATION MARK}" msgids.
10448 2000-07-05 Paul Eggert <eggert@twinsun.com>
10450 The old behavior of quoting `like this' doesn't look good with
10451 newer, ISO-style fonts. See:
10452 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10454 Instead, quote "like this" by default. Let the translator
10455 tailor the locale-specific quoting behavior by providing
10456 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10458 * quotearg.c (N_): New macro.
10459 (gettext_default): New function.
10460 (quotearg_buffer_restyled): Use
10461 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10462 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10464 2000-07-09 Jim Meyering <meyering@lucent.com>
10466 * Most files: Update copyright dates to include 2000.
10468 2000-07-08 Jim Meyering <meyering@lucent.com>
10470 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10472 (xgethostname): Remove now-unnecessary #ifdef.
10473 Move declaration of `err' into loop where it's used.
10475 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10477 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10478 by allocating a larger buffer. Test the gethostname return value for
10479 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10480 returns an error and ENAMETOOLONG isn't defined.
10482 2000-07-05 Paul Eggert <eggert@twinsun.com>
10483 and Bruno Haible <haible@clisp.cons.org>
10485 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10487 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10489 * quotearg.c (struct quoting_options): Simplify quote_these_too
10492 2000-07-03 Jim Meyering <meyering@lucent.com>
10494 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10495 Reported by Bruno Haible.
10497 2000-07-04 Jim Meyering <meyering@lucent.com>
10499 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10500 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10503 2000-07-03 Paul Eggert <eggert@twinsun.com>
10504 and Bruno Haible <haible@clisp.cons.org>
10506 * quotearg.c (mbrtowc):
10507 Assign to *pwc, and return 1 only if result is nonzero.
10508 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10510 2000-07-03 Jim Meyering <meyering@lucent.com>
10512 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10513 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10516 2000-07-02 Jim Meyering <meyering@lucent.com>
10518 * quotearg.c (mbstate_t): Don't define here.
10520 2000-07-02 Jim Meyering <meyering@lucent.com>
10522 * nanosleep.c (SIGCONT): Define if not already defined.
10524 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10526 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10527 per change in ../m4/ls-mntd-fs.m4.
10528 (read_filesystem_list): Ignore symbolic links.
10530 2000-06-29 Jim Meyering <meyering@lucent.com>
10532 * same.c: Include <string.h> or <strings.h>, as appropriate,
10533 for declaration of strcmp.
10535 * long-options.c: Include <stdlib.h>, for declaration of exit.
10537 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10538 Avoid warning by casting result to `char *' to remove `const'.
10540 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10542 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10544 2000-06-26 Paul Eggert <eggert@twinsun.com>
10546 savedir now sets errno on failure and invokes xmalloc to get memory.
10547 Fix a couple of other minor bugs while we're at it.
10549 * savedir.c (<unistd.h>): Do not include; there's no need.
10550 (NAMLEN): Remove macro.
10551 (malloc, realloc): Remove decls.
10552 (stpcpy): Likewise.
10553 ("xalloc.h"): Include.
10554 (NAME_SIZE_DEFAULT): New macro.
10555 (savedir): Use xmalloc / xrealloc to allocate memory.
10556 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10557 Skip "" directory entries.
10558 Use strlen to calculate directory entry length, since the old method
10559 is rarely used these days and isn't worth supporting.
10560 Don't use a pointer after freeing it.
10561 Check for integer overflow when calculating allocation size.
10562 Use memcpy to copy entries, instead of stpcpy.
10563 Set errno properly when returning NULL.
10564 Check for readdir error.
10566 2000-06-26 Jim Meyering <meyering@lucent.com>
10568 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10570 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10572 * getusershell.c (xmalloc, xrealloc): Remove functions.
10574 Don't include <stdlib.h>. Don't declare malloc, realloc.
10576 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10578 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10580 2000-06-24 Jim Meyering <meyering@lucent.com>
10582 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10584 2000-06-21 Jim Meyering <meyering@lucent.com>
10586 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10588 2000-06-19 Paul Eggert <eggert@twinsun.com>
10590 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10591 (mbrtowc, mbstate_t): Define substitutes if
10592 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10593 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10594 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10596 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10598 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10599 than 1024, return a memory chunk of least possible size, instead
10600 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10601 Use free/xmalloc instead of xrealloc to avoid copying for very long
10604 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10606 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10607 address, not strdup. Include <stdlib.h> and don't declare free().
10609 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10611 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10614 2000-06-21 Jim Meyering <meyering@lucent.com>
10616 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10617 (noinst_HEADERS): Add getstr.h.
10619 * getline.c (getstr): Move into a separate file.
10620 * getstr.c (getstr): New file, extracted from getline.c, with
10621 the following changes: new parameter, delim2; both delim[12]
10622 parameters have type `int', not `char'. The latter would lose
10623 with 8-bit delimiters.
10624 * getstr.h: New file.
10626 2000-06-19 Jim Meyering <meyering@lucent.com>
10628 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10630 2000-06-18 Jim Meyering <meyering@lucent.com>
10632 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10633 Besides, these days every porting target provides a mkdir function.
10635 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10636 (this snippet comes from src/system.h).
10638 2000-06-15 Paul Eggert <eggert@twinsun.com>
10640 * human.c (adjust_value): New function.
10641 (human_readable_inexact): Apply rounding style even when
10642 printing approximate values.
10644 2000-06-14 Paul Eggert <eggert@twinsun.com>
10646 * human.c (human_readable_inexact): Allow an input block
10647 size that is not a multiple of the output block size, and vice versa.
10648 Reported by Piergiorgio Sartor.
10650 2000-06-14 Paul Eggert <eggert@twinsun.com>
10652 * getdate.y (get_date): Apply relative times after time
10653 zone indicator, not before. Reported by Todd A. Jacobs.
10655 2000-06-13 Jim Meyering <meyering@lucent.com>
10657 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10659 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10661 2000-06-12 Paul Eggert <eggert@twinsun.com>
10663 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10665 2000-06-04 Paul Eggert <eggert@twinsun.com>
10667 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10669 2000-06-04 Jim Meyering <meyering@lucent.com>
10671 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10672 SunOS 4.1.4 for which gid_t is an unsigned type.
10674 2000-06-03 Jim Meyering <meyering@lucent.com>
10676 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10678 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10680 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10681 newer, don't install charset.alias.
10682 * config.charset: Change the Linux/glibc rules so they become empty
10683 on glibc-2.1 or newer.
10685 2000-06-02 Jim Meyering <meyering@lucent.com>
10687 * mountlist.c: Back out last change. Instead, do this...
10688 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10689 member using the same `ignore'-testing code.
10690 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10694 2000-05-29 Jim Meyering <meyering@lucent.com>
10696 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10697 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10699 2000-05-22 Jim Meyering <meyering@lucent.com>
10701 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10703 2000-05-18 Jim Meyering <meyering@lucent.com>
10705 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10706 back, too, since it may have been modified by allocate_entry.
10707 (hash_delete): Rewrite to use neither the assignment operator
10708 nor the comma operator in an if-expression.
10710 2000-05-15 Paul Eggert <eggert@twinsun.com>
10713 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10714 Remove; no longer needed.
10715 "quotearg.h": Add include.
10716 (file_name): Do not bother to explicitly initialize to NULL; it's less
10717 efficient on some hosts.
10718 (close_stdout_status): Remove test as to whether stdout was already
10719 closed; it breaks for the case "echo x | sort >&-".
10720 Quote file name colons.
10721 Do not assume that _("write error") lacks format strings.
10723 2000-05-15 Jim Meyering <meyering@lucent.com>
10725 * version-etc.c (version_etc_copyright): Update the copyright string
10726 used in all --version output.
10728 2000-05-14 Jim Meyering <meyering@lucent.com>
10730 * closeout.c (close_stdout_set_file_name): New function.
10731 (close_stdout_status): Use new file-scoped global.
10732 Return right away if fstat says the stdout file descriptor is invalid.
10733 * closeout.h (close_stdout_set_file_name): Declare.
10735 2000-05-10 Jim Meyering <meyering@lucent.com>
10737 * closeout.c [default_exit_status]: New file-scoped variable.
10738 (close_stdout_set_status): New function.
10739 * closeout.h (close_stdout_set_status): Declare.
10741 2000-05-08 Jim Meyering <meyering@lucent.com>
10743 * long-options.c: Don't include closeout.h.
10744 (parse_long_options): Don't call close_stdout for --version.
10746 2000-05-06 Jim Meyering <meyering@lucent.com>
10748 * strnlen.c: Undefine __strnlen and strnlen.
10749 [!weak_alias]: Define __strnlen to strnlen.
10751 * atexit.c: New file, from libiberty.
10753 2000-05-06 Jim Meyering <meyering@lucent.com>
10755 * closeout.c (close_stdout_status): Also check for errors on the
10758 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10760 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10761 instead of xmalloc, xrealloc, path_concat.
10762 (locale_charset): Treat empty environment variables as absent.
10763 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10765 2000-05-04 Jim Meyering <meyering@lucent.com>
10767 * getopt.c: Update from glibc.
10768 * obstack.c: Likewise.
10769 * obstack.h: Likewise.
10770 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10772 * regex.h: Likewise.
10773 * strndup.c: Likewise.
10774 * strnlen.c: New file, from glibc.
10776 2000-05-01 Jim Meyering <meyering@lucent.com>
10778 * full-write.c (full_write): Remove `FIXME' part of comment.
10780 2000-04-29 Jim Meyering <meyering@lucent.com>
10782 * path-concat.c: Declare strdup only if it's not defined.
10783 * canon-host.c: Likewise.
10785 2000-04-28 Jim Meyering <meyering@lucent.com>
10787 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10788 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10789 included first, then limits.h is included by locale.h by libintl.h.
10790 From John David Anglin.
10792 2000-04-25 Jim Meyering <meyering@lucent.com>
10794 * makepath.c (S_IRWXUGO): Define.
10795 (make_path): Always perform explicit chmod if MODE specifies any
10796 of the `special' permission bits. Prompted by a bug report against
10797 install from Mate Wierdl and Joost van Baal.
10799 2000-04-18 Jim Meyering <meyering@lucent.com>
10801 * README: New file.
10803 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10804 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10806 2000-04-17 Jim Meyering <meyering@lucent.com>
10808 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10809 the definition of it to rpl_strftime also defined-away the system's
10812 2000-04-15 Jim Meyering <meyering@lucent.com>
10814 Use `C' to denote so-called `contiguous' files, the same way
10816 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10817 (ftypelet): Use S_ISCTG.
10818 From Michael Deutschmann.
10820 2000-04-14 Jim Meyering <meyering@lucent.com>
10822 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10824 2000-04-08 Jim Meyering <meyering@lucent.com>
10826 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10827 names don't conflict. Reported by Eli Zaretskii.
10829 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10831 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10832 bug. Deal with the different error behavior of Irix iconv.
10834 2000-04-07 Jim Meyering <meyering@lucent.com>
10836 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10837 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10839 2000-04-05 Jim Meyering <meyering@lucent.com>
10841 Portability tweaks required for ultrix4.3.
10842 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10843 * readutmp.c: Include sys/types.h before sys/stat.h.
10844 * canon-host.c: Declare strdup.
10845 * path-concat.c: Likewise.
10846 From John David Anglin.
10848 2000-04-04 Jim Meyering <meyering@lucent.com>
10850 Be more DOS 8.3-friendly.
10851 * ref-add.sin: Renamed from ref-add.sed.in.
10852 * ref-del.sin: Renamed from ref-del.sed.in.
10853 * Makefile.am: Reflect renaming.
10854 Reported by Eli Zaretskii.
10856 Use a temporary file name that won't clash with `charset.alias'
10857 in the DOS 8.3 name space.
10858 * Makefile.am (charset_tmp): Define.
10859 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10860 (uninstall-local): Likewise.
10861 Reported by Eli Zaretskii.
10863 2000-03-29 Paul Eggert <eggert@twinsun.com>
10865 * time/strftime.c (my_strftime): Make sure we call the system
10866 strftime, not ourselves, when invoking the underlying strftime.
10868 2000-03-24 Jim Meyering <meyering@lucent.com>
10870 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10871 (charset_alias): Define.
10872 (install-exec-local): Factor out common code.
10873 (uninstall-local): Split lines longer than 80.
10874 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10875 (SUFFIXES): Define.
10876 (.sed.in.sed): New rule. Don't redirect directly to $@.
10877 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10879 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10881 * config.charset: Output a line containing "Packages using this file".
10882 * ref-add.sed.in, ref-del.sed.in: New files.
10883 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10884 ref-del.sed): New rules.
10886 2000-03-17 Jim Meyering <meyering@lucent.com>
10888 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10889 Otherwise, include <strings.h>
10891 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10893 * unicodeio.c (utf8_wctomb): New function.
10894 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10895 format instead of in UCS-4 with platform dependent endianness.
10897 2000-03-07 Paul Eggert <eggert@twinsun.com>
10899 * savedir.c (savedir): Work even if directory size is
10900 negative; this can happen with some screwy NFS configurations.
10902 2000-03-06 Jim Meyering <meyering@lucent.com>
10904 * localcharset.c (get_charset_aliases): Don't try to free file_name
10905 if it's NULL (because we ran out of memory). From Bruno Haible.
10907 2000-03-05 Jim Meyering <meyering@lucent.com>
10909 * localcharset.c ("path-concat.h"): Include.
10910 (get_charset_aliases): Use path_concat instead of ANSI string
10913 * unicodeio.h (PARAMS): Define.
10914 Use it to guard prototype.
10916 2000-03-04 Jim Meyering <meyering@lucent.com>
10918 * Makefile.am (install-exec-local): Create $(libdir) before installing
10920 (uninstall-local): Uncomment this rule so `make distcheck' works
10923 * unicodeio.c (<errno.h>): Include it.
10924 (errno): Declare if not defined.
10926 * localcharset.c: Add Bruno's comment justifying use of volatile.
10928 * config.charset: New version, incorporating remarks from a linux
10929 i18n mailing list. From Bruno Haible.
10931 2000-03-02 Jim Meyering <meyering@lucent.com>
10933 * Makefile.am (EXTRA_DIST): Add config.charset.
10935 2000-03-01 Jim Meyering <meyering@lucent.com>
10937 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10938 * unicodeio.c: Likewise.
10940 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10942 * config.charset: New file.
10943 * localcharset.c: New file.
10944 * unicodeio.h, unicodeio.c: New files.
10945 * Makefile.am (DEFS): Add -DLIBDIR=...
10946 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10947 (noinst_HEADERS): Add unicodeio.h.
10948 (all-local, install-exec-local, charset.alias): New targets.
10950 2000-02-28 Paul Eggert <eggert@twinsun.com>
10952 * quotearg.c (ALERT_CHAR): New macro.
10953 (quotearg_buffer_restyled): Use it.
10955 2000-02-27 Jim Meyering <meyering@lucent.com>
10957 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10958 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10960 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10961 not `#if STDC_HEADERS'.
10962 Declare malloc if needed.
10964 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10965 now that autoconf always defines the HAVE_DECL_ symbols.
10966 * human.c: Likewise.
10967 * same.c: Likewise.
10968 * strtoumax.c: Likewise.
10970 * backupfile.c: Arrange for cpp to fail if the configure-time
10971 declaration check was not run.
10972 * hash.c: Likewise.
10973 * human.c: Likewise.
10974 * same.c: Likewise.
10975 * strtoumax.c: Likewise.
10977 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10978 then first look up the entire `.'-containing string as a login name.
10980 2000-02-18 Paul Eggert <eggert@twinsun.com>
10982 * getdate.y: Handle two-digit years with leading zeros correctly.
10983 (textint): New typedef.
10984 (parser_control): Member year changed from int to textint.
10986 (YYSTYPE): Removed; replaced by %union with int and textint members.
10987 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10988 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10989 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10990 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10991 (date, number, to_year): Use width of number in digits, not its value,
10992 to determine whether it's a 2-digit year, or a 2-digit time.
10993 (yylex): Store number of digits of numeric tokens.
10994 Reported by John Kendall.
10996 (parser_control): Changed from struct parser_control to typedef (for
10997 consistency). All uses changed.
10999 (tID): Removed; not used.
11000 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
11002 2000-02-14 Paul Eggert <eggert@twinsun.com>
11004 * getpagesize.h (getpagesize): Port to VMS for Alpha;
11005 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
11007 2000-02-12 Jim Meyering <meyering@lucent.com>
11009 * userspec.c (ISDIGIT): Define it.
11010 (isdigit): Remove definition.
11011 (is_number): Use ISDIGIT, not isdigit.
11012 <libintl.h>: Include.
11013 (_ and N_): Define.
11014 (parse_user_spec): Mark translatable strings.
11016 2000-02-10 Jim Meyering <meyering@lucent.com>
11018 With these changes, nanosleep.[ch] are finally enough like the other
11019 lib/* replacement files to compile on a few more losing systems.
11021 * nanosleep.h: Don't include config.h.
11022 Remove prototype from declaration of nanosleep.
11023 (PARAMS): Remove now-unneeded definition.
11024 * nanosleep.c: #undef nanosleep.
11025 (rpl_nanosleep): Rename from nanosleep.
11027 2000-02-03 Jim Meyering <meyering@lucent.com>
11029 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11030 rather than with `#if HAVE_UTMPNAME'.
11032 2000-02-01 Jim Meyering <meyering@lucent.com>
11034 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
11036 2000-01-31 Jim Meyering <meyering@lucent.com>
11038 * nanosleep.h (nanosleep): Guard declaration with
11039 `#if ! HAVE_DECL_NANOSLEEP'.
11040 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11041 the declaration in that vendor's sys/timers.h.
11042 Reported by Christian Krackowizer.
11044 * quotearg.c (ISASCII): Add #undef and move definition to follow
11045 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11046 (ISPRINT): Likewise.
11047 Reported by Tom Tromey.
11049 2000-01-30 Jim Meyering <meyering@lucent.com>
11051 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11052 uses of ->ut_name. The latter doesn't work with new Linux header files
11053 where only utmpx.ut_user is declared.
11055 * readutmp.h (UT_USER): Define.
11057 2000-01-23 Jim Meyering <meyering@lucent.com>
11059 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11062 2000-01-22 Jim Meyering <meyering@lucent.com>
11064 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11065 [! HAVE_DECL_STRTOULL]: Declare strtoull.
11066 Required for some AIX systems. Reported by Christian Krackowizer.
11067 [TESTING] (main): New function.
11069 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
11070 * dirname.c (dir_name): Support for DOS-style file names with drive
11073 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11075 * strverscmp.c (ISDIGIT): Define.
11076 (strverscmp): Use ISDIGIT, not isdigit.
11078 2000-01-17 Paul Eggert <eggert@twinsun.com>
11080 * nanosleep.c (nanosleep):
11081 Don't use SA_INTERRUPT to decide whether to call sigaction, as
11082 POSIX.1 doesn't require SA_INTERRUPT and some systems
11083 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
11084 it's been part of POSIX.1 since day 1 (in 1988).
11086 2000-01-17 Jim Meyering <meyering@lucent.com>
11088 * interlock: Remove unused file. Reported by François Pinard.
11090 2000-01-16 Paul Eggert <eggert@twinsun.com>
11092 * quotearg.c (quotearg_buffer_restyled): Do not quote
11093 alert, backslash, formfeed, and vertical tab unnecessarily in
11094 shell quoting style.
11097 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11098 Free Software Foundation, Inc.
11099 Copying and distribution of this file, with or without modification,
11100 are permitted provided the copyright notice and this notice are preserved.