1 2006-10-08 Paul Eggert <eggert@cs.ucla.edu>
3 Don't include <config.h> twice; this doesn't work in some cases,
4 e.g., when config.h has "#define intmax_t long long int" and
5 we include <config.h>, <inttypes.h>, <config.h> in that order.
6 Problem reported by Matthew Woehlke in:
7 http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00073.html
8 * fprintftime.c: Don't include config.h or fprintftime.h.
9 * fts-cycle.c: Don't include config.h.
10 * strftime.c: Include fprintftime.h if FPRINTFTIME is defined.
11 * xstrtoimax.c: Remove copyright notice since it's short tnow.
12 Don't include config.h or xstrtol.h. Define STRTOL_T_MINIMUM
13 and STRTOL_T_MAXIMUM unconditionally, since we now assume gnulib
15 * xstrtoumax.c: Likewise.
16 * xstrtol.c: Include config.h and xstrtol.h after defining
17 __strtol and the like, so that this module is more like its siblings.
18 (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [! defined STRTOL_T_MINIMUM]:
19 Remove; no longer needed now that we assume gnulib inttypes.h.
21 2006-10-07 Bruno Haible <bruno@clisp.org>
23 * gl_sublist.h: New file.
24 * gl_sublist.c: New file.
26 2006-10-06 Paul Eggert <eggert@cs.ucla.edu>
28 * mkancesdirs.c (mkancesdirs): Pass to MAKE_DIR both the full file
29 name (relative to the original working directory) and the file
30 name component (relative to the temporary working directory). All
32 * mkancesdirs.h (mkancesdirs): Adjust prototype to match.
33 * mkdir-p.c (make_dir_parents): Likewise.
34 * mkdir-p.h (make_dir_parents): Likewise.
36 2006-10-06 Eric Blake <ebb9@byu.net>
38 * clean-temp.h (close_stream_temp): New declaration.
39 * clean-temp.c (includes): Pull in headers according to what
40 other modules are in use.
41 (close_stream_temp) [GNULIB_CLOSE_STREAM]: New function.
43 2006-10-06 Bruno Haible <bruno@clisp.org>
45 * clean-temp.h (cleanup_temp_file, cleanup_temp_subdir,
46 cleanup_temp_dir_contents, cleanup_temp_dir): Change return type to
48 * clean-temp.c (do_unlink, do_rmdir, cleanup_temp_file,
49 cleanup_temp_subdir, cleanup_temp_dir_contents, cleanup_temp_dir):
50 Return an error indicator.
51 Suggested by Eric Blake.
53 2006-10-06 Bruno Haible <bruno@clisp.org>
55 * clean-temp.c (PATH_MAX): Provide a fallback for GNU Hurd.
56 Reported by Eric Blake.
58 2006-10-06 Bruno Haible <bruno@clisp.org>
59 and Paul Eggert <eggert@cs.ucla.edu>
61 * closeout.c (close_stdout): Also close stderr.
62 * closeout.h: Update comment.
64 2006-10-06 Bruno Haible <bruno@clisp.org>
66 * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
67 instead of fopen, fwriteerror.
69 2006-10-05 Bruno Haible <bruno@clisp.org>
71 * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
72 fwriteerror_temp): New declarations.
73 * clean-temp.c (uintptr_t): Provide fallback definition.
74 (descriptors): New variable.
75 (cleanup): First, close the descriptors.
76 (register_fd, unregister_fd, open_temp, fopen_temp, close_temp,
77 fclose_temp, fwriteerror_temp): New functions.
79 2006-10-03 Bruno Haible
81 * gl_list.h (gl_sortedlist_search_from_to,
82 gl_sortedlist_indexof_from_to): New declarations.
83 (gl_list_implementation): New fields sortedlist_search_from_to,
84 sortedlist_indexof_from_to.
85 (gl_sortedlist_search_from_to, gl_sortedlist_indexof_from_to): New
87 * gl_list.c (gl_sortedlist_search_from_to,
88 gl_sortedlist_indexof_from_to): New functions.
89 * gl_array_list.c (gl_array_sortedlist_indexof_from_to): New function.
90 (gl_array_sortedlist_indexof, gl_array_sortedlist_search): Use it.
91 (gl_array_sortedlist_search_from_to): New function.
92 (gl_array_list_implementation): Update.
93 * gl_carray_list.c (gl_carray_sortedlist_indexof_from_to): New function.
94 (gl_carray_sortedlist_indexof, gl_carray_sortedlist_search): Use it.
95 (gl_carray_sortedlist_search_from_to): New function.
96 (gl_carray_list_implementation): Update.
97 * gl_anylinked_list2.h (gl_linked_sortedlist_search_from_to,
98 gl_linked_sortedlist_indexof_from_to): New functions.
99 * gl_linked_list.c (gl_linked_list_implementation): Update.
100 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
101 * gl_anytree_list2.h (gl_tree_sortedlist_search_from_to,
102 gl_tree_sortedlist_indexof_from_to): New functions.
103 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
104 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
105 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
106 * gl_rbtreehash_list.c (gl_avltreehash_list_implementation): Update.
108 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
110 Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
111 <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
112 * dirchownmod.c: Include lchown.h.
113 * lchown.c: Don't include files that lchown.h now includes.
114 Don't declare chown, since lchown.h now does that.
115 * lchown.h: Include errno.h, sys/types.h, unistd.h.
116 (lchown): Define to rpl_chown if lchown is declared but
117 does not exist. Declare using a prototype if lchown is not
118 declared. Add a copyright notice.
119 * mkstemp.h: Include <unistd.h>.
120 * openat.c: Include lchown.h.
122 * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
123 we now test for that separately.
124 * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
125 rather than O_NOFOLLOW, when testing whether it's possible to
126 avoid a race condition reliably.
127 * savewd.c (savewd_chdir): Likewise.
129 Remove macros that are no longer needed now that stdint.h is
131 * fsusage.c (UINTMAX_MAX): Remove.
132 * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
133 * utimecmp.c (SIZE_MAX): Remove.
135 2006-10-03 Bruno Haible <bruno@clisp.org>
137 * gl_list.h (gl_list_search_from, gl_list_search_from_to,
138 gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
139 (struct gl_list_implementation): Add fields search_from_to,
140 indexof_from_to. Remove fields search, indexof.
141 (gl_list_search): Use the search_from_to method.
142 (gl_list_search_from, gl_list_search_from_to): New functions.
143 (gl_list_indexof): Use the indexof_from_to method.
144 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
145 * gl_list.c (gl_list_search): Use the search_from_to method.
146 (gl_list_search_from, gl_list_search_from_to): New functions.
147 (gl_list_indexof): Use the indexof_from_to method.
148 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
149 * gl_array_list.c (gl_array_indexof_from_to): Renamed from
150 gl_array_indexof. Add start_index, end_index arguments.
151 (gl_array_search_from_to): Renamed from gl_array_search. Add
152 start_index, end_index arguments.
153 (gl_array_remove, gl_array_list_implementation): Update.
154 * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
155 gl_carray_indexof. Add start_index, end_index arguments.
156 (gl_carray_search_from_to): Renamed from gl_carray_search. Add
157 start_index, end_index arguments.
158 (gl_carray_remove, gl_carray_list_implementation): Update.
159 * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
160 gl_linked_search. Add start_index, end_index arguments.
161 (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
162 start_index, end_index arguments.
163 (gl_linked_remove): Update.
164 * gl_linked_list.c (gl_linked_list_implementation): Update.
165 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
166 * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
168 * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
169 gl_tree_search. Add start_index, end_index arguments.
170 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
171 start_index, end_index arguments.
172 (gl_tree_remove): Update.
173 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
174 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
175 * gl_anytreehash_list1.h (compare_position_threshold): New function.
176 * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
177 gl_tree_search. Add start_index, end_index arguments.
178 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
179 start_index, end_index arguments.
180 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
181 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
183 2006-10-04 Bruno Haible <bruno@clisp.org>
185 * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
187 2006-10-03 Bruno Haible <bruno@clisp.org>
189 * gl_oset.h (gl_setelement_threshold_fn): New type.
190 (gl_oset_search_atleast): New declaration.
191 (struct gl_oset_implementation): Add field 'search_atleast'.
192 (gl_oset_search_atleast): New inline function.
193 * gl_oset.c (gl_oset_search_atleast): New function.
194 * gl_array_oset.c (gl_array_search_atleast): New function.
195 (gl_array_oset_implementation): Update.
196 * gl_anytree_oset.h (gl_tree_search_atleast): New function.
197 * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
198 * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
200 2006-10-04 Jim Meyering <jim@meyering.net>
202 * fts.c (fts_open): Tiny comment change.
204 2006-10-03 Bruno Haible <bruno@clisp.org>
206 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
207 from gl_avltreehash_list_implementation.
209 2006-10-03 Bruno Haible <bruno@clisp.org>
211 * gl_oset.c (gl_oset_add): Fix return type.
213 2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
215 * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
217 2006-10-02 Paolo Bonzini <bonzini@gnu.org> (tiny change)
219 * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
221 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
223 Work around bug in Solaris 10 /proc file system:
224 /proc/self/fd/NNN/.. isn't the parent directory of
225 the directory whose file descriptor is NNN. This needs to
226 be worked around at run time, not compile time, since a
227 program might be built on Solaris 8, where things work, and
229 * openat-priv.h (BUILD_PROC_NAME): Remove. All callers changed
230 to use the following interface instead:
231 (OPENAT_BUFFER_SIZE): New macro.
232 (openat_proc_name): New function.
233 * at-func.c (AT_FUNC_NAME): Adjust to above changes.
234 * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
236 * openat-proc.c: New file.
238 2006-09-29 Bruno Haible <bruno@clisp.org>
240 * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
241 * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
242 argument. Set stdout_closed before testing for ferror, not after.
243 (fwriteerror, fwriteerror_no_ebadf): New functions.
245 2006-09-28 Paolo Bonzini <bonzini@gnu.org>
247 * poll.c (rpl_poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK.
249 2006-09-28 Bruno Haible <bruno@clisp.org>
251 * strndup.h: Simplify the redefinition of strndup.
252 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
254 2006-09-28 Bruno Haible <bruno@clisp.org>
256 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
257 * gl_linkedhash_list.c: Likewise.
258 * gl_rbtreehash_list.c: Likewise.
260 2006-09-28 Jim Meyering <jim@meyering.net>
262 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
265 2006-09-27 Jim Meyering <jim@meyering.net>
267 This file could end up with a definition for a function
268 named __strndup, rather than rpl_strndup on a system with
269 incomplete weak_alias support.
270 * strndup.c (strndup): Rename from __strndup.
271 Remove #defines that used to map __strndup to strndup.
272 Don't use K&R prototypes.
273 Remove LIBC-related code, since this file is not sync'd with glibc.
274 * strndup.h: Revamp, accordingly.
276 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
278 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
281 * __fpending.h: Don't include <stdio_ext.h> unless
282 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
283 it causes <stdio_ext.h> to cause a compile-time error.
284 Problem reported by Nelson H. F. Beebe.
285 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
286 of HAVE_DECL___PENDING.
288 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
290 * savewd.c: Include <signal.h>, for 'raise'.
292 2006-09-26 Eric Blake <ebb9@byu.net>
294 * verror.c: Include <config.h> unconditionally.
296 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
298 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
299 (gl_linked_iterator_from_to): Initialize struct completely.
300 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
301 (gl_tree_iterator_from_to): Likewise
302 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
303 * gl_array_list.c [lint] (gl_array_iterator)
304 (gl_array_iterator_from_to): Likewise.
305 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
306 * gl_carray_list.c [lint] (gl_carray_iterator)
307 (gl_carray_iterator_from_to): Likewise.
309 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
310 * md4.c (md4_process_block): Remove unused variable.
311 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
312 parentheses for clarity.
314 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
316 Import this patch from libc:
318 2006-09-06 Jakub Jelinek <jakub@redhat.com>
320 * regex_internal.c (re_string_reconstruct): Handle
321 offset < pstr->valid_raw_len && pstr->offsets_needed case.
322 Ensure no bytes read before raw_mbs array. Pass a saved copy of
323 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
324 re_string_context_at.
326 2006-09-20 Bruno Haible <bruno@clisp.org>
328 * mkdtemp.c: Import from libc.
329 2006-04-07 Ulrich Drepper <drepper@redhat.com>
330 * sysdeps/posix/tempname.c (__gen_tempname): Change
331 attempts_min into a macro. Use preprocessor to decide how to
332 initialize attempts [Coverity CID 67].
333 2001-11-27 Paul Eggert <eggert@twinsun.com>
334 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
335 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
337 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
339 * mkstemp.h: New file, since some standard headers
341 * mkstemp.c: Revamp to put the !_LIBC code together.
343 Make the _LIBC code resemble glibc original more,
345 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
346 (mkstemp): Remove, since mkstemp.h does this for us.
347 * stdlib--.h: Include mkstemp.h.
349 Import this patch from libc:
351 2006-04-07 Ulrich Drepper <drepper@redhat.com>
353 * tempname.c (__gen_tempname): Change attempts_min
354 into a macro. Use preprocessor to decide how to initialize
355 attempts [Coverity CID 67].
357 2006-09-18 Bruno Haible <bruno@clisp.org>
359 * javaversion.c: Include configmake.h.
361 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
363 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
364 that prevented coreutils 6.1 from building. Problem reported
365 by Petter Reinholdtsen.
367 2006-09-18 Jim Meyering <jim@meyering.net>
369 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
371 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
373 * dirchownmod.c: Don't include fcntl.h; no longer needed.
374 (dirchownmod): New arg FD. All callers changed.
375 Use FD rather than opening the directory ourself, as opening is
376 now the caller's responsibility.
377 * dirchownmod.h: Likewise.
378 * mkancesdirs.c: Include <sys/types.h>, for portability to older
379 hosts that require <sys/types.h> before <sys/stat.h>. Include
380 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
382 (mkancesdirs): Return length of prefix of FILE that has already
383 been made, or -2 if there is a child doing the work. Redo
384 algorithm so that it is O(N) rather than O(N**2). Optimize away
385 ".", and treat ".." specially since it might stray back into
386 already-created areas. Use a subprocess if necessary. New arg
387 WD; all users changed. MAKE_DIR function should now return 1
388 if it creates a directory that is not readable. Return -2 if
389 a child process is spun off.
390 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
391 Adjust signature to match code.
392 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
393 (make_dir_parents): Use a subprocess if necessary. New arg WD;
395 * savewd.c, savewd.h: New files.
397 2006-09-15 Jim Meyering <jim@meyering.net>
399 * rename-dest-slash.c (has_trailing_slash): Use
400 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
401 (rpl_rename_dest_slash): Perform the cheaper trailing slash
402 test before testing whether SRC is a directory.
403 Suggestions from Bruno Haible.
405 Avoid a warning about an unused variable.
406 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
407 into the #ifdef block where it's used.
409 * rename-dest-slash.c: New file.
411 2006-09-14 Bruno Haible <bruno@clisp.org>
413 * allocsa.c: Include <config.h> unconditionally.
414 * asnprintf.c: Likewise.
415 * asprintf.c: Likewise.
416 * c-strcasecmp.c: Likewise.
417 * c-strcasestr.c: Likewise.
418 * c-strncasecmp.c: Likewise.
419 * c-strstr.c: Likewise.
420 * classpath.c: Likewise.
421 * clean-temp.c: Likewise.
422 * concatpath.c: Likewise.
423 * copy-file.c: Likewise.
424 * csharpcomp.c: Likewise.
425 * csharpexec.c: Likewise.
426 * execute.c: Likewise.
427 * fatal-signal.c: Likewise.
428 * findprog.c: Likewise.
429 * fwriteerror.c: Likewise.
430 * gl_array_list.c: Likewise.
431 * gl_array_oset.c: Likewise.
432 * gl_avltree_list.c: Likewise.
433 * gl_avltree_oset.c: Likewise.
434 * gl_avltreehash_list.c: Likewise.
435 * gl_carray_list.c: Likewise.
436 * gl_linked_list.c: Likewise.
437 * gl_linkedhash_list.c: Likewise.
438 * gl_list.c: Likewise.
439 * gl_oset.c: Likewise.
440 * gl_rbtree_list.c: Likewise.
441 * gl_rbtree_oset.c: Likewise.
442 * gl_rbtreehash_list.c: Likewise.
443 * imaxabs.c: Likewise.
444 * imaxdiv.c: Likewise.
445 * javacomp.c: Likewise.
446 * javaexec.c: Likewise.
447 * javaversion.c: Likewise.
448 * linebreak.c: Likewise.
449 * localcharset.c: Likewise.
451 * mbchar.c: Likewise.
452 * mbswidth.c: Likewise.
453 * mkdtemp.c: Likewise.
455 * printf-args.c: Likewise.
456 * printf-parse.c: Likewise.
457 * progname.c: Likewise.
458 * progreloc.c: Likewise.
459 * readlink.c: Likewise.
460 * sh-quote.c: Likewise.
461 * stpcpy.c: Likewise.
462 * stpncpy.c: Likewise.
463 * strcasecmp.c: Likewise.
464 * strcasestr.c: Likewise.
465 * strcspn.c: Likewise.
466 * striconv.c: Likewise.
467 * strncasecmp.c: Likewise.
468 * strnlen1.c: Likewise.
469 * strstr.c: Likewise.
470 * strtok_r.c: Likewise.
472 * tmpdir.c: Likewise.
473 * unicodeio.c: Likewise.
474 * unsetenv.c: Likewise.
475 * vasnprintf.c: Likewise.
476 * vasprintf.c: Likewise.
477 * wait-process.c: Likewise.
478 * xallocsa.c: Likewise.
479 * xsetenv.c: Likewise.
480 * xstriconv.c: Likewise.
482 2006-09-13 Eric Blake <ebb9@byu.net>
484 * getopt.c: Fix typo in last commit.
486 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
488 * _fpending.c: Include <config.h> unconditionally, since we no
489 longer worry about uses that don't define HAVE_CONFIG_H.
490 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
491 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
492 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
493 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
494 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
495 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
496 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
497 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
498 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
499 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
500 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
501 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
502 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
503 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
504 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
505 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
506 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
507 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
508 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
509 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
510 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
511 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
512 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
513 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
514 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
515 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
516 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
517 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
518 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
519 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
520 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
521 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
522 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
523 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
526 2006-09-12 Jim Meyering <jim@meyering.net>
528 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
529 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
530 Reported by Nelson H. F. Beebe.
532 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
534 * argp-help.c (argp_doc): Make sure NULL is not passed to
537 2006-09-10 Bruno Haible <bruno@clisp.org>
539 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
541 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
543 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
544 program_invocation_name and program_invocation_short_name are
546 * argp-namefrob.h: Move declarations of program_invocation_name
547 and program_invocation_short_name to argp.h, so they are visible
551 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
553 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
554 convention. Text proposed by Bruno Haible.
555 (struct argp_option): Document the use of N_() wrappers.
557 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
558 and translate the two parts separately, instead of feeding
559 the whole string to gettext. This allows to exclude
560 '\v' from the strings visible to the translator by writing doc
561 strings as N_("..") "\v" N_("..").
563 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
565 * mktime.c (guess_time_tm): Fix bug where mktime
566 returned the maximum time_t value rather than (time_t) -1.
567 Problem originally reported by William Bardwell
568 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
570 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
572 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
575 2006-09-06 Bruno Haible <bruno@clisp.org>
577 * striconv.h: New file.
578 * striconv.c: New file, merging iconvme.c with GNU gettext's
580 * xstriconv.h: New file.
581 * xstriconv.c: New file.
583 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
585 * argz_.h: Sync from Libtool.
587 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
588 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
590 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
592 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
597 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
599 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
600 Problem reported by Ralf Wildenhues in
601 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
603 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
604 HAVE_STRUCT_STATFS_F_FSTYPENAME.
606 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
608 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
609 or stdbool.h, because they might not exist while configuring.
611 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
612 Don't include unistd.h or limits.h; not needed, since chdir-long.h
614 (O_DIRECTORY): Remove.
616 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
618 Work around a bug in both the Linux and SunOS 64-bit kernels:
619 nanosleep mishandles sleeps for longer than 2**31 seconds.
620 Problem reported by Frank v Waveren in
621 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
622 * nanosleep.c (BILLION): New constant.
623 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
624 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
626 2006-08-30 Jim Meyering <jim@meyering.net>
628 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
631 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
633 * isapipe.c, isapipe.h: New files.
635 2006-08-29 Eric Blake <ebb9@byu.net>
637 * error.c (error_at_line, print_errno_message): Match libc, after
638 resolution of upstream bug 3044.
640 2006-08-29 Bruno Haible <bruno@clisp.org>
642 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
644 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
648 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
650 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
651 sharing with gnulib. Report by Eric Blake.
653 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
655 * fcntl_.h: New file.
656 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
658 * dirchownmod.c: Likewise.
661 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
662 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
663 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
664 just before including <inttypes.h>, to avoid circular inclusion.
666 2006-08-28 Bruno Haible <bruno@clisp.org>
668 * inttypes_.h (SCNX*): Remove definitions.
669 Reported by Eric Blake.
671 2006-08-26 Bruno Haible <bruno@clisp.org>
673 * vasnprintf.c (EOVERFLOW): Remove definition.
674 (VASNPRINTF): Return a string of length > INT_MAX without failing.
675 * vasprintf.c: Include errno.h, limits.h.
676 (EOVERFLOW): New fallback definition.
677 (vasprintf): Test here whether the string length is > INT_MAX.
678 * vsnprintf.c: Include errno.h, limits.h.
679 (EOVERFLOW): New fallback definition.
680 (vsnprintf): Fix bug when generated string was too long for the buffer.
681 Test here whether the string length is > INT_MAX.
683 2006-08-26 Bruno Haible <bruno@clisp.org>
684 Simon Josefsson <jas@extundo.com>
687 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
689 2006-08-28 Bruno Haible <bruno@clisp.org>
691 * c-strstr.h: New file, from GNU gettext.
692 * c-strstr.c: New file, from GNU gettext.
694 2006-08-26 Bruno Haible <bruno@clisp.org>
696 * inttypes_.h: New file.
697 * inttypes.h: Remove file.
698 * stdint_.h: Include <inttypes.h> through its absolute filename.
700 * imaxabs.c: New file.
702 * imaxdiv.c: New file.
704 2006-08-22 Bruno Haible <bruno@clisp.org>
706 * readutmp.h: Skip most definitions if neither <utmp.h> nor
709 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
712 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
713 Problem reported by Bruno Haible.
715 2006-08-21 Bruno Haible <bruno@clisp.org>
718 * mbchar.h: Include <wctype.h> only if it exists.
720 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
722 * cycle-check.h: Include <stdint.h> unconditionally, since we
723 now assume the stdint module. Do not include inttypes.h.
724 * fsusage.h: Likewise.
725 * getndelim2.c: Likewise.
727 * inttostr.h: Likewise.
728 * obstack.c: Likewise.
729 * regex_internal.h: Likewise.
730 * tempname.c: Likewise.
731 * utimecmp.c: Likewise.
732 * xstrtol.h: Likewise.
734 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
736 * strtoimax.c: Adjust to macro name changes in Autoconf,
737 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
740 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
742 * fchmodat.c: New file, from coreutils. This was inadvertently
743 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
745 2006-08-18 Bruno Haible <bruno@clisp.org>
747 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
748 (ME_DUMMY): Treat "kernfs" as a dummy.
749 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
751 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
753 Update from coreutils.
755 * __fpending.h: Add copyright notice.
756 * fprintftime.h: Likewise.
757 * savedir.c: Use (C) in copyright notice.
758 * savedir.h: Likewise.
760 2006-08-15 Jim Meyering <jim@meyering.net>
762 * at-func.c: New file, with the logic of all emulated at-functions.
763 * openat-priv.h: Include <errno.h> and define ENOSYS,
764 in support of the EXPECTED_ERRNO macro.
765 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
766 Instead, define the appropriate symbols and include "at-func.c".
767 * mkdirat.c (mkdirat): Likewise.
768 * fchmodat.c (fchmodat): Likewise.
769 (ENOSYS): Remove definition.
770 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
771 Don't include "unistd--.h" -- it wasn't ever used.
773 2006-01-17 Jim Meyering <jim@meyering.net>
775 Rewrite fts.c not to change the current working directory,
776 by using openat, fstatat, fdopendir, etc..
778 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
779 (HAVE_OPENAT_SUPPORT): Define.
780 [_LIBC] (fchdir): Don't undef or define; no longer used.
781 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
782 Now, this `function' always succeeds, and consumes its file descriptor
783 parameter -- so callers must not close such FDs. Update callers.
784 (diropen_fd, opendirat, cwd_advance_fd): New functions.
785 (diropen): Add parameter, SP. Adjust all callers.
786 Implement using diropen_fd, rather than open.
787 (fts_open): Initialize new member, fts_cwd_fd.
788 Remove fts_rft-setting code.
789 (fts_close): Close fts_cwd_fd, if necessary.
790 (__opendir2): Define in terms of opendir or opendirat,
791 depending on whether the FST_NOCHDIR flag is set.
792 (fts_build): Since fts_safe_changedir consumes its FD, and since
793 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
794 and close the dup'd file descriptor upon failure.
795 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
796 (fts_safe_changedir): Tweak semantics to reflect that this function
797 now calls cwd_advance_fd and hence consumes its FD argument.
798 * fts_.h [struct FTS] (fts_cwd_fd): New member.
799 [struct FTS] (fts_rft): Remove now-unused member.
800 [struct FTS] (fts_cycle.state): Improve comment.
802 * openat.c (openat_needs_fchdir): New function.
803 * openat.h (openat_needs_fchdir): Declare it.
805 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
807 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
808 Problem and fix reported by Pádraig Brady in
809 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
811 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
813 * memcoll.c (memcoll): Optimize for the common case where the
814 arguments are bytewise equal.
816 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
818 Change copyright notice from LGPL 2 to GPL 2, since that's the
819 standard form used in the gnulib repository.
820 * lock.c: LGPL -> GPL.
822 * strnlen1.c: Likewise.
823 * strnlen1.h: Likewise.
826 * tmpdir.c: Likewise.
828 * TODO: Remove; this belongs only in coreutils.
830 2006-08-14 Eric Blake <ebb9@byu.net>
832 Import the following change from libc:
834 2006-08-12 Ulrich Drepper <drepper@redhat.com>
837 * misc/error.c: Add space between program name and message if file
840 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
842 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
843 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
845 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
846 in wchar_t. Problem reported by Eric Blake.
848 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
849 LEN is smaller than SIZE. Suggested by Bruno Haible.
850 Also, help the compiler to keep LEN in a register.
852 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
854 * .cppi-disable: Add snprintf.h, socket_.h.
855 * snprintf.c: Include <errno.h> and <limits.h>.
856 (EOVERFLOW): Define if the system does not.
857 Do not include "minmax.h"; it wasn't used.
858 (snprintf): Don't assume size_t promotes to an unsigned type.
859 Fix bug when generated string was too long for the buffer: the
860 buffer's contents are supposed to be the initial prefix of the
861 output. Don't assume vasnprintf returns EOVERFLOW if the size
862 exceeds INT_MAX; do the check ourselves.
864 Import the following changes from libc:
866 2006-06-02 Jakub Jelinek <jakub@redhat.com>
868 * posix/regex_internal.c (re_string_skip_chars): If no character has
869 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
870 to the byte which couldn't be converted.
871 (re_string_reconstruct): Don't clear valid_raw_len before calling
872 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
873 tip_context using re_string_context_at.
875 2006-05-02 Ulrich Drepper <drepper@redhat.com>
877 * posix/regex.h: g++ still cannot handled [restrict].
879 2006-04-21 Ulrich Drepper <drepper@redhat.com>
881 * posix/regex.h: Remove special handling for VMS.
883 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
887 2006-07-19 Mike Frysinger <vapier@gentoo.org>
889 * mountlist.c [ME_REMOTE]: Filter out cifs.
890 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
892 2006-08-08 Eric Blake <ebb9@byu.net>
894 * verror.c (verror_at_line): Work around glibc bug 2997, so that
895 verror_at_line output complies with GNU Coding Standards even when
898 2006-08-08 Eric Blake <ebb9@byu.net>
900 * verror.h, verror.c: New files.
902 2006-08-07 Bruno Haible <bruno@clisp.org>
904 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
906 Reported by Ralf Wildenhues.
908 2006-08-06 Eric Blake <ebb9@byu.net>
910 * error.h: Fold in some upstream changes from glibc.
913 2006-07-29 Bruno Haible <bruno@clisp.org>
915 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
917 2006-07-29 Bruno Haible <bruno@clisp.org>
919 * setenv.c: Undo unintended modification done on 2006-02-27.
921 2006-07-28 Eric Blake <ebb9@byu.net>
923 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
926 2006-07-28 Simon Josefsson <jas@extundo.com>
928 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
931 2006-07-28 Simon Josefsson <jas@extundo.com>
933 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
936 2006-07-28 Bruno Haible <bruno@clisp.org>
938 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
940 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
942 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
945 2006-07-28 Bruno Haible <bruno@clisp.org>
947 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
948 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
950 Avoids link error on FreeBSD 4.x.
951 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
953 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
955 * mbswidth.c (iswcntrl): Likewise.
957 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
959 * modechange.c (mode_compile): Numeric modes now affect setuid and
960 setgid on directories only if they set these bits.
961 * modechange.h: Remove obsolete comment about masks.
963 2006-07-27 Bruno Haible <bruno@clisp.org>
965 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
966 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
969 2006-07-26 Eric Blake <ebb9@byu.net>
971 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
972 like mingw that lack mkstemp.
973 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
974 avoid compilation warning on mingw.
976 2006-07-25 Bruno Haible <bruno@clisp.org>
978 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
979 <stdarg.h> or config.h.
981 2006-07-24 Bruno Haible <bruno@clisp.org>
983 * clean-temp.h: New file, from GNU gettext.
984 * clean-temp.c: New file, from GNU gettext.
986 2006-07-24 Bruno Haible <bruno@clisp.org>
988 * tmpdir.h: New file, from GNU gettext.
989 * tmpdir.c: New file, from GNU gettext.
991 2006-07-23 Bruno Haible <bruno@clisp.org>
993 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
994 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
995 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
996 gl_linked_remove_at): Use it.
998 2006-07-23 Eric Blake <ebb9@byu.net>
1000 * tmpfile-safer.c: New file.
1001 * stdio-safer.h (fopen_safer): Add prototype.
1002 * stdio--.h (tmpfile): Make safer.
1004 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
1006 * close-stream.c, close-stream.h: New files.
1008 2006-07-22 Bruno Haible <bruno@clisp.org>
1010 Merge from GNU gettext 0.15.
1012 2005-07-05 Bruno Haible <bruno@clisp.org>
1014 * printf-args.c (printf_fetchargs): Work around broken
1015 definition of wint_t on mingw.
1017 2005-02-12 Bruno Haible <bruno@clisp.org>
1019 * xallocsa.h: Add extern "C" for C++.
1021 2006-05-17 Bruno Haible <bruno@clisp.org>
1024 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
1026 2006-04-30 Bruno Haible <bruno@clisp.org>
1028 * progreloc.c: Include <mach-o/dyld.h> if available.
1029 (find_executable): Use _NSGetExecutablePath when possible.
1031 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
1033 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
1036 2005-12-29 Bruno Haible <bruno@clisp.org>
1038 * progreloc.c (set_program_name_and_installdir): Fix
1041 2005-12-04 Bruno Haible <bruno@clisp.org>
1044 * progreloc.c: Include <windows.h> also on Cygwin.
1045 (find_executable): Add support for Cygwin.
1046 (set_program_name_and_installdir): Handle also platforms with
1049 2006-07-11 Bruno Haible <bruno@clisp.org>
1051 * javacomp.c: Fix a comment.
1052 Reported by Jim Meyering.
1054 2006-04-30 Bruno Haible <bruno@clisp.org>
1056 * javacomp.h (compile_java_class): Add source_version,
1057 target_version arguments.
1058 * javacomp.c: Rewritten to choose only a compiler that
1059 respects the specified source_version and target_version.
1061 2006-06-27 Bruno Haible <bruno@clisp.org>
1063 Assume correct S_ISDIR macro.
1064 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
1066 2006-07-22 Bruno Haible <bruno@clisp.org>
1068 * javaversion.h: New file, from GNU gettext.
1069 * javaversion.c: New file, from GNU gettext.
1070 * javaversion.java: New file, from GNU gettext.
1071 * javaversion.class: New file, from GNU gettext.
1073 2006-05-17 Bruno Haible <bruno@clisp.org>
1076 * javaexec.c (execute_java_class): Test for jview program
1079 2006-04-09 Bruno Haible <bruno@clisp.org>
1081 * fatal-signal.c: Don't include string.h.
1082 (at_fatal_signal): Use a copying loop instead of memcpy.
1084 2005-12-04 Bruno Haible <bruno@clisp.org>
1086 * csharpexec.c: Add support for 'clix' launcher (untested).
1087 (execute_csharp_using_sscli): New function.
1088 (execute_csharp_program): Call it.
1090 2006-06-21 Bruno Haible <bruno@clisp.org>
1092 Avoid warnings from recent versions of mcs.
1093 * csharpcomp.c (compile_csharp_using_mono): Don't use options
1094 -o, -L, -r any more. Use options documented since mcs-1.0
1095 instead. Similarly for -g.
1097 2005-07-09 Bruno Haible <bruno@clisp.org>
1099 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
1101 Reported by Mark Junker <mjscod@gmx.de>.
1103 2006-06-17 Bruno Haible <bruno@clisp.org>
1105 * config.charset: Update for NetBSD 3.0.
1107 2006-05-17 Bruno Haible <bruno@clisp.org>
1110 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1112 2006-05-16 Bruno Haible <bruno@clisp.org>
1114 * localcharset.c [CYGWIN]: Include <windows.h>.
1115 (get_charset_aliases): For Cygwin, return the same CPxxx
1116 aliases list as under WIN32.
1117 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1118 the environment variables. Fall back to GetACP().
1120 2006-04-05 Bruno Haible <bruno@clisp.org>
1122 * config.charset: Update Juan Manuel Guerrero's address.
1124 2005-02-12 Bruno Haible <bruno@clisp.org>
1126 * allocsa.h: Add extern "C" for C++.
1128 2005-02-10 Bruno Haible <bruno@clisp.org>
1130 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1131 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1133 2006-07-22 Bruno Haible <bruno@clisp.org>
1135 * gettext.h: Update to GNU gettext-0.15.
1137 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1138 and Simon Josefsson <jas@extundo.com>
1140 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1142 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1144 2006-07-21 Eric Blake <ebb9@byu.net>
1146 * stdlib-safer.h: New file from coreutils, required by
1149 2006-07-19 Derek R. Price <derek@ximbiot.com>
1151 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1152 Reindent and repaginate.
1154 2006-07-17 Bruno Haible <bruno@clisp.org>
1156 * gl_list.h: New file.
1157 * gl_list.c: New file.
1158 * gl_array_list.h: New file.
1159 * gl_array_list.c: New file.
1160 * gl_carray_list.h: New file.
1161 * gl_carray_list.c: New file.
1162 * gl_linked_list.h: New file.
1163 * gl_linked_list.c: New file.
1164 * gl_anylinked_list1.h: New file.
1165 * gl_anylinked_list2.h: New file.
1166 * gl_avltree_list.h: New file.
1167 * gl_avltree_list.c: New file.
1168 * gl_anyavltree_list1.h: New file.
1169 * gl_anyavltree_list2.h: New file.
1170 * gl_rbtree_list.h: New file.
1171 * gl_rbtree_list.c: New file.
1172 * gl_anyrbtree_list1.h: New file.
1173 * gl_anyrbtree_list2.h: New file.
1174 * gl_anytree_list1.h: New file.
1175 * gl_anytree_list2.h: New file.
1176 * gl_linkedhash_list.h: New file.
1177 * gl_linkedhash_list.c: New file.
1178 * gl_anyhash_list1.h: New file.
1179 * gl_anyhash_list2.h: New file.
1180 * gl_avltreehash_list.h: New file.
1181 * gl_avltreehash_list.c: New file.
1182 * gl_rbtreehash_list.h: New file.
1183 * gl_rbtreehash_list.c: New file.
1184 * gl_anytreehash_list1.h: New file.
1185 * gl_anytreehash_list2.h: New file.
1187 * gl_oset.h: New file.
1188 * gl_oset.c: New file.
1189 * gl_array_oset.h: New file.
1190 * gl_array_oset.c: New file.
1191 * gl_avltree_oset.h: New file.
1192 * gl_avltree_oset.c: New file.
1193 * gl_rbtree_oset.h: New file.
1194 * gl_rbtree_oset.c: New file.
1195 * gl_anytree_oset.h: New file.
1197 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1199 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1201 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1202 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1203 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1204 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1205 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1206 callers changed. Revamp internals significantly, by not
1207 attempting to create directories that are temporarily more
1208 permissive than the final results. Do not attempt to use
1209 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1210 This removes some race conditions, fixes some bugs, and simplifies
1211 things. Use new dirchownmod function to do owner and mode changes.
1212 * mkdir-p.h: Likewise.
1213 * modechange.c (octal_to_mode): New function.
1214 (struct mode_change): New member mentioned.
1215 (make_node_op_equals): New arg mentioned. All callers changed.
1216 (mode_compile): Keep track of which mode bits the user has explicitly
1218 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1219 New arg PMODE_BITS, to keep track of which mode bits the user
1220 mentioned; it treats S_ISUID and S_ISGID speciall.
1221 All callers changed.
1222 * modechange.h: Likewise.
1224 2006-07-11 Derek R. Price <derek@ximbiot.com>
1226 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1228 2006-07-10 Derek R. Price <derek@ximbiot.com>
1230 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1231 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1232 macros into the GNU _D_EXACT_NAMLEN.
1233 * savedir.c: Likewise.
1234 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1236 2006-07-09 Jim Meyering <jim@meyering.net>
1238 * argp-pv.c: Remove a doubled word in a comment.
1239 * check-version.c (check_version): Likewise.
1240 * javacomp.c (compile_java_class): Likewise.
1242 2006-07-08 Jim Meyering <jim@meyering.net>
1244 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1246 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1248 * getaddrinfo.c: Changes to compile under MSVC6: changed
1249 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1250 brackets. Other minor changes to suppress some compiler
1253 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1255 * getloadavg.c: Use __VMS, not VMS.
1256 * getopt.c: Likewise.
1257 * getpagesize.h: Likewise.
1258 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1259 probably does not work.
1261 2006-07-06 Derek R. Price <derek@ximbiot.com>
1262 and Paul Eggert <eggert@cs.ucla.edu>
1264 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1265 Don't worry about this obsolete case any more.
1266 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1268 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1269 worry about this obsolete case any more.
1271 * getcwd.c: Likewise.
1273 * savedir.c: Likewise.
1275 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1277 * .cppi-disable: Add wcwidth.
1278 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1279 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1280 (ISGRAPH): Remove. All uses changed to isgraph.
1281 (FOLD) [!defined _LIBC]: Remove special case.
1282 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1283 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1285 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1287 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1289 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1291 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1293 * memcasecmp.c: Include <limits.h>.
1294 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1295 * strtod.c (strtod): Don't assume isspace works on negative chars.
1296 Don't assume isdigit succeeds only on '0' through '9'.
1298 2006-07-05 Derek R. Price <derek@ximbiot.com>
1300 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1301 All uses of is_space replaced by isspace.
1302 * exit.h: Don't talk about STDC_HEADERS.
1303 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1304 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1305 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1306 replaced by isprint etc.
1307 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1308 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1309 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1310 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1311 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1312 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1314 2006-07-05 Eric Blake <ebb9@byu.net>
1316 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1317 missing from netdb.h.
1318 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1320 2006-06-27 Bruno Haible <bruno@clisp.org>
1322 Assume ANSI C header files and <ctype.h> functions.
1323 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1324 (mbsnwidth): Use isprint, iscntrl instead.
1326 2006-07-03 Jim Meyering <jim@meyering.net>
1328 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1329 macro is used before the first cycle_check call.
1331 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1333 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1334 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1335 reported by Mark D. Baushke, one in
1336 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1338 Merge from coreutils.
1340 * .cppi-disable: Add stdint_.h.
1341 * .cvsignore: Add stdint.h.
1343 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1345 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1346 both double and long double versions.
1347 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1348 * xstrtold.c: New file.
1349 * xstrtod.h (xstrtold): New decl.
1351 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1353 * filemode.c (setst): Remove.
1354 (strmode): Rewrite to avoid setst. This makes the code shorter,
1355 (arguably) clearer, and the generated code is a bit smaller on my
1356 Debian GNU/Linux stable x86 host.
1358 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1360 * filemode.c: Include "filemode.h" first, to test the interface.
1361 Assume that filemode.h includes sys/types.h and sys/stat.h.
1362 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1363 (ftypelet): Reorder to put common cases first, for efficiency.
1364 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1366 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1367 of 10, for compatibility with FreeBSD. All callers changed.
1368 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1369 that can't be deduced solely from st_mode. First arg is now a const
1371 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1372 (strmode): Renamed from mode_string.
1373 (filemodestring): New decl.
1374 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1375 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1376 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1378 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1380 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1381 fsusage.h now does that. Include fsusage.h first, to test interface.
1382 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1383 at most one method (the old code could have generated decls that
1384 didn't conform to C89, not that this was ever exercised).
1385 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1387 2006-03-19 Jim Meyering <jim@meyering.net>
1389 Work even in a chroot where d_ino values for entries in "/"
1390 don't match the stat.st_ino values for the same names.
1391 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1392 number, iterate through all entries again, using lstat instead.
1393 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1394 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1396 * getcwd.c (__getcwd): Clarify a comment.
1397 Use memcpy in place of a call to strcpy.
1399 2006-03-12 Jim Meyering <jim@meyering.net>
1401 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1402 that of the current directory (which we're about to chdir ".." out of),
1403 then save the dev-ino of the parent, instead.
1405 * same-inode.h (SAME_INODE): New file/macro.
1406 * chdir-safer.c (SAME_INODE): Remove definition.
1407 Include "same-inode.h", instead.
1409 * cycle-check.h: Include "same-inode.h".
1410 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1411 * cycle-check.c (SAME_INODE): Remove definition.
1412 * root-dev-ino.h: Include "same-inode.h".
1414 2006-03-11 Eric Blake <ebb9@byu.net>
1416 * same.c (same_name): s/base_name/last_component/
1417 * backupfile.c (check_extension, numbered_backup): Likewise.
1418 * filenamecat.c (file_name_concat): Likewise.
1420 2006-03-11 Eric Blake <ebb9@byu.net>,
1421 Paul Eggert <eggert@cs.ucla.edu>
1423 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1424 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1426 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1427 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1428 (last_component): New method.
1429 * dirname.c (dir_len): Determine when drive letters need a
1430 subsequent slash. Preserve // when it is special.
1431 (dir_name): Don't append dot when drive letter is absolute.
1432 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1433 * basename.c (base_name): New semantics - malloc the result.
1434 Preserve // when it is special. Preserve relative files that look
1436 (base_len): Preserve // when it is special.
1437 (last_component): New method, similar to old base_name semantics.
1438 * stripslash.c (strip_trailing_slashes): Use last_component, not
1439 base_name. Strip redundant slashes from ///.
1441 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1443 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1444 both are 64 bits, since this seems to be the tradition, and this
1445 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1446 we ever run into a host that prefers long long to long in this
1447 case, we'll need another configure-time test. Problem reported by
1450 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1452 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1453 possible collision with system files.
1454 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1455 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1456 WCHAR_MIN and WCHAR_MAX in this case.
1457 (<stddef.h>): Do not include; no longer needed.
1458 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1459 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1460 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1461 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1462 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1463 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1464 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1465 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1466 !defined(__c99))]: Include in this case too, since it's harmless
1468 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1470 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1471 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1472 (_STDINT_MIN, _STDINT_MAX): New macros.
1473 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1474 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1475 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1476 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1477 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1478 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1479 macros, not typedefs; this simplifies things quite a bit.
1480 Use long int for all types narrower than int64_t.
1481 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1482 Define in terms of long long int or int64_t or long int,
1483 not int64_t or int32_t. This saves some compile-time testing.
1484 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1485 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1486 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1487 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1488 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1489 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1490 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1491 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1492 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1493 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1494 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1495 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1496 undef any previous version and define our own version, for
1497 simplicity and consistency with the new macros for types.
1498 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1499 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1500 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1501 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1502 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1503 @WINT_T_SUFFIX@ to keep things simple here.
1504 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1505 Simplify by assuming typical 8/16/32/64 host, since we're
1506 already doing that elsewhere anyway.
1507 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1508 and assume long long int is 64 bits if available. This
1509 speeds up 'configure'.
1511 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1513 * getaddrinfo.c: fixed typo
1515 2006-06-29 Eric Blake <ebb9@byu.net>
1517 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1518 unused static function.
1520 2006-06-29 Eric Blake <ebb9@byu.net>
1522 * stat_.h: New file.
1524 2006-06-29 Derek R. Price <derek@ximbiot.com>
1526 * strftime.c: Assume strftime() exists.
1528 2006-06-28 Bruno Haible <bruno@clisp.org>
1530 * getaddrinfo.h: Fix POSIX URL.
1531 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1532 (use_win32_p): Make static.
1533 (getaddrinfo): Reject service name if it is empty or does not consist
1534 solely of decimal digits, or if its value is > 65535.
1535 (getnameinfo): Remove useless casts.
1537 2006-06-28 Derek R. Price <derek@ximbiot.com>
1539 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1540 Autoconf 2.60 says this stuff was obsolete.
1542 2006-05-12 Bruno Haible <bruno@clisp.org>
1544 * mkdtemp.c [MINGW]: Include <io.h>.
1545 (mkdir): Define using _mkdir.
1547 2006-06-28 Bruno Haible <bruno@clisp.org>
1549 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1550 declaration for wcwidth.
1551 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1553 2006-06-28 Eric Blake <ebb9@byu.net>
1555 * xvasprintf.h: Fix comments.
1557 2006-06-28 Eric Blake <ebb9@byu.net>
1559 * mbchar.h (wcwidth): Include wcwidth.h.
1560 * mbswidth.c (wcwidth): Move from here...
1561 * wcwidth.h: ...to this new file.
1563 2006-06-28 Simon Josefsson <jas@extundo.com>
1565 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1566 functions there. It will succeed on Windows XP, but on Windows
1567 2000 and (presumably) earlier, it will fail, and use the internal
1569 (use_win32_p): New function.
1570 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1571 Support AI_NUMERICSERV to disable getservbyname.
1572 (getnameinfo): New function, only supports
1573 NI_NUMERICHOST|NI_NUMERICSERV for now.
1575 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1576 only have some of them. Add AI_NUMERICSERV. Add prototype for
1579 2006-06-27 Bruno Haible <bruno@clisp.org>
1581 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1583 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1585 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1586 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1587 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1589 2006-06-26 Bruno Haible <bruno@clisp.org>
1591 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1593 Reported by Mark D. Baushke and Larry Jones.
1595 2006-06-26 Bruno Haible <bruno@clisp.org>
1597 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1599 Suggested by Mark D. Baushke and Larry Jones.
1601 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1603 * stdint_.h: Treat BSD/OS like OpenBSD.
1605 2006-06-23 Bruno Haible <bruno@clisp.org>
1607 * stdint_.h: Treat IRIX like OpenBSD.
1609 2006-06-23 Bruno Haible <bruno@clisp.org>
1611 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1612 ISO C 99 Technical Corrigendum 1.
1614 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1616 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1617 Some compiler complained about some of them. Problem reported by
1619 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1621 2006-06-21 Simon Josefsson <jas@extundo.com>
1623 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1626 * socket_.h: Don't define WINVER.
1628 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1629 slightly modified to work in gnulib.
1631 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1633 * read-file.c (fread_file): Start with buffer allocation of
1634 0 bytes rather than 1 byte; this simplifies the code.
1635 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1636 code to free buffer and save/restore errno.
1637 (internal_read_file): Remove unused local.
1639 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1641 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1642 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1643 Problem reported by Denis Excoffier in
1644 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1646 2006-06-19 Simon Josefsson <jas@extundo.com>
1648 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1650 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1652 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1654 2006-06-17 Bruno Haible <bruno@clisp.org>
1656 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1658 2006-06-17 Bruno Haible <bruno@clisp.org>
1660 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1661 problem on Solaris 2.5.1.
1663 2006-06-16 Eric Blake <ebb9@byu.net>
1665 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1666 * unicodeio.c [!defined errno]: Likewise.
1667 * strtol.c [!defined errno]: Likewise.
1668 * strtod.c [!defined errno]: Likewise.
1670 2006-06-15 Bruno Haible <bruno@clisp.org>
1672 * stdint_.h: Rewritten to be fully auto-configured.
1673 Fixes bug on HP-UX/IA64.
1675 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1677 * getdate.y (__attribute__): Don't define if already defined.
1678 Problem reported by Larry Jones.
1679 * utimens.c (__attribute__): Likewise.
1681 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1683 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1684 reported by Andreas Schwab.
1686 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1687 Bruno Haible <bruno@clisp.org>
1689 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1691 2006-05-26 Martin Lambers <marlam@marlam.de>
1693 * getpass.c: Updates the test for the native W32 API, and adds
1694 missing includes, thus fixing compilation warnings.
1696 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1698 * tempname.c (small_open, large_open): New macros.
1699 (__open, __open64) [!_LIBC]: Remove.
1700 (__gen_tempname): Use small_open and large_open instead of __open
1701 and __open64. This fixes a portability bug on HP-UX 11.11i
1702 reported by Simon Wing-Tang in
1703 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1705 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1707 * exclude.c (exclude_fnmatch): New function.
1708 (excluded_file_name): Call exclude_fnmatch.
1709 * exclude.h (excluded_file_name): New prototype
1711 2006-05-24 Bruno Haible <bruno@clisp.org>
1713 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1714 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1715 Reported by Thorsten Maerz <torte@netztorte.de> via
1716 Aaron Stone <aaron@serendipity.cx>.
1718 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1720 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1721 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1722 (my_usleep): Don't mishandle maximum value.
1724 2006-05-19 Jim Meyering <jim@meyering.net>
1726 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1728 2006-05-17 Bruno Haible <bruno@clisp.org>
1731 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1733 2006-05-17 Bruno Haible <bruno@clisp.org>
1735 * stdint_.h: Fix recognition of Cygwin.
1737 2006-05-11 Jim Meyering <jim@meyering.net>
1739 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1741 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1743 * crc.c (crc32_update): Remove unnecessary L suffix.
1744 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1745 unwanted sign propagation, e.g., on hosts with 64-bit int.
1746 There still are some problems with reeelly weird theoretical hosts
1747 (e.g., 33-bit int) but it's not worth worrying about now.
1748 * sha1.c (rol): Likewise.
1749 (K1, K2, K3, K4): Remove unnecessary L suffix.
1751 2006-05-10 Bruno Haible <bruno@clisp.org>
1753 * des.c: Cast to avoid warnings.
1755 2006-05-10 Simon Josefsson <jas@extundo.com>
1757 * md4.c: Typo fix, update copyright years.
1758 (K1, K2): Don't use L because it turn computations into 64-bit on
1761 2006-05-09 Bruno Haible <bruno@clisp.org>
1763 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1764 (EOVERFLOW): Define fallback value.
1765 (xstrcat): New function.
1766 (xvasprintf): Recognize the special case of a string concatenation.
1768 2006-05-01 Bruno Haible <bruno@clisp.org>
1770 * stdint_.h: Shorter URL.
1771 * inttypes.h: Likewise.
1773 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1775 * verify.h: Document the internals better. Most of this change
1776 was written by Bruno Haible.
1778 2006-04-29 Bruno Haible <bruno@clisp.org>
1780 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1781 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1783 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1785 * getdate.y (get_date): When adding relative date, start with the
1786 initial time, not with the result of the first mktime call.
1788 2006-04-23 Bruno Haible <bruno@clisp.org>
1790 * copy-file.c: Include <unistd.h> unconditionally.
1791 * execute.c: Likewise.
1792 * fatal-signal.c: Likewise.
1793 * findprog.c: Likewise.
1794 * mkdtemp.c: Likewise.
1797 * wait-process.h: Likewise.
1799 2006-04-23 Bruno Haible <bruno@clisp.org>
1801 * fwriteerror.c (fwriteerror): Call fclose also when an error
1802 condition was already detected.
1803 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1805 2006-04-19 Derek Price <derek@ximbiot.com>
1806 Eric Blake <ebb9@byu.net>
1808 * inttypes.h: Correct grammar in comment.
1810 2006-04-18 Derek Price <derek@ximbiot.com>
1811 Paul Eggert <eggert@cs.ucla.edu>
1813 * inttypes.h: New file.
1814 * strtoimax.c: Assume <inttypes.h>.
1816 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1818 * utimens.c (futimens): glibc futimesat messes up if /proc
1819 isn't mounted. Problem reported by Kir Kolyshkin.
1821 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1823 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1824 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1825 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1827 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1829 Merge regex changes from libc, removing some of our
1830 POSIX-conformance changes that were rejected and redoing them in a
1833 * regcomp.c (re_compile_internal, init_dfa):
1834 Length arg is now size_t, not Idx. All uses changed.
1835 (peek_token): Forward decl now says internal_function.
1836 (__re_error_msgid, __re_error_msgid_idx):
1837 Now static rather than extern with attribute_hidden.
1838 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1839 For some reason libc prefers K&R style defns for external functions.
1840 (regerror) [!defined _LIBC]: Likewise.
1841 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1842 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1843 (build_range_exp, build_collating_symbol):
1845 (re_compile_fastmap): Use '\0' to memset, not 0.
1846 (utf8_sb_map): Make the calculations more obvious.
1847 (init_dfa, parse_bracket_exp, build_charclass_op):
1848 Call calloc and cast result, as glibc does.
1849 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1850 (build_range_exp, build_collating_symbol):
1851 Now internal functions.
1853 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1855 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1856 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1857 Don't depend on VMS; depend on __VMS instead, for POSIX
1858 namespace cleanness.
1859 (regoff_t): Define to ssize_t, not long int.
1861 Remove the REG_ macros named below. Instead, make the old names
1862 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1864 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1865 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1866 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1867 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1868 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1869 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1870 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1871 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1872 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1873 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1874 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1875 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1876 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1877 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1878 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1879 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1880 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1882 Remove. All uses replaced by the old RE_* names.
1883 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1884 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1885 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1886 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1887 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1888 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1889 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1890 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1891 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1892 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1893 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1894 Don't bother having these macros be independent of each others'
1895 values, since they no longer exist in the POSIX name space.
1897 Rename the following member names back to their old names,
1898 unless !__USE_GNU_REGEX. All uses changed back.
1899 (buffer): Renamed from re_buffer.
1900 (allocated): Renamed from re_allocated.
1901 (used): Renamed from re_used.
1902 (syntax): Renamed from re_syntax.
1903 (fastmap): Renamed from re_fastmap.
1904 (translate): Renamed from re_translate.
1905 (can_be_null): Renamed from re_can_be_null.
1906 (regs_allocated): Renamed from re_regs_allocated.
1907 (fastmap_accurate): Renamed from re_fastmap_accurate.
1908 (no_sub): Renamed from re_no_sub.
1909 (not_bol): Renamed from re_not_bol.
1910 (not_eol): Renamed from re_not_eol.
1911 (newline_anchor): Renamed from re_newline_anchor.
1912 (num_regs): Renamed from rm_num_regs.
1913 (start): Renamed from rm_start.
1914 (end): Renamed from rm_end.
1916 (free_state): Move up a bit.
1918 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1919 #define to be empty.
1920 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1921 when that is what is intended.
1922 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1923 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1925 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1926 All uses changed back to re_malloc, etc. It's now the caller's
1927 responsibility to check for overflow; all callers changed.
1928 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1929 (re_x2nrealloc): Remove.
1930 (free_state): Remove decl.
1932 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1933 (re_set_registers, re_exec):
1936 2006-01-31 Roland McGrath <roland@redhat.com>
1938 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1939 Reported by Mike Frysinger <vapier@gentoo.org>.
1941 2006-01-15 Andreas Jaeger <aj@suse.de>
1944 * regex_internal.c (re_string_reconstruct): Adjust for
1945 build_wcs_upper_buffer change.
1946 (build_wcs_upper_buffer): Change return type.
1948 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1950 * regex_internal.h: Include <stdint.h> if available.
1952 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1954 * regex_internal.h (SIZE_MAX): Provide a default definition.
1956 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1958 * regcomp.c: Adjust for changed secondary hash function.
1960 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1962 * regex.h: Pretty printing.
1963 Clean up namespace a bit.
1965 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1967 * regexec.c (update_cur_sifted_state, check_arrival,
1968 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1970 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1971 Ulrich Drepper <drepper@redhat.com>
1974 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1975 (bitset_word_t): Renamed from bitset_word. All uses changed.
1977 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1980 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1981 * regcomp.c: Remove unnecessary uses of
1982 unsigned RE_TRANSLATE_TYPE.
1983 * regex_internal.h: Likewise.
1984 * regex_internal.c: Likewise.
1985 * regexec.c: Likewise.
1986 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1988 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1990 * regexec.c (find_recover_state): Remove unnecessary
1992 (transit_state_bkref): Make DFA a const pointer.
1993 (get_subexp): Likewise.
1994 (check_arrival): Likewise.
1995 (update_cur_sifted_state): Likewise.
1996 (re_search_internal): Likewise.
1997 (prune_impossible_nodes): Likewise.
1998 (acquire_init_state_context): Likewise.
1999 (proceed_next_node): Likewise.
2000 (set_regs): Likewise.
2001 (free_fail_stack_return): Likewise.
2002 (check_arrival_expand_ecl): Mark DFA parameter as const.
2003 (check_arrival_expand_ecl_sub): Likewise.
2004 (check_subexp_limits): Likewise.
2005 (sub_epsilon_src_nodes): Likewise.
2006 (add_epsilon_src_nodes): Likewise.
2007 (merge_state_array): Likewise.
2008 (update_regs): Likewise.
2009 (build_trtable): Likewise.
2010 (sift_states_backward): Mark MCTX parameter as const.
2011 (build_sifted_states): Likewise.
2012 (update_cur_sifted_state): Likewise.
2013 (sift_states_mkref): Likewise.
2014 (check_arrival_expand_ecl): Mark eclosure as const.
2015 (check_dst_limits_calc_pos_1): Likewise.
2016 * regex_internal.h (re_match_context_t): Make dfa a const
2019 2005-09-06 Ulrich Drepper <drepper@redhat.com>
2021 * regexec.c (merge_state_with_log): Define dfa as const pointer.
2022 (transit_state_sb): Likewise.
2023 (transit_state_mb): Likewise.
2024 (sift_states_iter_mb): Likewise.
2025 (check_arrival_add_next_nodes): Likewise.
2026 (check_node_accept_bytes): Change first parameter to pointer-to-const.
2027 [_LIBC] (re_search_2_stub): Use mempcpy.
2029 * regex_internal.c (re_string_reconstruct): Avoid calling
2030 mbrtowc for very simple UTF-8 case.
2032 * regex_internal.c (re_acquire_state): Make DFA pointer arg
2034 (re_acquire_state_context): Likewise.
2035 * regex_internal.h: Adjust prototypes.
2037 * regex.c: Prevent using C++ compilers.
2039 * regex_internal.c (re_acquire_state): Minor code rearrangement.
2040 (re_acquire_state_context): Likewise.
2042 2006-03-29 Mark D. Baushke <mdb@gnu.org>
2043 Bruno Haible <bruno@clisp.org>
2045 * stdint_.h: On OpenBSD, don't redefine types already included in
2046 <sys/types.h> and <inttypes.h>.
2048 2006-03-24 Eric Blake <ebb9@byu.net>
2050 * time_r.c (copy_string_result): Remove, as it is no longer used.
2052 2006-03-24 Simon Josefsson <jas@extundo.com>
2054 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
2055 including some doc fixes.
2056 (base64_encode_alloc): Fix +1 bug on allocation failures.
2058 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2060 * base64.c (base64_encode): Do not read past end of array with
2061 unsanitized input on systems with CHAR_BIT > 8.
2063 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2065 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
2066 Typedef to long int, not to off_, as POSIX will likely change
2069 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
2071 * argp-help.c (validate_uparams): Fix typo
2072 * argp-parse.c (argp_default_options): Consistently begin help
2073 messages with a lowercase letter.
2075 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
2077 * time_r.h (asctime_r, ctime_r): Remove. These functions can
2078 overrun buffers and shouldn't be used (much as gets shouldn't be
2080 * time_r.c (asctime_r, ctime_r): Likewise.
2082 2006-03-08 Simon Josefsson <jas@extundo.com>
2084 * gc-gnulib.c (randomize): Don't open files called 'no', they
2085 signal that configure disabled the device.
2087 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
2089 * c-stack.c: Include unistd.h unconditionally, since we now assume
2091 * getlogin_r.c: Likewise.
2092 * getlogin_r.h: Likewise.
2094 * pagealign_alloc.c: Likewise.
2095 * unistd_.h: Remove; no longer needed.
2097 2006-03-07 Simon Josefsson <jas@extundo.com>
2099 * unistd_.h: New file.
2101 2006-03-07 Simon Josefsson <jas@extundo.com>
2103 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
2105 2006-03-01 Simon Josefsson <jas@extundo.com>
2107 * readline.c: Fix typo, tiny patch from Stepan Kasal
2110 2006-02-28 Simon Josefsson <jas@extundo.com>
2112 * getopt.c: Protect #include of unistd.h, for MSVS.
2114 2006-02-27 Simon Josefsson <jas@extundo.com>
2116 * base64.h: Indent #define's. From Jim Meyering
2119 2006-02-27 Jim Meyering <jim@meyering.net>
2121 Revert the change of 2006-02-24, so these files can continue
2122 to be sync'd from gettext.
2123 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2126 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2128 * glob.c: Say "invalid" rather than "illegal" in comments.
2130 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2132 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2134 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2136 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2137 AT_FDCWD exceeds INT_MAX.
2138 * openat.h (AT_FDCWD): Likewise.
2140 2006-02-14 Jim Meyering <jim@meyering.net>
2142 Sync from coreutils.
2144 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2145 failure on deficient systems, and simplify gnulib lgpl dependencies.
2146 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2147 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2149 * xalloc-die.c: Remove unused definition of N_.
2151 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2153 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2155 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2157 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2158 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2160 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2162 * argp-namefrob.h: Restore changes accidentally lost during the
2163 "autoupdate" on 2005-12-12.
2165 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2167 * fnmatch.c (L_): Renamed from L, to work around a bug in
2168 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2169 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2172 2006-01-26 Simon Josefsson <jas@extundo.com>
2174 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2175 prototype is visible on mingw32.
2177 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2180 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2183 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2185 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2186 attempt to open for write; this always fails, at least on POSIX
2187 hosts. This reinstates the 2006-01-09 change, which was
2188 inadvertently removed.
2190 2006-01-26 Bruno Haible <bruno@clisp.org>
2191 Paul Eggert <eggert@cs.ucla.edu>
2193 * stdbool_.h (_Bool)
2194 [(! (defined __cplusplus || defined __BEOS__)
2195 && !defined __GNUC__
2196 && !(defined __HP_cc || defined __xlc__
2197 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2198 || defined __sgi))]:
2199 #define to signed char in these cases too; this simplifies
2200 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2201 etc., separately) and makes it more conservative.
2203 2006-01-21 Jim Meyering <jim@meyering.net>
2205 Sync from the stable (b5) branch of coreutils:
2207 * fts.c (fts_children): Don't let close() clobber errno from
2210 * fts.c (fts_stat): When following a symlink-to-directory,
2211 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2212 a dangling symlink. That can also happen at least for ELOOP.
2213 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2214 FYI, this bug predates the inclusion of fts.c in coreutils.
2216 * fts.c (fts_open): Put new maxarglen declaration and uses
2217 in their own block, so pre-c99 compilers don't object.
2219 Avoid the double-free (first in fts_read, second in fts_close) that
2220 would occur when an `active' directory is made inaccessible (e.g.,
2221 via chmod a-x) during a traversal.
2222 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2223 before returning. Reproduce this failure by
2224 mkdir -p a/b; cd a; chmod a-x . b
2225 Reported by Stavros Passas.
2227 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2229 * argp-namefrob.h: Bugfix. Remove stray #
2231 2006-01-25 Bruno Haible <bruno@clisp.org>
2233 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2235 Reported by Paul Eggert.
2237 2006-01-25 Jim Meyering <jim@meyering.net>
2239 * fileblocks.c: Remove more useless parentheses.
2240 * readutmp.h: Likewise.
2242 2006-01-24 Bruno Haible <bruno@clisp.org>
2244 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2246 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2249 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2250 to avoid problems with the built-in _Bool type.
2251 Reported by Paul Eggert on 2005-11-26.
2253 2006-01-24 Jim Meyering <jim@meyering.net>
2255 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2257 2006-01-24 Simon Josefsson <jas@extundo.com>
2259 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2262 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2264 Work around porting bugs reported by Dieter in
2265 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2266 * getopt.c (_NOPROTO): Remove; no longer needed.
2267 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2268 Include "getopt.h" first, to check interface.
2269 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2271 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2272 (__strndup): Revert to K&R-style function dfns, the glibc style.
2273 * strnlen.c: Don't claim it's taken from glibc; it's not.
2274 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2275 Include strnlen.h first, to get prototype properly.
2276 (strnlen): Renamed from __strnlen.
2279 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2281 These changes imported from libc.
2282 * getopt.c: Use __fxprintf instead of inline stream orientation
2283 test and two separate function calls.
2284 * strndup.c (__strndup): Add libc_hidden_def.
2286 2006-01-22 Bruno Haible <bruno@clisp.org>
2288 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2289 temporary buffer for sprintf, take into account the precision also
2290 for 'd', 'i', 'u', 'o', 'x', 'X'.
2292 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2294 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2295 to pacify gcc -Wswitch-default.
2297 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2299 * argp-help.c (usage_long_opt): Do not print DOC options.
2300 (__argp_base_name): Removed
2301 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2303 (__argp_base_name): Provide macro definition or extern declaration
2304 depending on the configuration
2306 2006-01-20 Simon Josefsson <jas@extundo.com>
2308 * inet_ntop.h: Unconditionally include sys/socket.h.
2310 2006-01-19 Simon Josefsson <jas@extundo.com>
2312 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2314 2006-01-12 Simon Josefsson <jas@extundo.com>
2316 * base64.c: Fix warning, reported by Bruno Haible
2317 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2319 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2321 Sync from coreutils.
2322 * md5.c: Fix commentary typos.
2323 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2324 * md5.h (__attribute__): Remove; unused.
2325 * sha1.c: Fix commentary to match md5 better.
2326 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2327 so that we don't need to worry about alignment. All uses changed.
2328 This merges the 2005-10-28 md5 change into sha1.
2330 2006-01-11 Jim Meyering <jim@meyering.net>
2332 Sync from coreutils.
2333 * md5.c (OP): Fix spacing.
2335 2006-01-11 Simon Josefsson <jas@extundo.com>
2337 * stdint_.h (SIZE_MAX): Add missing (.
2339 2006-01-10 Bruno Haible <bruno@clisp.org>
2341 * argp.h (__const): Remove macro. Use const instead.
2342 * argp-fmtstream.h (__const): Likewise.
2343 * glob_.h (__const): Remove macro.
2344 * glob-libc.h: Use const instead of __const.
2346 2006-01-10 Jim Meyering <jim@meyering.net>
2348 Avoid the double-free (first in fts_read, second in fts_close) that
2349 would occur when an `active' directory is made inaccessible (e.g.,
2350 via chmod a-x) during a traversal.
2351 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2352 before returning. Reproduce this failure by
2353 mkdir -p a/b; cd a; chmod a-x . b
2354 Reported by Stavros Passas.
2356 Sync from coreutils.
2357 * sha1.c: Tweak grammar in a comment.
2359 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2361 * regex_internal.h (BITSET_WORD_BITS):
2362 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2363 preprocessor mishandles large unsigned values as if they were signed.
2364 Problem reported by Claudio Fontana in
2365 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2367 2006-01-10 Simon Josefsson <jas@extundo.com>
2369 * socket_.h: New file.
2371 2006-01-10 Bruno Haible <bruno@clisp.org>
2373 * localcharset.c: Update from GNU gettext.
2375 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2377 Sync from coreutils.
2378 * chdir-long.c (cdb_free): Don't bother trying to open directory
2379 for write access: POSIX says that must fail.
2380 * fts.c (diropen): Likewise.
2381 * save-cwd.c (save_cwd): Likewise.
2382 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2383 well, for minor improvements on hosts that lack O_DIRECTORY.
2384 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2385 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2386 Fall back on chown if open failed with EACCES.
2388 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2389 Report an error at compile-time if only a 1-second nominal clock
2390 resolution is found.
2392 * lchmod.h: New file.
2393 * mkdir-p.c: Include lchmod.h, lchown.h.
2394 (make_dir_parents): Use lchown rather than chown, and
2395 lchmod rather than chmod.
2397 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2398 too. Problem with "none" reported by Bob Proulx. Problem with
2399 "proc" reported by n0dalus.
2401 * mountlist.c: Include <limits.h>.
2402 (dev_from_mount_options)
2403 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2404 New function. It no longer assumes "dev=" has the System V meaning
2405 on Linux (since it doesn't). It also parses "dev=" more carefully.
2406 (read_file_system_list)
2407 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2408 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2411 * posixtm.h (PDS_PRE_2000): New macro.
2412 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2413 All usages changed. Reject dates outside the range 1969-1999 if
2414 PDS_PRE_2000 is used.
2416 2006-01-09 Jim Meyering <jim@meyering.net>
2418 Sync from coreutils.
2420 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2422 * chdir-safer.h, chdir-safer.c: New files.
2424 * modechange.c (mode_compile): Reject an invalid mode string
2425 that starts with an octal digit. From Andreas Gruenbacher.
2427 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2428 and dup to open_safer and dup_safer, respectively.
2429 (openat_permissive): Fix typo in comment.
2431 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2432 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2433 (_): Remove; no longer needed.
2434 (openat): Renamed from rpl_openat; no need for rpl_openat
2435 since openat.h renames openat for us.
2436 Replace most of the body with a call to openat_permissive,
2437 to avoid duplicate code.
2438 Port to (probably hypothetical) environments were mode_t is
2440 (openat_permissive): Require mode arg, so that we can check
2441 types better. Put it just after flags. Change cwd failure
2442 indicator from pointer-to-bool to pointer-to-errno-value.
2443 All callers changed.
2444 Invoke openat_save_fail and/or openat_restore_fail if
2445 cwd_errno is null, so that openat can call us.
2446 (openat_permissive, fdopendir, fstatat, unlinkat):
2447 Simplify errno handling to avoid some duplicate code,
2448 as it's OK to set errno on success.
2449 * openat.h: Revamp code so that function macros depend on
2450 __OPENAT_PREFIX only, not also on AT_FDCWD.
2451 (openat_ro): Remove. Caller changed to use openat_permissive.
2452 (openat_permissive): Now a macro, if not a function.
2453 (openat_restore_fail, openat_save_fail): Now always functions,
2454 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2456 * openat-priv.h: New file, defining macros used by mkdirat.c
2458 * mkdirat.c: Include openat-priv.h.
2459 Remove definitions of macros defined therein.
2460 * openat.c: Likewise.
2462 * mkdirat.c (mkdirat): New file and function.
2463 * openat.h (mkdirat): Declare.
2465 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2467 * openat.h (openat_permissive): Declare.
2468 (openat_ro): Define.
2470 * openat.c (EXPECTED_ERRNO): New macro.
2471 (openat_permissive): New function -- used in remove.c rewrite.
2472 (all functions): Set errno just before returning, only if there
2473 was an actual failure.
2474 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2476 Emulate openat-family functions using Linux's procfs, if possible.
2477 Idea and some code based on Ulrich Drepper's glibc changes.
2479 * openat.c: (BUILD_PROC_NAME): New macro.
2480 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2481 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2482 before falling back on save_cwd and restore_cwd.
2483 (fdopendir, fstatat, unlinkat): Likewise.
2485 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2486 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2488 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2489 as second argument to va_arg. Otherwise, some versions of gcc
2490 warn that `if this code is reached, the program will abort'.
2492 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2494 Sync from coreutils.
2496 Add POSIX ACL support
2497 * acl.h (copy_acl, set_acl): Add declarations.
2498 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2499 systems other than Linux.
2500 (chmod_or_fchmod): New function: use fchmod when possible,
2501 and chmod otherwise.
2502 (file_has_acl): Add a POSIX ACL implementation, with a
2503 Linux-specific subcase.
2504 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2505 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2506 acls are unsupported.
2507 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2508 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2511 2006-01-09 Bruno Haible <bruno@clisp.org>
2513 * sysexit_.h (EX_OK): New macro.
2514 Suggested by Martin Lambers <marlam@marlam.de>.
2516 2006-01-09 Bruno Haible <bruno@clisp.org>
2518 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2519 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2520 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2521 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2523 2006-01-09 Bruno Haible <bruno@clisp.org>
2525 * stdint_.h (SIZE_MAX): Write the value without involving negative
2528 2005-10-16 Bruno Haible <bruno@clisp.org>
2530 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2531 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2533 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2535 * strftime.c (tzname): Don't declare if it is already #defined.
2536 Problem reported for Mingw by Mark Junker.
2538 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2540 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2541 long int, not int, for nanosecond counts, so that people who are
2542 used to POSIX struct timespec won't be surprised. Reported by Jim
2545 2005-12-16 Jim Meyering <jim@meyering.net>
2547 * fprintftime.c, fprintftime.h: New files.
2549 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2551 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2552 * argp-help.c (fill_in_uparams): Check if the constructed
2553 struct uparams is valid. Fall back to the default values if it is
2556 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2558 * argp-help.c (__argp_base_name): New function
2559 (__argp_short_program_name): Rewrite using __argp_base_name
2560 * argp-namefrob.h: Define program_invocation_name and
2561 program_invocation_short_name if requested
2562 (__argp_base_name): Add prototype
2563 * argp-parse.c (argp_def): Use gettext wrappers
2564 (argp_default_parser): Use __argp_base_name
2565 * argp-pin.c: New file. Defines program_invocation_name and
2566 program_invocation_short_name on systems that lack them.
2568 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2570 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2571 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2572 porting problem reported by Georg Schwarz in
2573 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2575 2005-07-09 Bruno Haible <bruno@clisp.org>
2577 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2578 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2579 Reported by Mark Junker <mjscod@gmx.de>.
2581 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2583 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2584 (uintmax_t) [defined uintmax_t]: Do not declare.
2585 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2586 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2587 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2588 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2589 sake of portability to weird hosts that C allows (though we don't
2590 know of any practical examples).
2592 * savedir.h (fdsavedir): New decl.
2593 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2594 contains most of the former guts of savedir.
2595 (savedir): Use savedirstream.
2598 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2600 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2601 coreutils no longer futzes with rounding modes.
2603 2005-11-14 Jim Meyering <jim@meyering.net>
2605 * mkstemp-safer.c: Include <config.h>, required for possible
2606 replacement of mkstemp.
2608 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2610 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2612 (gethrxtime) [! (HAVE_NANOUPTIME
2613 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2614 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2615 our own approximation.
2617 2005-11-10 Simon Josefsson <jas@extundo.com>
2619 * readline.c: Remove EOL.
2621 2005-11-08 Eric Blake <ebb9@byu.net>
2623 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2625 2005-11-08 Eric Blake <ebb9@byu.net>
2627 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2629 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2631 Fix porting problem reported by Theodoros V. Kalamatianos.
2632 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2633 Don't assume that futimes failing means we must fail.
2635 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2637 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2638 leave errno alone. Problem reported by Dmitry V. Levin.
2640 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2642 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2643 errno alone. Problem reported by Frederic Jolliton.
2645 2005-10-28 Simon Josefsson <jas@extundo.com>
2647 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2648 "restrict" keywords, as per POSIX. Protect the function
2649 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2650 Don't use K&R prototypes. Check the sprintf return values.
2651 Re-define EAFNOSUPPORT if not present. Indent.
2653 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2654 suggested by Bruno Haible <bruno@clisp.org>.
2656 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2658 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2660 * gc-libgcrypt.c: Add MD2 (which is not available through
2663 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2665 * md2.h, md2.c: New files.
2667 2005-10-24 Simon Josefsson <jas@extundo.com>
2669 * md4.h: Shrink buffer size, now that we changed the type.
2671 2005-10-22 Simon Josefsson <jas@extundo.com>
2673 * arcfour.h, arcfour.c: Use fixed size indices in the
2674 arcfour_context struct (simplify test vector testing in GNU
2677 2005-10-22 Simon Josefsson <jas@extundo.com>
2679 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2680 suggested by Bruno Haible <bruno@clisp.org>.
2682 2005-10-22 Simon Josefsson <jas@extundo.com>
2684 * crc.h: Include stddef.h, for size_t.
2686 2005-10-21 Simon Josefsson <jas@extundo.com>
2688 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2689 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2691 2005-10-21 Simon Josefsson <jas@extundo.com>
2693 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2696 2005-10-21 Simon Josefsson <jas@extundo.com>
2698 * gc-gnulib.c: Support ARCTWO in CBC mode.
2700 2005-10-21 Simon Josefsson <jas@extundo.com>
2702 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2705 * hmac-sha1.c (hmac_sha1): Likewise.
2707 * crc.c (crc32_update): Actually use crc parameter, suggested by
2708 Bruno Haible <bruno@clisp.org>.
2710 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2713 2005-10-21 Simon Josefsson <jas@extundo.com>
2715 * des.h, des.c: New files.
2717 * gc-gnulib.c: Support DES.c
2719 2005-10-21 Simon Josefsson <jas@extundo.com>
2721 * arctwo.h, arctwo.c: New files.
2723 * gc-gnulib.c: Support ARCTWO.
2725 2005-10-21 Simon Josefsson <jas@extundo.com>
2727 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2729 2005-10-19 Simon Josefsson <jas@extundo.com>
2731 * gc-gnulib.c: Support ARCFOUR.
2733 2005-10-19 Simon Josefsson <jas@extundo.com>
2735 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2738 * gc.h: Add ECB enum type.
2740 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2742 2005-10-19 Simon Josefsson <jas@extundo.com>
2744 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2746 2005-10-18 Simon Josefsson <jas@extundo.com>
2748 * md4.h, md4.c: New files, based on md5.?.
2750 2005-10-17 Simon Josefsson <jas@extundo.com>
2752 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2754 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2756 2005-10-17 Simon Josefsson <jas@extundo.com>
2758 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2760 2005-10-17 Simon Josefsson <jas@extundo.com>
2762 * gc.h, gc-libgcrypt.c: Add ciphers.
2764 2005-10-17 Simon Josefsson <jas@extundo.com>
2766 * sha1.c: Use uint32_t instead of md5_uint32.t
2768 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2771 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2773 * md5.h: Use stdint.h and uint32_t. Doc fix.
2775 2005-10-15 Simon Josefsson <jas@extundo.com>
2777 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2779 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2781 2005-10-14 Simon Josefsson <jas@extundo.com>
2783 * arcfour.h, arcfour.c: New files.
2785 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2787 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2788 include <wchar.h>; no longer needed.
2790 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2791 and Ulrich Drepper <drepper@redhat.com>
2794 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2795 instead of inline stream orientation test and two separate
2796 function calls. Pay no attention to USE_IN_LIBIO.
2798 2005-10-14 Roland McGrath <roland@redhat.com>
2800 Import from libc. [BZ #1331]
2801 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2803 Reported by Matej Vela <vela@debian.org>.
2805 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2807 * mkdir-p.c (make_dir_parents): Don't report an error if an
2808 intermediate directory is in a read-only file system. Problem
2809 reported by Eric Blake.
2811 2005-10-13 Simon Josefsson <jas@extundo.com>
2813 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2814 Move memory allocation outside of loop.
2816 2005-10-12 Simon Josefsson <jas@extundo.com>
2818 * gc-pbkdf2-sha1.c: New file.
2820 * gc.h: Add gc_pbkdf2_sha1 prototype.
2822 2005-10-12 Simon Josefsson <jas@extundo.com>
2824 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2825 suggested by Bruno Haible <bruno@clisp.org>.
2827 2005-10-12 Simon Josefsson <jas@extundo.com>
2829 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2831 * gc-gnulib.c (gc_hmac_sha1): New function.
2833 2005-10-12 Simon Josefsson <jas@extundo.com>
2835 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2837 2005-10-12 Simon Josefsson <jas@extundo.com>
2839 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2840 GC_USE_HMAC_MD5, respectively.
2842 * gc-libgcrypt.c (gc_md5): Fix assert call.
2845 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2847 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2849 * gc-gnulib.c (gc_hash_buffer): Ditto.
2851 2005-10-11 Bruno Haible <bruno@clisp.org>
2853 * c-strcasestr.h: New file, from GNU gettext.
2854 * c-strcasestr.c: New file, from GNU gettext.
2856 2005-10-11 Bruno Haible <bruno@clisp.org>
2858 * c-strcase.h: New file, from GNU gettext.
2859 * c-strcasecmp.c: New file, from GNU gettext.
2860 * c-strncasecmp.c: New file, from GNU gettext.
2862 2005-10-11 Simon Josefsson <jas@extundo.com>
2864 * crc.h, crc.c: New files.
2866 * gc.h (gc_hash_buffer): Add doc.
2868 2005-10-08 Simon Josefsson <jas@extundo.com>
2870 * gc.h: Add gc_hash and gc_hash_buffer.
2872 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2874 * gc-libgcrypt.c (gc_hash_buffer): Add.
2876 2005-10-11 Bruno Haible <bruno@clisp.org>
2878 * strcasecmp.c: Include limits.h.
2879 (strcasecmp): Avoid integer overflow on exotic platforms.
2880 * strncasecmp.c: Include limits.h.
2881 (strncasecmp): Avoid integer overflow on exotic platforms.
2882 Reported by Paul Eggert.
2884 2005-10-06 Simon Josefsson <jas@extundo.com>
2886 * hmac-md5.c: New file.
2890 2005-10-06 Simon Josefsson <jas@extundo.com>
2892 * memxor.c (memxor): Avoid casts and warnings.
2894 2005-10-05 Derek Price <derek@ximbiot.com>
2896 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2898 2005-10-05 Simon Josefsson <jas@extundo.com>
2900 * memxor.c (memxor): Fix compiler error.
2902 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2903 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2905 * memxor.h, memxor.c: New files.
2907 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2908 we assume all systems have it, suggested by Jim Meyering
2909 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2910 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2911 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2914 2005-10-04 Bruno Haible <bruno@clisp.org>
2916 * verify.h (verify_true): Provide alternative definition for C++.
2918 2005-10-04 Simon Josefsson <jas@extundo.com>
2920 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2921 D. Baushke" <mdb@gnu.org>.
2923 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2925 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2926 (SSIZE_MAX): New macro, if not already defined.
2927 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2930 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2932 * exclude.c: Include verify.h.
2933 (verify): Remove. All callers changed to use verify.h's version.
2934 * strtoimax.c: Likewise.
2935 * utimecmp.c: Likewis.e
2937 Sync from coreutils.
2938 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2939 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2940 * .cvsignore: Add fts.h, search.h, t-fpending.
2941 * settime.c (settime): Fix { typo in previous patch. Also, don't
2942 bother returning ENOSYS if settimeofday or stime fails; just let
2943 them return whatever errno they want to return.
2944 * utimens.c: Include unistd.h, for dup2.
2945 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2946 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2948 2005-10-02 Jim Meyering <jim@meyering.net>
2950 Sync from coreutils.
2951 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2952 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2953 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2954 Remove AT_FDCWD test.
2955 Do not consume the fd unless successful.
2956 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2957 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2958 block, so that we don't even try to compile it if settimeofday is
2959 available. This works around a compilation failure on OSF1 V5.1,
2960 due to stime requiring a `long int*' while tv_sec is `int'.
2962 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2964 * getdelim.c (getdelim): Remove unused variables.
2966 2005-10-01 Simon Josefsson <jas@extundo.com>
2968 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2969 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2970 AI_* and EAI_* definitions. Protect function declarations.
2972 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2974 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2975 so that the code works even with ancient cpp. Portability problem
2976 with GCC 2.7.2.1 reported by Thomas M.Ott.
2978 2005-09-27 Jim Meyering <jim@meyering.net>
2980 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2982 * intprops.h (signed_type_or_expr__): Define.
2983 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2986 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2988 * verify.h (verify_expr): Remove, replacing with:
2989 (verify_true): New macro that returns true instead of void.
2990 (verify_type__): Remove.
2991 (verify): Use verify_true rather than verify_type__.
2993 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2995 * utimens.c (ENOSYS): Define if not already defined.
2996 (futimens): Support having a null PATH if the file descriptor
2999 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
3001 (__attribute): Define to empty unless GCC 3.1 or later.
3002 This works around a core dump on OpenBSD 3.4, which has GCC
3003 2.95.3, which dumps core when given __attribute__(()). It also
3004 simplifies other tests, since we really don't want to bother with
3005 worrying about which ancient version of GCC supported what.
3006 Original problem reported by Yoann Vandoorselaere, with part of
3007 the fix suggested by Derek Price.
3009 2005-09-24 Jim Meyering <jim@meyering.net>
3011 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
3012 so we can once again use a positive bitfield width of 1 -- now we
3013 don't have to explain why we were using a bitfield width of 2.
3015 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
3017 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
3018 Problem reported by Eric Blake.
3019 (getaddrinfo): Initialize se so that it's not garbage.
3020 Redo internal storage allocation so that it doesn't make unportable
3021 assumptions about alignment.
3024 * utimens.c (futimens): Use futimesat if available.
3025 Prefer it to futimes since it doesn't have the futimes bug.
3027 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
3028 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
3029 Instead, declare a function that returns a pointer to an array,
3030 and use verify_type__ to declare the size of the array.
3031 Problem and germ of a solution reported by Bruno Haible.
3032 (verify_type__): Use 2, not 1, for bitfield size, to avoid
3033 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
3035 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
3037 Sync from coreutils.
3039 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
3041 * argmatch.h: Include verify.h
3042 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
3043 (ARGMATCH_ASSERT): Remove; unused.
3044 * canonicalize.c: Assume STDC_HEADERS.
3045 * exclude.c: Include "strcase.h".
3046 * regex_internal.h [!defined _LIBC]: Likewise.
3047 * getusershell.c: Include stdio--.h rather than stdio.h
3049 (getusershell): Call fopen, not fopen_safer.
3050 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
3051 Do not include unistd-safer.h.
3052 (save_cwd): Don't call fd_safer; no longer needed
3053 now that we include fcntl--.h.
3055 * getdate.y (relative_time): New type.
3056 (RELATIVE_TIME_0): New constant.
3057 (parser_control): Use relative_time instead of doing it ourselves.
3058 (%union): Add new relative_time rel member.
3059 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
3061 (relunit, relunit_snumber): Now of type rel.
3062 (zone, rel, relunit, get_date): Adjust to above changes.
3064 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
3065 Do not include unistd-safer.h.
3066 (getloadavg): Don't call fd_safer; no longer needed
3067 now that we include fcntl--.h.
3069 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
3070 (make_dir_parents): Treat ENOSYS like EEXIST.
3072 Improve quality of diagnostics on restore_cwd failure.
3073 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
3074 (make_dir_parents): Last arg is now int * (for errno), not bool *.
3075 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
3076 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
3077 each time through the loop. Do not diagnose restore_cwd failure;
3078 that is the caller's job (and perhaps the caller does not care).
3080 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
3081 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
3082 If the file already exists but is not a directory, don't bother
3083 to try to make its parents.
3084 Close potential file descriptor leak if we can't chdir("/") (!).
3085 Don't always return true if chdir($PWD) fails; return true only
3086 if the requested action was done successfully (except for the
3088 Don't log final directory unless we actually made it.
3089 Refactor to avoid duplicate code to fix up permissions.
3090 Don't attempt to fix up parent permissions if chdir($PWD) fails.
3092 * strftime.c (my_strftime): Rewrite the previous change slightly,
3093 to make it a bit faster and (I hope) clearer.
3094 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
3095 Fix bug in formats like %2N.
3097 * verify.h: New file.
3099 2005-09-22 Jim Meyering <jim@meyering.net>
3101 Sync from coreutils.
3103 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
3105 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
3106 the .tm_year member, since otherwise gcc-4.0 would now warn about
3107 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
3109 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
3110 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3112 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3113 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3114 when run in a time zone for which daylight savings time is in effect
3115 for the starting date.
3117 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3118 stop us from restricting permissions of just-created absolute-named
3120 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3121 to restore initial working directory.
3122 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3123 to tell caller if/when we change the working directory and are
3124 unable to return to the initial one.
3125 * mkdir-p.h (make_dir_parents): Update prototype.
3126 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3127 `return false'. This fixes a bug introduced on 2004-07-30.
3129 * openat.c (fdopendir): Be sure to close the supplied
3130 file descriptor before returning. This makes our replacement
3131 implementation a little closer to Solaris's, where fdopendir
3132 ties the file descriptor to the returned DIR* pointer.
3133 * openat.c (unlinkat): New function.
3134 * openat.h (unlinkat): Add prototype.
3135 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3136 (openat_restore_fail): Rename from openat_restore_die.
3137 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3139 Provide an alternative to exiting immediately upon save_cwd or
3140 restore_cwd failure. Now, an application can arrange e.g.,
3141 to perform a longjump in that case.
3142 * openat.c: Include dirname.h.
3143 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3144 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3145 and openat_restore_die rather than calling error directly.
3146 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3148 * openat-die.c (openat_save_die, openat_restore_die): New file.
3149 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3151 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3152 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3153 int utc, int nanoseconds);
3155 date should not have to allocate a megabyte of virtual memory to
3156 handle a format argument like +%1048575T. When implemented with
3157 strftime, it must allocate such a buffer, use strftime to fill it
3158 in, print it, then free it.
3159 With fprintftime, it simply prints everything and exits.
3160 With no need for memory allocation, that's one fewer way to fail.
3161 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3162 optional field width, not before, so we accept %9:z, not %:9z.
3163 (my_strftime): Be sure to use L_('x') for literals.
3165 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3166 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3167 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3168 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3169 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3170 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3171 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3172 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3173 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3175 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3176 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3177 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3178 and don't include <sys/file.h>).
3180 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3182 Sync from coreutils.
3184 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3185 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3186 [!LDAV_DONE]: Avoid unused variable warning.
3188 2005-09-21 Bruno Haible <bruno@clisp.org>
3190 * unicodeio.h (unicode_to_mb): New declaration.
3192 2005-09-20 Derek Price <derek@ximbiot.com>
3194 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3196 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3198 Use a consistent style for including <config.h>.
3199 * __fpending.c, acl.c, argmatch.c,
3200 argp-help.c, argp-parse.c,
3201 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3202 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3203 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3204 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3205 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3206 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3207 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3208 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3209 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3210 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3211 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3212 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3213 modechange.c, mountlist.c, open-safer.c, physmem.c,
3214 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3215 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3216 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3217 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3218 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3219 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3220 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3221 userspec.c, utimecmp.c, version-etc-fsf.c,
3222 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3223 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3224 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3225 Standardize inclusion of config.h.
3226 * __fpending.h, dirfd.h, getdate.h, human.h,
3227 inttostr.h: Removed inclusion of config.h from header files.
3228 * inttostr.c: Adjusted in-tree users.
3229 * timespec.h: Remove superfluous warning to include config.h.
3230 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3231 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3232 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3233 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3235 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3237 * stat-time.h: New file.
3238 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3239 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3241 (timespec_cmp): New function.
3242 * utimecmp.c: Include stat-time.h.
3243 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3244 members exist, not on the obsolescent ST_MTIM_NSEC.
3245 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3247 2005-09-15 Derek Price <derek@ximbiot.com>
3248 Paul Eggert <eggert@cs.ucla.edu>
3250 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3251 changes, consolidating in...
3252 * regex_internal.h: ...this file.
3254 2005-09-15 Derek Price <derek@ximbiot.com>
3256 * regex_internal.h: Blank `pure' for GNUC < 3.
3257 * regex_internal.c: Ditto, using this...
3258 (__GNUC_PREREQ): ...new macro.
3259 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3260 (__GNUC_PREREQ): ...this new macro.
3262 * strstr.h: Include string.h. Define strstr as a macro here.
3264 2005-09-13 Derek Price <derek@ximbiot.com>
3266 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3268 Reported by Jim Meyering <jim@meyering.net>.
3270 2005-09-13 Jim Meyering <jim@meyering.net>
3272 * canon-host.c: Filter through gnu indent and reword comments slightly.
3273 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3275 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3278 (base64_encode): Put b64str in initialized data section.
3280 2005-09-12 Derek Price <derek@ximbiot.com>
3282 Return usable errors from canon-host.
3283 * canon-host.h: New file.
3284 * canon-host.c (canon_host): Wrap...
3285 (canon_host_r): ...this new function, which now relies exclusively on
3287 (ch_strerror): New function.
3288 (last_cherror): New global.
3289 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3290 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3292 (freeaddrinfo): Free ai->ai_canonname when set.
3294 2005-09-12 Derek Price <derek@ximbiot.com>
3295 Paul Eggert <eggert@cs.ucla.edu>
3297 * glob-libc.h: Renamed from glob_.h. The new version is
3298 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3299 protecting things that should be done only in gnulib contexts.
3300 * glob_.h: New file, containing only the glob things needed for
3302 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3303 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3304 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3305 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3306 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3307 and to respect the namespace rules better.
3309 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3311 Merge glibc and coreutils changes into gnulib, plus a few
3313 * md5.c: Use #error rather than a string.
3314 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3315 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3316 (__attribute__): Define to empty for non recent-GCC.
3317 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3318 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3319 Renamed from their non-__ counterparts, with new macros replacing
3320 them if not _LIBC. Add __THROW attribute.
3322 (struct md5_ctx): Align buffer if using GCC.
3323 * sha1.h (struct sha1_ctx): Likewise.
3324 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3325 The old name was backwards.
3326 (NOTSWAP): Remove; not used.
3327 (rol): New macro, moved here from md5.h.
3328 (sha1_process_block): Remove a FIXME that doesn't make sense.
3330 2005-09-12 Derek Price <derek@ximbiot.com>
3332 * gai_strerror.c: Include config.h when available. Include
3333 getaddrinfo.h before other headers to test interface.
3334 Reported by Larry Jones <lawrence.jones@ugs.com>.
3336 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3338 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3339 definitions, since that's the preferred style in glibc.
3340 Fix a minor spacing issue, and update copyright notice to match glibc's.
3342 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3344 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3346 2005-09-06 Simon Josefsson <jas@extundo.com>
3348 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3349 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3351 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3353 Change bitset word type from unsigned int to unsigned long int,
3354 as this has better performance on typical 64-bit hosts.
3355 Port bitset code to hosts with unusual word sizes.
3356 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3357 (build_collating_symbol):
3358 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3359 argument is a bitset. This is merely a style issue, but it makes
3360 it clearer that an entire array is expected.
3361 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3362 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3363 Port to the case where bitset_word is not the same as unsigned int.
3364 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3365 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3367 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3368 (build_trtable, group_nodes_into_DFAstates):
3370 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3371 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3372 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3373 * regexec.c (group_nodes_into_DFAstates): Likewise.
3374 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3375 * regcomp.c (optimize_subexps, lower_subexp):
3376 Work even if bitset_word has holes in its bitwise representation.
3377 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3378 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3380 * regex_internal.c (re_string_reconstruct):
3381 Don't assume UCHAR_MAX == 255.
3382 * regex_internal.h (bitset_set_all): Likewise.
3383 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3385 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3386 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3388 (BITSET_WORD_MAX): New macro.
3389 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3390 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3391 (bitset_empty, bitset_copy):
3392 Prefer sizeof (bitset) to multiplying it out ourselves.
3393 (bitset_not_merge): Remove; unused.
3394 (bitset_contain): Return bool, not unsigned int with one bit on.
3395 All callers changed.
3396 * regexec.c (build_trtable): Don't assume bitset has no stricter
3397 alignment than re_node_set; do this by defining a new internal
3398 type struct dests_alloc and using it to allocate memory.
3400 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3402 Check for arithmetic overflow when calculating sizes, to prevent
3403 some buffer-overflow issues. These patches are conservative, in the
3404 sense that when I couldn't determine whether an overflow was possible,
3405 I inserted a run-time check.
3406 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3407 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3408 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3409 (re_xnrealloc, re_x2nrealloc): New inline functions.
3410 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3411 (build_equiv_class, build_charclass): Check for arithmetic overflow
3412 in size expression calculations.
3413 * regex_internal.c (re_string_realloc_buffers):
3414 (build_wcs_upper_buffer, re_node_set_add_intersect):
3415 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3416 (re_dfa_add_node, register_state): Likewise.
3417 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3418 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3419 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3420 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3422 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3424 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3425 to avoid a collision with bits/local_lim.h in glibc.
3426 All uses changed. Problem reported by Dmitry V. Levin in
3427 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3429 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3430 bugs in int versus size_t comparisons.
3431 (re_string_context_at): Fix bug where the code assumed that
3434 Use bool where appropriate.
3435 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3436 All callers changed.
3437 (calc_eclosure_iter): Likewise, for ROOT arg.
3438 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3439 (build_charclass_op): Likewise, for NON_MATCH arg.
3440 * regex_internal.c (re_string_allocate, re_string_construct):
3441 (re_string_construct_common): Likewise, for ICASE arg.
3442 * regexec.c (re_search_2_stub, re_search_stub):
3443 Likewise, for RET_LEN arg.
3444 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3445 (set_regs): Likewise, for FL_BACKTRACK arg.
3446 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3447 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3448 (calc_eclosure_iter, parse_bracket_exp):
3449 Use bool for internal variables that are booleans.
3450 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3451 (set_regs, build_sifted_states, sift_states_bkref):
3452 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3453 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3454 (find_collation_sequence_value):
3456 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3457 (re_node_set_compare):
3458 Return bool, not int. All callers changed.
3459 * regexec.c (check_halt_node_context, check_dst_limits):
3460 (build_trtable, check_node_accept): Likewise.
3461 * regex_internal.h: Include stdbool.h.
3463 Fix bugs uncovered when converting to bool.
3464 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3465 failure instead of charging ahead blindly.
3466 * regex_internal.c (register_state): Likewise.
3467 * regexec.c (re_search_2_stub): Use simpler method than boolean
3468 for freeing internal storage.
3469 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3470 bitset pieces used as boolean, to avoid undefined behavior
3471 on hosts that do int overflow checking.
3473 2005-08-31 Derek Price <derek@ximbiot.com>
3475 * getdelim.c (getdelim): Return EOF on EOF.
3476 Reported by Larry Jones <lawrence.jones@ugs.com>.
3478 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3480 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3481 lengths fit in regoff_t; this isn't true if regoff_t is the same
3483 * regex.c (re_search_internal): 5th arg is LAST_START
3484 (= START + RANGE) instead of RANGE. This avoids overflow
3485 problems when regoff_t is the same width as size_t.
3486 All callers changed.
3487 (re_search_2_stub): Check for overflow when adding the
3488 sizes of the two strings.
3489 (re_search_stub): Check for overflow when adding START
3490 to RANGE; if it occurs, substitute the extreme value.
3492 2005-08-31 Jim Meyering <jim@meyering.net>
3494 * regcomp.c (search_duplicated_node): Make first pointer arg
3496 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3497 (register_state): Likewise.
3498 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3499 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3500 (group_nodes_into_DFAstates): Likewise.
3502 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3504 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3505 old glibc regex code mishandles strings longer than 2**31 bytes.
3506 This patch fixes this when the regex code is used in gnulib
3507 (i.e., outside glibc).
3509 This patch should not affect the use of the regex code inside
3510 glibc. No doubt this problem also needs to be handled for glibc
3511 as well, but the result will be an incompatible change to the
3512 glibc ABI, and the old ABI will have to be supported too. That
3513 can be the the subject for another patch.
3515 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3516 governing whether the rest of this patch is active. By default,
3517 the macro is disabled and the patch has no effect.
3518 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3519 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3520 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3521 (re_match_2, re_set_registers): Use the new types.
3522 * regex_internal.h (Idx, re_hashval_t): New types.
3523 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3525 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3526 (re_string_context_at, bin_tree_t, re_dfastate_t):
3527 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3528 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3529 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3530 (re_string_char_size_at, re_string_wchar_at):
3531 (re_string_elem_size_at):
3532 Use the new types and macros to port to 64-bit hosts.
3533 Use unsigned types for internal values, so that the code
3534 mostly works even for arrays larger than SSIZE_MAX.
3535 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3536 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3537 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3538 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3539 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3540 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3541 (calc_inveclosure, parse_dup_op, build_range_exp):
3542 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3543 (fetch_number, create_token_tree, mark_opt_subexp):
3545 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3546 (create_cd_newstate, re_string_allocate, re_string_construct):
3547 (re_string_realloc_buffers, build_wcs_upper_buffer):
3548 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3549 (re_string_reconstruct, re_string_peek_byte_case):
3550 (re_string_fetch_byte_case, re_string_context_at):
3551 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3552 (re_node_set_init_copy, re_node_set_add_intersect):
3553 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3554 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3555 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3556 (re_acquire_state, re_acquire_state_context, register_state):
3558 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3559 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3560 (re_search_internal, re_search_2_stub, re_search_stub)
3561 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3562 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3563 (update_cur_sifted_state, check_dst_limits):
3564 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3565 (check_subexp_limits, sift_states_bkref, merge_state_array):
3566 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3567 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3568 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3569 (expand_bkref_cache, check_node_accept_bytes):
3570 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3571 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3572 (acquire_init_state_context, check_halt_node_context):
3573 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3574 (sift_states_backward, clean_state_log_if_needed):
3575 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3576 (find_recover_state, transit_state_sb, transit_state_mb):
3577 (transit_state_bkref, build_trtable, match_ctx_clean):
3579 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3580 to work around an assumption that REG_MISSING is negative.
3582 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3583 (seek_collating_symbol_entry) [defined _LIBC]:
3584 (lookup_collation_sequence_value) [defined _LIBC]:
3585 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3586 Use prototypes rather than old-style function definitions.
3587 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3588 (transit_state_sb) [0]:
3589 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3591 * regexec.c (re_search_internal): Simplify update of rm_so and
3594 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3595 (optimize_subexps, lower_subexp):
3596 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3597 since the signed shift might overflow. Use 1u<<31 instead.
3598 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3599 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3602 * regcomp.c (optimize_subexps, lower_subexp):
3603 Use CHAR_BIT rather than 8, for clarity.
3604 * regexec.c (check_dst_limits_calc_pos_1):
3605 (check_subexp_matching_top): Likewise.
3606 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3607 have to worry about portability issues when shifting it left.
3608 Remove no-longer-needed test for table_size > 0.
3609 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3610 in a word, as the resulting behavior is undefined.
3611 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3612 in one case, a <= should have been an <, and in another case the
3613 whole test was missing.
3614 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3615 the standard name CHAR_BIT.
3616 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3617 this is not true on one's complement and signed-magnitude hosts.
3619 * regex_internal.h (re_sub_match_top_t): Remove unused member
3621 (struct re_dfa_t): Remove unused member states_alloc.
3622 * regcomp.c (init_dfa): Don't initialize unused members.
3624 2005-08-31 Bruno Haible <bruno@clisp.org>
3626 * strstr.c: Include <stddef.h>, for NULL.
3627 * strcasestr.c: Likewise.
3628 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3630 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3632 * iconvme.h: Add prototype for iconv_alloc.
3634 2005-08-29 Simon Josefsson <jas@extundo.com>
3636 * iconvme.c: Fix errno.
3638 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3640 * iconvme.c: Split iconv_string into iconv_alloc.
3642 2005-08-27 Jim Meyering <jim@meyering.net>
3644 * fopen-safer.c: Merge minor changes from coreutils.
3645 * dup-safer.c: Likewise.
3646 * fd-safer.c: Likewise.
3648 Merge from coreutils.
3649 * stdio--.h: New file.
3650 * stdlib--.h: New file.
3651 * mkstemp-safer.c: New file.
3653 GNU tar needs these.
3654 * pipe-safer.c: New file.
3655 * creat-safer.c: New file.
3656 * fcntl--.h (creat): Define to creat_safer.
3657 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3658 * unistd--.h (pipe): Define to pipe_safer.
3659 * unistd-safer.h: Declare pipe_safer.
3661 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3663 * regex_internal.h: Remove all references to
3664 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3666 (bitset_not, bitset_merge, bitset_not_merge):
3667 (bitset_mask, re_string_allocate, re_string_construct):
3668 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3669 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3670 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3671 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3672 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3673 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3674 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3675 (re_acquire_state_context):
3676 Remove unnecessary forward decls.
3677 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3678 Put __attribute at function definition,
3679 now that the function decl has been removed.
3680 * regex_internal.c (re_string_peek_byte_case):
3681 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3684 2005-08-26 Simon Josefsson <jas@extundo.com>
3686 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3687 Haible <bruno@clisp.org>.
3689 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3691 * regexec.c (set_regs): Don't alloca with an unbounded size.
3693 alloca modernization/simplification for regex.
3694 * regex.c: Remove portability cruft for alloca. This no longer
3695 needs to be at the start of the file, and can be moved into
3696 regex_internal.h and simplified.
3697 * regex_internal.h: Include <alloca.h>.
3698 (__libc_use_alloca) [!defined _LIBC]: New macro.
3699 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3700 now works outside glibc.
3702 2005-08-24 Simon Josefsson <jas@extundo.com>
3704 * getpass.c: Add WIN32 implementation. Conditionalize use of
3705 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3706 GLIBC specific code.
3708 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3710 Make regex safe for g++. This fixes one real bug (an "err"
3711 that should have been "*err"). g++ problem reported by
3713 * regex_internal.h (re_calloc): New macro, consistent with
3714 re_malloc etc. All callers of calloc changed to use re_calloc.
3715 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3716 not int. All callers changed.
3717 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3718 just use an array of size MB_LEN_MAX.
3719 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3720 (find_recover_state): Change "err" to "*err"; this fixes what
3721 appears to be a real bug.
3722 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3725 2005-08-25 Jim Meyering <jim@meyering.net>
3727 * open-safer.c: Include <config.h>.
3728 Otherwise, we'd lose LARGEFILE support in any file using
3731 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3733 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3734 * regex.h (regerror): Likewise.
3736 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3737 requires this. (The code never needed it.)
3739 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3740 All uses of recently-renamed identifiers changed to use the new,
3741 POSIX-compliant names. The code will build and run just fine
3742 without these changes, but it's better to eat our own dog food
3743 and use the standard-conforming names.
3745 * regex.h: Fix a multitude of POSIX name space violations.
3746 These changes have an effect only for programs that define
3747 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3748 do not change anything for programs compiled in the normal way.
3749 Also, there is no effect on the ABI.
3751 (_REGEX_SOURCE): New macro.
3752 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3753 defined and _GNU_SOURCE is not; this fixes a name space violation.
3755 Rename the following macros to obey POSIX requirements.
3756 The old names are still visible as macros if _REGEX_SOURCE is defined.
3757 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3758 RE_BACKSLASH_ESCAPE_IN_LISTS.
3759 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3760 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3761 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3762 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3763 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3764 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3765 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3766 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3767 (REG_INTERVALS): renamed from RE_INTERVALS.
3768 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3769 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3770 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3771 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3772 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3773 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3774 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3775 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3776 RE_UNMATCHED_RIGHT_PAREN_ORD.
3777 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3778 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3779 (REG_DEBUG): renamed from RE_DEBUG.
3780 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3781 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3782 unusual, since we can't clash with the POSIX REG_ICASE.
3783 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3784 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3785 (REG_NO_SUB): renamed from RE_NO_SUB.
3786 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3787 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3788 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3789 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3790 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3791 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3792 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3793 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3794 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3795 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3796 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3797 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3798 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3799 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3800 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3801 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3802 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3803 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3804 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3805 (REG_FIXED): Renamed from REGS_FIXED.
3806 (REG_NREGS): Renamed from RE_NREGS.
3808 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3809 of other REG_* macros, since POSIX says the user is allowed to
3810 #undef these macros selectively.
3812 (reg_errcode_t): Update comment stating what other tables need
3815 Rename the following enum values to obey POSIX requirements.
3816 The old names are still visible as macros.
3817 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3818 is not defined, since GNU is supposed to be a superset of POSIX as
3819 much as possible, and since we want reg_errcode_t to be a signed
3820 type for implementation consistency.
3821 (_REG_NOERROR): Renamed from REG_NOERROR.
3822 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3823 (_REG_BADPAT): Renamed from REG_BADPAT.
3824 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3825 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3826 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3827 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3828 (_REG_EBRACK): Renamed from REG_EBRACK.
3829 (_REG_EPAREN): Renamed from REG_EPAREN.
3830 (_REG_EBRACE): Renamed from REG_EBRACE.
3831 (_REG_BADBR): Renamed from REG_BADBR.
3832 (_REG_ERANGE): Renamed from REG_ERANGE.
3833 (_REG_ESPACE): Renamed from REG_ESPACE.
3834 (_REG_BADRPT): Renamed from REG_BADRPT.
3835 (_REG_EEND): Renamed from REG_EEND.
3836 (_REG_ESIZE): Renamed from REG_ESIZE.
3837 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3838 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3839 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3840 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3841 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3843 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3844 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3845 changed. But support the old name if the new one is not defined
3846 and if _REGEX_SOURCE.
3848 Change the following member names in struct re_pattern_buffer.
3849 The old names are still supported if !_REGEX_SOURCE.
3850 The new names are always supported, regardless of _REGEX_SOURCE.
3851 (re_buffer): Renamed from buffer.
3852 (re_allocated): Renamed from allocated.
3853 (re_used): Renamed from used.
3854 (re_syntax): Renamed from syntax.
3855 (re_fastmap): Renamed from fastmap.
3856 (re_translate): Renamed from translate.
3857 (re_can_be_null): Renamed from can_be_null.
3858 (re_regs_allocated): Renamed from regs_allocated.
3859 (re_fastmap_accurate): Renamed from fastmap_accurate.
3860 (re_no_sub): Renamed from no_sub.
3861 (re_not_bol): Renamed from not_bol.
3862 (re_not_eol): Renamed from not_eol.
3863 (re_newline_anchor): Renamed from newline_anchor.
3865 Change the following member names in struct re_registers.
3866 The old names are still supported if !_REGEX_SOURCE.
3867 The new names are always supported, regardless of _REGEX_SOURCE.
3868 (rm_num_regs): Renamed from num_regs.
3869 (rm_start): Renamed from start.
3870 (rm_end): Renamed from end.
3872 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3873 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3874 Prepend __ to parameter names.
3876 Undo yesterday's changes.
3878 2005-08-24 Jim Meyering <jim@meyering.net>
3880 Sync from coreutils.
3881 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3883 2005-08-21 Bruno Haible <bruno@clisp.org>
3885 * lock.h: Add multiple inclusion guard.
3886 * tls.h: Add multiple inclusion guard.
3888 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3890 * regex.h (REG_NOSYS)
3891 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3892 Define, since POSIX requires it as of 2001.
3893 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3894 New private symbol, used to keep the enum signed in all cases.
3895 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3896 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3898 * regex_internal.c (re_string_skip_chars, register_state):
3900 Remove forward decls; no longer needed now that we use prototypes.
3901 * regexec.c (acquire_init_state_context, check_halt_node_context):
3902 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3903 (clean_state_log_if_needed): Likewise.
3905 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3907 Fix problems reported by Sam Steingold in
3908 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3909 * regexec.c (sift_states_bkref): Fix portability bug: the code
3910 assumed that reg_errcode_t is a signed type, which is not
3911 necessarily true if _XOPEN_SOURCE is not defined.
3912 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3913 some compilers warn about it otherwise.
3915 2005-08-20 Jim Meyering <jim@meyering.net>
3917 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3918 of unused local, dfa.
3920 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3922 * regcomp.c (create_initial_state): Remove duplicate decl.
3923 (init_word_char, create_initial_state, duplicate_node_closure):
3924 (fetch_token, peek_token_bracket, build_range_exp):
3925 (build_collating_symbol): Remove forward decls; no longer needed
3926 now that we use prototypes.
3929 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3930 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3931 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3932 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3933 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3934 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3935 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3936 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3937 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3938 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3939 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3940 (build_charclass, build_charclass_op, fetch_number, create_tree):
3941 (create_token_tree, mark_opt_subexp, duplicate_tree):
3942 Use prototypes rather than old-style definitions.
3945 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3946 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3947 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3948 (re_string_reconstruct, re_string_peek_byte_case):
3949 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3950 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3951 (re_node_set_init_copy, re_node_set_add_intersect):
3952 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3953 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3954 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3955 (re_acquire_state, re_acquire_state_context, register_state):
3956 (create_ci_newstate, create_cd_newstate, free_state):
3958 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3959 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3960 (re_search_internal, prune_impossible_nodes):
3961 (acquire_init_state_context, check_matching, static):
3962 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3963 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3964 (update_regs, sift_states_backward, build_sifted_states):
3965 (clean_state_log_if_needed, merge_state_array):
3966 (update_cur_sifted_state, add_epsilon_src_nodes):
3967 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3968 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3969 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3970 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3971 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3972 (check_arrival, check_arrival_add_next_nodes):
3973 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3974 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3975 (check_node_accept_bytes, check_node_accept, extend_buffers):
3976 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3977 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3982 (re_string_allocate, re_string_construct, re_string_reconstruct):
3983 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3984 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3985 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3986 (re_string_context_at, re_string_peek_byte_case):
3987 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3988 is defined, since we now use prototypes always.
3990 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3991 C89 or better. All uses removed.
3993 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3995 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3996 [defined lint]: Suppress bogus uninitialized-variable warnings.
3998 * regcomp.c (duplicate_node): Return new index, not an error code,
3999 and let the caller return REG_ESPACE if out of space. This
4000 removes an uninitialied-variable warning with GCC 4.0.1, and also
4001 avoids taking the address of a local variable. All callers
4004 2005-08-19 Jim Meyering <jim@meyering.net>
4006 * regexec.c (proceed_next_node): Redo local variables to
4007 avoid GCC shadowing warnings.
4009 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
4011 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
4012 (re_node_set_insert_last, re_dfa_add_node):
4013 Rename local variables to avoid GCC shadowing warnings.
4015 2005-08-18 Bruno Haible <bruno@clisp.org>
4017 * strstr.c (strstr): Fix return value in multibyte case.
4018 * strcasestr.c (strcasestr): Likewise.
4020 2005-08-17 Jim Meyering <jim@meyering.net>
4022 Make the %s format (seconds since the epoch) work for a negative
4023 number and when used with a zero-padded field width, e.g. %015s.
4025 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
4026 label so that it precedes the code to set `digits'. Otherwise,
4027 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
4028 print `00-22'. Now, it prints `-0022', as it should.
4030 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
4032 * regex.h: Remove useless space-before-tab. From coreutils.
4034 2005-08-17 Bruno Haible <bruno@clisp.org>
4036 * strcasestr.h: New file.
4037 * strcasestr.c: New file.
4039 2005-08-17 Bruno Haible <bruno@clisp.org>
4041 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
4042 * strstr.c: Completely rewritten, with multibyte locale support.
4044 2005-08-17 Bruno Haible <bruno@clisp.org>
4046 * strcasecmp.c: Use mbuiter.h.
4048 2005-08-17 Bruno Haible <bruno@clisp.org>
4050 * mbuiter.h: New file.
4052 2005-08-16 Bruno Haible <bruno@clisp.org>
4054 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
4056 (mbi_avail, mbi_advance): Let the iteration end before the terminating
4057 NUL byte, not after it.
4059 2005-08-16 Bruno Haible <bruno@clisp.org>
4061 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
4062 the valid ones. Makes the comparison operations transitive:
4063 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
4064 * strcasecmp.c (strcasecmp): Use mb_casecmp.
4066 2005-08-16 Bruno Haible <bruno@clisp.org>
4068 * strcase.h (strcasecmp): Add note in comments.
4069 * strncasecmp.c: Use code from strcasecmp.c.
4070 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
4071 (strcasecmp): Work correctly in multibyte locales.
4073 2005-08-16 Bruno Haible <bruno@clisp.org>
4075 * strnlen1.h: New file.
4076 * strnlen1.c: New file.
4078 2005-08-16 Bruno Haible <bruno@clisp.org>
4080 * mbfile.h: New file.
4082 2005-08-16 Bruno Haible <bruno@clisp.org>
4084 * mbiter.h: New file.
4086 2005-08-16 Bruno Haible <bruno@clisp.org>
4088 * mbchar.h: New file.
4089 * mbchar.c: New file.
4091 2005-08-16 Bruno Haible <bruno@clisp.org>
4093 * tls.h: New file, from GNU gettext.
4094 * tls.c: New file, from GNU gettext.
4096 2005-08-15 Bruno Haible <bruno@clisp.org>
4098 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
4101 2005-08-14 Jim Meyering <jim@meyering.net>
4103 Sync from coreutils.
4105 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
4106 Use the hash-table-based cycle-detection code not just when
4107 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
4108 Reported by James Youngman in
4109 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
4110 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4111 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4112 This lets us compile with -DFTS_DEBUG, once again.
4113 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4114 * fts.c (fd_safer): Remove decl.
4115 Include fcntl--.h rather than unistd-safer.h
4116 (fts_safe_changedir): Don't call fd_safer; no longer needed
4117 now that we include fcntl--.h.
4119 2005-08-11 Simon Josefsson <jas@extundo.com>
4121 * readline.h, readline.c: New file.
4123 2005-08-11 Bruno Haible <bruno@clisp.org>
4125 * strnlen.h (strnlen): Change parameter name to match comment.
4127 2005-08-10 Simon Josefsson <jas@extundo.com>
4129 * strndup.c: Use strnlen.h.
4131 * strnlen.h: New file.
4133 2005-08-02 Simon Josefsson <jas@extundo.com>
4135 * getline.h, getline.c: Rewrite.
4137 * getdelim.h, getdelim.c: New files, ported from glibc.
4139 2005-07-31 Bruno Haible <bruno@clisp.org>
4141 * lock.h (gl_lock_initializer): New macro.
4142 (gl_lock_define_initialized): Use it.
4143 (gl_rwlock_initializer): New macro.
4144 (gl_rwlock_define_initialized): Use it.
4145 (gl_recursive_lock_initializer): New macro.
4146 (gl_recursive_lock_define_initialized): Use it.
4148 2005-07-26 Bruno Haible <bruno@clisp.org>
4150 * lock.h: Update from GNU gettext.
4151 * lock.c: Update from GNU gettext.
4153 2005-07-18 Bruno Haible <bruno@clisp.org>
4155 * lock.h (gl_once_t): New type.
4156 (gl_once_define, gl_once): New macros.
4157 * lock.c (fresh_once): New variable.
4158 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4161 2005-07-18 Simon Josefsson <jas@extundo.com>
4163 * check-version.c (check_version): Accept identical versions too.
4165 2005-07-18 Bruno Haible <bruno@clisp.org>
4167 * lock.h: New file, from GNU gettext.
4168 * lock.c: New file, from GNU gettext.
4170 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4172 * quotearg.c: Add translator comment suggested by Bruno Haible,
4173 with a minor change.
4175 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4177 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4178 copyright symbol and the year.
4179 * version-etc.c (COPYRIGHT_YEAR): New constant.
4180 (version_etc_va): Use parameterized copyright notice.
4181 Reword to conform to the current GNU coding standards.
4183 2005-07-11 Simon Josefsson <jas@extundo.com>
4185 * size_max.h: New file.
4187 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4189 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4192 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4193 and Paul Eggert <eggert@cs.ucla.edu>
4195 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4196 in wint_t, not wchar_t. Remove now-unnecessary cast.
4198 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4200 * regex.c, regex.h: Sync from libc.
4201 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4202 New files, synced from libc, except that regex_internal.h
4203 currently has a small porting fix.
4205 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4207 Remove the dependency of the strftime module on the tzset module.
4208 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4209 Copy the input structure, to work around some of the bug with
4210 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4211 Solaris releases, you should also use the tzset module, but we won't
4212 require it as a dependency any more since we don't want LGPLed code
4213 to depend on GPLed code.
4215 2005-07-02 Jim Meyering <jim@meyering.net>
4217 * backupfile.c (backup_args): Change a `0' to NULL.
4219 2005-07-01 Jim Meyering <jim@meyering.net>
4221 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4222 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4223 * save-cwd.c, tempname.c:
4224 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4225 and don't include <sys/file.h>).
4227 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4229 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4230 declares only 'struct timespec;' (!).
4232 2005-06-29 Jim Meyering <jim@meyering.net>
4234 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4235 type name. Use the variable name instead.
4236 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4238 2005-06-28 Simon Josefsson <jas@extundo.com>
4240 * check-version.h, check-version.c: New files.
4242 2005-06-28 Simon Josefsson <jas@extundo.com>
4244 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4245 collision with global variable. Better indentation. Don't
4246 increment buffer pointer beyond buffer end. Based on comments
4247 from Paul Eggert <eggert@cs.ucla.edu>.
4251 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4253 * canon-host.c (canon-host): Append trailing "," to 0 in
4254 initializer of struct addrinfo, as an indication that we don't
4255 care how many members the structure has.
4257 2005-06-24 Derek Price <derek@ximbiot.com>
4258 and Bruno Haible <bruno@clisp.org>
4260 Remove stat module & update lstat.
4261 * stat.c: Remove this file...
4262 (slash_aware_lstat): ...moving this content and its support...
4263 * lstat.c (rpl_lstat): ...into here.
4264 * lstat.h: New file.
4266 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4268 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4269 (ranged_convert): Don't save conversion in a temporary struct.
4270 This causes a warning with GCC 4.0.0, and anyway in the typical
4271 case it's not worth the extra 100 bytes or so of code.
4272 (ranged_convert, __mktime_internal): When calling a function via a
4273 pointer P, use P () rather than (*P) (), as we now assume C89 or
4276 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4278 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4279 "who -r" failed to give output. Problem reported by Tim Waugh.
4281 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4282 (xcalloc): Use it to avoid needless tests.
4283 Problem reported by Jim Meyering.
4285 2005-06-16 Jim Meyering <jim@meyering.net>
4287 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4288 when either N or S is zero.
4290 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4292 * argp.h (__option_is_short): Check upper limit of
4293 __key. Isprint() requires its argument to have the value
4294 of an unsigned char or EOF.
4296 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4298 * fnmatch.c (fnmatch): If there is an encoding error in a
4299 multibyte string or pattern, fall back on unibyte matching.
4300 Problem reported by James Youngman.
4302 2005-06-08 Bruno Haible <bruno@clisp.org>
4304 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4307 2005-06-08 Bruno Haible <bruno@clisp.org>
4309 * csharpcomp.h: New file, from GNU gettext.
4310 * csharpcomp.c: New file, from GNU gettext.
4311 * csharpcomp.sh.in: New file, from GNU gettext.
4313 2005-06-07 Derek Price <derek@ximbiot.com>
4316 * glob_.h: Indent nested #ifdef.
4318 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4320 Sync from coreutils.
4321 Use "file name" when talking about file names, instead of "filename"
4322 or "path", as per the GNU coding standards.
4323 * mkdir-p.c: Renamed from makepath.c.
4324 (make_dir_parents): Renamed from make_path. All callers changed.
4325 * mkdir-p.h: Likewise. All includers changed.
4326 * filenamecat.c: Renamed from path-concat.c.
4327 (file_name_concat): Renamed from path_concat. All callers changed.
4328 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4329 * filenamecat.h: Likewise. All includers changed.
4330 * acl.c: Don't use "path" or "filename" to mean "file name"
4331 in comments or local variable names.
4332 * basename.c: Likewise.
4333 * canonicalize.c, canonicalize.h: Likewise.
4334 * dirname.c, dirname.h: Likewise.
4335 * euidaccess.c: Likewise.
4336 * exclude.c: Likewise
4337 * fnmatch_.h, fnmatch_loop.c: Likewise.
4338 * fsusage.c, fsuage.h: Likewise.
4339 * fts.c, fts_.h: Likewise.
4340 * getcwd.c: Likewise.
4341 * getloadavg.c: Likewise.
4342 * mkstemp.c: Likewise.
4343 * mountlist.c, mountlist.h: Likewise.
4344 * openat.c, openat.h: Likewise.
4345 * readlink-stub.c: Likewise.
4346 * readutmp.c, readutmp.h: Likewise.
4347 * rename.c: Likewise.
4348 * rmdir.c: Likewise.
4350 * savedir.c: Likewise.
4351 * stripslash.c: Likewise.
4352 * tempname.c: Likewise.
4353 * xreadlink.c: Likewise.
4354 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4356 * exclude.h: Likewise.
4358 * euidaccess.c (getuid, getgid, getuid, getegid)
4359 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4360 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4361 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4362 * pathmax.h: Include <limits.h> unconditionally, since other
4363 files have been getting away with it for years (MORE/BSD 4.3
4365 * userspec.c (getpwnam, getgrnam, getgrgid)
4366 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4368 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4369 Define to 256, not 255, as per modern POSIX.
4371 2005-06-01 Bruno Haible <bruno@clisp.org>
4373 * csharpexec.h: New file, from GNU gettext.
4374 * csharpexec.c: New file, from GNU gettext.
4375 * csharpexec.sh.in: New file, from GNU gettext.
4377 2005-05-31 Derek Price <derek@ximbiot.com>
4378 Paul Eggert <eggert@cs.ucla.edu>
4381 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4383 2005-05-29 Derek Price <derek@ximbiot.com>
4384 Paul Eggert <eggert@cs.ucla.edu>
4386 * glob_.h, glob.c: New files.
4388 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4390 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4392 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4393 the configuration hassle isn't worth it.
4394 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4395 (LONGEST_MODIFIER, PRIuMAX): Remove.
4397 2005-05-27 Bruno Haible <bruno@clisp.org>
4399 * getlogin_r.h: Remove second include of <stddef.h>.
4401 2005-05-25 Bruno Haible <bruno@clisp.org>
4402 Derek Price <derek@ximbiot.com>
4404 * getlogin_r.h: Simplify API documentation.
4406 2005-05-25 Derek Price <derek@ximbiot.com>
4407 Paul Eggert <eggert@cs.ucla.edu>
4409 * getlogin_r.c, getlogin_r.h: New files.
4411 2005-05-22 Bruno Haible <bruno@clisp.org>
4413 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4414 Also include <sys/param.h> if it defines MIN, MAX.
4415 Based on a patch by Derek Price <derek@ximbiot.com>.
4417 2005-05-22 Bruno Haible <bruno@clisp.org>
4419 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4420 (INT64_MIN): Fix definition.
4421 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4423 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4424 NEED_SIGNED_INT_TYPES.
4426 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4427 HAVE_SYSTEM_INTTYPES.
4429 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4431 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4432 so that unistd-safer.h (GPL'ed code) need not be included.
4434 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4437 * fts.c: Don't include "cycle-check.h" or "hash.h".
4438 (setup_dir, free_dir): New functions.
4439 (enter_dir, leave_dir): Define trivial
4440 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4441 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4442 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4443 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4444 Move to fts-cycle.c.
4445 (fts_open): Use setup_dir.
4446 (fts_close): Use free_dir.
4447 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4448 This adds a label and some gotos, but the alternatives were messier.
4449 Check for memory allocation failure when entering a dir.
4450 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4451 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4452 (FTS): New member fts_cycle, that is a union that contains the
4453 old active_dir_ht and cycle_state. All uses changed to mention
4454 fts_cycle.ht and fts_cycle.state.
4455 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4456 fts.c, with the following changes:
4457 (setup_dir, free_dir): New functions.
4458 (enter_dir): Now returns bool. Return true if successful, false
4459 if memory exhausted. All callers changed.
4460 Do not bother partly cleaning up on
4461 memory allocation failure; that is free_dir's job.
4462 However, free ad if hash_insert fails, to avoid memory leak.
4463 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4464 fts->fts_options to see which union member to use.
4466 2005-05-20 Jim Meyering <jim@meyering.net>
4468 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4469 Now a macro, to pacify GCC.
4471 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4473 * chown.c (rpl_chown): Return -1 on failure.
4475 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4477 * canonicalize.c: Include canonicalize.h first, to test interface.
4478 Include <stddef.h> unconditionally, since we assume C89 now.
4479 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4480 * fts.c: Include fts_.h first, to check interface.
4481 Do not include intprops.h; no longer needed.
4482 Include cycle-check.h and hash.h, since fts_.h no longer does.
4483 Remove unnecessary casts of closedir to void.
4484 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4485 decide whether to decrement nlinks.
4486 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4487 (FTS): Use struct hash_table * instead of Hash_table, so that
4488 we no longer need to include hash.h here.
4490 2005-05-17 Jim Meyering <jim@meyering.net>
4492 * fts.c, fts_.h: New files, from coreutils.
4494 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4496 Sync from coreutils.
4497 * unlinkdir.c, unlinkdir.h: New files.
4498 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4499 regex.h, unlocked-io.h, xtime.h:
4500 White space changes only.
4501 * makepath.c (make_path): Port to hosts where leading "//" is special.
4502 * yesno.c: Include getline.h, not ctype.h.
4503 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4504 Use getline to remove arbitrary restriction on response length.
4506 2005-05-13 Bruno Haible <bruno@clisp.org>
4508 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4509 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4510 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4511 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4512 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4513 Add support for 64-bit integers in the MSVC compiler.
4515 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4517 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4518 Change the initial comment to refer to GPL, not LGPL.
4519 gnulib-tool will change it to LGPL as needed.
4521 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4522 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4523 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4524 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4525 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4526 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4527 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4528 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4529 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4530 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4531 concatpath.c, config.charset, copy-file.c, copy-file.h,
4532 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4533 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4534 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4535 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4536 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4537 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4538 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4539 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4540 full-read.c, full-read.h, full-write.c, full-write.h,
4541 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4542 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4543 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4544 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4545 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4546 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4547 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4548 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4549 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4550 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4551 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4552 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4553 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4554 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4555 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4556 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4557 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4558 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4559 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4560 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4561 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4562 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4563 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4564 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4565 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4566 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4567 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4568 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4569 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4570 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4571 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4572 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4573 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4574 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4575 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4576 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4577 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4578 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4579 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4580 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4581 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4582 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4583 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4584 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4585 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4586 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4587 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4588 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4589 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4590 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4591 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4592 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4593 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4594 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4595 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4596 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4597 Update FSF postal mail address.
4599 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4601 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4602 specified in ai_socktype. Fix invalid ai_protocol
4603 check. ai_protocol is usually set to 0 or depending on
4604 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4605 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4606 ai_socktype / ai_protocol in the returned addrinfo structure.
4608 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4609 Bruno Haible <bruno@clisp.org>
4611 * inet_ntop.h: New file.
4612 * inet_ntop.c: New file, from glibc with modifications.
4614 2005-05-08 Jim Meyering <jim@meyering.net>
4616 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4618 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4620 Merge from coreutils. Among other things,
4621 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4622 * fd-safer.c: New file.
4623 * fcntl-safer.h, open-safer.c: Remove.
4624 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4625 * dup-safer.c: Include unistd-safer.h first.
4626 Don't include errno.h.
4627 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4628 * file-type.h: Don't assume invoker included sys/stat.h first.
4629 * file-type.c: Rely on file-type.h change.
4630 * getloadavg.c: Include unistd-safer.h.
4631 (getloadavg): Use safer open.
4632 * getusershell.c: Include "stdio-safer.h".
4633 (getusershell): Use safer fopen.
4634 * long-options.c (long_options): Use NULL rather than 0.
4635 * modechange.h (mode_free): Remove; all callers changed to invoke
4637 * modechange.c: Likewise.
4638 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4639 (MODE_DONE): New constant.
4640 (struct mode_change): Remove 'next' member.
4641 (make_node_op_equals): New function; like the old one of the
4642 same name, except it allocates an array.
4643 (mode_compile, mode_create_from_ref): Use it.
4644 (mode_compile): Allocate result as an array, not a linked list.
4645 Parse octal string ourself, so that we catch mistakes like "+0".
4646 (mode_adjust): Arg is an array, not a linked list.
4647 * modechange.c: Include stat-macros.h, xalloc.h.
4648 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4649 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4650 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4651 Remove. This is now stat-macros.h's job.
4652 (talloc): Remove. All callers replaced by xalloc, so that
4653 our invokers don't have to worry about reporting memory failures.
4654 (make_node_op_equals): Remove.
4655 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4657 (struct mode_change): Moved here from modechange.h.
4658 (mode_append_entry): Remove.
4659 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4660 apps to have incorrect behavior. Use simpler algorithm for head
4661 and tail. Don't futz with umask; that's now the job of mode_adjust.
4662 Detect more invalid usages rather than having somewhat-random behavior.
4663 Don't insert an "a=" action, as that leads to incorrect behavior.
4664 (mode_compile, mode_create_from_ref): Return NULL on error instead
4665 of an enum, since now there's only one way to have an error. All
4667 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4668 at the correct time. Simplify calculation of "+u" and its ilk.
4669 Don't mishandle "+X".
4670 (mode_free): Remove "register" and localize decls.
4671 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4672 (struct mode_change): Move to modechange.c; callers don't
4673 need to see this stuff.
4674 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4675 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4676 (mode_change, mode_adjust): Reflect the new signatures noted above.
4677 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4678 that might redefine system include files.
4679 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4680 (my_usleep): Use NULL rather than (void *) 0.
4681 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4682 Use siginterrupt to specify that system calls should be interrupted.
4683 (rpl_nanosleep): Move initialization of suspended closer to call of
4685 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4686 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4687 (desirable_utmp_entry): New function.
4688 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4689 using x2nrealloc, to simplify logic.
4690 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4691 size calculation. Do not assume utmp file is a regular file.
4692 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4693 (READ_UTMP_CHECK_PIDS): New constant.
4694 * save-cwd.c: Include unistd-safer.h.
4695 (save_cwd): Use fd_safer.
4696 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4697 [!_LIBC] Include "stat-macros.h" instead.
4698 * unistd-safer.h (fd_safer): New decl.
4700 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4702 * byteswap_.h: New file.
4704 2005-04-25 Albert Chin <china@thewrittenword.com>
4706 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4709 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4711 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4712 that "UTC +1 second" continues to work. Problem reported
4714 (relunit_snumber): New rule.
4717 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4719 * getdate.y (universal_time_zone_table): New constant.
4720 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4721 universal_time_zone_table.
4722 (lookup_zone): Prefer universal_time_zone_table to
4723 local_time_zone_table, so that "GMT" time stamps are allowed in
4724 London during the summer. Problem reported by Ian Abbott.
4726 2005-04-12 Jim Meyering <jim@meyering.net>
4728 * human.c (humblock): Set *options even when returning due to
4729 xstrtoumax conversion failure. Thanks to a used-uninitialized
4732 2005-04-09 Jim Meyering <jim@meyering.net>
4734 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4735 -Wuninitialized: initialize tm0.tm_year.
4737 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4739 * getdate.y (parser_control): rels_seen is now a boolean, not a
4740 count, since there's no maximum. All uses changed.
4741 Add member dsts_seen.
4742 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4744 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4745 Use pc_rels_seen to decide whther a date is absolute.
4747 * getdate.y (number): Don't overwrite year.
4748 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4751 2005-04-02 Simon Josefsson <jas@extundo.com>
4753 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4754 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4756 2005-03-27 Jim Meyering <jim@meyering.net>
4758 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4760 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4762 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4763 "one's complement" -> "ones' complement" in comment, as per Knuth.
4764 "value of type" -> "type or expression" in comment.
4765 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4767 2005-03-26 Jim Meyering <jim@meyering.net>
4770 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4771 Correct typos: s/or/of/.
4773 2005-03-23 Jim Meyering <jim@meyering.net>
4775 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4777 2005-03-21 Jim Meyering <jim@meyering.net>
4779 Changes imported from coreutils.
4781 * cycle-check.c: Don't include xalloc.h.
4783 * path-concat.c: Don't include assert.h.
4784 (path_concat): Remove assertion that would have triggered
4785 for ABASE starting with more than one slash.
4786 Reported by Andreas Schwab.
4788 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4789 properly when ABASE is an absolute file name.
4790 Correct the description of this function.
4792 Add an assertion and a test driver.
4793 This fixes a bug introduced on 2004-07-02.
4794 Andreas Schwab reported the resulting failure of cp --parents:
4795 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4797 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4799 * strftime.c (my_strftime): If the underlying strftime returns 0
4800 (which shouldn't happen), generate nothing instead of returning 0
4801 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4803 2005-03-16 Bruno Haible <bruno@clisp.org>
4805 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4807 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4809 * strftime.c (my_strftime): Prepend space to format so that we can
4810 reliably distinguish strftime failure from empty output on POSIX
4813 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4815 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4816 (iconv_string): Don't guess a size-zero buffer, as that might cause
4817 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4818 result would be 'too large', where 'too large' is (heuristically)
4819 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4820 overflow concerns. This will prevent some unwanted malloc failures
4821 when the inputs are very large.
4823 2005-03-15 Bruno Haible <bruno@clisp.org>
4825 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4828 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4831 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4833 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4835 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4836 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4838 * strtol.c: Likewise.
4840 2005-03-14 Simon Josefsson <jas@extundo.com>
4842 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4845 2005-03-14 Jim Meyering <jim@meyering.net>
4847 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4848 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4849 to be nonzero so that we (and caller) can detect the difference
4850 between a valid zero-length expansion and an error return, even
4851 when the underlying strftime fails before writing anything into
4854 2005-03-10 Jim Meyering <jim@meyering.net>
4856 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4857 so that this module works on systems without fchdir.
4859 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4861 Factor int-properties macros into a single file, except for
4862 glibc-related files.
4863 * intprops.h: New file.
4864 * getloadavg.c: Include it instead of limits.h.
4865 (INT_STRLEN_BOUND): Remove.
4866 * human.c: Include intprops.h.
4867 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4868 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4869 * inttostr.h: Include intprops.h instead of limits.h.
4870 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4871 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4872 for consistency with intprops.h.
4873 (time_t_is_integer, twos_complement_arithmetic): Use them.
4874 * sig2str.h: Include <signal.h>, intprops.h.
4875 (INT_STRLEN_BOUND): Remove.
4876 * strftime.c (TYPE_SIGNED): Remove.
4877 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4878 * strtol.c: Adjust comments to match intprops.h.
4879 * userspec.c: Include intprops.h.
4880 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4881 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4882 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4883 instead of rolling our own expressions.
4884 * xstrtol.c: Include xstrtol.h first, to test interface.
4886 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4888 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4889 the right thing even if adding 1900 would overflow. Similarly
4890 for tm_mon + 1 and tm_yday + 1.
4891 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4892 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4893 (DO_SIGNED_NUMBER): New macro.
4894 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4896 2005-03-07 Bruno Haible <bruno@clisp.org>
4898 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4900 2005-03-03 Derek R. Price <derek@ximbiot.com>
4901 Bruno Haible <bruno@clisp.org>
4903 * pagealign_alloc.h: New file.
4904 * pagealign_alloc.c: New file.
4906 2005-01-28 Bruno Haible <bruno@clisp.org>
4908 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4911 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4913 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4914 The workaround isn't strictly needed for POSIX conformance, and
4915 it's too much of a pain to configure and maintain. We'll ask
4916 people to fix their kernels instead.
4917 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4918 (NANOSLEEP_BUG_WORKAROUND): Remove.
4919 (xnanosleep): Remove the workaround.
4921 2005-02-12 Bruno Haible <bruno@clisp.org>
4923 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4925 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4927 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4928 * timespec.h (gettime): Return void, since it always
4929 succeeds now. All uses changed.
4930 * gettime.c (gettime) Likewise.
4931 [HAVE_NANOTIME]: Prefer nanotime.
4932 Assume gettimeofday succeeds, as POSIX requires.
4933 Assime time () succeeds, since other code already does.
4934 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4935 (timespec_subtract): Remove.
4936 (NANOSLEEP_BUG_WORKAROUND): New constant.
4937 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4938 things considerably. Use it only on GNU/Linux hosts, since the
4939 workaround shouldn't be needed elsewhere.
4941 2005-02-24 Bruno Haible <bruno@clisp.org>
4943 * gettext.h: Update from GNU gettext 0.14.2.
4945 2005-02-24 Bruno Haible <bruno@clisp.org>
4947 * localcharset.c: Update from GNU gettext 0.14.2.
4948 * config.charset: Update from GNU gettext 0.14.2.
4950 2005-02-22 Simon Josefsson <jas@extundo.com>
4952 * iconvme.h, iconvme.c: New files, from libc.
4954 2005-02-20 Neil Conway <neilc@samurai.com>
4956 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4957 returned by OSX/Darwin if the specified buffer is not large
4958 enough for the hostname.
4960 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4962 * memrchr.h: New file.
4963 * chdir-long.c: Include it.
4964 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4965 Don't bother including stddef.h.
4967 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4969 * argp-help.c (__argp_help): Create a fake struct argp_state and
4970 pass it to _help, otherwise the latter coredumps trying to
4971 dereference state.root_argp.
4973 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4975 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4977 Include <sys/types.h>, for dev_t.
4978 (ME_DUMMY, ME_REMOTE): Move from here....
4979 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4980 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4982 Include mountlist.h first, to test the interface.
4984 2005-01-29 Bruno Haible <bruno@clisp.org>
4986 * progname.c (program_name): Initialize.
4987 Needed when linking statically on MacOS X.
4989 2005-01-28 Bruno Haible <bruno@clisp.org>
4991 * javacomp.sh.in: New file, from GNU gettext.
4992 * javacomp.h: New file, from GNU gettext.
4993 * javacomp.c: New file, from GNU gettext.
4995 2005-01-26 Bruno Haible <bruno@clisp.org>
4997 * javaexec.sh.in: New file, from GNU gettext.
4998 * javaexec.h: New file, from GNU gettext.
4999 * javaexec.c: New file, from GNU gettext.
5001 2005-01-26 Simon Josefsson <jas@extundo.com>
5003 * gai_strerror.c: Use GPL in header.
5005 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5007 * argp-help.c (hol_entry_help): Avoid using non-constant
5008 initializers for struct pentry_state.
5009 (__argp_error): Check return value of __asprintf
5010 (__argp_failure): Translate error message
5012 * argp-parse.c: Removed braces around the expansion of N_()
5014 2005-01-21 Jim Meyering <jim@meyering.net>
5016 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
5017 same value as for Solaris 9.
5019 * chdir-long.c (chdir_long): Rewrite to remove limitation on
5020 component length. This included changing the parameter to be
5021 of type `char *' rather than `char const *'.
5022 * chdir-long.h (chdir_long): Update prototype.
5024 * openat.c (fdopendir, fstatat): New functions.
5025 * openat.h: Include headers required for use of DIR and struct stat.
5026 [AT_SYMLINK_NOFOLLOW]: Define.
5027 (fdopendir, fstatat): Add prototypes.
5029 2005-01-21 Bruno Haible <bruno@clisp.org>
5031 * classpath.h: New file, from GNU gettext.
5032 * classpath.c: New file, from GNU gettext.
5034 2005-01-20 Simon Josefsson <jas@extundo.com>
5036 * version-etc-fsf.c: New file, with version_etc_copyright.
5037 * version-etc.c: Remove version_etc_copyright.
5038 * version-etc.h (version_etc_copyright): Use [] instead of * in
5039 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
5041 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
5043 * save-cwd.c (save_cwd): Remove code to support the case
5044 where fchdir is missing or flaky.
5046 2005-01-20 Simon Josefsson <jas@extundo.com>
5048 * base64.h (isbase64): Add.
5050 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
5051 using a unsigned prototype, don't inline.
5052 (base64_decode): Use it.
5054 2005-01-19 Bruno Haible <bruno@clisp.org>
5056 * sh-quote.h: New file, from GNU gettext.
5057 * sh-quote.c: New file, from GNU gettext.
5059 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
5061 Merge changes from coreutils, as described below in several
5062 changelogs dated today.
5064 * save-cwd.c: Include "save-cwd.h" before other include files.
5065 (O_DIRECTORY): Remove; not needed here, since "." must be
5066 a directory. All uses removed.
5067 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
5068 universal on Suns, and we also need to test for IRIX.
5069 Revamp code to use 'if' rather than '#if'.
5070 Avoid unnecessary comparison of cwd->desc to 0.
5072 * utimens.c (futimens): Robustify the previous patch, by checking
5073 for known valid error numbers rather than observed invalid ones.
5075 2005-01-18 Jim Meyering <jim@meyering.net>
5077 * version-etc.c (version_etc_copyright): Update copyright date.
5079 * utimens.c (futimens): Account for the fact that futimes
5080 can also fail with errno == ENOSYS or errno == ENOENT.
5081 Patch from Dmitry V. Levin.
5083 Change the name of the robust chdir function from chdir to chdir_long.
5084 * save-cwd.c: Include chdir-long.h rather than chdir.h.
5085 (restore_cwd): Use chdir_long, not chdir.
5086 * chdir-long.c: Renamed from chdir.c.
5087 * chdir-long.h: Renamed from chdir.h.
5088 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
5091 2005-01-18 Bob Proulx <bob@proulx.com>
5093 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
5094 offsetof() macro construct to avoid compile failure with native HP-UX
5095 11.0 ANSI C compiler.
5097 2005-01-06 Bruno Haible <bruno@clisp.org>
5099 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
5100 because stpncpy.m4 takes care of it.
5102 2004-01-24 Bruno Haible <bruno@clisp.org>
5104 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
5106 2003-10-09 Bruno Haible <bruno@clisp.org>
5108 * progreloc.c: Include xalloc.h instead of xmalloc.h.
5110 2005-01-06 Bruno Haible <bruno@clisp.org>
5112 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5113 * fwriteerror.c: Include <stdbool.h>.
5114 (fwriteerror): At the end, close the file stream. Record whether
5115 stdout was already closed.
5117 2004-05-27 Bruno Haible <bruno@clisp.org>
5119 * execute.c (environ): Declare if needed.
5120 * pipe.c (environ): Likewise.
5121 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5123 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5125 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5126 definitions to be after all include files, to avoid collisions.
5127 Problem reported by Bob Proulx.
5129 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5131 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5132 not needed. This removes a dependency on the gettext module.
5133 [defined _LIBC]: Do not include <libintl.h>; not needed.
5135 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5137 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5140 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5142 * argp-parse.c: Include <stddef.h>.
5143 (alignof, alignto): New macros.
5144 (parser_init): Don't assume that void * is aligned sufficiently
5147 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5148 need to extend the stack.
5149 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5152 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5154 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5156 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5158 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5159 Remove now-obsolete comment about AIX.
5160 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5161 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5162 (YYMAXDEPTH): New macro.
5164 2004-12-18 Bruno Haible <bruno@clisp.org>
5166 * fatal-signal.c (fatal_signals): Make non-const.
5167 (init_fatal_signals): New function.
5168 (uninstall_handlers, install_handlers): Ignore signals that were set to
5170 (at_fatal_signal): Call init_fatal_signals.
5171 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5173 Reported by Paul Eggert.
5175 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5177 * getdate.y (textint): New member "negative".
5178 (time_zone_hhmm): New function.
5179 Expect 14 shift-reduce conflicts, not 13.
5180 (o_colon_minutes): New rule.
5181 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5182 (yylex): Set the "negative" member of signed numbers.
5184 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5186 Changes imported from coreutils.
5187 * hard-locale.c: Assume <locale.h> exists.
5189 (GLIBC_VERSION): New macro.
5190 (hard_locale): Assume setlocale exists.
5191 Rewrite to avoid #ifdef.
5192 Use strdup rather than malloc + strcpy.
5193 * human.c: Assume <locale.h> exists.
5194 (human_readable): Assume localeconv exists.
5196 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5198 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5199 convert T2, not T. (Imported from libc.)
5201 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5203 * getcwd.c (is_ENAMETOOLONG): New macro.
5204 (__getcwd.c): Don't restore errno; glibc doesn't.
5205 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5206 first, falling back to our code only if its results look suspicious.
5207 Ensure that the resulting buffer is only as large as necessary.
5209 * readutmp.c: Include readutmp.h first.
5210 Include <errno.h>, since readutmp.h no longer does that.
5211 * readutmp.h: Don't include <errno.h>,
5212 <sys/param.h>, <time.h>; not needed to establish interface.
5213 (errno): Remove decl.
5214 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5215 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5216 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5218 2004-11-28 Simon Josefsson <jas@extundo.com>
5220 * base64.h, base64.c: New file.
5222 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5224 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5226 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5228 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5229 HP's ANSI C compiler.
5230 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5231 Declaring int functions causes warnings on some modern systems and
5232 shouldn't be needed to compile on ancient ones.
5233 * same.c (MIN) [defined MIN]: Don't define, since it's already
5236 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5237 with the following changes.
5238 (__set_errno): Parenthesize properly.
5239 Include <stdbool.h>.
5240 (MIN, MAX, MATCHING_INO): New macros.
5241 (__getcwd): Define with prototype, not K&R form.
5242 Use heuristics to allocate default buffer on stack if possible.
5243 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5244 behavior, and to avoid the PATH_MAX limit when computing
5246 Use MATCHING_INO to compare inode number to file.
5247 Check for arithmetic overflow in size calculations.
5248 Fix bug in reallocation of dot array that caused getcwd to fail
5249 on directories nested deeper than 75.
5250 Be more careful about saving errno on error.
5251 Do not use realloc; use only free+malloc, as this is a bit
5252 more flexible and avoids a needless copy operation.
5253 Do not inspect st_dev and st_ino for symbolic links; POSIX
5254 doesn't specify the latter.
5255 Check for closedir errors.
5256 Avoid needless casts.
5257 Use "#ifdef weak_alias" around weak_alias, to be like other
5259 The following changes to getcwd.c have effect only when used in
5260 gnulib; they have no effect inside glibc proper.
5261 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5262 as alloca isn't used.
5263 (alloca, __alloca): Likewise.
5264 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5265 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5266 unconditionally, as gnulib assumes C89 or better.
5267 Do not include <sys/param.h>.
5268 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5269 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5271 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5272 Include <dirent.h> in a way that is compatible with modern Autoconf.
5273 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5274 New macros, if not already defined.
5275 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5276 Use "_LIBC", not "defined _LIBC", for consistency.
5277 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5279 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5280 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5281 * xgetcwd.c: David MacKenzie's old code was removed, so give
5282 credit only to Jim Meyering and adjust the copyright dates.
5283 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5284 <stdlib.h>, <unistd.h>, "pathmax.h".
5285 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5286 (INITIAL_BUFFER_SIZE): Remove.
5287 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5289 2004-11-23 Jim Meyering <jim@meyering.net>
5291 * getopt_.h: Remove trailing blanks.
5293 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5295 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5296 (futimens): New function, which uses futimes if available.
5297 (futimens, utimens): Support timespec==NULL, with same semantics
5298 as utime and utimens.
5299 * utimens.h (futimens): New decl.
5301 2004-11-23 Jim Meyering <jim@meyering.net>
5303 * __fpending.c: Add comment.
5305 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5307 * getopt_.h: Re-addition of __getopt_argv_const caused
5308 redefinition warnings. To avoid them, include the defines
5309 in `#if !defined __need_getopt ... #endif'. The only place
5310 where __getopt_argv_const is used is in definitions
5311 of getopt_long and getopt_long_only below, which are as well
5312 protected by `#ifndef __need_getopt'.
5313 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5314 __need_getopt after including <stdio.h> and <unistd.h> These
5315 headers might have defined it.
5317 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5319 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5321 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5322 optopt): Use them instead of invoking ## directly; otherwise, the
5323 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5325 2004-11-19 Bruno Haible <bruno@clisp.org>
5327 * strtok_r.c: Move comments from here...
5328 * strtok_r.h: ... to here.
5330 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5332 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5333 might fail. Problem reported by Yoann Vandoorselaere.
5334 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5335 that mishandle size_t overflow.
5337 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5339 * canon-host.c: Include "strdup.h".
5340 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5341 Use strdup instead of malloc/strcpy to duplicate strings.
5343 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5344 (human_space_before_unit): New constant.
5345 * human.c (human_readable): Support it.
5347 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5348 (xgetcwd): Set errno correctly when failing.
5349 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5350 the failure is actually due to a PATH_MAX problem.
5352 Further getopt changes to make it more likely that glibc will
5353 buy the changes back.
5354 * getopt.c (POSIXLY_CORRECT): New constant.
5355 (getopt): Use it, so to preserve glibc semantic
5356 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5357 when compiling for libc.
5358 * getopt_.h (__getopt_argv_const): Bring it back.
5359 (getopt_long, getopt_long_only): Use it.
5361 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5362 New arg POSIXLY_CORRECT. All callers changed.
5363 (getopt): Argv is now char * const *, as per standard.
5364 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5365 not char *__getopt_argv_const *.
5366 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5367 _getopt_long_only_r): Likewise.
5368 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5369 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5370 _getopt_long_r, _getopt_long_only_r): Likewise.
5371 * getopt_.h (__getopt_argv_const): Remove.
5372 (getopt): Argv is now char * const *, as per standard.
5374 * getdate.y (tORDINAL): New token.
5375 (day, relunit): Allow it for relative times.
5376 (relative_time_table): Use tORDINAL for ordinals.
5378 2004-11-15 Jim Meyering <jim@meyering.net>
5380 * closeout.c: Include "__fpending.h" once again.
5381 Include <stdbool.h>.
5382 (close_stdout): Don't fail just because stdout was closed initially,
5383 since some programs don't write to stdout in the normal course of
5384 operation (other than --version and --help), and we don't want this
5385 function to make e.g. `touch file >&-' fail.
5386 But do fail if it was closed and someone has tried to write to it.
5387 E.g., `printf foo >&-' must fail.
5389 2004-11-11 Simon Josefsson <jas@extundo.com>
5391 * strtok_r.h, strtok_r.c: New file.
5393 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5395 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5396 we can stop lying to compilers about the constness of argv when we
5397 are compiled outside glibc.
5398 (getopt, getopt_long, getopt_long_only): Use it.
5399 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5401 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5402 _getopt_long_only_r): Likewise.
5403 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5404 _getopt_long_only_r): Likewise.
5406 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5407 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5408 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5409 the other external symbols.
5410 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5411 declaration, since the above renaming now works around collisions.
5413 2004-11-11 Jim Meyering <jim@meyering.net>
5415 * linebreak.c: Remove trailing blanks.
5416 * alloca_.h: Likewise.
5417 * acosl.c: Likewise.
5418 * euidaccess.c: Likewise.
5419 * allocsa.h: Likewise.
5421 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5423 * mktime.c (SHR): New macro, which is a portable
5424 substitute for >> that should work even on Crays.
5425 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5426 Problem reported by Mark D. Baushke in
5427 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5428 * getdate.y (SHR): Likewise.
5430 * strftime.c (SHR): Likewise.
5432 * quotearg.c (struct quoting_options): Use unsigned int for
5433 quote_these_too, so that right shifts are well defined. All uses
5436 2004-11-10 Simon Josefsson <jas@extundo.com>
5438 * getaddrinfo.h, getaddrinfo.c: New files.
5440 2004-11-10 Jim Meyering <jim@meyering.net>
5442 Ensure that no close failure goes unreported.
5443 * closeout.c (close_stdout): Always close stdout. I.e., don't
5444 return early when it seems there's nothing to flush.
5445 Don't include __fpending.h.
5447 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5449 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5451 2004-11-05 Bruno Haible <bruno@clisp.org>
5453 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5454 Reported by Mark D. Baushke <mdb@cvshome.org>.
5456 2004-11-04 Bruno Haible <bruno@clisp.org>
5458 2004-09-11 Bruno Haible <bruno@clisp.org>
5459 * allocsa.valgrind: New file.
5460 2004-02-06 Bruno Haible <bruno@clisp.org>
5461 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5462 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5463 Reported by Christopher Seip <chris.seip@hp.com>.
5465 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5467 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5468 with errno == ERANGE if the buffer is too small.
5469 Problem reported by Mark D. Baushke.
5471 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5473 * xreadlink.c (MAXSIZE): New macro.
5474 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5475 size does not exceed MAXSIZE. Avoid cast.
5476 As suggested by Mark D. Baushke in
5477 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5478 if readlink fails with buffer size just under MAXSIZE, try again
5481 2004-11-02 Derek R. Price <derek@ximbiot.com>
5482 and Paul Eggert <eggert@cs.ucla.edu>
5484 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5485 (get_date): Overparenthesize to avoid GCC warning.
5487 2004-11-02 Bruno Haible <bruno@clisp.org>
5489 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5490 function returns void.
5492 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5494 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5495 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5498 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5500 * getdate.y: Add support for TZ="foo" within a date string.
5501 Fix some bugs near time_t boundaries. Reject dates with
5502 out-of-range components, e.g., "Sept 31".
5503 Include <stdlib.h>, "setenv.h", "xalloc.h".
5504 (ISDIGIT_LOCALE): Remove; unused.
5505 Note that the TZ and time functions used here are not reentrant.
5506 (mktime_ok, get_tz): New functions.
5507 (TZBUFSIZE): New constant.
5508 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5509 This requires that we sometimes generate our own TZ="XXX..." setting.
5511 2004-10-27 Derek R. Price <derek@ximbiot.com>
5513 * mktime.c (not_equal_tm): Remove redundant check.
5515 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5517 * getdate.y: Use Bison 1.875 features, and some minor
5518 code cleanups. This change does not affect semantics.
5519 Don't include <stdlib.h>; no longer needed.
5520 Don't include unlocked-io.h; only the "#if TEST" code uses
5521 stdio, and performance isn't crucial there.
5522 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5523 Bison 1.875 features as described below.
5524 All uses of "PC." replaced by "pc->".
5525 (YYSTYPE): Add a forward declaration.
5526 (yylex, yyerror): Use full prototypes in forward decls.
5527 Use "%pure-parser" rather than obsolescent "%pure_parser".
5528 Use %parse-param and %lex-param instead of obsolescent
5529 YYPARSE_PARAM and YYLEX_PARAM.
5530 (meridian_table, month_and_day_table, time_units_table,
5531 relative_time_table, time_zone_table, military_table,
5532 lookup_zone, lookup_word, get_date):
5533 Use NULL instead of 0 where appropriate.
5534 (to_hour): Avoid abort (), to avoid a dependency on
5536 (yyerror, yylex): Now accepts parser_control * arg.
5537 (main) [TEST]: Use '\0' rather than 0 for char.
5539 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5541 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5542 It's now the caller's responsibility to handle the case where
5543 !HAVE_GETPAGESIZE && !defined getpagesize.
5545 * mktime.c (leapyear): Arg is long int, not int.
5547 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5549 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5551 2004-10-12 Simon Josefsson <jas@extundo.com>
5553 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5554 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5557 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5559 * vsnprintf.h: New file.
5560 * vsnprintf.c: New file.
5562 2004-10-07 Bruno Haible <bruno@clisp.org>
5564 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5565 into the provided buffer.
5567 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5569 * diacrit.c, diacrit.h: Add GPL notice.
5571 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5572 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5573 * logl.c (logl): Keep the code as similar to glibc as possible.
5574 This avoids a potential constant-folding bug.
5576 2004-10-05 Bruno Haible <bruno@clisp.org>
5578 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5580 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5582 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5583 * xmalloc.c (xmemdup): Likewise.
5584 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5585 XFREE): Remove these long-obsolescent macros.
5586 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5587 * xstrdup.c: Remove.
5589 * regex.c (re_comp): Cast gettext return value to char *,
5590 Problem reported by Martin Neitzel via Mark D. Baushke.
5592 2004-10-04 Simon Josefsson <jas@extundo.com>
5594 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5595 '#ifdef USE_UNLOCKED_IO'.
5597 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5599 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5600 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5601 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5602 regex.c, sha1.c, version-etc.c, yesno.c:
5603 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5604 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5605 the includer's responsibility.
5607 Sync from coreutils.
5609 * modechange.c (mode_compile): Don't decrement a pointer that
5610 points to the start of a string, as the C Standard says the
5611 resulting behavior is undefined.
5613 * backupfile.h (enum backuptype): Rename none -> no_backups,
5614 simple -> simple_backups, numbered_existing ->
5615 numbered_existing_backups, numbered -> numbered_backups
5616 to avoid shadowing problems. All uses changed.
5617 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5618 * backupfile.c (check_extension, numbered_backup):
5619 Rename locals to avoid shadowing 'basename'.
5620 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5623 * .cppi-disable: Add getopt_.h, getopt_int.h.
5624 * .cvsignore: Add getopt.h.
5626 2004-10-04 Simon Josefsson <jas@extundo.com>
5628 * memmem.h: New file.
5629 * memmem.c: New file, taken from glibc.
5631 2004-10-02 Jim Meyering <jim@meyering.net>
5633 * dirfd.h, getpagesize.h: Add copyright notice.
5635 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5637 * snprintf.c: Remove comments as to why each header is needed.
5639 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5641 * strsep.h: New file.
5642 * strsep.c: New file.
5644 2004-10-01 Simon Josefsson <jas@extundo.com>
5646 * snprintf.c (snprintf): Handle size==0.
5648 2004-10-01 Simon Josefsson <jas@extundo.com>
5649 Bruno Haible <bruno@clisp.org>
5651 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5652 (snprintf): Declare 'args'.
5654 2004-09-30 Simon Josefsson <jas@extundo.com>
5656 * snprintf.h, snprintf.c: New files.
5658 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5660 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5661 (hol_entry_help): Never translate an empty string.
5662 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5663 * argp.h (OPTION_NO_TRANS): New option.
5665 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5667 * xvasprintf.c: Include xalloc.h.
5668 (xvasprintf): Use xalloc_die, not xmalloc_die.
5670 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5672 * dummy.c: Change copyright notice to FSF, and license to GPL.
5674 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5676 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5677 Problem reported by Bruno Haible in:
5678 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5680 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5682 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5683 in case some system header has #define'd it. Problem reported by
5684 Soeren D. Schulze in
5685 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5687 2004-09-08 Bruno Haible <bruno@clisp.org>
5689 * stdint_.h: New file, taken from GNU clisp.
5691 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5693 * xvasprintf.h: New file.
5694 * xvasprintf.c: New file.
5695 * xasprintf.c: New file.
5697 2004-09-08 Bruno Haible <bruno@clisp.org>
5699 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5701 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5703 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5705 Import from coreutils.
5706 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5707 strings on unbounded length. alloca's performance benefits aren't
5708 that important here.
5710 (parse_with_separator): New function, with most of the internals
5711 of the old parse_user_spec. Allow user to omit both user and group,
5712 for compatibility with FreeBSD.
5713 Clone only the user name, not the entire spec.
5714 Do not set *uid, *gid unless entirely successful.
5715 Avoid memory leak in some failing cases.
5716 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5717 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5718 (parse_user_spec): Rewrite to use parse_with_separator.
5720 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5722 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5723 its complicated substitute.
5724 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5725 and program_invocation_name.
5726 (__argp_basename) [!_LIBC]: Remove; the only use was
5727 replaced by its body.
5728 (__argp_short_program_name): Change condition from
5729 !defined __argp_short_program_name to
5730 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5731 to match argp-namefrob.h.
5732 (__argp_failure): Don't assume strerror_r returns char *.
5733 * argp-parse.c (N_): Define unconditionally.
5734 (argp_default_options): Fill out initializers with 0 to avoid
5737 2004-08-12 Simon Josefsson <jas@extundo.com>
5739 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5740 * getopt_.h: Renamed from getopt.h.
5742 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5744 Merge from coreutils.
5746 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5747 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5748 for Reliant Unix 5.43.
5750 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5751 (union fooround): Use uintmax_t, not long int.
5752 The rest is a merge from libc:
5753 [defined _LIBC]: Include <shlib-compat.h>.
5754 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5756 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5758 * strverscmp.c: Convert to UTF-8.
5760 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5762 * obstack.h (obstack_empty_p):
5763 Don't assume that chunk->contents is suitably aligned.
5764 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5765 Likewise. Problem reported by Benno in
5766 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5768 * chown.c (rpl_chown): Work even if the file is writeable but not
5769 readable. This could be improved further but it'd take some work.
5771 2004-08-08 Simon Josefsson <jas@extundo.com>
5773 * xgethostname.c: Don't include error.h (not used).
5776 * getpass.c: Include getpass.h first.
5778 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5780 * xalloc-die.c: New files.
5781 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5783 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5784 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5785 (_, N_, xalloc_die): Move to xalloc-die.c.
5786 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5787 so that we needn't mess with xalloc_msg_memory_exhausted.
5789 * sha1.h: Renamed from sha.h.
5790 (SHA1_H): Renamed from _SHA_H.
5791 (sha1_ctx): Renamed from sha_ctx.
5792 (sha1_init_ctx): Renamed from sha_init_ctx.
5793 (sha1_process_block): Renamed from sha_process_block.
5794 (sha1_process_bytes): Renamed from sha_process_bytes.
5795 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5796 (sha1_read_ctx): Renamed from sha_read_ctx.
5797 (sha1_stream): Renamed from sha_stream.
5798 (sha1_buffer): Renamed from sha_buffer.
5799 * sha1.c: Likewise; renamed from sha.c.
5800 Do not include <sys/types.h>.
5801 Include <stddef.h> rather than <stdlib.h>.
5803 2004-08-08 Bruno Haible <bruno@clisp.org>
5805 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5806 FILESYSTEM_PREFIX_LEN.
5807 * progreloc.c: Likewise.
5808 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5810 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5813 * argp-help.c (make_hol, hol_append): Don't assume that
5814 SIZE_MAX is a valid preprocessor constant.
5815 (__argp_basename): Change from "#ifndef _LIBC"
5816 to "#ifndef __argp_short_program_name", so that
5817 we don't compile these functions for tar.
5819 More merges from coreutils.
5820 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5821 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5823 * addext.c: Remove; no longer needed.
5824 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5825 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5826 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5827 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5828 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5829 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5830 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5831 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5832 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5833 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5834 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5835 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5836 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5837 Import changes from coreutils.
5839 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5841 Merge from coreutils.
5843 * .gdb-history: Remove; this doesn't belong here.
5845 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5846 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5847 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5849 * dirname.h: Include <stdbool.h>.
5850 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5851 for consistency with POSIX terminology. All uses changed.
5852 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5853 (strip_trailing_slashes): Use bool for booleans.
5854 * stripslash.c (strip_trailing_slashes): Likewise.
5856 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5857 sometimes returns a positive errno value even when it succeeds.
5858 (print_errno_message) [!LIBC]: Fall back on strerror if
5861 * path-concat.c (mempcpy): Don't define if a system header defines it.
5862 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5863 (longest_relative_suffix): New function.
5864 (path_concat): Use it. Assume first argument is not NULL.
5865 Port to DOS. Omit redundant separators.
5866 Report an error instead of returning NULL.
5867 Use mempcpy instead of memcpy.
5868 (xpath_concat): Remove: not declared or used.
5870 * same.h: Include <stdbool.h>
5871 (same_name): Return bool, not int.
5872 * same.c (same_name): Likewise.
5873 (errno): Don't declare; we assume C89 or better now.
5875 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5876 if not already defined.
5878 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5879 * dup-safer.c (errno): Likewise.
5881 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5883 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5886 2004-08-03 Simon Josefsson <jas@extundo.com>
5888 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5889 * progname.h: Don't include stdbool.h.
5891 2004-08-02 Simon Josefsson <jas@extundo.com>
5893 * getsubopt.h: New file, with comments from Bruno Haible.
5894 * getsubopt.c: New file, from glibc, but slightly modified based on
5895 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5897 2004-08-01 Simon Josefsson <jas@extundo.com>
5899 * xgetdomainname.c: Include stdlib.h, for free().
5901 2004-07-16 Simon Josefsson <jas@extundo.com>
5903 * dummy.c: New file.
5905 2004-07-16 Bruno Haible <bruno@clisp.org>
5907 * backupfile.h: Add extern "C" for C++.
5908 * closeout.h: Likewise.
5909 * copy-file.h: Likewise.
5910 * findprog.h: Likewise.
5911 * full-write.h: Likewise.
5912 * pathname.h: Likewise.
5913 * progname.h: Likewise.
5914 * stpcpy.h: Likewise.
5915 * stpncpy.h: Likewise.
5916 * strcase.h: Likewise.
5917 * strstr.h: Likewise.
5918 * xalloc.h: Likewise.
5920 * mbswidth.h: Add extern "C" for C++.
5921 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5923 2004-07-09 Simon Josefsson <jas@extundo.com>
5925 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5926 failed without this.)
5928 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5930 * fchown-stub.c: New file.
5932 2004-06-24 Jim Meyering <jim@meyering.net>
5934 * obstack.h (obstack_base): Cast to (void *), per documentation.
5936 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5938 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5940 2004-06-01 Jim Meyering <jim@meyering.net>
5942 * calloc.c: New file.
5944 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5946 * getdate.y (yylex): Allow space between sign and number.
5947 Problem reported by Dan Jacobson.
5949 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5950 and Jim Meyering <jim@meyering.net>
5952 Merge from coreutils CVS.
5954 * stat-macros.h: New file, with contents from file-type.h
5955 and coreutils' system.h.
5956 * file-type.c: Include "stat-macros.h".
5957 * file-type.h (file_type): Move all macro definitions to new file,
5960 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5961 Wrap old code with this conditional.
5962 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5963 function that does not dereference symlinks.
5964 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5966 * xreadlink.c: Include xreadlink.h first, to catch .h file
5967 dependency problems.
5968 (xreadlink): Accept new arg SIZE, for efficiency.
5969 All decls and uses changed.
5970 * xreadlink.h: Include <stddef.h>, for size_t.
5972 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5973 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5975 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5977 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5979 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5980 macros to be defined.
5981 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5982 the allocator returns NULL because the requested size is zero.
5984 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5986 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5987 var. Add comment explaining why libc still defines it. This
5988 merges the following patch from glibc:
5989 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5991 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5993 * obstack.c (_obstack): Remove unused variable. It hasn't been
5994 present in glibc since revision 1.1 of this file.
5995 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5996 obstack_alignment_mask, obstack_alloc, obstack_base,
5997 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5998 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5999 obstack_grow0, obstack_init, obstack_int_grow,
6000 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
6001 obstack_next_free, obstack_object_size, obstack_ptr_grow,
6002 obstack_ptr_grow_fast, obstack_room): Remove declarations of
6003 nonexistent functions.
6005 2004-05-17 Derek R. Price <derek@ximbiot.com>
6006 Paul Eggert <eggert@cs.ucla.edu>
6008 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
6010 2004-05-14 Bruno Haible <bruno@clisp.org>
6012 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
6013 that consists of a '.' followed by an empty digit string.
6014 Patch by Tor Lillqvist <tml@iki.fi>.
6016 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
6018 Port obstack to the AS/400, where pointers are 16 bytes wide and
6019 you cannot cast an integer to a valid pointer. This patch is
6020 currently waiting to be integrated into glibc; see
6021 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
6023 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
6024 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
6025 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
6026 (struct obstack): temp member is now a union of a pointer and
6027 an integer, instead of an integer. All integer uses changed.
6028 This does not affect the physical layout of struct obstack,
6029 except on hosts (like the AS/400) where the size or alignment of
6030 void * is greater than that of ptrdiff_t.
6031 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
6032 __STDC__)]: Store temporary in pointer member of union, not
6034 * obstack.c: Include <stddef.h>, for offsetof.
6035 (struct fooalign): Remove; it doesn't need a name.
6036 (union fooround): Change double to long double, and add void *.
6037 (DEFAULT_ALIGNMENT): Use offsetof to compute.
6038 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
6039 not a macro. Hence the values are always int; so remove all
6040 casts-to-int in uses.
6042 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
6043 Derek Price <derek@ximbiot.com>
6045 * alloca.c: Include <alloca.h>, to get our interface.
6046 * alloca_.h: Use __alloca on AIX, so that we don't have to
6047 include <alloca.h> first. Use C89 prototype for alloca; this
6048 requires including <stddef.h> for size_t. Use extern "C" if C++.
6049 Use #elif for simplicity, since we can assume C89 now.
6050 Don't try to source the system alloca.h since it will not be found
6051 and to prevent recursively including its replacement.
6052 * fnmatch.c: Include <alloca.h> instead of opencoding.
6053 * regex.c: Likewise.
6055 2004-05-16 Derek Price <derek@ximbiot.com>
6056 Paul Eggert <eggert@cs.ucla.edu>
6058 getline cleanup. This changes the getndelim2 API: both order of
6059 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
6062 * getline.c: Don't include stddef.h or stdio.h, since our
6063 interface does that.
6064 (getline): Always use getdelim, so that we don't have two
6065 copies of this code.
6066 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
6068 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
6069 (GETNDELIM2_MAXIMUM): New macro.
6070 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
6071 instead of the old practice of delim2==0. All callers changed.
6072 Return -1 on overflow, instead of returning junk.
6073 Do not set *linesize unless allocation succeeds.
6074 * getndelim2.h: Do not include stddef.h; no longer needed, now
6075 that we include sys/types.h.
6076 * getnline.h: Likewise.
6077 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
6078 (getndelim2): Reorder arguments.
6079 * getnline.c (getnline, getndelim):
6080 Don't discard the NMAX argument.
6081 (getnline): Invoke getndelim, to avoid code duplication.
6082 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
6083 of (size_t) -1 by callers of the getnline family.
6085 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
6087 * nanosleep.c (suspended): Change its type from int to
6088 sig_atomic_t volatile.
6089 (first_call): Make it private to rpl_nanosleep, and have it
6090 be zero initially as that's a bit faster.
6091 (my_usleep): Round up fractional times instead of truncating them,
6092 as this is the usual meaning for 'sleep'.
6094 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
6096 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6097 (ENOSYS): Define if not defined.
6098 (settime): Fall back on stime if it exists and settimeofday fails.
6099 But don't bother with fallbacks if a method fails with errno == EPERM.
6101 2004-05-11 Jim Meyering <jim@meyering.net>
6103 Prior to this change, the save_cwd caller required read access to the
6104 current directory on most systems (ones with the fchdir function).
6106 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
6107 fails, try write-only, and finally, resort to using xgetcwd.
6109 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6111 * obstack.c, obstack.h: Import changes from libc.
6113 2004-04-28 Bruno Haible <bruno@clisp.org>
6115 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6116 implicitly appends .exe to executables.
6117 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6118 accepts Windows pathnames.
6119 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6120 Cygwin like Windows, since it now accepts Windows pathnames.
6121 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6122 Cygwin like Windows, since it now accepts Windows pathnames.
6123 Reported by Derek Robert Price <derek@ximbiot.com>.
6125 2004-04-20 Jim Meyering <jim@meyering.net>
6127 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6129 2004-04-20 Jim Meyering <jim@meyering.net>
6130 Bruno Haible <bruno@clisp.org>
6132 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6133 memory when realloc fails.
6135 2004-04-18 Jim Meyering <jim@meyering.net>
6137 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6138 don't leak memory and do call END_UTMP_ENT.
6140 2004-04-11 Paul Eggert <eggert@twinsun.com>
6142 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6143 (CHAR_BIT): Remove, since we assume C89.
6144 Include <stdint.h> if available, as per current Autoconf CVS advice.
6146 2004-03-30 Paul Eggert <eggert@twinsun.com>
6148 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6149 not bool, to be more consistent with Unix conventions.
6150 Suggested by Bruno Haible.
6152 Merge from coreutils.
6154 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6157 * getdate.h: Include stdbool.h, and timespec.h instead of
6158 the usual <time.h> dance.
6159 (get_date): Change signature to support fractional time stamps.
6160 All callers changed.
6161 * getdate.y: Include "getdate.h" first, as we can now
6162 assume C89 and don't need to worry about 'const'.
6163 Similarly, include "unlocked-io.h" near start, not in middle.
6165 (textint.value): Use long int rather than int.
6166 (textint.digits): Use size_t rather than int.
6167 (BILLION, LOG10_BILLION): New constants.
6168 (parser_control): New member rel_ns. Members day_ordinal,
6169 time_zone, month, day, hour, minutes, rel_year, rel_month,
6170 rel_day, rel_hour, rel_minutes, rel_seconds
6171 are now long int, not int. Member seconds is now struct timespec,
6172 not int. New member timespec_seen. Members dates_seen, days_seen,
6173 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6175 (%union.intval): Now long int, not int.
6176 New member timespec.
6177 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6178 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6179 (spec): Now is a timespec or an item list.
6180 (timespec, items): New nonterminals.
6181 (time, rel, relunit, number, get_date):
6182 Add support for fractional seconds.
6183 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6184 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6185 (to_hour): First arg is now long int, not int.
6186 (to_year): Returns long int, not int.
6187 Don't treat year -70 like 70.
6188 (tm_diff): Returns long int, not int.
6189 (lookup_word): Use bool instead of int when appropriate.
6190 (yylex): Use size_t for count, not int.
6191 Detect overflow when parsing large integer constants.
6192 Add support for fractions.
6193 (get_date): Make pointers 'const' if possible.
6194 Use more-portable code to detect integer overflow.
6195 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6196 Don't use ctime; it's not reliable if the year has >4 digits.
6198 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6199 This is for compatibility with BSD.
6201 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6202 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6203 From coreutils' system.h.
6205 * userspec.c: Don't include "posixver.h".
6206 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6207 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6208 compatible extension. Simplify code by removing a boolean int
6209 that was always nonzero if a string was nonnull.
6211 2004-03-30 Jim Meyering <jim@meyering.net>
6213 Merge from coreutils.
6215 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6217 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6218 an empty input stream.
6220 * readtokens.c: Include <stdbool.h>.
6221 (readtoken): Use `size_t' rather than int/long.
6222 All callers adjusted.
6223 Use `bool' rather than `int' where appropriate.
6224 Use memset rather than an explicit loop.
6225 Use x2nrealloc rather than xrealloc.
6226 Allow the use of `\0' as a delimiter.
6227 (readtokens): Likewise.
6228 * readtokens.h (readtoken, readtokens): Update prototypes.
6230 2004-03-30 Bruno Haible <bruno@clisp.org>
6232 * getloadavg.c (getloadavg): Don't assume setlocale returns
6235 2004-03-29 Paul Eggert <eggert@twinsun.com>
6237 Merge changes to getloadavg.c from coreutils and Emacs.
6239 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6240 Define to an expression, not to the empty string.
6241 Include cloexec.h and xalloc.h.
6242 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6243 Use set_cloexec_flag rather than rolling our own.
6244 * cloexec.c, cloexec.h: New files.
6246 2004-03-18 Paul Eggert <eggert@twinsun.com>
6248 * getopt.h: Sync with libc CVS.
6250 2004-03-18 Paul Eggert <eggert@twinsun.com>
6251 Bruno Haible <bruno@clisp.org>
6253 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6254 not on all platforms that have <wchar.h>.
6255 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6257 2004-03-09 Paul Eggert <eggert@twinsun.com>
6259 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6261 * getopt_int.h: New file, also synced from libc.
6263 2004-03-07 Paul Eggert <eggert@twinsun.com>
6265 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6266 '#if' expressions. Unlike the code it replaces, it does not
6267 depend on (defined _SC_PAGESIZE). However, it does depend on
6268 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6269 first reported by Jason Andrade in
6270 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6272 2004-01-18 Simon Josefsson <jas@extundo.com>
6274 * strdup.h: New file.
6275 * strdup.c: Include it.
6276 * path-concat.c: Include strdup.h. Drop strdup declaration.
6277 * userspec.c: Include strdup.h. Drop strdup declaration.
6279 2004-02-06 Karl Berry <karl@gnu.org>
6281 * config.charset: update from gettext 0.14.1.
6283 2004-02-05 Paul Eggert <eggert@twinsun.com>
6285 Add comments and code, prompted by suggestions from Bruno Haible
6287 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6288 describing the enum quoting_style values.
6289 * quotearg.c (quotearg_alloc): New function.
6290 (quotearg_buffer_restyled): Treat lone { and } as special.
6291 Treat = as special. Work around bug with older shells
6292 that "see" a '\' that is really the 2nd byte of a multibyte char.
6293 Quote empty string with shell_quoting_style.
6295 2004-02-03 Bruno Haible <bruno@clisp.org>
6297 * pipe.h: New file, from GNU gettext.
6298 * pipe.c: New file, from GNU gettext.
6300 2004-01-27 Bruno Haible <bruno@clisp.org>
6302 * execute.h: New file, from GNU gettext.
6303 * execute.c: New file, from GNU gettext.
6304 * w32spawn.h: New file, from GNU gettext.
6306 2004-01-23 Paul Eggert <eggert@twinsun.com>
6308 Exit-status fix from coreutils.
6310 Use exit_failure consistently in place of EXIT_FAILURE,
6311 so that program exit statuses are consistent on failure.
6313 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6314 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6315 * argmatch.h: Comment fix to match the above.
6316 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6317 Now a macro referring to exit_failure, instead of a separate
6318 variable. Include "exitfail.h" to get it.
6319 * xstrtol.h: Include "exitfail.h".
6320 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6322 * long-options.c (parse_long_options): Use prototype
6323 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6326 2004-01-21 Jim Meyering <jim@meyering.net>
6328 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6329 so as not to conflict with a different-sized __mktime_internal
6330 function in GNU libc.
6331 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6332 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6334 2004-01-18 Paul Eggert <eggert@twinsun.com>
6336 Merge from diffutils.
6338 * file-type.c (file_type): Add typed memory objects.
6339 * file-type.h (S_TYPEISTMO): New macro.
6341 * c-stack.h (c_stack_action): Remove argv argument.
6342 * c-stack.c (c_stack_action): Likewise. All uses changed.
6343 (die): Don't calculate message unless segv_action returns.
6344 (get_stack_location, min_address_from_argv, max_address_from_argv,
6345 volatile stack_base, volatile_stack_size): Remove.
6346 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6347 that every segmentation violation is a stack overflow. (Ouch!)
6348 See Debian bug 136249 (still outstanding) for more info about why
6349 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6351 2003-11-30 Bruno Haible <bruno@clisp.org>
6353 Safer stack allocation.
6354 * setenv.c: Include allocsa.h.
6355 (alloca): Remove fallback definition.
6356 (freea): Remove macro.
6357 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6360 2003-10-17 Bruno Haible <bruno@clisp.org>
6362 * binary-io.h: Avoid warnings on Cygwin.
6364 2003-12-28 Bruno Haible <bruno@clisp.org>
6366 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6367 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6369 2003-11-28 Bruno Haible <bruno@clisp.org>
6371 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6373 2003-11-27 Bruno Haible <bruno@clisp.org>
6375 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6377 2003-11-17 Bruno Haible <bruno@clisp.org>
6379 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6381 2003-11-24 Bruno Haible <bruno@clisp.org>
6383 * xallocsa.h: New file, from GNU gettext.
6384 * xallocsa.c: New file, from GNU gettext.
6386 2003-11-24 Bruno Haible <bruno@clisp.org>
6388 * allocsa.h: New file, from GNU gettext.
6389 * allocsa.c: New file, from GNU gettext.
6391 2003-11-24 Bruno Haible <bruno@clisp.org>
6393 * eealloc.h: New file.
6395 2004-01-15 Jim Meyering <jim@meyering.net>
6397 Merge from coreutils.
6399 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6400 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6401 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6403 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6404 optional configure-time default.
6406 * version-etc.c (version_etc_copyright): Update copyright date.
6408 * xreadlink.c (xreadlink): Correct outdated comment.
6410 2004-01-15 Paul Eggert <eggert@twinsun.com>
6412 Merge from coreutils.
6414 * posixver.c: Include posixver.h.
6416 * same.c: Include <stdbool.h>, <limits.h>.
6417 (_POSIX_NAME_MAX): Define if not defined.
6419 (same_name): If file names are silently truncated, report
6420 that the file names are the same if they are the same after
6421 the silent truncation.
6423 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6424 conversion function.
6425 * xstrtod.c (xstrtod): Likewise. All callers changed to
6426 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6429 2004-01-14 Paul Eggert <eggert@twinsun.com>
6431 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6432 with like-named macro in fnmatch.c.
6433 (EXT): Use an internal constant instead.
6435 Merge fnmatch patches from glibc.
6436 * fnmatch.c (mbsinit): Remove define.
6437 Add libc_hidden_ver (__fnmatch, fnmatch).
6438 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6439 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6441 2003-12-14 Karl Berry <karl@gnu.org>
6443 * config.charset: update from gettext-runtime.
6445 2003-12-03 Paul Eggert <eggert@twinsun.com>
6447 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6448 Bug reported by Alfred M. Szmidt.
6450 2003-11-29 Karl Berry <karl@gnu.org>
6452 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6454 2003-11-23 Paul Eggert <eggert@twinsun.com>
6455 Bruno Haible <bruno@clisp.org>
6457 * printf-parse.h: Don't include sys/types.h.
6458 (ARG_NONE): New macro.
6459 (char_directive): Change type of *arg_index fields to size_t.
6460 * printf-parse.c: Don't include sys/types.h.
6461 (SSIZE_MAX): Remove macro.
6462 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6463 Remove unnecessary overflow check.
6464 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6467 2003-11-24 Paul Eggert <eggert@twinsun.com>
6469 * alloca.c: Remove dependency on xalloc module.
6470 (xalloc_die): Remove.
6471 (memory_full) [!defined emacs]: New macro.
6472 [!defined emacs]: Don't include xalloc.h.
6473 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6474 address arithmetic overflows. Change datatypes a bit to avoid
6477 2003-11-22 Jim Meyering <jim@meyering.net>
6479 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6481 2003-11-17 Bruno Haible <bruno@clisp.org>
6483 * vasnprintf.c (alloca): Remove fallback definition.
6484 (freea): Remove definition.
6485 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6486 Reported by Paul Eggert.
6488 2003-11-17 Jim Meyering <jim@meyering.net>
6490 On systems without utime and without a utimes function capable of
6491 dealing with a NULL struct utimbuf* argument, this utime replacement
6492 could -- in unusual circumstances -- leak a file descriptor.
6493 * utime.c: Include <unistd.h> and <errno.h>.
6494 (utime_null): Be sure to close `fd' and to preserve errno.
6495 Reported by Geoff Collyer via Arnold Robbins.
6497 2003-11-16 Paul Eggert <eggert@twinsun.com>
6498 Bruno Haible <bruno@clisp.org>
6500 Protect against address arithmetic overflow.
6501 * printf-args.h: Include stddef.h.
6502 (arguments): Change type of field 'count' to size_t.
6503 * printf-args.c (printf_fetchargs): Use size_t instead of
6504 'unsigned int' where appropriate.
6505 * printf-parse.h: Include sys/types.h.
6506 (char_directive): Change type of *arg_index fields to ssize_t.
6507 (char_directives): Change type of fields 'count', max_*_length to
6509 * printf-parse.c: Include sys/types.h and xsize.h.
6510 (SSIZE_MAX): Define fallback value.
6511 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6512 instead of 'int' where appropriate. Check a_allocated, d_allocated
6513 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6514 * vasnprintf.c: Include xsize.h.
6515 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6516 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6517 overflow. Avoid wraparound when converting a width or precision from
6520 2003-11-16 Bruno Haible <bruno@clisp.org>
6522 Update from GNU gettext.
6523 * printf-parse.c: Generalize to it can be compiled for wide strings.
6524 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6525 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6526 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6527 SNPRINTF): New macros.
6528 Don't include <alloca.h> if the file is used inside libintl.
6529 (local_wcslen): New function, for Solaris 2.5.1.
6530 (VASNPRINTF): Use it instead of wcslen.
6532 2003-11-16 Bruno Haible <bruno@clisp.org>
6534 * xsize.h (xmax): New function.
6535 (xsum, xsum3, xsum4): Declare as "pure" functions.
6537 2003-11-12 Paul Eggert <eggert@twinsun.com>
6539 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6540 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6541 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6542 heuristic is just as accurate as far as we know, and it removes a
6543 dependency on size_max.m4 and ptrdiff_max.m4.
6545 2003-11-12 Paul Eggert <eggert@twinsun.com>
6547 * xstrtol.c (__xstrtol): Remove "break" immediately after
6548 "return", to pacify some unknown compiler. Problem reported
6551 2003-11-11 Bruno Haible <bruno@clisp.org>
6553 * xsize.h (SIZE_MAX): Remove fallback definition.
6554 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6557 2003-11-10 Paul Eggert <eggert@twinsun.com>
6559 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6560 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6561 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6563 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6564 not (size_t) -1, since it's defined here.
6566 2003-11-06 Paul Eggert <eggert@twinsun.com>
6568 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6569 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6570 Reject sizes of exactly SIZE_MAX bytes.
6571 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6572 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6574 2003-11-05 Bruno Haible <bruno@clisp.org>
6576 * xsize.h: Include limits.h, to avoid a possible collision with
6577 SIZE_MAX defined in <limits.h> on Solaris.
6579 2003-11-04 Bruno Haible <bruno@clisp.org>
6581 * xsize.h: New file.
6582 * linebreak.c: Include xsize.h.
6583 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6584 argument for overflow.
6585 Suggested by Paul Eggert.
6587 2003-10-31 Bruno Haible <bruno@clisp.org>
6589 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6590 to avoid (extremely rare) race condition.
6591 Suggested by Paul Eggert.
6593 2003-11-03 Jim Meyering <jim@meyering.net>
6595 * userspec.c: Include "userspec.h".
6596 * userspec.h: New file.
6598 2003-10-31 Paul Eggert <eggert@twinsun.com>
6600 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6601 * mountlist.c (SIZE_MAX): Define if not defined already.
6602 (read_filesystem_list): Set and use me_type_malloced.
6603 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6604 whatever the type happens to be), for brevity and consistency.
6605 Check for size calculation overflow on Alphas running OSF/1.
6607 2003-10-31 Jim Meyering <jim@meyering.net>
6609 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6611 * linebuffer.c: Include <string.h> for declaration of memset.
6613 2003-10-30 Paul Eggert <eggert@twinsun.com>
6614 Bruno Haible <bruno@clisp.org>
6616 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6617 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6619 2003-10-29 Paul Eggert <eggert@twinsun.com>
6621 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6622 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6624 * quotearg.c (quotearg_n_options): Use it.
6625 * group-member.c: Include <stdbool.h>.
6626 (free_group_info): Arg is now const *; don't free arg.
6627 (get_group_info): Now returns bool and accepts struct group_info *,
6628 rather than returning a malloc'ed struct group_info *.
6629 All uses changed. Check for overflow in internal size calculation.
6631 * getusershell.c (readname): Simplify the code by using x2nrealloc
6632 rather than xmalloc/xrealloc.
6633 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6634 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6635 conformance bug: the old code used a pointer after freeing the
6636 storage that it addressed.
6637 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6638 rather than doing it by hand.
6639 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6640 the buffer preserved. Use free and xmalloc instead.
6641 * quotearg.c (quotearg_n_options): Likewise.
6642 Use a simpler test for size overflow. Don't use xalloc_oversized
6643 because unsigned int might be wider than size_t (!); this suggests
6644 that we should switch from unsigned int to size_t for slot numbers.
6646 2003-10-27 Bruno Haible <bruno@clisp.org>
6648 * stdbool_.h: Better support for BeOS.
6650 2003-10-27 Paul Eggert <eggert@twinsun.com>
6652 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6653 to allocate the returned structure. Do not allocate a subarray,
6654 as x2nrealloc will do that.
6655 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6656 instead of xnrealloc.
6657 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6659 2003-10-26 Paul Eggert <eggert@twinsun.com>
6661 * xalloc.h (xalloc_oversized): New static inline function, for
6662 callers that want to do their own size-overflow checking. Include
6663 <stdbool.h>, since xalloc_oversized returns bool.
6664 * xalloc.c (array_size_overflow): Remove. All callers changed
6665 to use xalloc_oversized.
6667 Add two functions x2realloc, x2nrealloc, for programs that grow
6668 arrays dynamically by doubling their sizes.
6669 * xalloc.h (x2realloc, x2nrealloc): New decls.
6670 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6673 Port to C99 semantics for 'inline' of external functions.
6674 Bug reported by Bruno Haible.
6675 * xmalloc.c (xnmalloc_inline): New static inline function,
6676 with the old contents of xnmalloc.
6677 (xnmalloc, xmalloc): Use it.
6678 (xnrealloc_inline): New static inline function,
6679 with the old contents of xnrealloc.
6680 (xnrealloc, xrealloc): Use it.
6682 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6684 2003-10-25 Paul Eggert <eggert@twinsun.com>
6686 Fix several address-calculation bugs in the hash modules,
6687 plus some minor code cleanup.
6689 * hash.h: Include <stdbool.h>, for bool.
6690 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6691 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6692 hash_get_n_entries, hash_get_max_bucket_length,
6693 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6694 hash_rehash): Use size_t rather than unsigned.
6695 * hash.c (struct hash_table, hash_get_n_buckets,
6696 hash_get_n_buckets_used, hash_get_n_entries,
6697 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6698 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6699 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6701 (SIZE_MAX): Define if not defined.
6702 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6703 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6705 Use const * when possible.
6706 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6707 (check_tuning): Fix bug: if tuning parameters were very close to
6708 0 or 1, rounding errors could have caused subscript violations.
6709 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6710 (hash_initialize): Add 'fail:' label
6711 to free table and return NULL, and use it to simplify code.
6712 Use calloc rather than clearing the storage ourself.
6713 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6714 buffer size calculations.
6715 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6716 Include <stddef.h>, for size_t.
6717 * hash-pjw.c (hash_pjw): Likewise.
6718 Switch to method described by Bruno Haible.
6719 Include <limits.h>, for CHAR_BIT.
6720 (SIZE_BITS): New macro.
6722 2003-10-21 Paul Eggert <eggert@twinsun.com>
6724 * getndelim2.c (getndelim2): When size calculation overflows,
6725 ceiling the allocation at NMAX bytes rather than silently
6726 discarding input bytes before NMAX is reached. This makes
6727 a difference only if NMAX exceeds SIZE_MAX / 2.
6729 * obstack.c: Merge from glibc.
6730 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6731 Add libc_hidden_def (_obstack_newchunk).
6732 (_obstack_free) [! defined _LIBC]: Remove.
6733 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6734 a clone of the function body.
6735 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6736 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6738 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6739 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6742 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6743 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6744 Don't use lvalue casts, as GCC plans to remove support for them
6745 in GCC 3.5. Reported by Joseph S. Myers. This bug
6746 was also present in the non-GCC version, indicating that this
6747 code had always been buggy and had never been widely used.
6748 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6749 Use the fast variant of each macro, rather than copying the
6750 definiens of the fast variant; that way, we'll be more likely to
6751 catch future bugs in the fast variants.
6753 2003-10-20 Bruno Haible <bruno@clisp.org>
6755 * wait-process.h: New file, from GNU gettext.
6756 * wait-process.c: New file, from GNU gettext.
6758 2003-10-19 Jim Meyering <jim@meyering.net>
6760 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6762 2003-10-16 Paul Eggert <eggert@twinsun.com>
6764 * getgroups.c: Include <errno.h>, <stdlib.h>.
6765 (getgroups): First arg is int, not size_t.
6766 Don't let 'free' mangle errno.
6768 2003-10-16 Jim Meyering <jim@meyering.net>
6770 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6772 2003-10-15 Paul Eggert <eggert@twinsun.com>
6774 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6776 (new_exclude, add_exclude_file): Initial size no longer needs to
6778 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6779 our own address arithmetic overflow checking.
6781 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6782 (fnmatch): Do not alloca more than 2000 wide characters;
6783 instead, use malloc for large buffers.
6784 Check for address arithmetic overflow, and return -1
6785 with errno set to ENOMEM in that case.
6786 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6787 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6788 instead, return -1. Check for address arithmetic overflow.
6790 2003-10-14 Paul Eggert <eggert@twinsun.com>
6792 Handle invalid suffixes and overflow independently, so that
6793 callers can treat them independently as needed. Fix some bugs in
6794 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6795 suffix for a human-readable blocksize. The major caller-visible
6796 change is the addition of a new
6797 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6798 that both overflow and suffix chars were found.
6800 * human.c (humblock): Don't check separately for invalid suffix
6801 char; that is xstrtoumax's job (now that its bug is fixed).
6802 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6803 INTMAX_MAX]: New macros.
6804 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6805 TYPE_MAXIMUM): New macros.
6806 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6807 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6808 if overflow occurs, as it's what __strtol does and it's more useful
6810 (__xstrtol): If __strtol reports some error other than ERANGE,
6811 reflect it to the caller as LONGINT_INVALID. If it reports
6812 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6813 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6814 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6816 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6817 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6818 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6819 [defined UINTMAX_MAX]: New macros.
6821 2003-10-14 Bruno Haible <bruno@clisp.org>
6823 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6824 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6825 Also use volatile where needed.
6827 2003-10-12 Paul Eggert <eggert@twinsun.com>
6829 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6830 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6831 and define in terms of the other primitives.
6832 * xmalloc.c: Include stdbool.h; do not include exit.h.
6833 (SIZE_MAX): Define if not already defined.
6834 (array_size_overflow): New function.
6835 (xalloc_die): Abort instead of exiting if 'error' returns.
6836 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6837 (xmalloc, xrealloc): Use them.
6838 (xcalloc): Check for address arithmetic overflow.
6839 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6840 a bit faster than strcpy.
6842 2003-10-08 Paul Eggert <eggert@twinsun.com>
6844 Merge getpass from libc, plus a few fixes.
6846 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6847 Include <stdbool.h>.
6848 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6849 __fsetlocking to empty.
6850 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6851 do include <bits/libc-lock.h>.
6852 Do not include <fcntl.h>; not needed.
6853 [_LIBC]: Include <wchar.h>.
6854 (NOTCANCEL_MODE): New macro.
6855 (flockfile, funlockfile) [_LIBC]: New macros.
6856 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6857 [!_LIBC]: New macros.
6858 (call_fclose): New function.
6859 (getpass): Use it. Save tty stream separately; this simplifies the
6860 code and makes it more reliable if stdin happens to equal stdout.
6861 Invoke __fsetlocking on tty.
6862 Handle thread cancellation if needed.
6863 Namespace cleanup (use __tcgetattr, __getline).
6864 Use bool for Booleans.
6865 [USE_IN_LIBIO]: Handle wide streams.
6866 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6867 stream might go where.
6869 * unlocked-io.h: Include <stdio.h>, so that the caller
6870 doesn't have to include <stdio.h> before us.
6871 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6872 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6873 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6874 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6875 if not declared, so that we can use getpass.c code from libc without
6877 (flockfile, ftrylockfile, funlockfile): New macros.
6879 2003-10-06 Bruno Haible <bruno@clisp.org>
6881 * version-etc-2.h: Remove file.
6882 * version-etc-2.c: Remove file.
6884 2003-09-25 Jim Meyering <jim@meyering.net>
6885 Bruno Haible <bruno@clisp.org>
6887 This lets translators provide better translations for the
6888 "Written by ..." part of --version output.
6889 * version-etc.h: Include stdarg.h.
6890 (version_etc_copyright): Declare as readonly.
6891 (version_etc): Make this function variadic with a NULL-terminated list
6892 of author name strings.
6893 (version_etc_va): New declaration.
6894 * version-etc.c: Include stdarg.h, stdlib.h.
6895 (version_etc_copyright): Declare as readonly.
6896 (version_etc_va): New function. Provide a different translatable string
6897 for each possible number of authors < 10. Abbreviate when there are 10
6899 (version_etc): Make this function variadic. Call version_etc_va.
6900 Suggestion from Gary V. Vaughan.
6902 * long-options.h (parse_long_options): Change prototype: the authors
6903 string is moved to the end and becomes variadic.
6904 * long-options.c: Include stdarg.h.
6905 (parse_long_options): Make this function variadic, too.
6906 Call version_etc_va, not version_etc.
6908 2003-10-06 Bruno Haible <bruno@clisp.org>
6910 * fatal-signal.h: New file, from GNU gettext.
6911 * fatal-signal.c: New file, from GNU gettext.
6913 2003-10-04 Karl Berry <karl@gnu.org>
6915 * argp*: update from libc.
6917 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6919 * getpass.c (getpass): Use a no-op fseek when switching from input to
6920 output mode on the same stream.
6922 2003-09-29 Paul Eggert <eggert@twinsun.com>
6924 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6925 Fix arg typo in previous patch.
6927 2003-09-28 Jim Meyering <jim@meyering.net>
6929 * error.c: Correct cpp indentation.
6931 2003-09-27 Paul Eggert <eggert@twinsun.com>
6933 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6934 Omit the special code that used __typeof__, since we worry that
6935 it could be more trouble than it's worth. See:
6936 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6937 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6941 2003-09-26 Jim Meyering <jim@meyering.net>
6943 * error.c (error_tail): Move some declarations
6944 into inner scope where the local variables are used.
6946 2003-09-26 Bruno Haible <bruno@clisp.org>
6948 * stpncpy.h (gnu_stpncpy): New declaration.
6949 (stpncpy): Define as alias for gnu_stpncpy.
6950 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6952 2003-09-26 Paul Eggert <eggert@twinsun.com>
6954 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6955 (error_tail): Do not loop, reallocating temporary buffer, since
6956 the output cannot contain more wide characters than the input
6957 contains bytes, the size must be big enough already. This avoids
6958 one potential size overflow calculation. Check for size overflow
6959 when calculating temporary buffer size. Free temporary buffer
6960 when done, if it was allocated with malloc; this plugs a memory
6961 leak. Remove casts from void * to pointers, that are no longer
6962 needed now that we're assuming C89 or better.
6964 Merge error changes from glibc.
6966 * error.c, error.h: Update copyright notice header to match glibc.
6967 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6968 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6969 Disable cancellation while printing error.
6970 * error.h: Prepend __ to parameter names.
6972 2003-09-25 Karl Berry <karl@gnu.org>
6974 * argp-fmtstream.c, argp-help.c: update from libc.
6976 2003-09-25 Bruno Haible <bruno@clisp.org>
6978 * version-etc-2.h: New file, from version-etc.h with modifications.
6979 * version-etc-2.c: New file, from version-etc.c with modifications.
6981 2003-09-25 Simon Josefsson <jas@extundo.com>
6983 * xgetdomainname.h: New file.
6984 * xgetdomainname.c: New file.
6986 2003-09-25 Simon Josefsson <jas@extundo.com>
6987 Bruno Haible <bruno@clisp.org>
6989 * getdomainname.h: New file.
6990 * getdomainname.c: New file.
6992 2003-09-24 Paul Eggert <eggert@twinsun.com>
6994 * linebuffer.c (freebuffer): Don't free the argument, just
6995 the buffer associated with the argument. Bug reported by
6998 2003-09-19 Karl Berry <karl@gnu.org>
7000 * argp.h: update from libc.
7002 2003-09-16 Paul Eggert <eggert@twinsun.com>
7004 * linebuffer.c (readlinebuffer): Return NULL immediately upon
7005 input error, instead of returning NULL the next time we are called
7006 (and therefore losing track of errno).
7008 2003-09-15 Paul Eggert <eggert@twinsun.com>
7010 * getndelim2.c (getndelim2): Don't trash errno when a read
7011 fails, so that the caller gets the proper errno.
7013 * readutmp.c (read_utmp): Likewise.
7014 Check for fstat error. Close stream and free storage
7017 2003-09-14 Bruno Haible <bruno@clisp.org>
7019 * fwriteerror.h: New file.
7020 * fwriteerror.c: New file.
7022 2003-09-14 Jim Meyering <jim@meyering.net>
7024 * getloadavg.c: Correct cpp indentation.
7025 * strdup.c: Likewise.
7026 * vasnprintf.c: Likewise.
7028 2003-09-12 Paul Eggert <eggert@twinsun.com>
7030 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
7031 * obstack.c [!defined _LIBC]: Likewise.
7032 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
7033 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
7034 * exitfail.c: Don't include stdlib.h; no longer needed.
7036 More changes to assume C89 or better.
7038 * error.c (error_tail): Assume vprintf.
7040 * argmatch.c (getenv): Remove decl.
7041 * progreloc.c (get_full_program_name): Define via prototype.
7042 * setenv.c (clearenv): Likewise.
7043 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
7045 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
7046 (malloc, memcpy): Remove decls.
7047 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
7048 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
7049 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7050 (memcpy): Remove macro.
7051 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
7052 (__P): Remove. All uses removed.
7053 (PTR): Remove. All uses changed to void *.
7054 (CHAR_BIT, NULL): Remove.
7055 (spaces, zeros, memset_space, memset_zero)
7056 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
7058 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
7059 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
7060 Define with prototype.
7061 Remove now-unnecessary prototype decl.
7062 (extra_args_spec): Assume ANSI C. All uses changed.
7063 (extra_args_spec_iso): Remove.
7064 (my_strftime, emacs_strftimeu): Define via prototype.
7065 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
7067 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
7068 * strtoimax.c: Include <stdlib.h> unconditionally.
7069 (strtoul, strtol): Remove decls.
7070 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
7072 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
7073 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
7074 (LOCALE_PARAM_PROTO): New macro.
7075 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
7076 (INTERNAL (strtol), strtol): Define with a prototype.
7077 (PARAMS): Remove. All uses removed.
7078 * tempname.c: Include <string.h> unconditionally.
7079 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
7080 * xgethostname.c (main): Define with a prototype.
7081 * xmalloc.c: Include "xalloc.h" first, to check interface.
7082 Include <stdlib.h> unconditionally.
7083 (calloc, malloc, realloc, free): Remove decls.
7084 * xstrtod.c: Include "xstrtod.h" first, to check interface.
7085 Include <stdlib.h> unconditionally. Sort include file names.
7087 (xstrtod): Define with a prototype.
7088 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
7089 (strtol, strtoul): Remove decls.
7091 2003-09-11 Paul Eggert <eggert@twinsun.com>
7093 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
7094 Include <stdlib.h>, <string.h> unconditionally.
7095 Remove now-unnecessary cast to char *.
7096 * strnlen.c: Include <string.h> unconditionally.
7097 * yesno.c (yesno): Define with a prototype.
7099 2003-09-10 Bruno Haible <bruno@clisp.org>
7101 * strcspn.c: Include <string.h> unconditionally.
7102 * strpbrk.c: Include <string.h> unconditionally.
7103 * strstr.c: Include <string.h> unconditionally.
7104 * unicodeio.c: Include <string.h> unconditionally.
7105 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
7106 * unsetenv.c: Likewise.
7107 * xreadlink.c: Include <stdlib.h> unconditionally.
7108 * yesno.c: Include <stdlib.h> unconditionally.
7109 (rpmatch): Add prototype.
7111 2003-09-10 Jim Meyering <jim@meyering.net>
7113 * error.c: Correct indentation of cpp directives.
7115 2003-09-09 Paul Eggert <eggert@twinsun.com>
7119 * acosl.c (main): Use a prototype.
7120 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7123 * getloadavg.c (getloadavg, main): Define via prototypes.
7125 * getopt.h (struct option.name): Assume C89, and use 'const'.
7126 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7127 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7129 * getopt.c (const): Remove macro.
7130 Include <string.h> unconditionally.
7131 (my_index): Remove; all uses changed to strchr.
7132 (strlen): Remove decl.
7133 (exchange): Remove forward decl; no longer needed.
7134 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7135 Define with prototype.
7136 * getopt1.c (const): Remove macro.
7137 (getopt_long, getopt_long_only, main): Define with prototype.
7139 * getugroups.c: Include <string.h> unconditionally.
7141 * getusershell.c: Include <stdlib.h> unconditionally.
7142 (getusershell, setusershell, endusershell, readname, main):
7143 Define with prototypes.
7145 * group-member.c: Include group-member.h first.
7146 Include <stdlib.h> unconditionally.
7148 * hard-locale.c: Include hard-locale.h first.
7149 Include <stdlib.h>, <string.h> unconditionally.
7151 * hash.c (free, malloc): Remove decls.
7152 Include <stdlib.h> unconditionally.
7154 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7155 (getenv): Do not declare.
7157 * idcache.c: Include <string.h> unconditionally.
7159 * long-options.c: Include long-options.h first, to test interface.
7160 Include <stdlib.h> unconditionally.
7162 * makepath.c: Include makepath.h first, to test interface.
7163 Include <stdlib.h> and <string.h> unconditionally.
7165 * linebuffer.c: Include <stdlib.h>.
7166 (free): Remove decl.
7168 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7169 rpl_malloc returns void *, not char *.
7170 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7172 * md5.h: Include <limits.h> unconditionally.
7173 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7174 (__P): Remove; all uses removed.
7175 * md5.c: Include "md5.h" first.
7176 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7177 md5_buffer, md5_process_bytes, md5_process_block):
7178 Define with prototypes.
7179 * sha.h (__P): Remove all uses. (It wasn't defined??)
7180 * sha.c: Include "sha.h" first.
7181 Include <stdlib.h>, <string.h> unconditionally.
7183 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7184 * memcmp.c (__ptr_t): Likewise.
7185 * memrchr.c (__ptr_t): Likewise.
7186 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7187 Include <string.h> unconditionally.
7188 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7189 * memchr.c: Include <stdlib.h> unconditionally.
7190 * memchr.c (LONG_MAX): Remove.
7191 * memrchr.c (LONG_MAX): Likewise.
7192 * memchr.c (__memchr): Define via a prototype.
7193 * memrchr.c (__memrchr): Likewise.
7194 * memcmp.c (__P): Remove, and remove all uses.
7195 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7196 Remove forward decls; no longer needed.
7197 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7198 Use types required by C89 in prototype.
7200 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7201 * savedir.c: Likewise.
7202 * mkdir.c (free): Remove decl.
7203 * rmdir.c (rmdir): Define with a prototype.
7204 * savedir.c: Include savedir.h first, to test interface.
7206 * mktime.c (STDC_HEADERS): Remove.
7207 Include <stdlib.h>, <string.h> unconditionally.
7209 * modechange.c: Include <stdlib.h> unconditionally.
7210 (malloc): Remove decl.
7212 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7213 (free): Remove decl.
7215 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7216 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7217 (This type really should be intptr_t, but that's a C99ism.)
7218 (_obstack_memcpy): Remove: all uses changed to memcpy.
7219 Include <string.h> unconditionally.
7220 (struct obstack): Assume __STDC__ for types of members
7221 chunkfun, freefun, extra_arg.
7222 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7223 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7224 obstack_begin, obstack_specify_allocation,
7225 obstack_specify_allocation_with_arg, obstack_chunkfun,
7226 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7227 Remove unprototyped decls and the macros that use them.
7228 * obstack.c (POINTER): Remove. All uses changed to void *.
7229 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7230 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7231 (defined __STDC__ && __STDC__)]:
7232 Remove nonprototyped code.
7233 Include <stdlib.h> unconditionally.
7234 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7235 _obstack_allocated_p, _obstack_free, obstack_free,
7236 _obstack_memory_used, print_and_abort):
7237 Define using prototypes.
7238 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7239 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7240 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7241 obstack_next_free, obstack_object_size, obstack_room) [0]:
7242 Remove unused, unprototyped code.
7244 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7246 * physmem.c (physmem_total, physmem_available, main): Define
7249 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7250 (main): Define with a prototype.
7252 * posixver.c (getenv): Remove decl.
7254 * putenv.c (malloc): Returns void *, not char *.
7255 Include <string.h> unconditionally.
7256 (strchr, memcpy, NULL): Do not define.
7258 * readtokens.c: Include readtokens.h first, to test interface.
7259 Include <stdlib.h>, <string.h> unconditionally.
7260 (init_tokenbuffer): Define with a prototype.
7262 * regex.c (PARAMS): Remove. All uses removed.
7263 All uses of _RE_ARGS removed, too.
7264 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7266 (bzero): Assume memset exists.
7267 (memcmp, memcpy, NULL): Remove.
7268 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7269 char, or assignments to local vars of type signed char.
7270 (init_syntax_once, PREFIX(extract_number_and_incr),
7271 PREFIX(print_partial_compiled_pattern),
7272 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7273 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7274 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7275 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7276 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7277 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7278 wcs_compile_range, byte_compile_range, truncate_wchar,
7279 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7280 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7281 count_mbs_length, wcs_re_match_2_internal,
7282 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7283 PREFIX(alt_match_null_string_p),
7284 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7285 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7286 regfree, PREFIX(extract_number)): Define with prototype. Remove
7287 now-unnecessary declaration, if any.
7288 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7290 Remove now-unnecessary casts among pointer types.
7291 * regex.h (_RE_ARGS): Remove. All uses removed.
7293 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7294 (free): Remove decl.
7296 * rpmatch.c: Include <stdlib.h> unconditionally.
7298 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7299 (free): Remove decl.
7301 * save-cwd.c: Include <stdlib.h> unconditionally.
7302 * xgetcwd.c: Likewise.
7304 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7305 (free): Remove decl.
7307 * strchrnul.c (strchrnul): Define with a prototype.
7308 Fix bug: c_in was not converted to char before searching.
7310 The following changes are not K&R related:
7312 * group-member.h: Include <sys/types.h>, so that this file is
7314 * makepath.h: Likewise.
7316 * getusershell.c (readname, default_index, line_size, readname):
7317 Use size_t, not int, for sizes.
7318 (readname): If the size overflows, report an error instead of
7321 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7323 * getndelim2.c: Assume stdlib.h per the C89 spec.
7325 2003-09-08 Paul Eggert <eggert@twinsun.com>
7327 Assume C89 or better; remove K&R cruft.
7328 A few of these changes were first proposed by Derek Robert Price
7329 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7331 * addext.c: Include <string.h> unconditionally.
7332 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7333 Don't declare getenv or malloc.
7335 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7336 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7338 (find_stack_direction, alloca): Use prototypes.
7340 * atexit.c (atexit): Define using a prototype.
7342 * basename.c, dirname.c, stripslash.c:
7343 Include <string.h> unconditionally.
7345 * bcopy.c: Include <stddef.h>.
7346 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7348 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7350 * error.h (error, error_at_line, error_print_progname)
7351 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7352 * error.c: Include error.h first, to check interface.
7353 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7354 (VA_START): Remove; all uses changeed to va_start.
7355 (exit, strerror): Remove decls.
7356 (error_print_progname): Prototype uncondionally.
7357 Don't include <errno.h>; no longer needed.
7358 (private_strerror): Remove.
7359 (error_tail): Always define.
7360 (error, error_at_line): Assume C89 or better; always use prototypes.
7361 * fatal.c: Include "fatal.h" first, to test interface.
7362 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7363 (VA_START): Remove; all uses changed to va_start.
7364 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7366 (exit): Remove decl.
7367 (fatal): Prototype unconditionally. Assume va_start works.
7368 Abort at end, to pacify gcc.
7370 * euidaccess.c (main): Define with a prototype.
7372 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7374 * exitfail.c: Include <stdlib.h> unconditionally.
7376 * fnmatch_.h (__P): Remove. All uses changed to assume
7378 * fnmatch.c: Include fnmatch.h first, to test interface.
7379 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7380 (getenv): Remove decl.
7381 (fnmatch): Define using a prototype.
7382 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7383 (FCT): Define using a prototype.
7385 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7387 * gethostname.c: Include <stddef.h>.
7388 (gethostname): Define with prototype. Length is size_t, not int.
7390 2003-09-08 Paul Eggert <eggert@twinsun.com>
7392 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7393 getversion.c should have been removed then, but was accidentally
7396 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7397 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7399 2003-09-07 Paul Eggert <eggert@twinsun.com>
7401 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7402 copy_tm_result. Bug reported by Simon Josefsson in
7403 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7405 2003-09-06 Paul Eggert <eggert@twinsun.com>
7407 * time_r.c, time_r.h: New files.
7409 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7411 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7412 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7414 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7416 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7417 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7420 * timegm.c: Switch to glibc implementation, with the following changes:
7421 [defined HAVE_CONFIG_H]: Include <config.h>.
7422 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7423 (__mktime_internal) [!defined _LIBC]: New decl.
7424 (__gmtime_r) [!defined _LIBC]: New macro and function.
7425 (timegm): Use a prototype, since gnulib assumes C89.
7426 Do not bother declaring tmp to be const, as it's not really usefu.
7427 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7428 (timegm): Declare only if HAVE_DECL_TIMEGM.
7430 2003-09-03 Paul Eggert <eggert@twinsun.com>
7432 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7433 Bug reported by Lute Kamstra in
7434 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7436 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7437 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7438 course with correspondingly smaller numbers for tomorrow and
7439 yesterday. From Tadayoshi Funaba. Originally installed into
7440 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7443 2003-08-31 Simon Josefsson <jas@extundo.com>
7445 * timegm.h: New file.
7446 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7448 2003-08-31 Karl Berry <karl@gnu.org>
7450 * argp.h: update from libc.
7452 2003-08-28 Bruno Haible <bruno@clisp.org>
7454 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7455 warning on QNX, which defines O_BINARY to 000000.
7457 2003-08-24 Bruno Haible <bruno@clisp.org>
7459 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7460 MSVC7 <stdio.h> is included later.
7462 2003-08-20 Bruno Haible <bruno@clisp.org>
7464 * progname.h: New file, from GNU gettext.
7465 * progname.c: New file, from GNU gettext.
7466 * progreloc.c: New file, from GNU gettext.
7468 2003-08-19 Bruno Haible <bruno@clisp.org>
7470 * xstrdup.c: Assume <string.h> exists.
7472 2003-08-18 Jim Meyering <jim@meyering.net>
7474 * setenv.h: Indent nested cpp directive.
7475 * vasnprintf.c: Remove trailing blanks.
7477 2003-08-17 Simon Josefsson <jas@extundo.com>
7478 Bruno Haible <bruno@clisp.org>
7480 * xstrndup.h: New file.
7481 * xstrndup.c: New file.
7483 2003-08-17 Bruno Haible <bruno@clisp.org>
7485 * strndup.h: New file.
7487 2003-08-16 Paul Eggert <eggert@twinsun.com>
7489 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7490 space, undoing this 2003-08-12 change:
7491 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7493 2003-08-16 Jim Meyering <jim@meyering.net>
7495 Merge from coreutils.
7496 * xstrtoimax.c: #else #if -> #elif.
7497 * xstrtoumax.c: Likewise.
7499 2003-08-15 Paul Eggert <eggert@twinsun.com>
7501 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7502 rather than tab, after '#' in shell-script copyright notices.
7503 Suggested by Bruno Haible.
7505 2003-08-15 Jim Meyering <jim@meyering.net>
7506 and Paul Eggert <eggert@twinsun.com>
7508 Merge from coreutils.
7509 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7510 member but strut utmpx does not. Needed for AIX 4.3.3.
7511 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7513 2003-08-15 Jim Meyering <jim@meyering.net>
7515 Merge from coreutils.
7516 * xgethostname.c: Include <stdlib.h>.
7517 (xghostname): Don't exit for anything other than memory-related
7518 failure; just return NULL.
7519 * userspec.c: Include "posixver.h".
7520 (parse_user_spec): Accept `.' as a separator only
7521 in pre-POSIX-200112 mode.
7522 * strtoimax.c: Use #elif rather than #else #if.
7523 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7524 Remove function, now that we can rely on a working tzset function.
7525 [!_LIBC]: Ensure that the required autoconf test has been run.
7526 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7527 Use underlying_strftime for %r.
7528 * sha.c: Merge in some clean-up and optimization changes from glibc.
7529 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7530 Ensure that it is a multiple of 64.
7531 Rearrange loop exit tests so as to avoid performing an
7532 additional fread after encountering an error or EOF.
7533 * realloc.c: Update copyright date.
7535 2003-08-14 Jim Meyering <jim@meyering.net>
7537 Merge from coreutils.
7538 * obstack.h: Whitespace changes.
7539 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7540 and xcalloc return values.
7541 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7542 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7543 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7544 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7545 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7547 Use mntctl's return value to drive the entry-processing loop, since
7548 we can't rely on the value of the vmt_length member in the last
7549 entry. On some systems doing so could result in exhausting
7550 virtual memory. Based in part on a patch from Mike Jetzer.
7552 2003-08-14 Jim Meyering <jim@meyering.net>
7553 and Paul Eggert <eggert@twinsun.com>
7555 Merges from coreutils, plus other fixes.
7556 * physmem.c: Merge in portability changes from gcc/libiberty
7557 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7558 for credits and details. Thanks to Kaveh Ghazi for helping
7559 to keep these files in sync.
7560 (ARRAY_SIZE): Define it.
7561 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7562 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7563 (memcasecmp): Don't assume size_t fits in unsigned int.
7564 Remove casts and duplicate code.
7565 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7566 (memcpy): Remove definition.
7567 Merge in some clean-up and optimization changes from glibc.
7568 [BLOCKSIZE]: Move definition to top of file.
7569 Ensure that it is a multiple of 64.
7570 Rearrange loop exit tests so as to avoid performing an
7571 additional fread after encountering an error or EOF.
7572 * md5.h (md5_uintptr): Define.
7573 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7574 return to the initial working directory. Preserve errno
7576 * idcache.c: Include "xalloc.h".
7577 (xmalloc, xrealloc): Remove decls.
7578 (getuser): Remove casts no longer required in C89.
7579 * human.c: Include stdio.h, for sprintf.
7580 * group-member.c: Include "xalloc.h".
7581 (xmalloc, xrealloc): Remove decls.
7582 (get_group_info): Remove casts no longer required in C89.
7583 * getusershell.c (readname): Remove casts no longer required in C89.
7584 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7585 * getline.c: Whitespace fix, from coreutils.
7587 2003-08-13 Paul Eggert <eggert@twinsun.com>
7589 * exclude.c: Include <ctype.h>
7590 (IN_CTYPE_DOMAIN): New macro.
7592 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7595 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7596 Undo previous (whitespace-only) change.
7598 2003-08-12 Paul Eggert <eggert@twinsun.com>
7600 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7601 Normalize leading white space and remove trailing white space.
7602 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7603 notice, as per ../config/srclist-update.
7605 Merge from coreutils.
7606 * euidaccess.h: New file.
7607 * euidaccess.c: Include it.
7608 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7609 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7610 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7612 2003-08-11 Bruno Haible <bruno@clisp.org>
7614 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7615 (vasnprintf): Use it instead of wcslen.
7617 2003-08-11 Bruno Haible <bruno@clisp.org>
7619 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7620 value to ensure that _Bool promotes to int. Use #define for _Bool when
7621 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7623 2003-08-10 Karl Berry <karl@gnu.org>
7625 * regex.h: update from libc (whitespace fix).
7627 2003-08-09 Paul Eggert <eggert@twinsun.com>
7629 Merge some files from coreutils. These changes were
7630 originally made by Jim Meyering.
7631 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7632 many older Unixes require this.
7633 * alloca.c (alloca): Remove cast to argument of free;
7634 no longer needed in C89.
7635 * alloca_.h, regex.h: Fix white space to match
7636 what GNU indent does.
7638 2003-08-05 Paul Eggert <eggert@twinsun.com>
7640 * bumpalloc.h: Remove.
7642 2003-08-04 Paul Eggert <eggert@twinsun.com>
7644 * getloadavg.c: Change copyright notice and spacing to conform to
7647 Merge from coreutils.
7648 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7650 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7651 from Karl Berry, implemented by Jim Meyering.
7652 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7653 from Dmitry V. Levin.
7654 Remove anachronistic cast of xrealloc.
7655 * fnmatch_.h (__const): Remove. Use 'const'.
7656 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7657 type. Otherwise, it wouldn't compile with at least /bin/cc on
7658 ymp-cray-unicos9.0.2.X.
7659 Combine two mostly-identical uses of alloca into one.
7660 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7662 2003-08-04 Dave Love <d.love@dl.ac.uk>
7666 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7667 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7668 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7669 obsolete NLIST_NAME_UNION.
7670 [__GNU__]: Undef BSD and FSCALE.
7671 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7673 2003-08-03 Paul Eggert <eggert@twinsun.com>
7675 * stdbool_.h (_Bool): Make it signed char, instead of
7676 an enum type, so that it's guaranteed to promote to int. See:
7677 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7679 2003-07-31 Paul Eggert <eggert@twinsun.com>
7681 * strerror.c: Include config.h, limits.h. Declare sprintf.
7682 (strerror): Don't assume that a printable int fits in 14 bytes.
7684 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7685 Bruno Haible <bruno@clisp.org>
7687 * getline.h (getline, getdelim): Change return type to ssize_t.
7688 * getline.c (getline, getdelim): Likewise.
7689 Remove _GNU_SOURCE define; now it's defined in config.h through
7692 2003-07-22 Paul Eggert <eggert@twinsun.com>
7694 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7695 over-parenthesization in macros.
7697 Sync with coreutils.
7699 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7702 Use `exit_failure' for xalloc and xmemcoll instead of their own
7703 private exit-failure variables.
7704 * xalloc.h (xalloc_exit_failure): Remove.
7705 * xmalloc.c: Likewise. Include exitfail.h.
7706 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7707 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7708 * xmemcoll.c: Likewise. Include exitfail.h.
7709 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7711 2003-07-18 Paul Eggert <eggert@twinsun.com>
7713 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7714 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7715 to test that it can stand by itself. Include "exitfail.h".
7716 Clients should set exit_failure instead.
7717 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7719 2003-07-18 Andreas Schwab <schwab@suse.de>
7721 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7723 2003-07-18 Bruno Haible <bruno@clisp.org>
7725 * getndelim2.h: New file.
7726 * getndelim2.c: Make into a module of its own. Include config.h,
7728 (getndelim2): Make non-static. Change return type to ssize_t.
7729 * getline.h: Change argument names.
7730 * getline.c: Include getndelim2.h instead of getndelim2.c.
7731 * getnline.c: Include getndelim2.h.
7733 2003-07-17 Bruno Haible <bruno@clisp.org>
7735 * Makefile.am: Remove file.
7736 * Makefile.in: Remove file.
7738 2003-07-17 Bruno Haible <bruno@clisp.org>
7740 * getnline.h: New file.
7741 * getnline.c: New file.
7742 * getndelim2.c: New file, extracted from getline.c.
7743 (getndelim2): Renamed from getdelim2, with added nmax argument.
7744 * getline.c: Include getndelim2.c.
7745 (getdelim2): Moved out to getndelim2.c.
7746 (getline, getdelim): Update.
7748 2003-07-15 <karl@gnu.org>
7750 * vasnprintf.c: update from gettext.
7752 2003-07-15 Jim Meyering <jim@meyering.net>
7754 * makepath.c (make_path): Enclose diagnostic in _(...).
7756 2003-07-14 Paul Eggert <eggert@twinsun.com>
7758 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7759 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7760 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7761 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7762 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7763 updated automatically by ../config/srclist-update. This changes
7764 their license from LPGL to GPL.
7766 2003-07-14 Jim Meyering <jim@meyering.net>
7768 Don't emit diagnostics. Let callers do that.
7769 * save-cwd.c: Don't include "error.h".
7770 (save_cwd): Don't call error. Ensure that errno is valid
7771 when returning nonzero.
7773 * save-cwd.h (restore_cwd): Update prototype.
7774 * save-cwd.c (restore_cwd): Remove two parameters.
7775 Simplify. Don't call error upon failure. Let callers do that.
7776 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7777 when auditing is enabled. But don't bother updating the #if.
7779 2003-07-14 Simon Josefsson <jas@extundo.com>
7781 * mempcpy.h: New file.
7782 * mempcpy.c: New file.
7784 2003-07-14 Paul Eggert <eggert@twinsun.com>
7786 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7787 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7788 unicodeio.c, unicodeio.h, unlocked-io.h:
7789 Switch from LGPL to GPL.
7791 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7793 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7794 it breaks C++ compilation.
7795 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7797 2003-07-10 Jim Meyering <jim@meyering.net>
7799 * vasnprintf.c: Remove trailing blanks.
7800 Make cpp indentation consistent.
7802 2003-07-09 Paul Eggert <eggert@twinsun.com>
7804 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7805 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7806 Switch from LGPL to GPL.
7808 2003-07-07 Paul Eggert <eggert@twinsun.com>
7810 * mktime.c: Fix some boundary cases and remove need for floating point.
7812 Issue a compile-time diagnostic if time_t is floating point, or if
7813 two's complement arithmetic is not in effect, or if arithmetic
7814 right shift does not propagate the sign. These assumptions were
7815 all in the original code but they weren't checked.
7817 (TIME_T_MIDPOINT, verify): New macros.
7818 (__isleap): Remove; it has integer overflow problems.
7819 (leapyear): New function, without those problems.
7820 (ydhms_tm_diff): Remove; splitting into two parts.
7821 (ydhms_diff): New function, containing the arithmetic part of
7822 the old ydhms_tm_diff function. Issue a compile-time
7823 diagnostic if we are not using C99 integer division.
7824 Avoid casts when possible.
7825 (guess_time_tm): New function, containing the checking part of
7826 the old ydhms_tm_diff function. Return the new value, rather than
7827 the difference between it and the old. Accept a new argument T
7828 so that *T specifies the old value. Check for overflow in the result.
7830 (__mktime_internal): Use a time_t offset, not a long int offset.
7831 This undoes the 2003-06-04 change, which is no longer needed now
7832 that we have better overflow checking.
7833 (localtime_offset): Likewise.
7835 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7836 and long are 64-bit but int is only 32-bit.
7837 (ydhms_diff): Use long int to store year1 and yday1.
7838 Issue a compile-time diagnostic if long int is not wide enough.
7840 (__mktime_internal): Use long int to store adjusted year and yday.
7841 Use plain C rather than preprocessor commands, if that doesn't
7843 Check for overflow (and try to repair) after each probe
7844 rather than checking only at the very end. This avoids some bugs
7845 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7846 does not equal GMT offset at maximum time).
7847 Use integer to check for overflow rather than floating point; this
7848 is more portable to non-IEEE hosts, and is a tad faster.
7849 When we detect that we are oscillating between two values,
7850 don't check whether tm_isdst has the requested value, since
7851 we already know the answer. When tm_isdst has the wrong value,
7852 use a different heuristic to find the right one, based on the
7853 extreme values actually observed in practice in tz2003a,
7854 rather than the (overly optimistic) "previous 3 calendar quarters".
7856 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7857 "T const" to accommodate glibc style.
7858 (check_result): Use less-confusing report format. "long" -> "long int.
7860 Don't loop if the iteration overflows time_t.
7861 Allow a negative step in the iteration.
7863 2003-07-01 Paul Eggert <eggert@twinsun.com>
7865 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7866 having it depend on HAVE_SYS_TYPES_H.
7868 2003-06-25 Bruno Haible <bruno@clisp.org>
7870 * readlink.c: New file.
7872 2003-06-20 Bruno Haible <bruno@clisp.org>
7874 Assume C89, so PARAMS isn't needed.
7875 * unicodeio.h (PARAMS): Remove.
7876 * unicodeio.c: Don't use PARAMS.
7878 2003-06-18 Jim Meyering <jim@meyering.net>
7880 Merge changes from coreutils.
7881 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7882 Remove explicit declarations of xmalloc and realloc.
7884 (read_utmp): Remove anachronistic cast of xmalloc.
7886 2003-06-17 Paul Eggert <eggert@twinsun.com>
7888 Assume C89, so PARAMS isn't needed.
7889 * backupfile.h (PARAMS): Remove. All uses removed.
7890 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7891 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7892 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7893 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7894 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7895 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7896 xstrtol.h: Likewise.
7897 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7898 same.h, strverscmp.h: Do not include config.h; no longer needed.
7899 Anyway, config.h should always be included before any other file.
7901 2003-06-11 Simon Josefsson <jas@extundo.com>
7903 * sysexit_.h: New file.
7905 2003-05-20 Derek Price <derek@ximbiot.com>
7907 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7909 2003-06-10 Simon Josefsson <jas@extundo.com>
7911 * strchrnul.h: New file.
7912 * strchrnul.c: New file.
7914 2003-06-10 Simon Josefsson <jas@extundo.com>
7916 * argp.h: New file, from glibc.
7917 * argp-ba.c: New file, from glibc.
7918 * argp-eexst.c: New file, from glibc.
7919 * argp-fmtstream.c: New file, from glibc.
7920 * argp-fmtstream.h: New file, from glibc.
7921 * argp-fs-xinl.c: New file, from glibc.
7922 * argp-help.c: New file, from glibc.
7923 * argp-namefrob.h: New file, from glibc.
7924 * argp-parse.c: New file, from glibc.
7925 * argp-pv.c: New file, from glibc.
7926 * argp-pvh.c: New file, from glibc.
7927 * argp-xinl.c: New file, from glibc.
7929 2003-06-07 Jim Meyering <jim@meyering.net>
7931 * readtokens.h: Put `Free Software Foundation, Inc.'
7932 in place of my name in the copyright comment.
7933 Remove definition and uses of __P.
7936 * stat.c: Don't declare xmalloc explicitly.
7937 Instead, include "xalloc.h".
7938 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7939 xrealloc, and xcalloc return values.
7940 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7942 * xgetcwd.h: Remove definition/uses of PARAMS.
7944 2003-06-06 Jim Meyering <jim@meyering.net>
7946 * stdbool_.h: Renamed from stdbool.h.in.
7948 2003-06-06 Jim Meyering <jim@meyering.net>
7950 Merge from coreutils.
7951 * same.c: (same_name): Declare *_basename locals to be `const'.
7952 Consolidate declarations and initializations of *_base* locals.
7954 Merge from coreutils.
7955 This avoids a core dump on systems without GNU putenv,
7956 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7957 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7958 (unsetenv): New static function, from GNU libc.
7959 (rpl_putenv): Use it.
7961 * modechange.c: Remove trailing blanks.
7963 Merge from coreutils.
7964 * fsusage.c: Remove declaration of statfs.
7965 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7967 * posixtm.c: Include <stdbool.h> unconditionally.
7969 2003-06-05 Paul Eggert <eggert@twinsun.com>
7971 * mktime.c (__mktime_internal): When resolving a tm_isdst
7972 mismatch, look in future quarters as well as past. This fixes a
7973 bug when processing fall-backwards gaps immediately after a long
7974 period of daylight-saving time.
7976 * mktime.c: Assume freestanding C89 or better.
7977 (HAVE_LIMITS_H): Remove. Assume it's 1.
7978 (__P): Remove; not used.
7979 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7980 (mktime, not_equal_tm, print_tm, check_result,
7981 main): Use prototypes. Use const * where appropriate.
7982 (main): Fix typo in testing code that uncovered by above changes.
7983 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7985 2003-06-04 Paul Eggert <eggert@twinsun.com>
7987 * mktime.c: Fix Debian bug 177940
7988 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7989 (localtime_offset): Now long int, not time_t, because we want it
7990 to be guaranteed to be signed. All uses changed.
7991 (__mktime_internal): If overflow would occur when adding offset,
7994 Merge 'human' changes from coreutils. Rewrite to support
7995 locale-specific notations like thousands separators.
7996 * human.c: Simplify authorship notice.
7997 Include human.h immediately after config.h.
7998 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7999 <limits.h>: Do not include, since human.h does.
8000 (SIZE_MAX, UINTMAX_MAX): New macros.
8001 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
8002 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
8003 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
8004 (power_letter): Renamed from suffixes.
8005 (generate_suffix_backwards): Remove.
8006 (adjust_value): Now takes int style (because of human.h changes)
8007 and long double value (for greater precision on some platforms).
8008 (group_number): New function.
8009 (human_readable): Use it. Use integer options, not enum.
8010 Put the options before the sizes in the arg list.
8011 Support all the new options.
8012 The old human_readable function has been removed;
8013 use inttostr.h instead.
8014 (human_readable, default_block_size, humblock):
8015 Use uintmax_t, not int, for block sizes.
8016 (human_readable_inexact, block_size_types): Remove.
8017 (block_size_opts): New constant.
8018 (human_options): Renamed from human_block_size, with new signature
8019 that allows block sizes up to UINTMAX_MAX. All callers changed.
8020 * human.h: Add copyright and authorship notice.
8021 Include <limits.h> and <stdbool.h> unconditionally.
8022 (PARAMS): Remove. All uses removed.
8023 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
8024 (enum human_inexact_style): Remove tag; now a nameless enum.
8025 (human_floor, human_ceiling, human_round_to_even): Now have
8026 values 2, 0, 1 rather than -1, 1, 0.
8027 (human_group_digits, human_suppress_point_zero, human_autoscale,
8028 human_base_1024, human_SI, human_B): New constants.
8029 (human_readable_inexact, human_block_size): Remove.
8030 (human_readable): Size args are now uintmax_t, not int.
8031 (human_options): New decl.
8033 * exclude.c: (new_exclude, add_exclude): Remove casts that are
8034 unnecessary now that we assume C89 or better. This change
8035 imported from coreutils.
8037 * mktime.c (__mktime_internal): Do not reject negative timestamps
8038 arbitrarily. This is the same patch as 2003-05-28, but it got lost
8039 in the 2003-05-30 sync from glibc.
8041 .h files should stand alone, but we shouldn't include <sys/types.h>
8042 if we can get away with just <stddef.h>.
8044 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
8045 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
8046 rather than <sys/types.h>, as we merely need size_t.
8047 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
8049 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
8050 Include <stdio.h>, to get FILE.
8051 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
8052 memcasecmp.h has included <stddef.h> and all we need is size_t.
8053 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
8054 our interface, instead of including <sys/types.h>
8056 2003-06-02 Paul Eggert <eggert@twinsun.com>
8059 Fix some minor time-related bugs with POSIX time arguments.
8060 Some valid time stamps were being rejected (notably -1, and
8061 time stamps before 1900 on 64-bit hosts). And some invalid
8062 time stamps were being accepted, e.g. September 31.
8064 * posixtm.h (posixtime): Return bool instead of time_t, so
8065 that we can return (time_t) -1 successfully.
8066 * posixtm.c: Likewise.
8067 [HAVE_STDBOOL_H]: Include <stdbool.h>.
8068 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
8069 (t): Remove static var.
8070 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
8071 of static var. All uses changed.
8072 (year): Do not reject years before 1900; they can occur with
8074 (posix_time_parse): Do not check for out-of-range components;
8075 that is now the caller's responsibility, since our checks were
8076 only approximations.
8077 (posixtime): Use mktime to check for out-of-range components,
8078 since it knows them exactly.
8079 If mktime returns (time_t) -1, check whether an error actually occurred
8080 by invoking localtime on -1.
8081 (main) [TEST_POSIXTIME]: Check for input data errors, and report
8082 posixtime failures better.
8083 Improve the test data (in comments only).
8085 2003-05-30 <karl@gnu.org>
8087 * mktime.c: update from libc.
8089 2003-05-30 Bruno Haible <bruno@clisp.org>
8091 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
8092 * localcharset.h: Likewise.
8093 * localcharset.c: Likewise.
8095 2003-05-28 Paul Eggert <eggert@twinsun.com>
8097 Assume the headers required for C89 freestanding compilers.
8098 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
8099 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
8100 without checking for HAVE_LIMITS_H.
8101 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
8102 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
8104 * fatal.c: Include <stdarg.h> without checking for __STDC__.
8105 * exclude.c: Include <stdbool.h> unconditionally.
8106 * tempname.c: Include <stddef.h> unconditionally.
8107 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
8108 * modechange.c, rpmatch.c (NULL): Don't define, since
8109 <stddef.h> does that.
8110 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8111 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8112 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8113 * xstrtol.c: Likewise.
8114 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8115 * savedir.c: Include <stddef.h> instead of defining NULL.
8117 * addext.c (addext): Use assignment rather than cast, to avoid
8118 warnings on some platforms.
8120 * mktime.c (__mktime_internal): Do not reject negative timestamps
8123 2003-05-10 Bruno Haible <bruno@clisp.org>
8125 * linebreak.c (iconv_string_length): Don't return -1 just because the
8126 string is longer than 4 KB.
8128 2003-05-12 Jim Meyering <jim@meyering.net>
8130 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8131 the space-padded-by-default conversion specifiers, %e, %k, %l.
8133 2003-05-03 Bruno Haible <bruno@clisp.org>
8135 Upgrade to Unicode-4.0.
8136 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8137 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8138 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8139 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8140 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8141 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8142 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8143 Change width of U+E0100..U+E01EF from 1 to 0.
8145 2003-04-25 Bruno Haible <bruno@clisp.org>
8147 * copy-file.c: Include <stddef.h>, for size_t.
8149 2003-04-25 Jim Meyering <jim@meyering.net>
8151 * copy-file.c (copy_file_preserving): Declare buf_size to be
8152 of type size_t, not int.
8154 2003-04-11 Jim Meyering <jim@meyering.net>
8156 Merge changes from Coreutils.
8158 2003-03-22 Jim Meyering <jim@meyering.net>
8160 * strftime.c (widen): Cast alloca return value to proper type.
8162 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8165 * strftime.c (my_strftime): Handle very large width
8166 specifications for numeric values correctly. Improve checks for
8169 2003-01-19 Jim Meyering <jim@meyering.net>
8171 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8172 (nl_get_alt_digit) [! defined my_strftime]: Define.
8173 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8174 _nl_get_alt_digit and _nl_get_walt_digit.
8176 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8177 These changes have no effect outside of _LIBC.
8179 2003-04-10 Bruno Haible <bruno@clisp.org>
8181 * findprog.h: New file, from GNU gettext.
8182 * findprog.c: New file, from GNU gettext.
8184 2003-04-05 Jim Meyering <jim@meyering.net>
8186 Merge changes from Coreutils.
8188 * exclude.h (PARAMS): Remove definition and uses.
8189 * exclude.c: Remove uses of `PARAMS'.
8191 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8192 Add test-cases for DOS filenames. Declare program_name.
8193 (main): Set up program_name. Patch by Rich Dawe.
8195 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8197 Use mntctl's return value to drive the entry-processing loop, since
8198 we can't rely on the value of the vmt_length member in the last
8199 entry. On some systems doing so could result in exhausting
8200 virtual memory. Based in part on a patch from Mike Jetzer.
8202 2003-04-04 Bruno Haible <bruno@clisp.org>
8204 * linebreak.h: New file, from GNU gettext.
8205 * linebreak.c: New file, from GNU gettext with slight modifications.
8206 * lbrkprop.h: New file, from GNU gettext.
8208 2003-04-03 Bruno Haible <bruno@clisp.org>
8210 * utf8-ucs4.h: New file, from GNU gettext.
8211 * utf16-ucs4.h: New file, from GNU gettext.
8212 * ucs4-utf8.h: New file, from GNU gettext.
8213 * ucs4-utf16.h: New file, from GNU gettext.
8215 2003-04-02 Bruno Haible <bruno@clisp.org>
8217 * binary-io.h: New file, from GNU gettext.
8219 2003-04-01 Bruno Haible <bruno@clisp.org>
8221 * pathname.h: New file, from GNU gettext.
8222 * concatpath.c: New file, from GNU gettext.
8224 2003-03-30 Bruno Haible <bruno@clisp.org>
8226 * copy-file.c (copy_file_preserving): Don't set owner if the function
8227 chown() doesn't exist.
8229 2003-03-28 Bruno Haible <bruno@clisp.org>
8231 * copy-file.h: New file, from GNU gettext.
8232 * copy-file.c: New file, from GNU gettext.
8234 2003-03-18 Jim Meyering <jim@meyering.net>
8236 * quote.c (quote_n): Fix typo in comment.
8238 2003-03-14 Jim Meyering <jim@meyering.net>
8240 Merge changes from Coreutils.
8241 * obstack.h (obstack_object_size): Declare temporary, __o,
8242 to be const, in order to avoid warnings.
8243 (obstack_room): Likewise.
8244 (obstack_empty_p): Likewise.
8246 2003-03-13 Paul Eggert <eggert@twinsun.com>
8248 Merge changes from Bison.
8249 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8250 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8251 when compiling Bison 1.875's `bitset bset = obstack_alloc
8252 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8253 * hash.c: Include <stdbool.h> unconditionally.
8255 2003-03-09 Paul Eggert <eggert@twinsun.com>
8257 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8258 Reported by Bruce Becker; see:
8259 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8261 2003-03-03 Paul Eggert <eggert@twinsun.com>
8262 Bruno Haible <bruno@clisp.org>
8264 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8265 Reported by John Hughes, see
8266 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8268 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8270 * poll_.h: New file.
8273 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8275 * mathl.h: New file.
8276 * acosl.c: New file.
8277 * asinl.c: New file.
8278 * atanl.c: New file.
8279 * ceill.c: New file.
8282 * floorl.c: New file.
8283 * frexpl.c: New file.
8284 * ldexpl.c: New file.
8286 * sincosl.c: New file.
8288 * sqrtl.c: New file.
8290 * trigl.c: New file.
8291 * trigl.h: New file.
8293 2003-02-17 Bruno Haible <bruno@clisp.org>
8295 * mkdtemp.h: New file, from GNU gettext.
8296 * mkdtemp.c: New file, from GNU gettext.
8298 2003-01-31 Bruno Haible <bruno@clisp.org>
8300 * rename.c: #undef rename before defining rpl_rename.
8301 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8303 2003-01-30 Bruno Haible <bruno@clisp.org>
8305 * printf-args.h: New file, from GNU gettext.
8306 * printf-args.c: New file, from GNU gettext.
8307 * printf-parse.h: New file, from GNU gettext.
8308 * printf-parse.c: New file, from GNU gettext.
8309 * vasnprintf.h: New file, from GNU gettext.
8310 * vasnprintf.c: New file, from GNU gettext.
8311 * asnprintf.c: New file, from GNU gettext.
8312 * vasprintf.h: New file, from GNU gettext with modifications.
8313 * vasprintf.c: New file, from GNU gettext.
8314 * asprintf.c: New file, from GNU gettext.
8316 2003-01-29 Bruno Haible <bruno@clisp.org>
8318 * stpncpy.h: New file, from GNU gettext with modifications.
8319 * stpncpy.c: New file, from GNU gettext with modifications.
8321 2003-01-28 Bruno Haible <bruno@clisp.org>
8323 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8325 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8328 2003-01-27 Bruno Haible <bruno@clisp.org>
8330 * xsetenv.h: New file, from GNU gettext.
8331 * xsetenv.c: New file, from GNU gettext.
8333 2003-01-23 Bruno Haible <bruno@clisp.org>
8335 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8337 2003-01-22 Bruno Haible <bruno@clisp.org>
8339 * exit.h: New file, from GNU gettext.
8341 2003-01-11 Bruno Haible <bruno@clisp.org>
8343 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8344 * strcase.h (strcasecmp, strncasecmp): Likewise.
8346 2003-01-14 Jim Meyering <jim@meyering.net>
8348 * same.c (same_name): Tweak a comment.
8350 2003-01-11 Bruno Haible <bruno@clisp.org>
8352 * same.c (same_name): Reorder tests so as to avoid calling stat()
8353 when a string comparison is sufficient.
8355 2003-01-11 Bruno Haible <bruno@clisp.org>
8357 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8360 2003-01-11 Bruno Haible <bruno@clisp.org>
8362 * hash-pjw.c: Add comment about low quality of this function.
8364 2003-01-12 Paul Eggert <eggert@twinsun.com>
8366 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8367 to avoid collisions with libcurses and libreadline.
8369 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8370 * getstr.h, getstr.c: Remove.
8371 * getline.c: Include "getline.h", to check interface.
8372 Move body of old getstr.c here: this defines MIN_CHUNK and
8373 declares getdelim2, which is renamed from getstr.
8374 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8376 * linebuffer.c (readlinebuffer): Renamed from readline.
8378 * linebuffer.h: Likewise.
8379 (readline): Remove backward-compatibility macro.
8381 2003-01-12 Jim Meyering <jim@meyering.net>
8383 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8385 2003-01-10 Bruno Haible <bruno@clisp.org>
8387 * alloca_.h: New file.
8388 * getdate.y: Unconditionally include alloca.h.
8389 * makepath.c: Likewise.
8390 * setenv.c: Likewise.
8391 * userspec.c: Likewise.
8393 2003-01-09 Bruno Haible <bruno@clisp.org>
8395 * stdbool.h.in: New file.
8397 2003-01-08 Bruno Haible <bruno@clisp.org>
8399 * safe-read.c: Include specification header first, to ensure its
8401 * full-write.c: Likewise.
8403 2003-01-08 Jim Meyering <jim@meyering.net>
8405 * full-write.c: Undefine and define-away `const' after inclusion
8406 of errno.h, not before. Suggestion from Bruno Haible.
8408 2003-01-07 Jim Meyering <jim@meyering.net>
8410 * full-write.c: Rework so that it may serve to define full_read, too.
8411 * full-read.c: Simply #define FULL_READ and include full-write.c.
8413 2003-01-06 Jim Meyering <jim@meyering.net>
8415 * version-etc.c: Update year in translatable copyright string.
8417 2002-12-25 Bruno Haible <bruno@clisp.org>
8419 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8420 * xstrtol.h: Likewise.
8421 * xstrtoimax.c: Likewise.
8422 * xstrtoumax.c: Likewise.
8423 * human.h: Likewise.
8425 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8426 on systems that have <inttypes.h> but not <stdint.h>.
8428 2002-12-31 Paul Eggert <eggert@twinsun.com>
8430 * memcoll.c (memcoll): Fall back on a simple algorithm using
8431 memcmp if strcoll doesn't work.
8433 2002-12-23 Bruno Haible <bruno@clisp.org>
8435 * localcharset.h: New file.
8436 * localcharset.c: Include it.
8437 * unicodeio.c: Likewise.
8439 2002-12-22 Bruno Haible <bruno@clisp.org>
8441 * utime.c (utime_null): No need to call ftruncate if the file was
8444 2002-12-23 Bruno Haible <bruno@clisp.org>
8446 * memcoll.c (STRCOLL): New macro.
8449 2002-12-22 Bruno Haible <bruno@clisp.org>
8451 * getstr.h (getstr): Define, to avoid clash with libcurses.
8452 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8454 2002-12-22 Bruno Haible <bruno@clisp.org>
8456 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8458 2002-12-23 Bruno Haible <bruno@clisp.org>
8460 * getline.h: Include <stddef.h>, for size_t.
8462 * unicodeio.h: Include <stddef.h>, for size_t.
8463 * unicodeio.c: Don't include <stddef.h>.
8465 2002-12-17 Bruno Haible <bruno@clisp.org>
8467 * canon-host.c (strdup): Remove unused declaration.
8469 * fsusage.c: Include full_read.h.
8470 (get_fs_usage): Use full_read instead of safe_read.
8472 * utime.c (utime_null): Use SAFE_READ_ERROR.
8474 2002-12-11 Bruno Haible <bruno@clisp.org>
8476 * setenv.h: Rewritten to cope with systems that have setenv() but not
8478 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8481 2002-12-11 Bruno Haible <bruno@clisp.org>
8483 * setenv.c (alloca): Fall back to malloc.
8485 (setenv): Use freea() to free memory allocated with alloca().
8487 2002-11-13 Bruno Haible <bruno@clisp.org>
8489 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8490 function declarations.
8491 * unsetenv.c (unsetenv): Likewise.
8493 2002-03-04 Bruno Haible <bruno@clisp.org>
8495 Portability to AIX 4.3.3.
8496 * unsetenv.c: New file, extracted from setenv.c.
8497 * setenv.c: Move the unsetenv() function to unsetenv.c.
8499 2001-12-20 Bruno Haible <bruno@clisp.org>
8501 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8502 use malloc instead. For SunOS 4.
8504 2001-12-11 Bruno Haible <bruno@clisp.org>
8506 * setenv.c: Declare alloca.
8507 (compar_fn_t): New typedef.
8508 (KNOWN_VALUE, STORE_VALUE): Use it.
8510 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8513 2002-12-10 Paul Eggert <eggert@twinsun.com>
8515 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8516 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8517 Choose values that are less likely to collide with system fnmatch
8519 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8520 defined (e.g., a pure POSIX system).
8521 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8522 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8524 2002-12-06 Jim Meyering <jim@meyering.net>
8526 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8528 Merge in changes from libc's misc/error.c, in preparation
8529 for the merge of gnulib's changes back into libc.
8531 * error.c (_): Define only if not already defined.
8532 Move definition to follow all #include directives.
8533 Include unlocked-io.h only if !_LIBC.
8534 [_LIBC]: Include <libio/libioP.h>.
8535 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8536 (fflush): Tweak definition to use INTUSE.
8539 2002-12-05 Paul Eggert <eggert@twinsun.com>
8541 * alloca.c [defined emacs]: Include "lisp.h".
8542 (xalloc_die) [defined emacs]: New macro.
8543 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8544 [! defined emacs]: Include <xalloc.h>.
8545 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8546 (pointer): Typedef to POINTER_TYPE *.
8547 (malloc): Remove decl; we now always use xmalloc.
8548 (alloca): Use old-style definition, since Emacs needs this.
8549 Check for arithmetic overflow when computing combined size.
8551 2002-12-04 Paul Eggert <eggert@twinsun.com>
8553 Do not generate unlocked-io.h automatically, since it's easier to
8554 maintain it by hand.
8556 * unlocked-io.h: New file, from GNU diffutils,
8557 but with proper copyright notice and attribution.
8559 * Makefile.am: Add copyright notice.
8560 (libfetish_a_SOURCES): Add unlocked-io.h.
8561 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8562 (DISTCLEANFILES, io_functions): Remove macros.
8563 (EXTRA_DIST): Remove gen_uio.
8564 (unlocked-io.h): Remove rule.
8566 2002-12-04 Jim Meyering <jim@meyering.net>
8568 Reflect the fact that stat.c and lstat.c are no longer generated.
8569 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8570 (DISTCLEANFILES): Likewise.
8571 (EXTRA_DIST): Likewise.
8572 (all_local): Don't depend on stat.c or lstat.c.
8573 (stat.c, lstat.c): Remove rules.
8574 (EXTRA_DIST): Remove xstat.in.
8576 * xstat.in: Remove file. Contents moved into stat.c.
8577 * stat.c: New file. Contents mostly from xstat.in.
8578 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8579 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8581 * safe-read.c: Rework so that it may serve to define safe_write, too.
8582 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8584 2002-12-03 Jim Meyering <jim@meyering.net>
8586 * safe-read.c, safe-write.c: Change variable names and comments, but
8587 not semantics, to minimize the differences between these two files.
8588 (safe_read): Change comment to mention SAFE_READ_ERROR.
8590 * safe-read.c (IS_EINTR): Define.
8591 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8593 2002-12-02 Bruno Haible <bruno@clisp.org>
8595 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8596 Define, taken from safe-read.c.
8597 (INT_MAX): Provide fallback.
8598 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8599 * safe-write.h (SAFE_WRITE_ERROR): Define.
8601 * safe-read.c (EINTR): Remove definition.
8602 (safe_read): Don't use EINTR if it is absent.
8604 2002-12-02 Jim Meyering <jim@meyering.net>
8606 * safe-read.c (EINTR): Define.
8607 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8608 (INT_MAX): Provide fallback.
8609 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8611 * safe-read.h (SAFE_READ_ERROR): Define.
8613 2002-12-01 Jim Meyering <jim@meyering.net>
8615 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8616 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8618 2002-11-27 Paul Eggert <eggert@twinsun.com>
8620 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8621 hash_rehash): Replace `if (limit <= value) abort ();' with
8622 `if (! (value < limit)) abort ();', for readability.
8624 2002-11-26 <karl@gnu.org>
8626 * strdup.c: copy from libc again, with jim's ok.
8627 * .cppi-disable: re-add strdup.c
8629 2002-11-25 <karl@gnu.org>
8631 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8632 instead of "strtol.c".
8634 2002-11-25 Jim Meyering <jim@meyering.net>
8636 * mktime.c: Sync from libc, now that it has the latest fix.
8638 2002-11-24 <karl@gnu.org>
8640 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8641 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8643 2002-11-24 Jim Meyering <jim@meyering.net>
8645 Update from coreutils:
8647 * mktime.c: Merge in changes from libc.
8649 Avoid a link-time failure on some Linux systems.
8650 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8651 (__mon_yday): Declare with the STATIC attribute.
8652 (__mktime_internal): Likewise.
8653 Based on a report from Greg Schafer.
8655 2002-11-23 Jim Meyering <jim@meyering.net>
8657 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8658 Use `unsigned', not `int', as type of index.
8660 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8662 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8664 2002-11-22 Paul Eggert <eggert@twinsun.com>
8666 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8667 hint that one should use `if (! x) abort ();' rather than `assert
8668 (x);', and anyway it's one less thing to worry about configuring.
8669 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8670 hash_rehash, hash_insert): Use abort rather than assert.
8672 2002-11-22 Paul Eggert <eggert@twinsun.com>
8674 * quotearg.h: Allow multiple inclusion by surrounding with
8675 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8676 so that we can be included first.
8677 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8678 * quotearg.c: Include quotearg.h immediately after config.h.
8679 No need to include stddef.h or sys/types.h any more.
8680 Surround local include files with "", not "<>".
8681 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8682 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8683 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8684 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8685 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8686 (ISPRINT): Remove; no longer needed now that we assume C89.
8688 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8691 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8692 quotearg_char): Use SIZE_MAX rather than
8693 (size_t) -1 when we are talking about "infinity".
8695 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8697 2002-11-22 Bruno Haible <bruno@clisp.org>
8699 * safe-read.h: Assume C89. Add comments.
8700 (safe_read): Change return type to size_t.
8701 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8702 counts > SSIZE_MAX correctly.
8703 * safe-write.h: New file.
8704 * safe-write.c: New file.
8705 * full-read.h: New file.
8706 * full-read.c: New file.
8707 * full-write.h: Assume C89. Add comments.
8708 * full-write.c: Include safe-write.h.
8709 (full_write): Rewritten to use safe_write.
8710 Suggested by Jim Meyering and Paul Eggert.
8712 2002-11-21 Bruno Haible <bruno@clisp.org>
8714 Remove case insensitive option matching.
8715 * argmatch.h (argcasematch): Remove declaration.
8716 (ARGCASEMATCH): Remove macro.
8717 (__xargmatch_internal): Remove case_sensitive argument.
8718 (XARGMATCH): Update.
8719 (XARGCASEMATCH): Remove macro.
8720 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8721 case_sensitive argument.
8722 (argcasematch): Remove function.
8723 (__xargmatch_internal): Remove case_sensitive argument.
8724 (main): Use XARGMATCH instead of XARGCASEMATCH.
8726 * xmalloc.c: Change compile-time error message. Add comment about
8727 required autoconf version.
8729 2002-11-21 Jim Meyering <jim@meyering.net>
8731 * strdup.c (strdup): Tweak comment and initial #if/#include.
8733 Merge in changes from the coreutils.
8735 2002-09-25 Paul Eggert <eggert@twinsun.com>
8736 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8737 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8738 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8739 int. Work more efficiently if X is the same width as uintmax_t.
8740 Do not compare X to -1, to avoid bogus compiler warning.
8741 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8742 Don't assume that f_frsize and f_bsize are the same type.
8744 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8747 * makepath.c (make_path): Restore umask *before* creating the final
8749 (make_path): Minor reformatting.
8751 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8752 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8754 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8755 ones. At least on GNU/Linux systems, `auto' means something else.
8758 2002-11-20 Paul Eggert <eggert@twinsun.com>
8760 Merge argmatch cleanups from Bison. Assume C89.
8762 * argmatch.c: Include config.h here, not in argmatch.h.
8763 Include stdlib.h, for EXIT_FAILURE.
8764 Always include <string.h>, since we assume C89.
8765 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8766 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8767 Include <stddef.h> instead, since it's all we need for size_t.
8768 (PARAMS): Remove. All uses removed.
8769 (ARRAY_CARDINALITY): Do not bother to #undef.
8770 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8771 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8772 Remove unnecessary parentheses.
8773 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8774 Insert necessary parentheses.
8775 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8776 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8778 2002-11-19 Bruno Haible <bruno@clisp.org>
8780 * mbswidth.c: Include mbswidth.h right at the beginning.
8781 * mbswidth.h: Include <stddef.h>, for size_t.
8783 * mbswidth.h (PARAMS): Remove macro.
8784 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8785 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8787 * gcd.h (PARAMS): Remove macro.
8788 (gcd): Use ANSI C function declarations.
8789 * gcd.c (gcd): Likewise.
8791 2002-11-15 Bruno Haible <bruno@clisp.org>
8793 * strcspn.c: Include <stddef.h>.
8794 (strcspn): Use ANSI C function declaration. Change return type to
8796 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8797 (strpbrk): Use NULL.
8798 * strpbrk.h (PARAMS): Remove macro.
8799 (strpbrk): Use ANSI C function declaration.
8800 * strstr.c: Don't include <sys/types.h>.
8801 * strstr.h (PARAMS): Remove macro.
8802 (strstr): Use ANSI C function declarations.
8804 2002-11-06 Bruno Haible <bruno@clisp.org>
8806 * gcd.h (gcd): Change argument type to 'unsigned long'.
8807 * gcd.c (gcd): Likewise.
8809 2002-11-05 Bruno Haible <bruno@clisp.org>
8811 * gcd.h: New file, from gettext-0.11.5.
8812 * gcd.c: New file, from gettext-0.11.5.
8814 2002-11-05 Bruno Haible <bruno@clisp.org>
8816 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8817 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8818 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8819 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8821 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8822 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8824 * closeout.c: Include gettext.h instead of <libintl.h>.
8825 * human.c: Include gettext.h instead of <libintl.h>.
8826 * quotearg.c: Include gettext.h instead of <libintl.h>.
8827 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8828 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8829 * userspec.c: Include gettext.h instead of <libintl.h>.
8830 * version-etc.c: Include gettext.h instead of <libintl.h>.
8831 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8832 (textdomain): Remove definition.
8833 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8835 * long-options.c: Remove include of <libintl.h> and definition of _.
8836 * same.c: Remove include of <libintl.h> and definition of _.
8838 2002-11-04 Bruno Haible <bruno@clisp.org>
8840 * stpcpy.h: New file, from GNU gettext-0.11.5.
8841 * strcase.h: New file, from GNU gettext-0.11.5.
8842 * strpbrk.h: New file, from GNU gettext-0.11.5.
8843 * strstr.h: New file, from GNU gettext-0.11.5.
8844 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8846 2002-05-09 Bruno Haible <bruno@clisp.org>
8848 * config.charset: Update for newest glibc. Add canonical names
8849 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8851 2002-05-09 Bruno Haible <bruno@clisp.org>
8853 * localcharset.c (get_charset_aliases): Add more Windows specific
8856 2002-05-08 Owen Taylor <otaylor@redhat.com>
8858 * config.charset: A few additions for Solaris.
8860 2001-12-05 Bruno Haible <bruno@clisp.org>
8862 * localcharset.c (locale_charset): Don't return an empty string.
8864 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8866 * config.charset: msdos in uk_UA uses CP1125.
8868 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8870 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8871 * localcharset.c (locale_charset): Declare as extern "C".
8873 2002-02-15 Bruno Haible <bruno@clisp.org>
8875 * config.charset [msdosdjgpp]: For Russian, use CP866.
8877 2002-02-11 Bruno Haible <bruno@clisp.org>
8879 * config.charset: Add support for NetBSD.
8881 2002-09-25 <karl@gnu.org>
8883 * strdup.c: copy from libc/string (via ../config/srclist*).
8884 * getopt*: copy from libc/posix.
8885 * gettext.h: copy from gettext.
8886 * .cppi-disable: add strdup.c, gettext.h.
8888 2002-07-01 Jim Meyering <meyering@lucent.com>
8890 * c-stack.c: Include sys/time.h.
8891 From Volker Borchert.
8893 2002-06-11 Paul Eggert <eggert@twinsun.com>
8895 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8896 New macro. Use it uniformly instead of
8897 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8898 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8899 reported by Vin Shelton.
8901 2002-06-22 Jim Meyering <meyering@lucent.com>
8903 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8904 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8906 2002-06-22 Paul Eggert <eggert@twinsun.com>
8908 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8909 Do not assume SA_SIGINFO behavior.
8910 Bug reported by Jim Meyering on NetBSD 1.5.2.
8912 2002-06-22 Jim Meyering <meyering@lucent.com>
8914 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8916 * exitfail.c, exitfail.h: Likewise.
8917 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8919 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8921 (EXTRA_DIST): Add fnmatch_loop.c.
8922 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8924 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8925 * fnmatch.c: Update from diffutils-2.8.2.
8926 * fnmatch_.h: New file. From diffutils-2.8.2.
8927 * fnmatch.h: Remove file.
8929 2002-06-18 Paul Eggert <eggert@twinsun.com>
8931 * file-type.h: Report an error if neither S_ISREG nor
8932 S_IFREG is defined, instead of using a test specific to glibc
8933 2.2. This should be safe, since POSIX requires S_ISREG and
8934 Unix Version 7 had S_IFREG. We don't need to check for
8935 <sys/types.h> since we don't use any symbols that it defines.
8937 2002-06-15 Jim Meyering <meyering@lucent.com>
8939 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8940 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8941 have been included before this file.
8943 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8945 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8946 so that each temporary file name is unique and valid in the first
8947 8 characters, for operation under DOS.
8949 2002-06-15 Jim Meyering <meyering@lucent.com>
8951 Work even with DJGPP 2.03, which lacks support for symlinks.
8953 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8955 * lchown.c (S_ISLNK): Likewise.
8957 2002-06-14 Jim Meyering <meyering@lucent.com>
8959 * file-type.h: Use the version from diffutils-2.8.2.
8960 * file-type.c: Likewise.
8962 2002-05-27 Jim Meyering <meyering@lucent.com>
8964 Fix a problem seen only on nonconforming systems whereby ls.c's
8965 use of localtime, and then of gettimeofday would cause trouble:
8966 the localtime call used to initialize rpl_gettimeofday's save
8967 mechanism would clobber ls's current local time information so
8968 that in any long listing the first file would always be listed
8969 with date 1970-01-01. Analysis by Volker Borchert.
8971 * gettimeofday.c (localtime): Undefine.
8972 (rpl_localtime): New function.
8974 2002-05-22 Jim Meyering <meyering@lucent.com>
8976 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8977 * file-type.h: New file.
8978 * file-type.c (file_type): New file/function. Extracted from diffutils.
8980 2002-04-29 Paul Eggert <eggert@twinsun.com>
8982 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8984 2002-04-28 Paul Eggert <eggert@twinsun.com>
8986 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8987 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8988 of 127, since 64 is the largest conceivable number for ancient
8990 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8992 2002-04-28 Jim Meyering <meyering@lucent.com>
8994 * sig2str.c (WTERMSIG): Remove definition (unused).
8996 2002-04-28 Paul Eggert <eggert@twinsun.com>
8998 * sig2str.h, sig2str.c: New files.
8999 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
9001 2002-04-24 Jim Meyering <meyering@lucent.com>
9003 * gettext.h: New file, from Gettext.
9004 * Makefile.am (INCLUDES): Remove -I../intl.
9005 (libfetish_a_SOURCES): Add gettext.h.
9007 2002-04-16 Jim Meyering <meyering@lucent.com>
9009 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
9010 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
9011 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
9013 2002-04-12 Jim Meyering <meyering@lucent.com>
9015 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
9017 2002-03-10 Jim Meyering <meyering@lucent.com>
9019 * makepath.c (make_path): Remove a comma from a diagnostic.
9020 Suggestion from Santiago Vila.
9022 2002-03-08 Jim Meyering <meyering@lucent.com>
9024 * rename.c: Mention that this wrapper is needed also on
9025 mips-dec-ultrix4.4 systems.
9027 2002-03-02 Jim Meyering <meyering@lucent.com>
9029 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
9030 not HAVE_CLOCK_SETTIME.
9032 2002-02-27 Paul Eggert <eggert@twinsun.com>
9034 * nanosleep.h: Rename to....
9035 * timespec.h: New name for nanosleep.h. All uses changed.
9037 * gettime.c: New file.
9038 * settime.c: New file.
9041 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
9042 timespec.h. Remove nanosleep.h.
9044 2002-02-25 Paul Eggert <eggert@twinsun.com>
9046 * acl.c, acl.h: New files.
9047 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
9049 2002-02-24 Jim Meyering <meyering@lucent.com>
9051 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
9052 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
9053 cause trouble. Reported by Nelson Beebe.
9055 2002-02-23 Paul Eggert <eggert@twinsun.com>
9057 * path-concat.c (xpath_concat): Reorder code to pacify
9058 compilers that don't know that xalloc_die never returns.
9060 2002-02-20 Jim Meyering <meyering@lucent.com>
9062 * getdate.c: Regenerate using bison-1.33.
9064 2002-02-15 Paul Eggert <eggert@twinsun.com>
9066 * posixver.c, posixver.h: New files.
9067 * Makefile.am (libfetish_a_SOURCES): Add them.
9069 2002-02-02 Paul Eggert <eggert@twinsun.com>
9070 Bruno Haible <bruno@clisp.org>
9072 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
9073 (fwrite_success_callback): New declaration.
9074 * unicodeio.c (unicode_to_mb): New function, extracted from
9075 print_unicode_char. Call failure callback instead of error.
9076 (fwrite_success_callback): New function.
9077 (exit_failure_callback): New function.
9078 (fallback_failure_callback): New function.
9079 (print_unicode_char): Call unicode_to_mb.
9081 2002-01-26 Jim Meyering <meyering@lucent.com>
9083 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
9085 2002-01-22 Jim Meyering <meyering@lucent.com>
9087 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
9088 Otherwise, some versions of automake would omit the rule that makes
9089 Makefile from Makefile.in.
9091 2001-01-21 Paul Eggert <eggert@twinsun.com>
9093 * xmemcoll.h, xmemcoll.c: New files.
9094 * Makefile.am (libfetish_a_SOURCES): Add them.
9095 * memcoll.c: Include errno.h, and declare errno if not defined.
9096 (memcoll): Set errno to zero if there is no error.
9098 * quotearg.c (quotearg_buffer_restyled):
9099 Fix bug with quoting buffers containing NUL when backslashing escapes.
9100 This bug was exposed by the other changes in this patch.
9101 (quotearg_n_options): New arg ARGSIZE.
9102 All callers changed.
9103 (quoting_options_from_style): New function.
9104 (quotearg_n_style): Use it.
9105 (quotearg_n_style_mem): New function.
9107 * quotearg.h (quotearg_n_style_mem): New function.
9109 2002-01-16 Jim Meyering <meyering@lucent.com>
9111 * getdate.y: Add three semicolons, each just before a closing brace.
9112 Bison (as of version 1.31) no longer papers over that mistake.
9114 2002-02-14 Paul Eggert <eggert@twinsun.com>
9116 * backupfile.c (ISDIGIT): Comment fix.
9117 * getdate.y (ISDIGIT): Likewise.
9118 * posixtm.c (ISDIGIT, year): Likewise.
9119 * strverscmp.c (ISDIGIT): Likewise.
9120 * userspec.c (ISDIGIT): Likewise.
9122 2002-01-05 Jim Meyering <meyering@lucent.com>
9124 * version-etc.c (version_etc_copyright): Update copyright year.
9126 2001-01-19 Paul Eggert <eggert@twinsun.com>
9128 * closeout.c (close_stdout_status): If ferror (stdout), do
9129 not silently exit merely because the output buffer happens to
9130 have nothing pending.
9132 2001-12-18 Paul Eggert <eggert@twinsun.com>
9134 See the big note in ../ChangeLog.
9135 * human.c (suffixes): Prefer K to k for 1024.
9136 (generate_suffix_backwards): New function.
9137 (human_readable_inexact): Use it.
9138 * xstrtol.c (__xstrtol): If there is no number but there
9139 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9140 Accept 'K' as well as 'k'.
9142 2001-12-15 Jim Meyering <meyering@lucent.com>
9144 * regex.h (__restrict_arr): Update from libc.
9146 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9147 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9150 2001-12-10 Jim Meyering <meyering@lucent.com>
9152 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9153 Instead, include "xalloc.h".
9154 (initbuffer): Don't cast xmalloc return value to char*.
9155 (readline): Reword comment.
9156 Don't cast xrealloc return value to char*
9159 2001-12-09 Jim Meyering <meyering@lucent.com>
9161 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9162 `signed and unsigned type in conditional expression'.
9163 * posixtm.c (posix_time_parse): Likewise.
9165 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9167 * readtokens.c (readtoken): Declare an index to be of type unsigned
9168 to avoid a pedantic warning.
9170 * getstr.c: Don't include assert.h.
9171 (getstr): Remove warning-evoking assertions.
9172 Return -1 if offset parameter is out of bounds.
9173 Change the type of a local from int to size_t.
9175 * strftime.c (my_strftime_localtime_r): Include this function
9176 definition in the `#if ! HAVE_TM_GMTOFF' block.
9178 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9179 Include xalloc.h instead.
9181 2001-12-02 Jim Meyering <meyering@lucent.com>
9183 * tempname.c: Don't declare getenv, thus reverting the change of
9184 2001-11-18. It's no longer necessary, now that stdlib.h is always
9187 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9188 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9190 2001-11-30 Akim Demaille <akim@epita.fr>
9192 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9193 before being defined.
9195 2001-11-27 Paul Eggert <eggert@twinsun.com>
9197 * quotearg.h (quotearg_n, quotearg_n_style):
9198 First arg is int, not unsigned.
9199 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9200 (SIZE_MAX, UINT_MAX): New macros.
9201 (quotearg_n_options): Abort if N is negative.
9202 Avoid overflow check on hosts where size_t is 64 bits and int
9203 is 32 bits, as overflow is impossible there.
9204 Fix off-by-one typo that caused unnecessary reallocation.
9206 2001-11-27 Jim Meyering <meyering@lucent.com>
9208 * tempname.c: Merge with version from libc.
9209 * regex.c: Likewise.
9211 * tempname.c: Include stdlib.h unconditionally. On some old systems
9212 for which STDC_HEADERS is 0, it was not included, resulting in a
9213 warning about an integer-to-pointer conversion problem with getenv.
9214 Reported by Volker Borchert.
9216 2001-11-26 Jim Meyering <meyering@lucent.com>
9218 * gtod.h: Remove file.
9219 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9220 * gettimeofday.c: Don't include gtod.h.
9221 (GTOD_init): Remove function.
9222 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9223 Suggestion from Volker Borchert.
9225 2001-11-23 Jim Meyering <meyering@lucent.com>
9227 * hash.h (struct hash_table): Don't define here. Merely declare it.
9228 * hash.c (struct hash_table): Define it here instead.
9230 2001-11-22 Jim Meyering <meyering@lucent.com>
9232 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9234 2001-11-18 Paul Eggert <eggert@twinsun.com>
9236 * tempname.c (TMP_MAX): Remove; no longer needed.
9237 (TEMPORARIES): New macro.
9238 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9239 removes an artificial limitation (e.g. HP-UX 10.20, where
9242 2001-11-18 Jim Meyering <meyering@lucent.com>
9244 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9247 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9248 files will be created before anything else.
9250 2001-11-17 Jim Meyering <meyering@lucent.com>
9252 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9253 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9254 rather than group writable. Patch by Juan F. Codagnone.
9256 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9257 Instead, include "xalloc.h".
9259 * mountlist.c: Include unlocked-io.h after all system headers.
9260 Remove explicit declarations of xmalloc, xrealloc,
9261 and xstrdup. Instead, include "xalloc.h".
9263 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9264 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9265 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9267 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9268 Reported by Padraig Brady.
9270 * mkstemp.c: #undef mkstemp.
9272 (rpl_mkstemp): Rename from mkstemp.
9275 2001-11-16 Jim Meyering <meyering@lucent.com>
9277 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9278 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9279 determine the amount of total physical memory, use pstat_getstatic.
9280 HPUX-11 doesn't define _SC_PHYS_PAGES.
9281 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9282 If sysconf couldn't be used to determine the amount of available
9283 physical memory, use both pstat_getstatic and pstat_getdynamic.
9284 Based on a patch from Bob Proulx.
9286 2001-11-05 Jim Meyering <meyering@lucent.com>
9288 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9290 2001-11-03 Jim Meyering <meyering@lucent.com>
9292 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9293 in argmatch_to_argument call.
9295 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9298 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9299 e.g., a fault due to an attempt to free a NULL pointer.
9301 2001-11-01 Jim Meyering <meyering@lucent.com>
9303 * dirfd.c, dirfd.h: New files.
9304 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9306 * hash.c (hash_print) [TESTING]: Clean up.
9308 2001-10-22 Paul Eggert <eggert@twinsun.com>
9310 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9311 to avoid a warning if -Wall.
9313 2001-10-21 Paul Eggert <eggert@twinsun.com>
9315 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9317 2001-10-21 Jim Meyering <meyering@lucent.com>
9319 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9320 this code would end up calling gettext even in packages built
9322 * getopt.c (_): Likewise.
9323 * regex.c (_): Likewise.
9325 2001-10-20 Paul Eggert <eggert@twinsun.com>
9327 * error.c (strerror_r): Do not declare unless !_LIBC.
9328 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9329 Use strerror_r that is only a macro, even if it is not a function.
9330 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9331 (private_strerror): Use prototypes, not old-style function definition.
9332 (print_errno_message): New function.
9333 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9335 (error_tail, error, error_at_line): Use it.
9337 2001-10-11 Jim Meyering <meyering@lucent.com>
9339 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9340 and quote_n (1, ... to avoid clobbering a buffer.
9342 2001-10-05 Jim Meyering <meyering@lucent.com>
9344 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9345 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9346 * hash-pjw.h: New file.
9348 2001-09-30 Jim Meyering <meyering@lucent.com>
9350 * mountlist.c [MOUNTED_GETFSSTAT]:
9351 Include <sys/ucred.h>, for Apple Darwin.
9352 Include sys/mount.h and sys/fs_types.h only if available.
9354 (read_filesystem_list): Use FS_TYPE.
9356 2001-09-29 Paul Eggert <eggert@twinsun.com>
9358 * exclude.c (excluded_filename): 0 -> false, since it's
9361 2001-09-28 Paul Eggert <eggert@twinsun.com>
9363 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9364 #defines strtoimax. Also treat the other strto* functions
9367 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9368 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9369 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9371 2001-09-26 Jim Meyering <meyering@lucent.com>
9373 Most macros in unlocked-io.h had the wrong number of arguments.
9374 * gen-uio: New script.
9375 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9376 * unlocked-io.hin: Remove file.
9377 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9378 rather than trying to embed it here.
9379 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9380 Reported by Padraig Brady.
9382 2001-09-25 Volker Borchert <bt@teknon.de>
9384 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9386 2001-09-23 Jim Meyering <meyering@lucent.com>
9388 * mountlist.c: Remove useless parentheses in #if directives.
9389 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9390 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9392 2001-09-22 Jim Meyering <meyering@lucent.com>
9394 * localcharset.c: Update from latest gettext.
9395 * config.charset: Likewise.
9397 2001-09-20 Jim Meyering <meyering@lucent.com>
9399 * xstrtol.c (strtoimax): Guard declaration with
9400 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9401 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9402 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9403 (strtoumax): Likewise, for completeness (it wasn't necessary).
9405 2001-09-06 Paul Eggert <eggert@twinsun.com>
9407 * strtoimax.c (HAVE_LONG_LONG):
9408 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9409 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9410 to work around bug in IBM C compiler.
9412 2001-09-16 Jim Meyering <meyering@lucent.com>
9414 * mkdir.c: New file.
9416 2001-09-04 Paul Eggert <eggert@twinsun.com>
9418 * xgetcwd.c: Revert some of the previous change; intead,
9419 fix the HAVE_GETCWD_NULL code to behave more like the
9420 !HAVE_GETCWD_NULL code used to.
9423 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9426 2001-09-04 Paul Eggert <eggert@twinsun.com>
9428 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9429 Use ssize_t, not int, to store result of readlink.
9430 Check for ssize_t overflow as well as size_t overflow,
9431 as POSIX says the result of readlink is implementation-defined
9432 when ssize_t overflows.
9433 Remove unnecessary cast to char*.
9434 Use free+malloc instead of realloc, as the storage doesn't need
9435 to be preserved and it's clearer and can be more efficient that way.
9436 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9437 * xreadlink.h (xreadlink): Update prototype.
9439 2001-09-03 Paul Eggert <eggert@twinsun.com>
9441 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9442 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9443 spotted by Jim Meyering.
9445 2001-09-03 Jim Meyering <meyering@lucent.com>
9447 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9449 2001-09-03 Paul Eggert <eggert@twinsun.com>
9451 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9452 like the HAVE_GETCWD_NULL code.
9453 Include pathmax.h if not HAVE_GETCWD.
9454 Do not include xalloc.h.
9455 (INITIAL_BUFFER_SIZE): New symbol.
9456 Do not use xmalloc / xrealloc, since the caller is responsible for
9457 handling errors. Preserve errno around `free' during failure.
9458 Do not overrun buffer when using getwd.
9460 2001-09-03 Paul Eggert <eggert@twinsun.com>
9462 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9463 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9465 2001-09-02 Jim Meyering <meyering@lucent.com>
9467 * error.c: Update from GNU libc.
9469 2001-09-01 Jim Meyering <meyering@lucent.com>
9471 * xreadlink.c: New file.
9472 * xreadlink.h: New file.
9473 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9475 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9476 doesn't conflict with sparc Solaris 7's definition in
9477 /usr/include/sys/int_types.h.
9479 * exclude.c: Use `""', not `<>' to #include non-system header files.
9480 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9481 and strncasecmp as r-values. Unixware didn't have declarations.
9483 2001-08-31 Jim Meyering <meyering@lucent.com>
9485 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9486 Use an initial, malloc'd, buffer of length 128 rather than
9487 a statically allocated one of length 1024.
9489 2001-08-30 Paul Eggert <eggert@twinsun.com>
9491 * xgetcwd.c: Don't include pathmax.h.
9492 Include stdlib.h and unistd.h if available.
9494 (xmalloc, xstrdup, free): Remove decls.
9495 (xgetcwd): Don't assume sizes fit in unsigned.
9496 Check for overflow when computing sizes.
9497 Simplify reallocation code.
9499 2001-08-28 Paul Eggert <eggert@twinsun.com>
9501 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9503 * strtoimax.c: Renamed from strtoxmax.c, removing the
9506 Also, make the following further changes to make this file's
9507 configuration more similar to that of strtol.c:
9508 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9509 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9510 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9511 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9512 changed to signed values.
9514 And make the following changes as well:
9515 Fix copyright notice, as 1999 was missing.
9516 (verify): New macro.
9517 (strtoimax): Check sizes at compile-time, not run-time.
9518 Prefer strtol to strtoll if both work.
9519 (main): Remove; it was not that useful and was a pain to maintain.
9521 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9523 2001-08-30 Paul Eggert <eggert@twinsun.com>
9525 * savedir.c (savedir): Remove size parameter, as POSIX says that
9526 a directory's st_size can have an arbitrary value, so the old
9527 usage could waste an arbitrary amount of memory. All uses
9529 * savedir.h: Update prototype.
9531 2001-08-30 Paul Eggert <eggert@twinsun.com>
9533 * xstrtol.c (strtoimax): New decl.
9535 2001-08-28 Paul Eggert <eggert@twinsun.com>
9537 * xstrtol.h: Add copyright notice.
9538 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9539 LONGINT_INVALID_SUFFIX_CHAR.
9541 2001-08-30 Paul Eggert <eggert@twinsun.com>
9543 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9546 2001-08-30 Paul Eggert <eggert@twinsun.com>
9548 * hash.c: Remove '2001' from copyright notice.
9550 2001-08-30 Paul Eggert <eggert@twinsun.com>
9552 * full-write.h: New file.
9553 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9554 * full-write.c: Correct credits, as cccp.c no longer
9555 exists and anyway it was so heavily changed from the old cccp
9556 code as to be unrecognizable. Include full-write.h.
9557 (full_write) Return size_t, with short writes meaning failure.
9558 All callers changed. This fixes a bug with large buffers
9560 * utime.c: Include full-write.h.
9562 2001-08-30 Paul Eggert <eggert@twinsun.com>
9564 Merge 'exclude' changes from tar 1.13.22.
9565 This fixes one or two unlikely storage allocation overflow bugs,
9566 but doesn't change user-visible behavior otherwise.
9568 2001-08-30 Paul Eggert <eggert@twinsun.com>
9570 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9571 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9572 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9573 Include if available.
9574 (<xalloc.h>): Include
9575 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9576 (verify): New macro. Use it to verify that EXCLUDE macros do not
9577 collide with FNM macros.
9578 (struct patopts): New struct.
9579 (struct exclude): Use it, as exclude patterns now come with options.
9580 (new_exclude): Support above changes.
9581 (new_exclude, add_exclude_file):
9582 Initial size must now be a power of two to simplify overflow checking.
9583 (free_exclude, fnmatch_no_wildcards): New function.
9584 (excluded_filename): No longer requires options arg, as the options
9585 are determined by add_exclude. Now returns bool, not int.
9586 (excluded_filename, add_exclude):
9587 Add support for the fancy new exclusion options.
9588 (add_exclude, add_exclude_file): Now takes int options arg.
9589 Check for arithmetic overflow when computing sizes.
9590 (add_exclude_file): xrealloc might modify errno, so don't
9591 realloc until after errno might be used.
9593 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9595 (free_exclude): New decl.
9596 (add_exclude, add_exclude_file): Now takes int options arg.
9597 (excluded_filename): No longer requires options arg, as the options
9598 are determined by add_exclude. Now returns bool, not int.
9600 2001-08-30 Paul Eggert <eggert@twinsun.com>
9602 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9604 2001-08-27 Jim Meyering <meyering@lucent.com>
9606 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9608 * version-etc.c (N_): Remove definition.
9609 Revert most of last change.
9610 Instead, simply don't mark the `Copyright...' string for translation.
9611 Based on advice from Paul Eggert.
9613 * strtoxmax.c: Tweak comment.
9615 2001-08-26 Jim Meyering <meyering@lucent.com>
9617 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9618 of copyright with `%s' so translators don't get an untranslated
9620 (COPYRIGHT_YEAR): Define.
9621 (version_etc): Use fprintf rather than fputs.
9622 Suggestion from Ulrich Drepper.
9624 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9626 * strtoll.c: New file, from GNU libc.
9627 * xstrtoimax.c: New file.
9629 * xstrtol.h: Add xstrtoimax.
9630 * strtoumax.c: New file. Simply include "strtoumax.c".
9631 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9633 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9634 * strtoxmax.c: ... then renamed to this.
9636 2001-08-13 Paul Eggert <eggert@twinsun.com>
9638 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9639 Port to Solaris 8, where 'sed' requires a space after the 'r'
9640 command, and where sh dislikes "$/". Clean up the spacing a bit.
9641 Redirect output to $tmp just once.
9643 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9645 * addext.c (<errno.h>): Include.
9646 (errno): Declare if not defined.
9647 (addext): Work correctly when pathconf returns -1 and leaves
9648 errno alone because there is no limit. Also, work even if
9649 pathconf returns a value greater than SIZE_MAX.
9651 2001-08-12 Jim Meyering <meyering@lucent.com>
9653 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9654 Simply `return getcwd (NULL, 0);'.
9655 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9656 Use 1300 as initial value for length, not PATH_MAX.
9658 * pathmax.h: Clean up cpp syntax.
9660 2001-08-12 Jim Meyering <meyering@lucent.com>
9662 * gettimeofday.c: New file.
9664 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9666 2001-08-04 Jim Meyering <meyering@lucent.com>
9668 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9669 to get in sync with glibc.
9671 2001-08-03 Paul Eggert <eggert@twinsun.com>
9673 The following changes are from gettext 0.10.39 as maintained by
9676 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9677 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9678 with inverted sense. All uses changed.
9680 * mbswidth.c: Don't include <limits.h>.
9681 Include <stdlib.h> and <string.h> unconditionally.
9682 (iswcntrl, mbsinit, ISCNTRL): New macros.
9683 (mbsnwidth): Use K&R style function declarations.
9684 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9685 can optimize it when MB_CUR_MAX == 1.
9686 The width of control characters is zero, not 1.
9688 2001-07-15 Jim Meyering <meyering@lucent.com>
9690 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9691 (BUILT_SOURCES): Add unlocked-io.h.
9692 (io_functions): Define.
9693 (unlocked-io.h): New rule.
9694 (DISTCLEANFILES): Add unlocked-io.h.
9695 (all-local): Depend on unlocked-io.h, to ensure it is created.
9697 * unlocked-io.hin: New file
9699 * regex.c: Update from glibc.
9701 2001-07-05 Jim Meyering <meyering@lucent.com>
9703 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9705 (libfetish_a_SOURCES): Put all .h files here instead.
9706 Remove a thus-exposed (better checks in automake) duplicate and
9707 two unnecessary .h files.
9709 2001-06-11 Jim Meyering <meyering@lucent.com>
9711 * regex.c: Update from GNU libc.
9713 2001-05-27 Jim Meyering <meyering@lucent.com>
9715 * readutmp.h (UT_TYPE): Define.
9717 2001-05-24 Jim Meyering <meyering@lucent.com>
9719 * argmatch.c: Include "quote.h".
9720 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9721 quote function. Reported by Göran Uddeborg.
9723 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9725 * dirname.c (dir_name): Compute append_dot using path, not newpath
9726 which is not yet declared.
9728 2001-05-11 Paul Eggert <eggert@twinsun.com>
9730 * Makefile.am (libfetish_a_SOURCES):
9731 Add strftime.c, since we now compile it on all hosts.
9733 * strftime.c (my_strftime):
9734 Define to nstrftime if emacs, but only if my_strftime is not defined.
9735 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9736 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9737 Add one more extra argument: a nanoseconds value.
9740 (my_strftime function): Add %N format.
9741 (emacs_strftimeu): Renamed from emacs_strftime,
9742 with extra ut argument.
9744 2001-05-11 Paul Eggert <eggert@twinsun.com>
9746 dirname code cleanup. base_name now behaves more compatibly
9747 with POSIX basename when given file names that have trailing
9748 slashes, and similarly for dir_name. Add new primitives
9749 base_len and dir_len. Put the directory-name-related decls
9752 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9753 * backupfile.c (base_name): Likewise.
9754 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9755 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9756 * makepath.c (strip_trailing_slashes): Likewise.
9757 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9759 * rename.c (strip_trailing_slashes): Likewise.
9760 * same.c (base_name): Likewise.
9761 * stripslash.c (ISSLASH): Likewise.
9763 * addext.c: Include <dirname.h> after size_t is defined.
9764 * backupfile.c: Likewise.
9766 * addext.c (addext): Use base_len to trim redundant
9767 trailing slashes instead of doing it ourselves.
9768 But do not trim the last slash if it is not redundant.
9770 * backupfile.c (find_backup_file_name,
9771 max_backup_version): Use base_len instead of rolling it ourselves.
9772 Handle the case of "" and (on DOS) "C:" correctly.
9774 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9775 Include <string.h>, <dirname.h>.
9776 (base_name): Allow file names ending in slashes, other than names
9777 that are all slashes. In this case, return the basename followed
9778 by the slashes. This is more general, and can be used in places
9779 where the original base_name purposely had an assertion failure.
9780 (base_len): New function.
9782 * dirname.c: Include <string.h> instead of <stdlib.h>.
9783 Do not include <assert.h>; no longer needed.
9785 (memrchr): Remove decl.
9786 (dir_name_r): Remove.
9787 (dir_len): Renamed from dirlen. All callers changed.
9788 Rewrite in terms of base_name, for simplicity and consistency.
9789 (dir_name): Never return NULL. All callers changed.
9790 Do not include <stdlib.h> in test program; no longer needed.
9791 return 0; is fine for test program.
9793 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9795 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9797 * path-concat.c (path_concat): Use base_len to compute
9798 base length, not strlen; this means we cannot rely on memcpy
9801 * same.c (STREQ): Remove.
9802 (same_name): Handle the case where the basename ends in trailing '/'.
9804 * stripslash.c (strip_trailing_slashes): Return nonzero if
9805 a slash was stripped. Do not strip the last slash after a
9808 2001-04-08 Jim Meyering <meyering@lucent.com>
9810 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9811 recomputed; that's necessary when the offset spans a DST transition.
9812 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9814 2001-04-02 Jim Meyering <meyering@lucent.com>
9816 * regex.h, regex.c: Update from GNU libc.
9818 2001-03-19 Paul Eggert <eggert@twinsun.com>
9820 * version-etc.c (version_etc_copyright): Update to 2001.
9822 2001-03-16 Paul Eggert <eggert@twinsun.com>
9824 * tempname.c (uint64_t): Define to uintmax_t if
9825 not defined, and if UINT64_MAX is not defined.
9826 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9827 Reported by John David Anglin.
9829 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9831 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9832 alias if codeset is empty.
9833 * config.charset (BeOS): Use wildcard syntax.
9835 2001-03-13 Jim Meyering <meyering@lucent.com>
9837 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9838 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9841 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9843 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9845 * unicodeio.c (print_unicode_char): Simplify accordingly.
9847 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9849 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9850 support for DOS/DJGPP.
9852 2001-02-28 Paul Eggert <eggert@twinsun.com>
9854 * Makefile.am (libfetish_a_SOURCES):
9855 Add dup-safer.c, fopen-safer.c.
9856 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9858 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9860 2001-02-25 Paul Eggert <eggert@twinsun.com>
9862 The mkstemp replacement is taken from glibc 2.2.2, with some
9863 portability fixes for use outside glibc, as follows:
9865 * tempname.c (struct_stat64): New macro.
9866 (direxists, __gen_tempname): Use it.
9867 This avoids a portability problem with Solaris 8.
9869 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9870 (<stddef.h>, <stdint.h>, <string.h>):
9871 Include only if STDC_HEADERS || _LIBC.
9872 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9873 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9874 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9875 (__set_errno): Define this macro if <errno.h> doesn't.
9876 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9877 Define these macros if <stdio.h> doesn't.
9878 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9879 Define these macros if <sys/stat.h>
9880 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9881 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9882 __xstat64): Define if not _LIBC.
9883 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9884 (__gen_tempname): Invoke gettimeofday only if
9885 HAVE_GETTIMEOFDAY || _LIBC;
9886 otherwise, fall back on plain "time".
9887 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9889 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9891 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9893 2001-02-17 Jim Meyering <meyering@lucent.com>
9895 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9896 around included file name.
9898 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9900 * strftime.c: Update from GNU libc (the only changes were to comments).
9902 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9904 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9906 2001-02-17 Paul Eggert <eggert@twinsun.com>
9908 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9909 Remove workaround macros for hosts that have mbrtowc but not
9910 mbstate_t, as we now insist on proper declarations for both
9911 before using mbrtowc.
9913 2001-02-17 Jim Meyering <meyering@lucent.com>
9915 * regex.c: Update from libc.
9917 2001-02-16 Paul Eggert <eggert@twinsun.com>
9919 * alloca.c (malloc): Undef before defining, since stdlib.h
9920 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9921 Reported by Mark Hounschell via Paul Eggert.
9923 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9925 * config.charset: Update for FreeBSD 4.2.
9927 2001-01-26 Jim Meyering <meyering@lucent.com>
9929 * quotearg.c: Include stddef.h.
9930 * quote.c: Include stddef.h.
9931 Reported by Axel Kittenberger.
9933 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9934 line in double quotes so that it evokes a better diagnostic.
9935 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9936 Reported by Axel Kittenberger.
9938 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9940 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9941 to avoid a warning. Add back 'const' to inptr.
9943 2001-01-16 Jim Meyering <meyering@lucent.com>
9945 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9948 2001-01-14 Jim Meyering <meyering@lucent.com>
9950 * rename.c: New file. From Volker Borchert.
9951 Include stdlib.h, string.h or strings.h, and xalloc.h.
9952 Use strip_trailing_slashes rather than open-coding it.
9954 2001-01-03 Paul Eggert <eggert@twinsun.com>
9956 * strftime.c: Sync with glibc time/strftime.c 1.81.
9958 2001-01-03 Jim Meyering <meyering@lucent.com>
9960 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9961 local `inptr' to avoid warning with some system declarations of iconv.
9963 2000-12-29 Paul Eggert <eggert@twinsun.com>
9965 * modechange.c: Do not assume that mode_t uses the
9966 traditional octal encoding. E.g. "chmod 1 FOO" should set
9967 the other-execute bit of FOO even if S_IXOTH != 1.
9969 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9970 WOTH, XOTH, ALLM): New macros.
9971 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9972 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9974 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9975 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9977 No need to use uintmax_t; unsigned long is long enough.
9978 Don't bother to get suffix since we don't use it.
9980 2000-12-24 Jim Meyering <meyering@lucent.com>
9982 * hash.c (is_prime): Return explicit boolean values.
9983 (hash_get_first): Return NULL to appease Irix5.6's 89.
9984 Reported by Nelson Beebe.
9986 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9988 * localcharset.c (locale_charset): Add support for Win32.
9990 2000-12-18 Paul Eggert <eggert@twinsun.com>
9992 * physmem.h, physmem.c: New files.
9994 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9995 (noinst_HEADERS): Add physmem.h.
9997 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9998 't' for compatibility with Solaris 8 sort.
10000 2000-12-18 Bruno Haible <haible@clisp.cons.org>
10002 * config.charset: Add support for BeOS.
10004 2000-12-16 Jim Meyering <meyering@lucent.com>
10006 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
10007 SHELLS_FILE to a file name that's useful on djgpp systems.
10009 (ADDITIONAL_DEFAULT_SHELLS): Define.
10010 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
10011 Based mostly on a patch from Prashant TR.
10013 2000-12-16 Jim Meyering <meyering@lucent.com>
10015 This bug had a serious impact on chown: `chown N:M FILE' (for integer
10016 N and M) would have treated it like `chown N:N FILE'.
10018 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
10020 2000-10-31 Bruno Haible <haible@clisp.cons.org>
10022 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
10023 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
10024 to the list of canonical encodings. Rename EUC-CN to GB2312.
10026 2000-12-08 Andreas Schwab <schwab@suse.de>
10028 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
10029 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
10031 2000-12-07 Jim Meyering <meyering@lucent.com>
10033 * stripslash.c (ISSLASH): Define.
10034 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
10037 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
10038 (dir_name_r): Declare this function as static.
10039 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
10040 manifest itself on a name containing a mix of slashes and
10042 Make this function work with names starting with a DOS-style
10043 drive letter and colon prefix.
10044 (dir_name): Append `.' if necessary.
10045 Based mostly on patches from Prashant TR and Eli Zaretskii.
10047 * dirname.h (dir_name_r): Remove prototype.
10049 2000-12-05 Jim Meyering <meyering@lucent.com>
10051 * dirname.c (dir_name_r): Add `const' in a few local declarations.
10053 2000-12-04 Jim Meyering <meyering@lucent.com>
10055 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
10056 Also include memory.h, stdlib.h, unistd.h if appropriate.
10057 Reported by Andreas Jaeger (conflicting declaration of malloc).
10059 2000-12-02 Jim Meyering <meyering@lucent.com>
10061 * closeout.h: Make idempotent, to avoid some obscure warnings.
10063 2000-12-01 Paul Eggert <eggert@twinsun.com>
10065 * memrchr.c: Include <config.h> before any system include file.
10067 2000-11-29 Paul Eggert <eggert@twinsun.com>
10069 * dirname.c (dir_name_r): Fix typo: int -> size_t.
10071 2000-11-26 Jim Meyering <meyering@lucent.com>
10073 * memcoll.c: Include sys/types.h. From Werner Almesberger.
10075 2000-11-22 Paul Eggert <eggert@twinsun.com>
10077 * strftime.c (my_strftime): Do not invoke mbrlen with a
10078 size of (size_t) -1; it's not portable.
10080 2000-11-17 Akim Demaille <akim@epita.fr>
10082 * obstack.h: Formatting changes.
10083 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
10084 prevent type checking.
10085 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10086 cast the value to (void *): assigning a `foo *' to a `void *'
10088 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10090 2000-11-17 Jim Meyering <meyering@lucent.com>
10092 * strstr.c: Update from GNU libc.
10094 2000-11-16 Jim Meyering <meyering@lucent.com>
10096 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
10098 2000-11-11 Jim Meyering <meyering@lucent.com>
10100 * error.c: Add a couple #includes, merging from GNU libc version.
10102 2000-11-10 Jim Meyering <meyering@lucent.com>
10104 * obstack.h: Update from GNU libc.
10105 * obstack.c: Likewise.
10107 2000-11-06 Paul Eggert <eggert@twinsun.com>
10109 * getusershell.c (setusershell): Use rewind rather than
10110 fseek/fseeko, to avoid configuration hassles with fseeko.
10111 Don't bother opening SHELLS_FILE if shellstream is NULL;
10112 it's not necessary.
10114 2000-11-05 Jim Meyering <meyering@lucent.com>
10116 * makepath.h (make_dir): Declare.
10117 * makepath.c (make_dir): Remove `static' attribute.
10120 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10122 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10123 last one in a bucket, advance to the next bucket.
10125 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10127 * fnmatch.c: Do not comment out all the code if we are using
10128 the GNU C library, because in some cases we are replacing buggy
10129 code in the GNU C library itself.
10131 2000-10-30 Paul Eggert <eggert@twinsun.com>
10133 * error.h, getline.h, modechange.h:
10134 Remove "2000" from Copyright line, as the file hasn't been
10135 changed this year other than in the copyright notice.
10137 * xalloc.h: Add "2000" to Copyright line, as this file
10138 was changed this year.
10140 2000-10-30 Paul Eggert <eggert@twinsun.com>
10142 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10143 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10144 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10146 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10148 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10149 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10150 doesn't define __restrict_arr.
10152 2000-10-29 Jim Meyering <meyering@lucent.com>
10154 * xstat.in: Fix grammar in comment.
10156 2000-10-28 Jim Meyering <meyering@lucent.com>
10158 * memchr.c: Update from libc.
10159 Adjust for portability:
10160 [HAVE_STDLIB_H]: Include stdlib.h.
10161 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10162 Undef __memchr, too.
10163 [!weak_alias]: Define __memchr to memchr.
10165 * regex.c: Update from libc.
10166 * regex.h: Likewise.
10167 * getopt1.c: Likewise.
10168 * memcmp.c: Likewise.
10170 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10171 Avoid using fseek, when possible -- it's broken by design.
10172 Patch by Ulrich Drepper.
10174 2000-10-26 Jim Meyering <meyering@lucent.com>
10176 * strftime.c: Update from libc.
10178 2000-10-25 Jim Meyering <meyering@lucent.com>
10180 * obstack.c: Update from libc.
10182 2000-10-23 Jim Meyering <meyering@lucent.com>
10184 * hard-locale.c (hard_locale): Revert last change -- it was simply
10185 wrong. That set_locale call must not have any side effects.
10188 2000-10-22 Jim Meyering <meyering@lucent.com>
10190 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10191 [CYCLIC]: Remove now-unused definition.
10193 * save-cwd.c (O_DIRECTORY): Define, if needed.
10194 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10195 Suggestion from Ulrich Drepper.
10197 2000-10-21 Jim Meyering <meyering@lucent.com>
10199 * dirname.c (dir_name_r): New function, factored out of dir_name.
10200 (dir_name): Use dir_name_r.
10201 * dirname.h (dir_name_r): Declare it.
10203 2000-10-21 Jim Meyering <meyering@lucent.com>
10205 * dirname.c (memrchr): Declare if necessary.
10206 (dir_name): Remove the restriction that there be no
10207 trailing slashes. Now, this code skips past them, effectively
10209 [TEST_DIRNAME] (main): New unit tests.
10211 * memrchr.c: New file from GNU libc.
10212 Undef __memrchr, too.
10213 [!weak_alias]: Define __memrchr to memrchr.
10214 Guard weak_alias use with `#ifdef weak_alias'.
10216 2000-10-17 Jim Meyering <meyering@lucent.com>
10218 * quote.h (PARAMS): Define and use.
10219 Reported by Akim Demaille.
10221 * getopt.c: Update from libc.
10223 2000-10-16 Jim Meyering <meyering@lucent.com>
10225 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10228 2000-09-25 Jim Meyering <meyering@lucent.com>
10230 * md5.h (rol): Define (from GnuPG).
10232 * sha.c: Give credit (GnuPG) where due.
10233 (M): Use rol rather than open-coding it.
10234 Add a FIXME comment.
10236 2000-09-21 Jim Meyering <meyering@lucent.com>
10238 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10239 Reported by Michael Stone.
10241 2000-09-20 Jim Meyering <meyering@lucent.com>
10243 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10244 (noinst_HEADERS): Add sha.h.
10245 Based on code from Scott G. Miller and from GnuPG.
10247 2000-09-15 Jim Meyering <meyering@lucent.com>
10249 * regex.c: Update from libc.
10251 2000-09-10 Jim Meyering <meyering@lucent.com>
10253 * getopt.c (_getopt_internal): Update from glibc.
10255 2000-09-09 Jim Meyering <meyering@lucent.com>
10257 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10258 think it should be used as a general replacement for isascii.
10259 * fnmatch.c: Likewise.
10260 * mbswidth.c: Likewise
10261 * regex.c: Likewise.
10264 * userspec.c: Include sys/param.h and limits.h.
10266 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10267 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10268 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10269 UID, GID. Check range.
10271 2000-09-06 Jim Meyering <meyering@lucent.com>
10273 * getopt.c (_getopt_internal): Update from glibc.
10275 2000-08-30 Jim Meyering <meyering@lucent.com>
10277 * strftime.c: Merge in changes from GNU libc.
10279 2000-08-26 Jim Meyering <meyering@lucent.com>
10281 * closeout.c: Include "__fpending.h".
10282 (close_stdout_status): Return right away if there's nothing to flush.
10284 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10285 * __fpending.c: New file.
10286 * __fpending.h: New file.
10288 2000-08-07 Paul Eggert <eggert@twinsun.com>
10290 Standardize on "memory exhausted" instead of "Memory exhausted"
10291 or "virtual memory exhausted".
10292 * obstack.c (print_and_abort): Use "memory exhausted", not
10293 "virtual memory exhausted".
10294 * same.c (same_name): Invoke xalloc_die instead of printing
10296 * userspec.c (parse_user_spec): Likewise.
10297 * bumpalloc.h: comment fix
10298 * same.c, userspec.c: Include xalloc.h.
10300 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10301 not char *const and pointing to a constant array.
10302 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10303 (xrealloc): Comment fix.
10305 * userspec.c (parse_user_spec):
10306 Don't translate a message until just before returning,
10307 to avoid unnecessary translation.
10309 2000-08-07 Jim Meyering <meyering@lucent.com>
10311 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10312 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10313 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10314 getgroups.c, gethostname.c, getopt.h, group-member.c,
10315 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10316 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10317 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10318 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10319 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10320 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10321 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10322 yesno.c: Back out Copyright date changes for each file with no change
10323 this year. This eases coordination with other programs using the same
10324 source code modules. From Paul Eggert.
10326 2000-08-03 Greg McGary <greg@mcgary.org>
10328 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10329 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10330 (EXTEND_BUFFER): Use them.
10332 2000-08-01 Jim Meyering <meyering@lucent.com>
10334 * dirname.c (ISSLASH): Define.
10335 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10336 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10337 both `\' and `/' may be use as path separators.
10338 Based on a patch from Prashant TR.
10340 2000-07-31 Paul Eggert <eggert@twinsun.com>
10342 * quotearg.c (quotearg_n_options): Don't make the initial
10343 slot vector a constant, since it might get modified.
10345 2000-07-31 Jim Meyering <meyering@lucent.com>
10347 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10348 * obstack.c (print_and_abort): Likewise.
10350 2000-07-30 Paul Eggert <eggert@twinsun.com>
10352 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10353 buffer, so that the caller can always quote one small
10354 component of a "memory exhausted" message in slot 0.
10355 From a suggestion by Jim Meyering.
10357 2000-07-30 Jim Meyering <meyering@lucent.com>
10359 * makepath.c (make_path): Quote the other instance, too.
10361 * quotearg.c (N_STATIC_SLOTVECS): Define.
10362 (STATIC_BUF_SIZE): Define.
10363 (quotearg_n_options): Use only statically allocated storage when
10364 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10365 than STATIC_BUF_SIZE.
10367 2000-07-29 Jim Meyering <meyering@lucent.com>
10369 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10370 * dirname.c (dir_name): Likewise.
10372 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10374 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10375 (dir_name): Assert that there are no trailing slashes.
10377 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10379 * mbswidth.h (mbswidth): Add a flags argument.
10380 (mbswidth): New declaration.
10381 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10382 * mbswidth.c (mbswidth): Add a flags argument.
10383 (mbsnwidth): New function.
10385 2000-07-24 Jim Meyering <meyering@lucent.com>
10387 * mbswidth.c: Remove useless #else. From Bruno Haible.
10389 2000-07-23 Paul Eggert <eggert@twinsun.com>
10391 * mbswidth.c (_XOPEN_SOURCE):
10392 Don't define; this causes problems on Solaris 7.
10393 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10395 2000-07-23 Paul Eggert <eggert@twinsun.com>
10398 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10399 so that mbstate_t is always defined.
10401 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10402 be 1 in at least one GCC installation, and this configuration
10403 error is likely to be common. Ignoring MB_LEN_MAX hurts
10404 performance on hosts that have mbrtowc but have only unibyte
10405 locales, but I assume these hosts are rare.
10407 2000-07-23 Paul Eggert <eggert@twinsun.com>
10409 * quotearg.c: Streamline by invoking multibyte code only if needed.
10410 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10411 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10412 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10413 invoke multibyte primitives.
10415 2000-07-23 Jim Meyering <meyering@lucent.com>
10417 * basename.c (base_name): Add an assertion.
10419 2000-07-15 Bruno Haible <clisp.cons.org>
10421 * quotearg.c: When the system forces us to redefine mbstate_t,
10422 shadow its mbsinit function.
10424 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10426 * mbswidth.h: New file.
10427 * mbswidth.c: New file.
10428 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10429 (noinst_HEADERS): Add mbswidth.h.
10431 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10433 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10436 2000-07-15 Jim Meyering <meyering@lucent.com>
10438 * makepath.c: Include quote.h.
10439 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10440 corresponding argument in a `quote (...)' call.
10441 Give better diagnostics.
10443 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10444 (noinst_HEADERS): Add quote.h.
10446 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10447 from tar's src/misc.c.
10448 * quote.h: New file. Prototypes for same.
10450 2000-07-10 Paul Eggert <eggert@twinsun.com>
10452 From a suggestion by Bruno Haible.
10453 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10454 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10455 to decide whether to define the BeOS workaround macro;
10456 this adjusts to the change to AC_MBSTATE_T.
10458 2000-07-13 Paul Eggert <eggert@twinsun.com>
10460 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10462 * quotearg.c (quoting_style_args, quoting_style_vals,
10463 quotearg_buffer_restyled): Add support for
10464 clocale_quoting_style. Undo previous change to
10465 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10466 and "{RIGHT QUOTATION MARK}" msgids.
10468 2000-07-05 Paul Eggert <eggert@twinsun.com>
10470 The old behavior of quoting `like this' doesn't look good with
10471 newer, ISO-style fonts. See:
10472 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10474 Instead, quote "like this" by default. Let the translator
10475 tailor the locale-specific quoting behavior by providing
10476 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10478 * quotearg.c (N_): New macro.
10479 (gettext_default): New function.
10480 (quotearg_buffer_restyled): Use
10481 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10482 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10484 2000-07-09 Jim Meyering <meyering@lucent.com>
10486 * Most files: Update copyright dates to include 2000.
10488 2000-07-08 Jim Meyering <meyering@lucent.com>
10490 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10492 (xgethostname): Remove now-unnecessary #ifdef.
10493 Move declaration of `err' into loop where it's used.
10495 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10497 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10498 by allocating a larger buffer. Test the gethostname return value for
10499 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10500 returns an error and ENAMETOOLONG isn't defined.
10502 2000-07-05 Paul Eggert <eggert@twinsun.com>
10503 and Bruno Haible <haible@clisp.cons.org>
10505 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10507 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10509 * quotearg.c (struct quoting_options): Simplify quote_these_too
10512 2000-07-03 Jim Meyering <meyering@lucent.com>
10514 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10515 Reported by Bruno Haible.
10517 2000-07-04 Jim Meyering <meyering@lucent.com>
10519 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10520 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10523 2000-07-03 Paul Eggert <eggert@twinsun.com>
10524 and Bruno Haible <haible@clisp.cons.org>
10526 * quotearg.c (mbrtowc):
10527 Assign to *pwc, and return 1 only if result is nonzero.
10528 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10530 2000-07-03 Jim Meyering <meyering@lucent.com>
10532 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10533 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10536 2000-07-02 Jim Meyering <meyering@lucent.com>
10538 * quotearg.c (mbstate_t): Don't define here.
10540 2000-07-02 Jim Meyering <meyering@lucent.com>
10542 * nanosleep.c (SIGCONT): Define if not already defined.
10544 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10546 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10547 per change in ../m4/ls-mntd-fs.m4.
10548 (read_filesystem_list): Ignore symbolic links.
10550 2000-06-29 Jim Meyering <meyering@lucent.com>
10552 * same.c: Include <string.h> or <strings.h>, as appropriate,
10553 for declaration of strcmp.
10555 * long-options.c: Include <stdlib.h>, for declaration of exit.
10557 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10558 Avoid warning by casting result to `char *' to remove `const'.
10560 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10562 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10564 2000-06-26 Paul Eggert <eggert@twinsun.com>
10566 savedir now sets errno on failure and invokes xmalloc to get memory.
10567 Fix a couple of other minor bugs while we're at it.
10569 * savedir.c (<unistd.h>): Do not include; there's no need.
10570 (NAMLEN): Remove macro.
10571 (malloc, realloc): Remove decls.
10572 (stpcpy): Likewise.
10573 ("xalloc.h"): Include.
10574 (NAME_SIZE_DEFAULT): New macro.
10575 (savedir): Use xmalloc / xrealloc to allocate memory.
10576 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10577 Skip "" directory entries.
10578 Use strlen to calculate directory entry length, since the old method
10579 is rarely used these days and isn't worth supporting.
10580 Don't use a pointer after freeing it.
10581 Check for integer overflow when calculating allocation size.
10582 Use memcpy to copy entries, instead of stpcpy.
10583 Set errno properly when returning NULL.
10584 Check for readdir error.
10586 2000-06-26 Jim Meyering <meyering@lucent.com>
10588 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10590 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10592 * getusershell.c (xmalloc, xrealloc): Remove functions.
10594 Don't include <stdlib.h>. Don't declare malloc, realloc.
10596 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10598 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10600 2000-06-24 Jim Meyering <meyering@lucent.com>
10602 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10604 2000-06-21 Jim Meyering <meyering@lucent.com>
10606 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10608 2000-06-19 Paul Eggert <eggert@twinsun.com>
10610 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10611 (mbrtowc, mbstate_t): Define substitutes if
10612 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10613 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10614 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10616 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10618 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10619 than 1024, return a memory chunk of least possible size, instead
10620 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10621 Use free/xmalloc instead of xrealloc to avoid copying for very long
10624 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10626 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10627 address, not strdup. Include <stdlib.h> and don't declare free().
10629 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10631 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10634 2000-06-21 Jim Meyering <meyering@lucent.com>
10636 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10637 (noinst_HEADERS): Add getstr.h.
10639 * getline.c (getstr): Move into a separate file.
10640 * getstr.c (getstr): New file, extracted from getline.c, with
10641 the following changes: new parameter, delim2; both delim[12]
10642 parameters have type `int', not `char'. The latter would lose
10643 with 8-bit delimiters.
10644 * getstr.h: New file.
10646 2000-06-19 Jim Meyering <meyering@lucent.com>
10648 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10650 2000-06-18 Jim Meyering <meyering@lucent.com>
10652 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10653 Besides, these days every porting target provides a mkdir function.
10655 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10656 (this snippet comes from src/system.h).
10658 2000-06-15 Paul Eggert <eggert@twinsun.com>
10660 * human.c (adjust_value): New function.
10661 (human_readable_inexact): Apply rounding style even when
10662 printing approximate values.
10664 2000-06-14 Paul Eggert <eggert@twinsun.com>
10666 * human.c (human_readable_inexact): Allow an input block
10667 size that is not a multiple of the output block size, and vice versa.
10668 Reported by Piergiorgio Sartor.
10670 2000-06-14 Paul Eggert <eggert@twinsun.com>
10672 * getdate.y (get_date): Apply relative times after time
10673 zone indicator, not before. Reported by Todd A. Jacobs.
10675 2000-06-13 Jim Meyering <meyering@lucent.com>
10677 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10679 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10681 2000-06-12 Paul Eggert <eggert@twinsun.com>
10683 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10685 2000-06-04 Paul Eggert <eggert@twinsun.com>
10687 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10689 2000-06-04 Jim Meyering <meyering@lucent.com>
10691 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10692 SunOS 4.1.4 for which gid_t is an unsigned type.
10694 2000-06-03 Jim Meyering <meyering@lucent.com>
10696 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10698 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10700 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10701 newer, don't install charset.alias.
10702 * config.charset: Change the Linux/glibc rules so they become empty
10703 on glibc-2.1 or newer.
10705 2000-06-02 Jim Meyering <meyering@lucent.com>
10707 * mountlist.c: Back out last change. Instead, do this...
10708 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10709 member using the same `ignore'-testing code.
10710 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10714 2000-05-29 Jim Meyering <meyering@lucent.com>
10716 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10717 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10719 2000-05-22 Jim Meyering <meyering@lucent.com>
10721 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10723 2000-05-18 Jim Meyering <meyering@lucent.com>
10725 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10726 back, too, since it may have been modified by allocate_entry.
10727 (hash_delete): Rewrite to use neither the assignment operator
10728 nor the comma operator in an if-expression.
10730 2000-05-15 Paul Eggert <eggert@twinsun.com>
10733 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10734 Remove; no longer needed.
10735 "quotearg.h": Add include.
10736 (file_name): Do not bother to explicitly initialize to NULL; it's less
10737 efficient on some hosts.
10738 (close_stdout_status): Remove test as to whether stdout was already
10739 closed; it breaks for the case "echo x | sort >&-".
10740 Quote file name colons.
10741 Do not assume that _("write error") lacks format strings.
10743 2000-05-15 Jim Meyering <meyering@lucent.com>
10745 * version-etc.c (version_etc_copyright): Update the copyright string
10746 used in all --version output.
10748 2000-05-14 Jim Meyering <meyering@lucent.com>
10750 * closeout.c (close_stdout_set_file_name): New function.
10751 (close_stdout_status): Use new file-scoped global.
10752 Return right away if fstat says the stdout file descriptor is invalid.
10753 * closeout.h (close_stdout_set_file_name): Declare.
10755 2000-05-10 Jim Meyering <meyering@lucent.com>
10757 * closeout.c [default_exit_status]: New file-scoped variable.
10758 (close_stdout_set_status): New function.
10759 * closeout.h (close_stdout_set_status): Declare.
10761 2000-05-08 Jim Meyering <meyering@lucent.com>
10763 * long-options.c: Don't include closeout.h.
10764 (parse_long_options): Don't call close_stdout for --version.
10766 2000-05-06 Jim Meyering <meyering@lucent.com>
10768 * strnlen.c: Undefine __strnlen and strnlen.
10769 [!weak_alias]: Define __strnlen to strnlen.
10771 * atexit.c: New file, from libiberty.
10773 2000-05-06 Jim Meyering <meyering@lucent.com>
10775 * closeout.c (close_stdout_status): Also check for errors on the
10778 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10780 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10781 instead of xmalloc, xrealloc, path_concat.
10782 (locale_charset): Treat empty environment variables as absent.
10783 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10785 2000-05-04 Jim Meyering <meyering@lucent.com>
10787 * getopt.c: Update from glibc.
10788 * obstack.c: Likewise.
10789 * obstack.h: Likewise.
10790 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10792 * regex.h: Likewise.
10793 * strndup.c: Likewise.
10794 * strnlen.c: New file, from glibc.
10796 2000-05-01 Jim Meyering <meyering@lucent.com>
10798 * full-write.c (full_write): Remove `FIXME' part of comment.
10800 2000-04-29 Jim Meyering <meyering@lucent.com>
10802 * path-concat.c: Declare strdup only if it's not defined.
10803 * canon-host.c: Likewise.
10805 2000-04-28 Jim Meyering <meyering@lucent.com>
10807 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10808 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10809 included first, then limits.h is included by locale.h by libintl.h.
10810 From John David Anglin.
10812 2000-04-25 Jim Meyering <meyering@lucent.com>
10814 * makepath.c (S_IRWXUGO): Define.
10815 (make_path): Always perform explicit chmod if MODE specifies any
10816 of the `special' permission bits. Prompted by a bug report against
10817 install from Mate Wierdl and Joost van Baal.
10819 2000-04-18 Jim Meyering <meyering@lucent.com>
10821 * README: New file.
10823 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10824 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10826 2000-04-17 Jim Meyering <meyering@lucent.com>
10828 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10829 the definition of it to rpl_strftime also defined-away the system's
10832 2000-04-15 Jim Meyering <meyering@lucent.com>
10834 Use `C' to denote so-called `contiguous' files, the same way
10836 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10837 (ftypelet): Use S_ISCTG.
10838 From Michael Deutschmann.
10840 2000-04-14 Jim Meyering <meyering@lucent.com>
10842 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10844 2000-04-08 Jim Meyering <meyering@lucent.com>
10846 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10847 names don't conflict. Reported by Eli Zaretskii.
10849 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10851 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10852 bug. Deal with the different error behavior of Irix iconv.
10854 2000-04-07 Jim Meyering <meyering@lucent.com>
10856 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10857 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10859 2000-04-05 Jim Meyering <meyering@lucent.com>
10861 Portability tweaks required for ultrix4.3.
10862 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10863 * readutmp.c: Include sys/types.h before sys/stat.h.
10864 * canon-host.c: Declare strdup.
10865 * path-concat.c: Likewise.
10866 From John David Anglin.
10868 2000-04-04 Jim Meyering <meyering@lucent.com>
10870 Be more DOS 8.3-friendly.
10871 * ref-add.sin: Renamed from ref-add.sed.in.
10872 * ref-del.sin: Renamed from ref-del.sed.in.
10873 * Makefile.am: Reflect renaming.
10874 Reported by Eli Zaretskii.
10876 Use a temporary file name that won't clash with `charset.alias'
10877 in the DOS 8.3 name space.
10878 * Makefile.am (charset_tmp): Define.
10879 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10880 (uninstall-local): Likewise.
10881 Reported by Eli Zaretskii.
10883 2000-03-29 Paul Eggert <eggert@twinsun.com>
10885 * time/strftime.c (my_strftime): Make sure we call the system
10886 strftime, not ourselves, when invoking the underlying strftime.
10888 2000-03-24 Jim Meyering <meyering@lucent.com>
10890 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10891 (charset_alias): Define.
10892 (install-exec-local): Factor out common code.
10893 (uninstall-local): Split lines longer than 80.
10894 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10895 (SUFFIXES): Define.
10896 (.sed.in.sed): New rule. Don't redirect directly to $@.
10897 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10899 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10901 * config.charset: Output a line containing "Packages using this file".
10902 * ref-add.sed.in, ref-del.sed.in: New files.
10903 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10904 ref-del.sed): New rules.
10906 2000-03-17 Jim Meyering <meyering@lucent.com>
10908 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10909 Otherwise, include <strings.h>
10911 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10913 * unicodeio.c (utf8_wctomb): New function.
10914 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10915 format instead of in UCS-4 with platform dependent endianness.
10917 2000-03-07 Paul Eggert <eggert@twinsun.com>
10919 * savedir.c (savedir): Work even if directory size is
10920 negative; this can happen with some screwy NFS configurations.
10922 2000-03-06 Jim Meyering <meyering@lucent.com>
10924 * localcharset.c (get_charset_aliases): Don't try to free file_name
10925 if it's NULL (because we ran out of memory). From Bruno Haible.
10927 2000-03-05 Jim Meyering <meyering@lucent.com>
10929 * localcharset.c ("path-concat.h"): Include.
10930 (get_charset_aliases): Use path_concat instead of ANSI string
10933 * unicodeio.h (PARAMS): Define.
10934 Use it to guard prototype.
10936 2000-03-04 Jim Meyering <meyering@lucent.com>
10938 * Makefile.am (install-exec-local): Create $(libdir) before installing
10940 (uninstall-local): Uncomment this rule so `make distcheck' works
10943 * unicodeio.c (<errno.h>): Include it.
10944 (errno): Declare if not defined.
10946 * localcharset.c: Add Bruno's comment justifying use of volatile.
10948 * config.charset: New version, incorporating remarks from a linux
10949 i18n mailing list. From Bruno Haible.
10951 2000-03-02 Jim Meyering <meyering@lucent.com>
10953 * Makefile.am (EXTRA_DIST): Add config.charset.
10955 2000-03-01 Jim Meyering <meyering@lucent.com>
10957 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10958 * unicodeio.c: Likewise.
10960 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10962 * config.charset: New file.
10963 * localcharset.c: New file.
10964 * unicodeio.h, unicodeio.c: New files.
10965 * Makefile.am (DEFS): Add -DLIBDIR=...
10966 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10967 (noinst_HEADERS): Add unicodeio.h.
10968 (all-local, install-exec-local, charset.alias): New targets.
10970 2000-02-28 Paul Eggert <eggert@twinsun.com>
10972 * quotearg.c (ALERT_CHAR): New macro.
10973 (quotearg_buffer_restyled): Use it.
10975 2000-02-27 Jim Meyering <meyering@lucent.com>
10977 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10978 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10980 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10981 not `#if STDC_HEADERS'.
10982 Declare malloc if needed.
10984 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10985 now that autoconf always defines the HAVE_DECL_ symbols.
10986 * human.c: Likewise.
10987 * same.c: Likewise.
10988 * strtoumax.c: Likewise.
10990 * backupfile.c: Arrange for cpp to fail if the configure-time
10991 declaration check was not run.
10992 * hash.c: Likewise.
10993 * human.c: Likewise.
10994 * same.c: Likewise.
10995 * strtoumax.c: Likewise.
10997 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10998 then first look up the entire `.'-containing string as a login name.
11000 2000-02-18 Paul Eggert <eggert@twinsun.com>
11002 * getdate.y: Handle two-digit years with leading zeros correctly.
11003 (textint): New typedef.
11004 (parser_control): Member year changed from int to textint.
11006 (YYSTYPE): Removed; replaced by %union with int and textint members.
11007 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
11008 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
11009 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
11010 (tSNUMBER, tUNUMBER): Now of type <textintval>.
11011 (date, number, to_year): Use width of number in digits, not its value,
11012 to determine whether it's a 2-digit year, or a 2-digit time.
11013 (yylex): Store number of digits of numeric tokens.
11014 Reported by John Kendall.
11016 (parser_control): Changed from struct parser_control to typedef (for
11017 consistency). All uses changed.
11019 (tID): Removed; not used.
11020 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
11022 2000-02-14 Paul Eggert <eggert@twinsun.com>
11024 * getpagesize.h (getpagesize): Port to VMS for Alpha;
11025 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
11027 2000-02-12 Jim Meyering <meyering@lucent.com>
11029 * userspec.c (ISDIGIT): Define it.
11030 (isdigit): Remove definition.
11031 (is_number): Use ISDIGIT, not isdigit.
11032 <libintl.h>: Include.
11033 (_ and N_): Define.
11034 (parse_user_spec): Mark translatable strings.
11036 2000-02-10 Jim Meyering <meyering@lucent.com>
11038 With these changes, nanosleep.[ch] are finally enough like the other
11039 lib/* replacement files to compile on a few more losing systems.
11041 * nanosleep.h: Don't include config.h.
11042 Remove prototype from declaration of nanosleep.
11043 (PARAMS): Remove now-unneeded definition.
11044 * nanosleep.c: #undef nanosleep.
11045 (rpl_nanosleep): Rename from nanosleep.
11047 2000-02-03 Jim Meyering <meyering@lucent.com>
11049 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
11050 rather than with `#if HAVE_UTMPNAME'.
11052 2000-02-01 Jim Meyering <meyering@lucent.com>
11054 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
11056 2000-01-31 Jim Meyering <meyering@lucent.com>
11058 * nanosleep.h (nanosleep): Guard declaration with
11059 `#if ! HAVE_DECL_NANOSLEEP'.
11060 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
11061 the declaration in that vendor's sys/timers.h.
11062 Reported by Christian Krackowizer.
11064 * quotearg.c (ISASCII): Add #undef and move definition to follow
11065 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
11066 (ISPRINT): Likewise.
11067 Reported by Tom Tromey.
11069 2000-01-30 Jim Meyering <meyering@lucent.com>
11071 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
11072 uses of ->ut_name. The latter doesn't work with new Linux header files
11073 where only utmpx.ut_user is declared.
11075 * readutmp.h (UT_USER): Define.
11077 2000-01-23 Jim Meyering <meyering@lucent.com>
11079 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
11082 2000-01-22 Jim Meyering <meyering@lucent.com>
11084 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
11085 [! HAVE_DECL_STRTOULL]: Declare strtoull.
11086 Required for some AIX systems. Reported by Christian Krackowizer.
11087 [TESTING] (main): New function.
11089 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
11090 * dirname.c (dir_name): Support for DOS-style file names with drive
11093 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
11095 * strverscmp.c (ISDIGIT): Define.
11096 (strverscmp): Use ISDIGIT, not isdigit.
11098 2000-01-17 Paul Eggert <eggert@twinsun.com>
11100 * nanosleep.c (nanosleep):
11101 Don't use SA_INTERRUPT to decide whether to call sigaction, as
11102 POSIX.1 doesn't require SA_INTERRUPT and some systems
11103 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
11104 it's been part of POSIX.1 since day 1 (in 1988).
11106 2000-01-17 Jim Meyering <meyering@lucent.com>
11108 * interlock: Remove unused file. Reported by François Pinard.
11110 2000-01-16 Paul Eggert <eggert@twinsun.com>
11112 * quotearg.c (quotearg_buffer_restyled): Do not quote
11113 alert, backslash, formfeed, and vertical tab unnecessarily in
11114 shell quoting style.
11117 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11118 Free Software Foundation, Inc.
11119 Copying and distribution of this file, with or without modification,
11120 are permitted provided the copyright notice and this notice are preserved.